ハックキット

LS-CL

なんか、LS-HGL ハックキットが簡単に持ってこられそう。

ファイルのコピー

LS-HGL ハックキットのインストーラ、LS-CL_hackkit_0.00.sh
LS-HGL ハックキットの debian アーカイブ(をリネームした)、hackkit_080317.tar.gz
をファイル共有を利用して、 エクスプローラで /mnt/disk1/share/debian/ に置く
root@LS-CL701:~# cd /mnt/disk1/share/debian/
root@LS-CL701:/mnt/disk1/share/debian# ls
LS-HGL_hackkit_1.01.sh  hackkit_080317.tar.gz
root@LS-CL701:/mnt/disk1/share/debian#
LS-CL 用にインストーラをコピー
root@LS-CL701:/mnt/disk1/share/debian# cp LS-HGL_hackkit_1.01.sh LS-CL_hackkit_0.00.sh

インストーラの修正

LS-HGL と LS-CL とが違うところを修正していく。 といっても、/proc/buffalo の違いとロードするモジュールが違うぐらい
root@LS-CL701:/mnt/disk1/share/debian# diff -u LS-HGL_hackkit_1.01.sh LS-CL_hackkit_0.00.sh
--- LS-HGL_hackkit_1.01.sh      Sat Apr  5 14:10:08 2008
+++ LS-CL_hackkit_0.00.sh       Thu Nov  1 01:20:32 2007
@@ -1,6 +1,6 @@
 #! /bin/sh -x

-ADDRESS=192.168.2.44
+ADDRESS=192.168.2.47
 NETWORK=192.168.2.0
 NETMASK=255.255.255.0
 BROADCAST=192.168.2.255
@@ -12,7 +12,7 @@
 JAIL=$MOUNTPOINT/usr/local/buffalo
 WORK=/mnt/disk1/share/debian

-HACKKIT=$WORK/LS-HGL_hackkit_1.00.tar.gz
+HACKKIT=$WORK/hackkit_080317.tar.gz

 #---------------------------------------------------------
 # format
@@ -121,12 +121,12 @@

 case "\$1" in
   start)
-       echo off > /proc/buffalo/led/power_blink
-       echo on > /proc/buffalo/led/power
-       echo on > /proc/buffalo/led/eth
+       echo off > /proc/buffalo/gpio/led/power_blink
+       echo on > /proc/buffalo/gpio/led/power
+       echo on > /proc/buffalo/gpio/led/eth
        ;;
   stop)
-       echo on > /proc/buffalo/led/power_blink
+       echo on > /proc/buffalo/gpio/led/power_blink
        ;;
   *)
        echo "Usage: \$0 {start|stop}"
@@ -152,22 +152,26 @@

 case "\$1" in
   start)
-       echo on > /proc/buffalo/usb_control
-       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/usblp.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
+       echo on > /proc/buffalo/gpio/power_control/usb0
+       chroot /usr/local/buffalo insmod /lib/modules/*/kernel/drivers/usb/core/usbcore.ko
+       chroot /usr/local/buffalo insmod /lib/modules/*/kernel/drivers/usb/host/ehci-hcd.ko
+       chroot /usr/local/buffalo insmod /lib/modules/*/kernel/drivers/usb/host/ohci-hcd.ko
+       chroot /usr/local/buffalo insmod /lib/modules/*/kernel/drivers/usb/host/uhci-hcd.ko
+       chroot /usr/local/buffalo insmod /lib/modules/*/kernel/drivers/usb/storage/usb-storage.ko
+       chroot /usr/local/buffalo insmod /lib/modules/*/kernel/drivers/usb/class/usblp.ko
+       chroot /usr/local/buffalo insmod /lib/modules/*/kernel/fs/fat/fat.ko
+       chroot /usr/local/buffalo insmod /lib/modules/*/kernel/fs/vfat/vfat.ko
        ;;
   stop)
        chroot /usr/local/buffalo rmmod vfat.ko
        chroot /usr/local/buffalo rmmod fat.ko
