Skip to content

Commit

Permalink
Support arm64 in fetch-linux-headers.sh
Browse files Browse the repository at this point in the history
Only minor modifications were necessary to get this to work!
  • Loading branch information
yuvipanda committed Oct 31, 2023
1 parent 478404c commit 33caece
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions build/init/fetch-linux-headers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 33caece

Please sign in to comment.