All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/21] EFI image enhancements
@ 2018-03-01  2:14 California Sullivan
  2018-03-01  2:14 ` [PATCH v3 01/21] grub-efi.bbclass: split out configuration portion California Sullivan
                   ` (20 more replies)
  0 siblings, 21 replies; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:14 UTC (permalink / raw)
  To: openembedded-core

EFI images require a boot partition containing the bootloader, the
kernel, the bootloader configuration, and any other EFI binaries that
your platform needs. Currently, the boot partition is done at image
creation time rather than through packages, making it very difficult to
add to its contents. As an example, we currently have no way to make use
of the multiple kernel enhancement that was recently added.

We should instead be treating the boot partition like anything else and
be installing needed items via packages. This can be done by treating
the /boot/ directory as the boot partion, pointing wic at it via the
--rootfs-dir option for the EFI partition, and using the new
--exclude-path option to not include the contents of /boot/ in the main
rootfs. This is the kickstart file in patch 0008.

What's left is installing everything in the correct location, which is
what the majority of the remaining patches entails.

I reused the grub-efi and systemd-boot bbclasses to create the
configuration files, and one change that was required due to that is the
removal of the assumption that kernels are installed as "vmlinuz", which
was normal in the past. This change was needed in order to make use of
the new normal kernel install, where the default kernel is installed to
/boot/ as ${KERNEL_IMAGETYPE}.

This has some cascading effects and required changes in install scripts
as well, as they too assumed the kernel would be named vmlinuz. When
updating these I also added functionality allowing them to install
multiple kernels.

The image enhancements can be tested in qemu by adding the following to
your local.conf:
MACHINE="qemux86"
# or qemux86-64
WKS_FILE = "efi-bootdisk.wks.in"
MACHINE_FEATURES_append = " efi"
IMAGE_INSTALL_append = " grub-efi systemd-boot kernel-image-bzimage"
# kernel-image-bzimage is neccessary due to
# RDEPENDS_${KERNEL_PACKAGE_NAME}-base = "" in qemu.inc
IMAGE_FSTYPES_pn-core-image-minimal_append = " wic"

And then running the following:
bitbake core-image-minimal ovmf
runqemu wic ovmf

The image will contain two bootloaders in the boot partition, and will
boot successfully with either.

Please note that without setting the EFI_PROVIDER variable, neither
bootloader will be installed as the standard boot(x64|ia32), and will
have to be ran manually through the EFI shell.

There is still one unfortunate issue with this patchset - I wasn't able
to get random UUIDs working completely right before feature freeze, so
instead the bootconf recipes assume that the rootfs will be /dev/sda2.
This can be changed via the ROOT variable which originated from the
grub-efi.bbclass. For this reason, I'm not making the efi-bootdisk
kickstart file default for anything, only making it available for this
release.

The issue with random UUIDs is that both wic and the bootloader
configurations need the same random value, and wic needs it at parse
time in order to specify it in a kickstart file. This is doable, but a
little nasty, by writing a value to a file and adding helper functions
to assign that value to a variable. The issue here is package upgrades.
I know of no way to ensure that that file generated at parse time
persists between builds, and if someone tries to do a package upgrade on
thier configuration file that now has a different UUID, they would no
longer have the same UUID as their rootfs, causing boot failures.

One additional issue is that the kernel is installed to /boot/ in iso
and hddimgs, when the real kernel and bootloaders are in the separate
EFI partition. This can be fixed via the following patch and one
additional line of configuration for those image types:
http://lists.openembedded.org/pipermail/openembedded-core/2018-January/146828.html

Please review this patcheset and let me know of any issues you see or
encounter. Also, I have a contrib branch available to pull from here:
https://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=clsulliv/image-creation-sda2

A previous iteration including the UUID stuff that's not included here
is available at clsulliv/image-creation-exclude-path

Thanks,
Cal

V2 changes:
* ROOT is now overridable. Woops.
* Fix fixup in 'systemd-boot: add package that installs to boot' that
    belonged in the systemd-bootconf recipe patch.
* Add -bootconf recipes to SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS to avoid
    rebuilding grub-efi/systemd-boot when not necessary.
* Add basic test case that leverages the generic EFI boot partition.

V3 changes:
* Autobuilder testing revealed two failing tests with this patchset:
    https://autobuilder.yocto.io/builders/nightly-oe-selftest/builds/858/steps/Running%20oe-selftest/logs/stdio
    Patches 19-21 fix these.

California Sullivan (21):
  grub-efi.bbclass: split out configuration portion
  grub: create recipe for configuration
  grub-efi: install to /boot/
  grub-efi: if installed and EFI_PROVIDER, install as bootx64 or
    bootia32
  packagegroup-core-boot: add bootloader to EFI systems
  live-vm-common.bbclass: Don't use vmlinuz or VM_DEFAULT_KERNEL
  grub-efi*.bbclass: don't reference vmlinuz
  wic: add wks file to make use of exclude-path functionality
  init-install-efi.sh: Update to support installing multiple kernels
  syslinux.bbclass: don't use vmlinuz
  systemd-boot.bbclass: break out configuration creation
  systemd: add systemd-bootconf recipe
  systemd-boot*.bbclass: Don't use vmlinuz
  systemd-boot: add package that installs to boot
  packagegroup-core-boot: add kernel for EFI systems
  init-install.sh: support multiple kernels and don't assume vmlinuz
  layer.conf: add -bootconf recipes to SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS
  selftests: Add test case for booting a generic EFI boot partition
    image
  grub-efi-cfg.bbclass: Don't reference or set OVERRIDES
  systemd-boot-cfg.bbclass: Don't reference or set OVERRIDES
  maintainers.inc: add myself as -bootconf recipe maintainer

 .../{grub-efi.bbclass => grub-efi-cfg.bbclass}     |  50 +--------
 meta/classes/grub-efi.bbclass                      | 124 +--------------------
 meta/classes/live-vm-common.bbclass                |   9 +-
 meta/classes/syslinux.bbclass                      |   4 +-
 meta/classes/systemd-boot-cfg.bbclass              |  70 ++++++++++++
 meta/classes/systemd-boot.bbclass                  |  72 +-----------
 meta/conf/distro/include/maintainers.inc           |   2 +
 meta/conf/layer.conf                               |   2 +
 meta/lib/oeqa/selftest/cases/efibootpartition.py   |  45 ++++++++
 meta/recipes-bsp/grub/grub-bootconf_1.00.bb        |  29 +++++
 meta/recipes-bsp/grub/grub-efi_2.02.bb             |  43 +++++--
 .../initrdscripts/files/init-install-efi.sh        |  15 ++-
 .../initrdscripts/files/init-install.sh            |  37 +++++-
 .../packagegroups/packagegroup-core-boot.bb        |   3 +
 meta/recipes-core/systemd/systemd-boot_234.bb      |  28 ++++-
 meta/recipes-core/systemd/systemd-bootconf_1.00.bb |  31 ++++++
 scripts/lib/wic/canned-wks/efi-bootdisk.wks.in     |   3 +
 17 files changed, 301 insertions(+), 266 deletions(-)
 copy meta/classes/{grub-efi.bbclass => grub-efi-cfg.bbclass} (70%)
 create mode 100644 meta/classes/systemd-boot-cfg.bbclass
 create mode 100644 meta/lib/oeqa/selftest/cases/efibootpartition.py
 create mode 100644 meta/recipes-bsp/grub/grub-bootconf_1.00.bb
 create mode 100644 meta/recipes-core/systemd/systemd-bootconf_1.00.bb
 create mode 100644 scripts/lib/wic/canned-wks/efi-bootdisk.wks.in

-- 
2.14.3



^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v3 01/21] grub-efi.bbclass: split out configuration portion
  2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
@ 2018-03-01  2:14 ` California Sullivan
  2018-03-01  2:14 ` [PATCH v3 02/21] grub: create recipe for configuration California Sullivan
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:14 UTC (permalink / raw)
  To: openembedded-core

This part is useful on its own, whereas the whole class together is
specific for image-live.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 .../{grub-efi.bbclass => grub-efi-cfg.bbclass}     |  40 -------
 meta/classes/grub-efi.bbclass                      | 122 +--------------------
 2 files changed, 1 insertion(+), 161 deletions(-)
 copy meta/classes/{grub-efi.bbclass => grub-efi-cfg.bbclass} (76%)

diff --git a/meta/classes/grub-efi.bbclass b/meta/classes/grub-efi-cfg.bbclass
similarity index 76%
copy from meta/classes/grub-efi.bbclass
copy to meta/classes/grub-efi-cfg.bbclass
index 610479b85d1..730323c72e6 100644
--- a/meta/classes/grub-efi.bbclass
+++ b/meta/classes/grub-efi-cfg.bbclass
@@ -16,8 +16,6 @@
 # ${GRUB_TIMEOUT} - timeout before executing the deault label (optional)
 # ${GRUB_ROOT} - grub's root device.
 
-do_bootimg[depends] += "${MLPREFIX}grub-efi:do_deploy"
-
 GRUB_SERIAL ?= "console=ttyS0,115200"
 GRUB_CFG_VM = "${S}/grub_vm.cfg"
 GRUB_CFG_LIVE = "${S}/grub_live.cfg"
@@ -32,44 +30,6 @@ APPEND ?= ""
 # Need UUID utility code.
 inherit fs-uuid
 
-efi_populate() {
-	# DEST must be the root of the image so that EFIDIR is not
-	# nested under a top level directory.
-	DEST=$1
-
-	install -d ${DEST}${EFIDIR}
-
-	GRUB_IMAGE="grub-efi-bootia32.efi"
-	DEST_IMAGE="bootia32.efi"
-	if [ "${TARGET_ARCH}" = "x86_64" ]; then
-		GRUB_IMAGE="grub-efi-bootx64.efi"
-		DEST_IMAGE="bootx64.efi"
-	fi
-	install -m 0644 ${DEPLOY_DIR_IMAGE}/${GRUB_IMAGE} ${DEST}${EFIDIR}/${DEST_IMAGE}
-	EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
-	printf 'fs0:%s\%s\n' "$EFIPATH" "$DEST_IMAGE" >${DEST}/startup.nsh
-
-	install -m 0644 ${GRUB_CFG} ${DEST}${EFIDIR}/grub.cfg
-}
-
-efi_iso_populate() {
-	iso_dir=$1
-	efi_populate $iso_dir
-	# Build a EFI directory to create efi.img
-	mkdir -p ${EFIIMGDIR}/${EFIDIR}
-	cp $iso_dir/${EFIDIR}/* ${EFIIMGDIR}${EFIDIR}
-	cp $iso_dir/vmlinuz ${EFIIMGDIR}
-	EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
-	printf 'fs0:%s\%s\n' "$EFIPATH" "$GRUB_IMAGE" > ${EFIIMGDIR}/startup.nsh
-	if [ -f "$iso_dir/initrd" ] ; then
-		cp $iso_dir/initrd ${EFIIMGDIR}
-	fi
-}
-
-efi_hddimg_populate() {
-	efi_populate $1
-}
-
 python build_efi_cfg() {
     import sys
 
diff --git a/meta/classes/grub-efi.bbclass b/meta/classes/grub-efi.bbclass
index 610479b85d1..4b5704c19cc 100644
--- a/meta/classes/grub-efi.bbclass
+++ b/meta/classes/grub-efi.bbclass
@@ -1,36 +1,4 @@
-# grub-efi.bbclass
-# Copyright (c) 2011, Intel Corporation.
-# All rights reserved.
-#
-# Released under the MIT license (see packages/COPYING)
-
-# Provide grub-efi specific functions for building bootable images.
-
-# External variables
-# ${INITRD} - indicates a list of filesystem images to concatenate and use as an initrd (optional)
-# ${ROOTFS} - indicates a filesystem image to include as the root filesystem (optional)
-# ${GRUB_GFXSERIAL} - set this to 1 to have graphics and serial in the boot menu
-# ${LABELS} - a list of targets for the automatic config
-# ${APPEND} - an override list of append strings for each label
-# ${GRUB_OPTS} - additional options to add to the config, ';' delimited # (optional)
-# ${GRUB_TIMEOUT} - timeout before executing the deault label (optional)
-# ${GRUB_ROOT} - grub's root device.
-
-do_bootimg[depends] += "${MLPREFIX}grub-efi:do_deploy"
-
-GRUB_SERIAL ?= "console=ttyS0,115200"
-GRUB_CFG_VM = "${S}/grub_vm.cfg"
-GRUB_CFG_LIVE = "${S}/grub_live.cfg"
-GRUB_TIMEOUT ?= "10"
-#FIXME: build this from the machine config
-GRUB_OPTS ?= "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"
-
-EFIDIR = "/EFI/BOOT"
-GRUB_ROOT ?= "${ROOT}"
-APPEND ?= ""
-
-# Need UUID utility code.
-inherit fs-uuid
+inherit grub-efi-cfg
 
 efi_populate() {
 	# DEST must be the root of the image so that EFIDIR is not
@@ -69,91 +37,3 @@ efi_iso_populate() {
 efi_hddimg_populate() {
 	efi_populate $1
 }
-
-python build_efi_cfg() {
-    import sys
-
-    workdir = d.getVar('WORKDIR')
-    if not workdir:
-        bb.error("WORKDIR not defined, unable to package")
-        return
-
-    gfxserial = d.getVar('GRUB_GFXSERIAL') or ""
-
-    labels = d.getVar('LABELS')
-    if not labels:
-        bb.debug(1, "LABELS not defined, nothing to do")
-        return
-
-    if labels == []:
-        bb.debug(1, "No labels, nothing to do")
-        return
-
-    cfile = d.getVar('GRUB_CFG')
-    if not cfile:
-        bb.fatal('Unable to read GRUB_CFG')
-
-    try:
-         cfgfile = open(cfile, 'w')
-    except OSError:
-        bb.fatal('Unable to open %s' % cfile)
-
-    cfgfile.write('# Automatically created by OE\n')
-
-    opts = d.getVar('GRUB_OPTS')
-    if opts:
-        for opt in opts.split(';'):
-            cfgfile.write('%s\n' % opt)
-
-    cfgfile.write('default=%s\n' % (labels.split()[0]))
-
-    timeout = d.getVar('GRUB_TIMEOUT')
-    if timeout:
-        cfgfile.write('timeout=%s\n' % timeout)
-    else:
-        cfgfile.write('timeout=50\n')
-
-    root = d.getVar('GRUB_ROOT')
-    if not root:
-        bb.fatal('GRUB_ROOT not defined')
-
-    if gfxserial == "1":
-        btypes = [ [ " graphics console", "" ],
-            [ " serial console", d.getVar('GRUB_SERIAL') or "" ] ]
-    else:
-        btypes = [ [ "", "" ] ]
-
-    for label in labels.split():
-        localdata = d.createCopy()
-
-        overrides = localdata.getVar('OVERRIDES')
-        if not overrides:
-            bb.fatal('OVERRIDES not defined')
-
-        for btype in btypes:
-            localdata.setVar('OVERRIDES', label + ':' + overrides)
-
-            cfgfile.write('\nmenuentry \'%s%s\'{\n' % (label, btype[0]))
-            lb = label
-            if label == "install":
-                lb = "install-efi"
-            cfgfile.write('linux /vmlinuz LABEL=%s' % (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')
-
-    cfgfile.close()
-}
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 02/21] grub: create recipe for configuration
  2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
  2018-03-01  2:14 ` [PATCH v3 01/21] grub-efi.bbclass: split out configuration portion California Sullivan
@ 2018-03-01  2:14 ` California Sullivan
  2018-03-01  2:15 ` [PATCH v3 03/21] grub-efi: install to /boot/ California Sullivan
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:14 UTC (permalink / raw)
  To: openembedded-core

This makes use of the grub-efi-cfg bbclass that was split out to create
a grub.cfg file just like the old one.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 meta/recipes-bsp/grub/grub-bootconf_1.00.bb | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 meta/recipes-bsp/grub/grub-bootconf_1.00.bb

diff --git a/meta/recipes-bsp/grub/grub-bootconf_1.00.bb b/meta/recipes-bsp/grub/grub-bootconf_1.00.bb
new file mode 100644
index 00000000000..d376fde68b1
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-bootconf_1.00.bb
@@ -0,0 +1,29 @@
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SUMMARY = "Basic grub.cfg for use in EFI systems"
+
+RPROVIDES_${PN} += "virtual/grub-bootconf"
+
+inherit grub-efi-cfg
+
+S = "${WORKDIR}"
+
+GRUB_CFG = "${S}/grub-bootconf"
+LABELS = "boot"
+
+ROOT ?= "root=/dev/sda2"
+
+python do_configure() {
+    bb.build.exec_func('build_efi_cfg', d)
+}
+
+do_configure[vardeps] += "APPEND ROOT"
+
+do_install() {
+	install -d ${D}/boot
+	install -d ${D}/boot/EFI
+	install -d ${D}/boot/EFI/BOOT
+	install -m 0744 grub-bootconf ${D}/boot/EFI/BOOT/grub.cfg
+}
+
+FILES_${PN} = "/boot/EFI/BOOT/grub.cfg"
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 03/21] grub-efi: install to /boot/
  2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
  2018-03-01  2:14 ` [PATCH v3 01/21] grub-efi.bbclass: split out configuration portion California Sullivan
  2018-03-01  2:14 ` [PATCH v3 02/21] grub: create recipe for configuration California Sullivan
@ 2018-03-01  2:15 ` California Sullivan
  2018-03-01  2:15 ` [PATCH v3 04/21] grub-efi: if installed and EFI_PROVIDER, install as bootx64 or bootia32 California Sullivan
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:15 UTC (permalink / raw)
  To: openembedded-core

Since /boot/ will be recipe/package controlled now we can't just deploy.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 meta/recipes-bsp/grub/grub-bootconf_1.00.bb |  2 +-
 meta/recipes-bsp/grub/grub-efi_2.02.bb      | 34 +++++++++++++++++++++++------
 2 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/meta/recipes-bsp/grub/grub-bootconf_1.00.bb b/meta/recipes-bsp/grub/grub-bootconf_1.00.bb
index d376fde68b1..750f8c808a8 100644
--- a/meta/recipes-bsp/grub/grub-bootconf_1.00.bb
+++ b/meta/recipes-bsp/grub/grub-bootconf_1.00.bb
@@ -23,7 +23,7 @@ do_install() {
 	install -d ${D}/boot
 	install -d ${D}/boot/EFI
 	install -d ${D}/boot/EFI/BOOT
-	install -m 0744 grub-bootconf ${D}/boot/EFI/BOOT/grub.cfg
+	install grub-bootconf ${D}/boot/EFI/BOOT/grub.cfg
 }
 
 FILES_${PN} = "/boot/EFI/BOOT/grub.cfg"
diff --git a/meta/recipes-bsp/grub/grub-efi_2.02.bb b/meta/recipes-bsp/grub/grub-efi_2.02.bb
index d5aa64c75f7..c5a68f01cef 100644
--- a/meta/recipes-bsp/grub/grub-efi_2.02.bb
+++ b/meta/recipes-bsp/grub/grub-efi_2.02.bb
@@ -3,7 +3,7 @@ require grub2.inc
 GRUBPLATFORM = "efi"
 
 DEPENDS_append_class-target = " grub-efi-native"
-RDEPENDS_${PN}_class-target = "diffutils freetype grub-common"
+RDEPENDS_${PN}_class-target = "diffutils freetype grub-common virtual/grub-bootconf"
 
 SRC_URI += " \
            file://cfg \
@@ -36,6 +36,28 @@ EXTRA_OECONF += "--enable-efiemu=no"
 # and many other places in the grub code when compiled with some native gcc compilers (specifically, gentoo)
 CFLAGS_append_class-native = " -Wno-error=trampolines"
 
+do_mkimage() {
+	cd ${B}
+	# Search for the grub.cfg on the local boot media by using the
+	# built in cfg file provided via this recipe
+	grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
+	               -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \
+	               ${GRUB_BUILDIN}
+}
+
+addtask mkimage before do_install after do_compile
+
+do_mkimage_class-native() {
+	:
+}
+
+do_install_append_class-target() {
+	install -d ${D}/boot
+	install -d ${D}/boot/EFI
+	install -d ${D}/boot/EFI/BOOT
+	install -m 644 ${B}/${GRUB_IMAGE} ${D}/boot/EFI/BOOT/
+}
+
 do_install_class-native() {
 	install -d ${D}${bindir}
 	install -m 755 grub-mkimage ${D}${bindir}
@@ -57,11 +79,6 @@ GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos part_gpt normal \
                  efi_gop iso9660 configfile search loadenv test"
 
 do_deploy() {
-	# Search for the grub.cfg on the local boot media by using the
-	# built in cfg file provided via this recipe
-	grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
-	               -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \
-	               ${GRUB_BUILDIN}
 	install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR}
 }
 
@@ -72,7 +89,10 @@ do_deploy_class-native() {
 addtask deploy after do_install before do_build
 
 FILES_${PN} = "${libdir}/grub/${GRUB_TARGET}-efi \
-                "
+               ${datadir}/grub \
+               /boot/EFI/BOOT/${GRUB_IMAGE} \
+               "
+
 
 # 64-bit binaries are expected for the bootloader with an x32 userland
 INSANE_SKIP_${PN}_append_linux-gnux32 = " arch"
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 04/21] grub-efi: if installed and EFI_PROVIDER, install as bootx64 or bootia32
  2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
                   ` (2 preceding siblings ...)
  2018-03-01  2:15 ` [PATCH v3 03/21] grub-efi: install to /boot/ California Sullivan
@ 2018-03-01  2:15 ` California Sullivan
  2018-03-01  2:34   ` Anuj Mittal
  2018-03-01  2:15 ` [PATCH v3 05/21] packagegroup-core-boot: add bootloader to EFI systems California Sullivan
                   ` (16 subsequent siblings)
  20 siblings, 1 reply; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:15 UTC (permalink / raw)
  To: openembedded-core

This way we could theoretically support multiple bootloaders, and we
keep the convention of boot(x64|ia32).

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 meta/recipes-bsp/grub/grub-efi_2.02.bb | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-bsp/grub/grub-efi_2.02.bb b/meta/recipes-bsp/grub/grub-efi_2.02.bb
index c5a68f01cef..ed27b90fdbc 100644
--- a/meta/recipes-bsp/grub/grub-efi_2.02.bb
+++ b/meta/recipes-bsp/grub/grub-efi_2.02.bb
@@ -15,16 +15,19 @@ S = "${WORKDIR}/grub-${PV}"
 python __anonymous () {
     import re
     target = d.getVar('TARGET_ARCH')
+    prefix = "" if d.getVar('EFI_PROVIDER') == "grub-efi" else "grub-efi-"
     if target == "x86_64":
         grubtarget = 'x86_64'
-        grubimage = "grub-efi-bootx64.efi"
+        grubimage = prefix + "bootx64.efi"
     elif re.match('i.86', target):
         grubtarget = 'i386'
-        grubimage = "grub-efi-bootia32.efi"
+        grubimage = prefix + "bootia32.efi"
     else:
         raise bb.parse.SkipRecipe("grub-efi is incompatible with target %s" % target)
     d.setVar("GRUB_TARGET", grubtarget)
     d.setVar("GRUB_IMAGE", grubimage)
+    prefix = "grub-efi-" if prefix == "" else ""
+    d.setVar("GRUB_IMAGE_PREFIX", prefix)
 }
 
 inherit deploy
@@ -41,7 +44,7 @@ do_mkimage() {
 	# Search for the grub.cfg on the local boot media by using the
 	# built in cfg file provided via this recipe
 	grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
-	               -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \
+	               -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} \
 	               ${GRUB_BUILDIN}
 }
 
@@ -55,7 +58,7 @@ do_install_append_class-target() {
 	install -d ${D}/boot
 	install -d ${D}/boot/EFI
 	install -d ${D}/boot/EFI/BOOT
-	install -m 644 ${B}/${GRUB_IMAGE} ${D}/boot/EFI/BOOT/
+	install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${D}/boot/EFI/BOOT/${GRUB_IMAGE}
 }
 
 do_install_class-native() {
@@ -79,7 +82,7 @@ GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos part_gpt normal \
                  efi_gop iso9660 configfile search loadenv test"
 
 do_deploy() {
-	install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR}
+	install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${DEPLOYDIR}
 }
 
 do_deploy_class-native() {
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 05/21] packagegroup-core-boot: add bootloader to EFI systems
  2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
                   ` (3 preceding siblings ...)
  2018-03-01  2:15 ` [PATCH v3 04/21] grub-efi: if installed and EFI_PROVIDER, install as bootx64 or bootia32 California Sullivan
@ 2018-03-01  2:15 ` California Sullivan
  2018-03-01  2:15 ` [PATCH v3 06/21] live-vm-common.bbclass: Don't use vmlinuz or VM_DEFAULT_KERNEL California Sullivan
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:15 UTC (permalink / raw)
  To: openembedded-core

Since the bootloader is now installed instead of added at image creation
time, this is necessary for booting.

Also set the default to grub-efi. This is done because a default of
grub-efi is already used by live-vm-common.bbclass, and in the event
that EFI_PROVIDER isn't defined errors would occur.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 meta/recipes-core/packagegroups/packagegroup-core-boot.bb | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/recipes-core/packagegroups/packagegroup-core-boot.bb b/meta/recipes-core/packagegroups/packagegroup-core-boot.bb
index 04bc0f2b693..0fcb8ba9193 100644
--- a/meta/recipes-core/packagegroups/packagegroup-core-boot.bb
+++ b/meta/recipes-core/packagegroups/packagegroup-core-boot.bb
@@ -23,6 +23,8 @@ VIRTUAL-RUNTIME_init_manager ?= "sysvinit"
 VIRTUAL-RUNTIME_initscripts ?= "initscripts"
 VIRTUAL-RUNTIME_keymaps ?= "keymaps"
 
+EFI_PROVIDER ??= "grub-efi"
+
 SYSVINIT_SCRIPTS = "${@bb.utils.contains('MACHINE_FEATURES', 'rtc', '${VIRTUAL-RUNTIME_base-utils-hwclock}', '', d)} \
                     modutils-initscripts \
                     init-ifupdown \
@@ -35,6 +37,7 @@ RDEPENDS_${PN} = "\
     ${VIRTUAL-RUNTIME_base-utils} \
     ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "${SYSVINIT_SCRIPTS}", "", d)} \
     ${@bb.utils.contains("MACHINE_FEATURES", "keyboard", "${VIRTUAL-RUNTIME_keymaps}", "", d)} \
+    ${@bb.utils.contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER}", "", d)} \
     netbase \
     ${VIRTUAL-RUNTIME_login_manager} \
     ${VIRTUAL-RUNTIME_init_manager} \
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 06/21] live-vm-common.bbclass: Don't use vmlinuz or VM_DEFAULT_KERNEL
  2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
                   ` (4 preceding siblings ...)
  2018-03-01  2:15 ` [PATCH v3 05/21] packagegroup-core-boot: add bootloader to EFI systems California Sullivan
@ 2018-03-01  2:15 ` California Sullivan
  2018-03-01  2:15 ` [PATCH v3 07/21] grub-efi*.bbclass: don't reference vmlinuz California Sullivan
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:15 UTC (permalink / raw)
  To: openembedded-core

I can't find VM_DEFAULT_KERNEL used anywhere else, and we should not be
statically installing the kernel as vmlinuz.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 meta/classes/live-vm-common.bbclass | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/meta/classes/live-vm-common.bbclass b/meta/classes/live-vm-common.bbclass
index e1d8b1843b6..714d6d4788c 100644
--- a/meta/classes/live-vm-common.bbclass
+++ b/meta/classes/live-vm-common.bbclass
@@ -33,18 +33,17 @@ inherit ${EFI_CLASS}
 inherit ${PCBIOS_CLASS}
 
 KERNEL_IMAGETYPE ??= "bzImage"
-VM_DEFAULT_KERNEL ??= "${KERNEL_IMAGETYPE}"
 
 populate_kernel() {
 	dest=$1
 	install -d $dest
 
 	# Install bzImage, initrd, and rootfs.img in DEST for all loaders to use.
-	bbnote "Trying to install ${DEPLOY_DIR_IMAGE}/${VM_DEFAULT_KERNEL} as $dest/vmlinuz"
-	if [ -e ${DEPLOY_DIR_IMAGE}/${VM_DEFAULT_KERNEL} ]; then
-		install -m 0644 ${DEPLOY_DIR_IMAGE}/${VM_DEFAULT_KERNEL} $dest/vmlinuz
+	bbnote "Trying to install ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} as $dest/${KERNEL_IMAGETYPE}"
+	if [ -e ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} ]; then
+		install -m 0644 ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} $dest/${KERNEL_IMAGETYPE}
 	else
-		bbwarn "${DEPLOY_DIR_IMAGE}/${VM_DEFAULT_KERNEL} doesn't exist"
+		bbwarn "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} doesn't exist"
 	fi
 
 	# initrd is made of concatenation of multiple filesystem images
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 07/21] grub-efi*.bbclass: don't reference vmlinuz
  2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
                   ` (5 preceding siblings ...)
  2018-03-01  2:15 ` [PATCH v3 06/21] live-vm-common.bbclass: Don't use vmlinuz or VM_DEFAULT_KERNEL California Sullivan
@ 2018-03-01  2:15 ` California Sullivan
  2018-03-05 12:50   ` Burton, Ross
  2018-03-01  2:15 ` [PATCH v3 08/21] wic: add wks file to make use of exclude-path functionality California Sullivan
                   ` (13 subsequent siblings)
  20 siblings, 1 reply; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:15 UTC (permalink / raw)
  To: openembedded-core

Rather than renaming the kernel to vmlinuz and assuming the name is
vmlinuz in the grub.cfg, copy to ${KERNEL_IMAGETYPE} and also use that
value in the grub.cfg file.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 meta/classes/grub-efi-cfg.bbclass | 4 +++-
 meta/classes/grub-efi.bbclass     | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/classes/grub-efi-cfg.bbclass b/meta/classes/grub-efi-cfg.bbclass
index 730323c72e6..85173c91fc3 100644
--- a/meta/classes/grub-efi-cfg.bbclass
+++ b/meta/classes/grub-efi-cfg.bbclass
@@ -22,6 +22,7 @@ GRUB_CFG_LIVE = "${S}/grub_live.cfg"
 GRUB_TIMEOUT ?= "10"
 #FIXME: build this from the machine config
 GRUB_OPTS ?= "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"
+KERNEL_IMAGETYPE ??= "bzImage"
 
 EFIDIR = "/EFI/BOOT"
 GRUB_ROOT ?= "${ROOT}"
@@ -97,7 +98,8 @@ python build_efi_cfg() {
             lb = label
             if label == "install":
                 lb = "install-efi"
-            cfgfile.write('linux /vmlinuz LABEL=%s' % (lb))
+            kernel = localdata.getVar('KERNEL_IMAGETYPE')
+            cfgfile.write('linux /%s LABEL=%s' % (kernel, lb))
 
             cfgfile.write(' %s' % replace_rootfs_uuid(d, root))
 
diff --git a/meta/classes/grub-efi.bbclass b/meta/classes/grub-efi.bbclass
index 4b5704c19cc..90badc03a0e 100644
--- a/meta/classes/grub-efi.bbclass
+++ b/meta/classes/grub-efi.bbclass
@@ -26,7 +26,7 @@ efi_iso_populate() {
 	# Build a EFI directory to create efi.img
 	mkdir -p ${EFIIMGDIR}/${EFIDIR}
 	cp $iso_dir/${EFIDIR}/* ${EFIIMGDIR}${EFIDIR}
-	cp $iso_dir/vmlinuz ${EFIIMGDIR}
+	cp $iso_dir/${KERNEL_IMAGETYPE} ${EFIIMGDIR}
 	EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
 	printf 'fs0:%s\%s\n' "$EFIPATH" "$GRUB_IMAGE" > ${EFIIMGDIR}/startup.nsh
 	if [ -f "$iso_dir/initrd" ] ; then
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 08/21] wic: add wks file to make use of exclude-path functionality
  2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
                   ` (6 preceding siblings ...)
  2018-03-01  2:15 ` [PATCH v3 07/21] grub-efi*.bbclass: don't reference vmlinuz California Sullivan
@ 2018-03-01  2:15 ` California Sullivan
  2018-03-01  2:15 ` [PATCH v3 09/21] init-install-efi.sh: Update to support installing multiple kernels California Sullivan
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:15 UTC (permalink / raw)
  To: openembedded-core

Using --exclude-path and a wks.in file we can create an image that takes
the /boot/ directory for the boot partition, has an empty /boot/
directory in the rootfs partition. The boot partition gets mounted to
/boot/ after startup.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 scripts/lib/wic/canned-wks/efi-bootdisk.wks.in | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 scripts/lib/wic/canned-wks/efi-bootdisk.wks.in

diff --git a/scripts/lib/wic/canned-wks/efi-bootdisk.wks.in b/scripts/lib/wic/canned-wks/efi-bootdisk.wks.in
new file mode 100644
index 00000000000..7300e65e32d
--- /dev/null
+++ b/scripts/lib/wic/canned-wks/efi-bootdisk.wks.in
@@ -0,0 +1,3 @@
+bootloader --ptable gpt
+part /boot --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/boot --fstype=vfat --label boot --active --align 1024 --use-uuid --overhead-factor 1.0
+part / --source rootfs --fstype=ext4 --label root --align 1024 --exclude-path boot/
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 09/21] init-install-efi.sh: Update to support installing multiple kernels
  2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
                   ` (7 preceding siblings ...)
  2018-03-01  2:15 ` [PATCH v3 08/21] wic: add wks file to make use of exclude-path functionality California Sullivan
@ 2018-03-01  2:15 ` California Sullivan
  2018-03-01  2:15 ` [PATCH v3 10/21] syslinux.bbclass: don't use vmlinuz California Sullivan
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:15 UTC (permalink / raw)
  To: openembedded-core

We can no longer rely on the kernel having a static name of "vmlinuz".
This means we can't use it as a sentinel value in our sed commands, and
we can't just copy vmlinuz to the boot directory.

Instead, we'll use "root=" as the sentinel value for our sed commands,
and we'll search for common kernel names to copy into our boot
directory.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 meta/recipes-core/initrdscripts/files/init-install-efi.sh | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
index 706418fa9c5..f946d971d11 100644
--- a/meta/recipes-core/initrdscripts/files/init-install-efi.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
@@ -244,10 +244,9 @@ if [ -f /run/media/$1/EFI/BOOT/grub.cfg ]; then
     sed -i "/initrd /d" $GRUBCFG
     # Delete any LABEL= strings
     sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG
-    # Delete any root= strings
-    sed -i "s/ root=[^ ]*/ /g" $GRUBCFG
-    # Add the root= and other standard boot options
-    sed -i "s@linux /vmlinuz *@linux /vmlinuz root=PARTUUID=$root_part_uuid rw $rootwait quiet @" $GRUBCFG
+    # Replace root= and add additional standard boot options
+    # We use root as a sentinel value, as vmlinuz is no longer guaranteed
+    sed -i "s/ root=[^ ]*/ root=PARTUUID=$root_part_uuid rw $rootwait quiet /g" $GRUBCFG
 fi
 
 if [ -d /run/media/$1/loader ]; then
@@ -269,7 +268,13 @@ fi
 
 umount /tgt_root
 
-cp /run/media/$1/vmlinuz /boot
+# Copy kernel artifacts. To add more artifacts just add to types
+# For now just support kernel types already being used by something in OE-core
+for types in bzImage zImage vmlinux vmlinuz fitImage; do
+    for kernel in `find /run/media/$1/ -name $types*`; do
+        cp $kernel /boot
+    done
+done
 
 umount /boot
 
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 10/21] syslinux.bbclass: don't use vmlinuz
  2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
                   ` (8 preceding siblings ...)
  2018-03-01  2:15 ` [PATCH v3 09/21] init-install-efi.sh: Update to support installing multiple kernels California Sullivan
