diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2020-09-22 12:37:04 -0700 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2020-09-22 15:51:27 -0400 |
commit | cdf6f553470b348430e6750473b19a13541ff2d8 (patch) | |
tree | d24a4c549a8da23faba10c9e16a3a8d060409b95 /recipes-core/runx/runx_git.bb | |
parent | b40be07bf0f9c463d2eff3609f507387942e61f1 (diff) | |
download | meta-virtualization-cdf6f553470b348430e6750473b19a13541ff2d8.tar.gz |
runx: allow internal and external busybox
runx knows how to build its own copy of busybox for its initrd,
adding a flag to allow us to select which mode we want.
Signed-off-by: Bruce Ashfield <bruce.ashfield@xilinx.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-core/runx/runx_git.bb')
-rw-r--r-- | recipes-core/runx/runx_git.bb | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/recipes-core/runx/runx_git.bb b/recipes-core/runx/runx_git.bb index 53c24641..48a57766 100644 --- a/recipes-core/runx/runx_git.bb +++ b/recipes-core/runx/runx_git.bb | |||
@@ -14,6 +14,11 @@ SRC_URI = "\ | |||
14 | file://0001-make-initrd-cross-install-tweaks.patch \ | 14 | file://0001-make-initrd-cross-install-tweaks.patch \ |
15 | file://0001-runX-add-bounded-looping-timeout.patch \ | 15 | file://0001-runX-add-bounded-looping-timeout.patch \ |
16 | " | 16 | " |
17 | |||
18 | SRC_URI += "file://0001-Add-busybox-cross-build-for-arm64.patch \ | ||
19 | file://0002-don-t-call-busybox-install.patch \ | ||
20 | " | ||
21 | |||
17 | SRC_URI[md5sum] = "ce9b2d974d27408a61c53a30d3f98fb9" | 22 | SRC_URI[md5sum] = "ce9b2d974d27408a61c53a30d3f98fb9" |
18 | SRC_URI[sha256sum] = "bf338980b1670bca287f9994b7441c2361907635879169c64ae78364efc5f491" | 23 | SRC_URI[sha256sum] = "bf338980b1670bca287f9994b7441c2361907635879169c64ae78364efc5f491" |
19 | 24 | ||
@@ -33,6 +38,7 @@ inherit kernel-arch | |||
33 | # we have a busybox bbappend that makes /bin available to the | 38 | # we have a busybox bbappend that makes /bin available to the |
34 | # sysroot, and hence gets us the target binary that we need | 39 | # sysroot, and hence gets us the target binary that we need |
35 | DEPENDS = "busybox-initrd go-build" | 40 | DEPENDS = "busybox-initrd go-build" |
41 | DEPENDS += "resolvconf" | ||
36 | 42 | ||
37 | # for the kernel build phase | 43 | # for the kernel build phase |
38 | DEPENDS += "openssl-native coreutils-native util-linux-native xz-native bc-native" | 44 | DEPENDS += "openssl-native coreutils-native util-linux-native xz-native bc-native" |
@@ -42,6 +48,8 @@ RDEPENDS_${PN} += " jq bash" | |||
42 | RDEPENDS_${PN} += " xen-tools-xl go-build socat daemonize" | 48 | RDEPENDS_${PN} += " xen-tools-xl go-build socat daemonize" |
43 | RDEPENDS_${PN} += " qemu-system-i386 ca-certificates qemu qemu-keymaps" | 49 | RDEPENDS_${PN} += " qemu-system-i386 ca-certificates qemu qemu-keymaps" |
44 | 50 | ||
51 | RUNX_USE_INTERNAL_BUSYBOX ?= "" | ||
52 | |||
45 | do_compile() { | 53 | do_compile() { |
46 | # we'll need this for the initrd later, so lets error if it isn't what | 54 | # we'll need this for the initrd later, so lets error if it isn't what |
47 | # we expect (statically linked) | 55 | # we expect (statically linked) |
@@ -77,11 +85,22 @@ do_compile() { | |||
77 | ${S}/kernel/make-kernel | 85 | ${S}/kernel/make-kernel |
78 | 86 | ||
79 | # construct the initrd | 87 | # construct the initrd |
80 | echo "[INFO]: runx: constructing the initrd" | 88 | bbnote "runx: constructing the initrd" |
81 | cp ${STAGING_DIR_HOST}/bin/busybox.nosuid ${WORKDIR}/busybox | 89 | if [ -z "${RUNX_USE_INTERNAL_BUSYBOX}" ]; then |
82 | export QEMU_USER="`which qemu-${HOST_ARCH}` -L ${STAGING_BASELIBDIR}/.." | 90 | bbnote "runx: using external busybox" |
83 | export BUSYBOX="${WORKDIR}/busybox" | 91 | cp ${STAGING_DIR_HOST}/bin/busybox.nosuid ${WORKDIR}/busybox |
84 | export CROSS_COMPILE="t" | 92 | export QEMU_USER="`which qemu-${HOST_ARCH}` -L ${STAGING_BASELIBDIR}/.." |
93 | export BUSYBOX="${WORKDIR}/busybox" | ||
94 | export CROSS_COMPILE="${TARGET_PREFIX}" | ||
95 | else | ||
96 | bbnote "runx: using internal busybox" | ||
97 | export CC="${CC}" | ||
98 | export LD="${LD}" | ||
99 | export CFLAGS="${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${CFLAGS}" | ||
100 | export LDFLAGS="${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH} ${LDFLAGS}" | ||
101 | export HOSTCFLAGS="${BUILD_CFLAGS} ${BUILD_LDFLAGS}" | ||
102 | export CROSS_COMPILE="${TARGET_PREFIX}" | ||
103 | fi | ||
85 | ${S}/initrd/make-initrd | 104 | ${S}/initrd/make-initrd |
86 | } | 105 | } |
87 | 106 | ||