Skip to content

better handle kABI checks on RT kernels #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: mainline
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 40 additions & 8 deletions kernel_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,25 @@

pwd

BRANCH=$(git branch | grep \* | cut -d ' ' -f2 | sed -r 's/[{}/]/_/g')
REAL_BRANCH="$(git branch --show-current)"
# Enforce branch naming so that we can determine
# 1. If a kABI check is even necessary
# 2. Which git tag to checkout in the kernel-dist-git
# Can do with an if but I always get it wrong
if ! echo "$REAL_BRANCH" | grep -q -E '((ciqlts[0-9]+_[0-9]+(-rt)?|ciqcbr7_9)$|fips-([0-9]+|legacy-[0-9]+)(-compliant|-certified)?/)'; then
echo "Unexpected branch name."
echo "Either of the following must be present (part of) in the branch name, enforced for kABI check."
echo "- 'ciqcbr7_9'"
echo "- 'ciqltsX_Y'"
echo "- 'ciqltsX_Y-rt'"
echo "- 'fips-legacy-X-compliant/'"
echo "- 'fips-legacy-X/'"
echo "- 'fips-X/'"
echo "- 'fips-X-compliant/'"
echo "- 'fips-X-certified/'"
exit 1
fi
BRANCH=$(echo "$REAL_BRANCH" | sed -r 's/[{}/]/_/g')

START=$(date +%s)
START_MRPROPER=$(date +%s)
Expand Down Expand Up @@ -86,14 +104,28 @@ fi
END_INSTALL=$(date +%s)
echo "[TIMER]{INSTALL}: $(( $END_INSTALL - $START_INSTALL ))s"

echo "Checking kABI"
# ../kernel-dist-git/SOURCES/check-kabi -k ../kernel-dist-git/SOURCES/Module.kabi_x86_64 -s Module.symvers || echo "kABI failed"
KABI_CHECK=$(../kernel-dist-git/SOURCES/check-kabi -k ../kernel-dist-git/SOURCES/Module.kabi_${ARCH} -s Module.symvers)
if [ $? -ne 0 ]; then
echo "Error: kABI check failed"
exit 1
CHECK_KABI=true
# We disable kABI checks only on RT kernels up-to 9.4
if echo "$REAL_BRANCH" | grep -q 'ciqlts8_6-rt'; then
CHECK_KABI=false

elif echo "$REAL_BRANCH" | grep -q 'ciqlts8_8-rt'; then
CHECK_KABI=false

elif echo "$REAL_BRANCH" | grep -q 'ciqlts9_2-rt'; then
CHECK_KABI=false
fi

if [ $CHECK_KABI == 'true' ]; then
echo "Checking kABI"
KABI_CHECK=$(../kernel-dist-git/SOURCES/check-kabi -k ../kernel-dist-git/SOURCES/Module.kabi_${ARCH} -s Module.symvers)
if [ $? -ne 0 ]; then
echo -e "Error: kABI check failed for following symbols:\n$KABI_CHECK"
exit 1
else
echo "kABI check passed"
fi
fi
echo "kABI check passed"

GRUB_INFO=$(sudo grubby --info=ALL | grep -E "^kernel|^index")

Expand Down