Your message dated Fri, 27 Aug 2021 15:08:11 +0000
with message-id <e1mjdsl-0005lf...@fasolo.debian.org>
and subject line Bug#992915: fixed in grub 0.97-78
has caused the Debian Bug report #992915,
regarding grub-legacy: Removing kernel image fails: /usr/sbin/update-grub: line 
273: tempfile: command not found
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
992915: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=992915
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: grub-legacy
Severity: serious
Version: 0.97-77
Tags: patch
Control: affects -1 src:linux

Removing a kernel image fails as follows due to grub-legacy's
update-grub uses the deprecated and now removed tempfile utility:

Removing linux-image-5.10.0-6-amd64 (5.10.28-1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.10.0-6-amd64
/etc/kernel/postrm.d/zz-update-grub:
Searching for GRUB installation directory ... found: /boot/grub
/usr/sbin/update-grub: line 273: tempfile: command not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-5.10.0-6-amd64 (--remove):
 installed linux-image-5.10.0-6-amd64 package post-removal script subprocess 
returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-5.10.0-6-amd64
Processing was halted because there were too many errors.

This currently blocks all further apt activities.

The following patch seems to fix the issue:

--- /usr/sbin/update-grub~      2018-05-05 14:45:49.000000000 +0200
+++ /usr/sbin/update-grub       2021-08-25 00:26:21.527777990 +0200
@@ -270,7 +270,7 @@
 # Default options to use in a new config file. This will only be used if 
$menu_file
 # doesn't already exist. Only edit the lines between the two "EOF"s. The 
others are
 # part of the script.
-newtemplate=$(tempfile)
+newtemplate=$(mktemp)
 cat > "$newtemplate" <<EOF
 # $menu_file_basename - See: grub(8), info grub, update-grub(8)
 #            grub-install(8), grub-floppy(8),
@@ -637,7 +637,7 @@
 savedefault=$(GetMenuOpt "savedefault" "$savedefault")
 
 # Generate the menu options we want to insert
-buffer=$(tempfile)
+buffer=$(mktemp)
 echo $start >> $buffer
 echo "## lines between the AUTOMAGIC KERNELS LIST markers will be modified" >> 
$buffer
 echo "## by the debian update-grub script except for the default options 
below" >> $buffer
@@ -1034,7 +1034,7 @@
        fi
     else
        value="$1"
-       newmenu=$(tempfile)
+       newmenu=$(mktemp)
        sed -e "s/^[[:blank:]]*default[[:blank:]]*[[:digit:]]*\(.*\)/default    
     ${value}\1/;b" $menu > $newmenu
        cat $newmenu > $menu
        rm -f $newmenu

-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (600, 'testing'), (500, 'unstable-debug'), 
(500, 'buildd-unstable'), (110, 'experimental'), (1, 'experimental-debug'), (1, 
'buildd-experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-8-amd64 (SMP w/4 CPU threads)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages grub-legacy depends on:
ii  grub-common  2.04-20
ii  libc6-i386   2.31-17

grub-legacy recommends no packages.

Versions of packages grub-legacy suggests:
pn  grub-legacy-doc  <none>
pn  mdadm            <none>
ii  multiboot        0.6.96+20101113-3

-- no debconf information

--- End Message ---
--- Begin Message ---
Source: grub
Source-Version: 0.97-78
Done: Colin Watson <cjwat...@debian.org>

We believe that the bug you reported is fixed in the latest version of
grub, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 992...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Colin Watson <cjwat...@debian.org> (supplier of updated grub package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Fri, 27 Aug 2021 15:44:10 +0100
Source: grub
Architecture: source
Version: 0.97-78
Distribution: unstable
Urgency: medium
Maintainer: GRUB Maintainers <pkg-grub-de...@alioth-lists.debian.net>
Changed-By: Colin Watson <cjwat...@debian.org>
Closes: 992915
Changes:
 grub (0.97-78) unstable; urgency=medium
 .
   * Use mktemp rather than tempfile (closes: #992915).
Checksums-Sha1:
 d50a31a45a3bffb9de8e7c899d0df985b928cd32 2124 grub_0.97-78.dsc
 ff25a77c3c99e561d2b8d525fe4a13c48881f716 74472 grub_0.97-78.debian.tar.xz
 3818e9621f08c13c3fcc9dc5ec8be8beb072789b 6747 grub_0.97-78_source.buildinfo
Checksums-Sha256:
 b504a540f0e50dd925fec73e1931370d29eb1f851323a4abb0ba579eb5111a5f 2124 
grub_0.97-78.dsc
 79dc93d8b2462b15949017a938a85447deae1a19991d0fc773620e5f8214a49b 74472 
grub_0.97-78.debian.tar.xz
 5940d4234b5e3fbd6ca12f018a9a0abb6f11beb9bea2c5a4198e5e83fc935e33 6747 
grub_0.97-78_source.buildinfo
Files:
 7c31bf90867d03ca1af0336874112da9 2124 admin optional grub_0.97-78.dsc
 9b717ba26c31ecfa401f7ba509d7fdb9 74472 admin optional 
grub_0.97-78.debian.tar.xz
 d807a6435d9f6b76fd7f3490c5cbadeb 6747 admin optional 
grub_0.97-78_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEErApP8SYRtvzPAcEROTWH2X2GUAsFAmEo+lsACgkQOTWH2X2G
UAuRpQ//ZDt+LQ5URZ7WYZ34SeYFRgdC047zRiTcvvSn2icv8ztP4SIVOVN38xAi
qImEicfuwR47bFp4wrGeWcO2vS4RIuzRxSK4E76DT4D+kvnCl4MOafTCwRawXSdN
omFKFS/2zQ1sE72TWurBTU4yNur34chjtSKVwNhDQjzZxD30TVOX4gHnJSAwKwtc
CVoQYvmcVLqYxoVtUeA3vvAXonPdHZQq+F/BPx44lVlqjBof42d2luQ5cVYTs32v
4QtXGwmuZiP92WJ1KWf3KJyaPgCkGUB23+Zyw4yojiT+DSdZxhGIHBxBIFut6kvm
91I6UEjrsTP9Xyps8Z58eLi5awT2AiBiVQCE3L31c+LbNHTPrtPZ3bDhpxy7zEAk
HrK35EUPGrfvci+k368rdfCDYNmUjuu7TBz25kUz40gy37D3m+x12U8y2KsZ1BTU
a0O69y5+Z1RJ4feQ2Xt9DR5Yi+qAX0qdbA2zZCLs/vDfR3b6j7BfGQgDuxOplLOQ
3Mzrbk3oD5QfwExGL1MaNwhegteduWU+kScqPZ5OoKPV38DGjvl3tfxf68jQDvSl
TiOUqliCJ4rYkpozx5aRo1b6qpY3uQHMYt4MmW9BAXvFge8nEoZTsG9swL2Z1Oyl
Aj9hAnUf9yNEonLtqfDl10+om3UreEXVrcc+CjZ/DraFauJ35WA=
=any7
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to