FS#57385 - [fwupdate] cleanup script not being run on install

Attached to Project: Community Packages
Opened by Mario (superm1) - Monday, 05 February 2018, 19:29 GMT
Last edited by Bruno Pagani (ArchangeGabriel) - Tuesday, 27 February 2018, 18:30 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Bruno Pagani (ArchangeGabriel)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

We've gotten some failures that point to the initial fwupdate cleanup task is not being run on Arch installs of fwupdate.

This script is shipped as a systemd unit (https://github.com/rhboot/fwupdate/blob/master/linux/cleanup.service.in) but it can also be manually called during a postinst task https://github.com/rhboot/fwupdate/blob/master/linux/cleanup.in

The script will remove any old EFI variables from a different distribution to prevent pointing to the wrong files. If not removed then the fwupdate libraries will try to re-use variables and paths that they point to.

At least one report to LVFS indicates that it is not being run (The installation refers to an Ubuntu variable that should have been previously removed).

"Metadata": { "AppstreamGlibVersion": "0.7.4", "BootTime": "1517589445", "CpuArchitecture": "x86_64", "DistroId": "arch", "FwupdVersion": "1.0.4", "GUsbVersion": "0.2.11", "KernelVersion": "4.14.15-1-ARCH" }, "Modified": 1517669223, "Plugin": "uefi", "UpdateError": "UEFI firmware update failed: {error #0} libfwup.c:1178 get_fd_and_media_path(): open of /boot/efi/EFI/ubuntu/fw/fwupdate-3qh11r.cap failed: Datei oder Verzeichnis nicht gefunden", "UpdateState": 3, "VersionNew": "0.1.7.5", "VersionOld": "0.1.7.4"
This task depends upon

Closed by  Bruno Pagani (ArchangeGabriel)
Tuesday, 27 February 2018, 18:30 GMT
Reason for closing:  Implemented
Additional comments about closing:  Wiki page + instructions redirecting to it in fwupdate 10-1.
Comment by Doug Newgard (Scimmia) - Monday, 05 February 2018, 19:37 GMT
That sounds more like a documentation issue than a packaging issue. In general, Arch doesn't do things like this automatically.
Comment by Bruno Pagani (ArchangeGabriel) - Monday, 05 February 2018, 19:55 GMT
Of course it is not being run, because as I said upstream the script assumes ESP at a given position (/boot/efi currently, but that does not really matter), which is wrong for Arch since people are using /boot/efi as much as /boot directly. ;)

Also I’ve already agreed that this is more a documentation issue (we should have a wiki page telling to clean those things manually), but I don’t have time to write anything currently. Eventually if the script gets adjusted to run without assuming the ESP location, we could just add a line in the .install to tell people to run it (in addition to copying the required files).
Comment by Mario (superm1) - Monday, 05 February 2018, 19:58 GMT
Sorry I should be clearer - I expect that the /sys/firmware/efi/efivars/fwupdate-* should be getting cleaned up automatically at install time. That's the most important part that systemd unit does (if the files are still on the ESP that's just cruft, but won't cause problems).

The path for efivars should be static no matter where you put the ESP, if you don't run the unit can you please at least clean those variables up?
Comment by Bruno Pagani (ArchangeGabriel) - Wednesday, 07 February 2018, 20:03 GMT
OK, I will add some infos in the .install file about cleaning this, but I still don’t feel like running those command for the end user.
Comment by Mario (superm1) - Friday, 09 February 2018, 14:28 GMT
FWIW every single failure reported to LVFS for XPS 9360 is root caused to this problem in Arch right now. New reports are coming in every day.
Comment by Bruno Pagani (ArchangeGabriel) - Tuesday, 27 February 2018, 15:24 GMT
@superm1: Would a message like this suits you:
Please remove leftover from eventual previous install of fwupdate by running
this (as root or with sudo):
chattr -i /sys/firmware/efi/efivars/fwupdate-*-0abba7dc-e516-4167-bbf5-4d9d1c739416
rm /sys/firmware/efi/efivars/fwupdate-*-0abba7dc-e516-4167-bbf5-4d9d1c739416
Comment by Mario (superm1) - Tuesday, 27 February 2018, 15:32 GMT
You can certainly test if anything exists in /sys/firmware/efi/efivars/fwupdate-* at post install to determine whether to show the message.
If you're not going to automatically run those tasks I think that message makes sense.
Comment by Bruno Pagani (ArchangeGabriel) - Tuesday, 27 February 2018, 18:02 GMT
I’ll consider this fixed by:
post_install() {
echo "Please read https://wiki.archlinux.org/index.php/fwupd for things to setup before using fwupdate"
}

post_upgrade() {
if [ $(vercmp $2 10-1) -lt 0 ] ; then
post_install
fi
}

And https://wiki.archlinux.org/index.php/Fwupd#Verifying_leftovers_from_previous_installations

Loading...