158.htm

来自「pcb设计资料初学者难得的入门资料包含工厂制作过程」· HTM 代码 · 共 190 行

HTM
190
字号
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>CTerm非常精华下载</title>
</head>
<body bgcolor="#FFFFFF">
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="577">
<tr><td width="32%" rowspan="3" height="123"><img src="DDl_back.jpg" width="300" height="129" alt="DDl_back.jpg"></td><td width="30%" background="DDl_back2.jpg" height="35"><p align="center"><a href="http://202.112.58.200"><font face="黑体"><big><big>Tsinghua</big></big></font></a></td></tr>
<tr>
<td width="68%" background="DDl_back2.jpg" height="44"><big><big><font face="黑体"><p align="center">         嵌入式系统                            (BM: turbolinux jacobw)          </font></big></big></td></tr>
<tr>
<td width="68%" height="44" bgcolor="#000000"><font face="黑体"><big><big><p   align="center"></big></big><a href="http://cterm.163.net"><img src="banner.gif" width="400" height="60" alt="banner.gif"border="0"></a></font></td>
</tr>
<tr><td width="100%" colspan="2" height="100" align="center" valign="top"><br><p align="center">[<a href="嵌入式系统.htm">回到开始</a>][<a href="65.htm">上一层</a>][<a href="159.htm">下一篇</a>]
<hr><p align="left"><small>发信人: turbolinux (hoho~神啊,救救我吧...), 信区: Embedded <br>

标  题: Embedded Linux Howto  (5) <br>

发信站: BBS 水木清华站 (Thu Jul 12 00:32:34 2001) <br>

  <br>

5. Installing TinyLogin & login dependencies <br>

TinyLogin is available at http://tinylogin.lineo.com. <br>

  <br>

It will give us the following tools in less than 35Ko : <br>

  <br>

/bin/addgroup, /bin/adduser, /bin/delgroup, /bin/deluser, /bin/login, <br>

/bin/su, /sbin/getty, /sbin/sulogin, /usr/bin/passwd <br>

  <br>

Please refers to your main distribution doc or man pages to have a <br>

full description of those commands. <br>

  <br>

5.1 Configuring TinyLogin <br>

[... part of TinyLogin README ...] TinyLogin is modularized to easily <br>

allow you to build only the components you need, thereby reducing binary <br>

 size. To turn off unwanted TinyLogin components, simply edit the file <br>

tinylogin.def.h and comment out the parts you do not want using C++ <br>

style (//) comments. <br>

  <br>

5.2 Installing TinyLogin <br>



After the build is complete a tinylogin.links file is generated which is <br>

 then used by 'make install' to create symlinks to the tinylogin <br>

binary for all compiled in functions. By default, 'make install' will <br>

place a symlink forest into `pwd`/_install unless you have defined the <br>

PREFIX environment variable. <br>

  <br>

5.3 Installing Sysvinit & start-stop-daemon <br>

After the kernel is done loading it attempts to run the init program <br>

to finalize the boot process. <br>

  <br>

Unpack the Sysvinit archive. <br>

Go to the src directory <br>

Compile the package by running make <br>

Copy the init executable in $EMBPART/sbin <br>

The Sysvinit package also offers a C version of the start-stop-deamon in <br>

 the contrib directory. <br>

Compile it. <br>

Copy the file in $EMBPART/usr/sbin <br>

5.4 Configuring Sysvinit <br>

Sysvinit needs a configuration file named inittab and placed in <br>

$EMBPART/etc. The following is the one used in the LEM distro: <br>

  <br>

  <br>

  <br>

  <br>

# /etc/inittab: init(8) configuration. <br>

# $Id: inittab,v 1.6 1997/01/30 15:03:55 miquels Exp $ <br>

# Modified for LEM 2/99 by Sebastien HUET <sebhuet@linux-embedded.org> <br>

  <br>

# default rl. <br>

id:2:initdefault: <br>

  <br>

# first except in emergency (-b) mode. <br>

si::sysinit:/etc/init.d/rcS <br>

  <br>

# single-user mode. <br>

~~:S:wait:/sbin/sulogin <br>

  <br>

# /etc/init.d executes the S and K scripts upon change <br>

# 0:halt 1:single-user 2-5:multi-user (5 may be X with xdm or other) 6: <br>

reboot. <br>

l0:0:wait:/etc/init.d/rc 0 <br>

l1:1:wait:/etc/init.d/rc 1 <br>

l2:2:wait:/etc/init.d/rc 2 <br>

l3:3:wait:/etc/init.d/rc 3 <br>



l4:4:wait:/etc/init.d/rc 4 <br>

l5:5:wait:/etc/init.d/rc 5 <br>

l6:6:wait:/etc/init.d/rc 6 <br>

  <br>

# CTRL-ALT-DEL pressed. <br>

ca:12345:ctrlaltdel:/sbin/shutdown -t1 -r now <br>

  <br>

# Action on special keypress (ALT-UpArrow). <br>

kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this <br>

 work." <br>

  <br>

# /sbin/mingetty invocations for runlevels. <br>

1:2345:respawn:/sbin/getty 9600 tty1 <br>

2:23:respawn:/sbin/getty 9600 tty2 <br>

#3:23:respawn:/sbin/getty tty3 #you may add console there <br>

#4:23:respawn:/sbin/getty tty4 <br>

  <br>

5.5 Creating initial boot scripts <br>

As seen in the inittab file, Sysvinit needs additional scripts in <br>

their own directories. <br>

  <br>

Creating the necessary directories and base files <br>



  <br>

                cd $EMBPART/etc <br>

                mkdir rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d init.d <br>

rcS.d rc.boot <br>

  <br>

  <br>

Go to the unpacked Sysvinit source directory. <br>

Copy the debian/etc/init.d/rc to:$EMBART/etc/init.d <br>

Go to the $EMBPART/etc/init.d/ <br>

Create a new file rcS like those in LEM: <br>

#!/bin/sh <br>

PATH=/sbin:/bin:/usr/sbin:/usr/bin <br>

runlevel=S <br>

prevlevel=N <br>

umask 022 <br>

export PATH runlevel prevlevel <br>

./etc/default/rcS <br>

export VERBOSE <br>

# Trap CTRL-C  only in this shell so we can interrupt subprocesses. <br>

trap ":" 2 3 20 <br>

# Call all parts in order. <br>

for i in /etc/rcS.d/S??* <br>



do <br>

        [ ! -f "$i" ] && continue <br>

        case "$i" in <br>

                *.sh) <br>

                        ( <br>

                                trap - 2 3 20 <br>

                                . $i start <br>

                        ) <br>

                        ;; <br>

                *) <br>

                        $i start <br>

                        ;; <br>

        esac <br>

done <br>

# run the files in /etc/rc.boot <br>

[ -d /etc/rc.boot ] && run-parts /etc/rc.boot <br>

  <br>

Copy run-parts from your distro to $EMBPART/bin <br>

Adding base scripts <br>

<!-reboot----------------------------------------------> <br>

  <br>

Create a new file reboot containing the following: <br>



#!/bin/sh <br>

PATH=/sbin:/bin:/usr/sbin:/usr/bin <br>

echo -n "Rebooting... " <br>

reboot -d -f -i <br>

  <br>

<!-halt----------------------------------------------> <br>

  <br>

Create a new file halt containing the following: <br>

#!/bin/sh <br>

PATH=/sbin:/bin:/usr/sbin:/usr/bin <br>

halt -d -f -i -p <br>

  <br>

<!-mountfs----------------------------------------------> <br>

  <br>

Create a new file mountfs containing the following: <br>

  <br>

Creating initial scripts <br>

  <br>

5.6 Copying passwd & group files <br>

  <br>

  <br>

------------------------------------------------------------------------ <br>



-------- <br>

  <br>

-- <br>

Welcome to http://www.EnjoySmart.com <br>

  -->Dedicated to Smart Home & Network Appliances <br>

  <br>

  <br>

※ 来源:·BBS 水木清华站 smth.org·[FROM: 166.111.174.125] <br>

</small><hr>
<p align="center">[<a href="嵌入式系统.htm">回到开始</a>][<a href="65.htm">上一层</a>][<a href="159.htm">下一篇</a>]
<p align="center"><a href="http://cterm.163.net">欢迎访问Cterm主页</a></p>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?