u-boot中的脚本如下:
writepartitions=if ubi part boot-config && ubi read $verifyaddr u-boot-env1 1 && ubi read $verifyaddr u-boot-env2 1; then ubi remove bootfs && ubi remove config; else nand erase.part boot-config && ubi part boot-config && ubi create u-boot-env1 0x20000 dynamic && ubi create u-boot-env2 0x20000 dynamic; fi && ubi create bootfs 0x3600000 dynamic && ubi create config - dynamic && if ubi part root && ubi read $verifyaddr rootfs 1; then ubi remove rootfs; else nand erase.part root && ubi part root; fi && ubi create rootfs - dynamic;
运行命令
run writepartitions
弹出如下的问题
U-Boot> run writepartitions
Unknown command 'if' - try 'help'
Unknown command 'then' - try 'help'
Unknown command 'else' - try 'help'
Unknown command 'fi' - try 'help'
Unknown command 'then' - try 'help'
Unknown command 'else' - try 'help'
Unknown command 'fi' - try 'help'
Command failed, result=1
原因是下面的配置没有使能,使能了就ok了
CONFIG_HUSH_PARSER