kernel/kernel-std/files/mod-sign.sh
Jiping Ma 2cb3d041cd Upgrade to 5.10 Linux kernel.
Move to kernel version 5.10 using source from the Yocto Project.
1. Add STX patches for kernel 5.10.
2. Support git source for linux-yocto.
3. Add build_srpm from build-tools/default_build_srpm
   and modified for git repo from yocto
4. Modify std and rt config files.
5. Build python-perf instead of python3-perf for std kernel.
   python-perf is needed by tuned-2.8.0-5.el7.noarch.
6. Modify rt spec to build out package kernel-rt-tools and kernel-rt-kvm.
7. Add kernel-5.10.30-x86_64-rt.config.tis_extra and
   kernel-5.10.30-x86_64.config.tis_extra
8. Add a dist field to avoid undesired rebuilds.
9. Ensure -unsigned package is populated

Story: 2008921
Partial-Task: 42519

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Vefa Bicakci <vefa.bicakci@windriver.com>
Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
Change-Id: Id1f635302f265826f7ff2860a3bed4b7755b2888
2021-07-26 02:40:01 -04:00

38 lines
1.1 KiB
Bash
Executable File

#! /bin/bash
# The modules_sign target checks for corresponding .o files for every .ko that
# is signed. This doesn't work for package builds which re-use the same build
# directory for every flavour, and the .config may change between flavours.
# So instead of using this script to just sign lib/modules/$KernelVer/extra,
# sign all .ko in the buildroot.
# This essentially duplicates the 'modules_sign' Kbuild target and runs the
# same commands for those modules.
MODSECKEY=$1
MODPUBKEY=$2
moddir=$3
modules=`find $moddir -type f -name '*.ko'`
NPROC=`nproc`
[ -z "$NPROC" ] && NPROC=1
# NB: this loop runs 2000+ iterations. Try to be fast.
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 # xargs appends ARG1 ARG2..., which go into $mod in for loop.
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