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

Bug#429144: mkinitrd creates unusable initrd



Package: initramfs-tools
Version: 0.85e
Tag: patch

mkinitramfs creates a broken initrd, when accidentally the MODULES parameter is wrong in /etc/initramfs-tools/initramfs.conf.

This can create major problems, and it's not so easy to find the source of this problem

Compared to this, it's very easy to add the attached patch, which makes mkinitramfs check if the MODULES setting is useable and will not lead to an unusable initrd.

filet:~# diff /usr/sbin/mkinitramfs mkinitramfs
180,191c180,199
< if [ "${MODULES}" = "dep" ]; then
<       dep_add_modules
< fi
<
< if [ "${MODULES}" = "most" ]; then
<       auto_add_modules
< fi
<
< if [ "${MODULES}" = "netboot" ]; then
<       auto_add_modules base
<       auto_add_modules net
< fi
---
> case ${MODULES} in
>       dep)
>               dep_add_modules
>               ;;
>       most)
>               auto_add_modules
>               ;;
>       netboot)
>               auto_add_modules base
>               auto_add_modules net
>               ;;
>       list)
>               # do nothing
>               ;;
>       *)
>               echo "You chose an unsupported MODULES setting: ${MODULES}"
> echo "If you want to use only listed modules, chose 'list', or chose one of dep, most, netboot"
>               exit 1
>               ;;
> esac



Reply to: