From 39b5719c81ad1469f7964afb9ec3883c1951caed Mon Sep 17 00:00:00 2001 From: Michal Toman Date: Tue, 30 Jan 2024 14:49:49 +0100 Subject: [PATCH] Add recipe for balena bootloader This is a separate version of the kernel that will be used as a second stage bootloader instead of u-boot. With just this patch nothing will use it yet but it will be ready for use when we start to switch. Change-type: patch Changelog-entry: Add recipe for balena bootloader Signed-off-by: Michal Toman --- .../linux/linux-balena-bootloader_6.1.bb | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-balena-bootloader_6.1.bb diff --git a/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-balena-bootloader_6.1.bb b/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-balena-bootloader_6.1.bb new file mode 100644 index 000000000..a1f7ba9e4 --- /dev/null +++ b/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-balena-bootloader_6.1.bb @@ -0,0 +1,50 @@ +LINUX_VERSION ?= "6.1.64" +LINUX_RPI_BRANCH ?= "rpi-6.1.y" +LINUX_RPI_KMETA_BRANCH ?= "yocto-6.1" + +SRCREV_machine = "dad5d57939cfae7af363e7c9862b59d33d96794b" +SRCREV_meta = "f845a7f37d7114230d6609e2bd630070f2f6cd9b" + +KMETA = "kernel-meta" + +SRC_URI = " \ + git://github.com/raspberrypi/linux.git;name=machine;branch=${LINUX_RPI_BRANCH};protocol=https \ + git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=${LINUX_RPI_KMETA_BRANCH};destsuffix=${KMETA} \ +" +SRC_URI:remove = "file://initramfs-image-bundle.cfg" +SRC_URI:remove = "file://vc4graphics.cfg" + +require recipes-kernel/linux/linux-raspberrypi.inc + +inherit balena-bootloader + +BALENA_DEFCONFIG_NAME = "${KBUILD_DEFCONFIG}" + +BALENA_CONFIGS:append = " \ + rpisense \ + " + +BALENA_CONFIGS[rpisense] = " \ + CONFIG_MFD_RPISENSE_CORE=n \ + CONFIG_FB_RPISENSE=n \ + " + +do_deploy:append () { + BOOTENV_FILE="${DEPLOYDIR}/${KERNEL_PACKAGE_NAME}/bootenv" + grub-editenv "${BOOTENV_FILE}" create + grub-editenv "${BOOTENV_FILE}" set "resin_root_part=A" + grub-editenv "${BOOTENV_FILE}" set "bootcount=0" + grub-editenv "${BOOTENV_FILE}" set "upgrade_available=0" +} + +do_deploy[depends] += " grub-native:do_populate_sysroot" + +KERNEL_DTC_FLAGS += "-@ -H epapr" + +INITRAMFS_IMAGE = "balena-image-bootloader-initramfs" + +KERNEL_PACKAGE_NAME = "balena-bootloader" + +KERNEL_DEVICETREE = "${RPI_KERNEL_DEVICETREE}" + +PROVIDES = "virtual/balena-bootloader"