免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2247 | 回复: 0

[BootLoader] 求助:jffs2 rootfilesystem 不能 boot [复制链接]

论坛徽章:
0
发表于 2014-03-13 13:04 |显示全部楼层
刚刚发布在了linux板块,现在在嵌入式里问问。 求版主放行。

各位大虾,小弟最近在玩at91sam9263的板子,参考了很多网上的相关教程,用重新make 的 kernel, 但是新的kernel貌似无法正常boot,遇到rcS: applet not found的问题,上网看了好像是rootfilesystem没有设置好,下面是我的一些基本的脚本:

(1)create_roofs_bash:
#!/bin/sh
echo "------Create rootfs------"
rm -fr rootfs
rm initramfs.cpio
mkdir rootfs
pushd rootfs

echo "------Create root,dev...------"
mkdir root dev etc boot tmp usr var sys proc lib mnt home
mkdir etc/init.d etc/rc.d etc/sysconfig lib/modules
mkdir usr/sbin usr/bin usr/lib usr/modules
echo "------Copy from busybox, rootfs-base, libs ------"
cp -aP /usr/ShuLiang/AT91SAM263-EK/busybox-1.22.1/_install/* .
ln -s bin/busybox init
cp -arP ../rootfs-base/* /usr/ShuLiang/AT91SAM263-EK/rootfilesystem/rootfs/
cp /usr/ShuLiang/AT91SAM263-EK/linux-3.13.5/System.map boot/
chown -R root.root ../rootfs

echo "------make node dev/console dev/null------"
mknod -m 600 dev/console c 5 1
mknod -m 600 dev/null c 1 3
chmod 666 dev/console
chmod 666 dev/null
mknod /dev/pts c 5 2
mkdir mnt/etc mnt/yaffs mnt/data mnt/temp mnt/jffs2
mkdir var/lib var/lock var/run var/tmp
chmod 1777 tmp
chmod 1777 var/tmp
chmod 777 etc/init.d/rcS

# Create cpio image
find . | cpio -H newc -o > ../initramfs.cpio

# Move out of working directroy
popd

(2)rootfs-base/etc/init.d/rcS
#!/bin/sh

echo "* Mounting /proc..."
mount -t proc /proc /proc

echo "* Mounting /dev..."
mount -t tmpfs mdev /dev

echo "* Mounting /sys..."
mount -t sysfs none /sys

echo "* Mounting /dev/pts..."
mkdir /dev/pts
mount -t devpts devpts /dev/pts

echo "* Mounting /dev/shm..."
mkdir /dev/shm
mount -t tmpfs none /dev/shm

echo "* Starting system loggers..."
syslogd -C
klogd

echo "* Creating devices..."
echo /sbin/mdev>/proc/sys/kernel/hotplug
/sbin/mdev -s

echo "* Configuring loopback interface..."
ifconfig lo 127.0.0.1

echo "* Setting hostname..."
hostname at91sam9263ek

#echo "* Running application start script..."
#/home/start.sh

(3).rootfs-base/etc/inittab:
::sysinit:/etc/init.d/rcS
::askfirst:-/bin/sh
::restart:/sbin/init
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
::shutdown:/sbin/swapoff -a

(4).rootfs-base/etc/group:
root:0:
daemon:1:
bin:2:
sys:3:
adm:4:
tty:5:
disk:6:
wheel:10:root
audio:29:
www-data:33:
utmp:43:
staff:50:
lock:54:
haldaemon:68:
dbus:81:
netdev:82:
ftp:83
nobody:99:
nogroup:99:
users:100:
default:x:1000:

(5).rootfs-base/etc/hosts:
127.0.0.1        localhost

(6).rootfs-base/etc/mdev.conf:
# system all-writablei devices
full 0:0 0666
null 0:0 0666
ptmx 0:0 0666
random 0:0 0666
tty 0:0 0666
zero 0:0 0666
# console devices
tty[0-9]* 0:5 0660
vc/[0-9]* 0:5 0660
# serial port devices
# s3c2410_serial0 0:5 0666 =ttySAC0
# s3c2410_serial1 0:5 0666 =ttySAC1
# s3c2410_serial2 0:5 0666 =ttySAC2
# s3c2410_serial3 0:5 0666 =ttySAC3
# loop
loop[0-9]* 0:0 0660 =loop/
# i2c devices
# i2c-0 0:0 0666 =i2c/0
# i2c-1 0:0 0666 =i2c/1
#frame buffer devices
fb[0-9] 0:0 0666
# input devices
mice 0:0 0666 =input/
mouse.* 0:0 0666 =input/
event.* 0:0 0666 =input/
ts.* 0:0 0660 =input/
# rtc devices
rtc0 0:0 0644 >rtc
rtc[1-9] 0:0 0644
# misc devices
mmcblk0p1 0:0 0600 =sdcard */bin/hotplug
sda1 0:0 0600 =udisk * /bin/hotplug

