lawik

lawik

Nerves Core Team

How to investigate failing mix upload

I built the nerves container repo for rpi4.

Building the firmware went fine. The target device is a CM4 that is running Nerves, happily.

Could it be a partition resize or something?

lawik@monolith:~/nervescloud/contain$ ./upload.sh nerves-7170.local
Path: ./_build/nerves_containers_rpi4_dev/nerves/images/contain.fw
Product: contain 0.1.0
UUID: 5b76be06-ce28-55b8-b55f-d71226ae873f
Platform: rpi4

Uploading to nerves-7170.local...
fwup: Please check the media being upgraded. It doesn't look like either the A or B partitions are active.

I don’t know how to dig in and do what it is asking me to do. Check the media :smiley:

Marked As Solved

fhunleth

fhunleth

Co-author of Nerves

The rpi4 fwup.config still uses partition offsets to determine whether it’s running off the A or B partition. See this line for requiring that the partition offset be the B partition’s offset for a partition A update to happen.

One way to fix this is to use something else to determine which partition is active. For example, you could delete that line and add this instead to check the U-Boot environment variable that Nerves.Runtime.KV sees (also make the corresponding change for upgrading the a partition):

require-uboot-variable(uboot-env, "nerves_fw_active", "b")

However, before you do this, make sure that your new A or B partitions don’t overlap with the old ones. If they do, you could be overwriting the partition that you’re running off of to perform the update.

It’s pretty tricky to deploy firmware updates that enlarge root file systems. Hopefully you don’t have to do this on remote devices. If I had to do this on a lot of devices, I’d looks to see how much can be done with the padding between filesystems. If the partitions are back-to-back with no room to grow (like the default rpi4 ones), then I’d look into ways to avoid growing them. If there were no way, then I think that’s I’d create a firmware with an initramfs that knows how to move everything. I’d use an initramfs so that Linux won’t have mounted the root or data partitions that would be moved.

Hope that helps.

Where Next?

Popular in Questions Top

greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 41989 114
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New

We're in Beta

About us Mission Statement