카테고리 없음
root image 생성을 위한 mkfs.jffs2 가져오기...
벅스바니
2010. 2. 19. 16:39
리눅스 커널 빌드하는 것만 생각했지, 루트이미지는 전혀 생각하지 못하고 있었습니다.
NAND를 완전히 밀어버리고, 커널 부팅을 한 결과 나타난 것은 'kernel panic'......
부팅후 초기화시킬 파일 시스템이 전혀 없었던 것입니다.
그래서 부랴부랴 루트 이미지를 찾았고,
혹시나 해서 만들 방법도 확인해 보았습니다.
만드는 방법은 mkfs.jffs2라는 파일을 빌드 하는것....
두군데 정도 소스를 받아서 써봤는데, 에러가 나는 군요.
리눅스의 문제는 패키지 마다 define이 다른 것이 종종 생긴다는 것입니다.
그래서 소스 받아서 빌드하는 것은 포기하고,
커맨드 상에서 mkfs.jffs2를 그냥 쳐보니, 메시지가 나옵니다.
lebych@ubuntu:~/works/ARM/jffs2$ mkfs.jffs2The program 'mkfs.jffs2' is currently not installed. You can install it by typing:sudo apt-get install mtd-utilsmkfs.jffs2: command not found
친절하게도 인스톨 하라고 까지 설명해주세요..^^
그래서 알려준대로 인스톨 하였습니다.
lebych@ubuntu:~/works/ARM/jffs2$ sudo apt-get install mtd-utilsReading package lists... DoneBuilding dependency treeReading state information... DoneThe following packages were automatically installed and are no longer required:linux-headers-2.6.31-14 linux-headers-2.6.31-14-genericUse 'apt-get autoremove' to remove them.The following extra packages will be installed:liblzo2-2The following NEW packages will be installed:liblzo2-2 mtd-utils0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.Need to get 426kB of archives.After this operation, 1,393kB of additional disk space will be used.Do you want to continue [Y/n]?Get:1 http://us.archive.ubuntu.com karmic/main liblzo2-2 2.03-1 [64.5kB]Get:2 http://us.archive.ubuntu.com karmic/universe mtd-utils 20090606-1 [362kB]Fetched 426kB in 3s (113kB/s)Selecting previously deselected package liblzo2-2.(Reading database ... 208431 files and directories currently installed.)Unpacking liblzo2-2 (from .../liblzo2-2_2.03-1_i386.deb) ...Selecting previously deselected package mtd-utils.Unpacking mtd-utils (from .../mtd-utils_20090606-1_i386.deb) ...Processing triggers for man-db ...Setting up liblzo2-2 (2.03-1) ...Setting up mtd-utils (20090606-1) ...Processing triggers for libc-bin ...ldconfig deferred processing now taking placelebych@ubuntu:~/works/ARM/jffs2$
그리고 완전히 깔렸는지 확인해 보기위해 'mkfs.jffs2'를 실행해 보았습니다.
lebych@ubuntu:~/works/ARM/jffs2$ mkfs.jffs2mkfs.jffs2: Usage: mkfs.jffs2 [OPTIONS]Make a JFFS2 file system image from an existing directory treeOptions:-p, --pad[=SIZE] Pad output to SIZE bytes with 0xFF. If SIZE isnot specified, the output is padded to the end ofthe 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_NAMEDisable a compressor-X, --enable-compressor=COMPRESSOR_NAMEEnable a compressor-y, --compressor-priority=PRIORITY:COMPRESSOR_NAMESet 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 itlebych@ubuntu:~/works/ARM/jffs2$
잘 나오는군요...
나중에 이미지를 만드려면 다음과 같이 해야한다고 합니다...
실행은 안해봤습니다.
$ mkfs.jffs2 -o usr.jffs -e 0x40000 -r tmpdir |
-o : 생성 파일 이름
-e : Flash erase 블록 사이즈
-r : 대상 디렉토리 지정(하위 디렉토리 포함)
---end---