默认分类

雄迈ipc重新打包rootfs

挂载nfs传输文件

mount -t nfs -o rw,nolock 192.168.0.124:/root /mnt/logo/  
cd /mnt/logo

查看mtd分区

 cat /proc/mtd
~ # cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00040000 00010000 "boot"
mtd1: 00180000 00010000 "kernel"
mtd2: 00140000 00010000 "romfs"  #这个是rootfs分区
mtd3: 00470000 00010000 "user"
mtd4: 00040000 00010000 "custom"
mtd5: 00050000 00010000 "mtd"

备份rootfs分区

cat /dev/mtd2 > /mnt/logo/mtd2

查看映像详细信息

cd /root
file mtd2
mtd2: Linux Compressed ROM File System data, little endian size 1060864 version #2 sorted_dirs CRC 0xa93bb6b1, edition 0, 555 blocks, 161 files

binwalk mtd2

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
0             0x0             CramFS filesystem, little endian, size: 1060864, version 2, sorted_dirs, CRC 0xA93BB6B1, edition 0, 555 blocks, 161 files
#映像为cramfs文件系统

使用ubuntu解压,安装cramfs工具

cd /root
mkdir rootfs 
uncramfs rootfs  mtd2
[Volume size: 0x103000]
[Volume serial: b1b63ba9000000002b020000a1000000]
[Volume name: Compressed]

增加开机启动项

vim rootfs/etc/init.d/rcS
mkdir /xxoo #增加目录

重新打包

cd /root
mkcramfs rootfs mtd2new.cramfs
Directory data: 3368 bytes
Everything: 1036 kilobytes
Super block: 76 bytes
CRC: a93bb6b1

烧写rootfs固件

cp /mnt/logo/mtd2new.cramfs /tmp
flash_eraseall /dev/mtd2 #因为nor flash的特性,需要先擦除文件,才可以写入
cat /tmp/mtd2new.cramfs > /dev/mtd2
reboot

验证

ls /
bin      dev      fuck     lib      mnt      root     sys      usr      xxoo
boot     etc      home     linuxrc  proc     sbin     tmp      var
#成功看到xxoo目录

回复

  1. zmzroamqji zmzroamqji
    Sogo 10

    《名利游戏》海外剧高清在线免费观看:https://www.jgz518.com/xingkong/42664.html

This is just a placeholder img.