[[ -z ${1##/*} ]] || _delim="/"
if [[ $1 == *.so* ]]; then
- # shellcheck disable=SC2154
for l in $libdirs; do
_path="${l}${_delim}${1}"
if { $DRACUT_LDD "${dracutsysrootdir}${_path}" &> /dev/null; }; then
dlog_init
fi
-# shellcheck disable=SC2154
if ! [[ $initdir ]]; then
dfatal "initdir not set"
exit 1
export kernel
fi
-# shellcheck disable=SC2154
srcmods="$dracutsysrootdir/lib/modules/$kernel/"
-# shellcheck disable=SC2154
[[ $drivers_dir ]] && {
if ! command -v kmod &> /dev/null && vercmp "$(modprobe --version | cut -d' ' -f3)" lt 3.7; then
dfatal 'To use --kmoddir option module-init-tools >= 3.7 is required.'
# to check for required installed binaries
# issues a standardized warning message
require_binaries() {
- # shellcheck disable=SC2154
local _module_name="${moddir##*/}"
local _ret=0
# to check for required kernel modules
# issues a standardized warning message
require_kernel_modules() {
- # shellcheck disable=SC2154
local _module_name="${moddir##*/}"
local _ret=0
}
dracut_module_included() {
- # shellcheck disable=SC2154
[[ " $mods_to_load $modules_loaded " == *\ $*\ * ]]
}
dracut_instmods() {
local _ret _silent=0
local i
- # shellcheck disable=SC2154
[[ $no_kernel == yes ]] && return
for i in "$@"; do
[[ $i == "--silent" ]] && _silent=1
# be applied, else will ignore hostonly mode and try to install all
# given modules.
optional_hostonly() {
- # shellcheck disable=SC2154
if [[ $hostonly_mode == "strict" ]]; then
printf -- "%s" "$hostonly"
else
# shellcheck disable=SC2013
for _prog in $(sed -nr 's/.*PROGRAM==?"([^ "]+).*/\1/p' "$1"); do
_bin=""
- # shellcheck disable=SC2154
if [[ -x ${udevdir}/$_prog ]]; then
_bin="${udevdir}"/$_prog
elif [[ ${_prog/\$env\{/} == "$_prog" ]]; then
local _moddep
[[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1")
- # shellcheck disable=SC2154
[ "${#host_fs_types[@]}" -le 0 ] && return 1
# If we are already scheduled to be loaded, no need to check again.
[[ $2 ]] || mods_checked_as_dep+=" $_mod "
- # shellcheck disable=SC2154
if [[ " $omit_dracutmodules " == *\ $_mod\ * ]]; then
return 1
fi
fi
if [[ $uefi == "yes" ]]; then
- # shellcheck disable=SC2154
if [[ -n $uefi_secureboot_key && -z $uefi_secureboot_cert ]] || [[ -z $uefi_secureboot_key && -n $uefi_secureboot_cert ]]; then
printf "%s\n" "dracut[F]: Need 'uefi_secureboot_key' and 'uefi_secureboot_cert' both to be set." >&2
exit 1
readonly initdir="${DRACUT_TMPDIR}/initramfs"
mkdir -p "$initdir"
-# shellcheck disable=SC2154
if [[ $early_microcode == yes ]] || { [[ $acpi_override == yes ]] && [[ -d $acpi_table_dir ]]; }; then
readonly early_cpio_dir="${DRACUT_TMPDIR}/earlycpio"
mkdir "$early_cpio_dir"
unset enhanced_cpio
fi
-# shellcheck disable=SC2154
if [[ $no_kernel != yes ]] && ! [[ -d $srcmods ]]; then
dfatal "Cannot find module directory $srcmods"
dfatal "and --no-kernel was not specified"
if [[ $kernel_only != yes ]]; then
mkdir -p "${initdir}/etc/cmdline.d"
mkdir -m 0755 "${initdir}"/lib/dracut/hooks
- # shellcheck disable=SC2154
for _d in $hookdirs; do
# shellcheck disable=SC2174
mkdir -m 0755 -p "${initdir}/lib/dracut/hooks/$_d"
fi
fi
-# shellcheck disable=SC2154
if ((maxloglvl >= 5)) && ((verbosity_mod_l >= 0)); then
if [[ $allowlocal ]]; then
"$dracutbasedir/lsinitrd.sh" "${DRACUT_TMPDIR}/initramfs.img" | ddebug
fi
done
- # shellcheck disable=SC2154
if [[ $dracut_rescue_image != "yes" ]]; then
[[ $KERNEL_INSTALL_VERBOSE == 1 ]] \
&& echo "Skipping, 'dracut_rescue_image' not set to 'yes' in any dracut configuration file"
#!/bin/sh
-# shellcheck disable=SC2154
case "$root" in
live:/dev/*)
printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/create-overlay %s"\n' \
install() {
inst_multiple awk blkid cat grep mkdir mount parted readlink rmdir tr umount
inst_multiple -o mkfs.btrfs mkfs.ext4 mkfs.xfs
- # shellcheck disable=SC2154
inst_hook pre-udev 25 "$moddir/create-overlay-genrules.sh"
inst_script "$moddir/create-overlay.sh" "/sbin/create-overlay"
dracut_need_initqueue
cifs_to_var "$root"
-# shellcheck disable=SC2154
mount.cifs "//$server/$path" "$NEWROOT" -o "$options" && { [ -e /dev/root ] || ln -s null /dev/root; }
# inject new exit_if_exists
# shellcheck disable=SC2016
-# shellcheck disable=SC2154
echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm -f -- "$job"' > "$hookdir"/initqueue/cifs.sh
# force udevsettle to break
: > "$hookdir"/initqueue/work
#!/bin/sh
-# shellcheck disable=SC2154
if [ "${root%%:*}" = "block" ]; then
{
printf 'KERNEL=="%s", SYMLINK+="root"\n' \
} >> /etc/udev/rules.d/99-root.rules
# shellcheck disable=SC2016
- # shellcheck disable=SC2154
printf '[ -e "%s" ] && { ln -s "%s" /dev/root 2>/dev/null; rm "$job"; }\n' \
"${root#block:}" "${root#block:}" > "$hookdir"/initqueue/settled/blocksymlink.sh
) < /dev/null 2>&1 | tee "test${TEST_RUN_ID:+-$TEST_RUN_ID}.log"
elif [[ $V == "2" ]]; then
set -o pipefail
- # shellcheck disable=SC2154
(
test_setup && test_run
ret=$?