您的位置:首页 > 运维架构 > Linux

2440移植Linux Kernel笔记(三)------制作jffs2映像文件

2017-05-25 13:34 274 查看
你好!这里是风筝的博客,欢迎和我一起交流。

如果本篇博客对您有帮助,或许可以在下方评论给我留个言。

之前我们把busybox安装到/work/nfs/root/目录下.

现在:

cd /work/nfs/

mkfs.jffs2 -n -s 2048 -e 128KiB -d root -o rootfs.jffs2
其中root为busybox的安装文件夹,rootfs.jffs2为生成的目标文件
现在我们把rootfs.jffs2文件下载下去,在uboot里设置参数:

set bootargs console=ttyS0,115200 root=/dev/mtdblock3 rootfstype=jffs2

发现挂载不成功,提示:

end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004

这是因为我们Kernel没有支持ARM EABI造成的.

cd /work/system/linux-4.4.66/

make menuconfig

选中:Kernel Features->Use the ARM EABI to compile the kernel

make uImage

现在我们重新启动Kernel,发现rootfs.jffs2文件挂载成功!! 

附:

mkfs.jffs2的一些选项:

Options:

  -p, --pad[=SIZE]        Pad output to SIZE bytes with 0xFF. If SIZE is

                          not specified, the output is padded to the end of

                          the final erase block

  -r, -d, --root=DIR      Build file system from directory DIR (default: cwd)

  -s, --pagesize=SIZE     Use page size (max data node size) SIZE (default: 4KiB)

  -e, --eraseblock=SIZE   Use erase block size SIZE (default: 64KiB)

  -c, --cleanmarker=SIZE  Size of cleanmarker (default 12)

  -m, --compr-mode=MODE   Select compression mode (default: priortiry)

  -x, --disable-compressor=COMPRESSOR_NAME

                          Disable a compressor

  -X, --enable-compressor=COMPRESSOR_NAME

                          Enable a compressor

  -y, --compressor-priority=PRIORITY:COMPRESSOR_NAME

                          Set the priority of a compressor

  -L, --list-compressors  Show the list of the avaiable compressors

  -t, --test-compression  Call decompress and compare with the original (for test)

  -n, --no-cleanmarkers   Don't add a
b991
cleanmarker to every eraseblock

  -o, --output=FILE       Output to FILE (default: stdout)

  -l, --little-endian     Create a little-endian filesystem

  -b, --big-endian        Create a big-endian filesystem

  -D, --devtable=FILE     Use the named FILE as a device table file

  -f, --faketime          Change all file times to '0' for regression testing

  -q, --squash            Squash permissions and owners making all files be owned by root

  -U, --squash-uids       Squash owners making all files be owned by root

  -P, --squash-perms      Squash permissions on all files

      --with-xattr        stuff all xattr entries into image

      --with-selinux      stuff only SELinux Labels into jffs2 image

      --with-posix-acl    stuff only POSIX ACL entries into jffs2 image

  -h, --help              Display this help text

  -v, --verbose           Verbose operation

  -V, --version           Display version information

  -i, --incremental=FILE  Parse FILE and generate appendage output for it
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: