virt_linux: support arm_64

This feature was motivated and used only by the WireGuard port, so far.

Ref #4397
This commit is contained in:
Martin Stein 2022-05-18 12:14:47 +02:00 committed by Christian Helmuth
parent cded594346
commit f84e512ded
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,3 @@
LINUX_ARCH=arm64
include $(REP_DIR)/lib/mk/virt_linux_generated.inc

View File

@ -0,0 +1,38 @@
TARGET := arm_64_virt_linux
REQUIRES := arm_64
CUSTOM_TARGET_DEPS := kernel_build.phony
LX_DIR := $(call select_from_ports,linux)/src/linux
PWD := $(shell pwd)
LX_MK_ARGS = ARCH=arm64 CROSS_COMPILE=$(CROSS_DEV_PREFIX)
#
# Linux kernel configuration
#
# Start with 'make tinyconfig', enable/disable options via 'scripts/config',
# and resolve config dependencies via 'make olddefconfig'.
#
# define 'LX_ENABLE' and 'LX_DISABLE'
include $(REP_DIR)/src/virt_linux/target.inc
# filter for make output of kernel build system
BUILD_OUTPUT_FILTER = 2>&1 | sed "s/^/ [Linux] /"
kernel_config.tag:
$(MSG_CONFIG)Linux
$(VERBOSE)$(MAKE) -C $(LX_DIR) O=$(PWD) $(LX_MK_ARGS) tinyconfig $(BUILD_OUTPUT_FILTER)
$(VERBOSE)$(LX_DIR)/scripts/config --file $(PWD)/.config $(addprefix --enable ,$(LX_ENABLE))
$(VERBOSE)$(LX_DIR)/scripts/config --file $(PWD)/.config $(addprefix --disable ,$(LX_DISABLE))
$(VERBOSE)$(MAKE) $(LX_MK_ARGS) olddefconfig $(BUILD_OUTPUT_FILTER)
$(VERBOSE)$(MAKE) $(LX_MK_ARGS) prepare $(BUILD_OUTPUT_FILTER)
$(VERBOSE)touch $@
# update Linux kernel config on makefile changes
kernel_config.tag: $(MAKEFILE_LIST)
kernel_build.phony: kernel_config.tag
$(MSG_BUILD)Linux
$(VERBOSE)$(MAKE) $(LX_MK_ARGS) $(BUILD_OUTPUT_FILTER)