———————————————————————————————————————


主机操作系统:Centos 6.7
交叉编译器环境:arm-linux-gcc-4.5.4 
开发板平台: FL2440 
Linux内核版本: linux-3.0 
制作文件系统类型:JFFS2

——————————————————————————————————————


                                                                                                                                                                                            JFFS文件系统最早是由瑞典Axis Communications公司基于Linux2.0的内核为嵌入式系统开发的文件系统JFFS2(Journalling Flash FileSystem v2,日志闪存文件系统版本2 )是RedHat公司基于JFFS开发的闪存文件系统,最初是针对RedHat公司的嵌入式产品eCos开发的嵌入式文件系统,所JFFS2也可以用在Linux, uCLinux中。它主要用于NOR型闪存,基于MTD驱动层,特点是:可读写的、支持数据压缩的、基于哈希表的日志型文件系统,并提供了崩溃/掉电安全保护,提供“写平衡”支持等。缺点主要是当文件系统已满或接近满时,因为垃圾收集的关系而使jffs2的运行速度大大放慢。

   Jffs2不适合用于NAND闪存主要是因为NAND闪存的容量一般较大,这样导致jffs2为维护日志节点所占用的内存空间迅速增大,另外,jffs2文件系统在挂载时需要扫描整个FLASH的内容,以找出所有的日志节点,建立文件结构,对于大容量的NAND闪存会耗费大量时间。

   目前jffs3正在开发中,关于jffs2系列文件系统的使用详细文档,可参考MTD补丁包中mtd-jffs-HOWTO.txt


1.对根文件系统进行修改

无修改

2.添加内核对jffs2的支持

[leiyuxing@centos6 linux-3.0]$ export TERM=vt100

[leiyuxing@centos6 linux-3.0]$ make menuconfig

File systems --->
Miscellaneous filesystems --->
<*> Journalling Flash File System v2 (JFFS2) support
(0) JFFS2 debugging verbosity (0 = quiet, 2 = noisy)
[*] JFFS2 write-buffering support
[ ] JFFS2 summary support (EXPERIMENTAL)
[ ] JFFS2 XATTR support (EXPERIMENTAL)
[ ] Advanced compression options for JFFS2

[leiyuxing@centos6 linux-3.0]$ make

3.制作mkfs.jffs2和mkfs.ubifs工具

[leiyuxing@centos6 rootfs]$ mkdir mtd-utiles

[leiyuxing@centos6 rootfs]$ cd mtd-utiles/

[leiyuxing@centos6 mtd-utiles]$ vim build.sh
#!/bin/sh

#+--------------------------------------------------------------------------------------------
#|Description: This shell script used to download lzo,zlib,mtd-utils source code
#| and cross compile it for ARM Linux, all is static cross compile.
#| Author: GuoWenxue <guowenxue@gmail.com>
#| ChangeLog:
#| 1, Initialize 1.0.0 on 2011.04.12
#+--------------------------------------------------------------------------------------------

PRJ_PATH=`pwd`

LZO="lzo-2.04"
ZLIB="zlib-1.2.5"
e2fsprogs_ver=1.42
mtd="mtd-utils-1.4.9"

function decompress_packet()
(
echo "+---------------------------------------------+"
echo "| Decompress $1 now"
echo "+---------------------------------------------+"

ftype=`file "$1"`
case "$ftype" in
"$1: Zip archive"*)
unzip "$1" ;;
"$1: gzip compressed"*)
if [ `expr "$1" : ".*.tar.*" ` ] ; then
tar -xzf $1
else
gzip -d "$1"
fi ;;
"$1: bzip2 compressed"*)
if [ `e
xpr "$1" : ".*.tar.*" ` ] ; then
tar -xjf $1
else
bunzip2 "$1"
fi ;;
"$1: POSIX tar archive"*)
tar -xf "$1" ;;
*)
echo "$1 is unknow compress format";;
esac
)

# Download lzo source code packet
if [ ! -s $LZO.tar.gz ] ; then
wget http://www.oberhumer.com/opensource/lzo/download/$LZO.tar.gz
fi

