1. 程式人生 > >openwrt設置uboot環境變量在flash上的存儲地址

openwrt設置uboot環境變量在flash上的存儲地址

uboot 語句 變量存儲 flash 大小 conf 環境變量 con 兩個

ubootenv_add_app_config

ubootenv_add_uci_config "/dev/mtd1" "0x40000" "0x2000" "0x20000"

這兩個函數定義在文件uboot-envtools.sh中,先來解析以上語句:

/dev/mtd1 : 指定boot_env所在flash上的分區

0x40000 : 指定boot_env所在flash上的偏移量

0x2000 :指定uboot的環境變量存儲空間大小

0x20000 :指定flash的sector大小

ubootenv_add_app_config這個函數就是將"/dev/mtd1" "0x40000" "0x2000" "0x20000" 這些內容追加到/etc/fw_env.config

openwrt設置uboot環境變量在flash上的存儲地址