Skip to contentSkip to conversation

add variable APPENDS for multiple boot configuration

PATCH Superseded [email protected] 2 participants 2 messages Aug 2, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 add variable APPENDS for multiple boot configuration

From: Chee Yang Lee <[email protected]>

This patch introduce new variable APPENDS to define multiple boot configuration for systemd-boot and grub-efi.

APPENDS set the different in kernel option for each .conf file(for systemd-boot) or menuentry(for grub-efi). Include the differences in the title.
Separate each configuration with ";".

e.g.:
APPEND = "console=tty0 rootwait"
APPENDS = " i915.enable_guc=0; i915.enable_guc=2"

for systemd-boot, above setting will produce 2 .conf, boot-1.conf and boot-2.conf which set with below title and option:

boot-1.conf -

	title boot-1 i915.enable_guc=0
	option console=tty0 rootwait i915.enable_guc=0

boot-2.conf -

	title boot-2 i915.enable_guc=2
	option console=tty0 rootwait i915.enable_guc=2

This patch also update oeqa/selftest/wic testcase.

---
 meta/classes/grub-efi-cfg.bbclass             | 46 +++++++-------
 meta/classes/image_types_wic.bbclass          |  2 +-
 meta/classes/systemd-boot-cfg.bbclass         | 75 +++++++++++++----------
 meta/lib/oeqa/selftest/cases/wic.py           |  2 +-
 scripts/lib/wic/plugins/source/bootimg-efi.py | 86 +++++++++++++++------------
 5 files changed, 118 insertions(+), 93 deletions(-)
meta/classes/grub-efi-cfg.bbclass +24 -22
index f661a69..811c78f 100644
@@ -89,29 +89,31 @@ python build_efi_cfg() {
     for label in labels.split():
         localdata = d.createCopy()
 
+        initrd = localdata.getVar('INITRD')
+        append = localdata.getVar('APPEND')
+        appends = localdata.getVar('APPENDS') if localdata.getVar('APPENDS') else ""
         for btype in btypes:
-            cfgfile.write('\nmenuentry \'%s%s\'{\n' % (label, btype[0]))
-            lb = label
-            if label == "install":
-                lb = "install-efi"
-            kernel = localdata.getVar('KERNEL_IMAGETYPE')
-            cfgfile.write('linux /%s LABEL=%s' % (kernel, lb))
-
-            cfgfile.write(' %s' % replace_rootfs_uuid(d, root))
-
-            append = localdata.getVar('APPEND')
-            initrd = localdata.getVar('INITRD')
-
-            if append:
-                append = replace_rootfs_uuid(d, append)
-                cfgfile.write(' %s' % (append))
-
-            cfgfile.write(' %s' % btype[1])
-            cfgfile.write('\n')
-
-            if initrd:
-                cfgfile.write('initrd /initrd')
-            cfgfile.write('\n}\n')
+            for apd in appends.split(';'):
+                cfgfile.write('\nmenuentry \'%s%s %s\'{\n' % (label, btype[0],apd))
+                lb = label
+                if label == "install":
+                    lb = "install-efi"
+                kernel = localdata.getVar('KERNEL_IMAGETYPE')
+                cfgfile.write('linux /%s LABEL=%s' % (kernel, lb))
+
+                cfgfile.write(' %s' % replace_rootfs_uuid(d, root))
+
+                ap = append + apd
+                if ap:
+                    append = replace_rootfs_uuid(d, ap)
+                    cfgfile.write(' %s' % (ap))
+
+                cfgfile.write(' %s' % btype[1])
+                cfgfile.write('\n')
+
+                if initrd:
+                    cfgfile.write('initrd /initrd')
+                cfgfile.write('\n}\n')
 
     cfgfile.close()
 }
meta/classes/image_types_wic.bbclass +1 -1
index 519aeb1..4f2bdcc 100644
@@ -3,7 +3,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 \
+           ROOTFS_SIZE STAGING_DATADIR STAGING_DIR STAGING_LIBDIR TARGET_SYS APPENDS \
            KERNEL_IMAGETYPE MACHINE INITRAMFS_IMAGE INITRAMFS_IMAGE_BUNDLE INITRAMFS_LINK_NAME"
 
 inherit ${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', 'kernel-artifact-names', '', d)}
meta/classes/systemd-boot-cfg.bbclass +45 -30

86 lines not on this page · raw message

meta/lib/oeqa/selftest/cases/wic.py +1 -1
index fcdd550..cee8776 100644
@@ -498,7 +498,7 @@ class Wic2(WicTestCase):
 
         wicvars = set(bb_vars['WICVARS'].split())
         # filter out optional variables
-        wicvars = wicvars.difference(('DEPLOY_DIR_IMAGE', 'IMAGE_BOOT_FILES',
+        wicvars = wicvars.difference(('DEPLOY_DIR_IMAGE', 'IMAGE_BOOT_FILES', 'APPENDS',
                                       'INITRD', 'INITRD_LIVE', 'ISODIR','INITRAMFS_IMAGE',
                                       'INITRAMFS_IMAGE_BUNDLE', 'INITRAMFS_LINK_NAME'))
         with open(path) as envfile:
scripts/lib/wic/plugins/source/bootimg-efi.py +47 -39

114 lines not on this page · raw message

Signature · 1 line
2.7.4
#1 lore raw

✗ patchtest: failure for add variable APPENDS for multiple boot configuration

== Series Details ==

Series: add variable APPENDS for multiple boot configuration
Revision: 1
URL : https://patchwork.openembedded.org/series/19050/
State : failure

== Summary ==

Thank you for submitting this patch series to OpenEmbedded Core. This is an automated response. Several tests have been executed on the proposed series by patchtest resulting in the following failures:

* Patch            add variable APPENDS for multiple boot configuration
 Issue             Shortlog does not follow expected format [test_shortlog_format] 
  Suggested fix    Commit shortlog (first line of commit message) should follow the format "<target>: <summary>"
* Patch            add variable APPENDS for multiple boot configuration
 Issue             Patch is missing Signed-off-by [test_signed_off_by_presence] 
  Suggested fix    Sign off the patch (either manually or with "git commit --amend -s")

If you believe any of these test results are incorrect, please reply to the mailing list ([email protected]) raising your concerns. Otherwise we would appreciate you correcting the issues and submitting a new version of the patchset if applicable. Please ensure you add/increment the version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...).

---

Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe