About multiboot

You should not pay attention to this message. I’ll try to remove it.

This uboot is designed for SPI. write ubootl from radxa debian or ubuntu.

under what OS you this make?

:+1:

I wrote u-boot from Radxa Debian image to eMMC, but it was incompatible with mbr partitions, and failed to boot Slarm64 or Armbian on SD card.

I have an install of Radxa Debian which is updated, will try to use u-boot from there.

I tried from 2 OS, Slarm64 and Armbian Debian buster. Both gave same result.

Thanks.

hm …

LABEL slarm64
  LINUX /Image
  FDT /dtb/rk3399-rock-pi-4.dtb
uname -a
Linux rockpi-4b 5.4.28-rockchip64 #20.02.7 SMP PREEMPT Sat Mar 28 17:07:03 CET 2020 aarch64 GNU/Linux

Armbian_20.02.7_Rockpi-4b_buster_current_5.4.28_desktop

what version of the script you use?

Script with Version 1.2c

With u-boot from updated Radxa Debian image, the serial console works. However it does not boot. Output:

Load uboot, ReadLba = 4000
Load OK, addr=0x200000, size=0xef1e8
RunBL31 0x10000
NOTICE:  BL31: v1.3(debug):0e7a845
NOTICE:  BL31: Built : 16:13:46, Apr 17 2019
NOTICE:  BL31: Rockchip release version: v1.1
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 0
INFO:    plat_rockchip_pmu_init(1181): pd status 3e
INFO:    BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9


U-Boot 2017.09-2686-g18c70dba63 (Dec 31 2019 - 12:34:04 +0000), Build: jenkins-linux-build-testing-2-136

Model: Rockchip RK3399 rockpi4b Board
PreSerial: 2
DRAM:  3.9 GiB
Relocation Offset is: f5bdf000
Sysmem: init
I2c speed: 400000Hz
PMIC:  RK808 
vdd-center init 950000 uV
MMC:   dwmmc@fe320000: 1, sdhci@fe330000: 0
Using default environment

Model: Rockchip RK3399 rockpi4b Board
Bootdev(atags): mmc 0
PartType: EFI
get part misc fail -1
boot mode: None
init_resource_list: failed to get boot part, ret=-1
init_resource_list: failed to get resource part, ret=-1
Can't find file:logo.bmp
failed to display uboot logo
CLK: (uboot. arml: enter 816000 KHz, init 816000 KHz, kernel 0N/A)
CLK: (uboot. armb: enter 24000 KHz, init 24000 KHz, kernel 0N/A)
  aplll 816000 KHz
  apllb 24000 KHz
  dpll 800000 KHz
  cpll 24000 KHz
  gpll 800000 KHz
  npll 600000 KHz
  vpll 24000 KHz
  aclk_perihp 133333 KHz
  hclk_perihp 66666 KHz
  pclk_perihp 33333 KHz
  aclk_perilp0 266666 KHz
  hclk_perilp0 88888 KHz
  pclk_perilp0 44444 KHz
  hclk_perilp1 100000 KHz
  pclk_perilp1 50000 KHz
Net:   eth0: ethernet@fe300000
Hit key to stop autoboot('CTRL+C'):  0 

Device 0: unknown device
MMC: no card present
mmc_init: -123, time 0
switch to partitions #0, OK
mmc0(part 0) is current device
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   failed to get usb phy
Port not available.
USB3:   failed to get usb phy
Port not available.
USB4:   Can't get the usbphy register address
probe failed, error -6
USB5:   Can't get the usbphy register address
probe failed, error -6
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device
ethernet@fe300000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Could not initialize PHY ethernet@fe300000
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/01-ae-1e-19-20-55-6d
ethernet@fe300000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Could not initialize PHY ethernet@fe300000
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
ethernet@fe300000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Could not initialize PHY ethernet@fe300000

My mistake. While trying to update u-boot, looks like I made a typo and deleted the image partitions.

Here is the output while flashing Radxa Debian, one warning:

Size of image BOOT partition is 512 MiB
it flash into partition with size 512 MiB
Size of image ROOT partition is 3051 MiB
it flash into partition with size 8192 MiB

Type Y/y to continue or Ctrl-C to abort.
y
Work with partitions  ...
++++++++++++++++++++++++++++++++++++++++++++++++++++
Attention! If the program does not end with the phrase 'End Of Script' then manually do 'umount /tmp/{1..4}', 'rmdir /tmp/{1..4}'
and remove partions:  /dev/mmcblk2p4 /dev/mmcblk2p5
++++++++++++++++++++++++++++++++++++++++++++++++++++
Files are copied, wait ...
rm: cannot remove '/tmp/2/etc/FIRST_BOOT': No such file or directory

After flashing it worked, and was booted to the Radxa Debian image!

Thank you @rua1! :innocent:

Will try with more images now.

1 Like

Full output while flashing Slarm64:

# ../downloads/make_multiboot_dev.sh --device /dev/mmcblk2 --boot-size 1024 --root-size 10240 --image-file slarm64-current-aarch64-xfce-rootfs-14Dec19-5.4.6-rock_pi_4-build-20191222.img 

