From: Harald Hoyer Date: Mon, 18 Feb 2013 10:57:20 +0000 (+0100) Subject: dracut: enable initramfs building without kernel modules X-Git-Tag: 026~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5db6ca5a4bff765234ef3236a2ec8df70ceee3ae;p=thirdparty%2Fdracut-ng.git dracut: enable initramfs building without kernel modules --- diff --git a/dracut-functions.sh b/dracut-functions.sh index f7e3ec808..a2f366cdb 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -1499,13 +1499,16 @@ module_is_host_only() ( find_kernel_modules_by_path () ( local _OLDIFS - _OLDIFS=$IFS - IFS=: - while read a rest; do - [[ $a = */$1/* ]] || continue - echo $srcmods/$a - done < $srcmods/modules.dep - IFS=$_OLDIFS + + [[ -f $srcmods/modules.dep ]] || return 0 + + _OLDIFS=$IFS + IFS=: + while read a rest; do + [[ $a = */$1/* ]] || continue + echo $srcmods/$a + done < $srcmods/modules.dep + IFS=$_OLDIFS return 0 ) diff --git a/dracut.sh b/dracut.sh index e4c704392..4d17e4de8 100755 --- a/dracut.sh +++ b/dracut.sh @@ -689,10 +689,11 @@ esac abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile" -[[ -f $srcmods/modules.dep ]] || { - dfatal "$srcmods/modules.dep is missing. Did you run depmod?" - exit 1 -} +if [[ -d $srcmods ]]; then + [[ -f $srcmods/modules.dep ]] || { + dwarn "$srcmods/modules.dep is missing. Did you run depmod?" + } +fi if [[ -f $outfile && ! $force ]]; then dfatal "Will not override existing initramfs ($outfile) without --force"