diff --git a/.gitmodules b/.gitmodules index a33d980b5..97d71d599 100644 --- a/.gitmodules +++ b/.gitmodules @@ -19,3 +19,6 @@ [submodule "layers/meta-rust"] path = layers/meta-rust url = https://github.com/meta-rust/meta-rust.git +[submodule "layers/meta-balena-bsp"] + path = layers/meta-balena-bsp + url = https://github.com/balena-os/meta-balena-bsp.git diff --git a/balena-yocto-scripts b/balena-yocto-scripts index 3cfb90876..99cc22c72 160000 --- a/balena-yocto-scripts +++ b/balena-yocto-scripts @@ -1 +1 @@ -Subproject commit 3cfb908769d20683ccbda0ad0e565d64f8cb9760 +Subproject commit 99cc22c720783243ca2e1b24990af662fc387efc diff --git a/layers/meta-balena b/layers/meta-balena index eaed64e75..619bcc85d 160000 --- a/layers/meta-balena +++ b/layers/meta-balena @@ -1 +1 @@ -Subproject commit eaed64e75dd060fb4cd990e0af70d6c0697996ef +Subproject commit 619bcc85d35fd1a21d374a8b69238e7f592fb3d1 diff --git a/layers/meta-balena-bsp b/layers/meta-balena-bsp new file mode 160000 index 000000000..d45790bfe --- /dev/null +++ b/layers/meta-balena-bsp @@ -0,0 +1 @@ +Subproject commit d45790bfefdad240e2cb8e77ae6bad1dc207e2a8 diff --git a/layers/meta-balena-raspberrypi/conf/layer.conf b/layers/meta-balena-raspberrypi/conf/layer.conf index 64f15c659..938acd14e 100644 --- a/layers/meta-balena-raspberrypi/conf/layer.conf +++ b/layers/meta-balena-raspberrypi/conf/layer.conf @@ -9,6 +9,20 @@ BBFILE_PRIORITY_balena-raspberrypi = "1337" LAYERSERIES_COMPAT_balena-raspberrypi = "dunfell" +SDIMG_KERNELIMAGE_raspberrypi ?= "kernel.img" +SDIMG_KERNELIMAGE_raspberrypi2 ?= "kernel7.img" +SDIMG_KERNELIMAGE_raspberrypi3-64 ?= "kernel8.img" + +# Customize balenaos-img +BALENA_IMAGE_BOOTLOADER_rpi = "bootfiles" +BALENA_BOOT_PARTITION_FILES_rpi = " \ + u-boot.bin:/${SDIMG_KERNELIMAGE} \ + boot.scr:/boot.scr \ + bootfiles:/ \ +" +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" + # Add all the overlays available in kernel source code # # The files below come from kernel-source/arch/arm/boot/dts/overlays/, but without diff --git a/layers/meta-balena-raspberrypi/conf/samples/bblayers.conf.sample b/layers/meta-balena-raspberrypi/conf/samples/bblayers.conf.sample index 7a385a721..92ff0c573 100644 --- a/layers/meta-balena-raspberrypi/conf/samples/bblayers.conf.sample +++ b/layers/meta-balena-raspberrypi/conf/samples/bblayers.conf.sample @@ -13,6 +13,7 @@ BBLAYERS ?= " \ ${TOPDIR}/../layers/meta-openembedded/meta-networking \ ${TOPDIR}/../layers/meta-openembedded/meta-python \ ${TOPDIR}/../layers/meta-raspberrypi \ + ${TOPDIR}/../layers/meta-balena-bsp \ ${TOPDIR}/../layers/meta-balena/meta-balena-common \ ${TOPDIR}/../layers/meta-balena/meta-balena-dunfell \ ${TOPDIR}/../layers/meta-balena-raspberrypi \ diff --git a/layers/meta-balena-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend b/layers/meta-balena-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend index 0518b3a81..741fb1856 100644 --- a/layers/meta-balena-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend +++ b/layers/meta-balena-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend @@ -1,4 +1,4 @@ -inherit resin-u-boot +inherit balena-u-boot UBOOT_KCONFIG_SUPPORT = "1" FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" diff --git a/layers/meta-balena-raspberrypi/recipes-core/images/balena-image.bbappend b/layers/meta-balena-raspberrypi/recipes-core/images/balena-image.bbappend index 74abfbb13..e726e92c0 100644 --- a/layers/meta-balena-raspberrypi/recipes-core/images/balena-image.bbappend +++ b/layers/meta-balena-raspberrypi/recipes-core/images/balena-image.bbappend @@ -2,51 +2,11 @@ # See: # https://www.raspberrypi.org/documentation/hardware/computemodule/cm-emmc-flashing.md BALENA_BOOT_FAT32 = "1" +inherit balena-boot-helpers IMAGE_FSTYPES_append_rpi = " balenaos-img" # Kernel image name is different on Raspberry Pi 1/2/3-64bit -SDIMG_KERNELIMAGE_raspberrypi ?= "kernel.img" -SDIMG_KERNELIMAGE_raspberrypi2 ?= "kernel7.img" -SDIMG_KERNELIMAGE_raspberrypi3-64 ?= "kernel8.img" - -# Customize balenaos-img -BALENA_IMAGE_BOOTLOADER_rpi = "bootfiles" -BALENA_BOOT_PARTITION_FILES_rpi = " \ - u-boot.bin:/${SDIMG_KERNELIMAGE} \ - boot.scr:/boot.scr \ - bootfiles:/ \ - " - -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" - -python overlay_dtbs_handler () { - # Add all the dtb files programatically - for soc_fam in d.getVar('SOC_FAMILY', True).split(':'): - if soc_fam == 'rpi': - resin_boot_partition_files = d.getVar('BALENA_BOOT_PARTITION_FILES', True) - - overlay_dtbs = split_overlays(d, 0) - root_dtbs = split_overlays(d, 1) - - for dtb in root_dtbs.split(): - dtb = os.path.basename(dtb) - # newer kernels (5.4 onward) introduce overlay_map.dtb which needs to be deployed in the overlays directory - if dtb == 'overlay_map.dtb': - resin_boot_partition_files += "\t%s:/overlays/%s" % (dtb, dtb) - continue - resin_boot_partition_files += "\t%s:/%s" % (dtb, dtb) - - for dtb in overlay_dtbs.split(): - dtb = os.path.basename(dtb) - resin_boot_partition_files += "\t%s:/overlays/%s" % (dtb, dtb) - - d.setVar('BALENA_BOOT_PARTITION_FILES', resin_boot_partition_files) - - break -} addhandler overlay_dtbs_handler overlay_dtbs_handler[eventmask] = "bb.event.RecipePreFinalise"