# Decompress lzo source code packet
if [ ! -d $LZO ] ; then
decompress_packet $LZO.tar.*
fi

# Cross compile lzo

cd $LZO
if [ ! -s src/.libs/liblzo*.a ] ; then
unset LDFLAGS
./configure --enable-static --disable-shared
make
fi
cd -


echo "+----------------------------------------+"
echo "| Cross compile $ZLIB now "
echo "| Crosstool: $CROSS"
echo "+----------------------------------------+"

# Download zlib source code packet
if [ ! -s $ZLIB.tar* ] ; then
#wget http://www.zlib.net/$ZLIB.tar.gz
#wget http://www.imagemagick.org/download/delegates/$ZLIB.tar.bz2
#wget http://down1.chinaunix.net/distfiles/$ZLIB.tar.bz2
wget http://pkgs.fedoraproject.org/repo/pkgs/zlib/zlib-1.2.5.tar.bz2/be1e89810e66150f5b0327984d8625a0/$ZLIB.tar.bz2
fi

# Decompress zlib source code packet
if [ ! -d $ZLIB ] ; then
decompress_packet $ZLIB.tar.*
fi

#Cross compile zlib

cd $ZLIB
if [ ! -s libz.a ] ; then
unset LDFLAGS
./configure --static
make
fi
cd -


echo "+----------------------------------------+"
echo "| Cross compile e2fsprogsV$e2fsprogs_ver now "
echo "| Crosstool: $CROSS"
echo "+----------------------------------------+"
#e2fsprogs is for UBIFS, download e2fsprogs source code packet
if [ ! -s e2fsprogs-$e2fsprogs_ver.tar.gz ] ; then
wget http://nchc.dl.sourceforge.net/project/e2fsprogs/e2fsprogs/$e2fsprogs_ver/e2fsprogs-$e2fsprogs_ver.tar.gz
fi

# Decompress e2fsprogs source code packet
if [ ! -d e2fsprogs-$e2fsprogs_ver ] ; then
decompress_packet e2fsprogs-$e2fsprogs_ver.tar.*
fi

cd e2fsprogs-$e2fsprogs_ver
if [ ! -s lib/libuuid.a ] ; then
./configure --enable-elf-shlibs
make
fi
cd -

echo "+----------------------------------------+"
echo "| Cross compile mtd-utils now "
echo "| Crosstool: $CROSS"
echo "+----------------------------------------+"

if [ ! -s ${mtd}.tar.bz2 ] ; then
wget ftp://ftp.infradead.org/pub/mtd-utils/${mtd}.tar.bz2
fi
decompress_packet ${mtd}.tar.bz2

# download mtd-utils source code
#if [ ! -d mtd-utils* ] ; then
#git clone git://git.infradead.org/mtd-utils.git

#fi

cd ${mtd}
#Add the CROSS tool in file common.mk

line=`sed -n '/CFLAGS ?= -O2 -g/=' common.mk `
if [ ! -z $line ] ; then
sed -i -e ${line}s"|.*|CFLAGS ?= -O2 -g --static|" common.mk
fi

unset LDFLAGS
unset CFLAGS

set -x
export CFLAGS="-DWITHOUT_XATTR -I$PRJ_PATH/$ZLIB -I$PRJ_PATH/$LZO/include -I$PRJ_PATH/e2fsprogs-$e2fsprogs_ver/lib"
export ZLIBLDFLAGS=-L$PRJ_PATH/$ZLIB
export LZOLDFLAGS=-L$PRJ_PATH/$LZO/src/.libs/
export LDFLAGS="-static -L $PRJ_PATH/e2fsprogs-$e2fsprogs_ver/lib $ZLIBLDFLAGS $LZOLDFLAGS"
make

set -x
#strip nandwrite flash_erase nanddump
#sudo cp nandwrite $INST_PATH/.nandwrite
#sudo cp flash_erase $INST_PATH/.flash_erase
#sudo cp nanddump $INST_PATH/.nanddump

"build.sh" [新] 157L, 4268C已写入

[leiyuxing@centos6 mtd-utiles]$ ls

build.sh

[leiyuxing@centos6 mtd-utiles]$ sh build.sh

[leiyuxing@centos6 mtd-utiles]$ ls

build.sh lzo-2.04 mtd-utils-1.4.9.tar.bz2

e2fsprogs-1.42 lzo-2.04.tar.gz zlib-1.2.5

e2fsprogs-1.42.tar.gz mtd-utils-1.4.9 zlib-1.2.5.tar.bz2

[leiyuxing@centos6 mtd-utiles]$ cd mtd-utils-1.4.9

[leiyuxing@centos6 mtd-utils-1.4.9]$ ls

common.mk flash_otp_lock.c nanddump.o

compr.c flash_otp_write.c nandtest

compr.h flash_unlock nandtest.c

compr_lzo.c flash_unlock.c nandtest.o

compr_lzo.o flash_unlock.o nandwrite

compr.o ftl_check nandwrite.c

compr_rtime.c ftl_check.c nandwrite.o

compr_rtime.o ftl_check.o nftldump

compr_zlib.c ftl_format nftldump.c

compr_zlib.o ftl_format.c nftldump.o

COPYING ftl_format.o nftl_format

device_table.txt include nftl_format.c

docfdisk jffs2dump nftl_format.o

docfdisk.c jffs2dump.c rbtree.c

docfdisk.o jffs2dump.o rbtree.h

doc_loadbios jffs2reader rbtree.o

doc_loadbios.c jffs2reader.c recv_image

doc_loadbios.o jffs2reader.o recv_image.c

feature-removal-schedule.txt jffs-dump.c recv_image.o

fectest.c lib rfddump

flashcp load_nandsim.sh rfddump.c

flashcp.c make_a_release.sh rfddump.o

flashcp.o MAKEDEV rfdformat

flash_erase Makefile rfdformat.c

flash_eraseall mcast_image.h rfdformat.o

flash_erase.c mkfs.jffs2 serve_image

flash_erase.o mkfs.jffs2.1 serve_image.c

flash_lock mkfs.jffs2.c serve_image.o

flash_lock.c mkfs.jffs2.o summary.h

flash_lock.o mkfs.ubifs sumtool

flash_otp_dump mtd_debug sumtool.c

flash_otp_dump.c mtd_debug.c sumtool.o

flash_otp_dump.o mtd_debug.o tests

flash_otp_info mtd-utils.spec ubi-utils

flash_otp_info.c nanddump

flash_otp_info.o nanddump.c



[leiyuxing@centos6 mtd-utils-1.4.9]$ ls mkfs.ubifs/

compr.c crc16.c devtable.c lpt.c mkfs.ubifs.c ubifs.h

compr.h crc16.h devtable.o lpt.h mkfs.ubifs.h ubifs-media.h

compr.o crc16.o hashtable lpt.o mkfs.ubifs.o

COPYING defs.h key.h mkfs.ubifs README

[leiyuxing@centos6 mtd-utils-1.4.9]$ ls

common.mk flash_otp_lock.c nanddump.o

compr.c flash_otp_write.c nandtest

compr.h flash_unlock nandtest.c

compr_lzo.c flash_unlock.c nandtest.o

compr_lzo.o flash_unlock.o nandwrite

compr.o ftl_check nandwrite.c

compr_rtime.c ftl_check.c nandwrite.o

compr_rtime.o ftl_check.o nftldump

compr_zlib.c ftl_format nftldump.c

compr_zlib.o ftl_format.c nftldump.o

COPYING ftl_format.o nftl_format

device_table.txt include nftl_format.c

docfdisk jffs2dump nftl_format.o

docfdisk.c jffs2dump.c rbtree.c

docfdisk.o jffs2dump.o rbtree.h

doc_loadbios jffs2reader rbtree.o

doc_loadbios.c jffs2reader.c recv_image

doc_loadbios.o jffs2reader.o recv_image.c

feature-removal-schedule.txt jffs-dump.c recv_image.o

fectest.c lib rfddump

flashcp load_nandsim.sh rfddump.c

flashcp.c make_a_release.sh rfddump.o

flashcp.o MAKEDEV rfdformat

flash_erase Makefile rfdformat.c

flash_eraseall mcast_image.h rfdformat.o

flash_erase.c mkfs.jffs2 serve_image

flash_erase.o mkfs.jffs2.1 serve_image.c

flash_lock mkfs.jffs2.c serve_image.o

flash_lock.c mkfs.jffs2.o summary.h

flash_lock.o mkfs.ubifs sumtool

flash_otp_dump mtd_debug sumtool.c

flash_otp_dump.c mtd_debug.c sumtool.o

flash_otp_dump.o mtd_debug.o tests

flash_otp_info mtd-utils.spec ubi-utils

flash_otp_info.c nanddump

flash_otp_info.o nanddump.c

[leiyuxing@centos6 mtd-utils-1.4.9]$ file mkfs.jffs2

mkfs.jffs2: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, not stripped

[leiyuxing@centos6 mtd-utils-1.4.9]$ sudo cp mkfs.jffs2 /usr/local/bin/

[leiyuxing@centos6 mtd-utils-1.4.9]$ mkfs

mkfs mkfs.ext2 mkfs.ext4 mkfs.jffs2 mkfs.vfat

mkfs.cramfs mkfs.ext3 mkfs.ext4dev mkfs.msdos

[leiyuxing@centos6 mtd-utils-1.4.9]$ mkfs.jffs2 -V

mkfs.jffs2: error!: revision 1.60

[leiyuxing@centos6 mtd-utils-1.4.9]$ mkfs.jffs2

mkfs.jffs2: error!: Usage: mkfs.jffs2 [OPTIONS]

Make a JFFS2 file system image from an existing directory tree



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

-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

 4.制作映像文件

[leiyuxing@centos6 rootfs]$ sudo /usr/local/bin/mkfs.jffs2 -n -s 2048 -e 128KiB -d rootfs -o rootfs.jffs2 --pad=0x1400000

[leiyuxing@centos6 rootfs]$ du -h rootfs.jffs2

20M rootfs.jffs2

5.添加uboot对jffs2支持

根据上面内核对nandlfash的分区,对uboot的环境参数做相应的设置:

[fl2440@lingyun]# set bjffs2 'tftp 30008000 rootfs.jffs2;nand erase 1000000 4000000;nand write.jffs2 30008000 1000000 1400000'

[fl2440@lingyun]# set bootargs_jffs2 'noinitrd root=/dev/mtdblock2 rootfstype=jffs2 init=/linuxrc console=ttyS0,115200'

[fl2440@lingyun]# set bootargs 'noinitrd root=/dev/mtdblock2 rootfstype=jffs2 init=/linuxrc console=ttyS0,115200'

[fl2440@lingyun]# set bootcmd_jffs2 'nand read 30008000 100000 400000;bootm 30008000'

[fl2440@lingyun]# set bootcmd 'run bootcmd_jffs2'

[fl2440@lingyun]# save

Saving Environment to NAND...

Erasing Nand...

Erasing at 0x60000 -- 100% complete.

Writing to Nand... done

[fl2440@lingyun]# pri

bbl=tftp 30008000 u-boot-s3c2440.bin;nand erase 0 100000;nand write 30008000 0 40000

blx=tftp 30008000 linuxrom-s3c2440.bin;nand erase 100000 F00000;nand write 30008000 100000 F00000

tb=tftp 30008000 linuxrom-s3c2440.bin; bootm 30008000

bootdelay=2

baudrate=115200

ethaddr=08:00:3e:26:0a:51

ethact=dm9000

filesize=2BC9B4

fileaddr=30008000

netmask=255.255.255.0

ipaddr=192.168.1.168

serverip=192.168.1.2

bkr=tftp 30008000 linuxrom-s3c2440.bin;nand erase 100000 8000000;nand write 30008000 100000 800000

bootcmd_initramdisk=nand read 30008000 100000 800000;bootm 30008000

stdin=serial

stdout=serial

stderr=serial

bjffs2=tftp 30008000 rootfs.jffs2;nand erase 1000000 4000000;nand write.jffs2 30008000 1000000 1400000

bootargs_jffs2=noinitrd root=/dev/mtdblock2 rootfstype=jffs2 init=/linuxrc console=ttyS0,115200

bootargs=noinitrd root=/dev/mtdblock2 rootfstype=jffs2 init=/linuxrc console=ttyS0,115200

bootcmd_jffs2=nand read 30008000 100000 400000;bootm 30008000

bootcmd=run bootcmd_jffs2



Environment size: 988/131068 bytes

下载内核和rootfs.jffs2映像文件

[fl2440@lingyun]#  run bkr

dm9000 i/o: 0x20000300, id: 0x90000a46

DM9000: running in 16 bit mode

MAC: 08:00:3e:26:0a:51

could not establish link

operating at 100M full duplex mode

Using dm9000 device

TFTP from server 192.168.1.2; our IP address is 192.168.1.168

Filename 'linuxrom-s3c2440.bin'.

Load address: 0x30008000

Loading: #################################################################

#################################################################

#########################

done

Bytes transferred = 2264844 (228f0c hex)



NAND erase: device 0 offset 0x100000, size 0x8000000

Skipping bad block at 0x005c0000

Skipping bad block at 0x031a0000

Erasing at 0x80e0000 -- 100% complete.

OK



NAND write: device 0 offset 0x100000, size 0x800000

Skip bad block 0x005c0000

8388608 bytes written: OK

[fl2440@lingyun]# run bjffs2

dm9000 i/o: 0x20000300, id: 0x90000a46

DM9000: running in 16 bit mode

MAC: 08:00:3e:26:0a:51

could not establish link

operating at 100M full duplex mode

Using dm9000 device

TFTP from server 192.168.1.2; our IP address is 192.168.1.168

Filename 'rootfs.jffs2'.

Load address: 0x30008000

Loading: T #################################################################

#################################################################

#################################################################

#################################################################

#################################################################

#################################################################

#################################################################

#################################################################

#################################################################

#################################################################

#################################################################

#################################################################

#################################################################

#################################################################

#################################################################

#################################################################

#################################################################

#################################################################

#################################################################

#################################################################

#################################################################

################################################################

done

Bytes transferred = 20971520 (1400000 hex)



NAND erase: device 0 offset 0x1000000, size 0x4000000

Skipping bad block at 0x031a0000

Erasing at 0x4fe0000 -- 100% complete.

OK



NAND write: device 0 offset 0x1000000, size 0x1400000

20971520 bytes written: OK

6.启动引导

[fl2440@lingyun]# boot

NAND read: device 0 offset 0x100000, size 0x400000

4194304 bytes read: OK

## Booting kernel from Legacy Image at 30008000 ...

Image Name: Linux Kernel

Created: 2016-07-22 13:00:43 UTC

Image Type: ARM Linux Kernel Image (uncompressed)

Data Size: 2264780 Bytes = 2.2 MiB

Load Address: 30008040

Entry Point: 30008040

Verifying Checksum ... OK

Loading Kernel Image ... OK

OK



Starting kernel ...



Uncompressing Linux... done, booting the kernel.

Linux version 3.0.0 (leiyuxing@centos6.7.localdomain) (gcc version 4.5.4 (Buildroot 2012.08) ) #7 Fri Jul 22 21:00:28 CST 2016

CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177

CPU: VIVT data cache, VIVT instruction cache

Machine: SMDK2440

Memory policy: ECC disabled, Data cache writeback

CPU S3C2440A (id 0x32440001)

S3C24XX Clocks, Copyright 2004 Simtec Electronics

S3C244X: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 MHz

CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on

Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256

Kernel command line: noinitrd root=/dev/mtdblock2 rootfstype=jffs2 init=/linuxrc console=ttyS0,115200

PID hash table entries: 256 (order: -2, 1024 bytes)

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

Memory: 64MB = 64MB total

Memory: 60184k/60184k available, 5352k reserved, 0K highmem

Virtual kernel memory layout:

vector : 0xffff0000 - 0xffff1000 ( 4 kB)

fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)

DMA : 0xffc00000 - 0xffe00000 ( 2 MB)

vmalloc : 0xc4800000 - 0xf6000000 ( 792 MB)

lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)

modules : 0xbf000000 - 0xc0000000 ( 16 MB)

.init : 0xc0008000 - 0xc0029000 ( 132 kB)

.text : 0xc0029000 - 0xc0442000 (4196 kB)

.data : 0xc0442000 - 0xc0465d40 ( 144 kB)

.bss : 0xc0465d64 - 0xc049da70 ( 224 kB)

SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1

NR_IRQS:85

irq: clearing pending ext status 00080800

irq: clearing pending ext status 00080000

irq: clearing subpending status 00000003

irq: clearing subpending status 00000002

Console: colour dummy device 80x30

console [ttyS0] enabled

Calibrating delay loop... 201.52 BogoMIPS (lpj=503808)

pid_max: default: 32768 minimum: 301

Mount-cache hash table entries: 512

CPU: Testing write buffer coherency: ok

gpiochip_add: gpios 288..303 (GPIOK) failed to register

gpiochip_add: gpios 320..334 (GPIOL) failed to register

gpiochip_add: gpios 352..353 (GPIOM) failed to register

NET: Registered protocol family 16

S3C Power Management, Copyright 2004 Simtec Electronics

S3C2440: Initialising architecture

S3C2440: IRQ Support

S3C244X: Clock Support, DVS off

bio: create slab <bio-0> at 0

SCSI subsystem initialized

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

s3c-i2c s3c2440-i2c: slave address 0x10

s3c-i2c s3c2440-i2c: bus frequency set to 98 KHz

s3c-i2c s3c2440-i2c: i2c-0: S3C I2C adapter

Advanced Linux Sound Architecture Driver Version 1.0.24.

cfg80211: Calling CRDA to update world regulatory domain

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 2048 (order: 2, 16384 bytes)

TCP bind hash table entries: 2048 (order: 1, 8192 bytes)

TCP: Hash tables configured (established 2048 bind 2048)

TCP reno registered

UDP hash table entries: 256 (order: 0, 4096 bytes)

UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)

NET: Registered protocol family 1

RPC: Registered named UNIX socket transport module.

RPC: Registered udp transport module.

RPC: Registered tcp transport module.

RPC: Registered tcp NFSv4.1 backchannel transport module.

NetWinder Floating Point Emulator V0.97 (extended precision)

NTFS driver 2.1.30 [Flags: R/W].

JFFS2 version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.

ROMFS MTD (C) 2007 Red Hat, Inc.

msgmni has been set to 117

io scheduler noop registered

io scheduler deadline registered

io scheduler cfq registered (default)

Console: switching to colour frame buffer device 60x53

fb0: s3c2410fb frame buffer device

s3c2440-uart.0: ttyS0 at MMIO 0x50000000 (irq = 70) is a S3C2440

s3c2440-uart.1: ttyS1 at MMIO 0x50004000 (irq = 73) is a S3C2440

s3c2440-uart.2: ttyS2 at MMIO 0x50008000 (irq = 76) is a S3C2440

brd: module loaded

loop: module loaded

S3C24XX NAND Driver, (c) 2004 Simtec Electronics

s3c24xx-nand s3c2440-nand: Tacls=3, 29ns Twrph0=7 69ns, Twrph1=3 29ns

s3c24xx-nand s3c2440-nand: NAND soft ECC

NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)

Scanning device for bad blocks

Bad eraseblock 46 at 0x0000005c0000

Bad eraseblock 397 at 0x0000031a0000

Creating 6 MTD partitions on "NAND":

