ファームウェア 1.10 でハックキット

Debian LS-CHL

ハックキットが 1.10 でも動くか見る。
まぁ、壊れた LS-XHL で動いているし、大丈夫だろう。

インストーラの修正

PRODUCTID = 0x00000012
に対応する
yasunari@ude:/home/linkstation/HackKit/unified/current$ cp hackkit_090227.sh hackkit_090917.sh
yasunari@ude:/home/linkstation/HackKit/unified/current$ vi !$
	:
yasunari@ude:/home/linkstation/HackKit/unified/current$ !cp:s/cp/diff -c/
diff -c hackkit_090227.sh hackkit_090917.sh
*** hackkit_090227.sh   Fri Feb 27 20:53:05 2009
--- hackkit_090917.sh   Thu Sep 17 21:50:16 2009
***************
*** 725,730 ****
--- 725,735 ----

        ETH=eth1
        ;;
+ 0x00000012)
+       MACHINE=LSCHL
+
+       ETH=eth1
+       ;;
  0x00003002)
        MACHINE=LSWSGL

yasunari@ude:/home/linkstation/HackKit/unified/current$
さりげなく、!cp:s/cp/diff -c/

以下、 第三世代 LinkStation ハックキットの LS-XHL の手順を実行していく

準備(LS-XHL の場合)

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

標準ファームで起動

ハックキットのファイルを置く

ログイン


BUFFALO INC. LinkStation series

LS-CHL9EB login: root
No mail.
root@LS-CHL9EB:~#

時計を合わせる

root@LS-CHL9EB:~# date
Thu Nov  1 00:28:26 JST 2007
root@LS-CHL9EB:~# date 091722002009
Thu Sep 17 22:00:00 JST 2009
root@LS-CHL9EB:~#

インストールする HDD の準備

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

root@LS-CHL9EB:~# tail -f /var/log/messages
	:
	:
Sep 17 22:01:47 LS-CHL9EB kernel: usb 1-1: new high speed USB device using ehci_marvell and address 2
Sep 17 22:01:47 LS-CHL9EB kernel: usb 1-1: configuration #1 chosen from 1 choice
Sep 17 22:01:47 LS-CHL9EB kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Sep 17 22:01:52 LS-CHL9EB kernel: scsi 2:0:0:0: Direct-Access     ViPowER  VP-89118(SD1)    2.10 PQ: 0 ANSI: 4
Sep 17 22:01:52 LS-CHL9EB kernel: sd 2:0:0:0: [sdb] 398297088 512-byte hardware sectors (203928 MB)
Sep 17 22:01:52 LS-CHL9EB kernel: sd 2:0:0:0: [sdb] Write Protect is off
Sep 17 22:01:52 LS-CHL9EB kernel: sd 2:0:0:0: [sdb] Assuming drive cache: write through
Sep 17 22:01:52 LS-CHL9EB kernel: sd 2:0:0:0: [sdb] 398297088 512-byte hardware sectors (203928 MB)
Sep 17 22:01:52 LS-CHL9EB kernel: sd 2:0:0:0: [sdb] Write Protect is off
Sep 17 22:01:52 LS-CHL9EB kernel: sd 2:0:0:0: [sdb] Assuming drive cache: write through
Sep 17 22:01:52 LS-CHL9EB kernel:  sdb: sdb1 sdb2 sdb3 sdb4
Sep 17 22:01:52 LS-CHL9EB kernel: sd 2:0:0:0: [sdb] Attached SCSI disk
Sep 17 22:01:52 LS-CHL9EB kernel: sd 2:0:0:0: Attached scsi generic sg1 type 0
Sep 17 22:01:54 LS-CHL9EB kernel: FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
Sep 17 22:01:54 LS-CHL9EB kernel: kjournald starting.  Commit interval 5 seconds
Sep 17 22:01:54 LS-CHL9EB kernel: EXT3-fs warning: checktime reached, running e2fsck is recommended
Sep 17 22:01:54 LS-CHL9EB kernel: EXT3 FS on sdb1, internal journal
Sep 17 22:01:54 LS-CHL9EB kernel: EXT3-fs: mounted filesystem with ordered data mode.

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

root@LS-CHL9EB:~# df
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/sda2              4989760    393728   4596032   8% /
/dev/ram1                15360       120     15240   1% /mnt/ram
/dev/sda1               992036    162056    829980  16% /boot
/dev/disk1_6         473337664     66360 473271304   0% /mnt/disk1
/dev/usbdisk1_1         988212     27796    910216   3% /mnt/usbdisk1
root@LS-CHL9EB:~# umount /mnt/usbdisk1/
root@LS-CHL9EB:~#

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

(3-1)既にパーティションがある場合は、まずはそのパーティションを消します
root@LS-CHL9EB:~# parted -s /dev/sdb print
Model: ViPowER VP-89118(SD1) (scsi)
Disk /dev/sdb: 204GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      32.3kB  1028MB  1028MB  primary  ext3
 2      1028MB  5133MB  4104MB  primary  ext3
 3      5133MB  6161MB  1028MB  primary  linux-swap
 4      6161MB  204GB   198GB   primary  xfs

root@LS-CHL9EB:~# parted -s /dev/sdb rm 4
root@LS-CHL9EB:~# ^4^3
parted -s /dev/sdb rm 3
root@LS-CHL9EB:~# ^3^2
parted -s /dev/sdb rm 2
root@LS-CHL9EB:~# ^2^1
parted -s /dev/sdb rm 1
root@LS-CHL9EB:~# !?print
parted -s /dev/sdb print
Model: ViPowER VP-89118(SD1) (scsi)
Disk /dev/sdb: 204GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags

root@LS-CHL9EB:~# fdisk /dev/sdb

