About multiboot

@myxal rootfs can be located on any device, boot can be on microSD, eMMC and NVMe, if it can boot via SPI. I have a hot bootable NVMe.
With android on one device, you can have bootable partitions for other OSs. I once did. But it’s easier to have an android on eMMC, and the boot partitions for other OSs on microSD. And today I just prepared a guide of this.

Multiboot with android
, if the android is on EMMC, and on the microSD my multiboot image or any Linux from radxa is flashed. SPI flash must be erased!
In this case, when microSD is installed, Linux will boot, when removed, the android will boot.
We insert microSD, load Linux and do the following commands:

Open here
cd ~; sudo su

DevEmmc=/dev/mmcblk$((`uname -r | sed 's/^\([4-5]\).*/\1/'`-3))
DevMicroSD=/dev/mmcblk$((`uname -r | sed 's/^\([4-5]\).*/\1/'`-4))

mkdir /mnt/1
mount ${DevEmmc}p13 /mnt/1
dd if=${DevMicroSD}p2 of=/mnt/1/2.img; sync
echo '#!/system/bin/sh' > /mnt/1/system/bin/re2
echo 'dd if=/2.img of=/dev/block/mmcblk0p2; sync' >> /mnt/1/system/bin/re2
echo 'reboot'  >> /mnt/1/system/bin/re2
echo >> /mnt/1/system/bin/re2
chmod +x /mnt/1/system/bin/re2
umount /mnt/1
rmdir /mnt/1

echo '#!/bin/bash' > rebootToAndroid.sh
echo "sudo dd if=/dev/zero of=${DevMicroSD}p2; sync" >> rebootToAndroid.sh
echo 'sudo reboot' >> rebootToAndroid.sh
echo >> rebootToAndroid.sh
chmod +x rebootToAndroid.sh

In android, we allow su, go to the terminal application, type su and then re2 and reboot into Linux.
In Linux, run rebootToAndroid.sh.

Make shortcut on mate