I am building ubuntu core for imx8 based board. I want to copy Bluetooth firmware to the /etc/firmware directory in the filesystem. How can I do it from kernel snap?
At what time do you want to perform this copy? When the device is first booted/seeded?
You can do this with an install
hook and the system-files
interface to copy the files upon first boot.
well, except …
ogra@ubuntu:~$ ls -l /etc/firmware
ls: cannot access '/etc/firmware': No such file or directory
Ah good point, in that case it would need to be added to writable-paths first, then it could be exposed by system-files for your snap to write to it.
How to add something to writable-paths? Is there any documentation?
Just for the record, the usual place for all firmware is under /lib/firmware are you certain this is not the location you want?
Yes, hciattach (part of bluez stack) search for the firmware in /etc/firmware.
you should rather create a bluetooth helper snap with a patched hciattach that sets FIRMWARE_PATH to some place your helper snap can ship the FW … (similar to how we do it for the raspberry pi ) … or alternatively ship a patched hciattach and the firmware directly from a gadget …
Is there a reason you’re not using the upstream bluez snap instead?
I am installing the bluez snap using ‘snap install bluez’ command on ubuntu core 18. Isn’t it the way it should be done?