[oe-commits] [openembedded-core] 06/47: image_types_wic: add do_populate_bootfs task
git at git.openembedded.org
git at git.openembedded.org
Sun May 21 14:03:55 UTC 2017
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit cb75fc54662085ba4797bcd20f44ddec23b4ffb7
Author: Ed Bartosh <ed.bartosh at linux.intel.com>
AuthorDate: Wed May 10 10:40:16 2017 +0300
image_types_wic: add do_populate_bootfs task
This task generates root partition UUID and calls efi_bootfs_populate
API of current EFI provider to populate bootfs directory with
EFI artifacts.
[YOCTO #10073]
Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>
---
meta/classes/image_types_wic.bbclass | 37 ++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/meta/classes/image_types_wic.bbclass b/meta/classes/image_types_wic.bbclass
index 4711c24..3f9824d 100644
--- a/meta/classes/image_types_wic.bbclass
+++ b/meta/classes/image_types_wic.bbclass
@@ -115,3 +115,40 @@ python do_rootfs_wicenv () {
addtask do_rootfs_wicenv after do_image before do_image_wic
do_rootfs_wicenv[vardeps] += "${WICVARS}"
do_rootfs_wicenv[prefuncs] = 'set_image_size'
+
+# Set variables for efi_bootfs_populate
+GRUB_CFG ?= "${WORKDIR}/grub_wic.cfg"
+SYSTEMD_BOOT_CFG ?= "${WORKDIR}/loader_wic.conf"
+GRUB_GFXSERIAL ?= "1"
+LABELS_WIC ?= "boot install"
+LABELS ?= "${LABELS_WIC}"
+
+EFI_PROVIDER ?= "systemd-boot"
+EFI_CLASS = "${@bb.utils.contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER}", "", d)}"
+inherit ${EFI_CLASS}
+
+python do_populate_bootfs() {
+ def populate_bootfs(partuuid):
+ # remove bootfs dir as it may have files from previous build
+ bootfs = os.path.join(d.getVar("WORKDIR"), 'bootfs')
+ if os.path.exists(bootfs):
+ import shutil
+ shutil.rmtree(bootfs)
+
+ d.setVar("APPEND", "root=PARTUUID=%s" % partuuid)
+ bb.build.exec_func('build_efi_cfg', d)
+
+ bb.build.exec_func('efi_bootfs_populate', d)
+
+ if d.getVar('USING_WIC'):
+ # Generate parition UUID
+ from uuid import uuid4
+ partuuid = str(uuid4())
+ d.setVar("ROOTFS_PARTUUID", partuuid)
+
+ if d.getVar("EFI_CLASS"):
+ populate_bootfs(partuuid)
+}
+
+addtask do_populate_bootfs before do_image_wic
+do_populate_bootfs[depends] = "${MLPREFIX}${EFI_PROVIDER}:do_deploy virtual/kernel:do_deploy"
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list