diff options
Diffstat (limited to 'classes')
| -rw-r--r-- | classes/override_grub-efi-cfg.inc (renamed from classes/override_grub-efi.inc) | 11 | ||||
| -rw-r--r-- | classes/override_grub-efi_secureboot.inc | 31 | ||||
| -rw-r--r-- | classes/override_live-vm-common.inc | 29 |
3 files changed, 37 insertions, 34 deletions
diff --git a/classes/override_grub-efi.inc b/classes/override_grub-efi-cfg.inc index 15a7063..42d89b7 100644 --- a/classes/override_grub-efi.inc +++ b/classes/override_grub-efi-cfg.inc | |||
| @@ -1,4 +1,6 @@ | |||
| 1 | ## ENEA_start ## | ||
| 1 | GRUB_GRAPHICS ?= "console=tty0" | 2 | GRUB_GRAPHICS ?= "console=tty0" |
| 3 | ## ENEA_end ## | ||
| 2 | 4 | ||
| 3 | python build_efi_cfg() { | 5 | python build_efi_cfg() { |
| 4 | import sys | 6 | import sys |
| @@ -48,8 +50,10 @@ python build_efi_cfg() { | |||
| 48 | bb.fatal('GRUB_ROOT not defined') | 50 | bb.fatal('GRUB_ROOT not defined') |
| 49 | 51 | ||
| 50 | if gfxserial == "1": | 52 | if gfxserial == "1": |
| 53 | ## ENEA_start ## | ||
| 51 | btypes = [ [ " serial console", d.getVar('GRUB_SERIAL') or "" ], | 54 | btypes = [ [ " serial console", d.getVar('GRUB_SERIAL') or "" ], |
| 52 | [ " graphics console", d.getVar('GRUB_GRAPHICS') or "" ] ] | 55 | [ " graphics console", d.getVar('GRUB_GRAPHICS') or "" ] ] |
| 56 | ## ENEA_end ## | ||
| 53 | else: | 57 | else: |
| 54 | btypes = [ [ "", "" ] ] | 58 | btypes = [ [ "", "" ] ] |
| 55 | 59 | ||
| @@ -60,14 +64,15 @@ python build_efi_cfg() { | |||
| 60 | if not overrides: | 64 | if not overrides: |
| 61 | bb.fatal('OVERRIDES not defined') | 65 | bb.fatal('OVERRIDES not defined') |
| 62 | 66 | ||
| 63 | for btype in btypes: | 67 | localdata.setVar('OVERRIDES', 'grub_' + label + ':' + overrides) |
| 64 | localdata.setVar('OVERRIDES', label + ':' + overrides) | ||
| 65 | 68 | ||
| 69 | for btype in btypes: | ||
| 66 | cfgfile.write('\nmenuentry \'%s%s\'{\n' % (label, btype[0])) | 70 | cfgfile.write('\nmenuentry \'%s%s\'{\n' % (label, btype[0])) |
| 67 | lb = label | 71 | lb = label |
| 68 | if label == "install": | 72 | if label == "install": |
| 69 | lb = "install-efi" | 73 | lb = "install-efi" |
| 70 | cfgfile.write('linux /vmlinuz LABEL=%s' % (lb)) | 74 | kernel = localdata.getVar('KERNEL_IMAGETYPE') |
| 75 | cfgfile.write('linux /%s LABEL=%s' % (kernel, lb)) | ||
| 71 | 76 | ||
| 72 | cfgfile.write(' %s' % replace_rootfs_uuid(d, root)) | 77 | cfgfile.write(' %s' % replace_rootfs_uuid(d, root)) |
| 73 | 78 | ||
diff --git a/classes/override_grub-efi_secureboot.inc b/classes/override_grub-efi_secureboot.inc deleted file mode 100644 index b944ec8..0000000 --- a/classes/override_grub-efi_secureboot.inc +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | efi_populate() { | ||
| 2 | # DEST must be the root of the image so that EFIDIR is not | ||
| 3 | # nested under a top level directory. | ||
| 4 | DEST=$1 | ||
| 5 | |||
| 6 | install -d ${DEST}${EFIDIR} | ||
| 7 | |||
| 8 | GRUB_IMAGE="grub-efi-bootia32.efi" | ||
| 9 | DEST_IMAGE="bootia32.efi" | ||
| 10 | if [ "${TARGET_ARCH}" = "x86_64" ]; then | ||
| 11 | GRUB_IMAGE="grub-efi-bootx64.efi" | ||
| 12 | DEST_IMAGE="bootx64.efi" | ||
| 13 | fi | ||
| 14 | |||
| 15 | #Install EFI binaries | ||
| 16 | install -m 0644 ${IMAGE_ROOTFS}/boot/efi${EFIDIR}/*.* ${DEST}${EFIDIR} | ||
| 17 | |||
| 18 | #Install kernel and initramfs sig | ||
| 19 | install -m 0644 ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}.p7b ${DEST}/vmlinuz.p7b | ||
| 20 | install -m 0644 ${INITRD_LIVE}.p7b ${DEST}/initrd.p7b | ||
| 21 | |||
| 22 | EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g') | ||
| 23 | printf 'fs0:%s\%s\n' "$EFIPATH" "$DEST_IMAGE" >${DEST}/startup.nsh | ||
| 24 | |||
| 25 | install -m 0644 ${GRUB_CFG} ${DEST}${EFIDIR}/grub.cfg | ||
| 26 | |||
| 27 | #Install UEFI keys | ||
| 28 | install -d ${DEST}/uefi_sb_keys | ||
| 29 | install -m 0644 ${DEPLOY_DIR_IMAGE}/user-keys/uefi_sb_keys/*.crt ${DEST}/uefi_sb_keys/ | ||
| 30 | install -m 0644 ${DEPLOY_DIR_IMAGE}/user-keys/uefi_sb_keys/*.esl ${DEST}/uefi_sb_keys/ | ||
| 31 | } | ||
diff --git a/classes/override_live-vm-common.inc b/classes/override_live-vm-common.inc new file mode 100644 index 0000000..dc8e076 --- /dev/null +++ b/classes/override_live-vm-common.inc | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | # efi_populate_common DEST BOOTLOADER | ||
| 2 | efi_populate_common() { | ||
| 3 | # DEST must be the root of the image so that EFIDIR is not | ||
| 4 | # nested under a top level directory. | ||
| 5 | DEST=$1 | ||
| 6 | |||
| 7 | install -d ${DEST}${EFIDIR} | ||
| 8 | |||
| 9 | ## ENEA_start ## | ||
| 10 | # install -m 0644 ${DEPLOY_DIR_IMAGE}/$2-${EFI_BOOT_IMAGE} ${DEST}${EFIDIR}/${EFI_BOOT_IMAGE} | ||
| 11 | ## ENEA_end ## | ||
| 12 | |||
| 13 | EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g') | ||
| 14 | printf 'fs0:%s\%s\n' "$EFIPATH" "${EFI_BOOT_IMAGE}" >${DEST}/startup.nsh | ||
| 15 | |||
| 16 | ## ENEA_start ## | ||
| 17 | # Install EFI binaries | ||
| 18 | install -m 0644 ${IMAGE_ROOTFS}/boot/efi${EFIDIR}/*.* ${DEST}${EFIDIR} | ||
| 19 | |||
| 20 | # Install kernel and initramfs sig | ||
| 21 | install -m 0644 ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${SB_FILE_EXT} ${DEST}/${KERNEL_IMAGETYPE}${SB_FILE_EXT} | ||
| 22 | install -m 0644 ${INITRD_LIVE}${SB_FILE_EXT} ${DEST}/initrd${SB_FILE_EXT} | ||
| 23 | |||
| 24 | # Install UEFI keys | ||
| 25 | install -d ${DEST}/uefi_sb_keys | ||
| 26 | install -m 0644 ${DEPLOY_DIR_IMAGE}/user-keys/uefi_sb_keys/*.crt ${DEST}/uefi_sb_keys/ | ||
| 27 | install -m 0644 ${DEPLOY_DIR_IMAGE}/user-keys/uefi_sb_keys/*.esl ${DEST}/uefi_sb_keys/ | ||
| 28 | ## ENEA_end ## | ||
| 29 | } | ||
