Sloppy mode is the original hostonly mode.
Strict mode was newly introduced much later in 2018 (v048) as a non-default
opt-in special optimization mode to allow modules to ignore more drivers
or do some extra job to save memory and disk space, while making the image less portable.
This PR includes more dracut modules (and with that more kernel modules) in sloppy mode.
# if cryptsetup is not installed, then we cannot support encrypted devices.
require_binaries "$systemdutildir"/systemd-cryptsetup || return 1
- [[ $hostonly ]] || [[ $mount_needs ]] && {
+ [[ $hostonly_mode == "strict" ]] || [[ $mount_needs ]] && {
for fs in "${host_fs_types[@]}"; do
[[ $fs == "crypto_LUKS" ]] && return 0
done
# no point in trying to support it in the initramfs.
require_binaries btrfs || return 1
- [[ $hostonly ]] || [[ $mount_needs ]] && {
+ [[ $hostonly_mode == "strict" ]] || [[ $mount_needs ]] && {
for fs in "${host_fs_types[@]}"; do
[[ $fs == "btrfs" ]] && return 0
done
# if cryptsetup is not installed, then we cannot support encrypted devices.
require_any_binary "$systemdutildir"/systemd-cryptsetup cryptsetup || return 1
- [[ $hostonly ]] || [[ $mount_needs ]] && {
+ [[ $hostonly_mode == "strict" ]] || [[ $mount_needs ]] && {
for fs in "${host_fs_types[@]}"; do
[[ $fs == "crypto_LUKS" ]] && return 0
done
# in case some of the crypto modules moved from compiled in
# to module based, try to install those modules
# best guess
- if [[ $hostonly ]] || [[ $mount_needs ]]; then
+ if [[ $hostonly_mode == "strict" ]] || [[ $mount_needs ]]; then
# dmsetup returns s.th. like
# cryptvol: 0 2064384 crypt aes-xts-plain64 :64:logon:cryptsetup:....
dmsetup table | while read -r name _ _ is_crypt cipher _; do
require_binaries dmraid || return 1
require_binaries kpartx || return 1
- [[ $hostonly ]] || [[ $mount_needs ]] && {
+ [[ $hostonly_mode == "strict" ]] || [[ $mount_needs ]] && {
for dev in "${!host_fs_types[@]}"; do
[[ ${host_fs_types[$dev]} != *_raid_member ]] && continue
fi
fi
- # if not on hostonly mode, install all known filesystems,
+ # if not on strict hostonly mode, install all known filesystems,
# if the required list is not set via the filesystems variable
- if ! [[ $hostonly ]]; then
+ if [[ $hostonly_mode != "strict" ]]; then
if [[ -z $filesystems ]]; then
dracut_instmods -o -P ".*/(kernel/fs/nfs|kernel/fs/nfsd|kernel/fs/lockd)/.*" '=fs'
fi
# No point trying to support lvm if the binaries are missing
require_binaries lvm grep || return 1
- [[ $hostonly ]] || [[ $mount_needs ]] && {
+ [[ $hostonly_mode == "strict" ]] || [[ $mount_needs ]] && {
for fs in "${host_fs_types[@]}"; do
[[ $fs == LVM*_member ]] && return 0
done
# No mdadm? No mdraid support.
require_binaries mdadm expr || return 1
- [[ $hostonly ]] || [[ $mount_needs ]] && {
+ [[ $hostonly_mode == "strict" ]] || [[ $mount_needs ]] && {
for dev in "${!host_fs_types[@]}"; do
[[ ${host_fs_types[$dev]} != *_raid_member ]] && continue
require_binaries multipath || return 1
require_binaries kpartx || return 1
- [[ $hostonly ]] || [[ $mount_needs ]] && {
+ [[ $hostonly_mode == "strict" ]] || [[ $mount_needs ]] && {
for_each_host_dev_and_slaves is_mpath || return 255
}
check() {
is_qemu_virtualized && return 0
- if [[ $hostonly ]] || [[ $mount_needs ]]; then
+ if [[ $hostonly_mode == "strict" ]] || [[ $mount_needs ]]; then
return 255
fi
check() {
is_qemu_virtualized && return 0
- if [[ $hostonly ]] || [[ $mount_needs ]]; then
+ if [[ $hostonly_mode == "strict" ]] || [[ $mount_needs ]]; then
return 255
fi
# If our prerequisites are not met, fail anyways.
require_binaries mount.cifs || return 1
- [[ $hostonly ]] || [[ $mount_needs ]] && {
+ [[ $hostonly_mode == "strict" ]] || [[ $mount_needs ]] && {
for fs in "${host_fs_types[@]}"; do
[[ $fs == "cifs" ]] && return 0
done
block_is_fcoe "$1" || return 1
}
- [[ $hostonly ]] || [[ $mount_needs ]] && {
+ [[ $hostonly_mode == "strict" ]] || [[ $mount_needs ]] && {
for_each_host_dev_and_slaves is_fcoe || return 255
[ -d /sys/firmware/efi ] || return 255
}
block_is_fcoe "$1" || return 1
}
- [[ $hostonly ]] || [[ $mount_needs ]] && {
+ [[ $hostonly_mode == "strict" ]] || [[ $mount_needs ]] && {
for_each_host_dev_and_slaves is_fcoe || return 255
}
require_binaries iscsi-iname iscsiadm iscsid || return 1
require_kernel_modules iscsi_tcp || return 1
- # If hostonly was requested, fail the check if we are not actually
+ # If hostonly strict was requested, fail the check if we are not actually
# booting from root.
- [[ $hostonly ]] || [[ $mount_needs ]] && {
+ [[ $hostonly_mode == "strict" ]] || [[ $mount_needs ]] && {
pushd . > /dev/null
for_each_host_dev_and_slaves block_is_iscsi
local _is_iscsi=$?
# called by dracut
check() {
- [[ $hostonly ]] || [[ $mount_needs ]] && {
+ [[ $hostonly_mode == "strict" ]] || [[ $mount_needs ]] && {
[ -w /sys/module/scsi_mod/parameters/scan ] || return 255
read -r scan_type < /sys/module/scsi_mod/parameters/scan
[ "$scan_type" = "manual" ] && return 0
# if an nbd device is not somewhere in the chain of devices root is
# mounted on, fail the hostonly check.
- [[ $hostonly ]] || [[ $mount_needs ]] && {
+ [[ $hostonly_mode == "strict" ]] || [[ $mount_needs ]] && {
_rootdev=$(find_root_block_device)
[[ -b /dev/block/$_rootdev ]] || return 1
check_block_and_slaves block_is_nbd "$_rootdev" || return 255
require_any_binary rpcbind portmap || return 1
require_binaries rpc.statd mount.nfs mount.nfs4 umount sed chmod chown || return 1
- [[ $hostonly ]] || [[ $mount_needs ]] && {
+ [[ $hostonly_mode == "strict" ]] || [[ $mount_needs ]] && {
[[ "$(get_nfs_type)" ]] && return 0
return 255
}
[[ $found ]]
}
- [[ $hostonly ]] || [[ $mount_needs ]] && {
+ [[ $hostonly_mode == "strict" ]] || [[ $mount_needs ]] && {
[ -f /etc/nvme/hostnqn ] || return 255
[ -f /etc/nvme/hostid ] || return 255
pushd . > /dev/null
# called by dracut
check() {
- [[ $hostonly ]] || [[ $mount_needs ]] && {
+ [[ $hostonly_mode == "strict" ]] || [[ $mount_needs ]] && {
is_qemu_virtualized && return 0
for fs in "${host_fs_types[@]}"; do
# called by dracut
installkernel() {
# xfs/btrfs/ext4 need crc32c, f2fs needs crc32
- if [[ $hostonly ]]; then
+ if [[ $hostonly_mode == "strict" ]]; then
for_each_host_dev_fs include_fs_helper_modules
:
else
xfs_db xfs_check xfs_repair xfs_metadump
e2fsck jfs_fsck btrfsck
)
- if [[ $hostonly ]]; then
+ if [[ $hostonly_mode == "strict" ]]; then
read -r -a _helpers < <(for_each_host_dev_fs echo_fs_helper)
fi
else