Size of image ROOT partition is 5684 MiB
it flash into partition with size 10240 MiB

Type Y/y to continue or Ctrl-C to abort.
y
Work with partitions  ...
++++++++++++++++++++++++++++++++++++++++++++++++++++
Attention! If the program does not end with the phrase 'End Of Script' then manually do 'umount /tmp/{1..4}', 'rmdir /tmp/{1..4}'
and remove partions:  /dev/mmcblk2p6 /dev/mmcblk2p7
++++++++++++++++++++++++++++++++++++++++++++++++++++
Files are copied, wait ...
---------/boot/*Env.txt :
verbosity=4
console=both
fdtfile=rk3399-rock-pi-4.dtb
rootdev=/dev/mmcblk1p1
---------found RockPi4 fdt files :
/dtb/rk3399-rock-pi-4.dtb
--------- extlinux.conf :
LABEL slarm64
  LINUX /Image
  FDT /dtb//tmp/1/dtb/rk3399-rock-pi-4.dtb
  APPEND root=PARTUUID=75eed00b-3ffd-4562-9f40-e7e0d5f1557c rw rootwait console=ttyS2,1500000  
---------- /etc/fstab :
#
# /etc/fstab: static file system information
#
# <file system>        <mount point>   <type>  <options>                        <dump> <pass>
shm                    /dev/shm        tmpfs   defaults                         0      0
devpts                 /dev/pts        devpts  noexec,nosuid,gid=tty,mode=0620  0      0
sysfs                  /sys            sysfs   defaults                         0      0
proc                   /proc           proc    defaults                         0      0
#
#/dev/#EXT4FS_BOOT#    /boot           ext4    errors=remount-ro                0      1
#/dev/#SWAP#           swap            swap    defaults                         0      0
#/dev/#EXT4FS_ROOT#    /               ext4    errors=remount-ro                0      1
#/dev/#EXT4FS_HOME#    /home           ext4    defaults                         0      2

UUID=9f4441e4-07f0-4ee9-91ae-640ca1429c22  / ext4     noatime,nodiratime,data=writeback,errors=remount-ro       0       1
UUID=0629b095-d61d-4ba3-8676-adc896d2efd1 /boot ext2 defaults 0 0

loop deleted : /dev/loop0
  -= All OK =-
-= End Of Script =-

This one also booted.

However there was no console output on tty1, so I made some changes to extlinux.conf based on studying boot.scr.bak:

#  APPEND root=PARTUUID=75eed00b-3ffd-4562-9f40-e7e0d5f1557c rw rootwait console=ttyS2,1500000  
  APPEND root=PARTUUID=c1f2eb7f-064b-40e4-9826-c174658e065e ro rootwait console=ttyS2,1500000 consoleblank=0 earlyprintk console=tty1 loglevel=4

Comment part is before, uncommented part is after.
Also changed rw to ro since Slarm64 uses it for checking the partition and then remounts it after check.

@rua1, maybe you could upload your script to gitlab? Can send you pull request there!

Thanks again for your work. :innocent:

1 Like

@aaditya Thanks a lot for testing! I apologize for not posting announcements of new versions here. did not see much interest from other people. Now version 1.3 is located on the same link, maybe with it you will not have an error /dtb//tmp/1 …

Thanks again, I had to check in the script for the file first;). I was mistaken in the fact that all radxa OSs are built in the same way. I tested mainly on ubuntu.
In some OSs I got rid of the system extension to the entire disk (ubuntu, manjaro,
slarm, LibreELEC).

I will try to make these changes in the script … but … in the latest versions of the script the option –extlinux-conf-file where you can put the “skeleton” of a file suitable for you. You can share these files in this thread :slight_smile:

The idea is very good, but I need to study this technology, then there may not be time left to work on the script itself;)

.

1 Like

Its a technical topic, so users may take some time to digest. The script is a good way to make it easier. Thanks for that. :hugs:

I tested Radxa Debian, Slarm64, and Armbian Buster. All worked. Will test Manjaro ARM with the updated script.

Nice! Useful for automated usage. I studied and made changes manually since it was simple to compare and modify.

When you have some free time, there are tutorials to make it simple: :slightly_smiling_face:

For git: https://rogerdudler.github.io/git-guide/

For gitlab: https://about.gitlab.com/get-started/

It can help to keep track of changes, different features, documentation, issues faced, etc.

Edit-
Installed Manjaro ARM and Slarm64 using updated script 1.3a, worked fine. The FDT was written correctly for Slarm64, so I think its fixed. Nice work!

Now the link is version 1.4. Unlike previous versions, to create a new GPT you need to add the option –create-new-gpt or -c. The -t option (–test-mage) allows you to test the image. Shows boot and root sizes and contents of some files.
The -p option (–pause-before-umount) pauses both when testing the image and when creating a new OS. You can open a new terminal window and work with files in /tmp/1 and /tmp/2. Then you need to close all open files, if mc was used, go beyond the tmp/ directories, return to the first window and press Enter there to close all files.
If the script is running on rockpi, then the devices can be set by the names: emmc, microsd, nvme. for example, to create a new GPT with empty uboot you can specify the options: -d microsd -c. For backup uboot: -d emmc --backup-uboot. To install the new OS into the already existing partitions of the appropriate size from the system of the unnecessary OS: -b microsd -n 4 -r nvme -m 5 -i OSxxxx.img. Short options are provided. For hints, use -h
The script is now tested with radxa ubuntu & debian, Armbian, LibreELEC, Manjaro, slarm64 and DietPi. For these OS, you must save the original beginning of the file name. If the script does not recognize the OS by name and it does not have extlinux.conf, then the work will stop. If there is a file, then there will be an attempt to install the OS. The extlinux.conf file can be added (or replaced by an existing OS image) using the –extlinux-conf-file option.
I kind of realized all the necessary tasks for myself in the script and now I will only fix errors … maybe ;).

1 Like

Hi. Apologies in advance for disturbing again.
I would like to create a multiboot with Debian, Armbian and Manjaro, on an empty nvme disk. I am working on Rockpi4b.
1-download the scrip in / usr / local / sbin / and install kpartx.
2- I download all the images
3-do I have to replace something in the script? Or do I have to run the script for each operation, one by one? Thanks.

yes . Run it once with options: -d nvme -c , and then -d nvme -z 15000 -i OSxxx.img for each OS, setting instead of 15000 the required root partition size in MiB

p.s. Better to do in the sequence that you indicated. Debian first, last manjaro

2 Likes

Después de flashear funcionó, y se arrancó a la imagen de Radxa Debian!

Gracias @ rua1 !:inocente:

True, debian starts, but you cannot create a user or change a password, among other problems. Manjaro starts, but it has a bug with the wifi, the same with dietpi. the only one that works well is armbian, for now.

Blockquote

The main thing is that you have mastered the technology multiboot. Instead of an unnecessary OS, you can install another one. For example, instead of Debian, install ubuntu with options: -d nvme -n 4 -m 5 -i OSxxx.img

As is, we are learning from the patience of those who know. Thank you

Hi. I’m trying to install Twister-OS with the multiboot script, but I get the following error:

Files are copied, wait …
[Error] Unknown OS without extlinux.conf file

How do I solve it?

I don’t know how to do this.

Sorry, I’ve been busy for a long time. Today I installed Twister in multiboot. Working. If you’re still interested, I can post my extlinux.conf

Yes, it would be interesting to have your extlinux.conf

I did it this morning, maybe I need to fix something … but they work

LABEL Twister
  LINUX /Image
  INITRD /uInitrd
  FDT /dtb/rockchip/rk3399-rock-pi-4b.dtb
  APPEND root=UUID=539f2380-6341-4ab7-ac9e-a44f646d0d4a rw rootwait console=ttyS2,1500000  overlay_prefix=rockchip rootfstype=ext4 usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u,0x1058:0x25a2:u

I already have several 512 MB partitions on the microsd, and on nmve there are several ~ 20GB partitions, on which I put systems for tests. Therefore, the installation looked like this for me:

./make_multiboot_dev.sh -b microsd -n 7 -r nvme  -m 5 -p -i Twister_OSArmbianV1-0-0.img --extlinux-conf-file extlinux_twister.conf

Renamed the image file in order for the script to make short partitions labels names.

2 Likes

To simplify the selection of a partition for loading, I made a script. To work, you need the parted utility
The partition name must contain pattern boot (case insensitive, exclude uboot). You can do it like this examples:

parted /dev/mmcblk0 name 4 boot_ubuntu
or
parted /dev/mmcblk1 name 6 myBOOTpartition

By default, the microsd device is used. Using the -d key, you can specify emmc or nvme. The script will remove all boot flags from the previous partitions and set on the selected one.
Example:

./select_boot_dev.sh -d nvme

Find boot patrinions on /dev/nvme0n1 ....

Number  Start   End     Size    File system     Name                      Flags
 4      16,8MB  554MB   537MB   fat16           boot                      msftdata

Enter number of the partition to boot: 4

Set boot flag on 4 of /dev/nvme0n1
Remove boot flag on partition 6 of /dev/mmcblk0
Remove boot flag on partition 9 of /dev/mmcblk0
Remove boot flag on partition 11 of /dev/mmcblk0
Remove boot flag on partition 12 of /dev/mmcblk0
Remove boot flag on partition 3 of /dev/mmcblk1

Number  Start   End     Size    File system     Name                      Flags
 4      16,8MB  554MB   537MB   fat16           boot                      boot, esp

Reboot from device: /dev/nvme0n1 partiton:4  (Y/y):)n

Booting from nvme trough uboot does not work for me and I brought it to demonstrate removing the boot flag from all previous devices. As a reminder, the order of loading microsd-emmc-nvme.

I made this script available for all my OS and made a shortcut on my phone using JuceSSH. Now I can very quickly reboot to any installed OS on RockPi use my phone.