Bug#845967: initramfs-tools: Don't print warning if /etc/modprobe.d is empty
Source: initramfs-tools
Version: 0.125
Severity: wishlist
Tags: patch
Hi,
If /etc/modprobe.d is empty, we print a warning that might be misleading
to users:
[…]
update-initramfs: Generating /boot/initrd.img-4.8.0-1-amd64
cp: cannot stat '/etc/modprobe.d/*': No such file or directory
Setting up linux-image-amd64 (4.8+76) ...
[…]
Patch attached.
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` lamby@debian.org / chris-lamb.co.uk
`-
diff --git a/mkinitramfs b/mkinitramfs
index 27349ea..f1a05ac 100755
--- a/mkinitramfs
+++ b/mkinitramfs
@@ -303,7 +303,9 @@ ln -s /proc/mounts "${DESTDIR}/etc/mtab"
copy_exec /sbin/modprobe /sbin
copy_exec /sbin/rmmod /sbin
mkdir -p "${DESTDIR}/etc/modprobe.d"
-cp -a /etc/modprobe.d/* "${DESTDIR}/etc/modprobe.d/"
+if ls /etc/modprobe.d/* >/dev/null 2>&1; then
+ cp -a /etc/modprobe.d/* "${DESTDIR}/etc/modprobe.d/"
+fi
# workaround: libgcc always needed on old-abi arm
if [ "$DPKG_ARCH" = arm ] || [ "$DPKG_ARCH" = armeb ]; then
Reply to: