Bug#588331: grub-pc: fails to clean up /boot/grub/ in postrm during purge

Fabian Greffrath fabian at greffrath.com
Wed Jul 7 12:35:04 UTC 2010


Package: grub-pc
Version: 1.98+20100706-1
Severity: normal
Tags: patch

Hi,

when grub-pc is completely removed via dpkg --purge grub-pc, it asks wether
/boot/grub should also be cleaned via a debconf question. However, it fails to
do so even if the answer to this question is "yes".

The reason is, that in grub-pc.postrm the debconf question brought up via
db_input is grub-pc/postrm_purge_boot_grub, while the answer is queried via
db_get from grub-pc/purge_boot_grub. However, this debconf template does not
exist and thus the $RET value, which is checked before deleting the contents of
/boot/grub, cannot be "true". The attached patch fixes this to read the answer
from the right debconf template.

Cheers,
Fabian



-- Package-specific info:

*********************** BEGIN /proc/mounts
/dev/disk/by-uuid/e6445315-c5bf-4e2c-b011-3ed84748fd53 / ext3 rw,relatime,errors=remount-ro,data=ordered 0 0
/dev/sda6 /home ext3 rw,relatime,errors=continue,data=ordered 0 0
*********************** END /proc/mounts

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (501, 'unstable'), (101, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/1 CPU core)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages grub-pc depends on:
ii  debconf [debconf-2.0]    1.5.32          Debian configuration management sy
ii  grub-common              1.98+20100706-1 GRand Unified Bootloader, version 
ii  libc6                    2.11.2-2        Embedded GNU C Library: Shared lib
ii  libdevmapper1.02.1       2:1.02.48-2     The Linux Kernel Device Mapper use
ii  ucf                      3.0025          Update Configuration File: preserv

grub-pc recommends no packages.

Versions of packages grub-pc suggests:
ii  desktop-base                  5.0.5      common files for the Debian Deskto

-- debconf information:
  grub2/kfreebsd_cmdline:
  grub2/device_map_regenerated:
* grub2/linux_cmdline:
* grub-pc/install_devices_empty: true
  grub-pc/install_devices_failed: false
  grub-pc/chainload_from_menu.lst: true
  grub-pc/kopt_extracted: false
* grub-pc/install_devices:
  grub-pc/postrm_purge_boot_grub: false
  grub-pc/install_devices_failed_upgrade: true
  grub-pc/disk_description:
  grub2/kfreebsd_cmdline_default: quiet
  grub-pc/partition_description:
  grub-pc/install_devices_disks_changed:
  grub2/linux_cmdline_default: quiet
  grub-pc/mixed_legacy_and_grub2: true
-------------- next part --------------
--- grub2-1.98+20100706.orig/debian/postrm.in
+++ grub2-1.98+20100706/debian/postrm.in
@@ -21,7 +21,7 @@ case "$1" in
 
         db_input high grub-pc/postrm_purge_boot_grub || true
         db_go || true
-        db_get grub-pc/purge_boot_grub || true
+        db_get grub-pc/postrm_purge_boot_grub || true
         if [ "$RET" = "true" ] ; then
           rm -f /boot/grub/{grub.cfg,ascii.pf2,unicode.pf2,moreblue-orbit-grub.png,*.mod,*.lst,*.img,efiemu32.o,efiemu64.o} || true
           rmdir --ignore-fail-on-non-empty /boot/grub || true


More information about the Pkg-grub-devel mailing list