]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
add xz compression for kernel modules
authorJames Buren <ryuo@frugalware.org>
Sun, 22 Jan 2012 19:02:47 +0000 (13:02 -0600)
committerHarald Hoyer <harald@redhat.com>
Mon, 23 Jan 2012 08:59:39 +0000 (09:59 +0100)
dracut-functions
modules.d/40network/module-setup.sh
modules.d/90kernel-modules/module-setup.sh
modules.d/90multipath/module-setup.sh
modules.d/95iscsi/module-setup.sh

index a9b15ccd2bf44d0d38125f8928c5f21814bcff55..3852478b18780e7225c9786abeb5c43153ec6fa6 100755 (executable)
@@ -364,7 +364,7 @@ inst_simple() {
         inst "${_src%/*}/.${_src##*/}.hmac" "${target%/*}/.${target##*/}.hmac"
     fi
     ddebug "Installing $_src"
-    cp --sparse=always -pfL "$_src" "${initdir}/$target" 
+    cp --sparse=always -pfL "$_src" "${initdir}/$target"
 }
 
 # find symlinks linked to given library file
@@ -508,7 +508,7 @@ inst_symlink() {
     if [[ -d $_realsrc ]]; then
         inst_dir "$_realsrc"
     else
-        inst "$_realsrc" && mkdir -m 0755 -p "${_target%/*}" 
+        inst "$_realsrc" && mkdir -m 0755 -p "${_target%/*}"
     fi
     if [[ -e "${_src}" ]]; then
         ln -sfn $(convert_abs_rel "${_src}" "${_realsrc}") "$_target"
@@ -984,6 +984,7 @@ filter_kernel_modules_by_path () (
     if ! [[ $hostonly ]]; then
         _filtercmd='find "$srcmods/kernel/$1" "$srcmods/extra"'
         _filtercmd+=' "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz"'
+        _filtercmd+=' -o -name "*.ko.xz"'
         _filtercmd+=' 2>/dev/null'
     else
         _filtercmd='cut -d " " -f 1 </proc/modules|xargs modinfo -F filename '
@@ -996,13 +997,17 @@ filter_kernel_modules_by_path () (
                 $2 $initdir/$$.ko && echo "$_modname"
                 rm -f $initdir/$$.ko
                 ;;
+            *.ko.xz) xz -dc "$_modname" > $initdir/$$.ko
+                $2 $initdir/$$.ko && echo "$_modname"
+                rm -f $initdir/$$.ko
+                ;;
         esac
     done
 )
 find_kernel_modules_by_path () (
     if ! [[ $hostonly ]]; then
         find "$srcmods/kernel/$1" "$srcmods/extra" "$srcmods/weak-updates" \
-          -name "*.ko" -o -name "*.ko.gz" 2>/dev/null
+          -name "*.ko" -o -name "*.ko.gz" -o -name "*.ko.xz" 2>/dev/null
     else
         cut -d " " -f 1 </proc/modules \
         | xargs modinfo -F filename -k $kernel 2>/dev/null
index fbf6f3469456441416b7d45bcd963d4a5941d8ca..6c4ae92f14bcc744ffd49ae79e1ce6d9db7b7e6c 100755 (executable)
@@ -36,6 +36,7 @@ installkernel() {
                 case "$_fname" in
                     *.ko)    _fcont="$(<        $_fname)" ;;
                     *.ko.gz) _fcont="$(gzip -dc $_fname)" ;;
+                    *.ko.xz) _fcont="$(xz -dc   $_fname)" ;;
                 esac
                 [[   $_fcont =~ $_net_drivers
                 && ! $_fcont =~ iw_handler_get_spy ]] \
index 78884289d6a4aa18974bc6a5a3a95ad5d2323b32..46d85916c71ea4e7042164188e70619e8cfe9522 100755 (executable)
@@ -13,6 +13,7 @@ installkernel() {
                 while read _f; do case "$_f" in
                     *.ko)    [[ $(<         $_f) =~ $_blockfuncs ]] && echo "$_f" ;;
                     *.ko.gz) [[ $(gzip -dc <$_f) =~ $_blockfuncs ]] && echo "$_f" ;;
+                    *.ko.xz) [[ $(xz -dc   <$_f) =~ $_blockfuncs ]] && echo "$_f" ;;
                     esac
                 done
             }
index 43f0a3dbe04ec2a1ef8b7ebdb30bb1b223e41bd0..1502f59ae2246f48fe3491a84e17dec6e74895c2 100755 (executable)
@@ -40,6 +40,7 @@ installkernel() {
         while read _f; do case "$_f" in
             *.ko)    [[ $(<         $_f) =~ $_mpfuncs ]] && echo "$_f" ;;
             *.ko.gz) [[ $(gzip -dc <$_f) =~ $_mpfuncs ]] && echo "$_f" ;;
+            *.ko.xz) [[ $(xz -dc   <$_f) =~ $_mpfuncs ]] && echo "$_f" ;;
             esac
         done
     }
index 8caaf73922a50edcc92eb4ab10c9d99e6366cf04..560507c27a1a0ba210f27849b17c535a81cab1b1 100755 (executable)
@@ -48,6 +48,7 @@ installkernel() {
         while read _f; do case "$_f" in
             *.ko)    [[ $(<         $_f) =~ $_iscsifuncs ]] && echo "$_f" ;;
             *.ko.gz) [[ $(gzip -dc <$_f) =~ $_iscsifuncs ]] && echo "$_f" ;;
+            *.ko.xz) [[ $(xz -dc   <$_f) =~ $_iscsifuncs ]] && echo "$_f" ;;
             esac
         done
     }