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

Bug#807004: initramfs-tools: Breaks when installing kdump-tools with bcache rootfs



Package: initramfs-tools
Version: 0.120
Severity: important
Tags: patch

I have /dev/bcache0 as my rootfs. When upgrading kdump-tools, the
postinst fails because /etc/kernel/postinst.d/kdump-tools returns an
error. When I run this manually, I get:

kdump-tools: Generating /var/lib/kdump/initrd.img-4.2.0-1-amd64
mkinitramfs: for device /dev/bcache0 missing bcache /sys/block/ entry
mkinitramfs: workaround is MODULES=most
mkinitramfs: Error please report the bug

The "missing bcache /sys/block/ entry" message comes from
dep_add_modules_mount in /usr/share/initramfs-tools/hook-functions

The problem is that the "classical block device" case strips the numeric
suffix from the device name, but this is needed for the entry in
/sys/block.

The attached patch fixes the problem, although I don't know if it's the
best way to solve it.

-- Package-specific info:
-- initramfs sizes
-rw-r--r-- 1 root root 18M Dec  3 17:06 /boot/initrd.img-4.2.0-1-amd64
-- /proc/cmdline
BOOT_IMAGE=/vmlinuz-4.2.0-1-amd64 root=UUID=8e8ffc83-7eb2-4f54-8119-aafad05e1921 ro cgroup_enable=memory crashkernel=256M resume=UUID=752ca093-5231-4349-afc1-e63c1b549954 quiet

-- resume
RESUME=UUID=19307990-fe33-4596-ad78-2ba36dff42ba
-- /proc/filesystems
	ext3
	ext2
	ext4
	vfat
	fuseblk
	xfs
	jfs
	msdos
	ntfs
	minix
	hfs
	hfsplus
	qnx4
	ufs
	btrfs

-- lsmod
Module                  Size  Used by
cfg80211              532480  0
nfnetlink_queue        20480  0
nfnetlink_log          20480  0
nfnetlink              16384  2 nfnetlink_log,nfnetlink_queue
bluetooth             499712  0
btrfs                 933888  0
xor                    24576  1 btrfs
raid6_pq              102400  1 btrfs
ufs                    77824  0
qnx4                   16384  0
hfsplus               102400  0
hfs                    53248  0
minix                  36864  0
ntfs                  200704  0
msdos                  20480  0
jfs                   176128  0
xfs                   913408  0
libcrc32c              16384  1 xfs
dm_mod                106496  0
cpuid                  16384  0
fuse                   94208  3
xt_addrtype            16384  2
br_netfilter           24576  0
overlay                45056  0
xt_multiport           16384  1
xt_CHECKSUM            16384  1
iptable_mangle         16384  1
ipt_MASQUERADE         16384  4
nf_nat_masquerade_ipv4    16384  1 ipt_MASQUERADE
iptable_nat            16384  1
nf_nat_ipv4            16384  1 iptable_nat
nf_nat                 24576  2 nf_nat_ipv4,nf_nat_masquerade_ipv4
nf_conntrack_ipv4      20480  3
nf_defrag_ipv4         16384  1 nf_conntrack_ipv4
xt_conntrack           16384  2
nf_conntrack          110592  5 nf_nat,nf_nat_ipv4,xt_conntrack,nf_nat_masquerade_ipv4,nf_conntrack_ipv4
ipt_REJECT             16384  2
nf_reject_ipv4         16384  1 ipt_REJECT
xt_tcpudp              16384  6
tun                    28672  1
bridge                110592  1 br_netfilter
stp                    16384  1 bridge
llc                    16384  2 stp,bridge
ebtable_filter         16384  0
ebtables               36864  1 ebtable_filter
ip6table_filter        16384  0
ip6_tables             28672  1 ip6table_filter
iptable_filter         16384  1
ip_tables              28672  3 iptable_filter,iptable_mangle,iptable_nat
x_tables               36864  13 ip6table_filter,xt_CHECKSUM,ip_tables,xt_tcpudp,ipt_MASQUERADE,xt_conntrack,xt_multiport,iptable_filter,ebtables,ipt_REJECT,iptable_mangle,ip6_tables,xt_addrtype
binfmt_misc            20480  1
nfsd                  282624  2
auth_rpcgss            57344  1 nfsd
oid_registry           16384  1 auth_rpcgss
nfs_acl                16384  1 nfsd
nfs                   249856  0
lockd                  90112  2 nfs,nfsd
grace                  16384  2 nfsd,lockd
fscache                61440  1 nfs
sunrpc                327680  6 nfs,nfsd,auth_rpcgss,lockd,nfs_acl
nls_utf8               16384  1
nls_cp437              20480  1
vfat                   20480  1
fat                    69632  2 vfat,msdos
x86_pkg_temp_thermal    16384  0
intel_powerclamp       16384  0
kvm_intel             163840  0
kvm                   495616  1 kvm_intel
crct10dif_pclmul       16384  0
crc32_pclmul           16384  0
amdkfd                118784  1
radeon               1499136  8
sha256_ssse3           28672  1
sha256_generic         24576  1 sha256_ssse3
hmac                   16384  1
drbg                   24576  1
ansi_cprng             16384  0
eeepc_wmi              16384  0
asus_wmi               28672  1 eeepc_wmi
aesni_intel           167936  0
sparse_keymap          16384  1 asus_wmi
ttm                    94208  1 radeon
rfkill                 24576  5 cfg80211,bluetooth,asus_wmi
snd_hda_codec_realtek    86016  1
aes_x86_64             20480  1 aesni_intel
iTCO_wdt               16384  0
lrw                    16384  1 aesni_intel
drm_kms_helper        126976  1 radeon
iTCO_vendor_support    16384  1 iTCO_wdt
video                  36864  1 asus_wmi
mxm_wmi                16384  0
snd_hda_codec_generic    73728  1 snd_hda_codec_realtek
joydev                 20480  0
snd_hda_codec_hdmi     49152  1
gf128mul               16384  1 lrw
glue_helper            16384  1 aesni_intel
ablk_helper            16384  1 aesni_intel
drm                   352256  39 ttm,drm_kms_helper,radeon
cryptd                 20480  2 aesni_intel,ablk_helper
snd_hda_intel          36864  10
i2c_algo_bit           16384  1 radeon
snd_hda_codec         131072  4 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_intel
snd_hda_core           65536  5 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel
efi_pstore             16384  1
evdev                  20480  23
snd_hwdep              16384  1 snd_hda_codec
snd_pcm               102400  4 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_hda_core
snd_timer              32768  1 snd_pcm
psmouse               122880  0
sb_edac                28672  0
snd                    86016  28 snd_hda_codec_realtek,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel
mei_me                 24576  0
pcspkr                 16384  0
lpc_ich                24576  0
serio_raw              16384  0
efivars                20480  1 efi_pstore
edac_core              57344  1 sb_edac
sg                     32768  0
soundcore              16384  1 snd
i2c_i801               20480  0
mei                    86016  1 mei_me
mfd_core               16384  1 lpc_ich
shpchp                 36864  0
8250_fintek            16384  0
wmi                    20480  2 mxm_wmi,asus_wmi
tpm_infineon           20480  0
processor              36864  0
tpm_tis                20480  0
thermal_sys            49152  4 video,intel_powerclamp,processor,x86_pkg_temp_thermal
tpm                    40960  2 tpm_tis,tpm_infineon
button                 16384  0
nct6775                57344  0
hwmon_vid              16384  1 nct6775
coretemp               16384  0
parport_pc             28672  0
ppdev                  20480  0
lp                     20480  0
parport                49152  3 lp,ppdev,parport_pc
efivarfs               16384  1
autofs4                40960  2
ext4                  573440  2
crc16                  16384  2 ext4,bluetooth
mbcache                20480  1 ext4
jbd2                  102400  1 ext4
bcache                221184  4
hid_generic            16384  0
uas                    24576  0
usbhid                 49152  0
usb_storage            69632  1 uas
hid                   114688  2 hid_generic,usbhid
sr_mod                 24576  0
cdrom                  57344  1 sr_mod
sd_mod                 40960  6
crc32c_intel           24576  2
ahci                   36864  5
libahci                32768  1 ahci
xhci_pci               16384  0
libata                233472  2 ahci,libahci
ehci_pci               16384  0
r8169                  77824  0
xhci_hcd              167936  1 xhci_pci
ehci_hcd               77824  1 ehci_pci
mii                    16384  1 r8169
scsi_mod              225280  6 sg,uas,usb_storage,libata,sd_mod,sr_mod
usbcore               233472  7 uas,usb_storage,ehci_hcd,ehci_pci,usbhid,xhci_hcd,xhci_pci
usb_common             16384  1 usbcore

