From 61e18a9205b03e038ed359be8d3fa0715887c770 Mon Sep 17 00:00:00 2001 From: Will Milton Date: Sat, 30 May 2020 22:10:31 +0000 Subject: [PATCH] Fix header generation issues on new GKE clusters - build: add flex and bison packages to init container - fix: google container os detection Co-authored-by: Adelbert Chang Co-authored-by: Will Milton Co-authored-by: dan --- build/Dockerfile.initcontainer | 2 ++ build/init/fetch-linux-headers.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build/Dockerfile.initcontainer b/build/Dockerfile.initcontainer index d927aa5f..1e1207b9 100644 --- a/build/Dockerfile.initcontainer +++ b/build/Dockerfile.initcontainer @@ -3,6 +3,8 @@ RUN apk add --update \ bash \ bc \ build-base \ + bison \ + flex \ curl \ elfutils-dev \ linux-headers \ diff --git a/build/init/fetch-linux-headers.sh b/build/init/fetch-linux-headers.sh index 1eb779a5..df1fae2a 100755 --- a/build/init/fetch-linux-headers.sh +++ b/build/init/fetch-linux-headers.sh @@ -56,7 +56,7 @@ fetch_generic_linux_sources() install_cos_linux_headers() { if grep -q CHROMEOS_RELEASE_VERSION "${LSB_FILE}" >/dev/null; then - BUILD_ID=$(awk '/CHROMEOS_RELEASE_VERSION =/ { print $3 }' "${LSB_FILE}") + BUILD_ID=$(awk '/CHROMEOS_RELEASE_VERSION *= */ { gsub(/^CHROMEOS_RELEASE_VERSION *= */, ""); print }' "${LSB_FILE}") BUILD_DIR="/linux-lakitu-${BUILD_ID}" SOURCES_DIR="${TARGET_DIR}/linux-lakitu-${BUILD_ID}" @@ -88,7 +88,7 @@ install_generic_linux_headers() install_headers() { - distro="$(awk '/^NAME =/ { print $3 }' "${OS_RELEASE_FILE}")" + distro="$(awk '/^NAME *= */ { gsub(/^NAME *= */, ""); print }' "${OS_RELEASE_FILE}")" case $distro in *"Container-Optimized OS"*)