[meta-xilinx] [PATCH 4/7] xilinx-bootbin: convert to a normal recipe
Jean-Francois Dagenais
jeff.dagenais at gmail.com
Wed Jul 19 06:39:13 PDT 2017
> On Jul 18, 2017, at 17:59, Manjukumar Harthikote Matha <manjukumar.harthikote-matha at xilinx.com> wrote:
>
> Added EXTRA_IMAGEDEPENDS += "xilinx-bootbin" so that it always builds boot.bin
>
I had meditated on this approach. Problem is this will trigger a build of
xilinx-bootbin when one is trying to bake an initrd or squashfs image recipe
which is pointless. It really comes down to the type of image the user is trying
to bake. In the end I felt it was up to developers to define this dependency. I
personnaly use the SD/eMMC boot paths so I declare that my wic image depends on
xilinx-bootbin:do_deploy (like I mentioned in the commit msg). There are only
2-3 other boot paths for zynq so there may be a way to clearly define each one
with it's pull on xilinx-bootbin.
We could add machine specific (e.g. for each supported zynqmps?
For example, I've made my own image class:
WKS_FILES = "zynq-wic-sdcard.wks"
IMAGE_DEPENDS_wic += "dosfstools-native mtools-native e2fsprogs-native"
do_image_wic[depends] += "\
xilinx-bootbin:do_deploy \
"
python () {
initRdImage = d.getVar("INITRD_IMAGE", True)
if initRdImage:
d.appendVarFlag("do_image_wic", "depends", " " + initRdImage + ":do_image_complete")
}
IMAGE_CMD_wic_append() {
cd ${DEPLOY_DIR_IMAGE}
ln -sfv ${IMAGE_LINK_NAME}.wic.lz4 ${IMAGE_LINK_NAME}.sdcard.lz4
}
The class is written such that it doesn't trigger any change in behaviour for
initrds.
==========
in my machine.conf:
IMAGE_CLASSES += "zynq-wic-sdcard"
==========
And here's the kickstart file for reference (fork of sdimage-bootpart.wks)
# short-description: Create SD card image with a boot partition
# long-description: Creates a partitioned SD card image. Boot files
# are located in the first vfat partition.
# !! the partition alignment must match that found in test files
# we add 6MB to the boot partition to allow devs to copy a fpga.bin for example
part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label ZBOOT --active --align 4096 --extra-space 6
part / --source rootfs --ondisk mmcblk --fstype=ext4 --label rootfs --align 4096 --extra-space 5
I really hope we can make this patch work as I truly reflects better the nature
of xilinx-bootbin... and fixes a race when building more than one image (which
is as common as simply having an initrd as a dependency of another boot image).
>> +
>> +python do_configure() {
>> +
>
> Trying to see if we can get rid of "python" keyword here.
> This will be consistent like other recipes in Yocto.
That's fine. This is there only because I renamed the bbclass to a bb. I have no
strong opinion of it.
Cheers!
More information about the meta-xilinx
mailing list