HY ladies and gentlemen
I use u-boot since a few time and i am lost
In the first time, i used one Partition where there were the "boot folder" with Kernel (image), the dtb and the files boot.scr.
Now i would like to developp my project.
I need three Partitions :
-the 1st : boot with kernel, boot.scr and dtb
-the 2nd : a rootfs alpha
-the 3rd : the rootf beta.
In the boot's Partition there are two kernels, one for each rootfs.
I build the boot.scr from the files boot.cmd and using bkimage.
the code of boot.cmd is :
$this->bbcode_second_pass_code('', 'if part uuid ${devtype} ${devnum}:${distro_bootpart} partuuid; then
if test "${bootfstype}" = "btrfs"; then
rootflags="commit=5,subvol=@"
subvol="/@"
else
rootflags="commit=5"
subvol=""
fi
if load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${subvol}/boot/armada-3720-turris-mox.dtb; then
has_dtb=1
else
setenv has_dtb 0
echo "Cannot find device tree binary!"
fi
if test $has_dtb -eq 1; then
if load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ${subvol}/boot/Image; then
setenv bootargs "earlyprintk console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000 rootfstype=${bootfstype} root=PARTUUID=${partuuid} rootflags=${rootflags} rootwait ${contract} rw cfg80211.freg=${regdomain}"
booti ${kernel_addr_r} - ${fdt_addr_r}
echo "Booting Image failed"
else
echo "Cannot load kernel binary"
fi
fi
env delete partuuid
fi')
When i used one parition, it worked very well.
Now i know that i have to modify the boot's Files.
My Idea is to do two backups of boot.scr : one to boot in rootfs alpha and another for rootfs beta.
and when i wanted to boot in arootfs alpha, i do a cp boot.scr.alpha boot.scr
i have collect some informations :
Part uuid of all partitions,
and this part of the code $this->bbcode_second_pass_code('', '${devtype} ${devnum}:${distro_bootpart}') : for example the boot partition is mmc 0:1
i don't manage to do a static boot.scr for each rootfs.
i have tried a lot of combinations but none works
can somebody help me please
thanks by advance
Doudoo tiana