[pkg-cryptsetup-devel] Bug#840477: cryptsetup: initramfs hook cryptroot fails if root is lvm and spans multiple devices/nodes

Cem Onyuksel cem.onyuksel at gmail.com
Tue Oct 11 21:49:54 UTC 2016


Package: cryptsetup
Version: 2:1.7.2-3
Severity: important

Dear Maintainer,

update-initramfs fails to add cryptsetup to the initramfs with the warning:
update-initramfs: Generating /boot/initrd.img-4.7.0-1-amd64
cryptsetup: WARNING: invalid line in /etc/crypttab for md0p3_cryptflash_crypt - 
cryptsetup: WARNING: invalid line in /etc/crypttab for md0p3_cryptflash_crypt -

On my system, the root filesystem spans two lvm nodes (because I'm using lvm caching and one is a raid array while the other is an SSD).
I looked into /usr/share/initramfs-tools/hooks/cryptroot and found the issue was caused by not putting a space between the devices when generating the list of nodes. I fixed the issue by putting a space in line 233 before $depnode in function get_lvm_deps():
    printf '%s' " $depnode"

I think this bug was probably introduced in version 2:1.7.2-1, possibly with the change:
  * debian/initramfs/cryptroot-hook: Avoid leading space in $rootdevs,
      $resumedevs, etc.

Thanks!
- Cem

-- Package-specific info:
-- /proc/cmdline
BOOT_IMAGE=/vmlinuz-4.7.0-1-amd64 root=/dev/mapper/sapphire--vg-root ro initrd=/install/initrd.gz quiet

-- /etc/crypttab
flash_crypt /dev/sde none luks
md0p3_crypt /dev/md0p3 none luks

-- /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> 				<mount point>   <type>  <options>       	<dump>  <pass>
/dev/mapper/sapphire--vg-root	 		/               ext4    errors=remount-ro 	0       1
# /boot was on /dev/md0p2 during installation
UUID=4cae8b54-da05-4826-9b13-feaaa3335eaf 	/boot           ext2    defaults        	0       2
/dev/mapper/sapphire--vg-home 			/home           ext4    defaults        	0       0
/dev/mapper/sapphire--vg-swap_1 		none            swap    sw              	0       0
/dev/mapper/sapphire--vg-vault 			/mnt/vault	ext4	defaults		0	0

-- lsmod
Module                  Size  Used by
nls_utf8               16384  1
cifs                  630784  2
sha256_ssse3           32768  0
cmac                   16384  0
md4                    16384  0
des_generic            24576  0
arc4                   16384  0
dns_resolver           16384  1 cifs
fscache                61440  1 cifs
binfmt_misc            20480  1
snd_hda_codec_hdmi     45056  1
nvidia_drm             45056  1
dm_cache_smq           24576  2
drm_kms_helper        147456  1 nvidia_drm
intel_rapl             20480  0
dm_cache               57344  3 dm_cache_smq
snd_hda_codec_realtek    86016  1
x86_pkg_temp_thermal    16384  0
dm_persistent_data     65536  1 dm_cache
intel_powerclamp       16384  0
snd_hda_codec_generic    69632  1 snd_hda_codec_realtek
drm                   364544  4 drm_kms_helper,nvidia_drm
iTCO_wdt               16384  0
dm_bio_prison          16384  1 dm_cache
iTCO_vendor_support    16384  1 iTCO_wdt
dm_bufio               28672  1 dm_persistent_data
snd_usb_audio         176128  0
snd_hda_intel          36864  5
kvm_intel             188416  0
nvidia_modeset        765952  5 nvidia_drm
lpc_ich                24576  0
snd_hda_codec         135168  4 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_intel
mei_me                 32768  0
snd_usbmidi_lib        28672  1 snd_usb_audio
snd_rawmidi            32768  1 snd_usbmidi_lib
snd_seq_device         16384  1 snd_rawmidi
kvm                   573440  1 kvm_intel
pcspkr                 16384  0
mfd_core               16384  1 lpc_ich
i2c_i801               20480  0
serio_raw              16384  0
irqbypass              16384  1 kvm
mei                    94208  1 mei_me
sg                     32768  0
snd_hda_core           81920  5 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel
snd_hwdep              16384  2 snd_usb_audio,snd_hda_codec
snd_soc_rt5640        118784  0
snd_soc_rl6231         16384  1 snd_soc_rt5640
shpchp                 36864  0
snd_soc_ssm4567        16384  0
snd_soc_core          208896  2 snd_soc_rt5640,snd_soc_ssm4567
snd_compress           20480  1 snd_soc_core
snd_pcm               110592  7 snd_soc_rt5640,snd_usb_audio,snd_soc_core,snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_hda_core
dw_dmac                16384  0
snd_soc_sst_acpi       16384  0
snd_timer              32768  1 snd_pcm
dw_dmac_core           24576  1 dw_dmac
battery                16384  0
snd                    81920  24 snd_hda_codec_realtek,snd_usb_audio,snd_soc_core,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_rawmidi,snd_hda_codec_generic,snd_usbmidi_lib,snd_hda_codec,snd_hda_intel,snd_seq_device,snd_compress
snd_soc_sst_match      16384  1 snd_soc_sst_acpi
elan_i2c               36864  0
soundcore              16384  1 snd
evdev                  24576  9
i2c_designware_platform    16384  0
i2c_designware_core    20480  1 i2c_designware_platform
acpi_pad               24576  0
tpm_tis                20480  0
tpm                    45056  1 tpm_tis
nvidia              11472896  67 nvidia_modeset
it87                   57344  0
hwmon_vid              16384  1 it87
coretemp               16384  0
parport_pc             28672  0
ppdev                  20480  0
lp                     20480  0
parport                49152  3 lp,ppdev,parport_pc
ip_tables              24576  0
x_tables               36864  1 ip_tables
autofs4                40960  2
ext4                  589824  4
ecb                    16384  0
crc16                  16384  1 ext4
jbd2                  106496  1 ext4
mbcache                16384  5 ext4
dm_crypt               24576  2
algif_skcipher         20480  0
af_alg                 16384  1 algif_skcipher
dm_mod                106496  39 dm_persistent_data,dm_cache,dm_bufio,dm_crypt
raid10                 45056  0
raid1                  36864  0
raid0                  20480  0
multipath              16384  0
linear                 16384  0
raid456               106496  1
async_raid6_recov      20480  1 raid456
async_memcpy           16384  2 raid456,async_raid6_recov
async_pq               16384  2 raid456,async_raid6_recov
async_xor              16384  3 async_pq,raid456,async_raid6_recov
async_tx               16384  5 async_pq,raid456,async_xor,async_memcpy,async_raid6_recov
xor                    24576  1 async_xor
hid_generic            16384  0
usbhid                 49152  0
raid6_pq              102400  3 async_pq,raid456,async_raid6_recov
libcrc32c              16384  2 raid456,dm_persistent_data
crc32c_generic         16384  0
md_mod                131072  9 raid456,raid0,raid1,multipath,linear,raid10
sd_mod                 45056  9
crct10dif_pclmul       16384  0
crc32_pclmul           16384  0
crc32c_intel           24576  1
ghash_clmulni_intel    16384  0
mxm_wmi                16384  0
jitterentropy_rng      16384  0
hmac                   16384  3
drbg                   24576  1
ansi_cprng             16384  0
ahci                   36864  5
libahci                32768  1 ahci
aesni_intel           167936  6
xhci_pci               16384  0
xhci_hcd              172032  1 xhci_pci
libata                245760  2 ahci,libahci
ehci_pci               16384  0
ehci_hcd               77824  1 ehci_pci
aes_x86_64             20480  1 aesni_intel
lrw                    16384  1 aesni_intel
gf128mul               16384  1 lrw
glue_helper            16384  1 aesni_intel
ablk_helper            16384  1 aesni_intel
usbcore               241664  7 snd_usb_audio,snd_usbmidi_lib,ehci_hcd,ehci_pci,usbhid,xhci_hcd,xhci_pci
cryptd                 20480  5 ghash_clmulni_intel,aesni_intel,ablk_helper
psmouse               126976  0
scsi_mod              225280  3 sg,libata,sd_mod
alx                    36864  0
mdio                   16384  1 alx
usb_common             16384  1 usbcore
fan                    16384  0
thermal                20480  0
sdhci_acpi             16384  0
sdhci                  40960  1 sdhci_acpi
mmc_core              139264  2 sdhci,sdhci_acpi
wmi                    16384  1 mxm_wmi
video                  40960  0
i2c_hid                20480  0
hid                   118784  3 i2c_hid,hid_generic,usbhid
fjes                   28672  0
button                 16384  0


-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

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

Versions of packages cryptsetup depends on:
ii  cryptsetup-bin         2:1.7.2-3
ii  debconf [debconf-2.0]  1.5.59
ii  dmsetup                2:1.02.133-1
ii  libc6                  2.24-3

Versions of packages cryptsetup recommends:
ii  busybox                                 1:1.22.0-19
ii  console-setup                           1.151
ii  initramfs-tools [linux-initramfs-tool]  0.125
ii  kbd                                     2.0.3-2

Versions of packages cryptsetup suggests:
ii  dosfstools              4.0-2
ii  keyutils                1.5.9-9
ii  liblocale-gettext-perl  1.07-3+b1

-- Configuration Files:
/etc/cryptsetup-initramfs/conf-hook changed:
CRYPTSETUP=y


-- debconf information:
* cryptsetup/prerm_active_mappings: false



More information about the pkg-cryptsetup-devel mailing list