tftp Boot

KURO-NAS/X4

HDD boot に失敗したので、製品仕様書通り tftp Boot する。
でも tftp サーバを用意するのは、面倒だし、時間がない。

余談:
「面倒だし」と書いて「のうりょくがないし」と読む。
「時間がない」と書いて「わたしにはできない」と読む。
しつこい

ハック de 録!!サーバの HS-DHGL では、 PC-P1LAN用の boot サーバが動作しているので、 これを使うことにする。
ハック de 録!!サーバでなくとも、 ログインできるようにした標準ファームでもよいかも。

boot サーバの用意

ファイルを置く

/usr/local/buffalo/usr/local/BootServer/tftpboot に initrd.buffalo と uImage.buffalo とを置く。
sil:~# cd /usr/local/buffalo/usr/local/BootServer/tftpboot/
sil:/usr/local/buffalo/usr/local/BootServer/tftpboot# ftp fs.yamasita.jp
	:
	:
	:
sil:/usr/local/buffalo/usr/local/BootServer/tftpboot# ls -al
total 10148
drwxr-xr-x 3 root     root          73 Dec 19 18:03 .
drwxr-xr-x 3 root     root          76 Dec 21  2006 ..
drwxr-xr-x 2 root     root          37 Oct  5  2005 firm
-rw-r--r-- 1 root     root     7610042 Dec 19 18:03 initrd.buffalo
-rw-r--r-- 1 root     root     2773096 Dec 19 18:03 uImage.buffalo
-rwxr-xr-x 1 root     root           5 Oct  4  2006 version
sil:/usr/local/buffalo/usr/local/BootServer/tftpboot#

tftpd の再起動

確か、ファイルを置き直したら、再起動が必要だったはず。 ファイルの追加なので再起動は要らないかも。
sil:~# chroot /usr/local/buffalo
sil:/# cd etc/init.d/
sil:/etc/init.d# grep tftp *
ltbootd.sh:[ -x /usr/local/BootServer/tftpd ] || exit 0
ltbootd.sh:     echo -n " tftpd"; /usr/local/BootServer/tftpd &
ltbootd.sh:     echo "."; logger -t ${tag} -p ${facility} 'Started rarpd tftpd rarpcfgd fwupdated'
ltbootd.sh:     echo -n " tftpd"; killall -KILL tftpd
ltbootd.sh:     echo "."; logger -t ${tag} -p ${facility} 'Stopped rarpd tftpd rarpcfgd fwupdated'
kill して、再起動で良さそう。
sil:/etc/init.d# killall -KILL tftpd
sil:/etc/init.d# /usr/local/BootServer/tftpd &
[1] 25052
sil:/etc/init.d#
[1]+  Done                    /usr/local/BootServer/tftpd
sil:/etc/init.d# 

IP アドレスの変更

製品仕様書では、192.168.11.1 なりの IP アドレスを 使うように書いてあるが、 IP アドレスを変えるのは、面倒だし、時間がない。

U-Boot のパラメータを変更して IP を我が家の体系にする。

変数の設定

自分の IP アドレスは ipaddr
tftp サーバの IP アドレスは serverip
に設定する
Marvell>> setenv ipaddr 192.168.2.48
Marvell>> setenv serverip 192.168.2.39
Marvell>> printenv
baudrate=115200
loads_echo=0
rootpath=/nfs/arm
	:
	:
ipaddr=192.168.2.48
serverip=192.168.2.39

Environment size: 1165/4092 bytes
Marvell>> 

変数を記憶させる

単に setenv しただけではリブートで消えるので、Flash に書く
Marvell>> saveenv
Saving Environment to Flash...
.
Un-Protected 1 sectors
Erasing Flash...
.
Erased 1 sectors
Writing to Flash... done
.
Protected 1 sectors
Marvell>> 

tftp boot

いけー
Marvell>> reset
Marvell>> Orion2   CPU =  High

=== KURO U-Boot. ===
 ** LOADER **
 ** KUROBOX BOARD: KURO_BOX  LE (CFG_ENV_ADDR=fffff000)


U-Boot 1.1.1 (Oct  2 2008 - 06:29:53) Marvell version: 1.12.1 - TINY

DRAM CS[0] base 0x00000000   size 128MB
DRAM Total size 128MB
[256kB@fffc0000] Flash: 256 kB
Addresses 20M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (20M - 16M): Done

Soc: 88F5281 D0
CPU: ARM926 (Rev 0) running @ 500Mhz
Orion 2 streaming disabled
VFP initialized to Run Fast Mode.
SysClock = 250Mhz , TClock = 166Mhz


USB 0: host mode
PCI 0: PCI Express Root Complex Interface
PCI 1: PCI-X, speed = 133000000
CPU: Write allocate enabled
Net:   egiga0 [PRIME]
Using 88E1118 phy

