ハックキットのインストーラを作るため、まずは手作業でインストールする。
# mkdir -p /mnt/disk1 # mount /dev/sda6 /mnt/disk1 # ls /mnt/disk1/ hackkit spool #さすがにこれはスクリプトにはできない。
# echo 'DEVICE /dev/disk?_1 /dev/disk?_2 /dev/disk?_5' > /etc/mdadm.conf # mdadm -Eb /dev/disk?_1 /dev/disk?_2 /dev/disk?_5 >> /etc/mdadm.conf # mdadm -As --force mdadm: /dev/disk2_1 has wrong uuid. mdadm: /dev/disk1_1 has wrong uuid. mdadm: /dev/disk2_2 has wrong uuid. mdadm: /dev/disk1_2 has wrong uuid. mdadm: /dev/md10 has been started with 2 drives. mdadm: /dev/disk2_1 has wrong uuid. mdadm: /dev/disk1_1 has wrong uuid. mdadm: /dev/md1 has been started with 2 drives. mdadm: /dev/md0 has been started with 2 drives. #できたのか?
# cat /proc/mdstat Personalities : [raid0] [raid1] md10 : active raid1 sda5[0] sdb5[1] 1003904 blocks [2/2] [UU] md1 : active raid1 sda2[0] sdb2[1] 5004160 blocks [2/2] [UU] md0 : active raid1 sda1[0] sdb1[1] 1003904 blocks [2/2] [UU] unused devices: <none> #いけてそう。
# mkdir /mnt/debinst # mount /dev/md1 /mnt/debinst # ls /mnt/debinst/ bin dev home lib mnt proc root sys usr www boot etc initrd libexec modules pwrmgrlog sbin tmp var #
# cd /mnt/debinst/ # mkdir .buffalo # mv * .buffalo #
# tar zxvf /mnt/disk1/hackkit/hackkit_080317.tar.gz : :
# mv .buffalo usr/local/buffalo #
# vi etc/fstab # cat etc/fstab # /etc/fstab: static file system information. # #マウントポイントも作る/dev/md1 / xfs defaults,noatime 0 0 proc /proc proc defaults 0 0 /dev/md10 swap swap defaults 0 0 /dev/md0 /boot ext3 defaults,noatime 0 0 /dev/sda6 /mnt/disk1 xfs defaults,noatime 0 0 /dev/sdb6 /mnt/disk2 xfs defaults,noatime 0 0 #
# mkdir /mnt/debinst/mnt/disk1 # mkdir /mnt/debinst/mnt/disk2 #
# vi etc/init.d/miconapl : : # cat etc/init.d/miconapl #!/bin/sh case "$1" in start) echo off > /proc/buffalo/gpio/led/power_blink ;; stop) echo on > /proc/buffalo/gpio/led/power_blink ;; *) echo "Usage: $0 {start|stop}" exit 1 esac exit 0 # chmod +x etc/init.d/miconapl # ln -s ../init.d/miconapl etc/rc0.d/K10miconapl # ln -s ../init.d/miconapl etc/rc6.d/K10miconapl # ln -s ../init.d/miconapl etc/rcS.d/S80miconapl # ls -l etc/*/*miconapl -rwxr-xr-x 1 root root 248 Oct 27 22:55 etc/init.d/miconapl lrwxrwxrwx 1 root root 18 Oct 27 22:56 etc/rc0.d/K10miconapl -> ../init.d/miconapl lrwxrwxrwx 1 root root 18 Oct 27 22:56 etc/rc6.d/K10miconapl -> ../init.d/miconapl lrwxrwxrwx 1 root root 18 Oct 27 22:56 etc/rcS.d/S80miconapl -> ../init.d/miconapl #
# vi etc/init.d/usb : : # cat etc/init.d/usb #!/bin/sh case "$1" in start) echo on > /proc/buffalo/gpio/power_control/usb0 chroot /usr/local/buffalo mount /proc chroot /usr/local/buffalo insmod /lib/modules/2.6.16.16-arm1/kernel/drivers/usb/core/usbcore.ko chroot /usr/local/buffalo insmod /lib/modules/2.6.16.16-arm1/kernel/drivers/usb/host/ehci-marvell-hcd.ko chroot /usr/local/buffalo insmod /lib/modules/2.6.16.16-arm1/kernel/drivers/usb/storage/usb-storage.ko chroot /usr/local/buffalo insmod /lib/modules/2.6.16.16-arm1/kernel/fs/fat/fat.ko chroot /usr/local/buffalo insmod /lib/modules/2.6.16.16-arm1/kernel/fs/vfat/vfat.ko chroot /usr/local/buffalo insmod /lib/modules/2.6.16.16-arm1/kernel/fs/msdos/msdos.ko chroot /usr/local/buffalo insmod /lib/modules/2.6.16.16-arm1/kernel/drivers/usb/class/usblp.ko ;; stop) chroot /usr/local/buffalo umount /proc echo off > /proc/buffalo/gpio/power_control/usb0 ;; *) echo "Usage: $0 {start|stop}" exit 1 esac exit 0 # chmod +x etc/init.d/usb # ln -s ../init.d/usb etc/rc0.d/K10usb # ln -s ../init.d/usb etc/rc2.d/S90usb # ln -s ../init.d/usb etc/rc6.d/K10usb # ls -l etc/*/*usb -rwxr-xr-x 1 root root 838 Oct 27 23:03 etc/init.d/usb lrwxrwxrwx 1 root root 13 Oct 27 23:05 etc/rc0.d/K10usb -> ../init.d/usb lrwxrwxrwx 1 root root 13 Oct 27 23:06 etc/rc2.d/S90usb -> ../init.d/usb lrwxrwxrwx 1 root root 13 Oct 27 23:06 etc/rc6.d/K10usb -> ../init.d/usb #
# vi usr/local/sbin/kernelmon : : # cat usr/local/sbin/kernelmon #!/bin/sh while : do LINE=`cat /proc/buffalo/kernevnt` #echo "line [$LINE]" if [ "$LINE" = PSW_off ] then shutdown -h now fi done # chmod +x usr/local/sbin/kernelmon #
# vi etc/init.d/kernelmon : : # cat etc/init.d/kernelmon #!/bin/sh case "$1" in start) echo on > /proc/buffalo/gpio/switch/sw_control /usr/local/sbin/kernelmon & ;; stop) ;; *) echo "Usage: $0 {start|stop}" exit 1 esac exit 0 # chmod +x etc/init.d/kernelmon # ln -s ../init.d/kernelmon etc/rcS.d/S81kernelmon #
さあ、LS-WSGL 依存のところは、こんなところか。
あとはネットワーク系とぉ、、、initrd か。
# sh /mnt/disk1/hackkit/LS-WSGL_hackkit_step2_0.00.sh creating network_interfaces ... creating resolv.conf ... creating hosts ... creating hostname ... #
# umount /mnt/debinst #
# mount /dev/md0 /boot EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended # ls /boot conf_save.tgz initrd.gz conf_save.tgz.orig log.tgz hddrootfs.buffalo.updated.done lost+found initrd.buffalo uImage.buffalo initrd.buffalo.orig #
# cd /boot # mv initrd.buffalo initrd.buffalo.RamRoot #
# gunzip initrd.gz # mknod /dev/loop0 b 7 0 # mkdir /tmp/root # mount -o loop initrd /tmp/root # cd /tmp/root #
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin echo "---- in linuxrc ---" mount proc /proc -t proc mount sysfs /sys -t sysfs /etc/init.d/startSysMd.sh echo "0x901" > /proc/sys/kernel/real-root-dev umount /sys umount /proc umount -a exit 0このぐらいか。
# vi linuxrc : : # cat linuxrc #!/bin/sh export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin echo "---- in hackkit linuxrc ---" mount proc /proc -t proc mount sysfs /sys -t sysfs /etc/init.d/startSysMd.sh echo "0x901" > /proc/sys/kernel/real-root-dev umount /sys umount /proc umount -a exit 0 #
# cd / # umount /tmp/root #
# gzip /boot/initrd #
# /mnt/disk1/hackkit/mkimage -A ARM -O Linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initrd -d /boot/initrd.gz /boot/initrd.buffalo Image Name: initrd Created: Thu Nov 1 00:51:27 2007 Image Type: ARM Linux RAMDisk Image (gzip compressed) Data Size: 5598606 Bytes = 5467.39 kB = 5.34 MB Load Address: 0x00000000 Entry Point: 0x00000000 #できた。完璧のはず。
|
← KOF 展示環境 |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ メモリー、外付けHDD、ネットワーク対応HDDなど計44製品の価格改定を実施 |