From c743f77f9979b813da18585e9ca559d26913a62e Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 19 May 2019 19:04:07 +0300 Subject: Modularise architecture handling Signed-off-by: Laurent Pinchart --- arch/arm.sh | 3 +++ arch/arm64.sh | 3 +++ arch/x86.sh | 3 +++ kbuild.sh | 32 ++++++++++++-------------------- 4 files changed, 21 insertions(+), 20 deletions(-) create mode 100644 arch/arm.sh create mode 100644 arch/arm64.sh create mode 100644 arch/x86.sh diff --git a/arch/arm.sh b/arch/arm.sh new file mode 100644 index 0000000..53462fb --- /dev/null +++ b/arch/arm.sh @@ -0,0 +1,3 @@ +arch_dir=arm32 +cross_compile=arm-buildroot-linux-uclibcgnueabihf- +image_kernel=zImage diff --git a/arch/arm64.sh b/arch/arm64.sh new file mode 100644 index 0000000..a4b4b87 --- /dev/null +++ b/arch/arm64.sh @@ -0,0 +1,3 @@ +arch_dir=arm64 +cross_compile=aarch64-buildroot-linux-gnu- +image_kernel=Image diff --git a/arch/x86.sh b/arch/x86.sh new file mode 100644 index 0000000..50edef3 --- /dev/null +++ b/arch/x86.sh @@ -0,0 +1,3 @@ +arch_dir=x86 +cross_compile= +image_kernel=bzImage diff --git a/kbuild.sh b/kbuild.sh index 9bd2274..50f8d21 100755 --- a/kbuild.sh +++ b/kbuild.sh @@ -73,7 +73,7 @@ while [[ $# != 0 ]] ; do done # -# Platform handling +# Platform # if [[ -z "$platform" ]] ; then @@ -89,7 +89,7 @@ if [[ -z "$platform" ]] ; then fi if [[ ! -r "$kbuild_root/platforms/$platform.sh" ]] ; then - echo "Unknown platform '$platform'. Available platforms are" + echo "Unknown platform '$platform'. Supported platforms are" for f in $kbuild_root/platforms/*.sh ; do echo "- $(basename -s .sh $f)" done @@ -99,26 +99,18 @@ fi source "${kbuild_root}/platforms/$platform.sh" || exit 1 # -# Architecture handling +# Architecture # -case $arch in - arm) - arch_dir=arm32 - cross_compile=arm-buildroot-linux-uclibcgnueabihf- - image_kernel=zImage - ;; - arm64) - arch_dir=arm64 - cross_compile=aarch64-buildroot-linux-gnu- - image_kernel=Image - ;; - x86) - arch_dir=x86 - cross_compile= - image_kernel=bzImage - ;; -esac +if [[ ! -r "$kbuild_root/arch/$arch.sh" ]] ; then + echo "Unknown architecture '$arch'. Supported architectures are" + for f in $kbuild_root/arch/*.sh ; do + echo "- $(basename -s .sh $f)" + done + exit 1 +fi + +source "${kbuild_root}/arch/$arch.sh" || exit 1 target_dir=${target_dir:-$NFS_ROOT/$arch_dir} output_dir=${output_dir:-$PWD/output/$arch_dir} -- cgit v1.2.3