-       chroot /usr/local/buffalo rmmod usb-storage.ko
-       chroot /usr/local/buffalo rmmod ehci-marvell-hcd.ko
        chroot /usr/local/buffalo rmmod usblp.ko
+       chroot /usr/local/buffalo rmmod usb-storage.ko
+       chroot /usr/local/buffalo rmmod uhci-hcd.ko
+       chroot /usr/local/buffalo rmmod ohci-hcd.ko
+       chroot /usr/local/buffalo rmmod ehci-hcd.ko
        chroot /usr/local/buffalo rmmod usbcore.ko
-       echo off > /proc/buffalo/usb_control
+       echo off > /proc/buffalo/gpio/power_control/usb0
        ;;
   *)
        echo "Usage: \$0 {start|stop}"
root@LS-CL701:/mnt/disk1/share/debian#

実験用 HDD の接続

USB で ST3250 を接続する。
root@LS-CL701:~# less /var/log/messages
	:
	:
Nov  1 01:29:52 LS-CL701 kernel: usb 1-1: new high speed USB device using ehci_marvell and address 2
Nov  1 01:29:52 LS-CL701 kernel: usb 1-1: configuration #1 chosen from 1 choice
Nov  1 01:29:52 LS-CL701 kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Nov  1 01:29:57 LS-CL701 kernel: scsi 2:0:0:0: Direct-Access     ST325031         6RY0Y1VK A    PQ: 0 ANSI: 2 CCS
Nov  1 01:29:57 LS-CL701 kernel: sd 2:0:0:0: [sdb] 488397168 512-byte hardware sectors (250059 MB)
Nov  1 01:29:57 LS-CL701 kernel: sd 2:0:0:0: [sdb] Write Protect is off
Nov  1 01:29:57 LS-CL701 kernel: sd 2:0:0:0: [sdb] Assuming drive cache: write through
Nov  1 01:29:57 LS-CL701 kernel: sd 2:0:0:0: [sdb] 488397168 512-byte hardware sectors (250059 MB)
Nov  1 01:29:57 LS-CL701 kernel: sd 2:0:0:0: [sdb] Write Protect is off
Nov  1 01:29:57 LS-CL701 kernel: sd 2:0:0:0: [sdb] Assuming drive cache: write through
Nov  1 01:29:57 LS-CL701 kernel:  sdb: sdb1 sdb2 sdb4 < sdb5 sdb6 >
Nov  1 01:29:57 LS-CL701 kernel: sd 2:0:0:0: [sdb] Attached SCSI disk
Nov  1 01:29:57 LS-CL701 kernel: sd 2:0:0:0: Attached scsi generic sg1
type 0
sdb と認識された。

アンマウント

root@LS-CL701:~# mount
rootfs on / type rootfs (rw)
/dev/root on / type xfs (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw)
/dev/ram1 on /mnt/ram type tmpfs (rw)
/dev/sda1 on /boot type ext3 (rw,data=ordered)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/disk1_6 on /mnt/disk1 type xfs (rw,noatime,usrquota,grpquota)
/dev/usbdisk1_1 on /mnt/usbdisk1 type ext3 (rw,noatime,data=ordered)
root@LS-CL701:~# df
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/sda2              4993984    387228   4606756   8% /
/dev/ram1                15360       104     15256   1% /mnt/ram
/dev/sda1               996052    172984    823068  17% /boot
/dev/disk1_6         480348928     69484 480279444   0% /mnt/disk1
/dev/usbdisk1_1         287785     14843    258084   5% /mnt/usbdisk1
root@LS-CL701:~#
usbdisk1_1 (sdb1) が自動マウントされたので、アンマウントする。
root@LS-CL701:~# umount /mnt/usbdisk1/
root@LS-CL701:~#

パーティションをきる

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