@ 2018-03-01  2:15 ` California Sullivan
  2018-03-01  2:15 ` [PATCH v3 11/21] systemd-boot.bbclass: break out configuration creation California Sullivan
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:15 UTC (permalink / raw)
  To: openembedded-core

We can't guarantee the kernel will be named vmlinuz anymore. Use
KERNEL_IMAGETYPE instead.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 meta/classes/syslinux.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/classes/syslinux.bbclass b/meta/classes/syslinux.bbclass
index d6f882420e4..959aed4fb8f 100644
--- a/meta/classes/syslinux.bbclass
+++ b/meta/classes/syslinux.bbclass
@@ -21,6 +21,7 @@ do_bootimg[depends] += "${MLPREFIX}syslinux:do_populate_sysroot \
                         syslinux-native:do_populate_sysroot"
 
 ISOLINUXDIR ?= "/isolinux"
+KERNEL_IMAGETYPE ??= "bzImage"
 SYSLINUXDIR = "/"
 # The kernel has an internal default console, which you can override with
 # a console=...some_tty...
@@ -173,8 +174,9 @@ python build_syslinux_cfg () {
         if not root:
             bb.fatal('SYSLINUX_ROOT not defined')
 
+        kernel = localdata.getVar('KERNEL_IMAGETYPE')
         for btype in btypes:
-            cfgfile.write('LABEL %s%s\nKERNEL /vmlinuz\n' % (btype[0], label))
+            cfgfile.write('LABEL %s%s\nKERNEL /%s\n' % (btype[0], label, kernel))
 
             exargs = d.getVar('SYSLINUX_KERNEL_ARGS')
             if exargs:
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 11/21] systemd-boot.bbclass: break out configuration creation
  2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
                   ` (9 preceding siblings ...)
  2018-03-01  2:15 ` [PATCH v3 10/21] syslinux.bbclass: don't use vmlinuz California Sullivan
@ 2018-03-01  2:15 ` California Sullivan
  2018-03-01  2:15 ` [PATCH v3 12/21] systemd: add systemd-bootconf recipe California Sullivan
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:15 UTC (permalink / raw)
  To: openembedded-core

This class is useful on its own and can be used to create configuration
recipes.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 ...stemd-boot.bbclass => systemd-boot-cfg.bbclass} | 57 ------------------
 meta/classes/systemd-boot.bbclass                  | 70 +---------------------
 2 files changed, 1 insertion(+), 126 deletions(-)
 copy meta/classes/{systemd-boot.bbclass => systemd-boot-cfg.bbclass} (50%)

diff --git a/meta/classes/systemd-boot.bbclass b/meta/classes/systemd-boot-cfg.bbclass
similarity index 50%
copy from meta/classes/systemd-boot.bbclass
copy to meta/classes/systemd-boot-cfg.bbclass
index 937307076f7..46eeae126ae 100644
--- a/meta/classes/systemd-boot.bbclass
+++ b/meta/classes/systemd-boot-cfg.bbclass
@@ -1,18 +1,3 @@
-# Copyright (C) 2016 Intel Corporation
-#
-# Released under the MIT license (see COPYING.MIT)
-
-# systemd-boot.bbclass - The "systemd-boot" is essentially the gummiboot merged into systemd.
-#                        The original standalone gummiboot project is dead without any more
-#                        maintenance.
-#
-# Set EFI_PROVIDER = "systemd-boot" to use systemd-boot on your live images instead of grub-efi
-# (images built by image-live.bbclass)
-
-do_bootimg[depends] += "${MLPREFIX}systemd-boot:do_deploy"
-
-EFIDIR = "/EFI/BOOT"
-
 SYSTEMD_BOOT_CFG ?= "${S}/loader.conf"
 SYSTEMD_BOOT_ENTRIES ?= ""
 SYSTEMD_BOOT_TIMEOUT ?= "10"
@@ -20,48 +5,6 @@ SYSTEMD_BOOT_TIMEOUT ?= "10"
 # Need UUID utility code.
 inherit fs-uuid
 
