My apologies if this is an ignorant question, I have googled and searched this forum but have been unable to find the answer. I wanted to try to add wireless support to an unsupported board (everything works except wireless) during the build process. However, in order to do this I need to mount /lib/firmware RW.
/lib/firmware is part of the host OS filesystem, and changing it would either block Resin OS updates, or overwrite them on every update ā As this could leave devices in a non functioning state, Resin OS doesnāt allow modifications to it by default.
That said, it is certainly possible to load custom kernel modules and/or firmware from a container. If you put the firmware in the containers /lib/firmware (instead of mounting the host OSās), and load the required kernel module from there, that generally works well.
Alternatively, there might be a way to specify an alternative location for the firmware in the drivers?
I found this thread when searching for ābalena mount /lib/fimware rwā which is pretty close to the threadās titleā¦ yet the thread didnāt quite answer the question. As Iāve found a bit more about the answer, I thought I would add it here. (Chances are Iāll need to search again in a few monthsā time, so really I am helping myself.)
Regarding the /lib/firmware folder, it is possible to ābind mountā it on an app container by setting the io.balena.features.firmware label in the docker-compose.yml file (or by using a single-container app with a single Dockerfile):
With that in place, firmware files can be added through an app container. The /lib/firmware folder will be initially mounted āread onlyā on the app container, but it can remounted āread writeā before copying the file(s) with the command:
# on the app container
mount -o remount,rw /lib/firmware
It works similarly for the /lib/modules folder.
Specifically regarding network interfaces that are required to allow the device to connect to the internet, note that balena does not advise loading kernel modules or firmware files via app containers because of the risk that a routing application update could fail (e.g. a typo in the Dockerfile entry point script) and thus render the device unreachable. It would also make host OS upgrades riskier, in case the firmware file is incompatible (thought host OS upgrades should be first tested in a lab anywayā¦).
I know Iām bumping an old topic; apologies. Your instructions are exactly what Iām looking for, but when I attempt to bind-mount the /lib/firmware directory:
Hi,
I am trying to copy my new Wifi dongle driver in to the /lib/firmware.
followed you way but doesnāt work for me. When I want to build the image and upload in the fleet, I have error which is :
"
[app] Step 80/83 : RUN mount -o remount, rw /lib/firmware
[app] ā> Running in 629a1642eb30
[app] mount: /lib/firmware: mount point does not exist.
"