The number of cylinders for this disk is set to 30401.
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: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks  Id System
/dev/sdb1               1          37      297171  83 Linux
/dev/sdb2              38          99      498015  83 Linux
/dev/sdb4             100       30401   243400815   5 Extended
/dev/sdb5             100         116      136521  82 Linux swap
/dev/sdb6             117       30390   243175873+ 83 Linux

Command (m for help):
このあいだ LS-WSGL につないだ HDD。
まずは、パーティションを消す
Command (m for help): d
Partition number (1-6): 6

Command (m for help): d
Partition number (1-5): 5

Command (m for help): d
Partition number (1-5): 4

Command (m for help): d
Partition number (1-4): 2

Command (m for help): d
Selected partition 1

Command (m for help): p

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks  Id System

Command (m for help):
続いてハックキット流パーティションをきる
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-30401, default 1): Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-30401, default 30401): +200M

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (26-30401, default 26): Using default value 26
Last cylinder or +size or +sizeM or +sizeK (26-30401, default 30401): +4096M

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (525-30401, default 525): Using default value 525
Last cylinder or +size or +sizeM or +sizeK (525-30401, default 30401): +256M

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Selected partition 4
First cylinder (557-30401, default 557): 4
Value is out of range
First cylinder (557-30401, default 557): Using default value 557
Last cylinder or +size or +sizeM or +sizeK (557-30401, default 30401): Using default value 30401

Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): 82
Changed system type of partition 3 to 82 (Linux swap)

Command (m for help): p

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks  Id System
/dev/sdb1               1          25      200781  83 Linux
/dev/sdb2              26         524     4008217+ 83 Linux
/dev/sdb3             525         556      257040  82 Linux swap
/dev/sdb4             557       30401   239729962+ 83 Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table
root@LS-CL701:~#

インストーラの実行

インストーラを実行する。一発では動くはずないだろう。
root@LS-CL701:~# cd /mnt/disk1/share/debian/
root@LS-CL701:/mnt/disk1/share/debian# ./LS-CL_hackkit_0.00.sh
	:
creating hostname ...
+ hostname
+ echo hackkit
+ sync
+ cd /
+ umount /mnt/debinst
root@LS-CL701:/mnt/disk1/share/debian#
できた。

シャットダウン

電源 SW を OFF

実験用 HDD と入れ替え

USB で接続していた ST3250 を本体に SATA で接続。

電源 ON

buffalo_change_power_status > Read 0x5c
buffalo_change_power_status > Writing 0x3a

Marvell Serial ATA Adapter
Integrated Sata device found
  Device 0: OK
Model: ST3250310AS                              Firm: 3.AAA    Ser#:             6RY0Y1VK
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 238475.1 MB = 232.8 GB (488397168 x 512)

Using device ide0, partition 1

Loading from block device ide device 0, partition 1: Name: hda1
  Type: U-Boot  File:/uImage.buffalo

2115624 bytes read
   Image Name:   Linux-2.6.22.7
   Created:      2008-09-30  13:15:03 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2115560 Bytes =  2 MB
   Load Address: 00008000
   Entry Point:  00008000
Using device ide0, partition 1

Loading from block device ide device 0, partition 1: Name: hda1
  Type: U-Boot  File:/initrd.buffalo
** File not found /initrd.buffalo
serch_boot_drv (249)>No init_file 0
Using device ide1, partition 1
** Bad partition 1 **
serch_boot_drv (194)>No kernel_file 1
Using device ide1, partition 1
** Bad partition 1 **
serch_boot_drv (249)>No init_file 1
Lost all init_rd
なんで initrd.buffalo がないの?

まあ、一発通しなんて考えるのが甘いわな。



LS-C500L
楽天市場
amazon


カーネルモジュール
ハックの記録
LinkStation/玄箱 をハックしよう

HDD の玉突き交換(1)LS-LGL の HDD 交換のついでにファームアップ

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