wic: fixes for wic support
cover wic: fixes for wic support
A small series with 2 patches that enable using wic (once again).
The first patch moves sdimage-wks to ${LAYERDIR}/wic. This is already implemented in meta-yocto-bsp. The goal is to make wks files easier to find. Since Yocto is in general dumping custom image building methods in favor of wic, one would expect that wic is also usable with meta-raspberrypi.
The second patch adds support for KERNEL_DEVICETREE to IMAGE_BOOT_FILES. Currently, DTs will be copied over to boot partition when building rpi-sdimg. However, when building a wic image, none of this happens and once the process comlpetes, one will get an unbootable image. The patch adds proper entries to IMAGE_BOOT_FILES also taking care of proper file name transformation.
With these 2 patches, a wic image can be built by adding the following settings to conf/local.conf:
IMAGE_FSTYPES_append = " wic"
# or with your favourite compression, eg. wic.xz WKS_FILES = "sdimage-raspberrypi.wks"
Maciej Borzecki (2):
wic: move sdimage-raspberrypi to toplevel wic location
rpi-base: wic: generate entries for device tree files
conf/machine/include/rpi-base.inc | 32 +++++++++++++++++++++-
.../canned-wks => wic}/sdimage-raspberrypi.wks | 0
2 files changed, 31 insertions(+), 1 deletion(-)
rename {scripts/lib/image/canned-wks => wic}/sdimage-raspberrypi.wks (100%)Signature · 1 line
2.5.5
PATCH 1/2 wic: move sdimage-raspberrypi to toplevel wic location
Wic supports picking up image files from toplevel LAYERDIR/wic directory. Using this location has the benefit that image files are easier to find (compare that to previously used scripts/lib/image/canned-wks/ location).
---
{scripts/lib/image/canned-wks => wic}/sdimage-raspberrypi.wks | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {scripts/lib/image/canned-wks => wic}/sdimage-raspberrypi.wks (100%)wic/sdimage-raspberrypi.wks renamed from scripts/lib/image/canned-wks/sdimage-raspberrypi.wks +0 -0
Signature · 1 line
2.5.5
PATCH 2/2 rpi-base: wic: generate entries for device tree files
In reply to Maciej BorzeckiAugment IMAGE_BOOT_FILES with entries picking up proper dtb[o]s. This allows for building usable wic images once again.
--- conf/machine/include/rpi-base.inc | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-)
conf/machine/include/rpi-base.inc +31 -1
@@ -51,7 +51,37 @@ MACHINE_EXTRA_RRECOMMENDS += " kernel-modules" # Set Raspberrypi splash image SPLASH = "psplash-raspberrypi" -IMAGE_BOOT_FILES ?= "bcm2835-bootfiles/* ${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}" +def make_dtb_boot_files(d): + # Generate IMAGE_BOOT_FILES entries for device tree files listed in + # KERNEL_DEVICETREE. + alldtbs = d.getVar('KERNEL_DEVICETREE') + imgtyp = d.getVar('KERNEL_IMAGETYPE') + + def transform(dtb): + if dtb.endswith('dtb'): + # eg: bcm2708-rpi-b.dtb has: + # DEPLOYDIR file: ${KERNEL_IMAGETYPE}-bcm2708-rpi-b.dtb + # destination: bcm2708-rpi-b.dtb + src = '{}-{}'.format(imgtyp, dtb) + dst = dtb + return '{};{}'.format(src, dst) + elif dtb.endswith('dtbo'): + # overlay dtb: + # eg: overlays/hifiberry-amp.dtbo has: + # DEPLOYDIR file: ${KERNEL_IMAGETYPE}-hifiberry-amp.dtbp + # destination: overlays/hifiberry-amp.dtbo + base = os.path.basename(dtb) + src = '{}-{}'.format(imgtyp, base) + dst = dtb + return '{};{}'.format(src, dtb) + + return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb]) + + +IMAGE_BOOT_FILES ?= "bcm2835-bootfiles/* \ + ${@make_dtb_boot_files(d)} \ + ${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE} \ + " # The kernel image is installed into the FAT32 boot partition and does not need # to also be installed into the rootfs.
Signature · 1 line
2.5.5
Quoted 15 lines · Maciej Borzecki
A small series with 2 patches that enable using wic (once again).
The first patch moves sdimage-wks to ${LAYERDIR}/wic. This is already implemented in meta-yocto-bsp. The goal is to make wks files easier to find. Since Yocto is in general dumping custom image building methods in favor of wic, one would expect that wic is also usable with meta-raspberrypi.
The second patch adds support for
KERNEL_DEVICETREEtoIMAGE_BOOT_FILES. Currently, DTs will be copied over to boot partition when building rpi-sdimg. However, when building a wic image, none of this happens and once the process comlpetes, one will get an unbootable image. The patch adds proper entries toIMAGE_BOOT_FILESalso taking care of proper file name transformation.
Quoted 7 lines
With these 2 patches, a wic image can be built by adding the following settings to
conf/local.conf:
IMAGE_FSTYPES_append= " wic"# or with your favourite compression, eg. wic.xz WKS_FILES = "sdimage-raspberrypi.wks"
I have staged it in kraj/master and will test out image generation using wic.
Quoted 10 lines
Maciej Borzecki (2):
wic: move sdimage-raspberrypi to toplevel wic location
rpi-base: wic: generate entries for device tree filesconf/machine/include/rpi-base.inc | 32 +++++++++++++++++++++- .../canned-wks => wic}/sdimage-raspberrypi.wks | 0 2 files changed, 31 insertions(+), 1 deletion(-) rename {scripts/lib/image/canned-wks => wic}/sdimage-raspberrypi.wks (100%)