今回は ”sysvinit-2.85.tar.gz”を 入手しました。
適当に作成したディレクトリに 移動して
# pwd /home/qpo/proj/1005_Startup_and_Shutdown # ls -a ./ ../ # cp ../../dokoka/hokannbasho/sysvinit-2.85.tar.gz .
# tar zxvf sysvinit-2.85.tar.gz
# cd sysvinit-2.85
# cd src/
# pwd
/home/qpo/proj/1005_Startup_and_Shutdown/sysvinit-2.85/src
# ls
Makefile hddown.c initreq.h mesg.c runlevel.c utmp.c
bootlogd.c ifdown.c initscript.sample* oldutmp.h set.h utmpdump.c
dowall.c init.c killall5.c paths.h shutdown.c wall.c
halt.c init.h last.c reboot.h sulogin.c
# { time make CC="gcc -mcpu=i386" 2>&1 | tee log-MAKE ;} ... gcc -mcpu=i386 -s -o wall dowall.o wall.o real 0m27.389s user 0m24.100s sys 0m1.250s # ls Makefile hddown.o initreq.h mesg* runlevel.o utmp.c bootlogd.c ifdown.c initscript.sample* mesg.c set.h utmp.o dowall.c ifdown.o killall5* mesg.o shutdown* utmpdump* dowall.o init* killall5.c oldutmp.h shutdown.c utmpdump.c halt* init.c last* paths.h shutdown.o utmpdump.o halt.c init.h last.c reboot.h sulogin* wall* halt.o init.o last.o runlevel* sulogin.c wall.c hddown.c init_utmp.o log-MAKE runlevel.c sulogin.o wall.o
# ls ../../../staging/ bin/ dev/ home/ mnt/ proc/ sbin/ usr/ boot/ etc/ lib/ opt/ root/ tmp/ var/ # ls ../../../staging/sbin/ agetty* fdisk* fsck.ext2@ mke2fs* mkfs.ext2@ e2fsck* fsck* getty@ mkfs* swapon* # cp halt init shutdown ../../../staging/sbin/ # ls ../../../staging/sbin/ agetty* fdisk* fsck.ext2@ halt* mke2fs* mkfs.ext2@ swapon* e2fsck* fsck* getty@ init* mkfs* shutdown* # ln -s halt ../../../staging/sbin/reboot # ls ../../../staging/sbin/ agetty* fdisk* fsck.ext2@ halt* mke2fs* mkfs.ext2@ shutdown* e2fsck* fsck* getty@ init* mkfs* reboot@ swapon* # ln -s init ../../../staging/sbin/telinit # ls ../../../staging/sbin/ agetty* fdisk* fsck.ext2@ halt* mke2fs* mkfs.ext2@ shutdown* telinit@ e2fsck* fsck* getty@ init* mkfs* reboot@ swapon* # ls -l ../../../staging/sbin/| \ awk '{printf "%-10s\t%3d\t%8d\t%-12s\t%4s\t%12s\n",$1,$2,$5,$9,$10,$11}' | sed 1d -rwxr-xr-x 1 14492 agetty* -rwxr-xr-x 1 173480 e2fsck* -rwxr-xr-x 1 73544 fdisk* -rwxr-xr-x 1 32100 fsck* lrwxrwxrwx 1 6 fsck.ext2 -> e2fsck* lrwxrwxrwx 1 6 getty -> agetty* -rwxr-xr-x 1 8592 halt* -rwxr-xr-x 1 27180 init* -rwxr-xr-x 1 82596 mke2fs* -rwxr-xr-x 1 4920 mkfs* lrwxrwxrwx 1 6 mkfs.ext2 -> mke2fs* lrwxrwxrwx 1 4 reboot -> halt* -rwxr-xr-x 1 15432 shutdown* -rwxr-xr-x 1 7864 swapon* lrwxrwxrwx 1 4 telinit -> init*
halt と shutdown の 違いは 明白に 理解していないのですがそのうち必要 になるような感じです。
わすれないで initctl が 必要なようです。
# pwd /home/qpo/proj/1005_Startup_and_Shutdown # mknod ../staging/dev/initctl p # ls ../staging/dev/ console fd0 initctl| null ram0
# file sysvinit-2.85/src/halt sysvinit-2.85/src/halt: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), \ for GNU/Linux 2.0.0, dynamically linked (uses shared libs), stripped n# file sysvinit-2.85/src/init sysvinit-2.85/src/init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), \ for GNU/Linux 2.0.0, dynamically linked (uses shared libs), stripped # file sysvinit-2.85/src/shutdown sysvinit-2.85/src/shutdown: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), \ for GNU/Linux 2.0.0, dynamically linked (uses shared libs), stripped
にゃんたろう 拝!
2010年 8月29日 (日) 21:06:33 JST 作成