From: "Roger Feltrin Escanhola" <[EMAIL PROTECTED]>
Reply-To: uClinux development list <[email protected]>
To: "'uClinux development list'" <[email protected]>
Subject: RES: [uClinux-dev] How to mount a jffs2 in M5208EVB
Date: Fri, 18 May 2007 17:53:27 -0300
I finally got to build the uClinux so I could try to mount the jffs2.
But now I have another problem. I get the following error when I try to
mount JFFS2 (mount -t jffs2 /dev/mtdblock1 /mnt):
arena open of 1 failed!
mount: Mounting /dev/mtdblock1 on /mnt failed: No such device
Any Idea how to fix this?
Bellow I am coping the uClinux initialization from the image I’ve built.
Linux version 2.4.32-uc0 ([EMAIL PROTECTED]) (gcc version 4.1.1) #5 Fri May
18 16:25:56 BRT 2007
uClinux/COLDFIRE(m5208)
COLDFIRE port done by Greg Ungerer, [EMAIL PROTECTED]
Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne
On node 0 totalpages: 8159
zone(0): 0 pages.
zone(1): 8159 pages.
BUG: wrong zone alignment, it will crash
zone(2): 0 pages.
Kernel command line:
Calibrating delay loop... 109.77 BogoMIPS
Memory available: 30620k/32767k RAM, 0k/0k ROM (752k kernel code, 208k
data)
kmem_create: Forcing size word alignment - mm_struct
kmem_create: Forcing size word alignment - filp
Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)
Inode cache hash table entries: 2048 (order: 2, 16384 bytes)
kmem_create: Forcing size word alignment - inode_cache
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
kmem_create: Forcing size word alignment - bdev_cache
kmem_create: Forcing size word alignment - cdev_cache
kmem_create: Forcing size word alignment - kiobuf
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
kmem_create: Forcing size word alignment - file_lock_cache
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis
Communications AB.
ColdFire internal UART serial driver version 1.00
ttyS0 at 0xfc060000 (irq = 90) is a builtin ColdFire UART
ttyS1 at 0xfc064000 (irq = 91) is a builtin ColdFire UART
ttyS2 at 0xfc068000 (irq = 92) is a builtin ColdFire UART
kmem_create: Forcing size word alignment - blkdev_requests
fec.c: Probe number 1 with 0x0000
eth0: FEC ENET Version 0.2, 00:14:15:00:01:2b
fec: PHY @ 0x1, ID 0x20005c90 -- DP83848
Blkmem copyright 1998,1999 D. Jeff Dionne
Blkmem copyright 1998 Kenneth Albanowski
Blkmem 1 disk images:
0: 4011034C-401BCB4B [VIRTUAL 4011034C-401BCB4B] (RO) <ROMFS>
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
m5208 flash device: 200000 at 0
Amd/Fujitsu Extended Query Table v1.3 at 0x0040
number of CFI chips: 1
cfi_cmdset_0002: Disabling fast programming due to code brokenness.
Creating 3 MTD partitions on "Am29BDD160G 2.5v flash device (2MB) kernel
2.4.x":
0x00000000-0x00040000 : "dBUG teste (256K)"
0x00040000-0x000e0000 : "User FS (640K)"
0x000e0000-0x00200000 : "Kernel + RootFS (1152K)"
Can't allocate major number 31 for Memory Technology Devices.
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
kmem_create: Forcing size word alignment - ip_dst_cache
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 2048 bind 4096)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000:
0x4001 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000000bc:
0x0002 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000400:
0x46fc instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000404:
0x4ef9 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000408:
0xef64 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00004000:
0x0001 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00004004:
0x00c0 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00004008:
0x8bc0 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000400c:
0x33c0 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00004010:
0x01ff instead
Further such events for this erase block will not be printed
JFFS2: Erase block at 0x00000000 is not formatted. It will be erased
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010000:
0x4eb9 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010004:
0x0cf0 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010008:
0x4a80 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0001000c:
0xfd88 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010010:
0xfc04 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010014:
0x6000 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010018:
0x2f02 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0001001c:
0x0002 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010020:
0x4eb9 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010024:
0x0cf0 instead
Further such events for this erase block will not be printed
JFFS2: Erase block at 0x00010000 is not formatted. It will be erased
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020000:
0x0682 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020004:
0x0080 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020008:
0xff2a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0002000c:
0x0c3c instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020010:
0x4e5e instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020014:
0x4e56 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020018:
0x48d7 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0002001c:
0x246e instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020020:
0x2f12 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020028:
0x2400 instead
Further such events for this erase block will not be printed
JFFS2: Erase block at 0x00020000 is not formatted. It will be erased
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0003001c:
0x2000 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030024:
0x2000 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030028:
0x2000 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0003002c:
0x2000 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030030:
0x4000 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030034:
0x2000 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030038:
0x6000 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0003003c:
0x2000 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030040:
0x8000 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030044:
0x2000 instead
Further such events for this erase block will not be printed
JFFS2: Erase block at 0x00030000 is not formatted. It will be erased
Cowardly refusing to erase blocks on filesystem with no valid JFFS2
nodes
VFS: Mounted root (romfs filesystem) readonly.
Freeing unused kernel memory: 28k freed (0x400e6000 - 0x400ec000)
Shell invoked to run file: /etc/rc
Command: hostname uClinux
Command: /bin/expand /etc/ramfs.img /dev/ram1
Command: mount -t proc proc /proc
Command: mount -t ext2 /dev/ram1 /var
Command: mkdir /var/tmp
Command: mkdir /var/log
Command: mkdir /var/run
Command: mkdir /var/lock
Command: mkdir /var/empty
Command: mkdir /var/dhcpc
Command: ifconfig lo 127.0.0.1
ifconfig: Bad command or file name
Command: route add -net 127.0.0.0 netmask 255.0.0.0 lo
route: Bad command or file name
Command: dhcpcd -p -a eth0 &
eth0: config: auto-negotiation on, 100FDX, 100HDX, 10FDX, 10HDX.
[13]
Command: cat /etc/motd
Welcome to
____ _ _
/ __| ||_|
_ _| | | | _ ____ _ _ _ _
| | | | | | || | _ \| | | |\ \/ /
| |_| | |__| || | | | | |_| |/ \
| ___\____|_||_|_| |_|\____|\_/\_/
| |
|_|
For further information check:
http://www.uclinux.org/
Execution Finished, Exiting
Sash command shell (version 1.1.1)
/> Nov 30 00:00:08 dhcpcd[13]: dhcpConfig: failed to update
/etc/resolv.conf: Read-only file system
Nov 30 00:00:08 dhcpcd[13]: dhcpConfig: failed to write cache file
/etc/dhcpc/dhcpcd-eth0.cache: No such file or directory
Nov 30 00:00:08 dhcpcd[13]: dhcpConfig: failed to write info file
/etc/dhcpc/dhcpcd-eth0.info: No such file or directory
/> cat /proc/md td
dev: size erasesize name
mtd0: 00040000 00010000 "dBUG teste (256K)"
mtd1: 000a0000 00010000 "User FS (640K)"
mtd2: 00120000 00010000 "Kernel + RootFS (1152K)"
/> cd tmp
/var/tmp> mkdir fs
/var/tmp> mkdir jffs2
/var/tmp> mkdir jffs2/bin
/var/tmp> cd jffs2
/var/tmp/jffs2> vi
vi: Bad command or file name
/var/tmp/jffs2> touch teste0
/var/tmp/jffs2> ls
bin
teste0
/var/tmp/jffs2> cd ..
/var/tmp> mkjfs.jffs2 -d jffs2 -o jffs2.img
/var/tmp> ls
fs
jffs2
jffs2.img
/var/tmp> ls 0 -l
drwxr-xr-x 2 0 0 1024 Nov 30 00:02 fs
drwxr-xr-x 3 0 0 1024 Nov 30 00:03 jffs2
-rw-r--r-- 1 0 0 228 Nov 30 00:04 jffs2.img
/var/tmp> erase /dev/mtd1
Erase Total 1 Units
Erase Unit Size 0x10000,
Performing Flash Erase of length 65536 at offset 0x0 done
/var/tmp> cp jffs2.img /dev/mtd1
/var/tmp> mount -t jffs2 /dev/mtdblock1 /mnt
arena open of 1 failed!
mount: Mounting /dev/mtdblock1 on /mnt failed: No such device
/var/tmp>
Notice this line in initialization:
Can't allocate major number 31 for Memory Technology Devices.
What does mean? Is it a problem for me?
Regards
Roger
-----Mensagem original-----
De: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Em nome de Roger Feltrin
Escanhola
Enviada em: quarta-feira, 16 de maio de 2007 16:56
Para: [email protected]
Assunto: [uClinux-dev] How to mount a jffs2 in M5208EVB
Hi,
I am using my M5208EVB (Freescale evaluating board ) to make a GPRS
router using uClinux. It was going fine, but now I need a non-volatile
memory to save some files and initialize them when then uclinux starts.
So I am trying to mount jffs2 to create a folder (/mnt/flash) where I
can save my files.
I have built a different uClinux image (using menuconfig – toolchain:
m68k-uclinux-tools-20060615.sh) with some programs to make my router
works (for example: pppd, chat, ifconfig …), but I am having problems to
mount my jffs2.
I’ve found this site
http://www.enseirb.fr/~kadionik/embedded/uclinux/mtd/howto_mtd.html that
teaches how to mount jffs2 for a M5407C3 Motorola board and FLASH memory
(AMD Am29PL160C). I tried to build 2 different images: one where I
change the uClinux-dist/linux-2.4.x/drivers/mtd/maps/physmap.c to choose
the partitions that I want in my flash memory, and the other way that I
choose in menuconfig to use
uClinux-dist/linux-2.4.x/drivers/mtd/maps/m5208.c (default file for
M5208EVB), but in both cases I get errors during the make process.
Bellow I’m coping these errors messages:
////////////////////////////////////////////////////////////////////////
////////////////////
Error when I try to modify
uClinux-dist/linux-2.4.x/drivers/mtd/maps/physmap.c
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
\\\\\\\
/home/roger/uClinux-dist/user/busybox/libbb/bb_vfprintf.o
/home/roger/uClinux-dist/user/busybox/libbb/bb_vprintf.o
/home/roger/uClinux-dist/user/busybox/libbb/bb_fprintf.o
/home/roger/uClinux-dist/user/busybox/libbb/bb_printf.o
/home/roger/uClinux-dist/user/busybox/libbb/xgetularg_bnd_sfx.o
/home/roger/uClinux-dist/user/busybox/libbb/xgetlarg_bnd_sfx.o
/home/roger/uClinux-dist/user/busybox/libbb/getlarg10_sfx.o
/home/roger/uClinux-dist/user/busybox/libbb/xgetularg_bnd.o
/home/roger/uClinux-dist/user/busybox/libbb/xgetularg10_bnd.o
/home/roger/uClinux-dist/user/busybox/libbb/xgetularg10.o
/home/roger/uClinux-dist/user/busybox/libbb/safe_strtoi.o
/home/roger/uClinux-dist/user/busybox/libbb/safe_strtod.o
/home/roger/uClinux-dist/user/busybox/libbb/safe_strtol.o
/home/roger/uClinux-dist/user/busybox/libbb/safe_strtoul.o
m68k-elf-ar: creating
/home/roger/uClinux-dist/user/busybox/libbb/libbb.a
ucfront-gcc m68k-elf-gcc -m5307 -DCONFIG_COLDFIRE -Wl,--fatal-warnings
-Wl,-elf2flt -Wl,-move-rodata -msep-data -Wl,--fatal-warnings
-Wl,-elf2flt -Wl,-move-rodata -msep-data -Wl,-warn-common
-Wl,-warn-common -o busybox -Wl,--start-group
/home/roger/uClinux-dist/user/busybox/applets/applets.a
/home/roger/uClinux-dist/user/busybox/archival/archival.a
/home/roger/uClinux-dist/user/busybox/archival/libunarchive/libunarchive
.a /home/roger/uClinux-dist/user/busybox/coreutils/coreutils.a
/home/roger/uClinux-dist/user/busybox/console-tools/console-tools.a
/home/roger/uClinux-dist/user/busybox/debianutils/debianutils.a
/home/roger/uClinux-dist/user/busybox/editors/editors.a
/home/roger/uClinux-dist/user/busybox/findutils/findutils.a
/home/roger/uClinux-dist/user/busybox/init/init.a
/home/roger/uClinux-dist/user/busybox/miscutils/miscutils.a
/home/roger/uClinux-dist/user/busybox/modutils/modutils.a
/home/roger/uClinux-dist/user/busybox/networking/networking.a
/home/roger/uClinux-dist/user/busybox/networking/libiproute/libiproute.a
/home/roger/uClinux-dist/user/busybox/networking/udhcp/udhcp.a
/home/roger/uClinux-dist/user/busybox/procps/procps.a
/home/roger/uClinux-dist/user/busybox/loginutils/loginutils.a
/home/roger/uClinux-dist/user/busybox/shell/shell.a
/home/roger/uClinux-dist/user/busybox/sysklogd/sysklogd.a
/home/roger/uClinux-dist/user/busybox/util-linux/util-linux.a
/home/roger/uClinux-dist/user/busybox/libpwdgrp/libpwdgrp.a
/home/roger/uClinux-dist/user/busybox/coreutils/libcoreutils/libcoreutil
s.a /home/roger/uClinux-dist/user/busybox/libbb/libbb.a -Wl,--end-group
#m68k-elf-strip --remove-section=.note --remove-section=.comment busybox
/bin/sh /home/roger/uClinux-dist/user/busybox/applets/busybox.mkll
include/config.h /home/roger/uClinux-dist/user/busybox/include/applets.h
>busybox.links
mkdir -p docs
( cat /home/roger/uClinux-dist/user/busybox/docs/busybox_header.pod; \
/home/roger/uClinux-dist/user/busybox/docs/autodocifier.pl
/home/roger/uClinux-dist/user/busybox/include/usage.h; \
cat /home/roger/uClinux-dist/user/busybox/docs/busybox_footer.pod )
> docs/busybox.pod
BusyBox Documentation
mkdir -p docs
pod2text docs/busybox.pod > docs/BusyBox.txt
mkdir -p docs
pod2man --center=BusyBox --release="version 1.00" \
docs/busybox.pod > docs/BusyBox.1
pod2html --noindex docs/busybox.pod > \
docs/busybox.net/BusyBox.html
mkdir -p docs
make[4]: Leaving directory `/home/roger/uClinux-dist/user/busybox'
make[3]: Leaving directory `/home/roger/uClinux-dist/user/busybox'
make[2]: Leaving directory `/home/roger/uClinux-dist/user'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/roger/uClinux-dist/user'
make: *** [subdirs] Error 1
[EMAIL PROTECTED] uClinux-dist]#
////////////////////////////////////////////////////////////////////////
////////////////////
Erro Error when I use uClinux-dist/linux-2.4.x/drivers/mtd/maps/m5208.c
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
\\\\\\\
/home/roger/uClinux-dist/linux-2.4.x/include/linux/ncp.h:174: warning:
�packed’ attribute ignored for field of type �__u8’
binfmt_flat.c: In function �calc_v5_reloc’:
binfmt_flat.c:385: warning: unused variable �opcode’
binfmt_flat.c:385: warning: unused variable �offset’
binfmt_flat.c:384: warning: unused variable �usptr’
rm -f fs.o
m68k-elf-ld -r -o fs.o open.o read_write.o devices.o file_table.o
buffer.o super.o block_dev.o char_dev.o stat.o exec.o pipe.o namei.o
fcntl.o ioctl.o readdir.o select.o fifo.o locks.o dcache.o inode.o
attr.o bad_inode.o file.o iobuf.o dnotify.o filesystems.o namespace.o
seq_file.o xattr.o quota.o binfmt_script.o binfmt_flat.o proc/proc.o
partitions/partitions.o ext2/ext2.o ramfs/ramfs.o nfs/nfs.o nfsd/nfsd.o
lockd/lockd.o nls/nls.o smbfs/smbfs.o jffs2/jffs2.o romfs/romfs.o
make[3]: Leaving directory `/home/roger/uClinux-dist/linux-2.4.x/fs'
make[2]: Leaving directory `/home/roger/uClinux-dist/linux-2.4.x/fs'
m68k-elf-ld -T arch/m68knommu/platform/5208/M5208EVB/ram.ld
arch/m68knommu/platform/5208/M5208EVB/crt0_ram.o init/main.o
init/version.o init/do_mounts.o \
--start-group \
arch/m68knommu/kernel/kernel.o arch/m68knommu/mm/mm.o
arch/m68knommu/platform/5208/platform.o kernel/kernel.o
mmnommu/mmnommu.o fs/fs.o ipc/ipc.o \
drivers/char/char.o drivers/serial/serial.o
drivers/block/block.o drivers/misc/misc.o drivers/net/net.o
drivers/net/wan/wan.o drivers/mtd/mtdlink.o drivers/media/media.o \
net/network.o \
/home/roger/uClinux-dist/linux-2.4.x/lib/lib.a
arch/m68knommu/lib/lib.a
/usr/local/lib/gcc/m68k-uclinux/4.1.1//m5307/libgcc.a \
--end-group \
-o linux
drivers/mtd/mtdlink.o: In function `cleanup_m5208':
/home/roger/uClinux-dist/linux-2.4.x/drivers/mtd/maps/m5208.c:321:
undefined reference to `del_mtd_partitions'
drivers/mtd/mtdlink.o: In function `init_m5208':
/home/roger/uClinux-dist/linux-2.4.x/drivers/mtd/maps/m5208.c:267:
undefined reference to `add_mtd_partitions'
drivers/mtd/mtdlink.o: In function `m5208_ram_probe':
/home/roger/uClinux-dist/linux-2.4.x/drivers/mtd/maps/m5208.c:216:
undefined reference to `add_mtd_partitions'
make[1]: *** [linux] Error 1
make[1]: Leaving directory `/home/roger/uClinux-dist/linux-2.4.x'
make: *** [linux] Error 1
[EMAIL PROTECTED] uClinux-dist]#
In that site it says to build uClinux image using kernel 2.4.x, is there
any problem in using kernel 2.6.x? (ps: I also tried to build an image
using kernel 2.6.x and I also got errors during the compilation)
Does any one have any idea how I can solve my problem? Is there any
documentation that teaches how to do it?
Thanks,
Roger