-efi_populate() {
-        DEST=$1
-
-        EFI_IMAGE="systemd-bootia32.efi"
-        DEST_EFI_IMAGE="bootia32.efi"
-        if [ "${TARGET_ARCH}" = "x86_64" ]; then
-            EFI_IMAGE="systemd-bootx64.efi"
-            DEST_EFI_IMAGE="bootx64.efi"
-        fi
-
-        install -d ${DEST}${EFIDIR}
-        # systemd-boot requires these paths for configuration files
-        # they are not customizable so no point in new vars
-        install -d ${DEST}/loader
-        install -d ${DEST}/loader/entries
-        install -m 0644 ${DEPLOY_DIR_IMAGE}/${EFI_IMAGE} ${DEST}${EFIDIR}/${DEST_EFI_IMAGE}
-        EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
-        printf 'fs0:%s\%s\n' "$EFIPATH" "$DEST_EFI_IMAGE" >${DEST}/startup.nsh
-        install -m 0644 ${SYSTEMD_BOOT_CFG} ${DEST}/loader/loader.conf
-        for i in ${SYSTEMD_BOOT_ENTRIES}; do
-            install -m 0644 ${i} ${DEST}/loader/entries
-        done
-}
-
-efi_iso_populate() {
-        iso_dir=$1
-        efi_populate $iso_dir
-        mkdir -p ${EFIIMGDIR}/${EFIDIR}
-        cp $iso_dir/${EFIDIR}/* ${EFIIMGDIR}${EFIDIR}
-        cp -r $iso_dir/loader ${EFIIMGDIR}
-        cp $iso_dir/vmlinuz ${EFIIMGDIR}
-        EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
-        echo "fs0:${EFIPATH}\\${DEST_EFI_IMAGE}" > ${EFIIMGDIR}/startup.nsh
-        if [ -f "$iso_dir/initrd" ] ; then
-            cp $iso_dir/initrd ${EFIIMGDIR}
-        fi
-}
-
-efi_hddimg_populate() {
-        efi_populate $1
-}
-
 python build_efi_cfg() {
     s = d.getVar("S")
     labels = d.getVar('LABELS')
diff --git a/meta/classes/systemd-boot.bbclass b/meta/classes/systemd-boot.bbclass
index 937307076f7..14538fe2d7a 100644
--- a/meta/classes/systemd-boot.bbclass
+++ b/meta/classes/systemd-boot.bbclass
@@ -12,11 +12,6 @@
 do_bootimg[depends] += "${MLPREFIX}systemd-boot:do_deploy"
 
 EFIDIR = "/EFI/BOOT"
-
-SYSTEMD_BOOT_CFG ?= "${S}/loader.conf"
-SYSTEMD_BOOT_ENTRIES ?= ""
-SYSTEMD_BOOT_TIMEOUT ?= "10"
-
 # Need UUID utility code.
 inherit fs-uuid
 
@@ -62,67 +57,4 @@ efi_hddimg_populate() {
         efi_populate $1
 }
 
-python build_efi_cfg() {
-    s = d.getVar("S")
-    labels = d.getVar('LABELS')
-    if not labels:
-        bb.debug(1, "LABELS not defined, nothing to do")
-        return
-
-    if labels == []:
-        bb.debug(1, "No labels, nothing to do")
-        return
-
-    cfile = d.getVar('SYSTEMD_BOOT_CFG')
-    cdir = os.path.dirname(cfile)
-    if not os.path.exists(cdir):
-        os.makedirs(cdir)
-    try:
-         cfgfile = open(cfile, 'w')
-    except OSError:
-        bb.fatal('Unable to open %s' % cfile)
-
-    cfgfile.write('# Automatically created by OE\n')
-    cfgfile.write('default %s\n' % (labels.split()[0]))
-    timeout = d.getVar('SYSTEMD_BOOT_TIMEOUT')
-    if timeout:
-        cfgfile.write('timeout %s\n' % timeout)
-    else:
-        cfgfile.write('timeout 10\n')
-    cfgfile.close()
-
-    for label in labels.split():
-        localdata = d.createCopy()
-
-        overrides = localdata.getVar('OVERRIDES')
-        if not overrides:
-            bb.fatal('OVERRIDES not defined')
-
-        entryfile = "%s/%s.conf" % (s, label)
-        if not os.path.exists(s):
-            os.makedirs(s)
-        d.appendVar("SYSTEMD_BOOT_ENTRIES", " " + entryfile)
-        try:
-            entrycfg = open(entryfile, "w")
-        except OSError:
-            bb.fatal('Unable to open %s' % entryfile)
-        localdata.setVar('OVERRIDES', label + ':' + overrides)
-
-        entrycfg.write('title %s\n' % label)
-        entrycfg.write('linux /vmlinuz\n')
-
-        append = localdata.getVar('APPEND')
-        initrd = localdata.getVar('INITRD')
-
-        if initrd:
-            entrycfg.write('initrd /initrd\n')
-        lb = label
-        if label == "install":
-            lb = "install-efi"
-        entrycfg.write('options LABEL=%s ' % lb)
-        if append:
-            append = replace_rootfs_uuid(d, append)
-            entrycfg.write('%s' % append)
-        entrycfg.write('\n')
-        entrycfg.close()
-}
+inherit systemd-boot-cfg
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 12/21] systemd: add systemd-bootconf recipe
  2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
                   ` (10 preceding siblings ...)
  2018-03-01  2:15 ` [PATCH v3 11/21] systemd-boot.bbclass: break out configuration creation California Sullivan
@ 2018-03-01  2:15 ` California Sullivan
  2018-03-01  2:15 ` [PATCH v3 13/21] systemd-boot*.bbclass: Don't use vmlinuz California Sullivan
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:15 UTC (permalink / raw)
  To: openembedded-core

Reuses our systemd-boot-cfg bbclass to generate systemd-boot
configuration files.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 meta/recipes-core/systemd/systemd-bootconf_1.00.bb | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd-bootconf_1.00.bb

diff --git a/meta/recipes-core/systemd/systemd-bootconf_1.00.bb b/meta/recipes-core/systemd/systemd-bootconf_1.00.bb
new file mode 100644
index 00000000000..e9c2466456c
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-bootconf_1.00.bb
@@ -0,0 +1,31 @@
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SUMMARY = "Basic systemd-boot configuration files"
+
+RPROVIDES_${PN} += "virtual/systemd-bootconf"
+
+inherit systemd-boot-cfg
+
+S = "${WORKDIR}"
+
+LABELS = "boot"
+
+ROOT ?= "root=/dev/sda2"
+APPEND_append = " ${ROOT}"
+
+python do_configure() {
+    bb.build.exec_func('build_efi_cfg', d)
+}
+
+do_configure[vardeps] += "APPEND"
+
+do_install() {
+	install -d ${D}/boot
+	install -d ${D}/boot/loader
+	install -d ${D}/boot/loader/entries
+	install loader.conf ${D}/boot/loader/
+	rm loader.conf
+	install *.conf ${D}/boot/loader/entries/
+}
+
+FILES_${PN} = "/boot/loader/* /boot/loader/entries/*"
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 13/21] systemd-boot*.bbclass: Don't use vmlinuz
  2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
                   ` (11 preceding siblings ...)
  2018-03-01  2:15 ` [PATCH v3 12/21] systemd: add systemd-bootconf recipe California Sullivan
@ 2018-03-01  2:15 ` California Sullivan
  2018-03-01  2:15 ` [PATCH v3 14/21] systemd-boot: add package that installs to boot California Sullivan
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:15 UTC (permalink / raw)
  To: openembedded-core

We can't guarantee vmlinuz anymore. Use KERNEL_IMAGETYPE instead.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 meta/classes/systemd-boot-cfg.bbclass | 6 +++++-
 meta/classes/systemd-boot.bbclass     | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta/classes/systemd-boot-cfg.bbclass b/meta/classes/systemd-boot-cfg.bbclass
index 46eeae126ae..360c86cbd34 100644
--- a/meta/classes/systemd-boot-cfg.bbclass
+++ b/meta/classes/systemd-boot-cfg.bbclass
@@ -1,3 +1,5 @@
+KERNEL_IMAGETYPE ??= "bzImage"
+
 SYSTEMD_BOOT_CFG ?= "${S}/loader.conf"
 SYSTEMD_BOOT_ENTRIES ?= ""
 SYSTEMD_BOOT_TIMEOUT ?= "10"
@@ -52,7 +54,9 @@ python build_efi_cfg() {
         localdata.setVar('OVERRIDES', label + ':' + overrides)
 
         entrycfg.write('title %s\n' % label)
-        entrycfg.write('linux /vmlinuz\n')
+
+        kernel = localdata.getVar("KERNEL_IMAGETYPE")
+        entrycfg.write('linux /%s\n' % kernel)
 
         append = localdata.getVar('APPEND')
         initrd = localdata.getVar('INITRD')
diff --git a/meta/classes/systemd-boot.bbclass b/meta/classes/systemd-boot.bbclass
index 14538fe2d7a..3cd6811a6ce 100644
--- a/meta/classes/systemd-boot.bbclass
+++ b/meta/classes/systemd-boot.bbclass
@@ -45,7 +45,7 @@ efi_iso_populate() {
         mkdir -p ${EFIIMGDIR}/${EFIDIR}
         cp $iso_dir/${EFIDIR}/* ${EFIIMGDIR}${EFIDIR}
         cp -r $iso_dir/loader ${EFIIMGDIR}
-        cp $iso_dir/vmlinuz ${EFIIMGDIR}
+        cp $iso_dir/${KERNEL_IMAGETYPE} ${EFIIMGDIR}
         EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
         echo "fs0:${EFIPATH}\\${DEST_EFI_IMAGE}" > ${EFIIMGDIR}/startup.nsh
         if [ -f "$iso_dir/initrd" ] ; then
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 14/21] systemd-boot: add package that installs to boot
  2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
                   ` (12 preceding siblings ...)
  2018-03-01  2:15 ` [PATCH v3 13/21] systemd-boot*.bbclass: Don't use vmlinuz California Sullivan
@ 2018-03-01  2:15 ` California Sullivan
  2018-03-01  2:15 ` [PATCH v3 15/21] packagegroup-core-boot: add kernel for EFI systems California Sullivan
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:15 UTC (permalink / raw)
  To: openembedded-core

If the EFI_PROVIDER is systemd-boot, install as boot(x64|ia32) as per
convention. If its not the EFI_PROVIDER, install as
systemd-boot(x64|ia32), as to not collide with other possible
bootloaders.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 meta/recipes-core/systemd/systemd-boot_234.bb | 28 ++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/systemd/systemd-boot_234.bb b/meta/recipes-core/systemd/systemd-boot_234.bb
index 88a14ac61ec..2d29df8be7c 100644
--- a/meta/recipes-core/systemd/systemd-boot_234.bb
+++ b/meta/recipes-core/systemd/systemd-boot_234.bb
@@ -18,6 +18,26 @@ EXTRA_OECONF = " --enable-gnuefi \
                  EFI_CC='${EFI_CC}' \
                "
 
+# install to the image as boot*.efi if its the EFI_PROVIDER,
+# otherwise install as the full name.
+# This allows multiple bootloaders to coexist in a single image.
+python __anonymous () {
+    import re
+    target = d.getVar('TARGET_ARCH')
+    prefix = "" if d.getVar('EFI_PROVIDER', True) == "systemd-boot" else "systemd-"
+    if target == "x86_64":
+        systemdimage = prefix + "bootx64.efi"
+    else:
+        systemdimage = prefix + "bootia32.efi"
+    d.setVar("SYSTEMD_BOOT_IMAGE", systemdimage)
+    prefix = "systemd-" if prefix == "" else ""
+    d.setVar("SYSTEMD_BOOT_IMAGE_PREFIX", prefix)
+}
+
+FILES_${PN} = "/boot/EFI/BOOT/${SYSTEMD_BOOT_IMAGE}"
+
+RDEPENDS_${PN} += "virtual/systemd-bootconf"
+
 # Imported from the old gummiboot recipe
 TUNE_CCARGS_remove = "-mfpmath=sse"
 COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux"
@@ -29,12 +49,14 @@ do_compile() {
 		SYSTEMD_BOOT_EFI_ARCH="x64"
 	fi
 
-	oe_runmake systemd-boot${SYSTEMD_BOOT_EFI_ARCH}.efi
+	oe_runmake ${SYSTEMD_BOOT_IMAGE_PREFIX}${SYSTEMD_BOOT_IMAGE}
 }
 
 do_install() {
-	# Bypass systemd installation with a NOP
-	:
+	install -d ${D}/boot
+	install -d ${D}/boot/EFI
+	install -d ${D}/boot/EFI/BOOT
+	install ${B}/systemd-boot*.efi ${D}/boot/EFI/BOOT/${SYSTEMD_BOOT_IMAGE}
 }
 
 do_deploy () {
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 15/21] packagegroup-core-boot: add kernel for EFI systems
  2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
                   ` (13 preceding siblings ...)
  2018-03-01  2:15 ` [PATCH v3 14/21] systemd-boot: add package that installs to boot California Sullivan
@ 2018-03-01  2:15 ` California Sullivan
  2018-03-01  2:15 ` [PATCH v3 16/21] init-install.sh: support multiple kernels and don't assume vmlinuz California Sullivan
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:15 UTC (permalink / raw)
  To: openembedded-core

Previously this wasn't needed because the kernel was added at image
creation time to the boot partition. Now that the boot partition is
created from the /boot/ partition of the rootfs, it needs to be
installed there.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 meta/recipes-core/packagegroups/packagegroup-core-boot.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/packagegroups/packagegroup-core-boot.bb b/meta/recipes-core/packagegroups/packagegroup-core-boot.bb
index 0fcb8ba9193..76cd7fc4ebf 100644
--- a/meta/recipes-core/packagegroups/packagegroup-core-boot.bb
+++ b/meta/recipes-core/packagegroups/packagegroup-core-boot.bb
@@ -37,7 +37,7 @@ RDEPENDS_${PN} = "\
     ${VIRTUAL-RUNTIME_base-utils} \
     ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "${SYSVINIT_SCRIPTS}", "", d)} \
     ${@bb.utils.contains("MACHINE_FEATURES", "keyboard", "${VIRTUAL-RUNTIME_keymaps}", "", d)} \
-    ${@bb.utils.contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER}", "", d)} \
+    ${@bb.utils.contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER} kernel", "", d)} \
     netbase \
     ${VIRTUAL-RUNTIME_login_manager} \
     ${VIRTUAL-RUNTIME_init_manager} \
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 16/21] init-install.sh: support multiple kernels and don't assume vmlinuz
  2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
                   ` (14 preceding siblings ...)
  2018-03-01  2:15 ` [PATCH v3 15/21] packagegroup-core-boot: add kernel for EFI systems California Sullivan
@ 2018-03-01  2:15 ` California Sullivan
  2018-03-01  2:15 ` [PATCH v3 17/21] layer.conf: add -bootconf recipes to SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS California Sullivan
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:15 UTC (permalink / raw)
  To: openembedded-core

Since kernels will not necessarily be installed as vmlinuz anymore,
don't assume that's its name for either the bootloader config or the
copy of the kernel.

Also, allow installing multiple kernels by searching for common kernel
names.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 .../initrdscripts/files/init-install.sh            | 37 ++++++++++++++++++++--
 1 file changed, 34 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh
index dade059c8f1..713a83092bf 100644
--- a/meta/recipes-core/initrdscripts/files/init-install.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -256,9 +256,34 @@ fi
 umount /tgt_root
 umount /src_root
 
+echo "Looking for kernels to use as boot target.."
+# Find kernel to boot to
+# Give user options if multiple are found
+kernels="$(find /run/media/$1/ -type f  \
+           -name bzImage* -o -name zImage* \
+           -o -name vmlinux* -o -name vmlinuz* \
+           -o -name fitImage* \
+           | sed s:.*/::)"
+if [ -n "$(echo $kernels)" ]; then
+    # only one kernel entry if no space
+    if [ -z "$(echo $kernels | grep " ")" ]; then
+        kernel=$kernels
+        echo "$kernel will be used as the boot target"
+    else
+        echo "Which kernel do we want to boot by default? The following kernels were found:"
+        echo $kernels
+        read answer
+        kernel=$answer
+    fi
+else
+    echo "No kernels found, exiting..."
+    exit 1
+fi
+
 # Handling of the target boot partition
 mount $bootfs /boot
 echo "Preparing boot partition..."
