summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2021-03-21 18:15:52 +0100
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2021-04-12 14:03:51 +0200
commita66a367e9656f0f4e2f9e9f8932714cf9bee1725 (patch)
treea5884e5b45a77d09d959d4c4a7b258adf5dd4905
parenta14950444f22e7aaed1cce3c061c860572cf262f (diff)
downloadmeta-el-nfv-access-a66a367e9656f0f4e2f9e9f8932714cf9bee1725.tar.gz
classes/override_grub* sync with upstream renames
While at it, replace some hardcoded p7b extenstions with ${SB_FILE_EXT} and vmlinuz references with the appropiate variable (upstream no longer renames bzImage to vmlinuz in ISO root after [1]). [1] https://git.yoctoproject.org/cgit.cgi/poky/commit/?id=b6e36c01977 Change-Id: I5ce414a2f281ff2f1aeb0e26f35608cd8750855d Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com> Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
-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.inc31
-rw-r--r--classes/override_live-vm-common.inc29
-rw-r--r--images/enea-nfv-access-host-common.inc4
4 files changed, 39 insertions, 36 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 ##
1GRUB_GRAPHICS ?= "console=tty0" 2GRUB_GRAPHICS ?= "console=tty0"
3## ENEA_end ##
2 4
3python build_efi_cfg() { 5python 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 @@
1efi_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
2efi_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}
diff --git a/images/enea-nfv-access-host-common.inc b/images/enea-nfv-access-host-common.inc
index 82e9792..d984f95 100644
--- a/images/enea-nfv-access-host-common.inc
+++ b/images/enea-nfv-access-host-common.inc
@@ -2,10 +2,10 @@ IMAGE_FSTYPES += "hddimg"
2 2
3REQUIRE_FILES = " \ 3REQUIRE_FILES = " \
4 images/enea-nfv-access-common.inc \ 4 images/enea-nfv-access-common.inc \
5 classes/override_grub-efi.inc \ 5 classes/override_grub-efi-cfg.inc \
6 " 6 "
7REQUIRE_FILES_append_df-efi-secure-boot = " \ 7REQUIRE_FILES_append_df-efi-secure-boot = " \
8 classes/override_grub-efi_secureboot.inc \ 8 classes/override_live-vm-common.inc \
9 images/secure-boot.inc \ 9 images/secure-boot.inc \
10 " 10 "
11 11