Boot from specific partition using sd card - RCAR M06 KF Board

Hello everyone.

I hope everyone is doing well; I have one scenario for updating the device firmware.'


I have three partitions:
NO. 1 PARTITION - Boot folder (contains image and r8a7795-h3ulcb-4x2g-kf.dtb)

PART 2: Rootfs

PARTITION 3 - Empty partition - This is where the new rootfs will be unzipped/untarred.

During boot, I want to check partition 3 to read explicitly for rootfs, and if none is found, I want to check partition 2 for rootfs.

I've set the following u-boot parameters:

bootargs_emmc2='rw root=/dev/mmcblk1p2 rootdelay=5'
bootargs_emmc3='rw root=/dev/mmcblk1p3 rootdelay=5'
setenv bootargs "${bootargs_emmc2}; ${bootargs_emmc3}"
setenv bootcmd "ext2load mmc 0:1 0x48080000 /boot/Image; ext2load mmc 0:1 0x48000000 /boot/r8a7795-h3ulcb-4x2g-kf.dtb; booti 0x48080000 - 0x48000000"
saveenv

I followed the instructions at elinux.org/.../.
I'm getting the following error: devtmpfs: mounting error -2 (may be uboot not able to find rootfs but it is not fallback to read partition 2).

When I explicitly set bootargs to emmc2, the board boots up normally.

My question is whether there is a way to force uboot to read rootfs from part#3 if part#3 is not present, and to read rootfs from part#2 if part#3 is not present.

Any help will be appreciated Slight smile

Parents
  • Hi Siddharth,

    I think following command is useful for you.

    => ls mmc 0:1
    <DIR> 4096 .
    <DIR> 4096 ..
    <DIR> 16384 lost+found
    <DIR> 4096 bin
    <DIR> 4096 boot
    <DIR> 4096 dev
    <DIR> 4096 etc
    <DIR> 4096 home
    <DIR> 4096 lib
    <DIR> 4096 media
    <DIR> 4096 mnt
    <DIR> 4096 proc
    <DIR> 4096 run
    <DIR> 4096 sbin
    <DIR> 4096 sys
    <DIR> 4096 tmp
    <DIR> 4096 usr
    <DIR> 4096 var
    <DIR> 4096 data
    => if test -e mmc 0:1 /etc/hosts; then echo Exist; fi
    Exist
    => if test -e mmc 0:1 /etc/hosts_; then echo Exist; fi
    =>


    Firstly, set bootargs_emmc2.
    Then check whether rootfs is exist on partition3 as like above command.
    If rootfs is in partition3, set bootargs_emmc3.

    These process may realize thing that you want.
    But, I didn't test so I don't know it works well.

Reply
  • Hi Siddharth,

    I think following command is useful for you.

    => ls mmc 0:1
    <DIR> 4096 .
    <DIR> 4096 ..
    <DIR> 16384 lost+found
    <DIR> 4096 bin
    <DIR> 4096 boot
    <DIR> 4096 dev
    <DIR> 4096 etc
    <DIR> 4096 home
    <DIR> 4096 lib
    <DIR> 4096 media
    <DIR> 4096 mnt
    <DIR> 4096 proc
    <DIR> 4096 run
    <DIR> 4096 sbin
    <DIR> 4096 sys
    <DIR> 4096 tmp
    <DIR> 4096 usr
    <DIR> 4096 var
    <DIR> 4096 data
    => if test -e mmc 0:1 /etc/hosts; then echo Exist; fi
    Exist
    => if test -e mmc 0:1 /etc/hosts_; then echo Exist; fi
    =>


    Firstly, set bootargs_emmc2.
    Then check whether rootfs is exist on partition3 as like above command.
    If rootfs is in partition3, set bootargs_emmc3.

    These process may realize thing that you want.
    But, I didn't test so I don't know it works well.

Children
No Data