pmbootstrap installs unneeded firmware to device

Created on 2 Apr 2018  路  11Comments  路  Source: postmarketOS/pmbootstrap

I notice that pmbootstrap install installs a lot of firmware that will not get used on the device. My target is Nokia-N900 and in the log I see installation of linux-firmware-i915, linux-firmware-ath9k, linux-firmware-amdgpu, among others, and a whole of other linux-firmware-* packages.

I think this behavior could be changed. I understand that sometimes we may want to use that firmware if, for example, we connect a device via USB host, but in general I doubt this firmware is needed on most devices, at least for sure on N900.

bug good first issue help wanted packaging

All 11 comments

Which firmware files get installed depends on the device. In case of the N900, there's linux-firmware mentioned in aports/device/device-nokia-n900/APKBUILD. The linux-firmware package has been split up recently in Alpine, so it is possible to specify the subpackages you've mentioned instead of the meta-package which depends on all of them.

I agree that we should change all device APKBUILDs where linux-firmware is used. Could you make a pull request, that fixes this for the N900?

From reading up here, the only firmware subpackage needed should be:
linux-firmware-ti-connectivity (WiFi: wl1251-fw.bin and wl1251-nvs.bin)

(CC @craftyguy and @pavelmachek, do you know about more firmware files used, e.g. for the cellular modem?)

Thanks for opening this issue @sicelo!

PS: other devices having this issue:

$ grep -r linux-firmware aports
aports/device/device-htc-ace/APKBUILD:  depends="linux-firmware"
aports/device/device-nokia-n9/APKBUILD: depends="linux-firmware"
aports/device/device-nokia-n900/APKBUILD:       depends="linux-firmware"
aports/device/device-teclast-x80pro/APKBUILD:   depends="linux-firmware"
aports/device/device-sony-castor-windy/APKBUILD:        depends="linux-firmware firmware-adreno"
aports/device/device-lg-hammerhead/APKBUILD:    depends="linux-firmware"
aports/device/device-semc-anzu/APKBUILD:        depends="linux-firmware"

Wifi definitely needs firmware, I don't recall firmware being loaded for the modem, but it's really difficult to determine if it's required without removing all firmware and trying to load things (unless someone knows of a better way?), since not all drivers will say "I am loading firmware XYZ now" in the log..

Edit: the elinux link in @ollieparanoid's comment suggests that the BCM2048 firmware is also needed for the bluetooth radio.

@craftyguy: at least from that page, it looks like the bluetooth firmware never made it to the official linux-firmware. Regarding cellular modem: are there simple test instructions somewhere, that whoever gives this a shot could try out? Then we would know if behavior changes or not after reducing the installed firmwares.

Regarding cellular modem: are there simple test instructions somewhere, that whoever gives this a shot could try out?

Well basically if they can do what was described in the N900 wiki page for initializing the modem and establishing a data connection without any linux-firmware packages installed, then that would confirm the modem does not require loading any extra firmware to operate.

Yes, N900 currently only needs linux-firmware-ti-connectivity
I am not very familiar with alpine to know if that's available as a separate package or not ...

It is the very package name. I'm not sure if closing the issue was intentional, but it isn't really solved and if you don't want to work on it that's totally fine.

Thanks. I will look at it later today. I don't know how it got closed (thought someone else did).

EDIT: I see I inadvertently closed it by selecting the wrong comment button.

Issue #1184 seems a duplicate

i made the following change:

diff --git a/aports/device/device-nokia-n900/APKBUILD b/aports/device/device-nokia-n900/APKBUILD
index 6d22e60..32f10f2 100644
--- a/aports/device/device-nokia-n900/APKBUILD
+++ b/aports/device/device-nokia-n900/APKBUILD
@@ -97,7 +97,7 @@ i3wm() {

 nonfree_firmware() {
        pkgdesc="Wifi firmware"
-       depends="linux-firmware"
+       depends="linux-firmware-ti-connectivity"
        mkdir "$subpkgdir"
 }

but afterwards in log I get:
(022633) [21:21:50] device-nokia-n900-nonfree-firmware: depends on: linux-firmware

which makes me wonder what other file might be causing the dependency on linux-firmware as linux-firmware-ti-connectivity definitely has no such dependency.

I will test further now that building for N900 is working again (#1408 )

I might add that this is a fresh pmbootstrap installation

I guess the package was not rebuilt. Either run pmbootstrap build --force device-nokia-n900 (for usual testing) or increase the pkgrel (that needs to be done once in the PR) in the APKBUILD. Other than that the patch looks good :+1:

Closing. Commit 4388c6614df5915d76bad09ba882b7e70b7bf255 fixes the issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ollieparanoid picture ollieparanoid  路  5Comments

cmdr2 picture cmdr2  路  7Comments

pavelmachek picture pavelmachek  路  7Comments

ata2001 picture ata2001  路  4Comments

zenety picture zenety  路  5Comments