Kroutoshikou KURO-BOX (IETSUNA) kernel 2.4.17-kuro-box on ppc KURO-BOX-EM login: root Password: #-EM が付いているのが、インストール後と異なるところ。
# df Filesystem 1k-blocks Used Available Use% Mounted on /dev/ram0 9677 5495 4182 57% /RAM DISK ベースで動いている。
# ps -aux PID TTY Uid Size State Command 1 root 1448 S init 2 root 0 S [keventd] 3 root 0 S [ksoftirqd_CPU0] 4 root 0 S [kswapd] 5 root 0 S [bdflush] 6 root 0 S [kupdated] 39 root 1436 S dhcpcd -h KURO-BOX-EM -t 3 eth0 57 root 1732 S /sbin/syslogd 59 root 1500 S /sbin/klogd 67 root 1592 S /usr/sbin/ap_servd -i eth0 -c 72 root 1552 S /usr/sbin/inetd 76 root 1420 S /usr/sbin/ppc_uartd 78 ttyS0 root 1436 S /sbin/getty console 79 root 1696 S in.telnetd: 192.168.1.22 80 root 1536 S -ash 89 root 1852 R ps -auxアドレスを自動取得するために dhcpcd が、
# ls -l /bin -rwxr-xr-x 1 root root 137235 Nov 2 16:21 ash -rwxr-xr-x 1 root root 257404 Feb 2 2004 awk lrwxrwxrwx 1 root root 3 Feb 9 2004 bash -> ash -rwxr-xr-x 1 root root 287472 Feb 2 2004 busybox -rwxr-xr-x 1 root root 10992 Oct 22 17:04 cat -rwxr-xr-x 1 root root 19984 Oct 22 17:04 chmod -rwxr-xr-x 1 root root 22284 Oct 22 17:04 chown -rwxr-xr-x 1 root root 42616 Oct 22 17:04 cp lrwxrwxrwx 1 root root 7 Feb 9 2004 dd -> busybox lrwxrwxrwx 1 root root 7 Feb 9 2004 df -> busybox -rwxr-xr-x 1 root root 13612 Oct 22 17:04 echo lrwxrwxrwx 1 root root 7 Feb 9 2004 grep -> busybox lrwxrwxrwx 1 root root 7 Feb 9 2004 gzip -> busybox -rwxr-xr-x 1 root root 11048 Oct 22 17:04 hostname -r-xr-xr-x 1 root root 12648 Oct 22 17:04 kill lrwxrwxrwx 1 root root 7 Feb 9 2004 ln -> busybox -rwxr-xr-x 1 root root 42520 Oct 22 17:04 login lrwxrwxrwx 1 root root 7 Feb 9 2004 ls -> busybox -rwxr-xr-x 1 root root 21376 Oct 22 17:04 mkdir -rwsr-xr-x 1 root root 74516 Oct 22 17:04 mount -rwxr-xr-x 1 root root 52396 Oct 22 17:04 mv lrwxrwxrwx 1 root root 7 Feb 9 2004 ps -> busybox -rwxr-xr-x 1 root root 31376 Oct 22 17:04 rm -rwxr-xr-x 1 root root 13468 Oct 22 17:04 rmdir -rwxr-xr-x 1 root root 9924 Feb 2 2004 run-parts -rwxr-xr-x 1 root root 12373 Oct 22 17:04 setifmac lrwxrwxrwx 1 root root 3 Feb 9 2004 sh -> ash lrwxrwxrwx 1 root root 7 Feb 9 2004 sleep -> busybox -rwxr-xr-x 1 root root 34420 Oct 22 17:04 stty -rwxr-xr-x 1 root root 12108 Oct 22 17:04 sync -rwxr-xr-x 1 root root 179108 Oct 22 17:04 tar -rwxr-xr-x 1 root root 29804 Oct 22 17:04 touch -rwsr-xr-x 1 root root 39192 Oct 22 17:04 umount lrwxrwxrwx 1 root root 7 Feb 9 2004 uname -> busybox -rwxr-xr-x 1 root root 130243 Oct 22 17:04 unzip lrwxrwxrwx 1 root root 7 Feb 9 2004 vi -> busybox lrwxrwxrwx 1 root root 7 Feb 9 2004 wc -> busyboxさすがに FLASH に入りきらないのか、busybox が使われている。
# ls -l /sbin -rwxr-xr-x 1 root root 30616 Feb 2 2004 dhcpcd -rwxr-xr-x 1 root root 167309 Oct 22 17:05 e2fsck -rwxr-xr-x 1 root root 24637 Oct 22 17:05 fsck lrwxrwxrwx 1 root root 6 Feb 9 2004 fsck.ext2 -> e2fsck lrwxrwxrwx 1 root root 6 Feb 9 2004 fsck.ext3 -> e2fsck -rwxr-xr-x 1 root root 18998 Oct 22 17:05 getty -rwxr-xr-x 1 root root 8236 Oct 22 17:05 halt -rwxr-xr-x 1 root root 79312 Oct 22 17:05 ifconfig lrwxrwxrwx 1 root root 4 Feb 9 2004 ifdown -> ifup -rwxr-xr-x 1 root root 23560 Feb 3 2004 ifup -rwxr-xr-x 1 root root 32024 Oct 22 17:05 init -rwxr-xr-x 1 root root 17929 Oct 22 17:05 killall -rwxr-xr-x 1 root root 9400 Oct 22 17:05 killall5 -r-xr--r-- 1 root root 22180 Oct 22 17:05 klogd lrwxrwxrwx 1 root root 32 Feb 9 2004 mel_shutdown -> ../www/script/melsub_shutdown.sh -rwxr-xr-x 1 root root 88160 Feb 5 2004 mfdisk -rwxr-xr-x 1 root root 90725 Oct 22 17:05 mke2fs -rwxr-xr-x 1 root root 2370 Feb 9 2004 mkfilesystem.sh -rwxr-xr-x 1 root root 8130 Oct 22 17:05 mkfs lrwxrwxrwx 1 root root 6 Feb 9 2004 mkfs.ext2 -> mke2fs lrwxrwxrwx 1 root root 14 Feb 9 2004 mkswap -> ../bin/busybox lrwxrwxrwx 1 root root 4 Feb 9 2004 poweroff -> halt -rwxr-xr-x 1 root root 6564 Oct 22 17:05 probe lrwxrwxrwx 1 root root 4 Feb 9 2004 reboot -> halt -rwxr-xr-x 1 root root 53248 Oct 22 17:05 route -rwxr-xr-x 1 root root 3792 Oct 22 17:05 runlevel -rwxr-xr-x 1 root root 16048 Oct 22 17:05 shutdown -rwxr-xr-x 1 root root 18757 Oct 22 17:05 start-stop-daemon lrwxrwxrwx 1 root root 14 Feb 9 2004 syslogd -> ../bin/busybox lrwxrwxrwx 1 root root 4 Feb 9 2004 telinit -> init -rwxr-xr-x 1 root root 78141 Oct 22 17:05 tune2fsfsck, tunefs, mkfs と、メンテナンスコマンドがほぼそろっている。
12/5 に見つけた mfdisk もある。
(ひ)さんを見習って usage を出してみる
# mfdisk --help mfdisk: invalid option -- - Partition table manipulator for BUFFALO INC. Link Station series. ver 1.5, 2003.10.3 Usage: mfdisk DISK Create partition tables for HD-LAN ver 1.xx mfdisk -f DISK Create partition tables for HD-LAN ver 2.xx mfdisk -h DISK Create partition tables for HD-HLAN mfdisk -g [1:2:3:5:10:20:50] DISK Create partition tables mfdisk -a DISK Create partition table for HD-HLAN's USB Disk mfdisk -c DISK Create partition table(s) with menu mfdisk -p DISK Check partition table(s) mfdisk -e DISK Deleate all partition tables mfdisk -d [1:2:3:4] DISK Create partition tables for Link Station Here DISK is something like /dev/hda or /dev/sdaおー、使えそう。でも玄箱向けのパーティションはないようだ。
# mfdisk -h /dev/hda delete partition 1 delete partition 2 delete partition 3 create partitions... limit = 262079 start = 63, stop(limit) = 262079 limit = 786239 start = 262080, stop(limit) = 786239 limit = 2130911 start = 786240, stop(limit) = 2130911 The partition table has been altered! Syncing disks. # mfdisk -c /dev/hda Command (m for help): p Disk /dev/hda: 16 heads, 63 sectors, 2114 cylinders Units = cylinders of 1008 * 512 bytes Device Boot Start End Blocks Id System /dev/hda1 1 260 131008+ 83 Linux /dev/hda2 261 780 262080 82 Linux swap /dev/hda3 781 2114 672336 83 Linux Command (m for help):-c をつければ、fdisk 相当である。
fdisk って、GPL だったかな?
fdisk は util-linux の一部で、玄箱の CD-ROM には、
-r--r--r-- 1 yasunari 5 1420236 Nov 26 2002 hhl-target-util-linux-2.11h-mvl2.1.0.3.src.rpmがあるので、ソースが付いている事を期待して、後日ハックしよう。
フォーマットしてみる。
# mkfs -j /dev/hda1 mke2fs 1.22, 22-Jun-2001 for EXT2 FS 0.5b, 95/08/09 Filesystem label= OS type: Linux Block size=1024 (log=0) Fragment size=1024 (log=0) 32768 inodes, 131008 blocks 6550 blocks (5.00%) reserved for the super user First data block=1 16 block groups 8192 blocks per group, 8192 fragments per group 2048 inodes per group Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729 Writing inode tables: done Creating journal (4096 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 36 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. # mkfs -j /dev/hda3 mke2fs 1.22, 22-Jun-2001 for EXT2 FS 0.5b, 95/08/09 Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 84096 inodes, 168084 blocks 8404 blocks (5.00%) reserved for the super user First data block=0 6 block groups 32768 blocks per group, 32768 fragments per group 14016 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840 Writing inode tables: done Creating journal (4096 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 25 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.マウントしてみる
# mkdir /tmp/root # mount /dev/hda1 /tmp/root # mkdir /tmp/root/mnt # mount /dev/hda3 /tmp/root/mnt問題なし。
# mkswap /dev/hda2 Setting up swapspace version 1, size = 268365824 bytes # swapon -a swapon: not found残念ながら swap を有効にはできなかった。有効にしてどーする!
# ls -l /usr/sbin -rwxr-xr-x 1 root root 52225 Feb 9 2004 ap_servd -rwxr-xr-x 1 root root 8944 Oct 22 17:05 icmprequest -rwxr-xr-x 1 root root 64457 Jan 24 2003 in.ftpd -rwxr-xr-x 1 root root 48738 Jan 24 2003 in.telnetd -rwxr-xr-x 1 root root 20012 Oct 22 17:05 inetd -rwxr-xr-x 1 root root 12722 Feb 2 2004 ppc_uartd -rwxr-xr-x 1 root root 5008 Oct 22 17:05 tcpdぅぉー。in.ftpd まである。
# grep ftp /etc/inetd.conf # ftp stream tcp nowait root /usr/sbin/tcpd wu.ftpd -a # ftp stream tcp nowait root /usr/sbin/tcpd proftpd ftp stream tcp nowait root /usr/sbin/tcpd in.ftpd # Tftp service is provided primarily for booting. Most sites # tftp dgram udp wait nobody /usr/sbin/tcpd in.tftpd /tftpboot # bootps dgram udp wait root /usr/sbin/bootpd bootpd -c /tftpbootftp もできてしまいそう。
linkstationVine# ftp 192.168.1.123 Connected to 192.168.1.123. 220 KURO-BOX-EM FTP server (Version 6.4/OpenBSD/Linux-ftpd-0.17) ready. Name (192.168.1.123:yasunari): root 331 Password required for root. Password: 230- Linux 2.4.17 ppc unknown 230 User root logged in. Remote system type is UNIX. Using binary mode to transfer files. ftp>わウォー。root で ftp できてしまう。ますますもって危険。
ということで(?)ハックキットを玄箱にインストールする際、
別の Linux マシンも要らないし、
あらかじめ玄人志向ファームウェアをインストールしておく必要もなさそう。
と思っていたら、
# ls /lib/modules/ ls: /lib/modules/: No such file or directoryカーネルモジュールがなかった。残念。
# cat /var/log/messages : : Jan 17 22:11:20 KURO-BOX-EM kern.warn kernel: Boot from /dev/hda1. Jan 17 22:11:20 KURO-BOX-EM kern.warn kernel: VFS: Mounted root (ext2 filesystem). Jan 17 22:11:20 KURO-BOX-EM kern.warn kernel: Boot from /dev/hda1. Jan 17 22:11:20 KURO-BOX-EM kern.warn kernel: VFS: Mounted root (ext2 filesystem). Jan 17 22:11:20 KURO-BOX-EM kern.warn kernel: change_root: old root has d_count=5 Jan 17 22:11:20 KURO-BOX-EM kern.err kernel: Trying to unmount old root ... error -16 Jan 17 22:11:20 KURO-BOX-EM kern.err kernel: Change root to /initrd: error -2 : :思ったとおり、initrd であるが、、、error?