6

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
Rachid K.
  • 4,490
  • 3
  • 11
  • 30
Kevin
  • 320
  • 5
  • 17

1 Answers1

5

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.

Tomas Novotny
  • 1,771
  • 9
  • 11
  • oh I glossed over 1 of the things I really needed. How do dependencies get figured out? So if I depend on some addition files in IMAGE_BOOT_FILES that aren't in my rfs or initrd? – Kevin Feb 05 '19 at 17:53
  • Good point. I've updated the answer to mention the `WKS_FILE_DEPENDS`. – Tomas Novotny Feb 06 '19 at 09:34
  • It seems like you can't depend on a image type. It will just run the wik last so you have to remember, if you want an image to be included you have to just remember to add it to the image_types. It looks like thats what the intel wik does, it depends on the ISO being made and files being available. I like the simplicity but it feels detached from the rest of the process that uses do_image[depends]. It seems like the wic while improves some things, seems clunky in other ways. It might have been nicer if there was a bbclass that used wic and you could inherit it as part of an image type. – Kevin Apr 04 '19 at 17:49