+
 if [ -f /etc/grub.d/00_header -a $grub_version -ne 0 ] ; then
     echo "Preparing custom grub2 menu..."
     root_part_uuid=$(blkid -o value -s PARTUUID ${rootfs})
@@ -268,7 +293,7 @@ if [ -f /etc/grub.d/00_header -a $grub_version -ne 0 ] ; then
     cat >$GRUBCFG <<_EOF
 menuentry "Linux" {
     search --no-floppy --fs-uuid $boot_uuid --set root
-    linux /vmlinuz root=PARTUUID=$root_part_uuid $rootwait rw $5 $3 $4 quiet
+    linux /$kernel root=PARTUUID=$root_part_uuid $rootwait rw $5 $3 $4 quiet
 }
 _EOF
     chmod 0444 $GRUBCFG
@@ -282,10 +307,16 @@ if [ $grub_version -eq 0 ] ; then
     echo "timeout 30" >> /boot/grub/menu.lst
     echo "title Live Boot/Install-Image" >> /boot/grub/menu.lst
     echo "root  (hd0,0)" >> /boot/grub/menu.lst
-    echo "kernel /vmlinuz root=$rootfs rw $3 $4 quiet" >> /boot/grub/menu.lst
+    echo "kernel /$kernel root=$rootfs rw $3 $4 quiet" >> /boot/grub/menu.lst
 fi
 
-cp /run/media/$1/vmlinuz /boot/
+# Copy kernel artifacts. To add more artifacts just add to types
+# For now just support kernel types already being used by something in OE-core
+for types in bzImage zImage vmlinux vmlinuz fitImage; do
+    for kernel in `find /run/media/$1/ -name $types*`; do
+        cp $kernel /boot
+    done
+done
 
 umount /boot
 
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 17/21] layer.conf: add -bootconf recipes to SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS
  2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
                   ` (15 preceding siblings ...)
  2018-03-01  2:15 ` [PATCH v3 16/21] init-install.sh: support multiple kernels and don't assume vmlinuz California Sullivan
@ 2018-03-01  2:15 ` California Sullivan
  2018-03-01  2:15 ` [PATCH v3 18/21] selftests: Add test case for booting a generic EFI boot partition image California Sullivan
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:15 UTC (permalink / raw)
  To: openembedded-core

The bootloaders depend on these to be functional in the non-deploy case,
but changes in them don't require rebuilding of the packages.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 meta/conf/layer.conf | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/conf/layer.conf b/meta/conf/layer.conf
index 67820588d37..7193f113885 100644
--- a/meta/conf/layer.conf
+++ b/meta/conf/layer.conf
@@ -61,10 +61,12 @@ SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \
   initramfs-module-install->grub \
   initramfs-module-install->parted \
   initramfs-module-install->util-linux \
+  grub-efi->grub-bootconf \
   liberation-fonts->fontconfig \
   cantarell-fonts->fontconfig \
   gnome-icon-theme->librsvg \
   font-alias->font-util \
+  systemd-boot->systemd-bootconf \
   weston-init->weston \
   weston-init->kbd \
 "
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 18/21] selftests: Add test case for booting a generic EFI boot partition image
  2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
                   ` (16 preceding siblings ...)
  2018-03-01  2:15 ` [PATCH v3 17/21] layer.conf: add -bootconf recipes to SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS California Sullivan
@ 2018-03-01  2:15 ` California Sullivan
  2018-03-01  2:15 ` [PATCH v3 19/21] grub-efi-cfg.bbclass: Don't reference or set OVERRIDES California Sullivan
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:15 UTC (permalink / raw)
  To: openembedded-core

Simple test case that adds 'efi' to MACHINE_FEATURES, sets WKS_FILE to
"efi-bootdisk.wks.in", installed required boot items, and attempts to
boot the wic image.

Quick check to make sure that the feature actually works.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 meta/lib/oeqa/selftest/cases/efibootpartition.py | 45 ++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 meta/lib/oeqa/selftest/cases/efibootpartition.py

diff --git a/meta/lib/oeqa/selftest/cases/efibootpartition.py b/meta/lib/oeqa/selftest/cases/efibootpartition.py
new file mode 100644
index 00000000000..0c832566965
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/efibootpartition.py
@@ -0,0 +1,45 @@
+# Based on runqemu.py test file
+#
+# Copyright (c) 2017 Wind River Systems, Inc.
+#
+
+import re
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import bitbake, runqemu, get_bb_var
+
+class GenericEFITest(OESelftestTestCase):
+    """EFI booting test class"""
+
+    buffer = True
+    cmd_common = "runqemu nographic serial wic ovmf"
+    efi_provider = "systemd-boot"
+    image = "core-image-minimal"
+    machine = "qemux86-64"
+    recipes_built = False
+
+    @classmethod
+    def setUpLocal(self):
+        super(GenericEFITest, self).setUpLocal(self)
+
+        self.write_config(self,
+"""
+EFI_PROVIDER = "%s"
+IMAGE_FSTYPES_pn-%s_append = " wic"
+MACHINE = "%s"
+MACHINE_FEATURES_append = " efi"
+WKS_FILE = "efi-bootdisk.wks.in"
+IMAGE_INSTALL_append = " grub-efi systemd-boot kernel-image-bzimage"
+"""
+% (self.efi_provider, self.image, self.machine))
+        if not self.recipes_built:
+            bitbake("ovmf")
+            bitbake(self.image)
+            self.recipes_built = True
+
+    @classmethod
+    def test_boot_efi(self):
+        """Test generic boot partition with qemu"""
+        cmd = "%s %s" % (self.cmd_common, self.machine)
+        with runqemu(self.image, ssh=False, launch_cmd=cmd) as qemu:
+            self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd)
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 19/21] grub-efi-cfg.bbclass: Don't reference or set OVERRIDES
  2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
                   ` (17 preceding siblings ...)
  2018-03-01  2:15 ` [PATCH v3 18/21] selftests: Add test case for booting a generic EFI boot partition image California Sullivan
@ 2018-03-01  2:15 ` California Sullivan
  2018-03-01  2:15 ` [PATCH v3 20/21] systemd-boot-cfg.bbclass: " California Sullivan
  2018-03-01  2:15 ` [PATCH v3 21/21] maintainers.inc: add myself as -bootconf recipe maintainer California Sullivan
  20 siblings, 0 replies; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:15 UTC (permalink / raw)
  To: openembedded-core

There's no need to add to the local copy of overrides and then not do
anything with it.

Now that this function is being used in package creation it was causing
sstate issues as well, as MACHINE is always in OVERRIDES, so something
trivial such as the name of the MACHINE would cause the hash to change.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 meta/classes/grub-efi-cfg.bbclass | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/meta/classes/grub-efi-cfg.bbclass b/meta/classes/grub-efi-cfg.bbclass
index 85173c91fc3..d2226af97a7 100644
--- a/meta/classes/grub-efi-cfg.bbclass
+++ b/meta/classes/grub-efi-cfg.bbclass
@@ -87,13 +87,7 @@ python build_efi_cfg() {
     for label in labels.split():
         localdata = d.createCopy()
 
-        overrides = localdata.getVar('OVERRIDES')
-        if not overrides:
-            bb.fatal('OVERRIDES not defined')
-
         for btype in btypes:
-            localdata.setVar('OVERRIDES', label + ':' + overrides)
-
             cfgfile.write('\nmenuentry \'%s%s\'{\n' % (label, btype[0]))
             lb = label
             if label == "install":
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 20/21] systemd-boot-cfg.bbclass: Don't reference or set OVERRIDES
  2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
                   ` (18 preceding siblings ...)
  2018-03-01  2:15 ` [PATCH v3 19/21] grub-efi-cfg.bbclass: Don't reference or set OVERRIDES California Sullivan
@ 2018-03-01  2:15 ` California Sullivan
  2018-03-01  2:15 ` [PATCH v3 21/21] maintainers.inc: add myself as -bootconf recipe maintainer California Sullivan
  20 siblings, 0 replies; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:15 UTC (permalink / raw)
  To: openembedded-core

There's no need to add to the local copy of overrides and then not do
anything with it.

Now that this function is being used in package creation it was causing
sstate issues as well, as MACHINE is always in OVERRIDES, so something
trivial such as the name of the MACHINE would cause the hash to change.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 meta/classes/systemd-boot-cfg.bbclass | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/meta/classes/systemd-boot-cfg.bbclass b/meta/classes/systemd-boot-cfg.bbclass
index 360c86cbd34..107758548c6 100644
--- a/meta/classes/systemd-boot-cfg.bbclass
+++ b/meta/classes/systemd-boot-cfg.bbclass
@@ -39,10 +39,6 @@ python build_efi_cfg() {
     for label in labels.split():
         localdata = d.createCopy()
 
-        overrides = localdata.getVar('OVERRIDES')
-        if not overrides:
-            bb.fatal('OVERRIDES not defined')
-
         entryfile = "%s/%s.conf" % (s, label)
         if not os.path.exists(s):
             os.makedirs(s)
@@ -51,7 +47,6 @@ python build_efi_cfg() {
             entrycfg = open(entryfile, "w")
         except OSError:
             bb.fatal('Unable to open %s' % entryfile)
-        localdata.setVar('OVERRIDES', label + ':' + overrides)
 
         entrycfg.write('title %s\n' % label)
 
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 21/21] maintainers.inc: add myself as -bootconf recipe maintainer
  2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
                   ` (19 preceding siblings ...)
  2018-03-01  2:15 ` [PATCH v3 20/21] systemd-boot-cfg.bbclass: " California Sullivan
@ 2018-03-01  2:15 ` California Sullivan
  20 siblings, 0 replies; 27+ messages in thread
From: California Sullivan @ 2018-03-01  2:15 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
---
 meta/conf/distro/include/maintainers.inc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
index 50392487903..ba5e6137e77 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -236,6 +236,7 @@ RECIPE_MAINTAINER_pn-gptfdisk = "Alexander Kanavin <alexander.kanavin@intel.com>
 RECIPE_MAINTAINER_pn-grep = "Denys Dmytriyenko <denys@ti.com>"
 RECIPE_MAINTAINER_pn-groff = "Hongxu Jia <hongxu.jia@windriver.com>"
 RECIPE_MAINTAINER_pn-grub = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-grub-bootconf = "California Sullivan <california.l.sullivan@intel.com>"
 RECIPE_MAINTAINER_pn-grub-efi = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-gsettings-desktop-schemas = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-gst-examples = "Anuj Mittal <anuj.mittal@intel.com>"
@@ -683,6 +684,7 @@ RECIPE_MAINTAINER_pn-sysstat = "Chen Qi <Qi.Chen@windriver.com>"
 RECIPE_MAINTAINER_pn-systemd = "Chen Qi <Qi.Chen@windriver.com>"
 RECIPE_MAINTAINER_pn-systemd-boot = "Chen Qi <Qi.Chen@windriver.com>"
 RECIPE_MAINTAINER_pn-systemd-bootchart = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-systemd-bootconf = "California Sullivan <california.l.sullivan@intel.com>"
 RECIPE_MAINTAINER_pn-systemd-compat-units = "Chen Qi <Qi.Chen@windriver.com>"
 RECIPE_MAINTAINER_pn-systemd-serialgetty = "Chen Qi <Qi.Chen@windriver.com>"
 RECIPE_MAINTAINER_pn-systemd-systemctl-native = "Chen Qi <Qi.Chen@windriver.com>"
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 27+ messages in thread

* Re: [PATCH v3 04/21] grub-efi: if installed and EFI_PROVIDER, install as bootx64 or bootia32
  2018-03-01  2:15 ` [PATCH v3 04/21] grub-efi: if installed and EFI_PROVIDER, install as bootx64 or bootia32 California Sullivan
@ 2018-03-01  2:34   ` Anuj Mittal
  2018-03-01 17:37     ` Cal Sullivan
  0 siblings, 1 reply; 27+ messages in thread
From: Anuj Mittal @ 2018-03-01  2:34 UTC (permalink / raw)
  To: California Sullivan, openembedded-core

Hi Cal,

On 03/01/2018 10:15 AM, California Sullivan wrote:
> This way we could theoretically support multiple bootloaders, and we
> keep the convention of boot(x64|ia32).
> 
> Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
> ---
>  meta/recipes-bsp/grub/grub-efi_2.02.bb | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/meta/recipes-bsp/grub/grub-efi_2.02.bb b/meta/recipes-bsp/grub/grub-efi_2.02.bb
> index c5a68f01cef..ed27b90fdbc 100644
> --- a/meta/recipes-bsp/grub/grub-efi_2.02.bb
> +++ b/meta/recipes-bsp/grub/grub-efi_2.02.bb
> @@ -15,16 +15,19 @@ S = "${WORKDIR}/grub-${PV}"
>  python __anonymous () {
>      import re
>      target = d.getVar('TARGET_ARCH')
> +    prefix = "" if d.getVar('EFI_PROVIDER') == "grub-efi" else "grub-efi-"
>      if target == "x86_64":
>          grubtarget = 'x86_64'
> -        grubimage = "grub-efi-bootx64.efi"
> +        grubimage = prefix + "bootx64.efi"
>      elif re.match('i.86', target):
>          grubtarget = 'i386'
> -        grubimage = "grub-efi-bootia32.efi"
> +        grubimage = prefix + "bootia32.efi"
>      else:
>          raise bb.parse.SkipRecipe("grub-efi is incompatible with target %s" % target)
>      d.setVar("GRUB_TARGET", grubtarget)
>      d.setVar("GRUB_IMAGE", grubimage)
> +    prefix = "grub-efi-" if prefix == "" else ""
> +    d.setVar("GRUB_IMAGE_PREFIX", prefix)
>  }
>  
>  inherit deploy
> @@ -41,7 +44,7 @@ do_mkimage() {
>  	# Search for the grub.cfg on the local boot media by using the
>  	# built in cfg file provided via this recipe
>  	grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
> -	               -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \
> +	               -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} \
>  	               ${GRUB_BUILDIN}
>  }
>  
> @@ -55,7 +58,7 @@ do_install_append_class-target() {
>  	install -d ${D}/boot
>  	install -d ${D}/boot/EFI
>  	install -d ${D}/boot/EFI/BOOT
> -	install -m 644 ${B}/${GRUB_IMAGE} ${D}/boot/EFI/BOOT/
> +	install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${D}/boot/EFI/BOOT/${GRUB_IMAGE}
>  }
>  
>  do_install_class-native() {
> @@ -79,7 +82,7 @@ GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos part_gpt normal \
>                   efi_gop iso9660 configfile search loadenv test"
>  
>  do_deploy() {
> -	install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR}
> +	install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${DEPLOYDIR}
>  }
>  
>  do_deploy_class-native() {
> 

Should FILES_${PN} also be changed to add prefix?

Thanks,
Anuj



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v3 04/21] grub-efi: if installed and EFI_PROVIDER, install as bootx64 or bootia32
  2018-03-01  2:34   ` Anuj Mittal