-- /etc/initramfs-tools/modules
bcache

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

-- /etc/initramfs-tools/initramfs.conf
MODULES=most
BUSYBOX=y
KEYMAP=n
COMPRESS=gzip
DEVICE=
NFSROOT=auto

-- /etc/initramfs-tools/update-initramfs.conf
update_initramfs=yes
backup_initramfs=no

-- mkinitramfs hooks
/etc/initramfs-tools/hooks/:

/usr/share/initramfs-tools/hooks:
amd64_microcode
bcache
busybox
dmsetup
fsck
fuse
intel_microcode
keymap
klibc
kmod
lvm2
ntfs_3g
resume
thermal
udev
zz-busybox


-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (700, 'testing'), (600, 'unstable'), (500, 'testing-updates'), (500, 'testing-proposed-updates'), (500, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.2.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_CA.utf8, LC_CTYPE=en_CA.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages initramfs-tools depends on:
ii  busybox      1:1.22.0-15
ii  cpio         2.11+dfsg-4.1
ii  klibc-utils  2.0.4-4
ii  kmod         21-1
ii  udev         228-2

Versions of packages initramfs-tools recommends:
ii  busybox  1:1.22.0-15

Versions of packages initramfs-tools suggests:
ii  bash-completion  1:2.1-4.2

-- no debconf information
--- a/usr/share/initramfs-tools/hook-functions	2015-12-03 17:10:50.307611770 -0700
+++ b/usr/share/initramfs-tools/hook-functions	2015-12-03 17:10:56.803554575 -0700
@@ -434,6 +434,9 @@
 		block=${dev_node#/dev/i2o/}
 		block=${block%%[0-9]*}
 		block='i2o!'$block
+	# bcache device
+	elif [ "${dev_node#/dev/bcache}" != "${dev_node}" ]; then
+		block=${dev_node#/dev/}
 	# classical block device
 	else
 		block=${dev_node#/dev/}

Reply to: