diff options
author | Harald Hoyer <harald@redhat.com> | 2013-03-13 14:47:24 +0100 |
---|---|---|
committer | Harald Hoyer <harald@redhat.com> | 2013-03-13 14:49:20 +0100 |
commit | 83bb0893edc1c12bbaca20267134b01df2836e1c (patch) | |
tree | 04a0448504aad1aa9d954854b582a39174f65370 /dracut.sh | |
parent | 8fdcc1a9b1371b2b1d5c4e4b3ae077546f169459 (diff) | |
download | dracut-83bb0893edc1c12bbaca20267134b01df2836e1c.tar.gz dracut-83bb0893edc1c12bbaca20267134b01df2836e1c.tar.bz2 dracut-83bb0893edc1c12bbaca20267134b01df2836e1c.zip |
dracut.sh: Add --noimageifnotneeded parameter
Do not create an image in host-only mode, if no kernel driver is needed
and no $initdir/etc/cmdline/*.conf is generated.
Diffstat (limited to 'dracut.sh')
-rwxr-xr-x | dracut.sh | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -330,6 +330,7 @@ TEMP=$(unset POSIXLY_CORRECT; getopt \ --long keep \ --long printsize \ --long regenerate-all \ + --long noimageifnotneeded \ -- "$@") if (( $? != 0 )); then @@ -408,6 +409,7 @@ while :; do --keep) keep="yes";; --printsize) printsize="yes";; --regenerate-all) regenerate_all="yes";; + --noimageifnotneeded) noimageifnotneeded="yes";; --) shift; break;; @@ -1020,6 +1022,16 @@ if [[ $no_kernel != yes ]]; then dinfo "*** Installing kernel module dependencies and firmware ***" dracut_kernel_post dinfo "*** Installing kernel module dependencies and firmware done ***" + + if [[ $noimageifnotneeded == yes ]] && [[ $hostonly ]]; then + if [[ ! -f "$initdir/lib/dracut/need-initqueue" ]] && \ + [[ -f ${initdir}/lib/modules/$kernel/modules.dep && ! -s ${initdir}/lib/modules/$kernel/modules.dep ]]; then + for i in ${initdir}/etc/cmdline.d/*.conf; do + # We need no initramfs image and do not generate one. + [[ $i == "${initdir}/etc/cmdline.d/*.conf" ]] && exit 0 + done + fi + fi fi if [[ $kernel_only != yes ]]; then |