手机文件系统修改

目前常用的文件系统

  • jffs 一个针对flash闪存的文件系统,基于MTD,有yffs,jffs2两个版本
  • yaffs针对NAND Flash文件系统,有yaffs,yaffs2两个版本
  • cramfs只读文件系统,基于MTD支持zlib 压缩
  • SquashFS linux下的只读文件系统,支持压缩,有很多版本

linux读取&写入

  • cramfs可用mount挂载,毕竟是linus参与的东西,支持的就是好啊 :Overjoy:
    mount -o loop /your-cramfs.smg   /mount-dir

    创建cramfs 需切换到root

    mkcramfs /your-dir /your-squashfs.smg
  • squashfs
    mount -o loop /your-squashfs.smg  /mount-dir

    不过这二者必须有内核的支持,电脑linuxsquashfs新内核已经支持到v4了,可是moto linux的还是v2.1
    虽然可以使用系统中的squashfs-tool读取,但是打包后会导致moto无法识别,所以直接装squashfs 2.1
    使用squashfs-tool套件
    解包

    unsquashfs /your-squashfs.smg -d /your-dir

    打包

    squashfs /your-dir /your-squashfs.smg -all-root

    -all-root 设置打包用户组为root

  • jffs2
    检查如果不存在/dev/mtdblock0,切换到管理员下执行

    modprobe mtd # get this when enabling MTD
    modprobe jffs2 # under Filesystems, Misc
    modprobe mtdram # under MTD section
    modprobe mtdchar # under MTD section
    modprobe mtdblock # under MTD section

    此时应该出现/dev/mtdblock0

    dd if=your-jffs2 of=/dev/mtdblock0 &&mount -t jffs2 /dev/mtdblock0 /your-mount-point

    对jffs的写比较容易,直接写入即可,需要存档直接使用dd

    dd if=/dev/mtdblock0 of=/your-jffs.smg
  • yaffs 只能借助第三方工具
    yaffs2utils,  unyaffs ,yaffey

关于xu xc

工作两年了,有点懒,完了在写吧
此条目发表在手机, 系統分类目录。将固定链接加入收藏夹。