海思mksquashfs制作squashfs文件系统

1. 首先生成mksquashfs工具,进入osdrv\tools\pc\squashfs4.3,make 生成mksquashfs,大约1.2M,制作squashfs命令:

mksquashfs ${BASE_ROOTFS} ${PRODUCT}-rootfs.sqsh4 -b 64K -comp xz -noappend

2.内核kernel支持squashfs4.0文件系统

cp arch/arm/configs/hi3516ev200_xxx_defconfig .config
make ARCH=arm CROSS_COMPILE=arm-himixXXX-linux- menuconfig (保存退出即可)
打开支持xz压缩算法选项:
File systems --->
[*] Miscellaneous filesystems --->
<*> SquashFS 4.0 - Squashed file system support
[*] Include support for XZ compressed file systems


make ARCH=arm CROSS_COMPILE=arm-himixXXX-linux- uImage

3. 设定boot环境变量,设定文件系统分区

setenv bootargs 'mem=32M console=ttyAMA0,115200 root=/dev/mtdblock3 mtdparts=hi_sfc:512K(boot),4096K(appfs),3584K(kernel),1984K(rootfs),64K(hardware),1024K(config),16M@0(flash)' 

千万别这样写:

setenv bootargs 'mem=32M console=ttyAMA0,115200 root=/dev/mtdblock3 rootfstype=sqsh4 rw mtdparts=hi_sfc:512K(boot),4096K(appfs),3584K(kernel),1984K(rootfs),64K(hardware),1024K(config),16M@0(flash)'

否则会出现下面的错误:


版权声明:本文为harjay原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。