echo "/dev/by-name/env 0x0000 0x20000" > /etc/fw_env.config
echo "/dev/by-name/env-redund 0x0000 0x20000" >> /etc/fw_env.config
我用的是TF卡引导,修改配置文件如上,其中
root@TinaLinux:/# ls -lh /dev/by-name/env*
lrwxrwxrwx 1 root root 14 Jan 1 00:00 /dev/by-name/env -> /dev/mmcblk0p2
lrwxrwxrwx 1 root root 14 Jan 1 00:00 /dev/by-name/env-redund -> /dev/mmcblk0p3
两个设备的软链接指向了/dev/mmcblk0p2 和 p3
这俩设备是uboot传递给内核的分区参数里的。
root@TinaLinux:/# cat /proc/cmdline
earlyprintk=sunxi-uart,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyS0,115200 rootdelay=2 loglevel=8 root=/dev/mmcblk0p5 init=/pseudo_init partitions=boot-resource@mmcblk0p1:env@mmcblk0p2:env-redund@mmcblk0p3:boot@mmcblk0p4:rootfs@mmcblk0p5:private@mmcblk0p6:rootfs_data@mmcblk0p7:UDISK@mmcblk0p8 cma=4M snum= mac_addr= wifi_mac= bt_mac= specialstr= gpt=1 androidboot.mode=normal androidboot.hardware=sun8iw20p1 boot_type=1 androidboot.boot_type=1 gpt=1 uboot_message=2018.05-g2a1965a(07/10/2022-02:50:57) mbr_offset=1032192 disp_reserve=1536000,0x43f06000 androidboot.dramsize=128