(7).rootfs-base/etc/passwd:
root:x:0:0:root:/root:/bin/sh
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:100:sync:/bin:/bin/sync
mail:x:8:8:mail:/var/spool/mail:/bin/sh
proxy:x:13:13:proxy:/bin:/bin/sh
www-data:x:33:33:www-data:/var/www:/bin/sh
backup:x:34:34:backup:/var/backups:/bin/sh
operator:x:37:37:Operator:/var:/bin/sh
haldaemon:x:68:68:hald:/:/bin/sh
dbus:x:81:81:dbus:/var/run/dbus:/bin/sh
ftp:x:83:83:ftp:/home/ftp:/bin/sh
nobody:x:99:99:nobody:/home:/bin/sh
sshd:x:103:99:Operator:/var:/bin/sh
default:x:1000:1000efault non-root user:/home/default:/bin/sh

(.rootfs-base/etc/profile:
ulimit -S -c 0 > /dev/null 2>&1
USER="`id -un`"
LOGNAME=$USER
PS1='[\u@\h \W]\# '
PATH=$PATH
HOSTNAME=`/bin/hostname`
export USER LOGNAME PS1 PATH





我的板子启动信息:
U-Boot 1.3.4 (Sep  9 2010 - 15:22:07)

DRAM:  64 MB
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   macb0
macb0: Starting autonegotiation...
macb0: Autonegotiation timed out (status=0x7849)
macb0: link down (status: 0x7849)
Hit any key to stop autoboot:  3  2  1  0

NAND read: device 0 offset 0x200000, size 0x23f5a8
2356648 bytes read: OK
## Booting kernel from Legacy Image at 22200000 ...
   Image Name:   Linux-3.13.5
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2356584 Bytes =  2.2 MB
   Load Address: 20008000
   Entry Point:  20008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
Linux version 3.13.5 (root@localhost.localdomain) (gcc version 4.7.3 (Buildroot 2013.11) ) #65 PREEMPT Thu Mar 13 02:01:10 SGT 2014
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Atmel AT91SAM9263-EK
Ignoring unrecognised tag 0x54410008
Memory policy: Data cache writeback
AT91: Detected soc type: at91sam9263
AT91: sram at 0x300000 of 0x14000 mapped at 0xfef64000
AT91: sram at 0x500000 of 0x4000 mapped at 0xfef60000
Clocks: CPU 199 MHz, master 99 MHz, main 16.367 MHz
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: mem=64M console=ttyS0,115200 root=/dev/mtdblock3 rootfstype=jffs2
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: 60552K/65536K available (2676K kernel code, 182K rwdata, 560K rodata, 598K init, 315K bss, 4984K reserved)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0xc4800000 - 0xff000000   ( 936 MB)
    lowmem  : 0xc0000000 - 0xc4000000   (  64 MB)
      .text : 0xc0008000 - 0xc033165c   (3238 kB)
      .init : 0xc0332000 - 0xc03c79cc   ( 599 kB)
      .data : 0xc03c8000 - 0xc03f5a40   ( 183 kB)
       .bss : 0xc03f5a4c - 0xc0444674   ( 316 kB)
SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Preemptible hierarchical RCU implementation.
NR_IRQS:16 nr_irqs:16 16
AT91: 160 gpio irqs in 5 banks
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836480000000ns
Console: colour dummy device 80x30
Calibrating delay loop... 99.22 BogoMIPS (lpj=49612
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x2028c9d8 - 0x2028ca14
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
bio: create slab <bio-0> at 0
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
Switched to clocksource pit
FS-Cache: Loaded
CacheFiles: Loaded
NET: Registered protocol family 2
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
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
NetWinder Floating Point Emulator V0.97 (double precision)
jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
atmel_usart.0: ttyS0 at MMIO 0xffffee00 (irq = 17, base_baud = 6247474) is a ATMEL_SERIAL
console [ttyS0] enabled
atmel_usart.1: ttyS1 at MMIO 0xfff8c000 (irq = 23, base_baud = 6247474) is a ATMEL_SERIAL
No valid DiskOnChip devices found
atmel_nand: Use On Flash BBT
atmel_nand atmel_nand: No DMA support for NAND access.
NAND device: Manufacturer ID: 0x2c, Chip ID: 0xca (Micron MT29F2G16AAD)
NAND bus width 8 instead 16 bit
No NAND device found
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-atmel: OHCI Atmel driver
at91_ohci at91_ohci: OHCI Host Controller
at91_ohci at91_ohci: new USB bus registered, assigned bus number 1
at91_ohci at91_ohci: irq 45, io mem 0x00a00000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
rtc-test rtc-test.0: rtc core: registered test as rtc0
rtc-test rtc-test.1: rtc core: registered test as rtc1
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
IPv4 over IPSec tunneling driver
TCP: cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 17
NET: Registered protocol family 15
rtc-test rtc-test.0: setting system clock to 1970-01-01 00:00:01 UTC (1)
Freeing unused kernel memory: 596K (c0332000 - c03c7000)

starting pid 322, tty '': '/etc/init.d/rcS'
rcS: applet not found

Please press Enter to activate this console.

starting pid 323, tty '': '-/bin/sh'
-/bin/sh: can't access tty; job control turned off
-/bin/sh: id: not found
-/bin/sh: /bin/hostname: not found
[\u@\h \W]\#
[\u@\h \W]\#

哪位大虾帮小弟看看呗,谢谢谢谢。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP