Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HWP: Splitting packages #632

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions layers/meta-balena-bsp
Submodule meta-balena-bsp added at d45790
14 changes: 14 additions & 0 deletions layers/meta-balena-raspberrypi/conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
inherit resin-u-boot
inherit balena-u-boot
UBOOT_KCONFIG_SUPPORT = "1"

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down