| #! /bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| MODSECKEY=$1 |
| MODPUBKEY=$2 |
| moddir=$3 |
| |
| modules=`find $moddir -type f -name '*.ko'` |
| |
| NPROC=`nproc` |
| [ -z "$NPROC" ] && NPROC=1 |
| |
| |
| echo "$modules" | xargs -r -n16 -P $NPROC sh -c " |
| for mod; do |
| ./scripts/sign-file sha256 $MODSECKEY $MODPUBKEY \$mod |
| rm -f \$mod.sig \$mod.dig |
| done |
| " DUMMYARG0 |
| |
| RANDOMMOD=$(echo "$modules" | sort -R | head -n 1) |
| if [ "~Module signature appended~" != "$(tail -c 28 $RANDOMMOD)" ]; then |
| echo "*****************************" |
| echo "*** Modules are unsigned! ***" |
| echo "*****************************" |
| exit 1 |
| fi |
| |
| exit 0 |