Merge ~xnox/maas:compatible-grub.cfg into maas:master

Proposed by Dimitri John Ledkov
Status: Work in progress
Proposed branch: ~xnox/maas:compatible-grub.cfg
Merge into: maas:master
Diff against target: 43 lines (+16/-0)
2 files modified
src/provisioningserver/boot/install_grub.py (+8/-0)
src/provisioningserver/boot/uefi_amd64.py (+8/-0)
Reviewer Review Type Date Requested Status
Dimitri John Ledkov (community) Disapprove
MAAS Lander Approve
MAAS Maintainers Pending
Review via email: mp+397528@code.launchpad.net

Commit message

provisioningserver: generate grub.cfg suitable for both arm64 & amd64

This grub.cfg provisioning enrollment grub.cfg is suitable to be booted by either secureboot signed grub arm64 build, or the older unsigned network boot grub arm64 build as produced by bootloaders maas-images build.

This change will allow for the current/new maas to use either the current arm64 grub builds, or the new secureboot signed arm64 grub builds.

This alone will not obviously enable older/stable maas to use arm64 secureboot signed grub. But this change might be easy enough to backport to older maas series.

I did not test this, but it is the right syntax.

To post a comment you must log in.
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b compatible-grub.cfg lp:~xnox/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: c12d85dc4c391fe1ef0750748d2a8477940310c6

review: Approve
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

however this will not do much good.

this will allow to use the old bootloaders with new maas; but that is not a problem, cause we can make new maas use new bootloaders revisions too.

the issue is more pressing with making the new bootloader work with old maas, which might not be upgraded at all.

review: Disapprove

Unmerged commits

c12d85d... by Dimitri John Ledkov

provisioningserver: generate grub.cfg suitable for both arm64 & amd64

This grub.cfg provisioning enrollment grub.cfg is suitable to be
booted by either secureboot signed grub arm64 build, or the older
unsigned network boot grub arm64 build as produced by bootloaders
maas-images build.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/provisioningserver/boot/install_grub.py b/src/provisioningserver/boot/install_grub.py
2index 27ebd36..b43b8ed 100644
3--- a/src/provisioningserver/boot/install_grub.py
4+++ b/src/provisioningserver/boot/install_grub.py
5@@ -15,9 +15,17 @@ CONFIG_FILE = """
6 # Load based on MAC address first.
7 configfile /grub/grub.cfg-${net_default_mac}
8
9+if [ "$platform" = "x86_64-efi" ]; then
10 # Failed to load based on MAC address.
11 # Load amd64 by default, UEFI only supported by 64-bit
12 configfile /grub/grub.cfg-default-amd64
13+fi
14+
15+if [ "$platform" = "arm64-efi" ]; then
16+# Failed to load based on MAC address.
17+# Load arm64 by default, UEFI only supported by 64-bit
18+configfile /grub/grub.cfg-default-arm64
19+fi
20 """
21
22
23diff --git a/src/provisioningserver/boot/uefi_amd64.py b/src/provisioningserver/boot/uefi_amd64.py
24index 4e42c78..5a73dec 100644
25--- a/src/provisioningserver/boot/uefi_amd64.py
26+++ b/src/provisioningserver/boot/uefi_amd64.py
27@@ -26,9 +26,17 @@ CONFIG_FILE = dedent(
28 # Load based on MAC address first.
29 configfile (pxe)/grub/grub.cfg-${net_default_mac}
30
31+ if [ "$platform" = "x86_64-efi" ]; then
32 # Failed to load based on MAC address.
33 # Load amd64 by default, UEFI only supported by 64-bit
34 configfile (pxe)/grub/grub.cfg-default-amd64
35+ fi
36+
37+ if [ "$platform" = "arm64-efi" ]; then
38+ # Failed to load based on MAC address.
39+ # Load arm64 by default, UEFI only supported by 64-bit
40+ configfile (pxe)/grub/grub.cfg-default-arm64
41+ fi
42 """
43 )
44

Subscribers

People subscribed via source and target branches