*****************************************************************************************************************
环 境:linux系统(centos6.4 ubuntu12.10)
开 发 板:飞凌2440 、天嵌2440
版权所有:郭文学
装载声明:
http://blog.csdn.net/sonbai/article/details/8785038
http://blog.csdn.net/sonbai/article/details/8785146
http://blog.csdn.net/sonbai/article/details/8784808
http://blog.csdn.net/sonbai/article/details/8784046
*****************************************************************************************************************
[guowenxue@localhost opt]$ pwd/opt
[guowenxue@localhost opt]$ mkdir rootfs
[guowenxue@localhost opt]$ cd rootfs/
[guowenxue@localhost rootfs]$ ls
[guowenxue@localhost rootfs]$ mkdir -p {apps,bin,data,dev,info,proc,root,sbin,sys,tmp,var,etc/{,init.d,dropbear},mnt/{,usb,sdc,nfs,dev},usr/{,bin,sbin,lib,share},lib/{,modules/{,2.6.24,2.6.38}}}
[guowenxue@localhost rootfs]$ tree -L 3
.
|-- apps 挂载Application所在分区用的目录
|-- bin
|-- data 挂载data分区所在的目录
|-- dev
|-- etc
| |-- dropbear dropbear ssh server依赖的文件
| `-- init.d 系统启动初始化脚本
|-- info 挂载info分区所在的目录
|-- lib 动态库所存放的目录
| `-- modules insmod时,依赖/lib/modules/内核版本目录
| |-- 2.6.24 我们将Linux驱动放到该目录下
| `-- 2.6.38
|-- mnt 设备在运行时的一些挂载点
| |-- dev 保留备用
| |-- nfs NFS挂载点
| |-- sdc SD卡挂载点
| `-- usb U盘挂载点
|-- proc proc文件挂载点
|-- root root用户目录
|-- sbin
|-- sys sys文件系统挂载点
|-- tmp tmpfs文件系统挂载点
|-- usr
| |-- bin
| |-- lib 用户程序动态库放到这里
| |-- sbin
| `-- share
`-- var
29 directories, 0 files
因为内核挂载完文件系统后,init进程需要用到/dev/console和/dev/null这两个设备文件来调用mdev构建dev,所以必须在制作文件系统时静态创建这两个设备文件,否则在系统启动时将提示Waring:unable to open an initial console:
[guowenxue@localhost rootfs]$cd dev/
[guowenxue@localhost dev/]$ sudo mknod -m666 console c 5 1
[guowenxue@localhost dev/]$ sudo mknod -m666 ttyS0 c 4 64
[guowenxue@localhost dev/]$ sudo mknod mtdblock0 b 31 0
[guowenxue@localhost dev/]$ sudo mknod mtdblock1 b 31 1
[guowenxue@localhost dev/]$ sudo mknod mtdblock2 b 31 2
[guowenxue@localhost dev/]$ sudo mknod mtdblock3 b 31 3
注:
以上mtdblockx的个数是根据你内核中分区表信息来创建的,看下这个
http://blog.csdn.net/sonbai/article/details/8717574
[root:dev]#sudo mknod -m 755 mtd0 c 90 0
。。。。。。
。。。。。。
[guowenxue@localhost dev/]$ ll
total 4
crwxr-xr-x 1 root root 5, 1 Mar 28 14:11 console
crwxr-xr-x 1 root root 1, 11 Apr 10 15:49 kmsg
crw-r--r-- 1 root root 1, 1 Apr 10 15:24 mem
crwxr-xr-x 1 root root 90, 0 Apr 10 15:46 mtd0
crwxr-xr-x 1 root root 90, 1 Apr 10 15:46 mtd0ro
crwxr-xr-x 1 root root 90, 2 Apr 10 15:46 mtd1
crwxr-xr-x 1 root root 90, 3 Apr 10 15:47 mtd1ro
crwxr-xr-x 1 root root 90, 4 Apr 10 15:47 mtd2
crwxr-xr-x 1 root root 90, 5 Apr 10 15:47 mtd2ro
brw-r--r-- 1 root root 31, 0 Apr 10 15:12 mtdblock0
brw-r--r-- 1 root root 31, 1 Apr 10 15:13 mtdblock1
brw-r--r-- 1 root root 31, 2 Apr 10 15:13 mtdblock2
crwxr-xr-x 1 root root 1, 3 Mar 28 14:12 null
drwxr-xr-x 2 root root 4096 Apr 10 15:49 pts
crw-r--r-- 1 root root 1, 8 Apr 10 15:24 random
crw-r--r-- 1 root root 5, 0 Apr 10 15:23 tty
crwxr-xr-x 1 root root 4, 0 Apr 10 15:51 tty0
crwxr-xr-x 1 root root 4, 1 Apr 10 15:51 tty1
crwxr-xr-x 1 root root 4, 2 Apr 10 15:51 tty2
crwxr-xr-x 1 root root 4, 3 Apr 10 15:51 tty3
crwxr-xr-x 1 root root 4, 4 Apr 10 15:51 tty4
crwxr-xr-x 1 root root 4, 64 Mar 28 14:12 ttyS0
crwxr-xr-x 1 root root 4, 64 Mar 28 14:12 ttySAC0
crw-r--r-- 1 root root 1, 9 Apr 10 15:24 urandom
crw-r--r-- 1 root root 1, 5 Apr 10 15:23 zero
注:
以上设备节点都要创建,可以根据上面的信息自行创建
创建var目录中的一些符号链接文件:
[guowenxue@localhost rootfs]$ ln -s /tmp var/lock
[guowenxue@localhost rootfs]$ ln -s /tmp var/log
[guowenxue@localhost rootfs]$ ln -s /tmp var/run
[guowenxue@localhost rootfs]$ ln -s /tmp var/tmp
拷贝交叉编译器中的动态库:
[guowenxue@localhost rootfs]$ cp -af /opt/buildroot-2011.02/arm920t/usr/arm-linux/sysroot/lib/*so* lib/
[guowenxue@localhost rootfs]$ cp -af /opt/buildroot-2011.02/arm920t/usr/arm-linux/lib/*so* lib/
创建etc目录下的一些文件:
[guowenxue@localhost rootfs]$ cd etc/
[guowenxue@localhost etc]$ tree -L 2
.
|-- dropbear
`-- init.d
2 directories, 0 files
创建inittab文件:
# /etc/inittab
#
# Copyright (C) 2011 GuoWenxue <guowenxue@gmail.com>
#
# Note: BusyBox init doesn't support runlevels. The runlevels field is
# completely ignored by BusyBox init. If you want runlevels, use sysvinit.
#
# Format for each entry: <id>:<runlevels>:<action>:<process>
#
# id == tty to run on, or empty for /dev/console.
# If specified, then /dev/$id device must exist
# runlevels == ignored, busybox doesn't support it
# action == one of sysinit, respawn, askfirst, wait, and once
# process == program to run
# Startup the system
# mount all the file systems specified in /etc/fstab
::sysinit:/bin/mount -a
#Use mdev as hotplug to auto mount USB storage or SD card
::sysinit:/bin/echo /sbin/mdev > /proc/sys/kernel/hotplug
#Use mdev to auto generate the device node in /dev path
::sysinit:/sbin/mdev -s
#make shm, pts support
::sysinit:/bin/mkdir -p /dev/pts
::sysinit:/bin/mkdir -p /dev/shm
::sysinit:/bin/mount -t devpts devpts /dev/pts
#Mount our apps/info partition
null::wait:/bin/mount -o sync,noatime,ro -t jffs2 /dev/mtdblock6 /apps
null::wait:/bin/mount -o sync,noatime,ro -t jffs2 /dev/mtdblock7 /info
#Set hostname
null::sysinit:/bin/hostname -F /etc/hostname
#Enable console logon
null::respawn:/sbin/getty -L ttyS0 115200 vt100
# now run any rc scripts
null::wait:/etc/init.d/rcS
# system daemon
null::respawn:/sbin/syslogd -n
null::respawn:/sbin/klogd -n
# Stuff to do before rebooting
null::shutdown:/bin/umount /apps
null::shutdown:/bin/umount /info
null::shutdown:/bin/killall klogd
null::shutdown:/bin/killall syslogd
null::shutdown:/bin/umount -a -r
#null::shutdown:/sbin/swapoff -a
创建/etc/init.d/rcS脚本
[guowenxue@localhost etc]$ vim init.d/rcS
#!/bin/sh
# Copyright (C) 2011 GuoWenxue <guowenxue@gmail.com>
# Start all init scripts in /etc/init.d
# executing them in numerical order.
#
for i in /etc/init.d/S??* ; do
$i
done
常见配置网卡的启动脚本
[guowenxue@localhost etc]$ vim init.d/S01_network
#!/bin/sh
ifconfig eth0 192.168.1.244 netmask 255.255.255.0 up
创建/apps/etc目录下的启动脚本支持:
[guowenxue@localhost etc]$ vim init.d/S99_rcsApp
#!/bin/sh
# Copyright (C) 2011 GuoWenxue <guowenxue@gmail.com>
#
# Start all init scripts in /apps/etc/init.d
# executing them in numerical order.
#
if (test -d /apps/etc/init.d)
then
for i in /apps/etc/init.d/S??* ; do
$i
done
fi
[guowenxue@localhost etc]$ chmod 777 init.d/*
创建/etc/fstab文件:
[guowenxue@localhost etc]$ vim fstab
# /etc/fstab: static file system information.
# Copyright (C) 2011 GuoWenxue <guowenxue@gmail.com>
#
#<File system> <mount pt> <type> <options> <dump> <pass>
#devpts /dev/pts devpts defaults 0 0
#/dev/root / ext2 rw,noauto 0 1
proc /proc proc defaults 0 0
tmpfs /tmp tmpfs defaults 0 0
tmpfs /dev tmpfs defaults 0 0
sysfs /sys sysfs defaults 0 0
创建hostname,hosts,TZ文件:
[guowenxue@localhost etc]$ echo "root" > hostname
[guowenxue@localhost etc]$ echo "127.0.0.1 localhost" >> hosts
[guowenxue@localhost etc]$ echo "MST7MDT" >> TZ
[guowenxue@localhost etc]$ echo "Copyright (C) 2011 GuoWenxue<guowenxue@gmail.com>" >> issue 系统登录时的提示信息
创建profile文件:
[guowenxue@localhost etc]$ vim profile
# /etc/profile: system-wide .profile file for the Bourne shells.
export PATH=\
/bin:\
/sbin:\
/usr/bin:\
/usr/sbin:\
/usr/local/bin:\
/apps/bin:\
/apps/tools:\
/apps/tslib/bin\
# If running interactively, then:
if [ "$PS1" ]; then
if [ "$BASH" ]; then
export PS1="[\u@\h \W]\\$ "
alias ll='/bin/ls --color=tty -laFh'
alias ls='/bin/ls --color=tty -F'
export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;
32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=0
1;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.png=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35
:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.d
l=01;35:*.xcf=01;35:*.xwd=01;35:';
else
if [ "`id -u`" -eq 0 ]; then
export PS1='>: '
else
export PS1='>: '
fi
fi
# System Setting
set -o vi
alias ll='ls -l'
export USER=`id -un`
export LOGNAME=$USER
export HOSTNAME=`/bin/hostname`
export HISTSIZE=1000
export HISTFILESIZE=1000
export PAGER='/bin/more '
export EDITOR='/bin/vi'
export INPUTRC=/etc/inputrc
export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile
export VAR1=
export VAR2=
export VAR3=
export VAR4=
export VAR5=
export LD_LIBRARY_PATH=/lib:/usr/lib/
# QT Extendded 4.4.3 Setting
export QTDIR=/apps/qt-extended-4.4.3
export QWS_MOUSE_PROTO='TSLIB:/dev/event0'
export QWS_DISPLAY='LinuxFB:/dev/fb0'
export QWS_DISPLAY='LinuxFB:mmWidth240:mmHeight320:0'
export QWS_SIZE='240x320'
export QT_PLUGIN_PATH=$QTDIR/plugins/
export QT_QWS_FONTDIR=$QTDIR/lib/fonts
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$QTDIR/lib
# Touch Scree tslib Setting
export TSLIB_ROOT=/apps/tslib
export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf
export TSLIB_CALIBFILE=$TSLIB_ROOT/etc/pointercal
export TSLIB_TSDEVICE=/dev/event0
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
fi;
创建指定一些协议所使用的端口号文件/etc/protocols
[guowenxue@localhost etc]$ vim protocols
# /etc/protocols:
# $Id: protocols,v 1.1.1.1 2001/09/12 19:03:24 andersee Exp $
#
# Internet (IP) protocols
#
# from: @(#)protocols 5.1 (Berkeley) 4/17/89
#
# Updated for NetBSD based on RFC 1340, Assigned Numbers (July 1992).
ip 0 IP # internet protocol, pseudo protocol number
icmp 1 ICMP # internet control message protocol
igmp 2 IGMP # Internet Group Management
ggp 3 GGP # gateway-gateway protocol
ipencap 4 IP-ENCAP # IP encapsulated in IP (officially ``IP'')
st 5 ST # ST datagram mode
tcp 6 TCP # transmission control protocol
egp 8 EGP # exterior gateway protocol
pup 12 PUP # PARC universal packet protocol
udp 17 UDP # user datagram protocol
hmp 20 HMP # host monitoring protocol
xns-idp 22 XNS-IDP # Xerox NS IDP
rdp 27 RDP # "reliable datagram" protocol
iso-tp4 29 ISO-TP4 # ISO Transport Protocol class 4
xtp 36 XTP # Xpress Tranfer Protocol
ddp 37 DDP # Datagram Delivery Protocol
idpr-cmtp 39 IDPR-CMTP # IDPR Control Message Transport
rspf 73 RSPF #Radio Shortest Path First.
vmtp 81 VMTP # Versatile Message Transport
ospf 89 OSPFIGP # Open Shortest Path First IGP
ipip 94 IPIP # Yet Another IP encapsulation
encap 98 ENCAP # Yet Another IP encapsulation
mdev会在/etc目录下找mdev的配置文件: mdev.conf. 如果该文件不存在,那么在执行mdev –s这个命令时,
会提示找不到mdev.conf,这时我们可以建一个空的mdev.conf文件解决这个问题。下面创建使用mdev自动挂载u盘和SD卡的配置/etc/mdev.conf
[guowenxue@localhost etc]$ vim mdev.conf
sd[a-z][0-9] 0:0 0777 @(mount /dev/$MDEV /mnt/usb)
sd[a-z] 0:0 0777 $(umount /mnt/usb)
ub[a-z][0-9] 0:0 0777 @(mount /dev/$MDEV /mnt/usb)
ub[a-z] 0:0 0777 $(umount /mnt/usb)
mmcblk[0-9]p[0-9] 0:0 0777 @(mount /dev/$MDEV /mnt/sdc)
mmcblk[0-9] 0:0 0777 $(umount /mnt/sdc)
参考Linux系统下/etc/group文件创建用户组文件:
[guowenxue@localhost etc]$ vim group
root:x:0:root
它的格式如下:
groupname:password:gid:members
第一个字段为用户组名称
第二个字段为用户组密码,当为x时密码是映射到/etc/gshadow中的,是非逆的
第三个字段为GID,及组号,为正整数或0,0被付于了root用户组;系统通常会预留一些较靠前的GID给系统虚拟用户之用,每个系统预留的GID都不同,Fedora预留了500个,所以我们添加新用户组时是从500开始的。GID的范围由/etc/login.defs中的GID_MIN和GID_MAX决定
第四个字段为用户列表,每个用户间用逗号分隔
这里的password代表组口令,很少用到。它可使原先不在这个群组中的用户可以通过newgrp命令暂时继承该组的权限,使用 newgrp命令时会新开一个shell。口令的加密方式和passwd文件中的口令一样,所以如果需设置组口令,要用passwd程序虚设一个用户,再把该用户password节中的加密口令拷贝到/etc/group文件中。members列代表组成员,我们可把需加入该组的用户以逗号分隔添加到这里即可。同一组的成员可继承该组所拥有的权限。
参考Linux系统下/etc/passwd创建用户文件:
[guowenxue@localhost etc]$ vim passwd
root:x:0:0:root:/:/bin/sh
它的格式如下:
username:password:uid:gid:gecos:homedir:shell
第一个字段为登录名
第二个字段为口令,一般被映射到shadow文件中
第三个字段为UID
第四个字段为GID
第五个字段为用户名全称,gecos是通用电子计算机操作系统的缩写,是Bell实验室中的一台大型主机。
第六个字段为用户根目录
第七个字段为用户所用SHELL的类型
Unix系统最初是用明文保存密码的,后来由于安全的考虑,采用crypt()算法加密密码并存放在/etc/passwd文件。现在,由于计算机处理能力的提高,使密码破解变得越来越容易。/etc/passwd文件是所有合法用户都可访问的,大家都可互相看到密码的加密字符串,这给系统带来很大的安全威胁。现代的Unix系统使用影子密码系统,它把密码从/etc/pa sswd文件中分离出来,真正的密码保存在/etc/shadow文件中,shadow文件只能由超级用户访问。这样入侵者就不能获得加密密码串,用于破解。使用shadow密码文件后,/etc/passwd文件中所有帐户的password域的内容为"x",如果password域的内容为"*",则该帐号被停用。使用passwd这个程序可修改用户的密。
参考Linux系统下/etc/shadow,创建密码映射文件:
[guowenxue@localhost etc]$ vim shadow
root:$1$jGZIHmtT$y8ZXoPllK12/wl51kMw4e/:0:0:99999:7:::
该文件我们可以在Linux系统上使用passwd命令修改root口令来获取:
[guowenxue@localhost ~]$ passwd root
Changing password for user root.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[guowenxue@localhost ~]$ cat /etc/shadow | grep root
root:$1$jGZIHmtT$y8ZXoPllK12/wl51kMw4e/:0:0:99999:7:::
当然,在设置为嵌入式平台上的root口令后,最好把系统上的root命令恢复到原始密码。
他的格式如下:
username:password:last_change:min_change:max_change:warm:failed_expire:expiration:reserved
第一字段:用户名(也被称为登录名),在/etc/shadow中,用户名和/etc/passwd 是相同的,这样就把passwd 和shadow中用的用户记录联系在一起;这个字段是非空的;
第二字段:密码(已被加密),这个字段是非空的;
第三字段:上次修改口令的时间;这个时间是从1970年01月01日算起到最近一次修改口令的时间间隔(天数),您可以通过passwd 来修改用户的密码,然后查看/etc/shadow中此字段的变化;
第四字段:两次修改口令间隔最少的天数;如果这个字段的值为空,帐号永久可用;
第五字段:两次修改口令间隔最多的天数;如果这个字段的值为空,帐号永久可用;
第六字段:提前多少天警告用户口令将过期;如果这个字段的值为空,帐号永久可用;
第七字段:在口令过期之后多少天禁用此用户;如果这个字段的值为空,帐号永久可用;
第八字段:用户过期日期;此字段指定了用户作废的天数(从1970年的1月1日开始的天数),如果这个字段的值为空,帐号永久可用;
第九字段:保留字段,目前为空,以备将来发展之用;
*****************************************************************************************************************
环 境:linux系统(centos6.4 ubuntu12.10)
开 发 板:飞凌2440 、天嵌2440
版权所有:郭文学
装载声明:
http://blog.csdn.net/sonbai/article/details/8785038
http://blog.csdn.net/sonbai/article/details/8785146
http://blog.csdn.net/sonbai/article/details/8784808
http://blog.csdn.net/sonbai/article/details/8784046
*****************************************************************************************************************
编译并按照busybox到文件系统中去:
[guowenxue@localhost opt]$ tar -xjf ~/winxp/apps_pack/busybox-1.18.4.tar.bz2
[guowenxue@localhost opt]$ cd busybox-1.18.4/
[guowenxue@localhost busybox-1.18.4]$ vim Makefile
修改CROSS_COMPILER为:
CROSS_COMPILE ?= /opt/buildroot-2011.02/arm920t/usr/bin/arm-linux-
[guowenxue@localhost busybox-1.18.4]$ ls ../rootfs/
apps bin data dev etc info lib mnt proc root sbin sys tmp usr var
[guowenxue@localhost busybox-1.18.4]$ make menuconfig
选择:
Busybox Settings --->
General Configuration --->
[*] Don't use /usr
Installation Options ("make install" behavior) --->
What kind of applet links to install (as soft-links) --->
(../rootfs) BusyBox installation prefix
其他选项根据自己的需要选择。
[guowenxue@localhost busybox-1.18.4]$ make
[guowenxue@localhost busybox-1.18.4]$ file busybox
busybox: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), stripped
[guowenxue@localhost busybox-1.18.4]$ make install
....
../rootfs/sbin/udhcpc -> ../bin/busybox
../rootfs/sbin/udhcpd -> ../bin/busybox
../rootfs/sbin/vconfig -> ../bin/busybox
../rootfs/sbin/zcip -> ../bin/busybox
--------------------------------------------------
You will probably need to make your busybox binary
setuid root to ensure all configured applets will
work properly.
--------------------------------------------------
[guowenxue@localhost busybox-1.18.4]$
[guowenxue@localhost busybox-1.18.4]$ ls ../rootfs/
apps bin data dev etc info lib linuxrc mnt proc root sbin sys tmp usr var
移植dropbear:
首先编译生成PC版的,在制作密钥时用到:
[guowenxue@localhost ~]$ wget http://matt.ucc.asn.au/dropbear/releases/dropbear-0.53.1.tar.bz2
[guowenxue@localhost ~]$ tar -xjf dropbear-0.53.1.tar.bz2
[guowenxue@localhost ~]$ cd dropbear-0.53.1
[guowenxue@localhost dropbear-0.53.1]$ ./configure && make
生成的文件:
dropbear: ssh2 server
dropbearkey: 密钥生成器
dropbearconvert: 可以转换openssh的密钥
dbclient: ssh2 client
[guowenxue@localhost dropbear-0.53.1]$ ./dropbearkey -t rsa -f /opt/rootfs/etc/dropbear/dropbear_rsa_host_key
[guowenxue@localhost dropbear-0.53.1]$ ./dropbearkey -t dss -f /opt/rootfs/etc/dropbear/dropbear_dss_host_key
[guowenxue@localhost dropbear-0.53.1]$ chmod 666 /opt/rootfs/etc/dropbear/dropbear_*
编译ARM版本的:
[guowenxue@localhost dropbear-0.53.1]$ make distclean
[guowenxue@localhost dropbear-0.53.1]$ ./configure CC=/opt/buildroot-2011.02/arm920t/usr/bin/arm-linux-gcc --build=i686 --host=arm-linux --disable-zlib
[guowenxue@localhost dropbear-0.53.1]$ make
[guowenxue@localhost dropbear-0.53.1]$ file dropbear
dropbear: ELF 32-bit LSB executable, ARM, version 1 (ARM), dynamically linked (uses shared libs), not stripped
[guowenxue@localhost dropbear-0.53.1]$ file dbclient
dbclient: ELF 32-bit LSB executable, ARM, version 1 (ARM), dynamically linked (uses shared libs), not stripped
[guowenxue@localhost dropbear-0.53.1]$ mv dbclient ssh
[guowenxue@localhost dropbear-0.53.1]$ /opt/buildroot-2011.02/arm920t/usr/bin/arm-linux-strip dropbear
[guowenxue@localhost dropbear-0.53.1]$ /opt/buildroot-2011.02/arm920t/usr/bin/arm-linux-strip ssh
[guowenxue@localhost dropbear-0.53.1]$ cp ssh dropbear /opt/rootfs/usr/sbin/
在文件系统中创建启动脚本:
[guowenxue@localhost rootfs]$ vim etc/init.d/S04_dropbear
#!/bin/sh
/usr/sbin/dropbear
[guowenxue@localhost rootfs]$ chmod 777 etc/init.d/S04_dropbear
Freeing init memory: 124K
can't open /dev/null: No such file or directory
can't open /dev/null: No such file or directory
can't open /dev/null: No such file or directory
can't open /dev/null: No such file or directory
can't open /dev/ttyS0: No such file or directory
can't open /dev/ttyS0: No such file or directory
can't open /dev/ttyS0: No such file or directory
can't open /dev/ttyS0: No such file or directory
can't open /dev/ttyS0: No such file or directory
can't open /dev/ttyS0: No such file or directory
can't open /dev/ttyS0: No such file or directory
修改/etc/inittab,去掉前面的null:
::sysinit:/bin/mount -a
::sysinit:/bin/mkdir -p /dev/pts
::sysinit:/bin/mount -t devpts devpts /dev/pts
::sysinit:/bin/echo /sbin/mdev > /proc/sys/kernel/hotplug
::sysinit:/sbin/mdev -s
其中
null::sysinit:/bin/mount -a表示,在执行这条命令前,需要先确认/dev/null设备存在。同样
ttyS0::respawn:/sbin/getty -L ttyS0 115200 linux 表示在执行getty时,需要/dev/ttyS0存在,否则报错。
*****************************************************************************************************************
环 境:linux系统(centos6.4 ubuntu12.10)
开 发 板:飞凌2440 、天嵌2440
版权所有:郭文学
装载声明:
http://blog.csdn.net/sonbai/article/details/8785038
http://blog.csdn.net/sonbai/article/details/8785146
http://blog.csdn.net/sonbai/article/details/8784808
http://blog.csdn.net/sonbai/article/details/8784046
*****************************************************************************************************************