Skip to content

Commit

Permalink
Build from from rootfs.tar system files
Browse files Browse the repository at this point in the history
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.

It also adjusts the build process to allow using EROFS instead of squashfs when
making the firmware
  • Loading branch information
jjcarstens committed May 27, 2024
1 parent edabcc7 commit bc9a6cf
Show file tree
Hide file tree
Showing 5 changed files with 210 additions and 119 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
steps:
- run:
name: Install system dependencies
command: apk add --no-cache build-base procps
command: apk add --no-cache build-base procps git
- checkout
- run:
name: Install hex, rebar, and nerves_bootstrap
Expand Down
16 changes: 13 additions & 3 deletions lib/mix/nerves/preflight.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defmodule Mix.Nerves.Preflight do
# OSX
defp check_platform!(:darwin) do
ensure_fwup_version!()
ensure_available!("mksquashfs", package: "squashfs")
ensure_fs_tools!()
ensure_available!("gstat", package: "gstat (coreutils)")
end

Expand All @@ -35,13 +35,23 @@ defmodule Mix.Nerves.Preflight do
defp check_platform!(:wsl) do
ensure_fwup_version!()
ensure_fwup_version!("fwup.exe")
ensure_available!("mksquashfs", package: "squashfs")
ensure_fs_tools!()
end

# Non-WSL Linux
defp check_platform!(_) do
ensure_fwup_version!()
ensure_available!("mksquashfs", package: "squashfs")
ensure_fs_tools!()
end

defp ensure_fs_tools!() do
fs_type = Application.get_env(:nerves, :firmware, [])[:fs_type]

if fs_type == :erofs do
ensure_available!("mkfs.erofs", package: "erofs-utils")
else
ensure_available!("mksquashfs", package: "squashfs")
end
end

@doc """
Expand Down
Loading

0 comments on commit bc9a6cf

Please sign in to comment.