Support `hostonly` being unset when using `set -u`.
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"
# given modules.
optional_hostonly() {
if [[ $hostonly_mode == "strict" ]]; then
- printf -- "%s" "$hostonly"
+ printf -- "%s" "${hostonly-}"
else
printf ""
fi
inst_sysusers() {
inst_multiple -o "$sysusers/$*" "$sysusers/acct-*-$*"
- if [[ $hostonly ]]; then
+ if [[ ${hostonly-} ]]; then
inst_multiple -H -o "$sysusersconfdir/$*" "$sysusers/acct-*-$*"
fi
}
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
[[ $_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
# 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
[[ $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
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
;;
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
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
# 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!"
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
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
_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
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
systemd-run systemd-escape \
systemd-cgls
- if [[ $hostonly ]]; then
+ if [[ ${hostonly-} ]]; then
inst_multiple -H -o \
"$systemdutilconfdir"/system.conf \
"$systemdutilconfdir"/system.conf.d/*.conf \
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"
# 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
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" \
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/*"
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
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
"$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
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 \
"$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 \
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" \
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"
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[@]}"
$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" \
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" \
"$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" \
$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/*" \
$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" \
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 \
$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 \
"$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 \
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.*" \
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"
done
# Install the hosts local user configurations if enabled.
- if [[ $hostonly ]]; then
+ if [[ ${hostonly-} ]]; then
inst_multiple -H -o \
"$systemdntpunitsconfdir/*.list" \
"$systemdutilconfdir"/timesyncd.conf \
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 \
"$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" \
"$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 \
# 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
$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 \
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 \
[[ "$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.'
}
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
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
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
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"
# 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
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"
# 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)
/usr/libexec/bluetooth/bluetoothd \
/usr/lib/bluetooth/bluetoothd
- if [[ $hostonly ]]; then
+ if [[ ${hostonly-} ]]; then
var_lib_files=("${dracutsysrootdir-}"/var/lib/bluetooth/**)
inst_multiple -o \
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
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
}
# 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
}
# 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
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
fi
inst_multiple -o "$depmodd/*.conf"
- if [[ $hostonly ]]; then
+ if [[ ${hostonly-} ]]; then
inst_multiple -H -o "$depmodconfdir/*.conf"
fi
:
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
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")
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
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
"$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
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
# called by dracut
check() {
- if [[ ! $hostonly ]]; then
+ if [[ ! ${hostonly-} ]]; then
return 0
fi
[[ $DRACUT_KERNEL_MODALIASES && -f $DRACUT_KERNEL_MODALIASES ]] \
"${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
# 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
{"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/*"
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
# 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
# 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
}
"${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
inst_binary sort
inst_simple /etc/iscsi/iscsid.conf
- if [[ $hostonly ]]; then
+ if [[ ${hostonly-} ]]; then
inst_simple /etc/iscsi/initiatorname.iscsi
fi
fi
return 1
}
- [[ $hostonly ]] || [[ $mount_needs ]] && {
+ [[ ${hostonly-} ]] || [[ $mount_needs ]] && {
for_each_host_dev_and_slaves_all get_lunmask
} | sort | uniq
}
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
}
# 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
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
}
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")
{"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 \
# called by dracut
check() {
- [[ $hostonly ]] || [[ $mount_needs ]] && {
+ [[ ${hostonly-} ]] || [[ $mount_needs ]] && {
for fs in "${host_fs_types[@]}"; do
[[ $fs == "9p" ]] && return 0
done
inst_script /sbin/zfcpconf.sh
inst_rules 56-zfcp.rules
- if [[ $hostonly ]]; then
+ if [[ ${hostonly-} ]]; then
inst_simple -H /etc/zfcp.conf
fi
}
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)
{
# called by dracut
check() {
- [[ $hostonly ]] && {
+ [[ ${hostonly-} ]] && {
require_binaries keyctl uname || return 1
}
# 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"
[[ -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