Good news on the hardware for this side project... I found two additional new-in-box "license claimed" MX65 units for sale on the cheap and so now have a couple more units to try not to brick like last time. 
So the first one, I did the usual first steps and got to the early stage of resetting into busybox and then backing up /dev/mtdblock0
onto a 8GB thumb drive with dd. Decided to enable term capture for logging the output, did so, then issued a reboot. I left the usb drive in the board, didn't manually unmount before reboot. When it came back up while watching the capture log via TTL connection, I see it's loading uboot as such:
U-Boot 2012.10 (May 04 2022 - 23:46:39)Meraki MX64 Boot Kernel Loader
Then a flood of unexpected output from Single STEP Calibration
, which ended with Log: DDR Tuning Complete
. Finally, it kicks over to a u-boot>
prompt after notifying that the following initramfs cannot be found:
1046 โ Volume kernel not found!
1047 โ (Re)start USB...
1048 โ USB: Before reset, USB clk enable register is: 000002dd
1049 โ Before reset, USB clk enable register is: 000002dd
1050 โ usb2_reset_state is: 00000000
1051 โ Register 1212 NbrPorts 2
1052 โ USB EHCI 1.00
1053 โ scanning bus for devices... 2 USB Device(s) found
1054 โ scanning bus for storage devices... 1 Storage Device(s) found
1055 โ reading openwrt-bcm53xx-generic-meraki_mx65-initramfs.bin
1056 โ ..
1057 โ ** Unable to read "openwrt-bcm53xx-generic-meraki_mx65-initramfs.bin" from usb 0:1 **
1058 โ Wrong Image Format for bootm command
1059 โ ERROR: can't get kernel image!
1060 โ u-boot>
So, according to the last thing I read about the initramfs, I was expecting the boot sequence to access openwrt-bcm5862x-generic-meraki_mx65-initramfs-kernel.bin
instead, which is on the mounted USB drive in the base directory. Grep'ing for the other initramfs file mentioned in the boot log, I see it over here in the USB drive's directory for the build process:
ยป grep -R "openwrt-bcm53xx" *
U-boot.MX64/include/configs/kingpin.h: "initramfs_filename=openwrt-bcm53xx-generic-meraki_mx65-initramfs.bin\0" \
Binary file uboot_mx65 matches
Some Process Reference Details
For posterity sake and reference, here's the directory/structure for the files that get moved over to the USB drive after formatting it to FAT32 w/ DOS partition table, along with the process I follow for formatting the drive and blah blah blah.
Given the bricking from the first device by using a problematic 32GB drive, I made sure to not use GPT and wipe the drive entirely before any use with the MX65. Process is scripted as such (sda is always a usb drive on the workstation as the other drives are all nvme).
ยป cat sda-refresh.sh
1 โ wipefs -a /dev/sda
2 โ sgdisk --zap-all /dev/sda
3 โ sgdisk --gpttombr /dev/sda
ยป sudo ./sda-refresh.sh
/dev/sda: 5 bytes were erased at offset 0x00008001 (iso9660): 43 44 30 30 31
/dev/sda: 8 bytes were erased at offset 0x00000200 (gpt): 45 46 49 20 50 41 52 54
/dev/sda: 2 bytes were erased at offset 0x000001fe (PMBR): 55 aa
/dev/sda: calling ioctl to re-read partition table: Success
Creating new GPT entries.
GPT data structures destroyed! You may now partition the disk using fdisk or other utilities
- Command overview during fdisk usage:
- DOS label is auto-added by fdisk because it has no part table yet
- create primary partition to full disk size, label it FAT32, write the changes, exit fdisk
- use ` sudo mkfs.fat -F 32
ยป sudo fdisk /dev/sda
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x7307a6dd.
Command (m for help): p
Disk /dev/sda: 29.9 GiB, 32080200192 bytes, 62656641 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x7307a6dd
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p):
Partition number (1-4, default 1):
First sector (2048-62656640, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-62656640, default 62656640):
Created a new partition 1 of type 'Linux' and of size 29.9 GiB.
Command (m for help): p
Disk /dev/sda: 29.9 GiB, 32080200192 bytes, 62656641 sectors
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 62656640 62654593 29.9G 83 Linux
Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): b
Changed type of partition 'Linux' to 'W95 FAT32'.
Disklabel type: dos
Disk identifier: 0x7307a6dd
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 62656640 62654593 29.9G b W95 FAT32
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
Now the big question...
So... does this look correct and/or expected w/re to the initramfs or should I modify the contents of the USB drive to include the mentioned file openwrt-bcm5862x-generic-meraki_mx65-initramfs-kernel.bin
instead of the openwrt-bcm5862x-generic-meraki_mx65-initramfs-kernel.bin
one?
Here are the SHA256 hashed of the newer bin file. I cannot locate the other file to generate a hash for it.
ยป openssl sha256 openwrt-bcm5862x-generic-meraki_mx65-initramfs-kernel.bin
SHA256(openwrt-bcm5862x-generic-meraki_mx65-initramfs-kernel.bin)= 9b3f5ac07ac6f0487fc7775c570df97b375808e466e80abc446765e07839440d
And the tree structure of the data that ends up on the USB drive:
[~/Downloads/Firmware/Cisco-Meraki-Firmware/meraki_mx65]
ยป tree -L 2
.
โโโ mx64
โ โโโ mtd
โ โโโ mtd-rw.ko
โ โโโ openwrt-bcm5862x-generic-meraki_mx64-initramfs-kernel.bin
โ โโโ openwrt-bcm5862x-generic-meraki_mx64.manifest
โ โโโ openwrt-bcm5862x-generic-meraki_mx64-squashfs-sysupgrade.bin
โ โโโ uboot_mx64
โโโ OpenWRT_MX64-MX65.rar
โโโ U-boot-MX64-20190430_MX65
โโโ openwrt-bcm5862x-generic-meraki_mx65-initramfs-kernel.bin
โโโ U-boot.MX64
โโโ uboot_mx65
โโโ uboot_mx65.sha512
โโโ uboot_mx65_small
โโโ uboot_mx65_small.sha512
Before continuing I want to validate/verify with @sumo and/or @clayface that this initramfs file is the expected version. I made sure to pull the most recent commit from the MX65 repo ( https://github.com/clayface/U-boot-MX64-20190430_MX65.git) but I don't see the openwrt-bcm53xx-generic-meraki_mx65-initramfs.bin
in the repo anywhere... just that uboot is complaining as such:
ยป tail -f mx65-dev-2.cap
Register 1212 NbrPorts 2
USB EHCI 1.00
scanning bus for devices... 2 USB Device(s) found
scanning bus for storage devices... 1 Storage Device(s) found
reading openwrt-bcm53xx-generic-meraki_mx65-initramfs.bin
..
** Unable to read "openwrt-bcm53xx-generic-meraki_mx65-initramfs.bin" from usb 0:1 **
Wrong Image Format for bootm command
ERROR: can't get kernel image!
u-boot>