Merge ~sil2100/curtin:auto-nvram into curtin:master

Proposed by Łukasz Zemczak
Status: Work in progress
Proposed branch: ~sil2100/curtin:auto-nvram
Merge into: curtin:master
Diff against target: 33 lines (+7/-2)
1 file modified
helpers/common (+7/-2)
Reviewer Review Type Date Requested Status
Scott Moser (community) Needs Information
Review via email: mp+347157@code.launchpad.net

Commit message

Support --auto-nvram in curtin when running grub-install.

This still needs checking if actually --auto-nvram won't make the whole
grub_install update-nvram experience better.

Description of the change

Support --auto-nvram in curtin when running grub-install.

This still needs checking if actually --auto-nvram won't make the whole grub_install update-nvram experience better.

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) wrote :

It only makes sense to use --auto-nvram when we can be confident that the system will be bootable afterwards - either via the MBR, or via shim fallback + BOOTX64.CSV, or both. Are we confident that this is the case here? Should we be landing more extensive changes to ensure installation of grub-pc + shim-signed at the same time?

Revision history for this message
Scott Moser (smoser) :
Revision history for this message
Scott Moser (smoser) :
review: Needs Information

Unmerged commits

b897cc8... by Łukasz Zemczak

First try on getting --auto-nvram supported for the grub-install calls.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/helpers/common b/helpers/common
2index ac2d0f3..cccc25a 100644
3--- a/helpers/common
4+++ b/helpers/common
5@@ -703,13 +703,15 @@ install_grub() {
6 # or --efi-directory
7 target="--target=$2"
8 no_nvram="$3"
9+ auto_nvram="--auto-nvram"
10 efi_dir="--efi-directory=/boot/efi"
11 gi_out=$(grub-install --help 2>&1)
12 echo "$gi_out" | grep -q -- "$no_nvram" || no_nvram=""
13 echo "$gi_out" | grep -q -- "--target" || target=""
14 echo "$gi_out" | grep -q -- "--efi-directory" || efi_dir=""
15+ echo "$gi_out" | grep -q -- "$auto_nvram" || auto_nvram=""
16 grub-install $target $efi_dir \
17- --bootloader-id=ubuntu --recheck $no_nvram' -- \
18+ --bootloader-id=ubuntu --recheck $no_nvram $auto_nvram' -- \
19 "${grub_name}" "${grub_target}" "$nvram" </dev/null ||
20 { error "failed to install grub!"; return 1; }
21
22@@ -730,7 +732,10 @@ install_grub() {
23 pkg=$1; shift;
24 dpkg-reconfigure "$pkg"
25 update-grub
26- for d in "$@"; do grub-install "$d" || exit; done' \
27+ auto_nvram="--auto-nvram"
28+ gi_out=$(grub-install --help 2>&1)
29+ echo "$gi_out" | grep -q -- "$auto_nvram" || auto_nvram=""
30+ for d in "$@"; do grub-install "$d" $auto_nvram || exit; done' \
31 -- "${grub_name}" "${grubdevs[@]}" </dev/null ||
32 { error "failed to install grub!"; return 1; }
33 fi

Subscribers

People subscribed via source and target branches