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

Bug#847340: initramfs-tools: fails to copy DRM modules with plymouth, firmware-misc-nonfree 20161130-1, kernel 4.9~rc8



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

With these package versions:

linux-image-4.9.0-rc8-amd64-unsigned 4.9~rc8-1~exp1
firmware-misc-nonfree 20161130-1
plymouth 0.9.2-3+b1

and plymouth enabled, my initramfs fails to rebuild with exit status 1
from the plymouth hook.

Editing the plymouth hook to "set -x" reveals that two nvidia-related
graphics drivers (gm206 and gm200) both want to include
/lib/firmware/nvidia/gm200/gr/gpcss_bl.bin in the initramfs. The first
one copies successfully, but for the second, copy_file() returns 1,
causing unsuccessful exit from the manual_add_modules() function.

I attach a possible patch.

-- Package-specific info:
-- initramfs sizes
-rw-r--r-- 1 root root 27M Nov 25 22:54 /boot/initrd.img-3.16.0-4-amd64
-rw------- 1 root root 13M Jan 20  2016 /boot/initrd.img-4.3.0-1-amd64.dracut
-rw------- 1 root root 32M Jan 20  2016 /boot/initrd.img-4.3.0-1-amd64.dracut.full
-rw-r--r-- 1 root root 30M Jan 20  2016 /boot/initrd.img-4.3.0-1-amd64.i-t
-rw-r--r-- 1 root root 33M Nov 25 22:53 /boot/initrd.img-4.7.0-1-amd64
-rw-r--r-- 1 root root 33M Dec  2 16:03 /boot/initrd.img-4.8.0-2-amd64
-rw-r--r-- 1 root root 34M Dec  7 10:53 /boot/initrd.img-4.9.0-rc8-amd64
-- /proc/cmdline
BOOT_IMAGE=/vmlinuz-4.9.0-rc8-amd64 root=/dev/mapper/perpetual_ssd-root ro rootflags=subvol=@ apparmor=1 security=apparmor net.ifnames=1 quiet splash

-- resume
RESUME=/dev/mapper/perpetual_ssd-swap
-- /proc/filesystems
	btrfs
	fuseblk
	ext3
	ext2
	ext4
	vfat

