TinyLogin is available at http://tinylogin.lineo.com.
It will give us the following tools in less than 35Ko :
/bin/addgroup, /bin/adduser, /bin/delgroup, /bin/deluser, /bin/login, /bin/su, /sbin/getty, /sbin/sulogin, /usr/bin/passwd
Please refers to your main distribution doc or man pages to have a full description of those commands.
[... part of TinyLogin README ...] TinyLogin is modularized to easily allow you to build only the components you need, thereby reducing binary size. To turn off unwanted TinyLogin components, simply edit the file tinylogin.def.h and comment out the parts you do not want using C++ style (//) comments.
After the build is complete a tinylogin.links file is generated which is then used by 'make install' to create symlinks to the tinylogin binary for all compiled in functions. By default, 'make install' will place a symlink forest into `pwd`/_install unless you have defined the PREFIX environment variable.
After the kernel is done loading it attempts to run the init
program to finalize the boot process.
init
executable in $EMBPART/sbinC
version of the start-stop-deamon
in the contrib directory.
Sysvinit needs a configuration file named inittab
and placed in $EMBPART/etc. The following is the one used in the LEM distro:
# /etc/inittab: init(8) configuration. # $Id: inittab,v 1.6 1997/01/30 15:03:55 miquels Exp $ # Modified for LEM 2/99 by Sebastien HUET <> # default rl. id:2:initdefault: # first except in emergency (-b) mode. si::sysinit:/etc/init.d/rcS # single-user mode. ~~:S:wait:/sbin/sulogin # /etc/init.d executes the S and K scripts upon change # 0:halt 1:single-user 2-5:multi-user (5 may be X with xdm or other) 6:reboot. l0:0:wait:/etc/init.d/rc 0 l1:1:wait:/etc/init.d/rc 1 l2:2:wait:/etc/init.d/rc 2 l3:3:wait:/etc/init.d/rc 3 l4:4:wait:/etc/init.d/rc 4 l5:5:wait:/etc/init.d/rc 5 l6:6:wait:/etc/init.d/rc 6 # CTRL-ALT-DEL pressed. ca:12345:ctrlaltdel:/sbin/shutdown -t1 -r now # Action on special keypress (ALT-UpArrow). kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work." # /sbin/mingetty invocations for runlevels. 1:2345:respawn:/sbin/getty 9600 tty1 2:23:respawn:/sbin/getty 9600 tty2 #3:23:respawn:/sbin/getty tty3 #you may add console there #4:23:respawn:/sbin/getty tty4
As seen in the inittab
file, Sysvinit
needs additional scripts in their own directories.
cd $EMBPART/etc mkdir rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d init.d rcS.d rc.boot
debian/etc/init.d/rc
to:$EMBART/etc/init.d
$EMBPART/etc/init.d/
rcS
like those in LEM:
#!/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin runlevel=S prevlevel=N umask 022 export PATH runlevel prevlevel ./etc/default/rcS export VERBOSE # Trap CTRL-C only in this shell so we can interrupt subprocesses. trap ":" 2 3 20 # Call all parts in order. for i in /etc/rcS.d/S??* do [ ! -f "$i" ] && continue case "$i" in *.sh) ( trap - 2 3 20 . $i start ) ;; *) $i start ;; esac done # run the files in /etc/rc.boot [ -d /etc/rc.boot ] && run-parts /etc/rc.boot
run-parts
from your distro to $EMBPART/bin<!-reboot---------------------------------------------->
reboot
containing the following:#!/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin echo -n "Rebooting... " reboot -d -f -i
<!-halt---------------------------------------------->
halt
containing the following:#!/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin halt -d -f -i -p
<!-mountfs---------------------------------------------->
mountfs
containing the following: