-->

2011-05-30

gentoo kurobox shutdown

インストールする。
http://buffalo.nas-central.org/index.php/Install_the_Gentoo_Image
http://downloads.buffalo.nas-central.org/ALL_LS_KB_PPC/Distributions/Gentoo/
http://ftp.jaist.ac.jp/pub/Linux/Gentoo/releases/ppc/current-stage3/
http://tinderbox.dev.gentoo.org/default-linux/powerpc/ppc32/
http://kuro.dsk.jp/
http://www.genbako.com/
http://www.gentoo.org/doc/ja/handbook/handbook-x86.xml?part=1

システムの更新をする。
http://www.gentoo.org/doc/ja/handbook/handbook-x86.xml?part=2&chap=1

シャットダウンを登録する。
rc-update add kuro-shutdown shutdown

確認する。
$ ls -l /etc/runlevels/shutdown/
total 0
lrwxrwxrwx 1 root root 21 2011-05-30 13:10:34 killprocs -> /etc/init.d/killprocs*
lrwxrwxrwx 1 root root 25 2011-05-30 16:18:51 kuro-shutdown -> /etc/init.d/kuro-shutdown*
lrwxrwxrwx 1 root root 20 2011-05-30 13:10:34 mount-ro -> /etc/init.d/mount-ro*
lrwxrwxrwx 1 root root 21 2011-05-30 13:10:34 savecache -> /etc/init.d/savecache*

例。
$ cat /etc/init.d/kuro-shutdown
#!/sbin/runscript

description="shutdown kurobox."

depend()
{
    need mount-ro
}

start()
{
    if [ "$RC_RUNLEVEL" = shutdown ]; then
        if yesno "$RC_REBOOT"; then
            #/etc/init.d/reboot.sh
            if [ -c "/dev/ttyS1" ] ; then
                echo -n "CCCC" > /dev/ttyS1
            else
                ewarn "No /dev/ttyS1 device found, your Kurobox may not reboot correctly!"
            fi
        else
            #/etc/init.d/shutdown.sh
            if [ -c "/dev/ttyS1" ] ; then
                echo -n "EEEE" > /dev/ttyS1
            else
                ewarn "No /dev/ttyS1 device found, your Kurobox may not halt correctly!"
            fi
        fi
    fi
}

バージョン。
$ eix -c "^(binutils|gcc|linux-headers|glibc|baselayout|sysvinit|util-linux)$"
[I] sys-apps/baselayout (2.0.2@05/28/11): Filesystem baselayout and init scripts
[I] sys-apps/sysvinit (2.88-r1@05/29/11): /sbin/init - parent of all processes
[I] sys-apps/util-linux (2.19.1@05/29/11): Various useful Linux utilities
[I] sys-devel/binutils (2.20.1-r1@05/28/11): Tools necessary to build programs
[I] sys-devel/gcc (4.3.4(4.3)@05/29/11): The GNU Compiler Collection
[I] sys-kernel/linux-headers (2.6.27-r2@05/25/11): Linux system headers
[I] sys-libs/glibc (2.11.3(2.2)@05/29/11): GNU libc6 (also called glibc2) C library
Found 7 matches.

0 件のコメント: