Skip to main content

Detect ARM boot signatures on storage devices

Project description

Bootinfo

This tool detects valid boot signatures on storage devices or debugging boot issues on ARM boards.

Supported platforms

  • Allwinner A64 (PinePhone, PineTab, etc...)
  • Rockchip RK3399 (Pinebook Pro, PinePhone Pro, Rockpro64)
  • Generic Amlogic (Should work on all meson platforms)

The bootinfo command

$ sudo bootinfo
Found 'Sunxi/Allwinner eGON header' on /dev/mmcblk0 offset 8192B
Found 'Sunxi/Allwinner eGON header far' on /dev/mmcblk2 offset 131072B
Found 'Sunxi/Allwinner eGON header mmcboot' on /dev/mmcblk2boot0 offset 0B
    /dev/mmcblk2boot0 is not marked bootable!

Detected a bootloader on the SD, one on the eMMC which is on another offset because GPT and a bootloader on the mmc boot hardware partition. The boot0 partition is not marked bootable which on Allwinner platforms will ignore the boot signature.

The wipeboot command

The wipeboot command is designed to have a similar interface to wipefs and allows quickly checking for a bootloader on a specific block device and also to wipe it.

$ sudo wipeboot /dev/mmcblk2
Found 'Sunxi/Allwinner eGON header far' on /dev/mmcblk2 offset 131072B

To clear the bootloader add the -a argument. This will zero out the first few bytes of the bootloader without touching any of the surrounding partition tables etc.

$ sudo wipeboot -a /dev/mmcblk2
Found 'Sunxi/Allwinner eGON header far' on /dev/mmcblk2 offset 131072B
Do you want to clean the 1 sectors containing boot signatures?
Enter to continue, ctrl+c to abort

If you want to temporarily disable the bootloader there's also the -i flag, this will invert all the bits of the bootloader signature, which will make it undetectable to the actual hardware but is a nice and reversible operation.

$ sudo wipeboot --all --invert /dev/mmcblk2
Found 'Sunxi/Allwinner eGON header far' on /dev/mmcblk2 offset 131072B
Do you want to clean the 1 sectors containing boot signatures?
Enter to continue, ctrl+c to abort

Inverted 8192 (Sunxi/Allwinner eGON header)

$ sudo wipeboot /dev/mmcblk2
Found 'Sunxi/Allwinner eGON header' on /dev/mmcblk2 offset 8192B (inverted)

$ sudo wipeboot --all --invert /dev/mmcblk2
... the same operation restores the bootloader

$ sudo wipeboot /dev/mmcblk2
Found 'Sunxi/Allwinner eGON header' on /dev/mmcblk2 offset 8192B

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bootinfo-0.1.0.tar.gz (17.1 kB view details)

Uploaded Source

File details

Details for the file bootinfo-0.1.0.tar.gz.

File metadata

  • Download URL: bootinfo-0.1.0.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.3 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.5

File hashes

Hashes for bootinfo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6c6f66cf36833ddbff886a58bcbaf00bc5126f948f1b1d9efb14af1a6e31e297
MD5 c487f086325d39c3c17495dd4738b770
BLAKE2b-256 ae445f2fdf1bb414bc521bbaa1ede61ea613c97ab24fd11da6d32ad90d95ac0a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page