From 33caece6b3e8d24cd50f301809df3fa3cd6aa1ff Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Tue, 31 Oct 2023 15:53:21 +0530 Subject: [PATCH] Support arm64 in fetch-linux-headers.sh Only minor modifications were necessary to get this to work! --- build/init/fetch-linux-headers.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build/init/fetch-linux-headers.sh b/build/init/fetch-linux-headers.sh index f872df35..557dac9f 100755 --- a/build/init/fetch-linux-headers.sh +++ b/build/init/fetch-linux-headers.sh @@ -19,8 +19,13 @@ generate_headers() elif [ -e "/boot.host/config-${KERNEL_VERSION}" ]; then cp "/boot.host/config-${KERNEL_VERSION}" .config fi - make ARCH=x86 oldconfig > /dev/null - make ARCH=x86 prepare > /dev/null + + arch="$(uname -m)" + [[ "${arch}" == "x86_64" ]] && arch="x86" + [[ "${arch}" == "aarch64" ]] && arch="arm64" + + make ARCH="${arch}" oldconfig > /dev/null + make ARCH="${arch}" prepare > /dev/null # Clean up abundant non-header files to speed-up copying find "${BUILD_DIR}" -regex '.*\.c\|.*\.txt\|.*Makefile\|.*Build\|.*Kconfig' -type f -delete @@ -112,6 +117,7 @@ check_headers() kdir="${modules_path}/${KERNEL_VERSION}" [[ "${arch}" == "x86_64" ]] && arch="x86" + [[ "${arch}" == "aarch64" ]] && arch="arm64" [[ ! -e "${kdir}" ]] && return 1 [[ ! -e "${kdir}/source" ]] && [[ ! -e "${kdir}/build" ]] && return 1