firmwares, separated by :
--kernel-only Only install kernel drivers and firmware files
--no-kernel Do not install kernel drivers and firmware files
+ --print-cmdline Print the kernel command line for the given disk layout
--early-microcode Combine early microcode with ramdisk
--no-early-microcode Do not combine early microcode with ramdisk
--kernel-cmdline [PARAMETERS] Specify default kernel command line parameters
/usr/lib/dracut/modules.d.
Useful when running dracut from a git checkout.
-H, --hostonly Host-Only mode: Install only what is needed for
- booting the local host instead of a generic host.
+ booting the local host instead of a generic host.
-N, --no-hostonly Disables Host-Only mode
+ --persistent-policy [POLICY]
+ Use [POLICY] to address disks and partitions.
+ POLICY can be any directory name found in /dev/disk.
+ E.g. "by-uuid", "by-label"
--fstab Use /etc/fstab to determine the root device.
--add-fstab [FILE] Add file to the initramfs fstab
--mount "[DEV] [MP] [FSTYPE] [FSOPTS]"
--long force \
--long kernel-only \
--long no-kernel \
+ --long print-cmdline \
--long kernel-cmdline: \
--long strip \
--long nostrip \
--long host-only \
--long no-hostonly \
--long no-host-only \
+ --long persistent-policy: \
--long fstab \
--long help \
--long bzip2 \
--long printsize \
--long regenerate-all \
--long noimageifnotneeded \
+ --long early-microcode \
+ --long no-early-microcode \
-- "$@")
if (( $? != 0 )); then
-f|--force) force=yes;;
--kernel-only) kernel_only="yes"; no_kernel="no";;
--no-kernel) kernel_only="no"; no_kernel="yes";;
- --early-microcode) early_microcode="yes";;
- --no-early-microcode) early_microcode="no";;
+ --print-cmdline) print_cmdline="yes"; hostonly_l="yes"; kernel_only="yes"; no_kernel="yes";;
+ --early-microcode) early_microcode_l="yes";;
+ --no-early-microcode) early_microcode_l="no";;
--strip) do_strip_l="yes";;
--nostrip) do_strip_l="no";;
--hardlink) do_hardlink_l="yes";;
hostonly_l="yes" ;;
-N|--no-hostonly|--no-host-only)
hostonly_l="no" ;;
+ --persistent-policy)
+ persistent_policy_l="$2"; shift;;
--fstab) use_fstab_l="yes" ;;
-h|--help) long_usage; exit 1 ;;
-i|--include) push include_src "$2"
[[ $prefix_l ]] && prefix=$prefix_l
[[ $prefix = "/" ]] && unset prefix
[[ $hostonly_l ]] && hostonly=$hostonly_l
+[[ $persistent_policy_l ]] && persistent_policy=$persistent_policy_l
[[ $use_fstab_l ]] && use_fstab=$use_fstab_l
[[ $mdadmconf_l ]] && mdadmconf=$mdadmconf_l
[[ $lvmconf_l ]] && lvmconf=$lvmconf_l
[[ $show_modules_l ]] && show_modules=$show_modules_l
[[ $nofscks_l ]] && nofscks="yes"
[[ $ro_mnt_l ]] && ro_mnt="yes"
+[[ $early_microcode_l ]] && early_microcode=$early_microcode_l
+[[ $early_microcode ]] || early_microcode=no
# eliminate IFS hackery when messing with fw_dir
fw_dir=${fw_dir//:/ }
exit 1
fi
-inst /bin/sh
-if ! $DRACUT_INSTALL ${initdir+-D "$initdir"} -R "$initdir/bin/sh" &>/dev/null; then
- unset DRACUT_RESOLVE_LAZY
- export DRACUT_RESOLVE_DEPS=1
+if ! [[ $print_cmdline ]]; then
+ inst /bin/sh
+ if ! $DRACUT_INSTALL ${initdir+-D "$initdir"} -R "$initdir/bin/sh" &>/dev/null; then
+ unset DRACUT_RESOLVE_LAZY
+ export DRACUT_RESOLVE_DEPS=1
+ fi
+ rm -fr -- ${initdir}/*
fi
-rm -fr -- ${initdir}/*
if [[ -f $dracutbasedir/dracut-version.sh ]]; then
. $dracutbasedir/dracut-version.sh
}
fi
-if [[ -f $outfile && ! $force ]]; then
+if [[ -f $outfile && ! $force && ! $print_cmdline ]]; then
dfatal "Will not override existing initramfs ($outfile) without --force"
exit 1
fi
unset hostonly
fi
done
- if ! [[ -d /run/udev/data ]]; then
- dwarning "Turning off host-only mode: udev database not found!"
- unset hostonly
- fi
fi
declare -A host_fs_types
"/sbin" \
"/lib" \
"/lib64" \
+ "/usr" \
+ "/usr/bin" \
+ "/usr/sbin" \
+ "/usr/lib" \
+ "/usr/lib64" \
"/boot";
do
mp=$(readlink -f "$mp")
mountpoint "$mp" >/dev/null 2>&1 || continue
_dev=$(find_block_device "$mp")
- _bdev=$(readlink -f "/dev/block/$dev")
+ _bdev=$(readlink -f "/dev/block/$_dev")
[[ -b $_bdev ]] && _dev=$_bdev
push host_devs $_dev
[[ "$_mp" == "/" ]] && root_dev="$_dev"
while read _d _m _t _o _r; do
[[ "$_d" == \#* ]] && continue
[[ $_d ]] || continue
- [[ $_t != "swap" ]] || [[ $_m != "swap" ]] && continue
+ [[ $_t != "swap" ]] && continue
+ [[ $_m != "swap" ]] && [[ $_m != "none" ]] && continue
[[ "$_o" == *noauto* ]] && continue
[[ "$_d" == UUID\=* ]] && _d="/dev/disk/by-uuid/${_d#UUID=}"
[[ "$_d" == LABEL\=* ]] && _d="/dev/disk/by-label/$_d#LABEL=}"
[[ $_mapper = \#* ]] && continue
[[ "$_d" -ef /dev/mapper/"$_mapper" ]] || continue
[[ "$_o" ]] || _o="$_p"
- # skip mkswap swap
+ # skip mkswap swap
[[ $_o == *swap* ]] && continue 2
done < /etc/crypttab
fi
check_block_and_slaves_all _get_fs_type "$(get_maj_min "$dev")"
done
+for dev in "${!host_fs_types[@]}"; do
+ [[ ${host_fs_types[$dev]} = "reiserfs" ]] || [[ ${host_fs_types[$dev]} = "xfs" ]] || continue
+ rootopts=$(find_dev_fsopts "$dev")
+ if [[ ${host_fs_types[$dev]} = "reiserfs" ]]; then
+ journaldev=$(fs_get_option $rootopts "jdev")
+ elif [[ ${host_fs_types[$dev]} = "xfs" ]]; then
+ journaldev=$(fs_get_option $rootopts "logdev")
+ fi
+ if [[ $journaldev ]]; then
+ dev="$(readlink -f "$dev")"
+ push host_devs "$dev"
+ _get_fs_type "$dev"
+ check_block_and_slaves_all _get_fs_type "$(get_maj_min "$dev")"
+ fi
+done
+
[[ -d $udevdir ]] \
|| udevdir="$(pkg-config udev --variable=udevdir 2>/dev/null)"
if ! [[ -d "$udevdir" ]]; then
DRACUT_VERSION udevdir prefix filesystems drivers \
systemdutildir systemdsystemunitdir systemdsystemconfdir
+mods_to_load=""
+# check all our modules to see if they should be sourced.
+# This builds a list of modules that we will install next.
+for_each_module_dir check_module
+for_each_module_dir check_mount
+
+dracut_module_included "fips" && export DRACUT_FIPS_MODE=1
+
+if [[ $print_cmdline ]]; then
+ modules_loaded=" "
+ # source our modules.
+ for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
+ _d_mod=${moddir##*/}; _d_mod=${_d_mod#[0-9][0-9]}
+ module_cmdline "$_d_mod"
+ done
+ unset moddir
+ printf "\n"
+ exit 0
+fi
+
# Create some directory structure first
[[ $prefix ]] && mkdir -m 0755 -p "${initdir}${prefix}"
fi
fi
-mods_to_load=""
-# check all our modules to see if they should be sourced.
-# This builds a list of modules that we will install next.
-for_each_module_dir check_module
-for_each_module_dir check_mount
-
-[[ "$mods_to_load " == *01fips\ * ]] && export DRACUT_FIPS_MODE=1
-
_isize=0 #initramfs size
modules_loaded=" "
# source our modules.