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

Bug#409995: mkinitramfs silently fails to create bootable initrd when PATH lacks /sbin

Package: initramfs-tools
Version: 0.85e

uname:  Linux hpde 2.6.18-3-amd64 #1 SMP Mon Dec 4 17:04:37 CET 2006
x86_64 GNU/Linux

When building my own kernel and running mkinitramfs manually as a
non-root user, I ran:

$ /usr/sbin/mkinitramfs -o initrd.img-2.6.18-3-telco-amd64

The command completes with no apparent errors but produces an initrd.img
file with no modules and the resulting boot fails.  The problem occurs
in manual_add_modules in /usr/share/initramfs-tools/hook-functions:

        for mam_x in $(modprobe --set-version="${version}"
--ignore-install \
        --show-depends "${1}" 2>/dev/null | awk '/^insmod/ { print
$2 }'); do

The modprobe invocation fails (" -bash: modprobe: command not found"
when I try it from a shell prompt) because /sbin is not in my path, but
the error message is suppressed by the "2>/dev/null" and the loop just
doesn't process any modules.  I saw this my adding "set -x" to
mkinitramfs and comparing my bad run as a user to a successful run as

(perhaps related to #409243, "fails to boot"?)

Perhaps the command could set its own path, or use full paths for
commands to make this a little more idiot-proof.

Bob Montgomery

Reply to: