2440移植Linux Kernel筆記(三)------製作jffs2映像檔案
如果本篇部落格對您有幫助,或許可以在下方評論給我留個言。
之前我們把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
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 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