diff options
author | Christopher Clark <christopher.w.clark@gmail.com> | 2021-04-24 01:31:03 -0700 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2021-04-29 23:05:11 -0400 |
commit | 550a4080839184988487a8a64188c2de9fed956b (patch) | |
tree | f6311b267cddaf52a9fb242e90b03d45b3d6d8f7 | |
parent | 686adaf68eac343a261ae43a9452a978479f45ad (diff) | |
download | meta-virtualization-550a4080839184988487a8a64188c2de9fed956b.tar.gz |
xen, rpi4: add xen-rpi-u-boot-scr recipe for default u-boot script
Add a new xen-rpi-u-boot-scr recipe to PROVIDE u-boot-default-script
instead of using a bbappend to rpi-u-boot-scr.
This allows the new recipe to be selected by indicating it as
PREFERRED_PROVIDER of u-boot-default-script, and then do that in the
Xen on Raspberry Pi 4 config file, xen-raspberrypi4-64.inc.
Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r-- | dynamic-layers/raspberrypi/conf/distro/include/xen-raspberrypi4-64.inc | 2 | ||||
-rw-r--r-- | dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend | 17 | ||||
-rw-r--r-- | dynamic-layers/raspberrypi/recipes-bsp/xen-rpi-u-boot-scr/files/boot.cmd.xen.in (renamed from dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.xen.in) | 0 | ||||
-rw-r--r-- | dynamic-layers/raspberrypi/recipes-bsp/xen-rpi-u-boot-scr/xen-rpi-u-boot-scr.bb | 34 |
4 files changed, 36 insertions, 17 deletions
diff --git a/dynamic-layers/raspberrypi/conf/distro/include/xen-raspberrypi4-64.inc b/dynamic-layers/raspberrypi/conf/distro/include/xen-raspberrypi4-64.inc index 9c362551..2ea19dd4 100644 --- a/dynamic-layers/raspberrypi/conf/distro/include/xen-raspberrypi4-64.inc +++ b/dynamic-layers/raspberrypi/conf/distro/include/xen-raspberrypi4-64.inc | |||
@@ -21,3 +21,5 @@ BOOT_SPACE = "61440" | |||
21 | # Override the meta-raspberrypi default kernel preference | 21 | # Override the meta-raspberrypi default kernel preference |
22 | PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto" | 22 | PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto" |
23 | KERNEL_DEVICETREE ?= "broadcom/bcm2711-rpi-4-b.dtb" | 23 | KERNEL_DEVICETREE ?= "broadcom/bcm2711-rpi-4-b.dtb" |
24 | |||
25 | PREFERRED_PROVIDER_u-boot-default-script ?= "xen-rpi-u-boot-scr" | ||
diff --git a/dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend b/dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend deleted file mode 100644 index 2a511160..00000000 --- a/dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
2 | |||
3 | RPI_DOM0_MEM ??= "256M" | ||
4 | RPI_DEBUG_XEN_ARGS ??= "sync_console bootscrub=0" | ||
5 | |||
6 | SRC_URI += "file://boot.cmd.xen.in" | ||
7 | |||
8 | # If the distro is Xen enabled, override the default boot.cmd.in with the | ||
9 | # alternative boot.cmd.xen.in from this layer, with variables subsitution here | ||
10 | do_compile_append() { | ||
11 | if [ "${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'yes', 'no', d)}" = "yes" ]; then | ||
12 | sed -e 's/@@RPI_DOM0_MEM@@/${RPI_DOM0_MEM}/' \ | ||
13 | -e 's/@@RPI_DEBUG_XEN_ARGS@@/${RPI_DEBUG_XEN_ARGS}/' \ | ||
14 | "${WORKDIR}/boot.cmd.xen.in" > "${WORKDIR}/boot.cmd" | ||
15 | mkimage -A arm -T script -C none -n "Boot script" -d "${WORKDIR}/boot.cmd" boot.scr | ||
16 | fi | ||
17 | } | ||
diff --git a/dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.xen.in b/dynamic-layers/raspberrypi/recipes-bsp/xen-rpi-u-boot-scr/files/boot.cmd.xen.in index 0367e36c..0367e36c 100644 --- a/dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.xen.in +++ b/dynamic-layers/raspberrypi/recipes-bsp/xen-rpi-u-boot-scr/files/boot.cmd.xen.in | |||
diff --git a/dynamic-layers/raspberrypi/recipes-bsp/xen-rpi-u-boot-scr/xen-rpi-u-boot-scr.bb b/dynamic-layers/raspberrypi/recipes-bsp/xen-rpi-u-boot-scr/xen-rpi-u-boot-scr.bb new file mode 100644 index 00000000..87619d01 --- /dev/null +++ b/dynamic-layers/raspberrypi/recipes-bsp/xen-rpi-u-boot-scr/xen-rpi-u-boot-scr.bb | |||
@@ -0,0 +1,34 @@ | |||
1 | SUMMARY = "U-boot boot script for Xen on Raspberry Pi 4" | ||
2 | LICENSE = "MIT" | ||
3 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
4 | COMPATIBLE_MACHINE = "^raspberrypi4-64$" | ||
5 | |||
6 | DEPENDS = "u-boot-mkimage-native" | ||
7 | |||
8 | INHIBIT_DEFAULT_DEPS = "1" | ||
9 | |||
10 | SRC_URI = "file://boot.cmd.xen.in" | ||
11 | |||
12 | RPI_DOM0_MEM ??= "256M" | ||
13 | RPI_DEBUG_XEN_ARGS ??= "sync_console bootscrub=0" | ||
14 | |||
15 | do_compile() { | ||
16 | sed -e 's/@@KERNEL_IMAGETYPE@@/${KERNEL_IMAGETYPE}/' \ | ||
17 | -e 's/@@KERNEL_BOOTCMD@@/${KERNEL_BOOTCMD}/' \ | ||
18 | -e 's/@@RPI_DOM0_MEM@@/${RPI_DOM0_MEM}/' \ | ||
19 | -e 's/@@RPI_DEBUG_XEN_ARGS@@/${RPI_DEBUG_XEN_ARGS}/' \ | ||
20 | "${WORKDIR}/boot.cmd.xen.in" > "${WORKDIR}/boot.cmd" | ||
21 | |||
22 | mkimage -A ${UBOOT_ARCH} -T script -C none -n "Boot script" -d "${WORKDIR}/boot.cmd" boot.scr | ||
23 | } | ||
24 | |||
25 | inherit kernel-arch deploy nopackages | ||
26 | |||
27 | do_deploy() { | ||
28 | install -d ${DEPLOYDIR} | ||
29 | install -m 0644 boot.scr ${DEPLOYDIR} | ||
30 | } | ||
31 | |||
32 | addtask do_deploy after do_compile before do_build | ||
33 | |||
34 | PROVIDES += "u-boot-default-script" | ||