Chinaunix首页 | 论坛 | 博客
  • 博客访问: 560735
  • 博文数量: 105
  • 博客积分: 3274
  • 博客等级: 中校
  • 技术积分: 1161
  • 用 户 组: 普通用户
  • 注册时间: 2010-02-21 12:14
文章分类

全部博文(105)

文章存档

2011年(1)

2010年(104)

分类: LINUX

2010-04-02 22:19:55

devkit8000自带的根文件系统里面/etc目录下面的东西太多,如下,看着我就头痛。
[omap@localhost ~]$ ls ./rootfs/etc
alternatives      host.conf   motd           rc2.d           skel
angstrom-version  hostname    mtab           rc3.d           syslog.conf
busybox.links     hosts       network        rc4.d           terminfo
default           init.d      nsswitch.conf  rc5.d           timestamp
device_table      inittab     opkg           rc6.d           tinylogin.links
dev.tar           inputrc     passwd         rcS.d           ts.conf
filesystems       ipkg        profile        resolv.conf     udev
fonts             issue       protocols      rpc             udhcpc.d
fstab             issue.net   rc0.d          scsi_id.config  version
group             ld.so.conf  rc1.d          services        volatile.cache
[omap@localhost ~]$
于是上网找了个beagle比较简单的根文件系统,看看配置文件,如下,简单多了。
[omap@localhost ~]$ ls ./t/etc/
fstab  hosts.allow  init.d     nsswitch.conf  resolv.conf
group  hosts.deny   inittab    passwd         services
hosts  inetd.conf   mdev.conf  profile        ts.conf
[omap@localhost ~]$
不知道这个根文件系统所用的busybox是什么交叉编译器,所以busybox得重新编译了。
换上新的文件系统,果然明了很多。
对比:
devkit8000自带的:
VFS: Mounted root (ext2 filesystem).
Freeing init memory: 156K
INIT: version 2.86 booting
Starting udevuncorrectable error : <3>end_request: I/O error, dev mtdblock0, sector 0
Buffer I/O error on device mtdblock0, logical block 0
uncorrectable error : <3>uncorrectable error : <3>end_request: I/O error, dev
mtdblock0, sector 8
Buffer I/O error on device mtdblock0, logical block 1
end_request: I/O error, dev mtdblock0, sector 16
Buffer I/O error on device mtdblock0, logical block 2
uncorrectable error : <3>end_request: I/O error, dev mtdblock0, sector 24
Buffer I/O error on device mtdblock0, logical block 3
uncorrectable error : <3>end_request: I/O error, dev mtdblock0, sector 0
Buffer I/O error on device mtdblock0, logical block 0
tar: removing leading '/' from member names
Remounting root file system...
root: mount: mounting rootfs on / failed: No such file or directory
Setting up IP spoofing protection: rp_filter.
Configuring network interfaces... udhcpc (v1.11.3) started
Sending discover...
udhcpc: sendto: Network is down
Sending discover...
udhcpc: sendto: Network is down
Sending discover...
udhcpc: sendto: Network is down
No lease, failing
done.
Tue Jan 27 08:47:00 UTC 2009
INIT: Entering runlevel: 5
Starting syslogd/klogd: done
.-------.                                          
|       |                  .-.                     
|   |   |-----.-----.-----.| |   .----..-----.-----.
|       |     | __  |  ---'| '--.|  .-'|     |     |
|   |   |  |  |     |---  ||  --'|  |  |  '  | | | |
'---'---'--'--'--.  |-----''----''--'  '-----'-'-'-'
                -'  |
                '---'
The Angstrom Distribution DevKit8000 ttyS2
Angstrom 2008.1-test-20090127 DevKit8000 ttyS2
DevKit8000 login:
更换根文件系统之后的:
VFS: Mounted root (ext2 filesystem).
Freeing init memory: 156K
    OMAP3EVM (v0.90) : System initialization...
    Kernel release : Linux 2.6.28-rc9-omap1
    Kernel version : #1 Mon Dec 14 09:57:41 CST 2009
 Mounting /proc             : [SUCCESS]
 Mounting /sys              : [SUCCESS]
 Mounting /dev              : [SUCCESS]
 Mounting /dev/pts          : [SUCCESS]
 Enabling hot-plug          : [SUCCESS]
 Populating /dev            : mdev: applet not found
[FAILED]
 Mounting other filesystems : [SUCCESS]
 Starting syslogd           : [SUCCESS]
 Starting telnetd           : [SUCCESS]
System initialization complete.
Please press Enter to activate this console.
    Setting shell environment ...
    - Path
    - Aliases
    - Touchscreen
    Done!
