nerves-project / nerves

Craft and deploy bulletproof embedded software in Elixir
http://nerves-project.org
Apache License 2.0
2.23k stars 189 forks source link

Build from from `rootfs.tar` system files #978

Open jjcarstens opened 3 months ago

jjcarstens commented 3 months ago

Starts support to allow building firmware from a rootfs.tar tarball file more efficiently in Elixir, rather than relying on bash scripts to unsquash, combine, and resquash an FS.

The mix firmware task was due for a good refactoring, so it looks like a lot. The old way of building is maintained for the typical rootfs.squashfs file that systems have traditionally provided.

It also adjusts the build process to allow using EROFS instead of squashfs when making the firmware

[!NOTE] This adds config :nerves, :firmware, fs_type: :erofs to specify to use EROFS. If there is a preferred option name and/or location, let me know

Other pieces to still consider:

fhunleth commented 3 months ago

Cool! Thank you. I believe tar_merger is still private so I'll copy over and rename. It has a number of deficiencies that I forgot to tell you about but it's getting close and this will definitely help me.

jjcarstens commented 3 months ago

I added a few more notes. This could probably be split into 2 PRs for the EROFS concern, but after the redact that piece is so small that it could really go either way ¯_(ツ)_/¯

I've tested manually, but probably worth adding some tests if I can think of a good way how