使用unsquashfs -stat命令查看现有RootFS的参数信息:
root@csersoft-vm-ubuntu:/home/csersoft/r18s115# unsquashfs -stat rootfs.bin Found a valid SQUASHFS 4:0 superblock on rootfs.bin. Creation or last append time Tue Nov 13 20:25:40 2018 Filesystem size 18340.23 Kbytes (17.91 Mbytes) Compression lzma Block size 131072 Filesystem is exportable via NFS Inodes are compressed Data is compressed Fragments are compressed Always-use-fragments option is not specified Xattrs are compressed Duplicates are removed Number of fragments 166 Number of inodes 2353 Number of ids 1
解包并编辑后,根据上方列出的参数信息(主要是压缩算法、块大小),重新打包RootFS:
root@csersoft-vm-ubuntu:/home/csersoft/r18s115# mksquashfs squashfs-root/ new_rootfs.bin -comp lzma -b 131072 Parallel mksquashfs: Using 4 processors Creating 4.0 filesystem on new_rootfs.bin, block size 131072. [===================================================================================================================================================================================|] 1907/1907 100% Exportable Squashfs 4.0 filesystem, lzma compressed, data block size 131072 compressed data, compressed metadata, compressed fragments, compressed xattrs duplicates are removed Filesystem size 18339.69 Kbytes (17.91 Mbytes) 29.82% of uncompressed filesystem size (61496.49 Kbytes) Inode table size 20621 bytes (20.14 Kbytes) 22.63% of uncompressed inode table size (91124 bytes) Directory table size 21824 bytes (21.31 Kbytes) 40.95% of uncompressed directory table size (53295 bytes) Xattr table size 65 bytes (0.06 Kbytes) 81.25% of uncompressed xattr table size (80 bytes) Number of duplicate files found 33 Number of inodes 2355 Number of files 1607 Number of fragments 166 Number of symbolic links 529 Number of device nodes 5 Number of fifo nodes 0 Number of socket nodes 0 Number of directories 214 Number of ids (unique uids + gids) 1 Number of uids 1 root (0) Number of gids 1 root (0)
大神,请教华为的分区有个头文件。用unsquashfs无法直接解压,这个该如何处理?
文件头是什么?
直接用dd命令把文件头切了
大神,麻烦问下烽火的rootfs怎么处理。