The number of cylinders for this disk is set to 24792.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sdb: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks  Id System

Command (m for help): q

root@LS-CHL9EB:~#
(3-2)パーティションテーブルを作成します
root@LS-CHL9EB:~# parted -s /dev/sdb mklabel gpt
root@LS-CHL9EB:~#
パーティションを設定します
root@LS-CHL9EB:~# parted -s /dev/sdb mkpart primary ext3 0 1024M
root@LS-CHL9EB:~# parted -s /dev/sdb print
Model: ViPowER VP-89118(SD1) (scsi)
Disk /dev/sdb: 204GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
 1      17.4kB  1024MB  1024MB               primary

root@LS-CHL9EB:~# parted -s /dev/sdb mkpart primary xfs 1024MB 6144MB
root@LS-CHL9EB:~# parted -s /dev/sdb mkpart primary linux-swap 6144MB  7168MB
root@LS-CHL9EB:~# parted -s /dev/sdb mkpart primary xfs 7168MB 204GB
root@LS-CHL9EB:~# parted -s /dev/sdb print
Model: ViPowER VP-89118(SD1) (scsi)
Disk /dev/sdb: 204GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
 1      17.4kB  1024MB  1024MB               primary
 2      1024MB  6144MB  5120MB               primary
 3      6144MB  7168MB  1024MB               primary
 4      7168MB  204GB   197GB                primary

root@LS-CHL9EB:~#

インストール

カスタマイズ

hackkit_config を書く方法にする。
root@LS-CHL9EB:~# cd /mnt/disk1/share/hackkit/
root@LS-CHL9EB:/mnt/disk1/share/hackkit# ls
hackkit_090226.tar.gz  hackkit_config.sample  setup_090717.sh
hackkit_090917.sh      mkimage
root@LS-CHL9EB:/mnt/disk1/share/hackkit# cp hackkit_config.sample hackkit_config
root@LS-CHL9EB:/mnt/disk1/share/hackkit# vi hackkit_config
	:
	:
root@LS-CHL9EB:/mnt/disk1/share/hackkit# cat !$
cat hackkit_config
ADDRESS=192.168.2.52
HOSTNAME=chl
root@LS-CHL9EB:/mnt/disk1/share/hackkit#
ベタなホスト名だ。

インストーラの実行

root@LS-CHL9EB:/mnt/disk1/share/hackkit# sh hackkit_090917.sh
PRODUCTID = 0x00000012
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 36 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=3002320 blks
         =                       sectsz=512   attr=0
data     =                       bsize=4096   blocks=48037120, imaxpct=25
         =                       sunit=0      swidth=0 blks, unwritten=1
naming   =version 2              bsize=4096
log      =internal log           bsize=4096   blocks=23455, 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/
	:
	:
./opt/
./media/
./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.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 ...
139760+1 records in
139760+1 records out
gunziping /mnt/debinst/boot/initrd.gz ...
gziping /mnt/debinst/boot/initrd ... wait 5 minutes
Image Name:   initrd
Created:      Thu Sep 17 22:16:06 2009
Image Type:   ARM Linux RAMDisk Image (gzip compressed)
Data Size:    8899173 Bytes = 8690.60 kB = 8.49 MB
Load Address: 0x00000000
Entry Point:  0x00000000
unmount /boot ...
root@LS-CHL9EB:/mnt/disk1/share/hackkit#
device is busy は出なかった。

電源 OFF

ハックキットで起動

動作確認

LED の確認

POWER LED は点灯,。

ログイン

Debian GNU/Linux 5.0
chl login: guest
Password:
Linux chl 2.6.22.18 #182 Thu May 7 13:35:58 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@chl:/$

root になる

guest@chl:/$ su - root
Password:
chl:~#

USB メモリの認識

chl:~# tail -f /var/log/messages
	:
	:
Nov  1 00:54:34 chl kernel: usb 1-1: new high speed USB device using ehci_marvell and address 2
Nov  1 00:54:35 chl kernel: usb 1-1: configuration #1 chosen from 1 choice
Nov  1 00:54:35 chl kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Nov  1 00:54:40 chl kernel: scsi 2:0:0:0: Direct-Access     BUFFALO  ClipDrive        2.00 PQ: 0 ANSI: 2
Nov  1 00:54:41 chl kernel: ready
Nov  1 00:54:41 chl kernel: sd 2:0:0:0: [sdb] 256000 512-byte hardware sectors (131 MB)
Nov  1 00:54:41 chl kernel: sd 2:0:0:0: [sdb] Write Protect is off
Nov  1 00:54:41 chl kernel: sd 2:0:0:0: [sdb] 256000 512-byte hardware sectors (131 MB)
Nov  1 00:54:41 chl kernel: sd 2:0:0:0: [sdb] Write Protect is off
Nov  1 00:54:41 chl kernel: sdb: sdb1
Nov  1 00:54:41 chl kernel: sd 2:0:0:0: [sdb] Attached SCSI removable disk
Nov  1 00:54:41 chl kernel: sd 2:0:0:0: Attached scsi generic sg1 type 0

プリンタの認識(LS-GL 以外)

Nov  1 00:56:14 chl kernel: usb 1-1: new full speed USB device using ehci_marvell and address 3
Nov  1 00:56:14 chl kernel: usb 1-1: configuration #1 chosen from 1 choice
Nov  1 00:56:14 chl kernel: drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 3 if 0 alt 0 proto 2 vid 0x04B8 pid 0x0005

リブートの確認

シャットダウンの確認

まあ、ここまで来ればもう大丈夫だな。この先略



LS-CHL
バッファローダイレクト
楽天市場
Amazon


eth1?
ハックの記録
LinkStation/玄箱 をハックしよう

Software Design 2009/10

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