Skip to content

Commit

Permalink
balena-image: Use balena bootloader on raspberrypi5-64
Browse files Browse the repository at this point in the history
Change-type: patch
Changelog-entry: Use balena bootloader on Raspberry Pi 5
Signed-off-by: Michal Toman <[email protected]>
  • Loading branch information
mtoman committed Sep 26, 2023
1 parent 7039833 commit 57b5b2f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ BALENA_BOOT_PARTITION_FILES:rpi = " \
bootfiles:/ \
"

BALENA_BOOT_PARTITION_FILES:remove:raspberrypi5-64 = " \
u-boot.bin:/${SDIMG_KERNELIMAGE} \
boot.scr:/boot.scr \
"

BALENA_BOOT_PARTITION_FILES:append:raspberrypi5-64 = " \
balena-bootloader/${KERNEL_IMAGETYPE}-initramfs-${MACHINE}.bin:/${SDIMG_KERNELIMAGE} \
balena-bootloader/bootenv:/bootenv \
"

BALENA_BOOT_PARTITION_FILES:append:revpi-core-3 = " revpi-core-dt-blob-overlay.dtb:/dt-blob.bin"

BALENA_BOOT_PARTITION_FILES:append:revpi-connect = " revpi-connect-dt-blob-overlay.dtb:/dt-blob.bin"
Expand Down Expand Up @@ -58,6 +68,11 @@ python overlay_dtbs_handler () {
do_resin_boot_dirgen_and_deploy[prefuncs] += "overlay_dtbs_handler"

IMAGE_INSTALL:append:rpi = " u-boot"
IMAGE_INSTALL:remove:raspberrypi5-64 = " u-boot"
IMAGE_INSTALL:append:raspberrypi5-64 = " grub-editenv"

do_rootfs[depends] += "${@oe.utils.conditional('MACHINE','raspberrypi5-64',' virtual/balena-bootloader:do_deploy','',d)}"
do_image_balenaos_img[depends] += "${@oe.utils.conditional('MACHINE','raspberrypi5-64',' virtual/balena-bootloader:do_deploy','',d)}"

do_resin_boot_dirgen_and_deploy[depends] += "virtual/kernel:do_install"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ SRC_URI:remove = "file://initramfs-image-bundle.cfg"

require recipes-kernel/linux/linux-raspberrypi.inc

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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ FILESEXTRAPATHS:append := ":${THISDIR}/files"

HOSTAPP_HOOKS += " 99-resin-uboot 999-resin-boot-cleaner"
HOSTAPP_HOOKS:append:revpi-core-3 = " 9999-bootfiles"

HOSTAPP_HOOKS:remove:raspberrypi5-64 = "99-resin-uboot 999-resin-boot-cleaner"
HOSTAPP_HOOKS:append:raspberrypi5-64 = " 99-balena-bootloader"

0 comments on commit 57b5b2f

Please sign in to comment.