[Mac hardware] package fwupdate 0.5-2ubuntu4 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1

Bug #1573160 reported by Richard
58
This bug affects 12 people
Affects Status Importance Assigned to Milestone
fwupdate (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

I am not sure what I was doing when this problem occurred

ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: fwupdate 0.5-2ubuntu4
ProcVersionSignature: Ubuntu 4.4.0-21.37-generic 4.4.6
Uname: Linux 4.4.0-21-generic x86_64
ApportVersion: 2.20.1-0ubuntu2
Architecture: amd64
Date: Tue Apr 19 12:29:57 2016
ErrorMessage: subprocess installed post-installation script returned error exit status 1
RelatedPackageVersions:
 dpkg 1.18.4ubuntu1
 apt 1.2.10ubuntu1
SourcePackage: fwupdate
Title: package fwupdate 0.5-2ubuntu4 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
UpgradeStatus: Upgraded to xenial on 2016-04-19 (1 days ago)

Revision history for this message
Richard (ismail-a) wrote :
Revision history for this message
Mario Limonciello (superm1) wrote :

Your EFI system partition is mounted read only from what it looks like in these logs.

Is that intentional on your part?

Can you please share your /etc/fstab?

Revision history for this message
Richard (ismail-a) wrote :

It would be good if there is a message declaring what file system location is not writable causing the failure.

My mounts are as follows:
mount | grep /boot
/dev/md50 on /boot type ext4 (rw,relatime,stripe=4,data=ordered)
/dev/sda1 on /boot/efi type hfsplus (rw,relatime,umask=77,uid=0,gid=0,nls=utf8)

that /boot/efi ends up mounted ro is typically because of these two reasons:

A.
Package: grub-common
Version: 2.02~beta2-36ubuntu3
- has a bug that causes the Linux Installer to fail, it requires the file /boot/efi/EFI/ubuntu/mach_kernel to exist which can be fixed by:
touch /boot/efi/EFI/ubuntu/mach_kernel

B.
Some crash causing the /boot/efi needing a fsck, but fsck.hfsplus is not installed. Because of the Apple firmware on MacBooks, the efi system partition must be in the non-standard hfsplus format or the system does not boot.
Remount as rw can be fixed by:
umount /boot/efi
apt-get install hfsprogs
fsck.hfsplus /dev/sda1 # sda1 from the mount line above
mount -o relatime,umask=77,uid=0,gid=0,nls=utf8 /dev/sda1 /boot/efi # parameters from the mount line above

I believe this bug #1573160 occurred in that moment, after the installer had failed, while installing packages, but before I had ensured /boot/efi to be rw.

The package is properly installed now:
dpkg --status fwupdate
Package: fwupdate
Status: install ok installed
Priority: optional
Section: admin
Installed-Size: 212
Maintainer: Ubuntu Developers <email address hidden>
Architecture: amd64
Multi-Arch: foreign
Version: 0.5-2ubuntu4
Depends: libc6 (>= 2.4), libefivar0 (>= 0.23), libfwup0 (= 0.5-2ubuntu4), libpopt0 (>= 1.14), efibootmgr
Description: Tools to manage UEFI firmware updates
 fwupdate provides functionality to update system firmware. It has been
 initially designed to update firmware using UEFI capsule updates, but
 it is designed to be extensible to other firmware update standards.
 .
 This package provides a simple command line interface to perform UEFI
 firmware updates.
Original-Maintainer: Debian EFI <email address hidden>
Homepage: https://github.com/rhinstaller/fwupdate

Revision history for this message
Richard (ismail-a) wrote :

I had it again on upgrade of another system from 14.04 to 16.04

I used:
do-release-upgrade -d

/boot/efi ws mounted ro for some reason. The line in fstab is:
UUID=a369305d-809f-3317-8484-01d6c86315c5 /boot/efi auto defaults 0 3

- the file system was not dirty
- mount -o remount,rw /boot/efi failed with no logging or explanation

get-around:
mount | grep /boot
- note device, mount point and options
umount /dev/sda1 # the device
mount -o relatime,umask=22,uid=0,gid=0,nls=utf8 /dev/sda1 /boot/efi # options less the ro, device and mount point

The installer on continue will display:
Could not install the upgrades

The upgrade has aborted. Your system could be in an unusable state. A
recovery will run now (dpkg --configure -a).

Setting up fwupdate (0.5-2ubuntu4) ...
Installing fwupia32.efi to EFI system partition.
Setting up fwupdate-signed (1.11+0.5-2ubuntu4) ...

Upgrade complete

The upgrade has completed but there were errors during the upgrade
process.

To continue please press [ENTER]

Suggested fix:
if fwupdate notices /boot/efi being ro, print this fact and wait for ENTER key.
- the user can then in another terminal fix the problem

Revision history for this message
Richard (ismail-a) wrote :

The first system was a MacBook Pro
The second system a Mac mini 32-bit Intel

Revision history for this message
Richard (ismail-a) wrote :

That fstab line makes /boot/efi rw on boot

Revision history for this message
Mario Limonciello (superm1) wrote :

A few comments:
1) It's not acceptable for a postinst to hang waiting on a problem with the disk. If there was a problem with the disk, the post install script did the right thing by stopping and showing you an error.
2) It's assumed on Ubuntu that the ESP is writable. That's how GRUB gets installed to it on any GRUB updates as well. If fwupdate didn't fail there, GRUB would too.

So i'm going to close this bug as Won't Fix.

Changed in fwupdate (Ubuntu):
status: New → Won't Fix
summary: - package fwupdate 0.5-2ubuntu4 failed to install/upgrade: subprocess
- installed post-installation script returned error exit status 1
+ [Mac hardware] package fwupdate 0.5-2ubuntu4 failed to install/upgrade:
+ subprocess installed post-installation script returned error exit status
+ 1
Revision history for this message
Alexander Bethke (oolongbrothers) wrote :

I think the problem is that on Macs, EFI partitions are generally expected to be formatted in the HFS+ file system. The default EFI partition is HFS+ and even if you create a second one, you will often need to that as the HFS+ file system as well to work around peculiarities with the Mac firmware.

In Linux, HFS+ partitions (at least with journalling enabled) get mounted read-only by default. You can force them to mount read-write, but if you have journalling enabled that is possibly harmful for your EFI partition, which ultimately could render your system to be unable to boot, requiring you to fix it manually. If you really want to toy around with that, you should really make an backup image of your EFI partition and make sure you know and test how to recover it.

I have had bad experiences with Linux writing to HFS+ partitions even when journalling was turned off. Also, the firmware update tool will very likely do no good on Mac hardware at all. So I decided to remove the fwupdate package. This fixes the immediate problem and since I have not had problems with GRUB during the years of running Ubuntu on this machine, I hope I'm fine that way.

That said, it's not a great experience for a common problem with running Ubuntu on Mac hardware. Maybe this could be worked around by excluding the fwupdate package on Ubuntu installations on Mac hardware automatically. I acknowledge though that the real problem runs deeper and is very hard for Ubuntu to fix.

Revision history for this message
Mario Limonciello (superm1) wrote : Re: [Bug 1573160] Re: [Mac hardware] package fwupdate 0.5-2ubuntu4 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1

Originally the design was supposed to install fwupdate during ubiquity so
that decisions like that could be made. That ended up not happening and
it's instead seeded to all installations.

I think a possible consolation is to in the postinst script either test
for running on a Mac or instead test for installation to an hfs+ partition
of the bootloader and abort that step. Neither are really ideal however.

On Thu, Jul 27, 2017, 06:25 Alexander Bethke <email address hidden>
wrote:

> I think the problem is that on Macs, EFI partitions are generally
> expected to be formatted in the HFS+ file system. The default EFI
> partition is HFS+ and even if you create a second one, you will often
> need to that as the HFS+ file system as well to work around
> peculiarities with the Mac firmware.
>
> In Linux, HFS+ partitions (at least with journalling enabled) get
> mounted read-only by default. You can force them to mount read-write,
> but if you have journalling enabled that is possibly harmful for your
> EFI partition, which ultimately could render your system to be unable to
> boot, requiring you to fix it manually. If you really want to toy around
> with that, you should really make an backup image of your EFI partition
> and make sure you know and test how to recover it.
>
> I have had bad experiences with Linux writing to HFS+ partitions even
> when journalling was turned off. Also, the firmware update tool will
> very likely do no good on Mac hardware at all. So I decided to remove
> the fwupdate package. This fixes the immediate problem and since I have
> not had problems with GRUB during the years of running Ubuntu on this
> machine, I hope I'm fine that way.
>
> That said, it's not a great experience for a common problem with running
> Ubuntu on Mac hardware. Maybe this could be worked around by excluding
> the fwupdate package on Ubuntu installations on Mac hardware
> automatically. I acknowledge though that the real problem runs deeper
> and is very hard for Ubuntu to fix.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1573160
>
> Title:
> [Mac hardware] package fwupdate 0.5-2ubuntu4 failed to
> install/upgrade: subprocess installed post-installation script
> returned error exit status 1
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/fwupdate/+bug/1573160/+subscriptions
>

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.