Control: tag -1 upstream patch
---
Also disable stripping modules that have detached signatures.

Signed-off-by: Ben Hutchings <[email protected]>
---
--- a/dracut-init.sh
+++ b/dracut-init.sh
@@ -886,6 +886,10 @@ install_kmod_with_fw() {
 
     inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}"
     ret=$?
+    if (($ret == 0)) && [[ -f "$1.sig" ]]; then
+        inst_simple "$1.sig" 
"/lib/modules/$kernel/${1##*/lib/modules/$kernel/}.sig"
+        ret=$?
+    fi
     [[ $DRACUT_KERNEL_LAZY_HASHDIR ]] && \
         [[ -d "$DRACUT_KERNEL_LAZY_HASHDIR" ]] && \
         echo $ret > "$DRACUT_KERNEL_LAZY_HASHDIR/${1##*/}"
@@ -948,12 +952,16 @@ dracut_kernel_post() {
         (
             if [[ $DRACUT_INSTALL ]] && [[ -z $_moddirname ]]; then
                 xargs -r $DRACUT_INSTALL ${initdir:+-D "$initdir"} 
${loginstall:+-L "$loginstall"} -a < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"
+                sed 's/$/.sig/' "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep" | 
xargs -r $DRACUT_INSTALL -o ${initdir:+-D "$initdir"} ${loginstall:+-L 
"$loginstall"}
             else
                 while read _modpath || [ -n "$_modpath" ]; do
                     local _destpath=$_modpath
                     [[ $_moddirname ]] && _destpath=${_destpath##$_moddirname/}
                     _destpath=${_destpath##*/lib/modules/$kernel/}
                     inst_simple "$_modpath" 
"/lib/modules/$kernel/${_destpath}" || exit $?
+                    if [[ -f "${_modpath}.sig" ]]; then
+                        inst_simple "${_modpath}.sig" 
"/lib/modules/$kernel/${_destpath}.sig" || exit $?
+                    fi
                 done < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"
             fi
         ) &
--- a/dracut.sh
+++ b/dracut.sh
@@ -1596,7 +1596,7 @@ if [[ $do_strip = yes ]] && ! [[ $DRACUT
     find "$initdir" -type f -path '*/lib/modules/*.ko' -print0 \
         | while read -r -d $'\0' f || [ -n "$f" ]; do
         SIG=$(tail -c 28 "$f")
-        [[ $SIG == '~Module signature appended~' ]] || { printf "%s\000" "$f"; 
}
+        [[ $SIG == '~Module signature appended~' ]] || [[ -f "$f.sig" ]] || { 
printf "%s\000" "$f"; }
     done | xargs -r -0 strip -g
 
     dinfo "*** Stripping files done ***"

Attachment: signature.asc
Description: Digital signature

Reply via email to