再インストール

Debian LS-XHL

動いたばっかりだが、 /etc/network/interface の修正をインストーラに反映して 再インストールする。

インストーラの修正

LS-GL で修正。
yasunari@ude:/home/linkstation/HackKit/unified$ diff -u hackkit_090215.sh hackki
t_090216.sh
--- hackkit_090215.sh   2009-02-15 21:00:54.000000000 +0900
+++ hackkit_090216.sh   2009-02-16 20:37:53.995806375 +0900
@@ -4,13 +4,13 @@
 # Copyright (C) Yasunari YAMASHITA. All Rights Reserved.
 #

-ADDRESS=192.168.2.49
+ADDRESS=192.168.2.47
 NETWORK=192.168.2.0
 NETMASK=255.255.255.0
 BROADCAST=192.168.2.255
 GATEWAY=192.168.2.1
 NAMESERVER=192.168.1.2
-HOSTNAME=brick
+HOSTNAME=hackkit

 WORK=/mnt/disk1/share/hackkit
 HACKKIT=$WORK/hackkit_081209.tar.gz
@@ -468,6 +468,12 @@
 #======================================================================
 # setup network
 network_interfaces() {
+       ETH=eth0
+       if [ $MACHINE = LSXHL ]
+       then
+               ETH=eth1
+       fi
+
        cat > $MOUNTPOINT/etc/network/interfaces <<EOF
 ######################################################################
 # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
@@ -482,13 +488,13 @@

 # To use dhcp:
 #
-# auto eth0
-# iface eth0 inet dhcp
+# auto $ETH
+# iface $ETH inet dhcp

 # Static IP setup: (broadcast and gateway are optional)
 #
-auto eth0
-iface eth0 inet static
+auto $ETH
+iface $ETH inet static
 EOF
        (
        echo "  address $ADDRESS"
yasunari@ude:/home/linkstation/HackKit/unified$

準備

標準ファームに root でログインできるようにします

標準ファームで起動

ハックキットのファイルを置きます

root@LS-XHLA1F:~# ls -l /mnt/disk1/share/hackkit/
-rwxrw-rw-    1 nobody   nogroup  66409295 Dec  9 23:28 hackkit_081209.tar.gz
-rwxrw-rw-    1 nobody   nogroup     18691 Dec 14 19:37 hackkit_081214.sh
-rwxr--r--    1 root     root        19520 Feb 15 21:00 hackkit_090215.sh
-rwxrw-rw-    1 nobody   nogroup     19579 Feb 16 20:37 hackkit_090216.sh
-rwxr-xr-x    1 root     root        15920 Oct 26 14:46 mkimage
-rwxrw-rw-    1 nobody   nogroup      1067 Dec 13 09:11 ramroot_081213.sh
root@LS-XHLA1F:~#

インストール

ログイン

時計を合わせる

root@LS-XHLA1F:~# date
Mon Feb 16 22:11:11 JST 2009
root@LS-XHLA1F:~#
あってる。

インストールする HDD の準備(LS-WSGL 以外)

(1) ハックキットをインストールする HDD を USB で接続します。

(2) /mnt/usbdisk1 に自動的にマウントされた場合はアンマウントします。

root@LS-XHLA1F:~# df
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/sda2              4989760    330364   4659396   7% /
/dev/ram1                15360       116     15244   1% /mnt/ram
/dev/sda1               992036    136000    856036  14% /boot
/dev/disk1_6         149217988     65596 149152392   0% /mnt/disk1
/dev/usbdisk1_1         992036     27972    914068   3% /mnt/usbdisk1
root@LS-XHLA1F:~# umount /mnt/usbdisk1/
root@LS-XHLA1F:~#

(3) sdb にパーティションを切ります。

root@LS-XHLA1F:~# parted -s /dev/sdb print
Model: Hitachi  GEC534RF37924E (scsi)
Disk /dev/sdb: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
 1      17.4kB  1024MB  1024MB  ext3         primary
 2      1024MB  6144MB  5120MB  xfs          primary
 3      6144MB  7168MB  1024MB  linux-swap   primary
 4      7168MB  500GB   493GB   xfs          primary

root@LS-XHLA1F:~#

カスタマイズ

IP アドレスとホスト名を修正
root@LS-XHLA1F:~# cd /mnt/disk1/share/hackkit/
root@LS-XHLA1F:/mnt/disk1/share/hackkit# vi hackkit_090216.sh
	:
	:
root@LS-XHLA1F:/mnt/disk1/share/hackkit# head -20 !$
head -20 hackkit_090216.sh
#!/bin/sh
#
# LinkStation HackKit Installer.
# Copyright (C) Yasunari YAMASHITA. All Rights Reserved.
#

ADDRESS=192.168.2.49
NETWORK=192.168.2.0
NETMASK=255.255.255.0
BROADCAST=192.168.2.255
GATEWAY=192.168.2.1
NAMESERVER=192.168.1.2
HOSTNAME=brick

WORK=/mnt/disk1/share/hackkit
HACKKIT=$WORK/hackkit_081209.tar.gz
MOUNTPOINT=/mnt/debinst

BOOTPARTITION=/dev/sdb1
BOOTPARTITIONTYPE=ext3
root@LS-XHLA1F:/mnt/disk1/share/hackkit#

インストーラの実行

root@LS-XHLA1F:/mnt/disk1/share/hackkit# sh hackkit_090216.sh
PRODUCTID = 0x00000011
formating hard drive ...
mke2fs 1.40.5 (27-Jan-2008)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
62720 inodes, 249995 blocks
12499 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=260046848
8 block groups
32768 blocks per group, 32768 fragments per group
7840 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376

Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
meta-data=/dev/sdb2              isize=256    agcount=8, agsize=156250 blks
         =                       sectsz=512   attr=0
data     =                       bsize=4096   blocks=1250000, imaxpct=25
         =                       sunit=0      swidth=0 blks, unwritten=1
naming   =version 2              bsize=4096
log      =internal log           bsize=4096   blocks=2560, version=1
         =                       sectsz=512   sunit=0 blks, lazy-count=0
realtime =none                   extsz=4096   blocks=0, rtextents=0
Setting up swapspace version 1, size = 1023995904 bytes
meta-data=/dev/sdb4              isize=256    agcount=16, agsize=7521665 blks
         =                       sectsz=512   attr=0
data     =                       bsize=4096   blocks=120346640, imaxpct=25
         =                       sunit=0      swidth=0 blks, unwritten=1
naming   =version 2              bsize=4096
log      =internal log           bsize=4096   blocks=32768, version=1
         =                       sectsz=512   sunit=0 blks, lazy-count=0
realtime =none                   extsz=4096   blocks=0, rtextents=0
mounting root file system ...
extracting hackkit archive ...
./
./var/
./var/lib/
./var/lib/apt/
./var/lib/apt/lists/
./var/lib/apt/lists/partial/
./var/lib/apt/lists/ftp.jp.debian.org_debian_dists_lenny_Release
./var/lib/apt/lists/ftp.jp.debian.org_debian_dists_lenny_main_binary-armel_Packages
	:
	:
./initrd/
creating miconapl ...
creating kernelmon ...
copying /lib/modules ...
lib/modules/
lib/modules/2.6.22.18/
lib/modules/2.6.22.18/modules.ieee1394map
	:
	:
lib/modules/2.6.22.18/modules.dep
lib/modules/2.6.22.18/modules.ofmap
lib/modules/2.6.22.18/modules.symbols
lib/modules/2.6.22.18/modules.seriomap
creating usb ...
checking /dev/sdb1
fsck 1.40.5 (27-Jan-2008)
e2fsck 1.40.5 (27-Jan-2008)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdb1: 11/62720 files (9.1% non-contiguous), 6399/249995 blocks
mounting /boot ...
copying /boot ...
initrd.buffalo
uImage.buffalo
editing initrd ...
133156+1 records in
133156+1 records out
gunziping /mnt/debinst/boot/initrd.gz ...
gziping /mnt/debinst/boot/initrd ... wait 5 minutes
Image Name:   initrd
Created:      Mon Feb 16 22:17:06 2009
Image Type:   ARM Linux RAMDisk Image (gzip compressed)
Data Size:    8471943 Bytes = 8273.38 kB = 8.08 MB
Load Address: 0x00000000
Entry Point:  0x00000000
unmount /boot ...
root@LS-XHLA1F:/mnt/disk1/share/hackkit#
念のため確認。
root@LS-XHLA1F:/mnt/disk1/share/hackkit# mount /dev/sdb2 /tmp/root
root@LS-XHLA1F:/mnt/disk1/share/hackkit# cat /tmp/root/etc/network/interfaces
######################################################################
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# See the interfaces(5) manpage for information on what options are
# available.
######################################################################

# We always want the loopback interface.
#
auto lo
iface lo inet loopback

# To use dhcp:
#
# auto eth1
# iface eth1 inet dhcp

# Static IP setup: (broadcast and gateway are optional)
#
auto eth1
iface eth1 inet static
        address 192.168.2.49
        network 192.168.2.0
        netmask 255.255.255.0
        broadcast  192.168.2.255
        gateway 192.168.2.1
root@LS-XHLA1F:/mnt/disk1/share/hackkit#
eth1 にできている。

電源 OFF

ハックキットで起動

HDD の交換(LS-WSGL 以外)

起動

青点灯になったので、telnet してみる。
Debian GNU/Linux lenny/sid
brick login: guest
Password:
Linux brick 2.6.22.18 #132 Wed Jan 21 20:16:50 JST 2009 armv5tejl

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
No directory, logging in with HOME=/
guest@brick:/$ cat /proc/cpuinfo
Processor       : ARM926EJ-S rev 1 (v5l)
BogoMIPS        : 1199.30
Features        : swp half thumb fastmult edsp
CPU implementer : 0x56
CPU architecture: 5TE
CPU variant     : 0x2
CPU part        : 0x131
CPU revision    : 1
Cache type      : write-back
Cache clean     : cp15 c7 ops
Cache lockdown  : format C
Cache format    : Harvard
I size          : 16384
I assoc         : 4
I line length   : 32
I sets          : 128
D size          : 16384
D assoc         : 4
D line length   : 32
D sets          : 128

Hardware        : Feroceon-KW
Revision        : 0000
Serial          : 0000000000000000
guest@brick:/$
時には大胆に、時には確実に。

LS-XHL
バッファローダイレクト
楽天市場
amazon
Sofmap
ValuMore


あれとこれ
ハックの記録
LinkStation/玄箱 をハックしよう

LS-W{T,H}GL/R1シリーズ ファームウェア アップデータ Ver.[1-3].09

Copyright (C) 2003-2009 Yasunari Yamashita. All Rights Reserved.
yasunari @ yamasita.jp 山下康成@京都府向日市