1. 程式人生 > >jffs2檔案系統製作與移植

jffs2檔案系統製作與移植

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

主機作業系統:Centos 6.7交叉編譯器環境:arm-linux-gcc-4.5.4 開發板平臺: FL2440 Linux核心版本: linux-3.0 製作檔案系統型別:JFFS2
郵箱:[email protected]

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

                                                                                                                                                                                            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的支援

[[email protected] linux-3.0]$ export TERM=vt100

[[email protected] 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 

[[email protected] linux-3.0]$ make

3.製作mkfs.jffs2mkfs.ubifs工具

[[email protected] rootfs]$ mkdir mtd-utiles

[[email protected] rootfs]$ cd mtd-utiles/

[[email protected] 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 <[email protected]>
#|  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已寫入                             

[[email protected] mtd-utiles]$ ls

build.sh

[[email protected] mtd-utiles]$ sh build.sh

[[email protected] 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

[[email protected] mtd-utiles]$ cd mtd-utils-1.4.9

[[email protected] 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

[[email protected] 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

[[email protected] 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

[[email protected] 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

[[email protected] mtd-utils-1.4.9]$ sudo cp mkfs.jffs2 /usr/local/bin/

[[email protected] mtd-utils-1.4.9]$ mkfs

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

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

[[email protected] mtd-utils-1.4.9]$ mkfs.jffs2 -V

mkfs.jffs2: error!: revision 1.60

[[email protected] 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.製作映像檔案

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

[[email protected] rootfs]$ du -h rootfs.jffs2

20M     rootfs.jffs2

5.新增ubootjffs2支援

根據上面核心對nandlfash的分割槽,對uboot的環境引數做相應的設定:

[[email protected]]# set bjffs2 'tftp 30008000 rootfs.jffs2;nand erase 1000000 4000000;nand write.jffs2 30008000 1000000 1400000'

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

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

[[email protected]]# set bootcmd_jffs2 'nand read 30008000 100000 400000;bootm 30008000'

[[email protected]]# set bootcmd 'run bootcmd_jffs2'

[[email protected]]# save

Saving Environment to NAND...

Erasing Nand...

Erasing at 0x60000 -- 100% complete.

Writing to Nand... done

[[email protected]]# 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映像檔案

[[email protected]]#  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

[[email protected]]# 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.啟動引導

[[email protected]]# 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 ([email protected]) (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檔案系統就自作成功

製作過程中遇到的問題

問題一:

[[email protected] mtd-utiles]$ sh build.sh後遇到如下問題:


解決方法:

靜態編譯時需要將所有的.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安裝。

問題二:


解決方法:

[[email protected] 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

問題三:

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

sudo:mkfs.jffs2:找不到命令

解決方法:

[[email protected] rootfs]$ sudo cp mkfs.jffs2 /usr/local/bin/

因為之前已經將mkfs.jffs2拷貝到 /usr/local/bin/

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





相關推薦

jffs2檔案系統製作移植

——————————————————————————————————————— 主機作業系統:Centos 6.7交叉編譯器環境:arm-linux-gcc-4.5.4 開發板平臺: FL2440 Linux核心版本: linux-3.0 製作檔案系統型別:JFFS2郵箱

cramfs檔案系統製作移植(二)

[ [email protected] ]# bootm ## Booting kernel from Legacy Image at 30008000 ...    Image Name:   Linux Kernel    Created:      2013-04-23  12:05:15

Linux根檔案系統製作各種掛載方式的實現

Linux根檔案系統的製作 什麼是檔案系統 計算機的檔案系統是一種儲存和組織計算機資料的方法,它使得對其訪問和查詢變得容易,檔案系統使用檔案和樹形目錄的抽象邏輯概念代替了硬碟和光碟等物理裝置使用資料塊的概念,使用者使用檔案系統來儲存資料不必關心資料實際儲存在硬碟(或者光碟)的地址為多少的資料

jffs2檔案系統製作

U-Boot 2010.09-00000-g1a87d59 (Jun 01 2011 - 21:21:30) Modified by guowenxue for s3c2440/s3c2410 board. DRAM:  64 MiB Flash: 1 MiB NAND:  256 MiB In:    se

ramdisk檔案系統製作移植

[ [email protected] ]# pri bbl=nand erase 0 100000;tftp 30008000 u-boot-$cpu.bin;nand write 30008000 0 $filesize norbbl=erase bank 1;tftp 30008000 u-b

jffs2檔案系統製作(適用於spi nor flash)

mkfs.jffs2: Usage: mkfs.jffs2 [OPTIONS] Make a JFFS2 file system image from an existing directory tree Options: -p, --pad[=SIZE]       用16進位制來表示所要輸出檔案的大小,也

NFS檔案系統製作移植

**************************************************************************************************

jffs2檔案系統製作以及移植

[ [email protected] yangzheng ]# boot NANDread: device 0 offset 0x100000, size 0x27c800  2607104 bytes read: OK ##Booting kernel from Legacy Image a

cpio命令檔案系統製作

嵌入式開發過程中的檔案系統製作,往往是使用已經定製好的目錄及檔案進行製作,下面以實際的例子進行說明: 假設當前目錄為rootdir,目錄結構如下: [email protected]:~# tree -L 2 rootdir rootdir |-- dev |--

Linux核心移植和根檔案系統製作(詳細步驟精講)

start_kernel是所有 Linux 平臺進入系統核心初始化後的入口函式,它主要完成剩餘的與硬體平臺相關的初始化工作,在進行一系列與核心相關的初始化後,呼叫第一個使用者程序-init 程序並等待使用者程序的執行,這樣整個 Linux 核心便啟動完畢。該函式所做的具體工作有:呼叫 setup_arch

檔案系統製作(cramfs,jffs2)及busybox編譯

1.cramfs製作 cramfs-1.1.tar.gz >mkcramfs rootfs root.cramfs 2.jffs2製作 下載:mtd-utils-1.5.0.tar.bz2 》cd mtd-utils-1.5.0 >make >make

Linux-2.6.32.2核心在mini2440上的移植(四)---根檔案系統製作(1)

ROMFS MTD (C) 2007 Red Hat, Inc.msgmni has been set to 109 alg: No test for stdrng (krng) io scheduler noop registered io scheduler anticipatory registered

LINUX移植——根檔案系統製作(一)

上一篇文章當中,說了說怎樣搭建nfs伺服器的過程,這也是製作根檔案系統前必須的準備工作,當然也可以用其他方法,但從除錯的角度來說,還是nfs最適合了。這篇文章咱們正式開始製作根檔案系統,主要內容如下:

【原創】Linux 系統移植日誌----jffs2檔案系統定製

【原創】Linux 系統移植日誌—-jffs2檔案系統定製 DATE:2011-9-13 目標: 熟練u-boot、linux系統、檔案系統的優化裁剪;精通系統移植;精通linux系統、檔案系統、uboot原理等。 第一天,嘗試在AT91SAM9

UBIFS檔案系統簡介 利用mkfs.ubifs和ubinize兩個工具製作UBI映象

UBI檔案系統簡介在linux-2.6.27以前,談到Flash檔案系統,大家很多時候多會想到cramfs、jffs2、yaffs2等檔案系統。它們也都是基於檔案系 統+mtd+flash裝置的架構。linux-2.6.27後,核心加入了一種新型的flash檔案系統UBI(

arm-linux移植手記(四)基於busybox1.16.0的根檔案系統製作

    參考《Mini2440_Linux移植開發實戰指南.pdf》中的“使用 Busybox 構建檔案系統”,還是有些問題,我自己的為主要原因。詳細的檔案系統的介紹與理解,自己搜尋檢視相關資料吧,我這裡僅是記錄操作步驟與遇到的問題。指南手冊可以在我的資源中下載。環境介紹:

squashfs檔案系統分析製作

前段時間遇到一個海思Hi3519開發板,檔案系統較特殊,是squashfs,檔案系統的特點是隻讀,使用mount -o remout,rw 無法更改為rw,以為之前沒有遇到過,就研究了一下: 使用squashfs-tools分析檔案系統映象,並製作自己的檔案系統 使用squ

FastDFS分散式檔案系統配置部署

一文搞定FastDFS分散式檔案系統配置與部署 閱讀目錄 1 分散式檔案系統介紹 2 系統架構介紹 3 FastDFS效能方案 4 Linux基本命令操作 5 安裝VirtualBox虛擬機器並配置Ubuntu

簡單的成績錄入系統製作小問題

  1,首頁是每個人的登入頁面,需要通過正則表示式驗證輸入是否為空,需要將使用者名稱和資料庫中的密碼進行對比,否則無法進入自己的介面; 2,點選首頁中的新增記錄,跳轉第二個頁面,選擇第n次成績,錄入分數,則往資料庫新增某同學的成績,最後提交,系統詢問:無法更改請確認無誤,提交之後資

分散式小檔案系統fastdfsweedfs的對比

最近拿一臺雙核1G的kvm vps搭建了一個圖片的伺服器,前面用百度雲加速扛著,有了個專業圖片儲存及CDN的樣子。每天還是有50W左右的PV,流量在30G左右。總結一下最近接觸過的兩個分散式小檔案系統weedfs和fastdfs。 fastdfs的詳細介紹看這裡=》 傳