[\u\@\h \W]#
貌似也没简单多少,不过俺就是看着这个亲切点,呵呵。
[\u\@\h \W]# ls
bin         heaven.pcm  lib         proc        sys
dev         home        linuxrc     root        tmp
etc         include     lost+found  sbin        usr
[\u\@\h \W]#
这个heaven.pcm是什么玩意呢?google下,在beagle找到他们讨论的一段对话,heaven.pcm好像
是个什么应用程序,删了也没什么影响。
[\u\@\h \W]# vi ./etc/inittab
# /etc/inittab
 
# System configuration/initialization script.
# This is run first except when booting in single-user mode
#
::sysinit:/etc/init.d/rcS
 
# Start an "askfirst" shell on the console
::askfirst:-/bin/sh
 
# Things to do when restarting the init process
::restart:/sbin/init
 
# Things to do before rebooting
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
::shutdown:/sbin/swapoff -a
在此之前,先看下busybox的缺省init模式
busybox支持init功能,当系统没有/etc/inittab文件时,它有一套缺省的模式,按下面配置执行

::sysinit:/etc/init.d/rcS
::askfirst:/bin/sh
::ctrlaltdel:/sbin/reboot
::shutdown:/sbin/swapoff -a
::shutdown:/bin/umount -a -r
::restart:/sbin/init
如果busybox检测到/dev/console不是串口控制台,init还要执行下面的动作:
tty2::askfirst:/bin/sh
tty3::askfirst:/bin/sh
tty4::askfirst:/bin/sh
现在就比较好理解了。
注释:
::sysinit:/etc/init.d/rcS
sysinit表示只要系统引导,该进程就开始运行。首先执行/etc/init.d/rcS脚本,该脚本在运行
其他任何运行等级规定的脚本之前必须先运行。稍后,来详细解释下该脚本。
::askfirst:-/bin/sh
askfirst类似respawn(进程停止的时候重新引导),不过它的主要用途是减少系统上执行的终端应
用程序的数量。它将会促使init在控制台上显示“Please press Enter to active this console
”的信息,并在重新启动之前等待用户按下enter键。
下面我们看看/etc/init.d/rcS的内容。
[\u\@\h \W]# cat /etc/init.d/rcS
#!/bin/sh
#   ---------------------------------------------
#   Common settings
#   ---------------------------------------------
HOSTNAME=OMAP3EVM
VERSION=0.90
 
hostname $HOSTNAME
 
#   ---------------------------------------------
#   Prints execution status.
#
#   arg1 : Execution status
#   arg2 : Continue (0) or Abort (1) on error
#   ---------------------------------------------
status ()
{
        if [ $1 -eq 0 ] ; then
                echo "[SUCCESS]"
        else
                echo "[FAILED]"
 
                if [ $2 -eq 1 ] ; then
                        echo "... System init aborted."
                        exit 1
                fi
        fi
 
}
 
#   ---------------------------------------------
#   Get verbose
#   ---------------------------------------------
echo ""
echo "    $HOSTNAME (v$VERSION) : System initialization..."
echo ""
echo "    Kernel release : `uname -s` `uname -r`"
echo "    Kernel version : `uname -v`"
echo ""
 
 
#   ---------------------------------------------
#   MDEV Support
#   (Requires sysfs support in the kernel)
#   ---------------------------------------------
echo -n " Mounting /proc             : "
mount -n -t proc /proc /proc
status $? 1
 
echo -n " Mounting /sys              : "
mount -n -t sysfs sysfs /sys
status $? 1
 
echo -n " Mounting /dev              : "
mount -n -t tmpfs mdev /dev
status $? 1
 
echo -n " Mounting /dev/pts          : "
mkdir /dev/pts
mount -t devpts devpts /dev/pts
status $? 1
 
echo -n " Enabling hot-plug          : "
echo "/sbin/mdev" > /proc/sys/kernel/hotplug
status $? 0
 
echo -n " Populating /dev            : "
mkdir /dev/input
mkdir /dev/snd
 
mdev -s
status $? 0
 
 
#   ---------------------------------------------
#   Mount the default file systems
#   ---------------------------------------------
echo -n " Mounting other filesystems : "
mount -a
status $? 0
 
 
#   ---------------------------------------------
#   Set PATH
#   ---------------------------------------------
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
 
 
#   ---------------------------------------------
#   Start other daemons
#   ---------------------------------------------
echo -n " Starting syslogd           : "
/sbin/syslogd
status $? 0
 
echo -n " Starting telnetd           : "
/usr/sbin/telnetd
status $? 0
 
 
#   ---------------------------------------------
#   Done!
#   ---------------------------------------------
echo ""
echo "System initialization complete."
[\u\@\h \W]#
发现启动时
Populating /dev            : mdev: applet not found
[FAILED]
于是在busybox里面把mdev选上,重新编译。
启动,OK。
每次启动时最后都提示:
Please press Enter to activate this console.
感觉还是原来的舒服,于是把
::askfirst:-/bin/sh 改成 ::respawn:-/bin/sh了,再启动时就可以直接进入了。
阅读(3297) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~