Xenial grub-install fails on amd64 due to removed grub-pc-bin package

Bug #2045418 reported by Philip Roche
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
livecd-rootfs (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Fix Released
Undecided
Unassigned

Bug Description

I have found an interesting bug with grub on our cloud image builds for xenial. During the build `grub-install --target=i386-pc /dev/loop3` is called which calls `/usr/lib/grub/i386-pc/modinfo.sh` and `/usr/lib/grub/i386-pc/modinfo.sh` is from package `grub-pc-bin` but `grub2-common` which is where `grub-install` is from does not depend on `grub-pc-bin` so this now fails with error

```
grub-install: error: /usr/lib/grub/i386-pc/modinfo.sh doesn't exist. Please specify --target or --directory.
```

We are seeing this now on xenial as `grub-pc-bin` is now removed during build as part of fixing bug LP#2036195 as `grub-pc-bin` is being purged as an autoremovable package.

The reason `grub-pc-bin` is autoremovable is because the `grub-pc` package was removed when `apt-get install -qqy grub-efi-amd64-signed grub-efi-amd64 shim-signed` as `grub-efi-amd64` replaces `grub-pc`.

We are not seeing this on newer releases as `grub-pc` is still installed, and thus, so too is `grub-pc-bin`

There were previous changes in this area [1] related to grub installs which would have resolved this issue as part of LP#1901906 but they were reverted for xenial [2][3]

Without making further grub changes the solution is to mark `grub-pc-bin` as manually installed so even if `grub-pc` is removed the `grub-pc-bin` is not marked autoremovable.

[1] https://git.launchpad.net/livecd-rootfs/tree/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary?h=eef7feef4a302c844d4c7fd1f8313e0bc188a104#n89
[2] https://git.launchpad.net/livecd-rootfs/commit/?id=94cafd703d9167115be9ae73fffa70a661f05b7f
[3] https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/1901906/comments/12

Related branches

Revision history for this message
Philip Roche (philroche) wrote :

I had discussed this with juliank too to see if this could be fixed by updating the dependencies of grub2-common to include grub-pc-bin but this is not a path we wish to take.

It is expected that grub-install can't install targets you haven't installed. grub-pc is the only thing calling grub-install with the i386-pc target and if you want to run grub-install yourself for a specific target you have to make sure to install that target first.

As such the proposed solution is to apt-mark manual grub-pc-bin so it will not be autoremoved.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in livecd-rootfs (Ubuntu Xenial):
status: New → Confirmed
Changed in livecd-rootfs (Ubuntu):
status: New → Confirmed
Revision history for this message
Philip Roche (philroche) wrote :

We are seeing this now on xenial as grub-pc-bin is now removed during build as part of fixing bug https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/2036195.

Revision history for this message
Philip Roche (philroche) wrote :

This is now marked fix released as the xenial MP has been merged. No further packaging will be performed for Xenial due to being out of standard support now.

Changed in livecd-rootfs (Ubuntu Xenial):
status: Confirmed → Fix Released
Steve Langasek (vorlon)
Changed in livecd-rootfs (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.