From a7d849b638b1a3472a65bb48b231140351ec9024 Mon Sep 17 00:00:00 2001 From: Yan-Jie Wang Date: Tue, 20 Jun 2023 10:29:14 +0000 Subject: [PATCH] Add arm64 support for "make check" --- configs/linux-aarch64.config | 68 +++++++++++++++++++ configs/{linux.config => linux-x86_64.config} | 0 mk/external.mk | 20 ++++-- 3 files changed, 83 insertions(+), 5 deletions(-) create mode 100644 configs/linux-aarch64.config rename configs/{linux.config => linux-x86_64.config} (100%) diff --git a/configs/linux-aarch64.config b/configs/linux-aarch64.config new file mode 100644 index 0000000..395c4be --- /dev/null +++ b/configs/linux-aarch64.config @@ -0,0 +1,68 @@ +# CONFIG_CROSS_MEMORY_ATTACH is not set +# CONFIG_CPU_ISOLATION is not set +CONFIG_BLK_DEV_INITRD=y +# CONFIG_RD_GZIP is not set +# CONFIG_RD_BZIP2 is not set +# CONFIG_RD_LZMA is not set +# CONFIG_RD_XZ is not set +# CONFIG_RD_LZO is not set +# CONFIG_RD_LZ4 is not set +# CONFIG_RD_ZSTD is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +# CONFIG_MULTIUSER is not set +# CONFIG_SYSFS_SYSCALL is not set +# CONFIG_FHANDLE is not set +# CONFIG_POSIX_TIMERS is not set +# CONFIG_BUG is not set +# CONFIG_BASE_FULL is not set +# CONFIG_FUTEX is not set +# CONFIG_EPOLL is not set +# CONFIG_SIGNALFD is not set +# CONFIG_TIMERFD is not set +# CONFIG_EVENTFD is not set +# CONFIG_SHMEM is not set +# CONFIG_AIO is not set +# CONFIG_IO_URING is not set +# CONFIG_ADVISE_SYSCALLS is not set +# CONFIG_MEMBARRIER is not set +# CONFIG_KALLSYMS is not set +# CONFIG_RSEQ is not set +CONFIG_EMBEDDED=y +# CONFIG_UNMAP_KERNEL_AT_EL0 is not set +# CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY is not set +# CONFIG_RODATA_FULL_DEFAULT_ENABLED is not set +# CONFIG_ARM64_TAGGED_ADDR_ABI is not set +# CONFIG_ARM64_SVE is not set +# CONFIG_EFI is not set +# CONFIG_SECCOMP is not set +# CONFIG_STACKPROTECTOR is not set +# CONFIG_VMAP_STACK is not set +# CONFIG_RANDOMIZE_KSTACK_OFFSET is not set +# CONFIG_COREDUMP is not set +CONFIG_PCI=y +CONFIG_PCI_HOST_GENERIC=y +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +# CONFIG_ALLOW_DEV_COREDUMP is not set +# CONFIG_ARM_SMCCC_SOC_ID is not set +CONFIG_VIRTIO_BLK=y +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_NR_UARTS=1 +CONFIG_SERIAL_8250_RUNTIME_UARTS=1 +CONFIG_SERIAL_OF_PLATFORM=y +# CONFIG_HWMON is not set +# CONFIG_USB_SUPPORT is not set +CONFIG_VIRTIO_PCI=y +# CONFIG_VHOST_MENU is not set +# CONFIG_SURFACE_PLATFORMS is not set +# CONFIG_IOMMU_SUPPORT is not set +CONFIG_EXT4_FS=y +# CONFIG_FILE_LOCKING is not set +# CONFIG_DNOTIFY is not set +# CONFIG_INOTIFY_USER is not set +# CONFIG_MISC_FILESYSTEMS is not set +# CONFIG_CRYPTO_HW is not set +# CONFIG_DEBUG_MISC is not set +# CONFIG_FTRACE is not set +# CONFIG_STRICT_DEVMEM is not set diff --git a/configs/linux.config b/configs/linux-x86_64.config similarity index 100% rename from configs/linux.config rename to configs/linux-x86_64.config diff --git a/mk/external.mk b/mk/external.mk index d822f5e..e76d555 100644 --- a/mk/external.mk +++ b/mk/external.mk @@ -34,14 +34,24 @@ EXTERNAL_SRC = LINUX BUSYBOX $(foreach T,$(EXTERNAL_SRC),$(eval $(download-n-extract))) # Build Linux kernel image -LINUX_IMG = $(OUT)/bzImage +ifeq ($(ARCH), x86_64) +LINUX_IMG_NAME = bzImage +LINUX_ARCH = x86 +else ifeq ($(ARCH), aarch64) +LINUX_IMG_NAME = Image +LINUX_ARCH = arm64 +else + $(error Unsupported architecture) +endif +LINUX_IMG = $(OUT)/$(LINUX_IMG_NAME) + $(LINUX_IMG): $(LINUX_SRC) $(VECHO) "Configuring Linux kernel... " - $(Q)cp -f ${CONF}/linux.config $