由于hi3516dv300 sdk里面只有spi/nand flash上用的根文件系统,是否可以将其转成emmc上使用ext4 rootfs呢?
答案是肯定的:
0.找到ubi格式的rootfs rootfs_hi3516dv300_2k_128k_32M.ubifs:
1.安装工具mtd-utils: sudo apt-get install mtd-utils
2.执行如下的scripte:
sudo modprobe nandsim first_id_byte=0x2c second_id_byte=0xda third_id_byte=0x00 fourth_id_byte=0x15
sudo modprobe ubi mtd=0
sudo ubidetach /dev/ubi_ctrl -m 0
sudo ubiformat /dev/mtd0 -s 2048 -f rootfs_hi3516dv300_2k_128k_32M.ubifs
sudo ubiattach /dev/ubi_ctrl -m 0 -O 2048
sudo mkdir /mnt/ubi
sudo mount -t ubifs ubi0 /mnt/ubi
sudo cp -R /mnt/ubi/* /new/directory
3. 将raw文件转成ext4格式的rootfs.
sudo make_ext4fs -l 16M -s hi3516.rootfs_ext4.img ubi
4.烧录:
//emmc rootfs.ext4 is 16MB (uboot 1M ; uImage 8M)
mw.b 0x82000000 ff 0x1000000;tftp 0x82000000 hi3516.rootfs_ext4.img;mmc erase 4800 8000; mmc write.ext4sp 0 0x82000000 4800 8000