From 32bc1b14d4c6b3eb13b655d4e39b4ff36fe15123 Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Mon, 13 May 2024 15:53:29 +0200 Subject: [PATCH] dde_linux: add busybox port Fix genodelabs/genode#5214 --- repos/dde_linux/ports/busybox.hash | 1 + repos/dde_linux/ports/busybox.port | 7 +++++ repos/dde_linux/src/busybox/README | 26 +++++++++++++++++++ repos/dde_linux/src/busybox/arm/target.mk | 6 +++++ repos/dde_linux/src/busybox/arm_v8a/target.mk | 6 +++++ repos/dde_linux/src/busybox/target.inc | 20 ++++++++++++++ repos/dde_linux/src/busybox/x86_32/target.mk | 6 +++++ repos/dde_linux/src/busybox/x86_64/target.mk | 4 +++ 8 files changed, 76 insertions(+) create mode 100644 repos/dde_linux/ports/busybox.hash create mode 100644 repos/dde_linux/ports/busybox.port create mode 100644 repos/dde_linux/src/busybox/README create mode 100644 repos/dde_linux/src/busybox/arm/target.mk create mode 100644 repos/dde_linux/src/busybox/arm_v8a/target.mk create mode 100644 repos/dde_linux/src/busybox/target.inc create mode 100644 repos/dde_linux/src/busybox/x86_32/target.mk create mode 100644 repos/dde_linux/src/busybox/x86_64/target.mk diff --git a/repos/dde_linux/ports/busybox.hash b/repos/dde_linux/ports/busybox.hash new file mode 100644 index 0000000000..92adeab464 --- /dev/null +++ b/repos/dde_linux/ports/busybox.hash @@ -0,0 +1 @@ +06b318191dfd5f9ba3aff5a38810d22d71b2e574 diff --git a/repos/dde_linux/ports/busybox.port b/repos/dde_linux/ports/busybox.port new file mode 100644 index 0000000000..723b77f98d --- /dev/null +++ b/repos/dde_linux/ports/busybox.port @@ -0,0 +1,7 @@ +LICENSE := GPLv2 +VERSION := 1.36.1 +DOWNLOADS := busybox.archive + +URL(busybox) := https://busybox.net/downloads/busybox-$(VERSION).tar.bz2 +SHA(busybox) := b8cc24c9574d809e7279c3be349795c5d5ceb6fdf19ca709f80cde50e47de314 +DIR(busybox) := src/busybox diff --git a/repos/dde_linux/src/busybox/README b/repos/dde_linux/src/busybox/README new file mode 100644 index 0000000000..b1ded741f9 --- /dev/null +++ b/repos/dde_linux/src/busybox/README @@ -0,0 +1,26 @@ +Busybox port +############ + +For convenience reasons this target builds a busybox binary that can be used, +e.g., within run-scripts to provide an initram-filesystem for a Linux guest OS, +or native Linux kernel during device-driver porting. + +Requirements +~~~~~~~~~~~~ + +Tom compile and link busybox appropriatedly, the Genode toolchain is not +sufficient. Instead tools of the host system are used. When building busybox +on a x86_64 host machine for either ARM or x86 32-bit machines these targets +require a cross-compilation toolchain to be installed first. + +On a x86_64 Debian-based machine, one needs to install for ARM 32-bit: + +! apt-get install crossbuild-essential-armhf + +and for ARM 64-bit: + +! apt-get install crossbuild-essential-arm64 + +for x86 32-bit cross compilation, you need: + +! apt-get install crossbuild-essential-i386 diff --git a/repos/dde_linux/src/busybox/arm/target.mk b/repos/dde_linux/src/busybox/arm/target.mk new file mode 100644 index 0000000000..02aa3b477d --- /dev/null +++ b/repos/dde_linux/src/busybox/arm/target.mk @@ -0,0 +1,6 @@ +$(call check_tool,arm-linux-gnueabihf-gcc) + +REQUIRES := arm +BB_MK_ARGS := ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- + +include $(PRG_DIR)/../target.inc diff --git a/repos/dde_linux/src/busybox/arm_v8a/target.mk b/repos/dde_linux/src/busybox/arm_v8a/target.mk new file mode 100644 index 0000000000..f2d8786b66 --- /dev/null +++ b/repos/dde_linux/src/busybox/arm_v8a/target.mk @@ -0,0 +1,6 @@ +$(call check_tool,aarch64-linux-gnu-gcc) + +REQUIRES := arm_v8a +BB_MK_ARGS := ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- + +include $(PRG_DIR)/../target.inc diff --git a/repos/dde_linux/src/busybox/target.inc b/repos/dde_linux/src/busybox/target.inc new file mode 100644 index 0000000000..6325ea2a4a --- /dev/null +++ b/repos/dde_linux/src/busybox/target.inc @@ -0,0 +1,20 @@ +TARGET := busybox + +CUSTOM_TARGET_DEPS := busybox.links + +BB_DIR := $(call select_from_ports,busybox)/src/busybox +PWD := $(shell pwd) + +# do not confuse third-party sub-makes +unexport .SHELLFLAGS + +# filter for make output of kernel build system +BUILD_OUTPUT_FILTER = 2>&1 | sed "s/^/ [Busybox] /" + +busybox.links: + $(MSG_CONFIG)Buildroot + $(VERBOSE)$(MAKE) -C $(BB_DIR) O=$(PWD) $(BB_MK_ARGS) defconfig $(BUILD_OUTPUT_FILTER) + $(VERBOSE)sed -i -e 's/^# CONFIG_STATIC.*/CONFIG_STATIC=y/' .config + $(MSG_BUILD)Buildroot + $(VERBOSE)$(MAKE) $(BB_MK_ARGS) $(BUILD_OUTPUT_FILTER) + $(VERBOSE)$(MAKE) $(BB_MK_ARGS) CONFIG_PREFIX=rootfs install $(BUILD_OUTPUT_FILTER) diff --git a/repos/dde_linux/src/busybox/x86_32/target.mk b/repos/dde_linux/src/busybox/x86_32/target.mk new file mode 100644 index 0000000000..3b4ad51a4e --- /dev/null +++ b/repos/dde_linux/src/busybox/x86_32/target.mk @@ -0,0 +1,6 @@ +$(call check_tool,i686-linux-gnu-gcc) + +REQUIRES := x86_32 +BB_MK_ARGS := ARCH=i386 CROSS_COMPILE=i686-linux-gnu- + +include $(PRG_DIR)/../target.inc diff --git a/repos/dde_linux/src/busybox/x86_64/target.mk b/repos/dde_linux/src/busybox/x86_64/target.mk new file mode 100644 index 0000000000..2930890e56 --- /dev/null +++ b/repos/dde_linux/src/busybox/x86_64/target.mk @@ -0,0 +1,4 @@ +REQUIRES := x86_64 +BB_MK_ARGS := ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- + +include $(PRG_DIR)/../target.inc