diff options
-rw-r--r-- | meta/classes/image_types_wic.bbclass | 14 | ||||
-rw-r--r-- | meta/recipes-core/images/core-bootfs-systemd-boot.bb | 30 | ||||
-rw-r--r-- | scripts/lib/wic/canned-wks/generic-efi.wks | 9 |
3 files changed, 46 insertions, 7 deletions
diff --git a/meta/classes/image_types_wic.bbclass b/meta/classes/image_types_wic.bbclass index e5729ba12bc..73119067396 100644 --- a/meta/classes/image_types_wic.bbclass +++ b/meta/classes/image_types_wic.bbclass @@ -77,11 +77,11 @@ python () { # a variable and let the metadata deal with the deps. d.setVar('_WKS_TEMPLATE', body) - if d.getVar('EFI_CLASS'): - bb.build.addtask('do_prepare_wic_build', 'do_image_wic', 'do_bootimg', d) - d.appendVarFlag('do_prepare_wic_build', 'depends', 'virtual/kernel:do_deploy') - else: - bb.build.addtask('do_prepare_wic_build', 'do_image_wic', None, d) +# if d.getVar('EFI_CLASS'): +# bb.build.addtask('do_prepare_wic_build', 'do_image_wic', 'do_bootimg', d) +# d.appendVarFlag('do_prepare_wic_build', 'depends', 'virtual/kernel:do_deploy') +# else: +# bb.build.addtask('do_prepare_wic_build', 'do_image_wic', None, d) } # @@ -157,8 +157,8 @@ python do_prepare_wic_build() { partuuid = str(uuid4()) d.setVar("ROOTFS_PARTUUID", partuuid) - if d.getVar("EFI_CLASS"): - populate_bootfs(partuuid) +# if d.getVar("EFI_CLASS"): +# populate_bootfs(partuuid) template = d.getVar("_WKS_TEMPLATE") if template: diff --git a/meta/recipes-core/images/core-bootfs-systemd-boot.bb b/meta/recipes-core/images/core-bootfs-systemd-boot.bb new file mode 100644 index 00000000000..82592a58eb5 --- /dev/null +++ b/meta/recipes-core/images/core-bootfs-systemd-boot.bb @@ -0,0 +1,30 @@ +# Simple initramfs image. Mostly used for live images. +DESCRIPTION = "Systemd-boot based EFI system" +LICENSE = "MIT" + +inherit deploy +do_deploy() { + bbwarn ${DEPLOYDIR} + + EFIDIR="EFI/BOOT" + 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 ${DEPLOY_DIR_IMAGE}/bootfs/${EFIDIR} + # systemd-boot requires these paths for configuration files + # they are not customizable so no point in new vars + install -d ${DEPLOY_DIR_IMAGE}/bootfs/loader/entries + install -m 0644 ${DEPLOY_DIR_IMAGE}/${EFI_IMAGE} ${DEPLOY_DIR_IMAGE}/bootfs/${EFIDIR}/${DEST_EFI_IMAGE} + install -m 0644 ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/bootfs/vmlinuz + +} + +do_deploy[depends] = "${MLPREFIX}systemd-boot:do_deploy virtual/kernel:do_deploy" +addtask do_deploy after do_prepare_recipe_sysroot before do_wic_image + +# Use the same restriction as initramfs-live-install +COMPATIBLE_HOST = "(i.86|x86_64).*-linux" diff --git a/scripts/lib/wic/canned-wks/generic-efi.wks b/scripts/lib/wic/canned-wks/generic-efi.wks new file mode 100644 index 00000000000..bac60b95203 --- /dev/null +++ b/scripts/lib/wic/canned-wks/generic-efi.wks @@ -0,0 +1,9 @@ +# short-description: Create an EFI disk image +# long-description: Creates a partitioned EFI disk image that the user +# can directly dd to boot media. + +part /boot --source rootfs --rootfs-dir=/home/swold/yocto/releases/master/build/intel-dev/tmp/deploy/images/intel-corei7-64/bootfs --fstype=vfat --label boot --active --align 1024 + +part / --source rootfs --fstype=ext4 --label root --align 1024 --uuid ${ROOTFS_PARTUUID} + +bootloader --ptable gpt |