[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#499270: initramfs-tools: postrm.d/update-initramfs breaks removal of old kernel



Package: initramfs-tools
Version: 0.92k
Severity: serious
Justification: forbid removal of other packages

  Hi,

  I upgraded initramfs-tools then I tried to remove an old kernel package
(package from the Debian Kernel Team repo). I got an error:

eyak:/home/vdanjean# dpkg --purge linux-image-2.6.27-rc3-amd64
(Lecture de la base de données... 192887 fichiers et répertoires déjà installés.)
Suppression de linux-image-2.6.27-rc3-amd64 ...
Purge des fichiers de configuration de linux-image-2.6.27-rc3-amd64 ...
Running postrm hook script /usr/sbin/update-grub.
Updating /boot/grub/grub.cfg ...
Found Debian background: debian-blueish-wallpaper-640x480.png
Found linux image: /boot/vmlinuz-2.6.27-rc6-amd64
Found initrd image: /boot/initrd.img-2.6.27-rc6-amd64
Found linux image: /boot/vmlinuz-2.6.27-rc5-amd64
Found initrd image: /boot/initrd.img-2.6.27-rc5-amd64
Found linux image: /boot/vmlinuz-2.6.27-rc4-amd64
Found initrd image: /boot/initrd.img-2.6.27-rc4-amd64
Found linux image: /boot/vmlinuz-2.6.26-1-amd64
Found initrd image: /boot/initrd.img-2.6.26-1-amd64
done
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/update-initramfs
Cannot delete /boot/initrd.img-2.6.27-rc3-amd64, doesn't exist.
run-parts: /etc/kernel/postrm.d/update-initramfs exited with return code 1
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-2.6.27-rc3-amd64.postrm line 331.
dpkg : erreur de traitement de linux-image-2.6.27-rc3-amd64 (--purge) :
 le sous-processus post-removal script a retourné une erreur de sortie d'état 2
Des erreurs ont été rencontrées pendant l'exécution :
 linux-image-2.6.27-rc3-amd64
eyak:/home/vdanjean#

This is due to the fact that:
* linux-image-* postrm script removes /boot/initrd.img-... files
  Even if it should not, you cannot change already installed postrm files
  of all (locally or official) kernel debian package. This is why I report
  this bug against initramfs-tool and not linux-2.6
* linux-image-* postrm script calls /etc/kernel/postrm.d/update-initramfs
  (with the help of run-parts)
* /etc/kernel/postrm.d/update-initramfs runs "update-initramfs -d -k $KVER"
  that returns an error (even if "set -e" is not there, this is the last
  command of this script):
eyak:/home/vdanjean# update-initramfs -d -k 2.6.27-rc3-amd64 ; echo $?
Cannot delete /boot/initrd.img-2.6.27-rc3-amd64, doesn't exist.
1
eyak:/home/vdanjean#

  So, somthing must be done. /etc/kernel/postrm.d/update-initramfs must not
return an error when /boot/initrd.img-* is not present (even if it is not
removed in the linux-image-* postrm: the sysadmin can have (re)moved it)

  Regards,
    Vincent

PS: as a workaround, I added "true" in /etc/kernel/postrm.d/update-initramfs
on the last line. But it not really a fix since I now ignore any update-initramfs
error.

-- Package-specific info:
-- /proc/cmdline
BOOT_IMAGE=/vmlinuz-2.6.26-1-amd64 root=/dev/mapper/eyak-root ro

-- /proc/filesystems
	ext3
	udf
	iso9660

-- lsmod
Module                  Size  Used by
microcode              15160  0 
iwl4965               107208  0 
usbhid                 45792  0 
hid                    41792  1 usbhid
ff_memless              9224  1 usbhid
usblp                  16896  0 
aes_x86_64             12416  2 
aes_generic            32552  1 aes_x86_64
xts                     7680  1 
gf128mul               12800  1 xts
tun                    14084  1 
nls_utf8                6272  0 
isofs                  35880  0 
zlib_inflate           18944  1 isofs
udf                    75944  0 
nls_base               12932  3 nls_utf8,isofs,udf
crc_itu_t               6528  1 udf
i915                   35072  1 
drm                    91488  2 i915
rfcomm                 38176  0 
l2cap                  23936  5 rfcomm
kvm_intel              39776  0 
kvm                   127464  1 kvm_intel
ppdev                  11656  0 
parport_pc             31016  0 
lp                     14724  0 
parport                41776  3 ppdev,parport_pc,lp
ipv6                  288328  32 
acpi_cpufreq           11792  1 
cpufreq_conservative    11784  0 
cpufreq_stats           9120  0 
cpufreq_ondemand       11792  1 
cpufreq_userspace       8452  0 
cpufreq_powersave       6400  0 
freq_table              9344  3 acpi_cpufreq,cpufreq_stats,cpufreq_ondemand
dm_crypt               17032  1 
coretemp               11008  0 
loop                   19468  0 
joydev                 14848  0 
arc4                    6272  2 
ecb                     7296  2 
crypto_blkcipher       21636  4 xts,dm_crypt,ecb
pcmcia                 38680  0 
iwlcore                31360  1 iwl4965
firmware_class         12544  3 microcode,iwl4965,pcmcia
rfkill                 11168  2 iwlcore
snd_hda_intel         434776  1 
mac80211              162864  2 iwl4965,iwlcore
led_class               8968  1 iwlcore
snd_pcm_oss            41760  0 
snd_mixer_oss          18816  1 snd_pcm_oss
snd_pcm                81800  2 snd_hda_intel,snd_pcm_oss
snd_timer              25744  1 snd_pcm
yenta_socket           27916  1 
rsrc_nonstatic         14080  1 yenta_socket
psmouse                42268  0 
snd                    63688  7 snd_hda_intel,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer
cfg80211               30224  2 iwl4965,mac80211
iTCO_wdt               15696  0 
i2c_i801               13596  0 
soundcore              12064  1 snd
pcmcia_core            41508  3 pcmcia,yenta_socket,rsrc_nonstatic
pcspkr                  7040  0 
serio_raw               9860  0 
i2c_core               27936  1 i2c_i801
hci_usb                18460  2 
snd_page_alloc         13072  2 snd_hda_intel,snd_pcm
bay                     9216  0 
bluetooth              57124  7 rfcomm,l2cap,hci_usb
video                  24084  0 
output                  7808  1 video
wmi                    11712  0 
ac                      9352  0 
button                 11680  0 
battery                16904  0 
intel_agp              31728  1 
evdev                  14208  11 
dcdbas                 11952  0 
ext3                  124688  7 
jbd                    51240  1 ext3
mbcache                12804  1 ext3
dm_mirror              20608  0 
dm_log                 13956  1 dm_mirror
dm_snapshot            19400  0 
dm_mod                 58864  19 dm_crypt,dm_mirror,dm_log,dm_snapshot
sd_mod                 29376  4 
ide_cd_mod             36360  0 
cdrom                  37928  1 ide_cd_mod
ide_pci_generic         9220  0 [permanent]
piix                   12424  0 [permanent]
ide_core              128284  3 ide_cd_mod,ide_pci_generic,piix
ata_piix               22660  3 
ohci1394               32564  0 
ieee1394               93816  1 ohci1394
ata_generic            10116  0 
libata                165472  2 ata_piix,ata_generic
scsi_mod              160760  2 sd_mod,libata
tg3                    97156  0 
ehci_hcd               36108  0 
uhci_hcd               25760  0 
dock                   14112  2 bay,libata
thermal                22688  0 
processor              42304  4 acpi_cpufreq,thermal
fan                     9352  0 
thermal_sys            17728  4 video,thermal,processor,fan

-- /etc/kernel-img.conf
# Kernel image management overrides
# See kernel-img.conf(5) for details
do_symlinks = yes
relative_links = yes
do_bootloader = no
do_bootfloppy = no
do_initrd = yes
link_in_boot = no
postinst_hook = update-grub
postrm_hook   = update-grub

-- /etc/initramfs-tools/initramfs.conf
MODULES=most
BUSYBOX=y
KEYMAP=n
BOOT=local
DEVICE=eth0
NFSROOT=auto

-- /etc/crypttab
# <target name>	<source device>		<key file>	<options>
decrypt-private	/dev/mapper/eyak-private	none	luks,checkargs=ext3,noauto


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages initramfs-tools depends on:
ii  cpio                          2.9-13     GNU cpio -- a program to manage ar
ii  findutils                     4.4.0-2    utilities for finding files--find,
ii  klibc-utils                   1.5.12-2   small utilities built with klibc f
ii  module-init-tools             3.4-1      tools for managing Linux kernel mo
ii  udev                          0.125-6    /dev/ and hotplug management daemo

Versions of packages initramfs-tools recommends:
ii  busybox                       1:1.10.2-2 Tiny utilities for small and embed

initramfs-tools suggests no packages.

-- no debconf information



Reply to: