Skip to content

Commit 1f07e16

Browse files
author
Itxaka
authored
Add shim to grub2-efi packages (#1604)
* Add shim to grub2-efi packages Add the shim.efi to the grub2 packages (system adn live) in a way that its backwards compatible. As shim is just a launcher for grub.efi, it should be backwards compatible with anything using this packages plus compatible with elemental-cli versions that now use the shim for the installation as well as older versions which did not do that. Signed-off-by: Itxaka <[email protected]> * Debug bump elemental Signed-off-by: Itxaka <[email protected]> * Fix arm64 shim path Signed-off-by: Itxaka <[email protected]> * Some fixes - add gzip packages - bump elemental-cli to latest - copy shim into the proper entry for fallback Signed-off-by: Itxaka <[email protected]> * Bump base/distro so it gets the latest packages Signed-off-by: Itxaka <[email protected]> * Something Signed-off-by: Itxaka <[email protected]> * bump images for arm64 and fix tests Signed-off-by: Itxaka <[email protected]> * Bump orange version as 21.04 is EOL Signed-off-by: Itxaka <[email protected]> * use normal shi Signed-off-by: Itxaka <[email protected]> * Add missing gzip and bump arm64 base image for teal Signed-off-by: Itxaka <[email protected]> * Bump all the things Signed-off-by: Itxaka <[email protected]> * Fix tests Signed-off-by: Itxaka <[email protected]> * bump again goddammit Signed-off-by: Itxaka <[email protected]> * Revert to using image names for arm64 As we cant properly cross build, we dont need to specify the hash anymore. Running the build from an arm64 platform will pick the proper platform for the image Signed-off-by: itxaka <[email protected]> Signed-off-by: Itxaka <[email protected]> Signed-off-by: itxaka <[email protected]>
1 parent a13a77d commit 1f07e16

File tree

21 files changed

+74
-41
lines changed

21 files changed

+74
-41
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
name: "base-dracut-modules"
22
category: "system"
3-
version: 0.1.2-6
3+
version: 0.2.0
44
description: "Base modules for creating an initrd with dracut for cOS derivatives"

packages/base/definition.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: "base"
22
category: "distro"
3-
version: "0.20220630"
3+
version: "0.20221006"
44
labels:
55
autobump.strategy: "snapshot"

packages/cos/collection.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ packages:
22
- &cos
33
name: "cos"
44
category: "system"
5-
version: 0.9.0
5+
version: 0.9.1
66
description: "cOS base image, used to build cOS live ISOs"
77
brand_name: "cOS"
88
labels:

packages/golang/build.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ requires:
66
prelude:
77
{{ if .Values.tool_image_distribution }}
88
{{if eq .Values.tool_image_distribution "opensuse" }}
9-
- zypper in -y curl git && zypper install -y -t pattern devel_basis
9+
- zypper in -y curl git gzip && zypper install -y -t pattern devel_basis
1010
{{else if eq .Values.tool_image_distribution "fedora" }}
11-
- dnf install -y curl git "@Development Tools"
11+
- dnf install -y curl git gzip "@Development Tools"
1212
{{else if eq .Values.tool_image_distribution "ubuntu" }}
1313
- apt-get update
14-
- apt-get install -y build-essential curl git
14+
- apt-get install -y build-essential curl git gzip
1515
{{end}}
1616
{{end}}
1717
- |

packages/grub2/build.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ requires:
55
- name: "cos-config-tmpl"
66
category: "utils"
77
version: ">=0"
8+
{{if eq .Values.name "grub2-efi-image"}}
9+
{{if .Values.tool_image_distribution}}
10+
{{if eq .Values.tool_image_distribution "opensuse"}}
11+
prelude:
12+
- zypper in -y shim
13+
{{end}}
14+
{{end}}
15+
{{end}}
16+
817
steps:
918
{{if eq .Values.name "grub2-config"}}
1019
- cp config/grub.cfg.tmpl config/bootargs.cfg.tmpl /etc/cos
@@ -27,10 +36,18 @@ steps:
2736
{{if eq .Values.tool_image_distribution "opensuse"}}
2837
{{if .Values.arch }}
2938
{{if eq .Values.arch "x86_64"}}
30-
- cp /usr/share/grub2/x86_64-efi/grub.efi /EFI/BOOT/bootx64.efi
39+
- cp /usr/share/efi/x86_64/shim.efi /EFI/BOOT/shim.efi
40+
- cp /usr/share/efi/x86_64/grub.efi /EFI/BOOT/grub.efi
41+
- cp /usr/share/efi/x86_64/MokManager.efi /EFI/BOOT/MokManager.efi
42+
# Backwards compatible for elemental-cli versions <= 0ff8246e0f93e00ab3fd5b175c0d3e78d11df3be
43+
- cp /usr/share/efi/x86_64/shim.efi /EFI/BOOT/bootx64.efi
3144
{{end}}
3245
{{if eq .Values.arch "aarch64"}}
33-
- cp /usr/share/grub2/arm64-efi/grub.efi /EFI/BOOT/bootaa64.efi
46+
- cp /usr/share/efi/aarch64/shim.efi /EFI/BOOT/shim.efi
47+
- cp /usr/share/efi/aarch64/grub.efi /EFI/BOOT/grub.efi
48+
- cp /usr/share/efi/aarch64/MokManager.efi /EFI/BOOT/MokManager.efi
49+
# Backwards compatible for elemental-cli versions <= 0ff8246e0f93e00ab3fd5b175c0d3e78d11df3be
50+
- cp /usr/share/efi/aarch64/shim.efi /EFI/BOOT/bootaa64.efi
3451
{{end}}
3552
{{end}}
3653
{{else if eq .Values.tool_image_distribution "fedora"}}
@@ -56,6 +73,7 @@ steps:
5673
{{if .Values.tool_image_distribution}}
5774
{{if eq .Values.tool_image_distribution "opensuse"}}
5875
- cp -rf /usr/share/grub2/* /grub-artifacts
76+
- cp -rf /usr/share/efi/* /grub-artifacts
5977
{{else}}
6078
- cp -rfL /usr/lib/grub/* /grub-artifacts
6179
{{end}}

packages/grub2/collection.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
packages:
22
- name: "grub2-artifacts"
33
category: "system"
4-
version: 0.0.3-12
4+
version: 0.0.3-13
55
provides:
66
- name: "grub-artifacts"
77
version: ">0.0.2"
@@ -13,7 +13,7 @@ packages:
1313
version: ">0.0.12"
1414
- name: "grub2-efi-image"
1515
category: "system"
16-
version: 0.0.2-3
16+
version: 0.0.2-5
1717
# TODO: Modules list could be refined
1818
efi_modules: ext2 iso9660 linux echo configfile search_label search_fs_file search search_fs_uuid ls normal gzio png fat gettext font minicmd gfxterm gfxmenu all_video xfs gcry_rijndael gcry_sha256 gcry_sha512 test true loadenv part_gpt part_msdos efi_gop efi_uga
1919
efi_modules_arm64: ext2 iso9660 linux echo configfile search_label search_fs_file search search_fs_uuid ls normal gzio png fat gettext font minicmd gfxterm gfxmenu all_video xfs gcry_rijndael gcry_sha256 gcry_sha512 test true loadenv part_gpt part_msdos efi_gop

packages/initrd/definition.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
name: "dracut-initrd"
22
category: "system"
3-
version: 0.3-11
3+
version: 0.4.0
44
description: "Dracut-based generated initrd"

packages/kernel/definition.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
name: "kernel"
22
category: "system"
3-
version: 0.1.2-14
3+
version: 0.2.0
44
description: "Kernel extracted from the upstream repositories"

packages/livecd/grub2/build.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ requires:
55
prelude:
66
{{ if .Values.arch }}
77
{{if eq .Values.arch "x86_64"}}
8-
- zypper in -y --no-recommends syslinux grub2-i386-pc grub2-x86_64-efi
8+
- zypper in -y --no-recommends syslinux grub2-i386-pc grub2-x86_64-efi shim
99
{{end}}
1010
{{if eq .Values.arch "aarch64"}}
11-
- zypper in -y --no-recommends syslinux-x86_64 grub2-i386-pc grub2-arm64-efi
11+
- zypper in -y --no-recommends syslinux-x86_64 grub2-i386-pc grub2-arm64-efi shim
1212
{{end}}
1313
- zypper cc
1414
- grub2-mkimage -O i386-pc -o /usr/share/grub2/i386-pc/core.img -p /boot/grub2 -d /usr/share/grub2/i386-pc ext2 iso9660 linux echo configfile search_label search_fs_file search search_fs_uuid ls normal gzio png fat gettext font minicmd gfxterm gfxmenu all_video xfs btrfs lvm luks gcry_rijndael gcry_sha256 gcry_sha512 crypto cryptodisk test true loadenv part_gpt part_msdos biosdisk vga vbe chain boot
@@ -34,10 +34,18 @@ steps:
3434
{{if eq .Values.name "grub2-efi-image"}}
3535
{{if .Values.arch }}
3636
{{if eq .Values.arch "x86_64"}}
37-
- mkdir -p /EFI/BOOT && cp /usr/share/grub2/x86_64-efi/grub.efi /EFI/BOOT/bootx64.efi
37+
- mkdir -p /EFI/BOOT
38+
# For removable drives the name of the efi needs to be bootx64.efi
39+
- cp /usr/share/efi/x86_64/shim.efi /EFI/BOOT/bootx64.efi
40+
- cp /usr/share/efi/x86_64/grub.efi /EFI/BOOT/grub.efi
41+
- cp /usr/share/efi/x86_64/MokManager.efi /EFI/BOOT/MokManager.efi
3842
{{end}}
3943
{{if eq .Values.arch "aarch64"}}
40-
- mkdir -p /EFI/BOOT && cp /usr/share/grub2/arm64-efi/grub.efi /EFI/BOOT/bootaa64.efi
44+
- mkdir -p /EFI/BOOT
45+
# For removable drives the name of the efi needs to be bootaa64.efi
46+
- cp /usr/share/efi/aarch64/shim.efi /EFI/BOOT/bootaa64.efi
47+
- cp /usr/share/efi/aarch64/grub.efi /EFI/BOOT/grub.efi
48+
- cp /usr/share/efi/aarch64/MokManager.efi /EFI/BOOT/MokManager.efi
4149
{{end}}
4250
{{end}}
4351
- cp config/grub_live_efi.cfg /EFI/BOOT/grub.cfg

packages/livecd/grub2/collection.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ packages:
55
description: "Grub2 booloader for live systems"
66
- name: "grub2-efi-image"
77
category: "live"
8-
version: 0.0.2-2
8+
version: 0.0.2-3
99
description: "Grub2 booloader EFI image for live systems"

0 commit comments

Comments
 (0)