koleto
I am trying to deploy I simple text file on a Nerves BBB device application partition. For this I created custom config/fwup.conf where I add an custom file-resource just below the rootfs.img like this:
file-resource test.txt {
host-path = "${NERVES_APP}/config/test.txt"
}
The text file is also under config/test.txt
In the task upgrade.b …
on-resource test.txt { fat_write(${ROOTFS_B_PART_OFFSET}, "test.txt") }
When I start ./upload.sh I get fwup message:
./upload.sh
Path: ./_build/bbb_dev/nerves/images/hello_nerves.fw
Product: hello_nerves 0.1.0
UUID: 4cc602a0-71dc-5398-5a5c-bf4727494331
Platform: bbb
Uploading to nerves.local...
Running fwup...
fwup: Upgrading partition B
fwup: Can't open file on FAT partition(test.txt): FATFS: There is no valid FAT volume
Is there a way deploy a file or file bundle resource on the application partition?
Trending in Questions
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
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
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
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
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted”
Version...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
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
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 4- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
fhunleth
Hi Koleto,
There are several ways of putting files on Nerves devices. Here are the compile-time ways:
privdirectory. Then use:code.priv_dir/1orApplication.app_dir/2to get a path to it. The file will be read-only on the device.rootfs_overlay. This lets you put a file in any directory on the root filesystem. It will still be read-only.fwup.confto add a file to the boot partition. Unless you need to modify the bootloader or update kernel device tree overlays, I’d stay away from this. The boot filesystem is small and since your device depends on it to boot up, it’s generally a good idea to leave it be.I highly recommend sticking with option 1 if you can.
If you need a file to be writable, the recipe is to add code to your app that initializes files or directories under
/root. For example, if you have a sqlite database that’s been pre-seeded, you’d add the database file to aprivdirectory. Then at run time, you’d check if/root/mydb.sqlite3exists. If not, you’d copy over the pre-seeded one from yourprivdirectory.When the device is running, you can run
sftpto get and put files on the device.If none of these options works for you, let me know more about the constraints on the files that you have.
koleto
Thank you very much! It was very useful information. I tried rootfs_overlay to put just a text file in /tmp and /opt but somehow I was not able to find the file after flashing the firmware. The firs method is the one I still have to try. I am evaluating Nerves for building a logging system on top of CouchDB. The idea is to have continues replication with another CouchDB server, and still make logging on a write partition. I build similar system working already for 3 years 24/7 but still experiencing some minor problems that I hope to overcome with Nerves. Unfortunately I didn’t found any information on including CouchDB to Nerves, so I build CouchDB release to try to mount as a file bundle on Nerves BBB without modifying the image itself. This is the reason why I tried first to use fwup.
fhunleth
The
rootfs_overlaycan put a file most places, but anything in/tmpwon’t be visible since atmpfsfilesystem is mounted there. The other special locations are/proc,/sys, and/dev./optshould have worked. Of course, usingprivdirectories is still better since it’s namespaced and keeps with Erlang/OTP conventions.Since it sounds like you’re just making one device, running
sftpto copy your current database on/rootwould be easiest, right? Or could the database magically replicate there if you start CouchDB with an empty database there.Frank
koleto
sftp is working very well I don’t know why I didn’t try this by myself it is probably because I try to use scp but this didn’t work. For my first test evaluation sftp is working perfect…
Thank you Frank!