· KLDP.org · KLDP.net · KLDP Wiki · KLDP BBS ·
Booyo LiveCD/Sys Vinit

BooyoLiveCD/SysVinit

As we have seen, the init program is run by the kernel at boot time. It is in charge of starting all the normal processes that need to start up with the system. These include the getty processes that allow you to log in, NFS daemons, FTP daemons, and anything else you want to run when your machine boots.
  • The kernel looks in /sbin for init
  • init runs the /etc/rc.d/rc.sysinit script
  • rc.sysinit handles most of the boot loader's processes and then runs rc.serial (if it exists)
  • init runs all the scripts for the default runlevel
  • init runs /etc/rc.d/rc.local
knoppix ´Â sysvinit_2.84-186.tar.gz »ç¿ë FC3 ´Â SysVinit-2.85-34.src.rpm »ç¿ë

knoppix

bin -> /KNOPPIX/bin
boot -> /KNOPPIX/boot
lib -> /KNOPPIX/lib
opt -> /KNOPPIX/opt
sbin -> /KNOPPIX/sbin
usr -> /KNOPPIX/usr

root@ttyp1[/]# cd /sbin
root@ttyp1[sbin]# ls -l init
-rwxr-xr-x  1 root root 50932 2004-11-11 08:31 init
root@ttyp1[sbin]# ls -l halt
lrwxrwxrwx  1 root root 4 2005-01-22 13:42 halt -> init
root@ttyp1[sbin]# ls -l reboot
lrwxrwxrwx  1 root root 4 2005-01-22 13:42 reboot -> init

/etc/inittab
si::sysinit:/etc/init.d/rcS
l0:0:wait:/etc/init.d/knoppix-halt
l6:6:wait:/etc/init.d/knoppix-reboot
ca::ctrlaltdel:/etc/init 0
kb::kbrequest:/bin/echo "Keyboard Request -- edit /etc/inittab to let this work."
pf::powerwait:/etc/init.d/powerfail start
pn::powerfailnow:/etc/init.d/powerfail now
po::powerokwait:/etc/init.d/powerfail stop

/etc/init.d
knoppix-autoconfig -> /KNOPPIX/etc/init.d/knoppix-autoconfig
knoppix-halt -> /KNOPPIX/etc/init.d/knoppix-halt
knoppix-reboot -> /KNOPPIX/etc/init.d/knoppix-reboot

case "$CMDLINE" in *noprompt*) NOPROMPT="yes"; ;; esac
FINALCMD="/sbin/$command"
if [ -z "$INSTALLED" -a -z "$NOPROMPT" ]; then
[ -x /etc/init ] || cp -p /sbin/init /etc/
[ -x /etc/init ] && FINALCMD="/etc/init"

/KNOPPIX/etc/init.d
knoppix-halt -> knoppix-reboot

  • halt, reboot, Ctl-Alt-Del ¸ðµÎ knoppix-halt ¸¦ ¼öÇàÇÏ°í, °á°úÀûÀ¸·Î /etc/init ¸¦ ¸¶Áö¸·À¸·Î ¼öÇàÇÔ.
  • /etc/init.d/powerfail ÀÌ ¾ø½¿.


Â÷ÀÌÁ¡

