swishy
FWUP && VIM3 target - corrupting the written image
Kia ora All, I’m currently porting nerves to the Khadas VIM3 board and have got to the point its booting fine however fwup appears to be corrupting the written image - I have tested both fwup 1.13.2 and fwup 1.14.0 -
Khadas VIM3 (AMLogic A311D)
Mainline U-Boot 2024.01 (512-byte offset for SD card)
MBR partition layout with bootloader at sector 1 (512-byte offset)
Kernel panics with VFS: Unable to mount root fs on unknown-block(179,2)
The generated .fw image however contains a mountable squashfs filesystem
Corruption appears to occur with both mix burn and mix firmware.image - file headers appear intact but data is corrupted on raw_write() to root partition after byte 35 onward. Its reproducible using both zip and xz compression.
At the moment I’m getting a boot-able image by extracting the generated .fw file and using dd to write to sdcard
e.g. dd if=/dev/sda2 of=/tmp/extracted.img bs=512 count=524288
Passing the following in target.ex to use xz compression
config :nerves, :firmware,
mksquashfs_flags: [“-no-xattrs”, “-quiet”, “-comp”, “xz”]
I’m assuming its something stupid I’m doing, any insights would be appreciated.
Dale.
Most Liked
swishy
Ok funny story - fresh checkout with your fix and it now boots fine using mix burn
, feel like the cache gremlins have bitten me again lol
lawik
How are you flashing the device?
Does it show up as a USB mass storage device or how sre you using fwup/dd to write to it?
fhunleth
Hi @swishy,
It would be helpful if you could sharing your project that reproduces the issue.
Normally when people report corruption issues, they’re due to having some other part of the fwup.conf overwrite the part that’s getting corrupt. That’s what I’d check.
Using xz or gzip for SquashFS compression shouldn’t make a difference, but I’d stick with gzip to minimize the number of changes you’re making.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