Marvell Serial ATA Adapter
Found adapter at bus 1, device 7 ... Scanning channels
  Device 0: OK
Model: Maxtor 6L200M0                           Firm: BANC1G10 Ser#: L40PVARG
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 194481.0 MB = 189.9 GB (398297088 x 512)

hit any key to switch tftp boot.
Hit any key to stop autoboot:  0
<<system_bootend>>
Hit any key to stop autoboot:  0

Reset IDE:
Marvell Serial ATA Adapter
Found adapter at bus 1, device 7 ... Scanning channels
  Device 0: OK
Model: Maxtor 6L200M0                           Firm: BANC1G10 Ser#: L40PVARG
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 194481.0 MB = 189.9 GB (398297088 x 512)

Using device ide0, partition 1

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

0 bytes read
<<stop_sound>>
## Booting image at 00100000 ...
Bad Magic Number
bootm fail.
<<system_not_found>>
Using egiga0 device
TFTP from server 192.168.2.39; our IP address is 192.168.2.48
Filename 'uImage.buffalo'.
Load address: 0x100000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ######################
done
Bytes transferred = 2773096 (2a5068 hex)
Using egiga0 device
TFTP from server 192.168.2.39; our IP address is 192.168.2.48
Filename 'initrd.buffalo'.
Load address: 0x2000000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #########################################################
done
Bytes transferred = 7610042 (741eba hex)
<<stop_sound>>
## Booting image at 00100000 ...
   Image Name:   Linux-2.6.22.7
   Created:      2008-10-01   7:13:39 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2773032 Bytes =  2.6 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK
## Loading Ramdisk Image at 02000000 ...
   Image Name:   initrd
   Created:      2008-10-01  12:06:44 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    7609978 Bytes =  7.3 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK

Starting kernel ...