@ 2018-03-01 17:37     ` Cal Sullivan
  0 siblings, 0 replies; 27+ messages in thread
From: Cal Sullivan @ 2018-03-01 17:37 UTC (permalink / raw)
  To: Anuj Mittal, openembedded-core



On 02/28/2018 06:34 PM, Anuj Mittal wrote:
> Hi Cal,
>
> On 03/01/2018 10:15 AM, California Sullivan wrote:
>> This way we could theoretically support multiple bootloaders, and we
>> keep the convention of boot(x64|ia32).
>>
>> Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
>> ---
>>   meta/recipes-bsp/grub/grub-efi_2.02.bb | 13 ++++++++-----
>>   1 file changed, 8 insertions(+), 5 deletions(-)
>>
>> diff --git a/meta/recipes-bsp/grub/grub-efi_2.02.bb b/meta/recipes-bsp/grub/grub-efi_2.02.bb
>> index c5a68f01cef..ed27b90fdbc 100644
>> --- a/meta/recipes-bsp/grub/grub-efi_2.02.bb
>> +++ b/meta/recipes-bsp/grub/grub-efi_2.02.bb
>> @@ -15,16 +15,19 @@ S = "${WORKDIR}/grub-${PV}"
>>   python __anonymous () {
>>       import re
>>       target = d.getVar('TARGET_ARCH')
>> +    prefix = "" if d.getVar('EFI_PROVIDER') == "grub-efi" else "grub-efi-"
>>       if target == "x86_64":
>>           grubtarget = 'x86_64'
>> -        grubimage = "grub-efi-bootx64.efi"
>> +        grubimage = prefix + "bootx64.efi"
>>       elif re.match('i.86', target):
>>           grubtarget = 'i386'
>> -        grubimage = "grub-efi-bootia32.efi"
>> +        grubimage = prefix + "bootia32.efi"
>>       else:
>>           raise bb.parse.SkipRecipe("grub-efi is incompatible with target %s" % target)
>>       d.setVar("GRUB_TARGET", grubtarget)
>>       d.setVar("GRUB_IMAGE", grubimage)
>> +    prefix = "grub-efi-" if prefix == "" else ""
>> +    d.setVar("GRUB_IMAGE_PREFIX", prefix)
>>   }
>>   
>>   inherit deploy
>> @@ -41,7 +44,7 @@ do_mkimage() {
>>   	# Search for the grub.cfg on the local boot media by using the
>>   	# built in cfg file provided via this recipe
>>   	grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
>> -	               -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \
>> +	               -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} \
>>   	               ${GRUB_BUILDIN}
>>   }
>>   
>> @@ -55,7 +58,7 @@ do_install_append_class-target() {
>>   	install -d ${D}/boot
>>   	install -d ${D}/boot/EFI
>>   	install -d ${D}/boot/EFI/BOOT
>> -	install -m 644 ${B}/${GRUB_IMAGE} ${D}/boot/EFI/BOOT/
>> +	install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${D}/boot/EFI/BOOT/${GRUB_IMAGE}
>>   }
>>   
>>   do_install_class-native() {
>> @@ -79,7 +82,7 @@ GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos part_gpt normal \
>>                    efi_gop iso9660 configfile search loadenv test"
>>   
>>   do_deploy() {
>> -	install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR}
>> +	install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${DEPLOYDIR}
>>   }
>>   
>>   do_deploy_class-native() {
>>
> Should FILES_${PN} also be changed to add prefix?
Nope, only ${GRUB_IMAGE}. It gets installed as ${GRUB_IMAGE}, which will 
either be grub-efi-bootx64.efi or bootx64.efi (or ia32 equivalents). 
${GRUB_IMAGE_PREFIX} is only used to set the build target, input file 
for installation, and deploy target. ${GRUB_IMAGE_PREFIX} will always be 
either "grub-efi" or "", and together ${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} 
will always create grub-efi-boot(x64|ia32).efi.

The goal of this is to install as boot(x64|ia32).efi if it is selected 
as the EFI_PROVIDER, and install as the complete name otherwise. This 
allows one efi bootloader to be installed as the standard 
boot(x64|ia32).efi, while still being able to coexist with other efi 
bootloaders.

Thanks,
Cal
>
> Thanks,
> Anuj
>



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v3 07/21] grub-efi*.bbclass: don't reference vmlinuz
  2018-03-01  2:15 ` [PATCH v3 07/21] grub-efi*.bbclass: don't reference vmlinuz California Sullivan
@ 2018-03-05 12:50   ` Burton, Ross
  2018-03-06  1:00     ` Cal Sullivan
  0 siblings, 1 reply; 27+ messages in thread
From: Burton, Ross @ 2018-03-05 12:50 UTC (permalink / raw)
  To: California Sullivan; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 246 bytes --]

On 1 March 2018 at 02:15, California Sullivan <
california.l.sullivan@intel.com> wrote:

> +KERNEL_IMAGETYPE ??= "bzImage"
>

You repeat this line in several classes, can we just move the default to
default-distrovars or similar?

Ross

[-- Attachment #2: Type: text/html, Size: 594 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v3 07/21] grub-efi*.bbclass: don't reference vmlinuz
  2018-03-05 12:50   ` Burton, Ross
@ 2018-03-06  1:00     ` Cal Sullivan
  2018-03-06  1:23       ` Andre McCurdy
  0 siblings, 1 reply; 27+ messages in thread
From: Cal Sullivan @ 2018-03-06  1:00 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 841 bytes --]



On 03/05/2018 04:50 AM, Burton, Ross wrote:
> On 1 March 2018 at 02:15, California Sullivan 
> <california.l.sullivan@intel.com 
> <mailto:california.l.sullivan@intel.com>> wrote:
>
>     +KERNEL_IMAGETYPE ??= "bzImage"
>
>
> You repeat this line in several classes, can we just move the default 
> to default-distrovars or similar?

I was trying to avoid adding to bitbake.conf (or things it inherits 
from) but I think it makes sense here. With the changes switching away 
from assuming "vmlinuz" and instead using KERNEL_IMAGETYPE, we now rely 
on it being set in a number of places, so setting a global default would 
be best. If I have your blessings I can make that change.

I see this patchset in is master-next and ross/mut. Should I make the 
change on top of this, or send a v4?

Thanks,
Cal
>
> Ross


[-- Attachment #2: Type: text/html, Size: 2182 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v3 07/21] grub-efi*.bbclass: don't reference vmlinuz
  2018-03-06  1:00     ` Cal Sullivan
@ 2018-03-06  1:23       ` Andre McCurdy
  0 siblings, 0 replies; 27+ messages in thread
From: Andre McCurdy @ 2018-03-06  1:23 UTC (permalink / raw)
  To: Cal Sullivan; +Cc: OE-core

On Mon, Mar 5, 2018 at 5:00 PM, Cal Sullivan
<california.l.sullivan@intel.com> wrote:
> On 03/05/2018 04:50 AM, Burton, Ross wrote:
> On 1 March 2018 at 02:15, California Sullivan
> <california.l.sullivan@intel.com> wrote:
>>
>> +KERNEL_IMAGETYPE ??= "bzImage"
>
> You repeat this line in several classes, can we just move the default to
> default-distrovars or similar?
>
> I was trying to avoid adding to bitbake.conf (or things it inherits from)
> but I think it makes sense here. With the changes switching away from
> assuming "vmlinuz" and instead using KERNEL_IMAGETYPE, we now rely on it
> being set in a number of places, so setting a global default would be best.
> If I have your blessings I can make that change.

Isn't KERNEL_IMAGETYPE now deprecated in favour of KERNEL_IMAGETYPES?

If so, everywhere that's now referencing KERNEL_IMAGETYPE should
probably be updated to parse and deal with the list of types in
KERNEL_IMAGETYPES so that the legacy variable can eventually be
removed.


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2018-03-06  1:23 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-01  2:14 [PATCH v3 00/21] EFI image enhancements California Sullivan
2018-03-01  2:14 ` [PATCH v3 01/21] grub-efi.bbclass: split out configuration portion California Sullivan
2018-03-01  2:14 ` [PATCH v3 02/21] grub: create recipe for configuration California Sullivan
2018-03-01  2:15 ` [PATCH v3 03/21] grub-efi: install to /boot/ California Sullivan
2018-03-01  2:15 ` [PATCH v3 04/21] grub-efi: if installed and EFI_PROVIDER, install as bootx64 or bootia32 California Sullivan
2018-03-01  2:34   ` Anuj Mittal
2018-03-01 17:37     ` Cal Sullivan
2018-03-01  2:15 ` [PATCH v3 05/21] packagegroup-core-boot: add bootloader to EFI systems California Sullivan
2018-03-01  2:15 ` [PATCH v3 06/21] live-vm-common.bbclass: Don't use vmlinuz or VM_DEFAULT_KERNEL California Sullivan
2018-03-01  2:15 ` [PATCH v3 07/21] grub-efi*.bbclass: don't reference vmlinuz California Sullivan
2018-03-05 12:50   ` Burton, Ross
2018-03-06  1:00     ` Cal Sullivan
2018-03-06  1:23       ` Andre McCurdy
2018-03-01  2:15 ` [PATCH v3 08/21] wic: add wks file to make use of exclude-path functionality California Sullivan
2018-03-01  2:15 ` [PATCH v3 09/21] init-install-efi.sh: Update to support installing multiple kernels California Sullivan
2018-03-01  2:15 ` [PATCH v3 10/21] syslinux.bbclass: don't use vmlinuz California Sullivan
2018-03-01  2:15 ` [PATCH v3 11/21] systemd-boot.bbclass: break out configuration creation California Sullivan
2018-03-01  2:15 ` [PATCH v3 12/21] systemd: add systemd-bootconf recipe California Sullivan
2018-03-01  2:15 ` [PATCH v3 13/21] systemd-boot*.bbclass: Don't use vmlinuz California Sullivan
2018-03-01  2:15 ` [PATCH v3 14/21] systemd-boot: add package that installs to boot California Sullivan
2018-03-01  2:15 ` [PATCH v3 15/21] packagegroup-core-boot: add kernel for EFI systems California Sullivan
2018-03-01  2:15 ` [PATCH v3 16/21] init-install.sh: support multiple kernels and don't assume vmlinuz California Sullivan
2018-03-01  2:15 ` [PATCH v3 17/21] layer.conf: add -bootconf recipes to SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS California Sullivan
2018-03-01  2:15 ` [PATCH v3 18/21] selftests: Add test case for booting a generic EFI boot partition image California Sullivan
2018-03-01  2:15 ` [PATCH v3 19/21] grub-efi-cfg.bbclass: Don't reference or set OVERRIDES California Sullivan
2018-03-01  2:15 ` [PATCH v3 20/21] systemd-boot-cfg.bbclass: " California Sullivan
2018-03-01  2:15 ` [PATCH v3 21/21] maintainers.inc: add myself as -bootconf recipe maintainer California Sullivan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.