|
3 | 3 |
|
4 | 4 | pwd
|
5 | 5 |
|
6 |
| -BRANCH=$(git branch | grep \* | cut -d ' ' -f2 | sed -r 's/[{}/]/_/g') |
| 6 | +REAL_BRANCH="$(git branch --show-current)" |
| 7 | +# Enforce branch naming so that we can determine |
| 8 | +# 1. If a kABI check is even necessary |
| 9 | +# 2. Which git tag to checkout in the kernel-dist-git |
| 10 | +# Can do with an if but I always get it wrong |
| 11 | +if ! echo "$REAL_BRANCH" | grep -q -E '((ciqlts[0-9]+_[0-9]+(-rt)?|ciqcbr7_9)$|fips-([0-9]+|legacy-[0-9]+)(-compliant|-certified)?/)'; then |
| 12 | + echo "Unexpected branch name." |
| 13 | + echo "Either of the following must be present (part of) in the branch name, enforced for kABI check." |
| 14 | + echo "- 'ciqcbr7_9'" |
| 15 | + echo "- 'ciqltsX_Y'" |
| 16 | + echo "- 'ciqltsX_Y-rt'" |
| 17 | + echo "- 'fips-legacy-X-compliant/'" |
| 18 | + echo "- 'fips-legacy-X/'" |
| 19 | + echo "- 'fips-X/'" |
| 20 | + echo "- 'fips-X-compliant/'" |
| 21 | + echo "- 'fips-X-certified/'" |
| 22 | + exit 1 |
| 23 | +fi |
| 24 | +BRANCH=$(echo "$REAL_BRANCH" | sed -r 's/[{}/]/_/g') |
7 | 25 |
|
8 | 26 | START=$(date +%s)
|
9 | 27 | START_MRPROPER=$(date +%s)
|
|
86 | 104 | END_INSTALL=$(date +%s)
|
87 | 105 | echo "[TIMER]{INSTALL}: $(( $END_INSTALL - $START_INSTALL ))s"
|
88 | 106 |
|
89 |
| -echo "Checking kABI" |
90 |
| -# ../kernel-dist-git/SOURCES/check-kabi -k ../kernel-dist-git/SOURCES/Module.kabi_x86_64 -s Module.symvers || echo "kABI failed" |
91 |
| -KABI_CHECK=$(../kernel-dist-git/SOURCES/check-kabi -k ../kernel-dist-git/SOURCES/Module.kabi_${ARCH} -s Module.symvers) |
92 |
| -if [ $? -ne 0 ]; then |
93 |
| - echo "Error: kABI check failed" |
94 |
| - exit 1 |
| 107 | +# "temporary" duct tape |
| 108 | +KERNEL_DIST_GIT_TAG=undecided |
| 109 | +CHECK_KABI=undecided |
| 110 | +# TODO: find status of FIPS and CBR and implement it here |
| 111 | +if echo "$REAL_BRANCH" | grep -q 'ciqlts8_6-rt'; then |
| 112 | + CHECK_KABI=false |
| 113 | + |
| 114 | +elif echo "$REAL_BRANCH" | grep -q 'ciqlts8_8-rt'; then |
| 115 | + CHECK_KABI=false |
| 116 | + |
| 117 | +elif echo "$REAL_BRANCH" | grep -q 'ciqlts9_2-rt'; then |
| 118 | + CHECK_KABI=false |
| 119 | + |
| 120 | +elif echo "$REAL_BRANCH" | grep -q 'ciqlts8_6'; then |
| 121 | + CHECK_KABI=true |
| 122 | + KERNEL_DIST_GIT_TAG='imports/r8/kernel-4.18.0-372.32.1.el8_6' |
| 123 | + |
| 124 | +elif echo "$REAL_BRANCH" | grep -q 'ciqlts8_8'; then |
| 125 | + CHECK_KABI=true |
| 126 | + KERNEL_DIST_GIT_TAG='imports/r8/kernel-4.18.0-477.27.1.el8_8' |
| 127 | + |
| 128 | +elif echo "$REAL_BRANCH" | grep -q 'ciqlts9_2'; then |
| 129 | + CHECK_KABI=true |
| 130 | + KERNEL_DIST_GIT_TAG='imports/r9/kernel-5.14.0-284.30.1.el9_2' |
| 131 | + |
| 132 | +elif echo "$REAL_BRANCH" | grep -q 'ciqlts9_4'; then |
| 133 | + CHECK_KABI=true |
| 134 | + KERNEL_DIST_GIT_TAG='imports/r9/kernel-5.14.0-427.42.1.el9_4' |
| 135 | + |
| 136 | +else |
| 137 | + echo "Warning: Could not determine if kABI check was necessary, defaulting to 'no.'" |
| 138 | + CHECK_KABI=false |
| 139 | +fi |
| 140 | + |
| 141 | +if [ $CHECK_KABI == 'true' ]; then |
| 142 | + echo "Checking kABI" |
| 143 | + if [ ! -d ../kernel-dist-git ]; then |
| 144 | + echo "Error: kernel-dist-git is missing." |
| 145 | + echo "RUN: 'git clone https://git.rockylinux.org/staging/rpms/kernel.git $(realpath ../kernel-dist-git)'" |
| 146 | + echo "RUN: 'git -C $(realpath ../kernel-dist-git) checkout $KERNEL_DIST_GIT_TAG'" |
| 147 | + exit 1 |
| 148 | + fi |
| 149 | + # make sure we're on the right branch (the commit author is bad at this and this check exists for him) |
| 150 | + git -C "$(realpath ../kernel-dist-git)" checkout "$KERNEL_DIST_GIT_TAG" |
| 151 | + KABI_CHECK=$(../kernel-dist-git/SOURCES/check-kabi -k ../kernel-dist-git/SOURCES/Module.kabi_${ARCH} -s Module.symvers) |
| 152 | + if [ $? -ne 0 ]; then |
| 153 | + echo "Error: kABI check failed" |
| 154 | + exit 1 |
| 155 | + fi |
| 156 | + |
| 157 | + echo "kABI check passed" |
95 | 158 | fi
|
96 |
| -echo "kABI check passed" |
97 | 159 |
|
98 | 160 | GRUB_INFO=$(sudo grubby --info=ALL | grep -E "^kernel|^index")
|
99 | 161 |
|
|
0 commit comments