balena inject on jetson-nano device_type causes error `Invalid MBR boot signature`

  • Balena cli version: 12.44.24
  • Device type jetson-nano - Nano SD-Card version
  • Balena OS
    • 2.75.0+rev1
    • 2.69.1+rev1
    • 2.67.3+rev2

Manipulating the .img provided by the balena dashboard as such:

sudo balena config write --type jetson-nano --drive balena-cloud-staging-linux-armv8-l4t-t210-jetson-nano-2.75.0+rev1-dev-v12.5.10.img.zip  os.udevRules.101 "ACTION==\"add\", SUBSYSTEMS==\"usb\", RUN+=\"/usr/sbin/nvpmodel -m 0\"" --debug

or

sudo balena config inject ./staging-linux-armv8-l4t-t210.config.json --drive ./balena-cloud-staging-linux-armv8-l4t-t210-jetson-nano-2.75.0+rev1-dev-v12.5.10.img.zip --type jetson-nano

Fail with:

Invalid MBR boot signature. Expected 0xAA55, but saw 0x501A

SyntaxError: Invalid MBR boot signature. Expected 0xAA55, but saw 0x501A
    at Function.MBR.detectFormat (/snapshot/versioned-source/node_modules/mbr/lib/mbr.js:73:11)
    at Function.MBR.parse (/snapshot/versioned-source/node_modules/mbr/lib/mbr.js:54:20)
    at new MBR (/snapshot/versioned-source/node_modules/mbr/lib/mbr.js:12:16)
    at getPartitionsFromMBRBuf (/snapshot/versioned-source/node_modules/partitioninfo/build/partitioninfo.js:36:12)
    at getDiskPartitions (/snapshot/versioned-source/node_modules/partitioninfo/build/partitioninfo.js:88:24)

The expected MBR boot signature in the error stays the same across all Balena OS versions, but the found signature changes:

  • 2.75.0+rev1: Expected 0xAA55, but saw 0x501A
  • 2.69.1+rev1: Expected 0xAA55, but saw 0x66BC
  • 2.67.3+rev2: Expected 0xAA55, but saw 0xDCC9

I just tried it with a jetson-tx2 device type as well, same issue.

Ahh, this does not work on the .zip files that one downloads from the Dashboard.
The solution is to unzip the image first.

Would be great to either support a .zip or get a nicer error message. @pdcastro

Thanks for the suggestion! As part of this PR we added an additional warning if a zip file is detected by balena preload: preload: Catch sfdisk errors that result in an endless spinner by klutchell · Pull Request #2283 · balena-io/balena-cli · GitHub

I guess we should do the same for balena config inject/write! I’ve opened this issue for tracking and we can notify you on this thread when a fix is released!

1 Like