-- lsmod
Module                  Size  Used by
cpuid                  16384  0
rfcomm                 77824  2
xt_CHECKSUM            16384  1
tun                    28672  1
ctr                    16384  6
ccm                    20480  3
nf_conntrack_netbios_ns    16384  2
nf_conntrack_broadcast    16384  1 nf_conntrack_netbios_ns
xt_CT                  16384  2
ipt_MASQUERADE         16384  4
nf_nat_masquerade_ipv4    16384  1 ipt_MASQUERADE
xt_tcpudp              16384  59
ip6t_rpfilter          16384  1
ip6t_REJECT            16384  2
nf_reject_ipv6         16384  1 ip6t_REJECT
ipt_REJECT             16384  4
nf_reject_ipv4         16384  1 ipt_REJECT
xt_conntrack           16384  60
ip_set                 45056  0
nfnetlink              16384  1 ip_set
ebtable_broute         16384  1
bridge                135168  1 ebtable_broute
stp                    16384  1 bridge
llc                    16384  2 bridge,stp
ebtable_nat            16384  1
ip6table_mangle        16384  1
ip6table_security      16384  1
ip6table_raw           16384  1
ip6table_nat           16384  1
nf_conntrack_ipv6      20480  32
nf_defrag_ipv6         36864  1 nf_conntrack_ipv6
nf_nat_ipv6            16384  1 ip6table_nat
iptable_mangle         16384  1
iptable_security       16384  1
iptable_raw            16384  1
iptable_nat            16384  1
nf_conntrack_ipv4      16384  32
nf_defrag_ipv4         16384  1 nf_conntrack_ipv4
nf_nat_ipv4            16384  1 iptable_nat
nf_nat                 28672  3 nf_nat_ipv6,nf_nat_masquerade_ipv4,nf_nat_ipv4
nf_conntrack          114688  10 nf_conntrack_ipv6,nf_conntrack_ipv4,nf_conntrack_broadcast,nf_conntrack_netbios_ns,xt_CT,nf_nat_ipv6,nf_nat_masquerade_ipv4,xt_conntrack,nf_nat_ipv4,nf_nat
ebtable_filter         16384  1
ebtables               36864  3 ebtable_filter,ebtable_nat,ebtable_broute
ip6table_filter        16384  1
ip6_tables             28672  5 ip6table_mangle,ip6table_filter,ip6table_security,ip6table_raw,ip6table_nat
iptable_filter         16384  1
cpufreq_userspace      16384  0
cpufreq_powersave      16384  0
cpufreq_conservative    16384  0
bnep                   20480  2
binfmt_misc            20480  1
nls_ascii              16384  1
nls_cp437              20480  1
vfat                   20480  1
fat                    69632  1 vfat
ext4                  581632  2
jbd2                  106496  1 ext4
fscrypto               28672  1 ext4
ecb                    16384  0
mbcache                16384  3 ext4
iTCO_wdt               16384  0
iTCO_vendor_support    16384  1 iTCO_wdt
intel_rapl             20480  0
x86_pkg_temp_thermal    16384  0
intel_powerclamp       16384  0
coretemp               16384  0
arc4                   16384  2
efi_pstore             16384  0
kvm_intel             192512  0
iwldvm                139264  0
kvm                   589824  1 kvm_intel
irqbypass              16384  1 kvm
joydev                 20480  0
mac80211              667648  1 iwldvm
pcspkr                 16384  0
serio_raw              16384  0
i2c_i801               24576  0
i2c_smbus              16384  1 i2c_i801
efivars                20480  1 efi_pstore
sg                     32768  0
snd_hda_codec_hdmi     45056  1
iwlwifi               147456  1 iwldvm
lpc_ich                24576  0
snd_hda_codec_conexant    24576  1
mfd_core               16384  1 lpc_ich
btusb                  45056  0
btrtl                  16384  1 btusb
btbcm                  16384  1 btusb
btintel                16384  1 btusb
snd_hda_codec_generic    69632  1 snd_hda_codec_conexant
bluetooth             552960  31 btrtl,btintel,bnep,btbcm,rfcomm,btusb
cfg80211              589824  3 iwlwifi,mac80211,iwldvm
crc16                  16384  2 bluetooth,ext4
snd_hda_intel          36864  9
snd_hda_codec         135168  4 snd_hda_intel,snd_hda_codec_conexant,snd_hda_codec_hdmi,snd_hda_codec_generic
snd_hda_core           81920  5 snd_hda_intel,snd_hda_codec_conexant,snd_hda_codec,snd_hda_codec_hdmi,snd_hda_codec_generic
shpchp                 36864  0
snd_hwdep              16384  1 snd_hda_codec
snd_pcm               110592  4 snd_hda_intel,snd_hda_codec,snd_hda_core,snd_hda_codec_hdmi
snd_timer              32768  1 snd_pcm
mei_me                 36864  0
mei                   102400  1 mei_me
thinkpad_acpi          86016  1
nvram                  16384  1 thinkpad_acpi
snd                    86016  27 snd_hda_intel,snd_hwdep,snd_hda_codec_conexant,snd_hda_codec,snd_timer,thinkpad_acpi,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_pcm
soundcore              16384  1 snd
rfkill                 24576  8 bluetooth,thinkpad_acpi,cfg80211
battery                16384  0
ac                     16384  0
evdev                  24576  19
tpm_tis                16384  0
tpm_tis_core           20480  1 tpm_tis
cuse                   16384  3
fuse                   98304  6 cuse
tpm_rng                16384  0
tpm                    45056  3 tpm_tis,tpm_rng,tpm_tis_core
rng_core               16384  2 tpm_rng
loop                   28672  0
parport_pc             28672  0
ppdev                  20480  0
lp                     20480  0
parport                49152  3 lp,parport_pc,ppdev
efivarfs               16384  1
ip_tables              24576  5 iptable_mangle,iptable_filter,iptable_raw,iptable_nat,iptable_security
x_tables               36864  19 ipt_REJECT,iptable_mangle,ip_tables,ip6t_rpfilter,ebtables,iptable_filter,xt_tcpudp,iptable_raw,ipt_MASQUERADE,ip6t_REJECT,iptable_security,ip6table_mangle,xt_CHECKSUM,ip6table_filter,ip6table_security,xt_CT,ip6table_raw,xt_conntrack,ip6_tables
autofs4                40960  2
btrfs                1060864  1
algif_skcipher         20480  0
af_alg                 16384  1 algif_skcipher
dm_crypt               24576  1
dm_mod                118784  14 dm_crypt
raid10                 49152  0
raid456               106496  0
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_xor,async_pq,raid456,async_memcpy,async_raid6_recov
xor                    24576  2 async_xor,btrfs
raid6_pq              110592  4 async_pq,btrfs,raid456,async_raid6_recov
libcrc32c              16384  1 raid456
crc32c_generic         16384  0
raid1                  36864  0
raid0                  20480  0
multipath              16384  0
linear                 16384  0
md_mod                131072  6 raid1,raid10,multipath,linear,raid0,raid456
sd_mod                 45056  4
crct10dif_pclmul       16384  0
crc32_pclmul           16384  0
crc32c_intel           24576  6
ghash_clmulni_intel    16384  0
aesni_intel           167936  9
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
cryptd                 24576  4 ablk_helper,ghash_clmulni_intel,aesni_intel
psmouse               135168  0
i915                 1232896  21
ahci                   36864  3
libahci                32768  1 ahci
libata                249856  2 ahci,libahci
scsi_mod              225280  3 sd_mod,libata,sg
xhci_pci               16384  0
ehci_pci               16384  0
xhci_hcd              188416  1 xhci_pci
ehci_hcd               81920  1 ehci_pci
usbcore               249856  5 ehci_hcd,xhci_pci,btusb,xhci_hcd,ehci_pci
i2c_algo_bit           16384  1 i915
sdhci_pci              28672  0
sdhci                  40960  1 sdhci_pci
drm_kms_helper        155648  1 i915
e1000e                245760  0
mmc_core              147456  2 sdhci,sdhci_pci
ptp                    20480  1 e1000e
drm                   360448  11 i915,drm_kms_helper
pps_core               16384  1 ptp
thermal                20480  0
wmi                    16384  0
fjes                   28672  0
video                  40960  2 thinkpad_acpi,i915
button                 16384  1 i915

-- /etc/initramfs-tools/modules
sd_mod

-- /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=auto
KEYMAP=n
COMPRESS=gzip
DEVICE=
NFSROOT=auto

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

-- /etc/crypttab
# <target name>	<source device>					<key file>	<options>
perpetual_msata	UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx	none	luks,discard,noauto
perpetual_ssd	UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx	none	luks,discard

-- /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
unused devices: <none>

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

/usr/share/initramfs-tools/hooks:
btrfs
cryptgnupg
cryptkeyctl
cryptopenct
cryptopensc
cryptpassdev
cryptroot
cryptroot-unlock
dmsetup
fsck
fuse
intel_microcode
keymap
klibc-utils
kmod
lvm2
mdadm
ntfs_3g
plymouth
resume
thermal
udev
zz-busybox


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

Kernel: Linux 4.9.0-rc8-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.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  initramfs-tools-core  0.125
ii  linux-base            4.5

initramfs-tools recommends no packages.

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

-- no debconf information
>From b16674a06d27c1a8109424a0262c32320b7ab5c5 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@debian.org>
Date: Wed, 7 Dec 2016 11:11:33 +0000
Subject: [PATCH] hook-functions: Ignore attempts to install the same firmware
 twice

The plymouth hook copies graphics drivers into the initramfs if enabled.
With recent linux and firmware-misc-nonfree, nouveau.ko expresses
dependencies on gm206/gr/gpccs_bl.bin and gm200/gr/gpcss_bl.bin, which
are symlinked together. initramfs-tools successfully copies the first,
but when it is time to copy the second, copy_file() returns 1 for
"already present". To avoid the whole hook failing, treat copy_file()
returning 1 as success.

Signed-off-by: Simon McVittie <smcv@debian.org>
---
 hook-functions | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/hook-functions b/hook-functions
index 9ef9c31..d71a276 100644
--- a/hook-functions
+++ b/hook-functions
@@ -98,11 +98,17 @@ manual_add_modules()
 				continue
 			fi
 
+			local e=0
+			# Ignore exit status 1 from copy_file, which means
+			# "already present"
 			if [ -e "/lib/firmware/${version}/${firmware}" ]; then
 				copy_file firmware \
-					"/lib/firmware/${version}/${firmware}"
+					"/lib/firmware/${version}/${firmware}" || e="$?"
 			else
-				copy_file firmware "/lib/firmware/${firmware}"
+				copy_file firmware "/lib/firmware/${firmware}" || e="$?"
+			fi
+			if [ $e -gt 1 ]; then
+				return $e
 			fi
 		done
 	done
-- 
2.11.0


Reply to: