summaryrefslogtreecommitdiff
path: root/dracut.sh
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2013-03-13 14:47:24 +0100
committerHarald Hoyer <harald@redhat.com>2013-03-13 14:49:20 +0100
commit83bb0893edc1c12bbaca20267134b01df2836e1c (patch)
tree04a0448504aad1aa9d954854b582a39174f65370 /dracut.sh
parent8fdcc1a9b1371b2b1d5c4e4b3ae077546f169459 (diff)
downloaddracut-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-xdracut.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/dracut.sh b/dracut.sh
index 2582f749..69f52824 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -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