View: 12316|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
Published in 2015-10-11 22:25:03 | Show all floors |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
Published in 2015-10-14 15:45:57 | Show all floors
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| Published in 2015-10-14 22:18:56 | Show all floors
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 need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list