There was free time and I designed my previous work in the form of a script.
Now the program can be used not only to create new partitions, but also to modify existing ones
Download, unzip to folder /usr/local/sbin/ and install kpartx
tar -xzvf make_multiboot_dev.sh.tar.gz -C /usr/local/sbin/
sudo apt install kpartx
Example of creating a multi-boot microSD device with three OS. Change /dev/sdz to own and change sizes depending on your needs and drive sizes:
sudo su
#---- Make GPT and flash uboot
make_multiboot_dev.sh --device /dev/sdz --uboot-file rockpi4b-ubuntu-bionic-minimal-20190104_2101-gpt.img
#---- Flash 3 OS
make_multiboot_dev.sh --device /dev/sdz --boot-size 128 --image-file rockpi4b-ubuntu-bionic-minimal-20190104_2101-gpt.img
make_multiboot_dev.sh --device /dev/sdz --image-file Armbian_20.02.0-rc0_Rockpi-4b_bionic_legacy_4.4.210_desktop.img
make_multiboot_dev.sh --device /dev/sdz --boot-size 512 --root-size 2048 --image-file LibreELEC-ARM-ALL.arm-9.80-devel-20200331083128-569f834-rk3399.img
An example of how to write a boot partion on microSD, and root on SSD
make_multiboot_dev.sh --boot-dev /dev/mmcblk0 --root-dev /dev/nvme0n1 --image-file Armbian_20.02.0-rc0_Rockpi-4b_bionic_legacy_4.4.210_desktop.img
Devices must have free space at the end.
You can use existing partions. In this case, free space is not needed, but the data on these partions will be erased. for instance
make_multiboot_dev.sh --boot-device /dev/mmcblk0p7 --root-dev /dev/nvme0n1p5 --image-file LibreELEC-ARM-ALL.arm-9.80-devel-20200331083128-569f834-rk3399.img
You can create one partion, use the other from the old.
With the --help switch, the program gives a hint.
Can currently be used OS : debian and ubuntu from radxa, Armbian… and LibreELEC…
Actions after the first start of radxa ubuntu
default login: rock password: rock
Don’t install rockchip-fstab !!!
sudo su
apt update && apt upgrade
apt install rockchip-overlay rockpi4b-rk-u-boot-latest rockpi4-dtbo # On the first question of confirmation of installation, press 'y', on the second question of the bootloader, press 'n' !!!
apt install ssh parted mc nano kpartx gdisk linux-base linux-4.4-latest
return_my_root_to_extlinux.sh
# check configs
cat /boot/extlinux/extlinux.conf
cat /etc/fstab
If ever a new kernel is installed during an apt upgrade, then always use return_my_root_to_extlinux.sh to restore the correct path to rootfs!