34,38c36,37
< init:         init.o init_utmp.o
< halt:         halt.o ifdown.o hddown.o utmp.o reboot.h
---
> init:         init.o init_utmp.o halt.o ifdown.o utmp.o reboot.h
102,103c92,94
<               cd $(ROOT)/sbin; ln -sf halt reboot;
<               cd $(ROOT)/sbin; ln -sf halt poweroff;
---
>               cd $(ROOT)/sbin; ln -sf init halt;
>               cd $(ROOT)/sbin; ln -sf init reboot; 
>               cd $(ROOT)/sbin; ln -sf init poweroff;
diff -r sysvinit-2.85/src/halt.c /home/tcheun/sysvinit-knoppix-2.84/src/halt.c
11c11
<  * Usage:     halt [-n] [-w] [-d] [-f] [-p]
---
>  * Usage:     halt [-n] [-w] [-d] [-f] [-p] [-r]
16a17
>  *            -r: reboot (act like "reboot")
>   /* KNOPPIX: the "halt" options idfnpwt
halt.c
if (!strcmp(progname, "reboot")) do_reboot = 1;
if (!strcmp(progname, "poweroff")) do_poweroff = 1;

¿É¼Ç 
case 'n': do_sync = 0; do_wtmp = 0;
case 'w': do_nothing = 1;
case 'd': do_wtmp = 0;
case 'f': do_hard = 1;
case 'i': do_ifdown = 1;
case 'p': do_poweroff = 1;
case 'r': do_reboot = 1;
case 't': tm = optarg;

fc3 Ãß°¡ 
case 'h': do_hddown = 1;
  • halt.c ¿¡¼­ Please remove CD, close cdrom drive and hit return. ó¸®

inittab in fedora

  • ca::ctrlaltdel:/sbin/shutdown -t3 -r now
  • pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"
  • pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"
  • shutdown.c
  • -r ÀÇ °æ¿ì reboot rc6.d ¼öÇà
    • S00killall
    • S01reboot /sbin/reboot ¸µÅ© to /sbin/halt
  • -h ÀÇ °æ¿ì halt rc0.d ¼öÇà
    • S00killall
    • S01halt /sbin/halt

¸í·É¾î

gnome -> ¸í·É -> ·Î±×¾Æ¿ô


/proc/sys/dev/cdrom/autoclose /proc/sys/dev/cdrom/autoeject /proc/sys/dev/cdrom/check_media /proc/sys/dev/cdrom/debug /proc/sys/dev/cdrom/info /proc/sys/dev/cdrom/lock

As an example, the auto eject feature can be turned on by the superuser with the command echo "1" > /proc/sys/dev/cdrom/autoeject. This will cause cdroms to be ejected from the drive when unmounted.

modify sysvinit

boot booyo need libsepol-devel-1.1.1-2.i386.rpm make BUILD mv src to fedora for CVS (sshd) boot fedora change source code (Makefile, halt.c, init.c) boot booyo mv source code make

ÇØ¾ß ÇÒ ÀÏ halt.c commit ÇÒ °Í /sbin/init.org halt.org reboot.org
1019 mv init init.org 1020 cp -p /usr/src/booyo/BUILD/sysvinit-2.85/src/init . 1023 mv halt halt.org 1025 ln -sf init halt 1028 mv reboot reboot.org 1029 ls -l reboot.org 1030 ln -sf init reboot 1033 mv poweroff poweroff.org 1034 ln -sf init poweroff

booyo-halt ¼öÁ¤ ÇÊ¿ä

/initrd/etc/rc.d/inittab, /initrd/init ¼öÁ¤Çß½¿.

2006.6.7

init À» ¸¸µé¶§ static ¿É¼ÇÀ» ÁÖ¾î¾ß ÇÔ. ¾ÆÁ÷ ¹®Á¦°¡ ¾ø´Â °ÍÀº ¾Æ´Ô. inittab ¸¦ 6 ·Î ÇÏ°í booyo-halt ¸¦ ¹Ù·Î ¼öÇàÇÒ °æ¿ì¿¡ /BOOYO °¡ busy ·Î ³ª¿À´Â ÀÌÀ¯´Â ¹«¾ùÀϱî?

strip init cp init /mnt/sda11/sbin/ reboot /mnt/sda11 make compressed

»õ ¹öÀüÀ¸·Î ¼öÁ¤ÇØ¾ß ÇÔ.

ID
Password
Join
Someone is speaking well of you.


sponsored by andamiro
sponsored by cdnetworks
sponsored by HP

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2005-07-03 12:39:31
Processing time 0.0053 sec