0x000000000000-0x000000100000 : "mtdblock0 u-boot 1MB"

0x000000100000-0x000001000000 : "mtdblock1 kernel 15MB"

0x000001000000-0x000005000000 : "mtdblock2 rootfs 64MB"

0x000005000000-0x00000a000000 : "mtdblock3 apps 80MB"

0x00000a000000-0x00000d000000 : "mtdblock4 data 48MB"

0x00000d000000-0x000010000000 : "mtdblock5 backup 48MB"

dm9000 Ethernet Driver, V1.31

ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver

s3c2410-ohci s3c2410-ohci: S3C24XX OHCI

s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1

s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 2 ports detected

usbcore: registered new interface driver libusual

s3c2410_udc: debugfs dir creation failed -19

mousedev: PS/2 mouse device common for all mice

S3C24XX RTC, (c) 2004,2006 Simtec Electronics

i2c /dev entries driver

sdhci: Secure Digital Host Controller Interface driver

sdhci: Copyright(c) Pierre Ossman

usbcore: registered new interface driver usbhid

usbhid: USB HID core driver

ALSA device list:

No soundcards found.

TCP cubic registered

NET: Registered protocol family 17

lib80211: common routines for IEEE802.11 drivers

Registering the dns_resolver key type

drivers/rtc/hctosys.c: unable to open rtc device (rtc0)

usb 1-1: new full speed USB device number 2 using s3c2410-ohci

usb 1-1: device descriptor read/64, error -62

usb 1-1: device descriptor read/64, error -62

usb 1-1: new full speed USB device number 3 using s3c2410-ohci

usb 1-1: device descriptor read/64, error -62

VFS: Mounted root (jffs2 filesystem) on device 31:2.

Freeing init memory: 132K

usb 1-1: device descriptor read/64, error -62

usb 1-1: new full speed USB device number 4 using s3c2410-ohci

usb 1-1: device not accepting address 4, error -62

usb 1-1: new full speed USB device number 5 using s3c2410-ohci

usb 1-1: device not accepting address 5, error -62

hub 1-0:1.0: unable to enumerate USB device on port 1



Copyright (C) 2016 Reagan

root login: root

Password:

>: ls

apps data etc init linuxrc proc sbin tmp var

bin dev info lib mnt root sys usr

这样jffs2文件系统就自作成功

制作过程中遇到的问题

问题一:

[leiyuxing@centos6 mtd-utiles]$ sh build.sh后遇到如下问题:

jffs2文件系统制作与移植_文件系统

 

解决方法:

静态编译时需要将所有的.a库链接到可执行程序中,所以需要libc的静态库文件,使用此命令查看rpm -ql glibc-static提示没有库文件,到下面的地址

​http://www.rpmfind.net/linux/rpm2html/search.php?query=libc.a&submit=Search+...​

下载glibc-static文件,使用 rpm -iv filename.rpm安装即可,调用find / -name libc.a可以看到libc的静态库,或则利用yum install glibc-static安装。

问题二:

解决方法:

[leiyuxing@centos6 mtd-utils-1.4.9]$ mkfs(按完mkfs后接着按Tab键即可查看,切记不可按Enter否则会出现如上错误)

mkfs mkfs.ext2 mkfs.ext4 mkfs.jffs2 mkfs.vfat

mkfs.cramfs mkfs.ext3 mkfs.ext4dev mkfs.msdos

问题三:

[leiyuxing@centos6 rootfs]$ sudo mkfs.jffs2 -n -s 2048 -e 128KiB -d rootfs -o rootfs.jffs2 --pad=0x1400000

sudo:mkfs.jffs2:找不到命令

解决方法:

[leiyuxing@centos6 rootfs]$ sudo cp mkfs.jffs2 /usr/local/bin/

因为之前已经将mkfs.jffs2拷贝到 /usr/local/bin/

[leiyuxing@centos6 rootfs]$ sudo /usr/local/bin/mkfs.jffs2 -n -s 2048 -e 128KiB -d rootfs -o rootfs.jffs2 --pad=0x1400000