--omit-drivers --modules --omit --drivers --filesystems --install
--fwdir --libdirs --fscks --add-fstab --mount --device --nofscks
--kmoddir --conf --confdir --tmpdir --stdlog --compress --prefix
- --kernel-cmdline --sshkey'
+ --kernel-cmdline --sshkey --persistent-policy'
)
if __contains_word "$prev" ${OPTS[ARG]}; then
-a|-m|-o|--add|--modules|--omit)
comps=$(dracut --list-modules 2>/dev/null)
;;
+ --persistent-policy)
+ comps=$(cd /dev/disk/; echo *)
+ ;;
--kver)
comps=$(cd /lib/modules; echo [0-9]*)
;;
_dev=$(get_maj_min "$1")
[ -z "$_dev" ] && return
- for i in /dev/mapper/* /dev/disk/by-uuid/* /dev/disk/by-id/*; do
+ for i in \
+ /dev/mapper/* \
+ /dev/disk/$persistent_policy/* \
+ /dev/disk/by-uuid/* \
+ /dev/disk/by-label/* \
+ /dev/disk/by-partuuid/* \
+ /dev/disk/by-partlabel/* \
+ /dev/disk/by-id/* \
+ /dev/disk/by-path/* \
+ ; do
[[ $i == /dev/mapper/control ]] && continue
[[ $i == /dev/mapper/mpath* ]] && continue
_tmp=$(get_maj_min "$i")
done
}
+shorten_persistent_dev() {
+ local dev="$1"
+ case "$dev" in
+ /dev/disk/by-uuid/*)
+ printf "%s" "UUID=${dev##*/}";;
+ /dev/disk/by-label/*)
+ printf "%s" "LABEL=${dev##*/}";;
+ /dev/disk/by-partuuid/*)
+ printf "%s" "PARTUUID=${dev##*/}";;
+ /dev/disk/by-partlabel/*)
+ printf "%s" "PARTLABEL=${dev##*/}";;
+ *)
+ printf "%s" "$dev";;
+ esac
+}
+
# find_block_device <mountpoint>
# Prints the major and minor number of the block device
# for a given mountpoint.
**-N, --no-hostonly**::
Disable 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_ instead of _/proc/self/mountinfo_.
/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 host-only \
--long no-hostonly \
--long no-host-only \
+ --long persistent-policy: \
--long fstab \
--long help \
--long bzip2 \
hostonly_l="yes" ;;
-N|--no-hostonly|--no-host-only)
hostonly_l="no" ;;
+ --persistent-policy)
+ persistent_policy="$2"; shift;;
--fstab) use_fstab_l="yes" ;;
-h|--help) long_usage; exit 1 ;;
-i|--include) push include_src "$2"
cmdline() {
local dev=/dev/block/$(find_root_block_device)
if [ -e $dev ]; then
- printf " root=%s" $(get_persistent_dev "$dev")
- printf " rootflags=%s" $(find_mp_fsopts /)
- printf " rootfstype=%s" $(find_mp_fstype /)
+ printf " root=%s" "$(shorten_persistent_dev "$(get_persistent_dev "$dev")")"
+ printf " rootflags=%s" "$(find_mp_fsopts /)"
+ printf " rootfstype=%s" "$(find_mp_fstype /)"
fi
}