arg:console=ttyS0,115200 root=/dev/sda2 rw panic=5 initrd=0x02000040,20M panic=5 BOOTVER=1.091
CONFIG_BUFFALO_PLATFORM CONFIG_BUFFALO_TERASTATION_TSHTGL ---
Uncompressing Linux.............................................................................................................................................................................. done, booting the kernel.
Linux version 2.6.22.7 (root@dhcp-200-175.soum.co.jp) (gcc version 4.2.0 20070413 (prerelease)) #1 Wed Oct 1 16:13:29 JST 2008
CPU: ARM926EJ-S [41069260] revision 0 (ARMv5TEJ), cr=00053177
Machine: Feroceon
Using UBoot passing parameters structure
Memory policy: ECC disabled, Data cache writeback
CPU0: D VIVT write-back cache
CPU0: I cache: 32768 bytes, associativity 1, 32 byte lines, 1024 sets
CPU0: D cache: 32768 bytes, associativity 4, 32 byte lines, 256 sets
Built 1 zonelists.  Total pages: 32512
Kernel command line: console=ttyS0,115200 root=/dev/sda2 rw panic=5 initrd=0x02000040,20M panic=5 BOOTVER=1.091
PID hash table entries: 512 (order: 9, 2048 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 128MB 0MB 0MB 0MB = 128MB total
Memory: 103680KB available (4728K code, 761K data, 124K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
Sys Clk = 0, Tclk = 166664740

CPU Interface
-------------
SDRAM_CS0 ....base 00000000, size 128MB
SDRAM_CS1 ....disable
SDRAM_CS2 ....disable
SDRAM_CS3 ....disable
PEX0_MEM ....base e0000000, size 128MB
PEX0_IO ....base f2000000, size   1MB
PCI0_MEM ....base e8000000, size 128MB
PCI0_IO ....base f2100000, size   1MB
INTER_REGS ....base f1000000, size   1MB
DEVICE_CS0 ....base fa000000, size   2MB
DEVICE_CS1 ....base fc000000, size  32MB
DEVICE_CS2 ....base fa800000, size   1MB
DEV_BOOCS ....base f4000000, size  16MB

  Marvell Development Board (LSP Version 3.0.5_NAS_GDP_p3)-- BUFFALO_BOARD_TS_HTGL_R5  Soc: 88F5281 D0

 Detected Tclk 166664740 and SysClk 0
Marvell USB EHCI Host controller #0: c3430600
PCI: bus0: Fast back to back transfers enabled
PCI: bus1: Fast back to back transfers enabled
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
Time: orion_clocksource clocksource has been installed.
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
Freeing initrd memory: 20480K
RTC registered
Use IDMA channels 2 and 3 for enhancing the following function:
  o Copy From/To user space operations.
  o memzero() operations.
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
fuse init (API version 7.8)
SGI XFS with large block numbers, no debug enabled
SGI XFS Quota Management subsystem
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
serial8250: ttyS1 at MMIO 0x0 (irq = 4) is a 16550A
serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 3) is a 16550A
serial8250.0: ttyS2 at MMIO 0xf1012100 (irq = 4) is a 16550A
RAMDISK driver initialized: 16 RAM disks of 32768K size 1024 blocksize
loop: module loaded
Marvell Ethernet Driver 'mv_ethernet':
  o Uncached descriptors in DRAM
  o DRAM SW cache-coherency
  o TCP segmentation offload enabled
  o Checksum offload enabled
  o Driver statistics enabled
  o Marvell ethtool proc enabled
  o Rx desc: 128
  o Tx desc: 256
  o Loading network interface ** eth_init_module (0)
'eth0'
scsi0 : Marvell SCSI to SATA adapter
scsi1 : Marvell SCSI to SATA adapter
scsi2 : Marvell SCSI to SATA adapter
scsi3 : Marvell SCSI to SATA adapter
** BUFFALO Disable Command Queuing Function [0 0] **
scsi 0:0:0:0: Direct-Access     Maxtor   6L200M0          BANC PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] 398297088 512-byte hardware sectors (203928 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sd 0:0:0:0: [sda] 398297088 512-byte hardware sectors (203928 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda: sda1
sd 0:0:0:0: [sda] Attached SCSI disk
sd 0:0:0:0: Attached scsi generic sg0 type 0
physmap platform flash device: 01000000 at f0000000
physmap-flash physmap-flash.0: map_probe failed
Found: SST 39LF020
cfi_flash_0: Found 1 x8 devices at 0x0 in 8-bit bank
number of JEDEC chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
cmdlinepart partition parsing not available
ehci_marvell ehci_marvell.4523: Marvell Orion EHCI
ehci_marvell ehci_marvell.4523: new USB bus registered, assigned bus number 1
ehci_marvell ehci_marvell.4523: irq 17, io base 0xf1050100
ehci_marvell ehci_marvell.4523: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
USB Universal Host Controller Interface driver v3.0
usb 1-1: new high speed USB device using ehci_marvell and address 2
usb 1-1: configuration #1 chosen from 1 choice
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
usbcore: registered new interface driver cdc_acm
drivers/usb/class/cdc-acm.c: v0.25:USB Abstract Control Model driver for USB modems and ISDN adapters
usbcore: registered new interface driver usblp
drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver emi26 - firmware loader
usbcore: registered new interface driver emi62 - firmware loader
mice: PS/2 mouse device common for all mice
md: linear personality registered for level -1
md: raid0 personality registered for level 0
md: raid1 personality registered for level 1
raid6: int32x1     32 MB/s
raid6: int32x2     45 MB/s
raid6: int32x4     55 MB/s
raid6: int32x8     47 MB/s
raid6: using algorithm int32x4 (55 MB/s)
md: raid6 personality registered for level 6
md: raid5 personality registered for level 5
md: raid4 personality registered for level 4
raid5: measuring checksumming speed
   arm4regs  :   429.200 MB/sec
   8regs     :   386.400 MB/sec
   32regs    :   428.000 MB/sec
raid5: using function: arm4regs (429.200 MB/sec)
device-mapper: ioctl: 4.11.0-ioctl (2006-10-12) initialised: dm-devel@redhat.com
Kernel event proc (C) BUFFALO INC. V.1.00 installed.
MICON ctrl (C) BUFFALO INC. V.1.00 installed.
MICON V2 (C) BUFFALO INC. V.1.00 installed.
UPSDRV (C) BUFFALO INC. V.1.00 installed.
BUFFALO UPS Recover Function Initialized.
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
VFP support v0.3: implementor 41 architecture 1 part 10 variant 9 rev 0
md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.
RAMDISK: Compressed image found at block 0
VFS: Mounted root (ext2 filesystem).
eth0: link down
eth0: link up, full duplex, speed 1 Gbps
sendto:  count 6   sync 1
sendto:  count 5   sync 0
sendto:  count 6   sync 0
exportfs: failed to lock /var/lib/nfs/etab
exportfs: failed to lock /var/lib/nfs/xtab
NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
NFSD: unable to find recovery directory /var/lib/nfs/v4recovery
NFSD: starting 90-second grace period
Freeing init memory: 124K
init started: BusyBox v1.7.0 (2007-10-15 19:49:46 IST)
starting pid 374, tty '': '/etc/init.d/rcS'
starting pid 376, tty '': '/bin/sh'
#
TS-HTGL/R5 用のカーネルがそのまま。
というか、箱は違うもののメインボードが TS-HTGL/R5 と同じ?
液晶部分はそのまま流用やし。
それやったら、TS-HTGL/R5 の箱の方がよかったなぁ。。。

KURO-NAS/X4
楽天市場
amazon
Yahoo!ショッピング
クレバリー
ソフマップ・ドットコム


HDD Boot
ハックの記録
LinkStation/玄箱 をハックしよう

boot できなかった HDD のマウント / mount un-bootable hard drive

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