Update to 032
[platform/upstream/dracut.git] / dracut.sh
index d0d1c11..117f877 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -346,6 +346,8 @@ TEMP=$(unset POSIXLY_CORRECT; getopt \
     --long printsize \
     --long regenerate-all \
     --long noimageifnotneeded \
+    --long early-microcode \
+    --long no-early-microcode \
     -- "$@")
 
 if (( $? != 0 )); then
@@ -388,8 +390,8 @@ while :; do
         --kernel-only) kernel_only="yes"; no_kernel="no";;
         --no-kernel)   kernel_only="no"; no_kernel="yes";;
         --print-cmdline) print_cmdline="yes"; hostonly_l="yes"; kernel_only="yes"; no_kernel="yes";;
-        --early-microcode) early_microcode="yes";;
-        --no-early-microcode) early_microcode="no";;
+        --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";;
@@ -414,7 +416,7 @@ while :; do
         -N|--no-hostonly|--no-host-only)
                        hostonly_l="no" ;;
         --persistent-policy)
-                       persistent_policy="$2"; shift;;
+                       persistent_policy_l="$2"; shift;;
         --fstab)       use_fstab_l="yes" ;;
         -h|--help)     long_usage; exit 1 ;;
         -i|--include)  push include_src "$2"
@@ -654,6 +656,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
 [[ $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
@@ -665,6 +668,8 @@ stdloglvl=$((stdloglvl + verbosity_mod_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//:/ }
 
@@ -905,7 +910,8 @@ if [[ $hostonly ]]; then
             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=}"
@@ -1006,7 +1012,7 @@ mods_to_load=""
 for_each_module_dir check_module
 for_each_module_dir check_mount
 
-[[ "$mods_to_load " == *01fips\ * ]] && export DRACUT_FIPS_MODE=1
+dracut_module_included "fips" && export DRACUT_FIPS_MODE=1
 
 if [[ $print_cmdline ]]; then
     modules_loaded=" "