I was looking into reform-flash-uboot and I don’t believe it currently works as written:
$ sudo reform-flash-uboot
Usage:
reform-flash-uboot [--offline] [device...]
/usr/sbin/reform-flash-uboot: 59: MMC_BOOT: parameter not set
I believe the intent is that this parameter be set by sourcing from /usr/share/reform-tools/machines/, but none of the definitions there define MMC_BOOT. I’d make a pull request but I’m not sure what the intent of this parameter is.
Additionally, it’s easy to make parted hang indefinitely in this script by providing an argument that doesn’t exist in /dev, since in that case it prompts for instruction:
$ sudo parted --machine asdf unit B print
Error: Could not stat device asdf - No such file or directory.
Retry/Cancel?
I’d suggest a change like:
diff --git a/sbin/reform-flash-uboot b/sbin/reform-flash-uboot
index bab7019..5ccb662 100755
--- a/sbin/reform-flash-uboot
+++ b/sbin/reform-flash-uboot
@@ -134,7 +134,7 @@ for dev in "$@"; do
fi
# no further tests for disks without a partition table
- if [ "$(parted --machine "$dev" unit B print 2>/dev/null | grep "^$dev:" | cut -d: -f 6)" = unknown ]; then
+ if [ "$(parted --script --machine "$dev" unit B print 2>/dev/null | grep "^$dev:" | cut -d: -f 6)" = unknown ]; then
continue
fi
This raises a question for me, though: is reform-flash-uboot (either with no arguments or with emmc) supposed to do anything on Pocket Reform? Since EMMC_BOOT and SD_BOOT are both false:
~/source/reform-tools$ sudo ./sbin/reform-flash-uboot
Usage:
reform-flash-uboot [--offline] [device...]
Download and write recent uboot to chosen device.
Without arguments only /boot/flash.bin will be updated unless --offline is given.
Otherwise, the arguments are the devices onto which to install uboot.
~/source/reform-tools$ sudo ./sbin/reform-flash-uboot emmc
E: writing uboot to eMMC not supported on MNT Pocket Reform with i.MX8MP Module
@andypiper already tried out my patched u-boot on their pocket reform (thank you!) but without success, sadly.
So maybe in the future we want to allow flashing a newer u-boot version onto emmc on the imx8mplus but right now, this would likely soft-brick your device. If you want to help, there is definitely enough stuff to do to make this all work better.
Thanks for explaining! I didn’t realize there wasn’t a way to update u-boot as is; I have a handful of other things to look into on my list but I may be able to look into it eventually