4
votes

This might be a fairly simple question, there is a few things I'm missing. I'm trying to use wic as a replacement for a custom script for laying out a boot partition. The device is an IMX6 and has uboot written at 0x400, and a fat32 boot partition to load off of with a /boot folder.. containing some files

/boot
    uImage
    root.squashfs
    splash.bmp
    devicetree.dts
    6x_bootscript

I briefly looked into the plugin that uses bootimg-partition for wic. Seems like a simple way to include files, but not enough control over the name of the files. It can take an entire folder but I'm not sure how to create a directory with those specific files. The files have to have the correct name after copying.

# Copied from https://community.nxp.com/thread/389816
# Image Creator .wks

part u-boot --source rawcopy --sourceparams="file=u-boot.imx" --ondisk mmcblk --no-table --align 1

# Boot partition

part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4096 --size 8M --extra-space 0
1

1 Answers

5
votes

You can rename the files with bootimg-partition wic plugin. You need to specify the new name after a semi-colon in the IMAGE_BOOT_FILES variable. There is an example to rename "uImage -> kernel" (and also add u-boot.img as is) taken from documentation:

IMAGE_BOOT_FILES = "u-boot.img uImage;kernel"

You can also pick several files using glob pattern and save them into the directory (but renaming of individual files is not possible). Again, an example from doc:

IMAGE_BOOT_FILES = "bcm2835-bootfiles/*;boot/"

See documentation for IMAGE_BOOT_FILES variable for full explanation and more examples.

Build-time dependencies for wic images (e.g. native tools, bootloaders) are defined in WKS_FILE_DEPENDS variable (see doc for more information). Ensure that files listed in IMAGE_BOOT_FILES have the proper dependency on respective recipe.


Of course, you can also rename your files during do_deploy, so you don't need to handle renaming in wic. And you can also create a new wic plugin in case that you need something very specific.