Merge ~ltrager/maas:chainload_shim into maas:master

Proposed by Lee Trager
Status: Merged
Approved by: Lee Trager
Approved revision: ff0f0a4463803a2b313d18dd5738f06beebda591
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~ltrager/maas:chainload_shim
Merge into: maas:master
Diff against target: 86 lines (+21/-39)
2 files modified
src/provisioningserver/boot/tests/test_uefi_amd64.py (+5/-2)
src/provisioningserver/templates/uefi/config.local.amd64.template (+16/-37)
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
MAAS Lander Approve
Review via email: mp+356391@code.launchpad.net

Commit message

Chainload the local UEFI shim if available when local booting on AMD64.

Description of the change

This is pending the new shim in the MAAS stream from LP:1792575

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

UNIT TESTS
-b chainload_shim lp:~ltrager/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: FAILED
LOG: http://maas-ci-jenkins.internal:8080/job/maas/job/branch-tester/4121/console
COMMIT: 2f0dc959245cf4b7f67a1dc057946e30a8d38932

review: Needs Fixing
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b chainload_shim lp:~ltrager/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: db82decc4d3dfa2204648b2773d47bdf20e12e94

review: Approve
Revision history for this message
Andres Rodriguez (andreserl) wrote :

So, while this looks good, I'm concerned that your change of approach is too large or too risky for an rc release...

review: Needs Information
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b chainload_shim lp:~ltrager/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: b506c43234dfde569254d8035d198fb84f5c9648

review: Approve
Revision history for this message
Lee Trager (ltrager) wrote :

I've tested this in the CI and successfully deployed Ubuntu 18.04, CentOS 7, RHEL 7, and VMware ESXi 6.7. The loop is much cleaner to read and is supported by GRUB[1]. IMHO the risk is that we're changing from chainbooting local GRUB to chainbooting the local shim in an RC.

[1] https://www.gnu.org/software/grub/manual/grub/html_node/Shell_002dlike-scripting.html

Revision history for this message
Andres Rodriguez (andreserl) wrote :

ok. Please test Windows and report back in this branch.

On Thu, Oct 11, 2018 at 7:29 PM Lee Trager <email address hidden> wrote:

> I've tested this in the CI and successfully deployed Ubuntu 18.04, CentOS
> 7, RHEL 7, and VMware ESXi 6.7. The loop is much cleaner to read and is
> supported by GRUB[1]. IMHO the risk is that we're changing from
> chainbooting local GRUB to chainbooting the local shim in an RC.
>
> [1]
> https://www.gnu.org/software/grub/manual/grub/html_node/Shell_002dlike-scripting.html
> --
> https://code.launchpad.net/~ltrager/maas/+git/maas/+merge/356391
> You are reviewing the proposed merge of ~ltrager/maas:chainload_shim into
> maas:master.
>

--
Andres Rodriguez
Engineering Manager, MAAS
Canonical USA, Inc.

Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b chainload_shim lp:~ltrager/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: f42fe7a6141ab3d0167c1f8444347469d9382445

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b chainload_shim lp:~ltrager/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: ff0f0a4463803a2b313d18dd5738f06beebda591

review: Approve
Revision history for this message
Lee Trager (ltrager) wrote :
Revision history for this message
Andres Rodriguez (andreserl) :
review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/provisioningserver/boot/tests/test_uefi_amd64.py b/src/provisioningserver/boot/tests/test_uefi_amd64.py
2index 0a84266..09fdc48 100644
3--- a/src/provisioningserver/boot/tests/test_uefi_amd64.py
4+++ b/src/provisioningserver/boot/tests/test_uefi_amd64.py
5@@ -1,4 +1,4 @@
6-# Copyright 2014-2016 Canonical Ltd. This software is licensed under the
7+# Copyright 2014-2018 Canonical Ltd. This software is licensed under the
8 # GNU Affero General Public License version 3 (see the file LICENSE).
9
10 """Tests for `provisioningserver.boot.uefi_amd64`."""
11@@ -132,7 +132,10 @@ class TestUEFIAMD64BootMethodRender(MAASTestCase):
12 purpose="local", arch="amd64"),
13 }
14 output = method.get_reader(**options).read(10000).decode("utf-8")
15- self.assertIn("chainloader /efi/ubuntu/grubx64.efi", output)
16+ self.assertIn("chainloader /efi/", output)
17+ self.assertIn("bootx64.efi", output)
18+ self.assertIn("shimx64.efi", output)
19+ self.assertIn("grubx64.efi", output)
20
21 def test_get_reader_with_enlist_purpose(self):
22 # If purpose is "enlist", the config.enlist.template should be
23diff --git a/src/provisioningserver/templates/uefi/config.local.amd64.template b/src/provisioningserver/templates/uefi/config.local.amd64.template
24index 62e2976..b8ffe40 100644
25--- a/src/provisioningserver/templates/uefi/config.local.amd64.template
26+++ b/src/provisioningserver/templates/uefi/config.local.amd64.template
27@@ -3,43 +3,22 @@ set timeout=0
28
29 menuentry 'Local' {
30 echo 'Booting local disk...'
31- # Ubuntu and Ubuntu Core
32- search --set=root --file /efi/ubuntu/grubx64.efi
33- if [ $? -eq 0 ]; then
34- chainloader /efi/ubuntu/grubx64.efi
35- boot
36- fi
37- # CentOS 7
38- search --set=root --file /efi/centos/grubx64.efi
39- if [ $? -eq 0 ]; then
40- chainloader /efi/centos/grubx64.efi
41- boot
42- fi
43- # RHEL 7 unsigned bootloader, generated by Curtin
44- search --set=root --file /efi/rhel/grubx64.efi
45- if [ $? -eq 0 ]; then
46- chainloader /efi/rhel/grubx64.efi
47- boot
48- fi
49- # RHEL 7 signed bootloader, this may not work due to RHBZ #1623296
50- search --set=root --file /efi/redhat/grubx64.efi
51- if [ $? -eq 0 ]; then
52- chainloader /efi/redhat/grubx64.efi
53- boot
54- fi
55- # Windows
56- search --set=root --file /efi/Microsoft/Boot/bootmgfw.efi
57- if [ $? -eq 0 ]; then
58- chainloader /efi/Microsoft/Boot/bootmgfw.efi
59- boot
60- fi
61- # This is the default bootloader location according to the UEFI spec.
62- # This path is used by ESXi.
63- search --set=root --file /efi/boot/bootx64.efi
64- if [ $? -eq 0 ]; then
65- chainloader /efi/boot/bootx64.efi
66- boot
67- fi
68+ for bootloader in \
69+ boot/bootx64.efi \
70+ ubuntu/shimx64.efi \
71+ ubuntu/grubx64.efi \
72+ centos/shimx64.efi \
73+ centos/grubx64.efi \
74+ rhel/shimx64.efi \
75+ rhel/grubx64.efi \
76+ red/grubx64.efi \
77+ Microsoft/Boot/bootmgfw.efi; do
78+ search --set=root --file /efi/$bootloader
79+ if [ $? -eq 0 ]; then
80+ chainloader /efi/$bootloader
81+ boot
82+ fi
83+ done
84 # If no bootloader is found exit and allow the next device to boot.
85 exit
86 }

Subscribers

People subscribed via source and target branches