Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
View: 6497|Reply: 2

u-boot and uImage : support eEnv.txt & uInitrd for OPI-PC H3

[Copy link]

1

Threads

3

Posts

115

Credits

Registered member

Rank: 2

Credits
115
Post time 2015-10-11 22:25:03 | Show all posts |Read mode
Edited by ccwufu at 2015-10-11 22:24

u-boot  & uImage:
support eEnv.txt & uInitrd(external, not embedded in uImage)  for OPI-PC H3
can be used to  support mulit-boot easily.
(another way is : cmdline.txt in embedded/external initramfs(initrd ))

files at boot partition
uEnv.txt
script.bin
uImage (without embedded initrd : rootfs.cpio.gz)
uInitrd (mkimage -A arm -T ramdisk -C none -n uInitrd -d /path/to/rootfs.cpio.gz /path/to/uInitrd)

cat uEnv.txt
scriptf=script.bin
uimagef=uImage
uinitrdf=uInitrd
mmc_root=/dev/mmcblk0p2
(mmc_root=/dev/mmcblk0p3 : if another OS in mmcblk0p3)

1)nano ./u-boot-2011.09/include/configs/sun8iw7p1.h

#define CONFIG_EXTRA_ENV_SETTINGS \
    "bootdelay=3\0" \
    "scriptaddr=0x44000000\0" \
    "loadbootenv=" \
        "fatload mmc 0:1 $scriptaddr uEnv.txt\0" \
    "loaduenv=if run loadbootenv; then " \
        "env import -t ${scriptaddr} ${filesize};" \
        "fi\0" \
    "bootcmd=run setargs_mmc loaduenv boot_normal\0" \
    "console=ttyS0,115200\0" \
    "nand_root=/dev/nandd\0" \
    "mmc_root=/dev/mmcblk0p2\0" \
    "scriptf=script.bin\0" \
    "uimagef=uImage\0" \
    "uinitrdf=uInitrd\0" \
    "init=/init\0" \
    "loglevel=8\0" \
    "setargs_nand=setenv bootargs console=${console} root=${nand_root}" \
    "init=${init} loglevel=${loglevel} partitions=${partitions}\0" \
    "setargs_mmc=setenv bootargs console=${console} root=${mmc_root}" \
    "init=${init} loglevel=${loglevel} partitions=${partitions}\0" \
    "boot_normal=fatload mmc 0:1 0x43000000 ${scriptf};fatload mmc 0:1 40007800 ${uimagef};" \
        "fatload mmc 0:1 50000000 ${uinitrdf};bootm 40007800 50000000\0" \
    "boot_recovery=sunxi_flash read 40007800 recovery;boota 40007800\0" \
    "boot_fastboot=fastboot\0"

2)nano  ./github-lobo/OrangePI-Kernel/build/sun8iw7p1smp_lobo_defconfig.opi2
- CONFIG_INITRAMFS_SOURCE="output/rootfs.cpio.gz"
+ CONFIG_INITRAMFS_SOURCE=""

1

Threads

47

Posts

189

Credits

Registered member

Rank: 2

Credits
189
Post time 2015-10-14 15:45:57 | Show all posts
Quite the same as mine (http://moinejf.free.fr/opi2/u-boot.patch).
I noticed that the machine does not boot when the file 'uEnv.txt' is not present. Have you the same behaviour?
BTW, initrd is needed only if the root file system is in a kernel module. I never used it since I switched to ARM machines.

1

Threads

3

Posts

115

Credits

Registered member

Rank: 2

Credits
115
 Author| Post time 2015-10-14 22:18:56 | Show all posts
1) same behaviour
sunxi#boot                                                                     
** Unable to read "uEnv.txt" from mmc 0:1 **                                    

then halt

2)initrd
I prefer initrd
there are some examples about initrd used in debian.
https://wiki.debian.org/InstallingDebianOn/Allwinner
debian  live-boot also use initrd(initramfs).
You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2019-10-20 03:24 GMT+8 , Processed in 0.028277 second(s), 22 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list