Skip to contentSkip to conversation

wic: Honor APPEND

PATCH In review Kevin Hao 2 participants 3 messages Feb 13, 2020 – Feb 15, 2020

lore
Share & tools
lore

Kevin Hao

author
#0 lore raw

PATCH 1/1 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]

---
 meta/classes/image_types_wic.bbclass | 2 +-
 scripts/lib/wic/ksparser.py          | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
meta/classes/image_types_wic.bbclass +1 -1
index fc9b106a9a81..b83308b45cb5 100644
@@ -4,7 +4,7 @@ WICVARS ?= "\
            BBLAYERS IMGDEPLOYDIR DEPLOY_DIR_IMAGE FAKEROOTCMD IMAGE_BASENAME IMAGE_BOOT_FILES \
            IMAGE_LINK_NAME IMAGE_ROOTFS INITRAMFS_FSTYPES INITRD INITRD_LIVE ISODIR RECIPE_SYSROOT_NATIVE \
            ROOTFS_SIZE STAGING_DATADIR STAGING_DIR STAGING_LIBDIR TARGET_SYS \
-           KERNEL_IMAGETYPE MACHINE INITRAMFS_IMAGE INITRAMFS_IMAGE_BUNDLE INITRAMFS_LINK_NAME"
+           KERNEL_IMAGETYPE MACHINE INITRAMFS_IMAGE INITRAMFS_IMAGE_BUNDLE INITRAMFS_LINK_NAME APPEND"
 
 inherit ${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', 'kernel-artifact-names', '', d)}
 
scripts/lib/wic/ksparser.py +5 -0
index 707a2e801962..650b976223e0 100644
@@ -246,6 +246,11 @@ class KickStart():
                     elif line.startswith('bootloader'):
                         if not self.bootloader:
                             self.bootloader = parsed
+                            # Concatenate the strings set in APPEND
+                            append_var = get_bitbake_var("APPEND")
+                            if append_var:
+                                self.bootloader.append = ' '.join(filter(None, \
+                                                         (self.bootloader.append, append_var)))
                         else:
                             err = "%s:%d: more than one bootloader specified" \
                                       % (confpath, lineno)
Signature · 1 line
2.25.0.191.gde93cc14ab7e
#1 lore raw
Quoted 13 lines · Kevin Hao

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.

Quoted 7 lines

[Yocto #12809]

---
 meta/classes/image_types_wic.bbclass | 2 +-
 scripts/lib/wic/ksparser.py          | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

This seems to cause a selftest failure:

https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/688

oe-selftest -r wic.Wic2.test_image_env

Cheers,

Richard

author
#2 lore raw
Quoted 22 lines · Richard Purdie
Quoted 13 lines · Kevin Hao

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.

Quoted 7 lines

[Yocto #12809]

---
 meta/classes/image_types_wic.bbclass | 2 +-
 scripts/lib/wic/ksparser.py          | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
Quoted 5 lines

This seems to cause a selftest failure:

https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/688

oe-selftest -r wic.Wic2.test_image_env

The APPEND is optional, so I should add it in the optional variables list in wic.Wic2.test_image_env. The fix is coming soon.

Thanks,
Kevin

Quoted 5 lines

Cheers,

Richard