Using APPEND at image level doesn't take effect when using the wks files with wic because none of the current kickstarter files use this value when passing parameters to bootloader's --append. As an example, this won't take effect with wic: http://cgit.openembedded.org/openembedded-core/commit/?id=cfc09de06ecc12bb42181004689e881c75072665 There's code present that can parse bitbake vars in a wks.in template file and that works as expected. Is this an expected behavior or should it be changed to use APPEND var with a .wks.in file? Should the use of APPEND be discouraged and changed instead?
I think this is as trivial as http://git.yoctoproject.org/cgit.cgi/meta-intel-contrib/commit/?h=ross/wic&id=bae7c2bfb29c6cc093166ac834b4d3d818ff2c0e
Thanks for the hint. It's that easy. This is the same change but for genericx86 targets that are part of Poky. There's just too many other platforms that need changing (or at least there is a lot more wks files and I don't know which ones need to change). diff --git a/meta-yocto-bsp/conf/machine/include/genericx86-common.inc b/meta-yocto-bsp/conf/machine/include/genericx86-common.inc index f83ce5c594..5db91bee37 100644 --- a/meta-yocto-bsp/conf/machine/include/genericx86-common.inc +++ b/meta-yocto-bsp/conf/machine/include/genericx86-common.inc @@ -20,6 +20,6 @@ GLIBC_ADDONS = "nptl" EXTRA_OECONF_append_pn-matchbox-panel-2 = " --with-battery=acpi" IMAGE_FSTYPES += "wic wic.bmap" -WKS_FILE ?= "genericx86.wks" +WKS_FILE ?= "genericx86.wks.in" do_image_wic[depends] += "gptfdisk-native:do_populate_sysroot" do_image_wic[recrdeptask] += "do_bootimg" diff --git a/meta-yocto-bsp/wic/genericx86.wks b/meta-yocto-bsp/wic/genericx86.wks.in similarity index 80% rename from meta-yocto-bsp/wic/genericx86.wks rename to meta-yocto-bsp/wic/genericx86.wks.in index dab719c584..7560035148 100644 --- a/meta-yocto-bsp/wic/genericx86.wks +++ b/meta-yocto-bsp/wic/genericx86.wks.in @@ -4,4 +4,4 @@ part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda -- part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid part swap --ondisk sda --size 44 --label swap1 --fstype=swap -bootloader --ptable gpt --timeout=5 --append="rootfstype=ext4 console=ttyS0,115200 console=tty0" +bootloader --ptable gpt --timeout=5 --append="rootfstype=ext4 ${APPEND}"
commit dd372f09fc8a Author: Kevin Hao <kexin.hao@windriver.com> Date: Thu Feb 13 10:31:41 2020 +0800 wic: Honor APPEND APPEND is used to add additional parameters to kernel by features, such as read-only-rootfs. So we should honor this variable when we compose the kernel parameter in wic. I know we also can resolve this kind of issue by using the .wks.in template introduced by commit 42e870c5ed4b ("image_types.bbclass: support template .wks.in files for wic"), but the APPEND is needed by all the wks, it would seems pretty ridiculous to me to change all the .wks to .wks.in and then foist the APPEND into them. So the APPEND is definitely deserved to export to the wic directly. [Yocto #12809] (From OE-Core rev: 18981b8a457104391dfd94938c247eac04e4ed50) Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>