mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-30 16:14:13 +00:00
dde_linux: add virt_linux lx_emul flavor
To support device-less protocol-stacks only ports, we can use a Virt I/O Linux kernel flavor, and export the lx_kit/lx_emul parts not depending on platform API and devices. Ref #4397
This commit is contained in:
parent
35cf8aada4
commit
9713014130
12
repos/dde_linux/lib/import/import-lx_emul.mk
Normal file
12
repos/dde_linux/lib/import/import-lx_emul.mk
Normal file
@ -0,0 +1,12 @@
|
||||
LIBS += virt_linux_generated
|
||||
|
||||
LX_SRC_DIR := $(call select_from_ports,linux)/src/linux
|
||||
ifeq ($(wildcard $(LX_SRC_DIR)),)
|
||||
LX_SRC_DIR := $(call select_from_repositories,src/linux)
|
||||
endif
|
||||
|
||||
LX_GEN_DIR := $(LIB_CACHE_DIR)/virt_linux_generated
|
||||
|
||||
-include $(call select_from_repositories,lib/import/import-lx_emul_common.inc)
|
||||
|
||||
SRC_CC += lx_kit/memory_non_dma.cc
|
2
repos/dde_linux/lib/mk/lx_emul.mk
Normal file
2
repos/dde_linux/lib/mk/lx_emul.mk
Normal file
@ -0,0 +1,2 @@
|
||||
# the lx_emul libray exists only for the import file
|
||||
|
@ -0,0 +1,3 @@
|
||||
LINUX_ARCH=x86_64
|
||||
|
||||
include $(REP_DIR)/lib/mk/virt_linux_generated.inc
|
30
repos/dde_linux/lib/mk/virt_linux_generated.inc
Normal file
30
repos/dde_linux/lib/mk/virt_linux_generated.inc
Normal file
@ -0,0 +1,30 @@
|
||||
CUSTOM_TARGET_DEPS := kernel_build.phony
|
||||
|
||||
LX_DIR := $(call select_from_ports,linux)/src/linux
|
||||
PWD := $(shell pwd)
|
||||
|
||||
LX_MK_ARGS = ARCH=$(LINUX_ARCH) CROSS_COMPILE=$(CROSS_DEV_PREFIX)
|
||||
|
||||
#
|
||||
# Linux kernel configuration
|
||||
#
|
||||
|
||||
# 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 $(addprefix --enable ,$(LX_ENABLE))
|
||||
$(VERBOSE)$(LX_DIR)/scripts/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
|
14
repos/dde_linux/src/virt_linux/README
Normal file
14
repos/dde_linux/src/virt_linux/README
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
# RUN virt_linux under Qemu (x86_64)
|
||||
|
||||
qemu-system-x86_64 \
|
||||
-no-kvm -m 512 \
|
||||
-chardev stdio,id=virtiocon0 \
|
||||
-device virtio-serial \
|
||||
-device virtconsole,chardev=virtiocon0 \
|
||||
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no \
|
||||
-net nic,model=virtio,netdev=net0 \
|
||||
-kernel virt_linux/x86_64/arch/x86_64/boot/bzImage \
|
||||
-initrd busybox/initramfs.cpio.gz \
|
||||
-append "console=hvc0 ip=dhcp"
|
||||
|
35
repos/dde_linux/src/virt_linux/target.inc
Normal file
35
repos/dde_linux/src/virt_linux/target.inc
Normal file
@ -0,0 +1,35 @@
|
||||
#
|
||||
# Linux kernel configuration
|
||||
#
|
||||
|
||||
# kernel fundamentals
|
||||
LX_ENABLE += TTY SERIAL_EARLYCON SERIAL_OF_PLATFORM PRINTK HAS_IOMEM
|
||||
|
||||
# initrd support
|
||||
LX_ENABLE += BINFMT_ELF BLK_DEV_INITRD
|
||||
|
||||
# network infrastructure
|
||||
LX_ENABLE += NET NETDEVICES
|
||||
|
||||
# PCI support
|
||||
LX_ENABLE += PCI
|
||||
|
||||
# Virtio devices
|
||||
LX_ENABLE += VIRTIO_MENU VIRTIO_PCI VIRTIO_NET VIRTIO_CONSOLE
|
||||
|
||||
# network protocols
|
||||
LX_ENABLE += INET IP_PNP IP_PNP_DHCP
|
||||
|
||||
# random number generator
|
||||
LX_ENABLE += HW_RANDOM ARCH_RANDOM RANDOM_TRUST_CPU RANDOM_TRUST_BOOTLOADER
|
||||
LX_ENABLE += CRYPTO_JITTERENTROPY CRYPTO_ANSI_CPRNG HW_RANDOM_TIMERIOMEM
|
||||
|
||||
# wireguard driver
|
||||
LX_ENABLE += WIREGUARD WIREGUARD_DEBUG
|
||||
|
||||
# disable optimization not possible in PIC code under Genode
|
||||
LX_DISABLE += CC_HAS_ASM_GOTO
|
||||
|
||||
# slim down kernel by removing superfluous drivers
|
||||
LX_DISABLE += HID HID_GENERIC USB_HID VGA_CONSOLE DUMMY_CONSOLE NLS VGA_ARB DEBUG_LIST
|
||||
LX_DISABLE += INPUT_KEYBOARD INPUT_MOUSE WLAN WIRELESS ETHERNET
|
37
repos/dde_linux/src/virt_linux/x86_32/target.mk
Normal file
37
repos/dde_linux/src/virt_linux/x86_32/target.mk
Normal file
@ -0,0 +1,37 @@
|
||||
TARGET := x86_32_virt_linux
|
||||
REQUIRES := x86_32
|
||||
|
||||
CUSTOM_TARGET_DEPS := kernel_build.phony
|
||||
|
||||
LX_DIR := $(call select_from_ports,linux)/src/linux
|
||||
PWD := $(shell pwd)
|
||||
|
||||
LX_MK_ARGS = ARCH=x86 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)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) bzImage $(BUILD_OUTPUT_FILTER)
|
37
repos/dde_linux/src/virt_linux/x86_64/target.mk
Normal file
37
repos/dde_linux/src/virt_linux/x86_64/target.mk
Normal file
@ -0,0 +1,37 @@
|
||||
TARGET := x86_64_virt_linux
|
||||
REQUIRES := x86_64
|
||||
|
||||
CUSTOM_TARGET_DEPS := kernel_build.phony
|
||||
|
||||
LX_DIR := $(call select_from_ports,linux)/src/linux
|
||||
PWD := $(shell pwd)
|
||||
|
||||
LX_MK_ARGS = ARCH=x86_64 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)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) bzImage $(BUILD_OUTPUT_FILTER)
|
Loading…
x
Reference in New Issue
Block a user