Merge ~mwhudson/ubuntu/+source/grub-installer:lp-1847721 into ubuntu/+source/grub-installer:ubuntu/devel

Proposed by Michael Hudson-Doyle
Status: Work in progress
Proposed branch: ~mwhudson/ubuntu/+source/grub-installer:lp-1847721
Merge into: ubuntu/+source/grub-installer:ubuntu/devel
Diff against target: 60 lines (+11/-12)
1 file modified
grub-installer (+11/-12)
Reviewer Review Type Date Requested Status
git-ubuntu developers Pending
Review via email: mp+384068@code.launchpad.net

Commit message

allow invoker to override architecture

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

This isn't sufficient, see comment on https://code.launchpad.net/~mwhudson/ubiquity/+git/ubiquity/+merge/384069. Not sure if the best approach is to continue this or to just do what needs to be done from ubiquity more directly.

7f7bd54... by Michael Hudson-Doyle

do not be fancy trying to determine which grub-efi package to install

4087f06... by Michael Hudson-Doyle

always pass --target x86_64-efi to grub-install on adm64/efi

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

So with these changes I can install a system booted in legacy mode and then boot it in UEFI mode.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Pushed some more changes to do with installing grub-pc under a UEFI booted system. Not tested.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I've taken the "install grub-pc under UEFI boot" out again.

Unmerged commits

4087f06... by Michael Hudson-Doyle

always pass --target x86_64-efi to grub-install on adm64/efi

7f7bd54... by Michael Hudson-Doyle

do not be fancy trying to determine which grub-efi package to install

813c82e... by Michael Hudson-Doyle

allow invoker to override architecture

de05494... by Jean-Baptiste Lallement

Import patches-unapplied version 1.128ubuntu14 to ubuntu/eoan-proposed

Imported using git-ubuntu import.

Changelog parent: 7ab883a303660bb8b02b99dfc4c2b5347bdc4cb6

New changelog entries:
  * When running on a ZFS filesystem udevadm returns an error
    which can be ignored. (LP: #1847228)
  * On zfs 0.8 cache is in /etc, do not attempt to copy it from
    /boot/zfs when it doesn't exist.

7ab883a... by Dimitri John Ledkov

Import patches-unapplied version 1.128ubuntu13 to ubuntu/eoan-proposed

Imported using git-ubuntu import.

Changelog parent: fa29c9a51de16c7debe93309a650f99f6212a5ce

New changelog entries:
  [ Cherrypick 1.165 Colin Watson ]
  * On Linux, mount/unmount /run to work around #918590. LP: #1838525

fa29c9a... by Mathieu Trudel-Lapierre

Import patches-unapplied version 1.128ubuntu12 to ubuntu/cosmic-proposed

Imported using git-ubuntu import.

Changelog parent: a3f1e8cb03699a4dde45e453353721d4d5ed61a8

New changelog entries:
  [ Hans van den Bogert ]
  * Fix support for installation on NVMe with RAID1 (LP: #1771845)

a3f1e8c... by Łukasz Zemczak

Import patches-unapplied version 1.128ubuntu11 to ubuntu/cosmic-proposed

Imported using git-ubuntu import.

Changelog parent: 1c3080d679c2c9d422a88e10ecd68a29f7b7357e

New changelog entries:
  * grub-installer: actually also do not purge grub-gfxpayload-lists as it's
    yet another dependency of grub-pc.

1c3080d... by Łukasz Zemczak

Import patches-unapplied version 1.128ubuntu10 to ubuntu/cosmic-proposed

Imported using git-ubuntu import.

Changelog parent: b567a7569987f46f5f4fb533313c6c34fb0dfbe3

New changelog entries:
  * grub-installer: do not purge grub-pc-bin as well as it's a dependency of
    grub-pc.

b567a75... by Łukasz Zemczak

Import patches-unapplied version 1.128ubuntu9 to ubuntu/cosmic-proposed

Imported using git-ubuntu import.

Changelog parent: 0b340924b407170e9c7e8785aaaa667f3549c908

New changelog entries:
  * grub-installer: install grub-pc for EFI setups and make sure we're
    not purging it earlier in case it got installed. It's needed to make sure
    the right maintainer scripts are run and the ESP populated. (LP: #1775743)

0b34092... by Mathieu Trudel-Lapierre

Import patches-unapplied version 1.128ubuntu8 to ubuntu/zesty-proposed

Imported using git-ubuntu import.

Changelog parent: af8e4efacd97c256890d7e7155eeed44fca5910b

New changelog entries:
  * Fix a typo in PReP bootdev selection code; we should not skip over a valid
    mpath device in favor of the underlying block device, since it won't be
    available for grub-install later. (LP: #1681932)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/grub-installer b/grub-installer
2index 8879dbe..2329f0e 100755
3--- a/grub-installer
4+++ b/grub-installer
5@@ -8,11 +8,16 @@ set -e
6 if [ "$1" ]; then
7 ROOT="$1"
8 chroot=chroot
9+ shift
10 else
11 ROOT=
12 chroot=
13 fi
14
15+if [ "$1" ]; then
16+ ARCH="$1"
17+fi
18+
19 . /usr/share/grub-installer/functions.sh
20 . /usr/share/grub-installer/otheros.sh
21
22@@ -37,7 +42,7 @@ debug () {
23 [ -z "${DEBCONF_DEBUG}" ] || log "debug: $@"
24 }
25
26-ARCH="$(archdetect)"
27+ARCH="${ARCH:-$(archdetect)}"
28 info "architecture: $ARCH"
29
30 umount_dirs=
31@@ -494,17 +499,7 @@ case $ARCH in
32 if [ -f /var/lib/partman/ignore_uefi ]; then
33 grub_package="grub-pc"
34 else
35- grub_package="grub-efi"
36- # Override the package choice if we can figure out the
37- # right package to use directly
38- if [ -f /sys/firmware/efi/fw_platform_size ] ; then
39- SIZE=$(cat /sys/firmware/efi/fw_platform_size)
40- if [ $SIZE -eq 64 ] ; then
41- grub_package="grub-efi-amd64-signed"
42- elif [ $SIZE -eq 32 ] ; then
43- grub_package="grub-efi-ia32"
44- fi
45- fi
46+ grub_package="grub-efi-amd64-signed"
47 if [ ! -d /target/boot/efi ]; then
48 # No EFI System Partition, so presumably the partitioner
49 # believed this to be unnecessary, perhaps because we're
50@@ -1094,6 +1089,10 @@ EOF
51 grub_install_params="$grub_install_params --force"
52 fi
53
54+ if [ "$ARCH" = "amd64/efi" ] ; then
55+ grub_install_params="$grub_install_params --target x86_64-efi"
56+ fi
57+
58 CODE=0
59 case $ARCH:$grub_package in
60 *:grub|*:grub-pc|*:grub-efi*|sparc:grub-ieee1275|ppc64el/*:grub-ieee1275)

Subscribers

People subscribed via source and target branches