Skip to content

Commit

Permalink
Closes 2b-t#1. fix: Fixed missing public key with GPG resulting in te…
Browse files Browse the repository at this point in the history
…rmination of compilation script
  • Loading branch information
2b-t committed May 27, 2022
1 parent 2487a7a commit b3f1729
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions compile_kernel_preemptrt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,21 @@ function download_and_extract_preemptrt {
# Sign the kernel and the patch
function sign_kernel_and_preemptrt {
echo "Signing keys..."
gpg2 --verify linux-${KERNEL_VER_FULL}.tar.sign
if [ $? -ne 0 ]
then
local KERNEL_KEY=$(gpg2 --verify linux-${KERNEL_VER_FULL}.tar.sign 2>&1 | grep -o -P '(?<=RSA key )(.*)')
gpg2 --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys ${KERNEL_KEY}
gpg2 --verify linux-${KERNEL_VER_FULL}.tar.sign
# Catch non-zero exit code despite "set -e", see https://stackoverflow.com/a/57189853
if gpg2 --verify linux-${KERNEL_VER_FULL}.tar.sign; then
:
else
local KERNEL_KEY=$(gpg2 --verify linux-${KERNEL_VER_FULL}.tar.sign 2>&1 | grep -o -P '(?<=RSA key )(.*)')
gpg2 --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys ${KERNEL_KEY}
gpg2 --verify linux-${KERNEL_VER_FULL}.tar.sign
fi
gpg2 --verify patch-${PREEMPT_RT_VER_FULL}.patch.sign
if [ $? -ne 0 ]
then
local PREEMPT_KEY=$(gpg2 --verify patch-${PREEMPT_RT_VER_FULL}.patch.sign 2>&1 | grep -o -P '(?<=RSA key )(.*)')
gpg2 --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys ${PREEMPT_KEY}
gpg2 --verify patch-${PREEMPT_RT_VER_FULL}.patch.sign

if gpg2 --verify patch-${PREEMPT_RT_VER_FULL}.patch.sign; then
:
else
local PREEMPT_KEY=$(gpg2 --verify patch-${PREEMPT_RT_VER_FULL}.patch.sign 2>&1 | grep -o -P '(?<=RSA key )(.*)')
gpg2 --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys ${PREEMPT_KEY}
gpg2 --verify patch-${PREEMPT_RT_VER_FULL}.patch.sign
fi
}

Expand Down

0 comments on commit b3f1729

Please sign in to comment.