在 Linux 机器上解压提取到的 m4.img 镜像,查看 block size,后面重新压缩会用到。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
root@ubuntu:/home/test/Desktop/xiaomi# unsquashfs -s mtdblock4.img Found a valid SQUASHFS 4:0 superblock on mtdblock4.img. Creation or last append time Thu Jul 16 13:04:11 2020 Filesystem size 32052.31 Kbytes (31.30 Mbytes) Compression xz xz: error reading stored compressor options from filesystem! 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 not stored Duplicates are removed Number of fragments 106 Number of inodes 1763 Number of ids 1
root@ubuntu:/home/test/Desktop/xiaomi# cat m4/etc/rc.local # the system init finished. By default this file does nothing. sh /data/init.sh & exit 0 root@ubuntu:/home/test/Desktop/xiaomi#
root@ubuntu:/home/test/Desktop/xiaomi# mksquashfs m4 m4_crack.img -b 131072 -comp xz -Xbcj arm -Xdict-size 32K -no-xattrs Parallel mksquashfs: Using 4 processors Creating 4.0 filesystem on m4_crack.img, block size 131072. [======================================================\] 1495/1495 100%
Exportable Squashfs 4.0 filesystem, xz compressed, data block size 131072 compressed data, compressed metadata, compressed fragments, no xattrs duplicates are removed Filesystem size 32469.29 Kbytes (31.71 Mbytes) 46.00% of uncompressed filesystem size (70587.29 Kbytes) Inode table size 15932 bytes (15.56 Kbytes) 24.82% of uncompressed inode table size (64178 bytes) Directory table size 17978 bytes (17.56 Kbytes) 44.87% of uncompressed directory table size (40068 bytes) Number of duplicate files found 23 Number of inodes 1763 Number of files 1082 Number of fragments 106 Number of symbolic links 578 Number of device nodes 1 Number of fifo nodes 0 Number of socket nodes 0 Number of directories 102 Number of ids (unique uids + gids) 1 Number of uids 1 root (0) Number of gids 1 root (0)
Writing from m4_crack.img to system0 ... [w] root@S12:/tmp# /usr/bin/fw_env -s boot_part boot0 [ubootenv] update_bootenv_varible name [boot_part]: value [boot0] [ubootenv] Save ubootenv to /dev/nand_env succeed!
root@S12:~# mount rootfs on / type rootfs (rw) /dev/ubi0_0 on / type ubifs (rw,noatime) devtmpfs on /dev type devtmpfs (rw,relatime,size=115548k,nr_inodes=28887,mode=755) proc on /proc type proc (rw,nosuid,nodev,noexec,noatime) sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime) cgroup on /sys/fs/cgroup type cgroup (rw,nosuid,nodev,noexec,relatime,debug,cpu,cpuacct,devices,freezer,net_cls,blkio) tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime) tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755) debugfs on /sys/kernel/debug type debugfs (rw,noatime) /dev/ubi1_0 on /data type ubifs (rw,relatime) root@S12:~#