diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2019-05-20 13:18:48 +0200 |
---|---|---|
committer | Martin Borg <martin.borg@enea.com> | 2019-05-23 14:51:29 +0200 |
commit | 6f4d06897bb746f64e6ec6c2d6d67aba5ff93416 (patch) | |
tree | f3ae04c1e9d9e011ffd84e165c6cbf764cf79338 | |
parent | 4834bbecf7070611dab6f66c876d371a7d9aee7e (diff) | |
download | meta-el-nfv-access-6f4d06897bb746f64e6ec6c2d6d67aba5ff93416.tar.gz |
Split grub_efi class override
Split the class override into generic changes and Secure Boot specific
(efi_populate). This allows us to override the secureboot parts only if the
efi-secure-boot distro feature is enabled.
Change-Id: I68ab1a9eae2ffceecd057506ef493b4388ff5343
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
-rw-r--r-- | classes/override_grub-efi.inc | 28 | ||||
-rw-r--r-- | classes/override_grub-efi_secureboot.inc | 27 | ||||
-rw-r--r-- | images/enea-nfv-access-host-common.inc | 1 |
3 files changed, 28 insertions, 28 deletions
diff --git a/classes/override_grub-efi.inc b/classes/override_grub-efi.inc index fb1958d..4c2ae64 100644 --- a/classes/override_grub-efi.inc +++ b/classes/override_grub-efi.inc | |||
@@ -87,31 +87,3 @@ python build_efi_cfg() { | |||
87 | 87 | ||
88 | cfgfile.close() | 88 | cfgfile.close() |
89 | } | 89 | } |
90 | |||
91 | efi_populate() { | ||
92 | # DEST must be the root of the image so that EFIDIR is not | ||
93 | # nested under a top level directory. | ||
94 | DEST=$1 | ||
95 | |||
96 | install -d ${DEST}${EFIDIR} | ||
97 | |||
98 | GRUB_IMAGE="grub-efi-bootia32.efi" | ||
99 | DEST_IMAGE="bootia32.efi" | ||
100 | if [ "${TARGET_ARCH}" = "x86_64" ]; then | ||
101 | GRUB_IMAGE="grub-efi-bootx64.efi" | ||
102 | DEST_IMAGE="bootx64.efi" | ||
103 | fi | ||
104 | |||
105 | #Install EFI binaries | ||
106 | install -m 0644 ${IMAGE_ROOTFS}/boot/efi${EFIDIR}/*.* ${DEST}${EFIDIR} | ||
107 | |||
108 | #Install kernel and initramfs sig | ||
109 | install -m 0644 ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}.p7b ${DEST}/vmlinuz.p7b | ||
110 | install -m 0644 ${INITRD_LIVE}.p7b ${DEST}/initrd.p7b | ||
111 | |||
112 | EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g') | ||
113 | printf 'fs0:%s\%s\n' "$EFIPATH" "$DEST_IMAGE" >${DEST}/startup.nsh | ||
114 | |||
115 | install -m 0644 ${GRUB_CFG} ${DEST}${EFIDIR}/grub.cfg | ||
116 | |||
117 | } | ||
diff --git a/classes/override_grub-efi_secureboot.inc b/classes/override_grub-efi_secureboot.inc new file mode 100644 index 0000000..a33c1a8 --- /dev/null +++ b/classes/override_grub-efi_secureboot.inc | |||
@@ -0,0 +1,27 @@ | |||
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 | } | ||
diff --git a/images/enea-nfv-access-host-common.inc b/images/enea-nfv-access-host-common.inc index e552168..77b873a 100644 --- a/images/enea-nfv-access-host-common.inc +++ b/images/enea-nfv-access-host-common.inc | |||
@@ -4,6 +4,7 @@ REQUIRE_FILES = " \ | |||
4 | " | 4 | " |
5 | REQUIRE_FILES_append_df-efi-secure-boot = " \ | 5 | REQUIRE_FILES_append_df-efi-secure-boot = " \ |
6 | classes/override_image_types_ostree.inc \ | 6 | classes/override_image_types_ostree.inc \ |
7 | classes/override_grub-efi_secureboot.inc \ | ||
7 | images/secure-boot.inc \ | 8 | images/secure-boot.inc \ |
8 | " | 9 | " |
9 | 10 | ||