ci: Get kernel version
When building with the SDK the build scripts have to specify the
kernel version (and GCC). This was hardcoded, which is fine as the CI
scripts are checked into the repo where the changes are made.
Hoover it's one more thing to remember when bumping the kernel version.
This grabs it from the BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE in the
given config file, which should always be set.
Signed-off-by: Joel Stanley <joel@jms.id.au>
diff --git a/ci/build-all-defconfigs.sh b/ci/build-all-defconfigs.sh
index 0ab53bf..e1455b2 100755
--- a/ci/build-all-defconfigs.sh
+++ b/ci/build-all-defconfigs.sh
@@ -39,6 +39,12 @@
esac
done
+function get_kernel_release
+{
+ IFS=. read major minor macro <<<"$1"
+ echo -n "${major}_${minor}"
+}
+
if [ -z "${PLATFORM_LIST}" ]; then
echo "Using all the defconfigs for all the platforms"
DEFCONFIGS=`(cd openpower/configs; ls -1 *_defconfig)`
@@ -84,7 +90,11 @@
./buildroot/utils/config --file $O/.config --set-val BR2_TOOLCHAIN_EXTERNAL_CXX y
# FIXME: How do we work this out programatically?
./buildroot/utils/config --file $O/.config --set-val BR2_TOOLCHAIN_EXTERNAL_GCC_6 y
- ./buildroot/utils/config --file $O/.config --set-val BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_18 y
+
+ KERNEL_VER=$(./buildroot/utils/config --file $O/.config --state BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE)
+ echo "KERNEL_VER " $KERNEL_VER
+ HEADERS=BR2_TOOLCHAIN_EXTERNAL_HEADERS_$(get_kernel_release $KERNEL_VER)
+ ./buildroot/utils/config --file $O/.config --set-val $HEADERS y
fi
op-build O=$O olddefconfig
op-build O=$O