Figured out *why* this is occurring: the linux-firmware package, on
upgrade from plucky->questing, moves its contents from the aliased
(symlinked) /lib location to /usr/lib. However, the linux-firmware-raspi
diversions are for /lib. Knowing this was going on, I also moved the
diversions to /usr/lib in the questing update, but it turns out this is
insufficient if a specific ordering of operations occurs. The following
concentrates only on cypress/cyfmac43455-sdio.bin.zst as that's the only
blob that gets broken by these operations:

1. Starting state: [/usr]/lib/firmware/cypress/cyfmac43455-sdio.bin.zst
exists, and is a symlink to the currently configured alternative (by
default 43455-sdio-standard.bin.zst). A diversion exists forcing
cyfmac43455-sdio.bin.zst from linux-firmware to the .distrib suffix.

2. linux-firmware unpacks, "removes"
/lib/firmware/cypress/cyfmac43455-sdio.bin.zst and "adds"
/usr/lib/firmware/cypress/cyfmac43455-sdio.bin.zst (at the same location
because /lib is aliased). This skips the diversion (which is keyed on
the /lib/firmware filename, not /usr/lib/firmware), and overwrites the
alternatives symlink because that is not "owned" by any package.

3. linux-firmware-raspi preinst runs and migrates the diversions from
/lib/firmware to /usr/lib/firmware. This fixes up other diversions but
*doesn't* in the case of cyfmac43455-sdio.bin.zst because there is *no
replacement file* in the package for it (just other files which are
linked via alternatives).

4. linux-firmware-raspi unpacks (again, fixes other diversions, doesn't
affect cyfmac43455-sdio.bin.zst)

5. linux-firmware-raspi postinst runs and attempts to migrate the
alternatives links. However, this fails because a file is in the way,
leaving both the alternative and the diversion broken.

The fix is to determine (at the start of postinst, before attempting to
migrate the alternatives) whether 1) the expected symlink is actually a
file and whether 2) the expected .distrib file does not exist. If these
are both true, the diversion should be remade (with --rename) to force
the cyfmac43455-sdio.bin.zst back into its diverted position, then
proceed with remaking the alternatives symlink.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2126066

Title:
  Upgrade to questing daily breaks wifi firmware blob

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-firmware-raspi/+bug/2126066/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to