Jump to content

Recommended Posts

Posted

Hi,

there is almost 0 documentation how to update u-boot; where to flash (dd) it, if it does support boot from rootfs on ZFS etc. 

Regarding the ZFS; here I assume /boot has to be on ext4/vfat and rest of the rootfs (/) as ZFS to make it works?

 

Is there any way to flash more details on this part?

 

I found files as following but no idea... 

 

/usr/lib/linux-u-boot-current-bananapi_21.05.1_armhf/u-boot-sunxi-with-spl.bin
 

root@bananapi:/usr/lib/u-boot# pwd
/usr/lib/u-boot
root@bananapi:/usr/lib/u-boot# ls
Bananapi_defconfig  LICENSE  platform_install.sh
 

 

Also I wanted to do simple update; to make u-boot boot from /dev/mmcblk0p2 instead of rootfs that was place originally on /dev/mmcblk0p1; /dev/mmcblk0p2 is identical copy of /dev/mmcblk0p1

 

Thanks

 

Edit> seems that details are stored here platform_install.sh;

 

But how/where i can re-compile file u-boot-sunxi-with-spl.bin so that it will boot from /dev/mmcblk0p2 instead of /dev/mmcblk0p1; or is that based on the Boot flag set on partition?

 

 

so i assume in my case i have to pass 

$1 = /usr/lib/linux-u-boot-current-bananapi_21.05.1_armhf

$2 = /dev/mmcblk0

 

DIR=/usr/lib/linux-u-boot-current-bananapi_21.05.1_armhf
write_uboot_platform ()
{
    dd if=/dev/zero of=$2 bs=1k count=1023 seek=1 status=noxfer > /dev/null 2>&1;
    dd if=$1/u-boot-sunxi-with-spl.bin of=$2 bs=1024 seek=8 status=noxfer > /dev/null 2>&1
}

setup_write_uboot_platform ()
{
    if grep -q "ubootpart" /proc/cmdline; then
        local tmp=$(cat /proc/cmdline);
        tmp="${tmp##*ubootpart=}";
        tmp="${tmp%% *}";
        [[ -n $tmp ]] && local part=$(findfs PARTUUID=$tmp 2>/dev/null);
        [[ -n $part ]] && local dev=$(lsblk -n -o PKNAME $part 2>/dev/null);
        [[ -n $dev ]] && DEVICE="/dev/$dev";
    else
        if [[ -f /var/lib/armbian/force_search_uboot ]]; then
            for dev in $(lsblk -d -n -p -o NAME);
            do
                if grep -q 'eGON.BT0' <(dd if=$dev bs=32 skip=256 count=1 status=none); then
                    echo "SPL signature found on $dev" 1>&2;
                    DEVICE=$dev;
                    break;
                fi;
            done;
        fi;
    fi
}
 

 

Posted

Even i made /dev/mmcblk0p2 *   bootable; edited its /etc/fstab & /boot/armbianEnv.txt with proper UUID of /dev/mmcblk0p2 it got booted from /dev/mmcblk0p1 after reboot.

 

https://github.com/u-boot/u-boot/blob/master/doc/README.distro

Distros simply need to install the boot configuration files (see next

section) in an ext2/3/4 or FAT partition, mark the partition bootable (via

the MBR bootable flag, or GPT legacy_bios_bootable attribute), and U-Boot (or

any other bootloader) will find those boot files and execute them. This is

conceptually identical to creating a grub2 configuration file on a desktop

PC.

 

Device         Boot    Start      End  Sectors  Size Id Type
/dev/mmcblk0p1          8192 10493951 10485760    5G 83 Linux
/dev/mmcblk0p2 *    10493952 31116287 20622336  9.9G 83 Linux
 

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines