diff options
| author | Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com> | 2019-09-18 16:12:47 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-09-19 10:54:32 +0100 |
| commit | 4ad3130c20bfb4eac7c1fd4eedb7d10e49c364c9 (patch) | |
| tree | 37ec412b6b2ad3a9a498af7af03c5488ee302db4 /meta/classes/live-vm-common.bbclass | |
| parent | 94df595512a4b60279b8bfeef8d625d82495ed59 (diff) | |
| download | poky-4ad3130c20bfb4eac7c1fd4eedb7d10e49c364c9.tar.gz | |
live-vm-common.bbclass: provide efi population functions for live images
Define common functions for populating EFI directories in live image by
reusing common code from grub-efi and systemd-boot bbclasses.
(From OE-Core rev: 3728899a0cd543793db258da0976362b4bde7133)
Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/live-vm-common.bbclass')
| -rw-r--r-- | meta/classes/live-vm-common.bbclass | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/meta/classes/live-vm-common.bbclass b/meta/classes/live-vm-common.bbclass index 68105d9b84..74e7074a53 100644 --- a/meta/classes/live-vm-common.bbclass +++ b/meta/classes/live-vm-common.bbclass | |||
| @@ -29,6 +29,39 @@ def pcbios(d): | |||
| 29 | PCBIOS = "${@pcbios(d)}" | 29 | PCBIOS = "${@pcbios(d)}" |
| 30 | PCBIOS_CLASS = "${@['','syslinux'][d.getVar('PCBIOS') == '1']}" | 30 | PCBIOS_CLASS = "${@['','syslinux'][d.getVar('PCBIOS') == '1']}" |
| 31 | 31 | ||
| 32 | # efi_populate_common DEST BOOTLOADER | ||
| 33 | efi_populate_common() { | ||
| 34 | # DEST must be the root of the image so that EFIDIR is not | ||
| 35 | # nested under a top level directory. | ||
| 36 | DEST=$1 | ||
| 37 | |||
| 38 | install -d ${DEST}${EFIDIR} | ||
| 39 | |||
| 40 | install -m 0644 ${DEPLOY_DIR_IMAGE}/$2-${EFI_BOOT_IMAGE} ${DEST}${EFIDIR}/${EFI_BOOT_IMAGE} | ||
| 41 | EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g') | ||
| 42 | printf 'fs0:%s\%s\n' "$EFIPATH" "${EFI_BOOT_IMAGE}" >${DEST}/startup.nsh | ||
| 43 | } | ||
| 44 | |||
| 45 | efi_iso_populate() { | ||
| 46 | iso_dir=$1 | ||
| 47 | efi_populate $iso_dir | ||
| 48 | # Build a EFI directory to create efi.img | ||
| 49 | mkdir -p ${EFIIMGDIR}/${EFIDIR} | ||
| 50 | cp $iso_dir/${EFIDIR}/* ${EFIIMGDIR}${EFIDIR} | ||
| 51 | cp $iso_dir/${KERNEL_IMAGETYPE} ${EFIIMGDIR} | ||
| 52 | |||
| 53 | EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g') | ||
| 54 | printf 'fs0:%s\%s\n' "$EFIPATH" "${EFI_BOOT_IMAGE}" >${EFIIMGDIR}/startup.nsh | ||
| 55 | |||
| 56 | if [ -f "$iso_dir/initrd" ] ; then | ||
| 57 | cp $iso_dir/initrd ${EFIIMGDIR} | ||
| 58 | fi | ||
| 59 | } | ||
| 60 | |||
| 61 | efi_hddimg_populate() { | ||
| 62 | efi_populate $1 | ||
| 63 | } | ||
| 64 | |||
| 32 | inherit ${EFI_CLASS} | 65 | inherit ${EFI_CLASS} |
| 33 | inherit ${PCBIOS_CLASS} | 66 | inherit ${PCBIOS_CLASS} |
| 34 | 67 | ||
