-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ERL-466: nemos-images-*-mantic: qemu-*: fix EFI boot on Grub 2.12
Kiwi seems to generate an invalid configuration for Grub 2.12, causing the images to fail to boot. Manually install Grub and Shim according to the standard Ubuntu UEFI layout to get around this. Signed-off-by: Isaac True <[email protected]>
- Loading branch information
Showing
8 changed files
with
170 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash -ex | ||
|
||
# Kiwi is incompatible with Grub 2.12 (as of Kiwi version 9.25.17) | ||
# We need to install and configure it manually. | ||
|
||
# Construct the EFI partition according to the standard Ubuntu layout using | ||
# signed images. | ||
install -vD usr/lib/shim/shimx64.efi.signed.latest \ | ||
boot/efi/EFI/BOOT/BOOTX64.EFI | ||
install -vD usr/lib/shim/shimx64.efi.signed.latest \ | ||
boot/efi/EFI/UBUNTU/SHIMX64.EFI | ||
install -vD usr/lib/shim/fbx64.efi \ | ||
boot/efi/EFI/BOOT/FBX64.EFI | ||
install -vD usr/lib/shim/mmx64.efi \ | ||
boot/efi/EFI/BOOT/MMX64.EFI | ||
install -vD usr/lib/shim/BOOTX64.CSV \ | ||
boot/efi/EFI/UBUNTU/BOOTX64.CSV | ||
install -vD usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed \ | ||
boot/efi/EFI/UBUNTU/GRUBX64.EFI | ||
|
||
# Tell Grub to load its config from the BOOT partition | ||
cat > boot/efi/EFI/UBUNTU/grub.cfg << EOF | ||
search.fs_label BOOT root | ||
set prefix=(\$root)'/grub' | ||
configfile \$prefix/grub.cfg | ||
EOF | ||
|
||
# Install Grub modules | ||
mkdir -p /boot/grub | ||
cp -rv usr/lib/grub/x86_64-efi/*.mod boot/grub/ | ||
|
||
# Basic Grub configuration to load the kernel and initrd | ||
KERNEL="$(basename boot/vmlinuz-*)" | ||
INITRD="$(basename boot/initrd.img-*)" | ||
cat > boot/grub/grub.cfg << EOF | ||
linux /${KERNEL} console=ttyS0 root=overlay:PARTLABEL=p.lxreadonly rd.root.overlay.readonly selinux=0 | ||
initrd /${INITRD} | ||
boot | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash -ex | ||
|
||
# Kiwi is incompatible with Grub 2.12 (as of Kiwi version 9.25.17) | ||
# We need to install and configure it manually. | ||
|
||
# Construct the EFI partition according to the standard Ubuntu layout using | ||
# signed images. | ||
install -vD usr/lib/shim/shimaa64.efi.signed.latest \ | ||
boot/efi/EFI/BOOT/BOOTAA64.EFI | ||
install -vD usr/lib/shim/shimaa64.efi.signed.latest \ | ||
boot/efi/EFI/UBUNTU/SHIMAA64.EFI | ||
install -vD usr/lib/shim/fbaa64.efi \ | ||
boot/efi/EFI/BOOT/FBAA64.EFI | ||
install -vD usr/lib/shim/mmaa64.efi \ | ||
boot/efi/EFI/BOOT/MMAA64.EFI | ||
install -vD usr/lib/shim/BOOTAA64.CSV \ | ||
boot/efi/EFI/UBUNTU/BOOTAA64.CSV | ||
install -vD usr/lib/grub/arm64-efi-signed/grubaa64.efi.signed \ | ||
boot/efi/EFI/UBUNTU/GRUBAA64.EFI | ||
|
||
# Tell Grub to load its config from the BOOT partition | ||
cat > boot/efi/EFI/UBUNTU/grub.cfg << EOF | ||
search.fs_label BOOT root | ||
set prefix=(\$root)'/grub' | ||
configfile \$prefix/grub.cfg | ||
EOF | ||
|
||
# Install Grub modules | ||
mkdir -p /boot/grub | ||
cp -rv usr/lib/grub/arm64-efi/*.mod boot/grub/ | ||
|
||
# Basic Grub configuration to load the kernel and initrd | ||
KERNEL="$(basename boot/vmlinuz-*)" | ||
INITRD="$(basename boot/initrd.img-*)" | ||
cat > boot/grub/grub.cfg << EOF | ||
linux /${KERNEL} console=ttyS0 root=overlay:PARTLABEL=p.lxreadonly rd.root.overlay.readonly selinux=0 | ||
initrd /${INITRD} | ||
boot | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash -ex | ||
|
||
# Kiwi is incompatible with Grub 2.12 (as of Kiwi version 9.25.17) | ||
# We need to install and configure it manually. | ||
|
||
# Construct the EFI partition according to the standard Ubuntu layout using | ||
# signed images. | ||
install -vD usr/lib/shim/shimx64.efi.signed.latest \ | ||
boot/efi/EFI/BOOT/BOOTX64.EFI | ||
install -vD usr/lib/shim/shimx64.efi.signed.latest \ | ||
boot/efi/EFI/UBUNTU/SHIMX64.EFI | ||
install -vD usr/lib/shim/fbx64.efi \ | ||
boot/efi/EFI/BOOT/FBX64.EFI | ||
install -vD usr/lib/shim/mmx64.efi \ | ||
boot/efi/EFI/BOOT/MMX64.EFI | ||
install -vD usr/lib/shim/BOOTX64.CSV \ | ||
boot/efi/EFI/UBUNTU/BOOTX64.CSV | ||
install -vD usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed \ | ||
boot/efi/EFI/UBUNTU/GRUBX64.EFI | ||
|
||
# Tell Grub to load its config from the BOOT partition | ||
cat > boot/efi/EFI/UBUNTU/grub.cfg << EOF | ||
search.fs_label BOOT root | ||
set prefix=(\$root)'/grub' | ||
configfile \$prefix/grub.cfg | ||
EOF | ||
|
||
# Install Grub modules | ||
mkdir -p /boot/grub | ||
cp -rv usr/lib/grub/x86_64-efi/*.mod boot/grub/ | ||
|
||
# Basic Grub configuration to load the kernel and initrd | ||
KERNEL="$(basename boot/vmlinuz-*)" | ||
INITRD="$(basename boot/initrd.img-*)" | ||
cat > boot/grub/grub.cfg << EOF | ||
linux /${KERNEL} console=ttyS0 rd.systemd.verity=1 root=overlay:MAPPER=verityRoot verityroot=/dev/disk/by-partlabel/p.lxreadonly rd.root.overlay.write=/dev/mapper/luks rd.luks=yes rootwait pstore.backend=efi selinux=0 | ||
initrd /${INITRD} | ||
boot | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash -ex | ||
|
||
# Kiwi is incompatible with Grub 2.12 (as of Kiwi version 9.25.17) | ||
# We need to install and configure it manually. | ||
|
||
# Construct the EFI partition according to the standard Ubuntu layout using | ||
# signed images. | ||
install -vD usr/lib/shim/shimaa64.efi.signed.latest \ | ||
boot/efi/EFI/BOOT/BOOTAA64.EFI | ||
install -vD usr/lib/shim/shimaa64.efi.signed.latest \ | ||
boot/efi/EFI/UBUNTU/SHIMAA64.EFI | ||
install -vD usr/lib/shim/fbaa64.efi \ | ||
boot/efi/EFI/BOOT/FBAA64.EFI | ||
install -vD usr/lib/shim/mmaa64.efi \ | ||
boot/efi/EFI/BOOT/MMAA64.EFI | ||
install -vD usr/lib/shim/BOOTAA64.CSV \ | ||
boot/efi/EFI/UBUNTU/BOOTAA64.CSV | ||
install -vD usr/lib/grub/arm64-efi-signed/grubaa64.efi.signed \ | ||
boot/efi/EFI/UBUNTU/GRUBAA64.EFI | ||
|
||
# Tell Grub to load its config from the BOOT partition | ||
cat > boot/efi/EFI/UBUNTU/grub.cfg << EOF | ||
search.fs_label BOOT root | ||
set prefix=(\$root)'/grub' | ||
configfile \$prefix/grub.cfg | ||
EOF | ||
|
||
# Install Grub modules | ||
mkdir -p /boot/grub | ||
cp -rv usr/lib/grub/arm64-efi/*.mod boot/grub/ | ||
|
||
# Basic Grub configuration to load the kernel and initrd | ||
KERNEL="$(basename boot/vmlinuz-*)" | ||
INITRD="$(basename boot/initrd.img-*)" | ||
cat > boot/grub/grub.cfg << EOF | ||
linux /${KERNEL} console=ttyS0 rd.systemd.verity=1 root=overlay:MAPPER=verityRoot verityroot=/dev/disk/by-partlabel/p.lxreadonly rd.root.overlay.write=/dev/mapper/luks rd.luks=yes pstore.backend=efi selinux=0 | ||
initrd /${INITRD} | ||
boot | ||
EOF |