]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix: support hostonly being unset
authorBenjamin Drung <benjamin.drung@canonical.com>
Fri, 20 Jun 2025 17:56:27 +0000 (19:56 +0200)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Thu, 3 Jul 2025 12:23:37 +0000 (08:23 -0400)
Support `hostonly` being unset when using `set -u`.

61 files changed:
dracut-init.sh
dracut.sh
modules.d/10systemd/module-setup.sh
modules.d/11fips/module-setup.sh
modules.d/11systemd-ask-password/module-setup.sh
modules.d/11systemd-coredump/module-setup.sh
modules.d/11systemd-creds/module-setup.sh
modules.d/11systemd-cryptsetup/module-setup.sh
modules.d/11systemd-hostnamed/module-setup.sh
modules.d/11systemd-integritysetup/module-setup.sh
modules.d/11systemd-journald/module-setup.sh
modules.d/11systemd-ldconfig/module-setup.sh
modules.d/11systemd-modules-load/module-setup.sh
modules.d/11systemd-networkd/module-setup.sh
modules.d/11systemd-pcrphase/module-setup.sh
modules.d/11systemd-portabled/module-setup.sh
modules.d/11systemd-pstore/module-setup.sh
modules.d/11systemd-repart/module-setup.sh
modules.d/11systemd-resolved/module-setup.sh
modules.d/11systemd-sysctl/module-setup.sh
modules.d/11systemd-sysext/module-setup.sh
modules.d/11systemd-timedated/module-setup.sh
modules.d/11systemd-timesyncd/module-setup.sh
modules.d/11systemd-tmpfiles/module-setup.sh
modules.d/11systemd-udevd/module-setup.sh
modules.d/11systemd-veritysetup/module-setup.sh
modules.d/13modsign/module-setup.sh
modules.d/16dbus-broker/module-setup.sh
modules.d/16dbus-daemon/module-setup.sh
modules.d/20i18n/module-setup.sh
modules.d/35connman/module-setup.sh
modules.d/35network-legacy/module-setup.sh
modules.d/35network-manager/module-setup.sh
modules.d/45drm/module-setup.sh
modules.d/45plymouth/plymouth-populate-initrd.sh
modules.d/70bluetooth/module-setup.sh
modules.d/70crypt/module-setup.sh
modules.d/70dmsquash-live-autooverlay/module-setup.sh
modules.d/70dmsquash-live/module-setup.sh
modules.d/70kernel-modules/module-setup.sh
modules.d/70lvm/module-setup.sh
modules.d/70mdraid/module-setup.sh
modules.d/70multipath/module-setup.sh
modules.d/70nvdimm/module-setup.sh
modules.d/70pcmcia/module-setup.sh
modules.d/70ppcmac/module-setup.sh
modules.d/73pcsc/module-setup.sh
modules.d/74dasd/module-setup.sh
modules.d/74dcssblk/module-setup.sh
modules.d/74hwdb/module-setup.sh
modules.d/74iscsi/module-setup.sh
modules.d/74lunmask/module-setup.sh
modules.d/74nvmf/module-setup.sh
modules.d/74resume/module-setup.sh
modules.d/74rootfs-block/module-setup.sh
modules.d/74udev-rules/module-setup.sh
modules.d/74virtfs/module-setup.sh
modules.d/74zfcp/module-setup.sh
modules.d/74znet/module-setup.sh
modules.d/76masterkey/module-setup.sh
modules.d/80base/module-setup.sh

index 9103e3a52cb1364eab885bc435549b006e2f6032..4ba4897233f09c8a38defb9ee2fd256b45b57080 100755 (executable)
@@ -222,7 +222,7 @@ dracut_module_path() {
     return 1
 }
 
-if [[ $hostonly == "-h" ]]; then
+if [[ ${hostonly-} == "-h" ]]; then
     if ! [[ $DRACUT_KERNEL_MODALIASES ]] || ! [[ -f $DRACUT_KERNEL_MODALIASES ]]; then
         export DRACUT_KERNEL_MODALIASES="${DRACUT_TMPDIR}/modaliases"
         $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${srcmods:+--kerneldir "$srcmods"} --modalias > "$DRACUT_KERNEL_MODALIASES"
@@ -375,7 +375,7 @@ inst_fsck_help() {
 # given modules.
 optional_hostonly() {
     if [[ $hostonly_mode == "strict" ]]; then
-        printf -- "%s" "$hostonly"
+        printf -- "%s" "${hostonly-}"
     else
         printf ""
     fi
@@ -634,7 +634,7 @@ inst_libdir_file() {
 inst_sysusers() {
     inst_multiple -o "$sysusers/$*" "$sysusers/acct-*-$*"
 
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o "$sysusersconfdir/$*" "$sysusers/acct-*-$*"
     fi
 }
@@ -695,7 +695,7 @@ module_check() {
     local _moddir=$3
     local _ret
     local _forced=0
-    local _hostonly=$hostonly
+    local _hostonly=${hostonly-}
     [[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1")
     [ $# -ge 2 ] && _forced=$2
     [[ -f $_moddir/module-setup.sh ]] || return 1
@@ -707,7 +707,7 @@ module_check() {
     [[ $_forced != 0 ]] && unset hostonly
     # don't quote $hostonly to leave argument empty
     # shellcheck disable=SC2086
-    moddir="$_moddir" check $hostonly
+    moddir="$_moddir" check ${hostonly-}
     _ret=$?
     unset "${module_functions[@]}"
     hostonly=$_hostonly
@@ -1168,7 +1168,7 @@ is_qemu_virtualized() {
     # 255 if any error was encountered
 
     # do not consult /sys and do not detect virt environment in non-hostonly mode
-    ! [[ $hostonly ]] && return 1
+    ! [[ ${hostonly-} ]] && return 1
 
     if type -P systemd-detect-virt > /dev/null 2>&1; then
         if ! vm=$(systemd-detect-virt --vm 2> /dev/null); then
index e0c041f46a531602889e724f313555450a22333d..480c35c1d384fdf3cf65c4e84386621765ecdfa2 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1119,7 +1119,7 @@ drivers_dir="${drivers_dir%"${drivers_dir##*[!/]}"}"
 [[ $hostonly_l ]] && hostonly=$hostonly_l
 [[ $hostonly_cmdline_l ]] && hostonly_cmdline=$hostonly_cmdline_l
 [[ $hostonly_mode_l ]] && hostonly_mode=$hostonly_mode_l
-[[ $hostonly == "yes" ]] && ! [[ $hostonly_cmdline ]] && hostonly_cmdline="yes"
+[[ ${hostonly-} == "yes" ]] && ! [[ $hostonly_cmdline ]] && hostonly_cmdline="yes"
 # shellcheck disable=SC2034
 [[ $i18n_install_all_l ]] && i18n_install_all=$i18n_install_all_l
 # shellcheck disable=SC2034
@@ -1305,15 +1305,15 @@ check_kernel_compress_support() {
     return $?
 }
 
-[[ $hostonly == yes ]] && hostonly="-h"
-[[ $hostonly != "-h" ]] && unset hostonly
+[[ ${hostonly-} == yes ]] && hostonly="-h"
+[[ ${hostonly-} != "-h" ]] && unset hostonly
 
 case $hostonly_mode in
     '')
-        [[ $hostonly ]] && hostonly_mode="sloppy"
+        [[ ${hostonly-} ]] && hostonly_mode="sloppy"
         ;;
     sloppy | strict)
-        if [[ ! $hostonly ]]; then
+        if [[ ! ${hostonly-} ]]; then
             unset hostonly_mode
         fi
         ;;
@@ -1406,7 +1406,7 @@ fi
 
 if systemd-detect-virt -c &> /dev/null; then
     export DRACUT_NO_MKNOD=1
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         printf "%s\n" "dracut[W]: Running in hostonly mode in a container!" >&2
     fi
 fi
@@ -1696,7 +1696,7 @@ if [[ $acpi_override == yes ]] && ! (check_kernel_config CONFIG_ACPI_TABLE_UPGRA
 fi
 
 if [[ $early_microcode == yes ]]; then
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         if [[ $(get_cpu_vendor) == "AMD" || $(get_cpu_vendor) == "Intel" ]]; then
             check_kernel_config CONFIG_MICROCODE || unset early_microcode
         else
@@ -1719,7 +1719,7 @@ fi
 # Need to be able to have non-root users read stuff (rpcbind etc)
 chmod 755 "$initdir"
 
-if [[ $hostonly ]]; then
+if [[ ${hostonly-} ]]; then
     for i in /sys /proc /run /dev; do
         if ! findmnt --target "$i" &> /dev/null; then
             dwarning "Turning off host-only mode: '$i' is not mounted!"
@@ -1785,7 +1785,7 @@ if ((${#add_device_l[@]})); then
     push_user_devs "${add_device_l[@]}"
 fi
 
-if [[ $hostonly ]] && [[ $hostonly_default_device != "no" ]]; then
+if [[ ${hostonly-} ]] && [[ $hostonly_default_device != "no" ]]; then
     # in hostonly mode, determine all devices, which have to be accessed
     # and examine them for filesystem types
 
@@ -2134,7 +2134,7 @@ if [[ $no_kernel != yes ]]; then
     dracut_kernel_post
     dinfo "*** Installing kernel module dependencies done ***"
 
-    if [[ $noimageifnotneeded == yes ]] && [[ $hostonly ]]; then
+    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
@@ -2291,7 +2291,7 @@ if [[ $early_microcode == yes ]]; then
     _dest_dir="$early_cpio_dir/d/kernel/x86/microcode"
     _dest_idx="0 1"
     mkdir -p "$_dest_dir"
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         [[ $(get_cpu_vendor) == "AMD" ]] && _dest_idx="0"
         [[ $(get_cpu_vendor) == "Intel" ]] && _dest_idx="1"
     fi
@@ -2301,7 +2301,7 @@ if [[ $early_microcode == yes ]]; then
             if [[ -d $_fwdir && -d $_fwdir/$_fw ]]; then
                 _src="*"
                 dinfo "*** Constructing ${ucode_dest[$idx]} ***"
-                if [[ $hostonly ]]; then
+                if [[ ${hostonly-} ]]; then
                     _src=$(get_ucode_file)
                     [[ $_src ]] || break
                     if [[ -r "$_fwdir/$_fw/${_src}.early" ]]; then
index 8c3d2b8bae59c2ac8e22e34e37722513bee92e15..cda64219ac4e1d7300da5e424f53c2b1bf7a371f 100755 (executable)
@@ -96,7 +96,7 @@ install() {
         systemd-run systemd-escape \
         systemd-cgls
 
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             "$systemdutilconfdir"/system.conf \
             "$systemdutilconfdir"/system.conf.d/*.conf \
index ed4ef20b98b19e42e0b28ae5113d05ef7eb07827..721466382f83b1476da75a9a37bab31212d4dcaf 100755 (executable)
@@ -42,7 +42,7 @@ installkernel() {
     done
 
     # with hostonly_default_device fs module for /boot is not installed by default
-    if [[ $hostonly ]] && [[ $hostonly_default_device == "no" ]]; then
+    if [[ ${hostonly-} ]] && [[ $hostonly_default_device == "no" ]]; then
         _bootfstype=$(find_mp_fstype /boot)
         if [[ -n $_bootfstype ]]; then
             hostonly='' instmods "$_bootfstype"
index 8b09b69f2d862f675c91afc2d102f9b5b42af452..73ada440cd3dd1596e5f4fe6dec17e5586faca7a 100755 (executable)
@@ -19,7 +19,7 @@ check() {
 # Module dependency requirements.
 depends() {
 
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         # A password cannot be entered if there is no graphical output during boot,
         # as is the case in aarch64, where efifb does not work with qemu-system-aarch64:
         # - virtio-gpu-pci does not expose a linear framebuffer
index 4014b074c80f928f9e10413632c7abd88e0b4fcf..a2111c989fefee5a9ae2d1c468687e51db498a5d 100755 (executable)
@@ -57,7 +57,7 @@ install() {
     fi
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             "$systemdutilconfdir"/coredump.conf \
             "$systemdutilconfdir/coredump.conf.d/*.conf" \
index 1b66519c312df2045d9abc75e4b35907cfa8aa4a..a20d512b3acae38e4b986bf9b2a7c586837298ce 100755 (executable)
@@ -37,7 +37,7 @@ install() {
         systemd-creds
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             "/etc/credstore/*" \
             "/etc/credstore.encrypted/*"
index 0dd1f444afdfc8c92ca25c47e0d42060ac4e8792..0a89ef200d41e82ebc0b9d3fef677ec9e809a3e0 100755 (executable)
@@ -20,7 +20,7 @@ check() {
 depends() {
     local deps
     deps="dm rootfs-block crypt systemd-ask-password"
-    if [[ $hostonly && -f "${dracutsysrootdir-}"/etc/crypttab ]]; then
+    if [[ ${hostonly-} && -f "${dracutsysrootdir-}"/etc/crypttab ]]; then
         if grep -q -e "fido2-device=" -e "fido2-cid=" "${dracutsysrootdir-}"/etc/crypttab; then
             deps+=" fido2"
         fi
@@ -30,7 +30,7 @@ depends() {
         if grep -q "tpm2-device=" "${dracutsysrootdir-}"/etc/crypttab; then
             deps+=" tpm2-tss"
         fi
-    elif [[ ! $hostonly ]]; then
+    elif [[ ! ${hostonly-} ]]; then
         for module in fido2 pkcs11 tpm2-tss; do
             module_check $module > /dev/null 2>&1
             if [[ $? == 255 ]] && ! [[ " $omit_dracutmodules " == *\ $module\ * ]]; then
@@ -56,7 +56,7 @@ install() {
         "$systemdsystemunitdir"/remote-cryptsetup.target \
         "$systemdsystemunitdir"/initrd-root-device.target.wants/remote-cryptsetup.target
 
-    if [[ $hostonly ]] && [[ -f $initdir/etc/crypttab ]]; then
+    if [[ ${hostonly-} ]] && [[ -f $initdir/etc/crypttab ]]; then
         # for each entry in /etc/crypttab check if the key file is backed by a socket unit and if so,
         # include it along with its corresponding service unit.
         while read -r _mapper _dev _luksfile _luksoptions || [[ -n $_mapper ]]; do
index d589061741bc76e23241c4f04f35585e7bf988fc..daa35cce80b585034291cbed2f705bdbc9116ee7 100755 (executable)
@@ -46,7 +46,7 @@ install() {
         hostnamectl
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             /etc/hostname \
             "$systemdsystemconfdir"/systemd-hostnamed.service \
index d376013a2326fe5e248c08550fd3f81db030a1bf..3a025c548cc215832c09e49b7227e50e1698583d 100755 (executable)
@@ -49,7 +49,7 @@ install() {
         "$systemdsystemunitdir"/initrd-root-device.target.wants/remote-integritysetup.target
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             /etc/integritytab \
             "$systemdsystemconfdir"/integritysetup.target \
index 807c7ab384e0482a6d14beecdfcda054591b7faf..92157a43353b53288d42962004ec27421b276cb4 100755 (executable)
@@ -67,7 +67,7 @@ install() {
     fi
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             "$systemdutilconfdir"/journald.conf \
             "$systemdutilconfdir/journald.conf.d/*.conf" \
index 4e65d89211ec092079ab5d23d7f859d66c64c1a3..82dc63a08f8628d958bad806b88a45e75f459f20 100755 (executable)
@@ -41,7 +41,7 @@ install() {
     inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"ld.so"
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             "$systemdsystemconfdir"/ldconfig.service \
             "$systemdsystemconfdir/ldconfig.service.d/*.conf"
index 49bf658f441dd5396358b27eb8a3ee24f1c8a54e..337a040b6301f563cf80c60a5aa03ae000c57a00 100755 (executable)
@@ -38,7 +38,7 @@ installkernel() {
         hostonly='' instmods "${_mods[@]}"
     fi
 
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         mapfile -t _mods < <(modules_load_get "$modulesloadconfdir")
         if [[ ${#_mods[@]} -gt 0 ]]; then
             hostonly='' instmods "${_mods[@]}"
@@ -65,7 +65,7 @@ install() {
     $SYSTEMCTL -q --root "$initdir" enable systemd-modules-load.service
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             /etc/modules-load.d/*.conf \
             "$modulesloadconfdir/*.conf" \
index e7755f4a6a92743f94d5a5df9e4a3ff61e413da7..15c20c67fd7f306a82feac6ad66d22ae3ad695a0 100755 (executable)
@@ -78,7 +78,7 @@ install() {
     done
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             "$systemdutilconfdir"/networkd.conf \
             "$systemdutilconfdir/networkd.conf.d/*.conf" \
index bc6e93cc525ac54a04636ef8cd31d2b033afcc26..7a614bbb09bc02335bab055b5ad5ebb236e798af 100755 (executable)
@@ -43,7 +43,7 @@ install() {
         "$systemdsystemunitdir"/initrd.target.wants/systemd-pcrphase-initrd.service
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             "$systemdsystemconfdir"/systemd-pcrphase-initrd.service \
             "$systemdsystemconfdir/systemd-pcrphase-initrd.service.d/*.conf" \
index 5f12348fddd0c3aa6fe65c1944434552afdbc3fe..ace9cb1bdcef5cd3897f9a25903f2a95383f6b94 100755 (executable)
@@ -66,7 +66,7 @@ install() {
     $SYSTEMCTL -q --root "$initdir" enable systemd-portabled.service
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             "/etc/portables/*.raw" \
             "$systemdutilconfdir/system.attached/*" \
index 6cfea8ab32032686feef91559f26b59a5c84dd96..ff6b5cc1d908526e417be689b2a4bfd82f6f4506 100755 (executable)
@@ -44,7 +44,7 @@ install() {
     $SYSTEMCTL -q --root "$initdir" enable systemd-pstore.service
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             "$systemdutilconfdir"/pstore.conf \
             "$systemdutilconfdir/pstore.conf.d/*.conf" \
index 14917d37f29e2f18264fa91eabbc9843be02139f..592ffd20d69d0b721eb8f93fc8a31b0cb1411159 100755 (executable)
@@ -21,7 +21,7 @@ install() {
         systemd-repart
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             "/etc/repart.d/*.conf" \
             "$systemdsystemconfdir"/systemd-repart.service \
index d20f211c60742508c57fd8a2f4f2826e0675db2d..74c6de8ec354841fc496b45c76d83fa92e297548 100755 (executable)
@@ -48,7 +48,7 @@ install() {
     $SYSTEMCTL -q --root "$initdir" enable systemd-resolved.service
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             "$systemdutilconfdir"/resolv.conf \
             "$systemdutilconfdir"/resolved.conf \
index d5abe575b86b782db8db7fbefe213b0f1affc0e4..e283451afc3261ef33830ea75fa8a5f487dbf6a8 100755 (executable)
@@ -23,7 +23,7 @@ install() {
         "$systemdutildir"/systemd-sysctl
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             /etc/sysctl.conf \
             /etc/sysctl.d/*.conf \
index dffe9767776c60f65b5402a5854603c6d31fc2b4..4ab02e81611b8114e5c60b04f9da52a2bfebeb38 100755 (executable)
@@ -51,7 +51,7 @@ install() {
     done
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             "/etc/extensions/*.raw" \
             "/etc/extension-release.d/extension-release.*" \
index 5e9c5caf9a072cd2dec0edb5da9d0af365927109..a3bf3f7581f7d6313009ebc3accad325defd29cb 100755 (executable)
@@ -38,7 +38,7 @@ install() {
         timedatectl
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             "$systemdsystemconfdir"/systemd-timedated.service \
             "$systemdsystemconfdir/systemd-timedated.service.d/*.conf"
index 82902b3b05828b6c22a71f0311ffdf1b9d109d8f..01ef6cef01dff87eab982d85137a7faaa2bf9caa 100755 (executable)
@@ -55,7 +55,7 @@ install() {
     done
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             "$systemdntpunitsconfdir/*.list" \
             "$systemdutilconfdir"/timesyncd.conf \
index 7976afa4fa73f53f313d0f6121c63b2507af9d90..7076097e6cecd6b8fc27530819d0571028e20eee 100755 (executable)
@@ -43,7 +43,7 @@ install() {
         systemd-tmpfiles
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             "$tmpfilesconfdir/*.conf" \
             "$systemdsystemconfdir"/systemd-tmpfiles-clean.service \
index e8f6e5ba5d0dc28bcc9ff58c8507e05ac5d56642..4ad2519b3d29911338cbb435677ddab03728d959 100755 (executable)
@@ -50,7 +50,7 @@ install() {
         "$systemdsystemunitdir"/sysinit.target.wants/systemd-udev-trigger.service
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             "$systemdsystemconfdir"/systemd-udevd.service \
             "$systemdsystemconfdir/systemd-udevd.service.d/*.conf" \
index 79f6adbcea1a9f59ce70939b6cc3f6567bf12dd9..4a166054ef462dae2362ebee59529b28acd47780 100755 (executable)
@@ -49,7 +49,7 @@ install() {
         "$systemdsystemunitdir"/initrd-root-device.target.wants/remote-veritysetup.target
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             /etc/veritytab \
             "$systemdsystemconfdir"/veritysetup.target \
index b069a30ab36b96c18865358b67fe11686a84c570..cc41f1a63f1ed444de47d4bd5530dc822b266b16 100755 (executable)
@@ -11,7 +11,7 @@ check() {
 
     # do not include module in hostonly mode,
     # if no keys are present
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         x=$(echo "${dracutsysrootdir-}"/lib/modules/keys/*)
         [[ ${x} == "${dracutsysrootdir-}/lib/modules/keys/*" ]] && return 255
     fi
index e28bd21b164406edd5296ad03c0b1dbadc01566a..9d2d77cffa9bd07d3aa251a90188337df20c2e46 100755 (executable)
@@ -71,7 +71,7 @@ install() {
     $SYSTEMCTL -q --root "$initdir" enable dbus-broker.service
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             "$dbusconfdir"/session.conf \
             "$dbusconfdir"/system.conf \
index 5972b0b2d0e63774a04093e5409e0d29b8fa6ff1..f03631803ca851a5b051c1635b8aa2f3d70448ca 100755 (executable)
@@ -77,7 +77,7 @@ install() {
     grep '^\(d\|message\)bus:' "${dracutsysrootdir-}"/etc/group >> "$initdir/etc/group"
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             "$dbusconfdir"/system.conf \
             "$systemdsystemconfdir"/dbus.socket \
index d6916d08c4e17585fe54fbb1c45678b7a4e50cc5..907ebbef678f0d8193cb15dd839f18d47471d8d3 100755 (executable)
@@ -299,7 +299,7 @@ install() {
         [[ "$kbddir" ]] || return 1
 
         [[ -f ${dracutsysrootdir-}$I18N_CONF ]] \
-            || [[ ! ${hostonly} || ${i18n_vars} ]] || {
+            || [[ ! ${hostonly-} || ${i18n_vars-} ]] || {
             derror 'i18n_vars not set!  Please set up i18n_vars in ' \
                 'configuration file.'
         }
@@ -309,7 +309,7 @@ install() {
     if checks; then
         install_base
 
-        if [[ ${hostonly} ]] && ! [[ ${i18n_install_all} == "yes" ]]; then
+        if [[ ${hostonly-} ]] && ! [[ ${i18n_install_all} == "yes" ]]; then
             install_local_i18n || install_all_kbd
         else
             install_all_kbd
index e703465896702a6ad300e7b9eadd4fa528e423c9..b055df7f953ecdf77e53333fd4b720d330a89582 100755 (executable)
@@ -24,7 +24,7 @@ install() {
     inst connmanctl
     inst connmand-wait-online
     inst "$dbussystem"/connman.conf
-    [[ $hostonly ]] && [[ -f ${dracutsysrootdir-}/etc/connman/main.conf ]] && inst /etc/connman/main.conf
+    [[ ${hostonly-} ]] && [[ -f ${dracutsysrootdir-}/etc/connman/main.conf ]] && inst /etc/connman/main.conf
     inst_dir /usr/lib/connman/plugins
     inst_dir /var/lib/connman
 
index b99567f52de0fee8c2feee26717b0f5936fef6b4..fe922aea8377f950f2a81023f44c41f2a7a172d8 100755 (executable)
@@ -29,7 +29,7 @@ install() {
         inst_multiple -o \
             "${systemdnetwork}/99-default.link" \
             "${systemdnetwork}/98-default-mac-none.link"
-        [[ $hostonly ]] && inst_multiple -H -o "${systemdnetworkconfdir}/*.link"
+        [[ ${hostonly-} ]] && inst_multiple -H -o "${systemdnetworkconfdir}/*.link"
     fi
 
     inst_multiple ip dhclient sed awk grep pgrep tr expr
index 3705b7a5e776b3598726df0193d84300aa93c2d0..09107708cd0ae58d70de89a59683bc65a9e7f803 100755 (executable)
@@ -75,7 +75,7 @@ install() {
         inst_multiple -o \
             "${systemdnetwork}/99-default.link" \
             "${systemdnetwork}/98-default-mac-none.link"
-        [[ $hostonly ]] && inst_multiple -H -o "${systemdnetworkconfdir}/*.link"
+        [[ ${hostonly-} ]] && inst_multiple -H -o "${systemdnetworkconfdir}/*.link"
     fi
 
     inst_hook initqueue/settled 99 "$moddir/nm-run.sh"
index 6bb4f8a890fa60f1fdaf2989012bc5c057e3014e..2e97f8d1ed7e1237002c6286dac5ffda308c5e1a 100755 (executable)
@@ -23,7 +23,7 @@ installkernel() {
     # if the hardware is present, include module even if it is not currently loaded,
     # as we could e.g. be in the installer; nokmsboot boot parameter will disable
     # loading of the driver if needed
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         local -a _mods
         local i modlink modname
 
index 17653a0ea20a921877844e81e5b102dca64e3cdb..bc8b1f82c91272641a5c97a594052f0b40334496 100755 (executable)
@@ -12,7 +12,7 @@ mkdir -m 0755 -p "${initdir}/usr/share/plymouth"
 
 inst_libdir_file "plymouth/text.so" "plymouth/details.so"
 
-if [[ $hostonly ]]; then
+if [[ ${hostonly-} ]]; then
     inst_multiple \
         "/usr/share/plymouth/themes/details/details.plymouth" \
         "/usr/share/plymouth/themes/text/text.plymouth"
index e9d550dffa9e26e54f178f91a42de0c247a58bc8..c87e589add1ad0683c9d67c5f1892a8494263e1b 100755 (executable)
@@ -7,7 +7,7 @@ check() {
     # If the binary(s) requirements are not fulfilled the module can't be installed
     require_any_binary /usr/lib/bluetooth/bluetoothd /usr/libexec/bluetooth/bluetoothd || return 1
 
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         # Warn user if bluetooth kernel module is loaded
         # and if Peripheral (0x500) is found of minor class:
         #  * Keyboard (0x40)
@@ -68,7 +68,7 @@ install() {
         /usr/libexec/bluetooth/bluetoothd \
         /usr/lib/bluetooth/bluetoothd
 
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         var_lib_files=("${dracutsysrootdir-}"/var/lib/bluetooth/**)
 
         inst_multiple -o \
index fbea9bec8abc63ce0b5833ebdb450ca3b1232985..e01e086e9e4089477514615323bcc7775c320d03 100755 (executable)
@@ -93,7 +93,7 @@ install() {
         inst_hook cleanup 30 "$moddir/crypt-cleanup.sh"
     fi
 
-    if [[ $hostonly ]] && [[ -f "${dracutsysrootdir-}/etc/crypttab" ]]; then
+    if [[ ${hostonly-} ]] && [[ -f "${dracutsysrootdir-}/etc/crypttab" ]]; then
         # filter /etc/crypttab for the devices we need
         while read -r _mapper _dev _luksfile _luksoptions || [ -n "$_mapper" ]; do
             [[ $_mapper == \#* ]] && continue
index 176677c7e785fd2cb82d11152db6a2f96ba2d54f..776c78f3eab708632f5899dbc3e53baca468d226 100755 (executable)
@@ -2,7 +2,7 @@
 
 check() {
     # including a module dedicated to live environments in a host-only initrd doesn't make sense
-    [[ $hostonly ]] && return 1
+    [[ ${hostonly-} ]] && return 1
     return 255
 }
 
index 5601346ee68ac5f106271c736f94c8cab740ac0d..d2a252f2692ffbb3e7dd8539e68775a2748f50e3 100755 (executable)
@@ -3,7 +3,7 @@
 # called by dracut
 check() {
     # a live host-only image doesn't really make a lot of sense
-    [[ $hostonly ]] && return 1
+    [[ ${hostonly-} ]] && return 1
     return 255
 }
 
index cd3ca5dbd29c364116bea073795c12220a2037e9..ad0d4ab7f5a2eedfed92177eff9dccac160583b0 100755 (executable)
@@ -109,7 +109,7 @@ installkernel() {
 
         # if not on hostonly mode, or there are hostonly block device
         # install block drivers
-        if ! [[ $hostonly ]] \
+        if ! [[ ${hostonly-} ]] \
             || for_each_host_dev_and_slaves_all record_block_dev_drv; then
             hostonly='' instmods sg sr_mod sd_mod scsi_dh ata_piix
 
@@ -126,7 +126,7 @@ installkernel() {
             dracut_instmods -o -P ".*/(kernel/fs/nfs|kernel/fs/nfsd|kernel/fs/lockd)/.*" '=fs'
         fi
 
-        if [[ $hostonly ]] && [[ "${host_fs_types[*]}" ]]; then
+        if [[ ${hostonly-} ]] && [[ "${host_fs_types[*]}" ]]; then
             hostonly='' instmods "${host_fs_types[@]}"
         fi
 
@@ -143,7 +143,7 @@ installkernel() {
     fi
 
     inst_multiple -o "$depmodd/*.conf"
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o "$depmodconfdir/*.conf"
     fi
     :
index 3d8fe213574d45b98ded9d2602561ef80290d7ef..9f1a4b26eae1fa09054e6e4c841e543695d2b080 100755 (executable)
@@ -58,7 +58,7 @@ install() {
 
     inst_rules "$moddir/64-lvm.rules"
 
-    if [[ $hostonly ]] || [[ $lvmconf == "yes" ]]; then
+    if [[ ${hostonly-} ]] || [[ $lvmconf == "yes" ]]; then
         if [[ -f "${dracutsysrootdir-}/etc/lvm/lvm.conf" ]]; then
             inst_simple -H /etc/lvm/lvm.conf
         fi
@@ -89,7 +89,7 @@ install() {
     inst_script "$moddir/lvm_scan.sh" /sbin/lvm_scan
     inst_hook cmdline 30 "$moddir/parse-lvm.sh"
 
-    if [[ $hostonly ]] && find_binary lvs &> /dev/null; then
+    if [[ ${hostonly-} ]] && find_binary lvs &> /dev/null; then
         for dev in "${!host_fs_types[@]}"; do
             [[ -e /sys/block/${dev#/dev/}/dm/name ]] || continue
             dev=$(< "/sys/block/${dev#/dev/}/dm/name")
@@ -107,7 +107,7 @@ install() {
         done
     fi
 
-    if ! [[ $hostonly ]]; then
+    if ! [[ ${hostonly-} ]]; then
         inst_multiple -o thin_dump thin_restore thin_check thin_repair \
             cache_dump cache_restore cache_check cache_repair \
             era_check era_dump era_invalidate era_restore
index 09f0323b640358e085e7b9a91f49672ff9513b1e..5f8f5100e87ae2048328696dd04a39a7f5308785 100755 (executable)
@@ -91,7 +91,7 @@ install() {
 
     inst_rules "$moddir/59-persistent-storage-md.rules"
 
-    if [[ $hostonly ]] || [[ $mdadmconf == "yes" ]]; then
+    if [[ ${hostonly-} ]] || [[ $mdadmconf == "yes" ]]; then
         if [[ -f "${dracutsysrootdir-}/etc/mdadm.conf" ]]; then
             inst -H /etc/mdadm.conf
         else
index 0b05e5af0f49da491f5df080275fa37c3c48e483..9ecbbeed2733e421a6ce04e26f2cfc2378281094 100755 (executable)
@@ -111,7 +111,7 @@ install() {
         "$tmpfilesdir/multipath.conf"
 
     mpathconf_installed \
-        && [[ $hostonly ]] && [[ $hostonly_mode == "strict" ]] && {
+        && [[ ${hostonly-} ]] && [[ $hostonly_mode == "strict" ]] && {
         for_each_host_dev_and_slaves_all add_hostonly_mpath_conf
         if ((${#_allow[@]} > 0)); then
             local -a _args
@@ -123,7 +123,7 @@ install() {
         fi
     }
 
-    [[ $hostonly ]] || mpathconf_installed || {
+    [[ ${hostonly-} ]] || mpathconf_installed || {
         for_each_host_dev_and_slaves is_mpath \
             || [[ -f /etc/multipath.conf ]] || {
             cat > "${initdir}"/etc/multipath.conf << EOF
index fe32585a9996a5f6f0c15fa58cfc626b88a1c329..ce73fe3601854c0e22c624a3ab5ef73b0a1905d7 100755 (executable)
@@ -2,7 +2,7 @@
 
 # called by dracut
 check() {
-    if [[ ! $hostonly ]]; then
+    if [[ ! ${hostonly-} ]]; then
         return 0
     fi
     [[ $DRACUT_KERNEL_MODALIASES && -f $DRACUT_KERNEL_MODALIASES ]] \
index 747e4f1fa4052269ed89de7a2e51595d756a6f39..1617107bbc242985e268bbf23271567af8e7be51 100755 (executable)
@@ -26,7 +26,7 @@ install() {
         "${udevdir}"/pcmcia-check-broken-cis
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             /etc/pcmcia/config.opts
     fi
index e9afa7ee42313a4a43a662354dae29a46d34ff58..00c525c1c3b0f8f16e64bc9b9b83a157432611d5 100755 (executable)
@@ -33,7 +33,7 @@ installkernel() {
 
     # only PowerMac3,6 has a module, special case
     if [[ ${DRACUT_ARCH:-$(uname -m)} != ppc64* ]]; then
-        if [[ $hostonly_mode != "strict" ]] || [[ $hostonly && "$(pmac_model)" == "PowerMac3,6" ]]; then
+        if [[ $hostonly_mode != "strict" ]] || [[ ${hostonly-} && "$(pmac_model)" == "PowerMac3,6" ]]; then
             hostonly=$(optional_hostonly) instmods therm_windtunnel
         fi
         return 0
index 5ae1272b20c09c86a4fe7628f509bc90361bc450..6b3d7f378999c02455ab8c3743012472174ed4f3 100755 (executable)
@@ -55,7 +55,7 @@ install() {
         {"tls/$_arch/",tls/,"$_arch/",}"libpcsclite_real.so.*"
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             /etc/opensc.conf \
             "/etc/reader.conf.d/*"
index f532e55853ab8e0aafef14c0e827da6752a53913..cfc60e1b45ca94556e4ad5809ee504df76f2f2b1 100755 (executable)
@@ -12,7 +12,7 @@ check() {
 install() {
     inst_multiple dasdconf.sh
     conf=/etc/dasd.conf
-    if [[ $hostonly && -f $conf ]]; then
+    if [[ ${hostonly-} && -f $conf ]]; then
         inst -H $conf
     fi
     inst_rules 56-dasd.rules
index 67af4ad58b16644b05a79bbb866351e0291a2ebe..c3a141ae210335211f01359a50a85cba8db32e9f 100755 (executable)
@@ -11,7 +11,7 @@ check() {
 
 # called by dracut
 installkernel() {
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         for dev in /sys/devices/dcssblk/*/block/dcssblk*; do
             [[ -e $dev ]] || continue
             hostonly='' instmods dcssblk
@@ -28,7 +28,7 @@ install() {
     # If there is a config file which contains avail (best only of root device)
     # disks to activate add it and use it during boot -> then we do not need
     # a kernel param anymore
-    #if [[ $hostonly ]]; then
+    #if [[ ${hostonly-} ]]; then
     #    inst /etc/dcssblk.conf
     #fi
 }
index a8e10ab4872afac786b0842bd6254a0a7c146716..2713c92c05ecd6576d9c4140793edd06ad3ea324 100644 (file)
@@ -16,7 +16,7 @@ install() {
         "${udevdir}"/hwdb.bin
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_multiple -H -o \
             "$udevconfdir"/hwdb.bin
     fi
index 4f786167bd1b336176eb9d2138ca6ef69a5852de..c3860cf8b05fd01877bac381945c1a5808a8d4e7 100755 (executable)
@@ -193,7 +193,7 @@ install() {
     inst_binary sort
 
     inst_simple /etc/iscsi/iscsid.conf
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_simple /etc/iscsi/initiatorname.iscsi
     fi
 
index 563891c9c9b34539583b775eae4786ffbc218651..8bf06be74b8fc5cc8d3b2838bab3622daac359f8 100755 (executable)
@@ -38,7 +38,7 @@ cmdline() {
         fi
         return 1
     }
-    [[ $hostonly ]] || [[ $mount_needs ]] && {
+    [[ ${hostonly-} ]] || [[ $mount_needs ]] && {
         for_each_host_dev_and_slaves_all get_lunmask
     } | sort | uniq
 }
index e1c9cbe4899ab9d3515d634363cd64813c9d05c8..54feffbb951ab76f3a873972b8efcad9454bbbc1 100755 (executable)
@@ -128,7 +128,7 @@ cmdline() {
         echo -n " rd.nvmf.hostid=${_hostid}"
     fi
 
-    [[ $hostonly ]] || [[ $mount_needs ]] && {
+    [[ ${hostonly-} ]] || [[ $mount_needs ]] && {
         pushd . > /dev/null
         for_each_host_dev_and_slaves gen_nvmf_cmdline
         popd > /dev/null || exit
index 4d4d3a78cd4b04effe0dc85d62f1f2dd090afd2f..a2693af5af19ae348c6ed9361315f40fbbbe436d 100755 (executable)
@@ -11,7 +11,7 @@ check() {
     }
 
     # If hostonly check if we want to include the resume module
-    if [[ $hostonly ]] || [[ $mount_needs ]]; then
+    if [[ ${hostonly-} ]] || [[ $mount_needs ]]; then
         # Resuming won't work if swap is on a netdevice
         swap_on_netdevice && return 255
         if grep -rq 'resume=' /proc/cmdline /etc/cmdline /etc/cmdline.d /etc/kernel/cmdline /usr/lib/kernel/cmdline 2> /dev/null; then
@@ -80,7 +80,7 @@ install() {
     for _bin in /usr/sbin/resume /usr/lib/suspend/resume /usr/lib64/suspend/resume /usr/lib/uswsusp/resume /usr/lib64/uswsusp/resume; do
         [[ -x "${dracutsysrootdir-}${_bin}" ]] && {
             inst "${_bin}" /usr/sbin/resume
-            [[ $hostonly ]] && [[ -f "${dracutsysrootdir-}/etc/suspend.conf" ]] && inst -H /etc/suspend.conf
+            [[ ${hostonly-} ]] && [[ -f "${dracutsysrootdir-}/etc/suspend.conf" ]] && inst -H /etc/suspend.conf
             break
         }
     done
index 4e1a7c3585d244f2a2db8079ab35b819b6acb8a2..34f7b7c2434d0aec790915316360ddbe8064a7a9 100755 (executable)
@@ -6,7 +6,7 @@ depends() {
 }
 
 cmdline_journal() {
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         for dev in "${!host_fs_types[@]}"; do
             [[ ${host_fs_types[$dev]} == "xfs" ]] || continue
             rootopts=$(find_dev_fsopts "$dev")
index f98ed33a529535de41b3eaca9e87bac76a0acb59..35e4399786e7e71643890c94c0de413fa3824748 100755 (executable)
@@ -100,7 +100,7 @@ install() {
         {"tls/$_arch/",tls/,"$_arch/",}"libnss_files*"
 
     # Install the hosts local user configurations if enabled.
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_dir "$udevconfdir"
         inst_multiple -H -o \
             "$udevconfdir"/udev.conf \
index 47a317f0b9bb06dc823204081d31e9a17db62a16..2691419c37bdea2e37c5c8925d5498af1ae8d6c5 100755 (executable)
@@ -2,7 +2,7 @@
 
 # called by dracut
 check() {
-    [[ $hostonly ]] || [[ $mount_needs ]] && {
+    [[ ${hostonly-} ]] || [[ $mount_needs ]] && {
         for fs in "${host_fs_types[@]}"; do
             [[ $fs == "9p" ]] && return 0
         done
index 14a52b3751d157a90868e5890c7bd972b77893c4..5a211313fd9d7aa459f95c40fb19db23d7d599b1 100755 (executable)
@@ -23,7 +23,7 @@ install() {
     inst_script /sbin/zfcpconf.sh
     inst_rules 56-zfcp.rules
 
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         inst_simple -H /etc/zfcp.conf
     fi
 }
index b84470f37d77ac1f0f7eb3b42a487e601c9dd8bd..7bc26af12dd0c8d7e9dbaead959f1d02f9408b7a 100755 (executable)
@@ -25,7 +25,7 @@ installkernel() {
 install() {
     inst_hook cmdline 30 "$moddir/parse-ccw.sh"
     inst_multiple grep sed seq readlink chzdev
-    if [[ $hostonly ]]; then
+    if [[ ${hostonly-} ]]; then
         local _tempfile
         _tempfile=$(mktemp --tmpdir="${DRACUT_TMPDIR}" dracut-zdev.XXXXXX)
         {
index 1b6afb154cda55476fea916ed95ec3be87e0ee3c..ede6b050184bd1cf2db7041240121e45cb222f94 100755 (executable)
@@ -2,7 +2,7 @@
 
 # called by dracut
 check() {
-    [[ $hostonly ]] && {
+    [[ ${hostonly-} ]] && {
         require_binaries keyctl uname || return 1
     }
 
index 9a6dc8bf77a6b7efd76d00d2cc8e75f8b173c5ca..44899b1d374cfcdda1b4aad9b1875073262a9aaf 100755 (executable)
@@ -62,10 +62,10 @@ install() {
 
     # add common users in /etc/passwd, it will be used by nfs/ssh currently
     # use password for hostonly images to facilitate secure sulogin in emergency console
-    [[ $hostonly ]] && pwshadow='x'
+    [[ ${hostonly-} ]] && pwshadow='x'
     grep '^root:' "$initdir/etc/passwd" > /dev/null 2>&1 || echo "root:$pwshadow:0:0::/root:/bin/sh" >> "$initdir/etc/passwd"
 
-    [[ $hostonly ]] && grep '^root:' "${dracutsysrootdir-}"/etc/shadow >> "$initdir/etc/shadow"
+    [[ ${hostonly-} ]] && grep '^root:' "${dracutsysrootdir-}"/etc/shadow >> "$initdir/etc/shadow"
 
     # install our scripts and hooks
     inst_script "$moddir/loginit.sh" "/sbin/loginit"
@@ -86,7 +86,7 @@ install() {
 
     [[ -d /lib/modprobe.d ]] && inst_multiple -o "/lib/modprobe.d/*.conf"
     [[ -d /usr/lib/modprobe.d ]] && inst_multiple -o "/usr/lib/modprobe.d/*.conf"
-    [[ $hostonly ]] && inst_multiple -H -o /etc/modprobe.d/*.conf /etc/modprobe.conf
+    [[ ${hostonly-} ]] && inst_multiple -H -o /etc/modprobe.d/*.conf /etc/modprobe.conf
 
     inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh