Reform-setup-encrypted-disk fails

Thank you for yours!

The situation is mysterious. But I have a new hunch. Could you confirm the following theory:

Your unit boots realiably if an sd-card is inserted. Without an sd-card, your screen remains black.

For example the serial output you collected. Did you collect it when you booted from an sd-card or was no sd-card in your unit when you collected it?

If your unit only boots when an sd-card is inserted, can you try flashing the reform-system-any image instead of the reform-system-rk3588-dsi image and try boot that?

If that does not work, could you try booting from the reform-system-rk3588-dsi image and run the following command:

sudo dd if=/dev/mmcblk0 of=boot.img bs=1048576 count=16

And then upload boot.img somewhere and share it here?

Yes, that’s right. My Reform only boots with an SD card. Without an SD card, the screen remains dark.

I collected the serial output when booting with an SD-Card.

The attempt with the image reform-system-any failed.

So I boot with reform-system-rk3588-dsi.img

I executed the “sudo dd if=/dev/mmcblk0 of=boot.img bs=1048576 count=16” command.

You can find the boot.img here:

Awesome, this is crucial information!

And this explains why it is like that. You can only boot your unit with an sd-card inserted because your emmc does not contain u-boot. Without a bootloader your unit cannot boot. rk3588 is able to fall back to loading u-boot from sd-card and this is why it only boots for you when an sd-card is inserted – except with the reform-system-any image which does not contain u-boot.

So I had a look at the first 16MBit of your eMMC. It contains a MS DOS partition table with a 27.4G linux partition but the partition starts at an offset of 1 MiB. Did you manually partition your eMMC?

You can flash u-boot to eMMC by running sudo reform-flash-uboot emmc but that will be no good in your case because the first partition on your eMMC starts much too early. The next time you do anything on that partition it will overwrite u-boot.

If you don’t mind wiping your eMMC, then you can restore it to factory settings by booting from an sd-card, connecting the system to the internet and then running sudo reform-flash-rescue. That wil install a rescue system to eMMC and that will include u-boot and the first partition will only start at 16 MiB which leaves enough room for the bootloader.

I am not aware of this, but given the many attempts I have made, I cannot rule it out either.

Here is the terminal recording:

micha@reformmk:~$ sudo reform-flash-rescue
[sudo] password for micha: 
W: Flashing u-boot to eMMC on MNT Reform 2 with RCORE-DSI RK3588 Module is not without risk.
W: If you flash the wrong u-boot or if the flashing process goes wrong, it is
W: possible to soft-brick your board. Restoring it might need some extra hardware.
W: Please only proceed if you are sure that the benefits outweigh the risks for you.
Are you sure you want to proceed? [y/N] y
WARNING: This overwrites the bootloader on the eMMC rescue disk with the
backup stored as /boot/flash.bin!
Are you sure you want to proceed? [y/N] y
the first partition on /dev/mmcblk0 starts at 1048576 and would be overwritten by uboot
make sure that the first 9469440 bytes are free on /dev/mmcblk0
micha@reformmk:~$ 

Whoops, sorry for that. You ran into a bug with reform-flash-rescue which is tripped in cases where eMMC already contains a partition which starts too early. The simple workaround is to just nuke your partition table:

sudo dd if=/dev/zero of=/dev/mmcblk0 bs=512 count=1

After doing that, try running reform-flash-rescue again.

I’ll fix this with the next upload of reform-tools. Sorry again, your case is a bit unique and didn’t happen before. :slight_smile:

2 Likes

It’s working again!

I really admire your persistence and helpfulness! Especially on a Sunday.

Thanks a million, Josch!

4 Likes