vsubbiah

vsubbiah

I am trying to burn image to SD using mix firmware and it fails as below. Looks like some invalid options are being passed to mksquashfs. Wondering how I can get the full mksquashfs being used, so that I can debug this further.

venkat@XPS-8930:~/work/pp/nerves/bb/nerves_system_bbb/test_bb$ mix firmware --verbose
==> nerves
==> test_bb

Nerves environment
  MIX_TARGET:   bbb
  MIX_ENV:      dev

Generated test_bb app
|nerves| Building OTP Release...

* [Nerves] validating vm.args
* skipping runtime configuration (config/runtime.exs not found)
* creating _build/bbb_dev/rel/test_bb/releases/0.1.0/vm.args
Updating base firmware image with Erlang release...
Copying rootfs_overlay: /home/venkat/work/pp/nerves/bb/nerves_system_bbb/test_bb/_build/bbb_dev/nerves/rootfs_overlay
Copying rootfs_overlay: /home/venkat/work/pp/nerves/bb/nerves_system_bbb/test_bb/rootfs_overlay
mksquashfs: invalid option

SYNTAX:mksquashfs source1 source2 ...  dest [options] [-e list of exclude
dirs/files]

Filesystem build options:

Showing Posts 1 to 7

fhunleth

fhunleth

Co-author of Nerves

We very recently fixed this so that it would be easier to see mksquashfs errors, but I don’t think that update will be out until midweek.

You are getting an unexpected error, though. It looks like you’re using Linux. What version of mksquashfs are you using?

vsubbiah

vsubbiah OP

Thanks for much for you help.
Yes, I am using Linux (Ubuntu 18.04)
Below is info on version of mksquashfs.

~/work/pp/nerves/bb/test_bb$ mksquashfs -version
mksquashfs version 4.3-git (2014/06/09)
vsubbiah

vsubbiah OP

I was trying to debug the mksquashfs error. I think mksquashfs is called from deps/nerves_system_br/scripts/rel2fw.sh.

But when I make changes in that file it doesn’t change the build.

I changed this line
echo "VS Copying rootfs_overlay: $OVERLAY" to add a prefix MyDebug echo "MyDebug Copying rootfs_overlay: $OVERLAY" but when I do ```mix firmware`````` it doesn’t print the addedd prefix MyDebug.

Wondering how can we make changes in this script to add additional debug

vsubbiah

vsubbiah OP

I can confirm that this error is due to version of squashfs-tools. Upgraded to a later version of squashfs-tools using procedure below and this fixes the issue.

git clone https://github.com/plougher/squashfs-tools.git
cd squashfs-tools
git checkout 4.6.1
cd squashfs-tools
make
sudo make install

It would still be good, if I can get help on how to add additional debug to the scripts.

jjcarstens

jjcarstens

Nerves Core Team

Which version of nerves_system_br was being used in this test? The ability to see mksquashfs errors as part of the output was released a while ago and the latest Nerves systems have that included (needs nerves_system_br >= 1.23.1. Likewise, where you were putting those log lines matter. You were most likely not seeing those debug prints because the were behind an if check on rootfs_overlays which are not always present.

Likewise, it seems your error was on this line with merge-squashfs. Looking at your output above, it seems like you were getting the stderr from that:

mksquashfs: invalid option

SYNTAX:mksquashfs source1 source2 ...  dest [options] [-e list of exclude
dirs/files]

Filesystem build options:

Unfortunately, that is from mksquashfs tool directly so up to them for providing helpful out.

rel2fw.sh was the right place to add

vsubbiah

vsubbiah OP

deps/nerves_system_br/scripts/rel2fw.sh doesn’t seem to be script that is being used.

I am able to run mix firmware succesfully even after deleting deps/nerves_system_br/scripts/rel2fw.sh
Below are logs.

venkat@XPS-8930:~/work/pp/nerves/ne1/blinky$ rm deps/nerves_system_br/scripts/rel2fw.sh

venkat@XPS-8930:~/work/pp/nerves/ne1/blinky$ ls -al deps/nerves_system_br/scripts/rel2fw.sh
ls: cannot access 'deps/nerves_system_br/scripts/rel2fw.sh': No such file or directory

venkat@XPS-8930:~/work/pp/nerves/ne1/blinky$ mix clean
==> nerves
==> blinky

Nerves environment
  MIX_TARGET:   bbb
  MIX_ENV:      dev

venkat@XPS-8930:~/work/pp/nerves/ne1/blinky$ mix firmware
==> nerves
==> blinky

Nerves environment
  MIX_TARGET:   bbb
  MIX_ENV:      dev

Compiling 2 files (.ex)
Generated blinky app
|nerves| Building OTP Release...

* [Nerves] validating vm.args
* skipping runtime configuration (config/runtime.exs not found)
* creating _build/bbb_dev/rel/blinky/releases/0.1.0/vm.args
Updating base firmware image with Erlang release...
Copying rootfs_overlay: /home/venkat/work/pp/nerves/ne1/blinky/_build/bbb_dev/nerves/rootfs_overlay
Copying rootfs_overlay: /home/venkat/work/pp/nerves/ne1/blinky/rootfs_overlay
Building /home/venkat/work/pp/nerves/ne1/blinky/_build/bbb_dev/nerves/images/blinky.fw...
Firmware built successfully! 🎉

Now you may install it to a MicroSD card using `mix burn` or upload it
to a device with `mix upload` or `mix firmware.gen.script`+`./upload.sh`.

Below is section of output mix deps.tree which show I am using nerves_system_br 1.23.2

venkat@XPS-8930:~/work/pp/nerves/ne1/blinky$ mix deps.tree
...
├── nerves_system_bbb ~> 2.8 (Hex package)
│   ├── nerves ~> 1.6.0 or ~> 1.7.15 or ~> 1.8 (Hex package)
│   ├── nerves_system_br 1.23.2 (Hex package)
│   └── nerves_toolchain_armv7_nerves_linux_gnueabihf ~> 1.8.0 (Hex package)
│       ├── nerves ~> 1.0 (Hex package)
│       └── nerves_toolchain_ctng ~> 1.9.3 (Hex package)
│           └── nerves ~> 1.0 (Hex package)
vsubbiah

vsubbiah OP

I found that the script being used is ~/.nerves/./artifacts/nerves_system_bbb-portable-2.18.1/scripts/rel2fw.sh.

By making changes there and also in ~/.nerves/artifacts/nerves_system_bbb-portable-2.18.1/scripts/merge-squashfs I am able to gain insights into how squashfs is being used.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews