この方法でも HD-LAN シリーズ Ver. 1.0 と同じく FLASH ROM から起動する Linux 上で chroot にて仮想ルートディレクトリを作成し、 その中で各種サーバを動作させる方法を採ります。
|
# mke2fs -j /dev/hdc1 # mke2fs /dev/hdc3 |
|
# mkdir /tmp/root # mount /dev/hdc1 /tmp/root |
|
# mount /mnt/cdrom # cd /tmp/root # mkdir /tmp/root/HackKit # cd /tmp/root/HackKit # tar zxvpf /mnt/cdrom/hackkit-x.y.tar.gz |
#!/bin/sh
#
# HackKit
#
start() {
touch /fastboot
rm -f /.autofsck
/etc/rc.d/rc.sysinit
for f in /etc/rc.d/rc3.d/S*
do
$f start
done
}
stop() {
for f in `ls /etc/rc.d/rc3.d/S* | sort -r`
do
$f stop
done
umount /proc
umount /dev/pts
}
case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0
|
#!/bin/sh if [ `df | sed -n -e 's;^/dev/hda1.*[ ]*\([0-9][0-9]*\)%.*$;\1;p'` -ge 90 ] then echo -n "WWWW" > /dev/ttyS1 exit 1 fi echo -n "VVVV" > /dev/ttyS1 exit 0 |
# cd / # umount /tmp/root |
# mkdir /tmp/mnt2 # mount /dev/hdc3 /tmp/mnt2 |
# cd /tmp/root # tar zxvf /tmp/mnt2/hdlan_diffimg.tar.gz |
#!/bin/sh
#
# HackKit
#
start() {
/etc/rc.d/init.d/atalk stop
/etc/rc.d/init.d/smb stop
/etc/rc.d/init.d/cron stop
/etc/rc.d/init.d/thttpd stop
/etc/rc.d/init.d/inetd stop
/etc/rc.d/init.d/syslog stop
kill `cat /var/run/apservd-eth0.pid`
/etc/rc.d/init.d/networking stop
/etc/rc.d/init.d/atalk stop
rm -fr /www
mkdir /www
mkdir /www/script
cp /mnt/HackKit/www/script/*.sh /www/script
/mnt/HackKit/usr/sbin/chroot /mnt/HackKit /etc/rc.d/init.d/hackkitjail start
}
stop() {
/mnt/HackKit/usr/sbin/chroot /mnt/HackKit /etc/rc.d/init.d/hackkitjail stop
}
test -x /mnt/HackKit/etc/rc.d/init.d/hackkitjail || exit 1
case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0
|
# cd /tmp/root/etc/rc.d/rc0.d # ln -s ../init.d/hackkit K10hackkit # cd ../rc2.d # ln -s ../init.d/hackkit S96hackkit |
# cd /tmp/root # tar zcvf /tmp/mnt2/hdlan_diffimg.tar.gz . # cd / # umount /tmp/mnt2 |
| ← | ハックキットを使ってホームサーバを構築しよう | → 最初の設定 |
|
LinkStation/玄箱 ハックキット | ||
| LinkStation/玄箱 をハックしよう |