Package: hw-detect
Version: 1.147
Tags: d-i

Dear maintainer,

In some situations, check-missing-firmware fails to find loose firmware file or package file on partitioned removable media (as most USB drives are nowadays).

Observed behaviour:
- When looking for a loose firmware file, check-missing-firmware calls "mountmedia" which returns after mounting the first device which can be mounted.

- When looking for a firmware package, check-missing-firmware calls "mountmedia driver" which returns after mounting the first device which can be mounted and contains {,/firmware}/*.{deb,udeb,ude} files.

mountmedia tries to mount whole drives first, then partitions, in alphanumerical order.

In either case, the lookup fails if the mounted device is not the one which contains the requested firmware, next devices are not tried.

The usual workaround is to mount the right device on /media by hand.

Here are tested examples of such situations.

* Example 1
sda = internal drive
sdb = USB flash drive with debian-11.6.0-amd64-i386-netinst.iso
sdc1 = USB flash drive with requested firmware file
-> mountmedia mounts the d-i EFI partition sdb2

The firmware media is usually connected after booting the installer.
If both media are connected before the usb-storage module is loaded, there is 50% probability of failure.

* Example 2
sda1 = internal EFI/FAT/ISO9660 partition
sdb1 = USB flash drive with requested firmware file
sdc = USB flash drive with debian-11.6.0-amd64-i386-netinst.iso
-> mountmedia mounts the internal partition sda1

Internal drives are usually detected before USB drives and may contain an EFI partition.

* Example 3
sda3 = internal EFI/FAT/ISO9660 partition with other {,/firmware}/*.deb
sdb1 = USB flash drive with deb package containing requested firmware
sdc = USB flash drive with debian-11.6.0-amd64-i386-netinst.iso
-> mountmedia mounts the internal partition sda3

This is a much less common situation than the previous ones, so loading firmware from package files is usually more reliable. However all required firmware packages must be in the same location.

Here is a situation which unexepectedly works:

* Example 4
sda = internal drive
sdb = USB flash drive with firmware-11.6.0-amd64-i386-netinst.iso without the requested firmware package
sdc1 = USB flash drive with deb package containing requested firmware

mountmedia tries to mount sdb1 which contains /firmare/*.deb, but "fortunately" busybox mount fails to do so because sdb1 is already mounted (unlike util-linux mount). IMO we should not rely on this.

IMO the correct behaviour is:

for each drive or partition
        if device not mounted
                try to mount device
                if mount succeeds
                        look for missing loose firmware files
                        look for missing firmware in deb package files

But I do not see how this can be achieved by still using mountmedia...

Reply via email to