]> git.ipfire.org Git - thirdparty/dracut.git/blobdiff - dracut-init.sh
Merge branch 'optimization' of https://github.com/ryncsn/dracut into ryncsn-optimization
[thirdparty/dracut.git] / dracut-init.sh
index 2fa1046667828d57c0761f1557cfc76edba8585b..c9043d64b4896239ddf3ac7a5acfa58fd8bc6b97 100644 (file)
@@ -150,6 +150,10 @@ dracut_module_included() {
     [[ " $mods_to_load $modules_loaded " == *\ $*\ * ]]
 }
 
+dracut_no_switch_root() {
+    >"$initdir/lib/dracut/no-switch-root"
+}
+
 dracut_module_path() {
     echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; }
 }
@@ -930,8 +934,16 @@ install_kmod_with_fw() {
     for _fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do
         _found=''
         for _fwdir in $fw_dir; do
-            [[ -d $_fwdir && -f $_fwdir/$_fw ]] || continue
-            inst_simple "$_fwdir/$_fw" "/lib/firmware/$_fw"
+            [[ -d $_fwdir ]] || continue
+            if [[ -f $_fwdir/$_fw ]]; then
+                inst_simple "$_fwdir/$_fw" "/lib/firmware/$_fw"
+            elif [[ -f $_fwdir/$_fw.xz ]]; then
+                inst_simple "$_fwdir/$_fw.xz" "/lib/firmware/$_fw.xz"
+                rm -f "${initdir}/lib/firmware/$_fw"
+                unxz -f "${initdir}/lib/firmware/$_fw.xz"
+            else
+               continue
+            fi
             _found=yes
         done
         if [[ $_found != yes ]]; then