?? 00000015.htm
字號:
<?xml version="1.0" encoding="gb2312"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"/><title>Embedded Linux Howto (5) turbolinux </title></head><body><center><h1>BBS 水木清華站∶精華區(qū)</h1></center><a name="top"></a>發(fā)信人: turbolinux (hoho~神啊,救救我吧...), 信區(qū): Embedded <br />標(biāo) 題: Embedded Linux Howto (5) <br />發(fā)信站: BBS 水木清華站 (Thu Jul 12 00:32:34 2001) <br /> <br />5. Installing TinyLogin & login dependencies <br />TinyLogin is available at <a href="http://tinylogin.lineo.com.">http://tinylogin.lineo.com.</a> <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 /># /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 <<a href="mailto:sebhuet@linux-embedded.org>">sebhuet@linux-embedded.org></a> <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 <a href="http://www.EnjoySmart.com">http://www.EnjoySmart.com</a> <br /> -->Dedicated to Smart Home & Network Appliances <br /> <br /> <br />※ 來源:·BBS 水木清華站 smth.org·[FROM: 166.111.174.125] <br /><a href="00000014.htm">上一篇</a><a href="javascript:history.go(-1)">返回上一頁</a><a href="index.htm">回到目錄</a><a href="#top">回到頁首</a><a href="00000016.htm">下一篇</a></h1></center><center><h1>BBS 水木清華站∶精華區(qū)</h1></center></body></html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -