miconapl で初期化(2)

Debian TS-WXL

標準ファームを見ているのだが、 なぜ駄目なのか、よくわからない。

問題を単純化するために、 initrd の /linuxrc から miconapl の処理を消し、 Debian からの初期化処理だけにしてみる。

HDD2 の標準ファームから起動

ディスクの再認識

実験用 HDD を HDD1 に刺し、認識させる
root@TS-WXL3B3:/# KERNELMOn (SATA 0 plugged)
Core Driver (ERROR) 0 0: Edma Error Reg 0x10
start to wait 1000 mili sec
wait finished.
skip diskmon...
** BUFFALO Disable Command Queuing Function [0 0] **
scsi 0:0:0:0: Direct-Access     SAMSUNG  HD501LJ          CR10 PQ: 0 ANSI: 5
Linux IAL (ERROR) [0 0 0]: set device max sectors to 2048
/sbin/hotplug [scsi]
/sbin/hotplug [scsi_disk]
Linux IAL (ERROR) : retry command host=0, bus=0 SCpnt = 809e8060
sd 0:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)
sd 0:0:0:0: [sdb] Write Protect is off
sd 0:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sd 0:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)
sd 0:0:0:0: [sdb] Write Protect is off
sd 0:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sdb: sdb1 sdb2 sdb3 sdb4 sdb5 sdb6
/sbin/hotplug [block]
/sbin/hotplug [block]
/sbin/hotplug [block]
/sbin/hotplug [block]
/sbin/hotplug [block]
/sbin/hotplug [block]
sd 0:0:0:0: [sdb] Attached SCSI disk
/sbin/hotplug [block]
/sbin/hotplug [scsi_device]
sd 0:0:0:0: Attached scsi generic sg1 type 0
need re create_devlink!!!
/sbin/hotplug [scsi_generic]
*** /usr/local/bin/DirectCopy_wait.sh [stop]

root@TS-WXL3B3:/# cd /usr/local/bin/
root@TS-WXL3B3:/usr/local/bin# ./hdd_wakeup.sh  disk1
need re create_devlink!!!
hdd_wakeup.sh : FLAG_FORMAT=0
mdadm: No md superblock detected on /dev/disk1_6.
mdadm: No md superblock detected on /dev/disk2_6.
/usr/local/bin/change_notify.sh:LCD display message setted to [HD  2  : SINGLE     1  : REMOVE]
root@TS-WXL3B3:/usr/local/bin#

マウント

root@TS-WXL3B3:/usr/local/bin# mkdir /tmp/root
root@TS-WXL3B3:/usr/local/bin# mount -t ext3 /dev/sdb2 /tmp/root
kjournald starting.  Commit interval 5 seconds
EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
EXT3 FS on sdb2, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
root@TS-WXL3B3:/usr/local/bin#

linuxrc の修正

root@TS-WXL3B3:/usr/local/bin# ls /mnt/disk2/wk/
initrd.gz
root@TS-WXL3B3:/usr/local/bin#
以前 initrd.buffalo を作ったときの initrd が残っているので、 これを修正する。

復元

root@TS-WXL3B3:/usr/local/bin# cd !$
cd /mnt/disk2/wk/
root@TS-WXL3B3:/mnt/disk2/wk# gunzip initrd.gz
root@TS-WXL3B3:/mnt/disk2/wk#

マウント

root@TS-WXL3B3:/mnt/disk2/wk# mount -o loop initrd /tmp/root
root@TS-WXL3B3:/mnt/disk2/wk#

linuxrc の修正

root@TS-WXL3B3:/mnt/disk2/wk# cd /tmp/root/
root@TS-WXL3B3:/tmp/root# cat linuxrc
#!/bin/sh

export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin

echo "---- in hackkit linuxrc ---"

mount proc /proc -t proc
mount sysfs /sys -t sysfs

. /usr/local/lib/libsys
SetupNasFeature

ldconfig
depmod

. /etc/nas_feature
/usr/local/sbin/miconapl -a serialmode_console
/etc/init.d/startSysMd.sh
echo "0x901" > /proc/sys/kernel/real-root-dev

umount -a
exit 0
root@TS-WXL3B3:/tmp/root#
miconapl の行を消す。
root@TS-WXL3B3:/tmp/root# vi linuxrc
	:
	:
root@TS-WXL3B3:/tmp/root# cat !$
cat linuxrc
#!/bin/sh

export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin

echo "---- in hackkit linuxrc ---"

mount proc /proc -t proc
mount sysfs /sys -t sysfs

. /usr/local/lib/libsys
SetupNasFeature

ldconfig
depmod

. /etc/nas_feature
/etc/init.d/startSysMd.sh
echo "0x901" > /proc/sys/kernel/real-root-dev

umount -a
exit 0
root@TS-WXL3B3:/tmp/root#

アンマウント

root@TS-WXL3B3:/tmp/root# cd /
root@TS-WXL3B3:/# umount /tmp/root
root@TS-WXL3B3:/#

initrd.buffalo の作成

root@TS-WXL3B3:/# cd /mnt/disk2/wk/
root@TS-WXL3B3:/mnt/disk2/wk# mkdir /tmp/boot
root@TS-WXL3B3:/mnt/disk2/wk# mount -t ext3 /dev/sdb1 /tmp/boot
kjournald starting.  Commit interval 5 seconds
EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
EXT3 FS on sdb1, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
root@TS-WXL3B3:/mnt/disk2/wk# gzip initrd
(じっと待つ)
root@TS-WXL3B3:/mnt/disk2/wk# mkimage -A ARM -O Linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initrd -d initrd.gz /tmp/boot/initrd.buffalo
Image Name:   initrd
Created:      Tue Apr  6 21:27:59 2010
Created(epoc):1270556879
Image Type:   ARM Linux RAMDisk Image (gzip compressed)
Data Size:    9237088 Bytes = 9020.59 kB = 8.81 MB
Load Address: 0x00000000
Entry Point:  0x00000000
root@TS-WXL3B3:/mnt/disk2/wk# umount /tmp/boot/
root@TS-WXL3B3:/mnt/disk2/wk#

再起動

電源ボタン長押しで電源OFF、
HDD2 を抜いて
電源ボタンを押す
	:
	:
---- in hackkit linuxrc ---
-- rebuild mdadm.conf for BOOT, ROOTFS with Intelligent routine --
kjournald starting.  Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
mount: mounting /dev/disk2_1 on /tmp/boot_test failed: No such device or address
GetMdBaseDisk : Selected 1
md: md10 stopped.
md: bind<sda5>
raid1: raid set md10 active with 1 out of 2 mirrors
mdadm: /dev/md10 has been started with 1 drive (out of 2).
md: md1 stopped.
md: bind<sda2>
raid1: raid set md1 active with 1 out of 2 mirrors
mdadm: /dev/md1 has been started with 1 drive (out of 2).
md: md0 stopped.
md: bind<sda1>
raid1: raid set md0 active with 1 out of 2 mirrors
mdadm: /dev/md0 has been started with 1 drive (out of 2).
-- setup max error counts --
/sys/block/md0/md/maxerr_cnt is setted to 20
/sys/block/md1/md/maxerr_cnt is setted to 20
/sys/block/md10/md/maxerr_cnt is setted to 20
kjournald starting.  Commit interval 5 seconds
EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
EXT3 FS on md1, internal journal
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem).
Trying to move old root to /initrd ... okay
Freeing init memory: 136K
INIT: version 2.86 booting
Setting the system clock.
Cannot access the Hardware Clock via any known method.
Use the --debug option to see the details of our search for an access method.
Unable to set System Clock to: Wed Apr 7 06:31:09 JST 2010 (warning).
Activating swap...Adding 999864k swap on /dev/md10.  Priority:-1 extents:1 across:999864k
done.
Setting the system clock.
Cannot access the Hardware Clock via any known method.
Use the --debug option to see the details of our search for an access method.
Unable to set System Clock to: Wed Apr 7 06:31:10 JST 2010 (warning).
Cleaning up ifupdown....
Loading kernel modules...done.
Checking file systems...fsck 1.41.3 (12-Oct-2008)
done.
Setting kernel variables (/etc/sysctl.conf)...Unknown HZ value! (80) Assume 100.
done.
Mounting local filesystems...kjournald starting.  Commit interval 5 seconds
EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
EXT3 FS on md0, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
done.
Activating swapfile swap...done.
Setting up networking....
Configuring network interfaces...eth0: link down
eth0: started
done.
INIT: Entering runlevel: 2
Starting enhanced syslogd: rsyslogdeth0: link up, full duplex, speed 1 Gbps
.
Starting internet superserver: inetd.
Starting periodic command scheduler: crond.

Debian GNU/Linux 5.0 tswxl ttyS0

tswxl login:

telnet してログイン


Linux 2.6.22.18-mv78100 (x31l.yamasita.jp) (pts/0)

tswxl login: yasunari
Password:
Last login: Sun Mar 28 08:22:32 JST 2010 from x31l.yamasita.jp on pts/0
Linux tswxl 2.6.22.18-mv78100 #134 Thu Feb 4 11:14:40 JST 2010 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.
yasunari@tswxl:~$

root になる

yasunari@tswxl:~$ su - root
Password:
tswxl:~#

初期化

手動で初期化
tswxl:~# /usr/local/sbin/miconapl -b -a boot_flash_ok
tswxl:~#
すっと帰ってきた。行けたか???
tswxl:~# /usr/local/sbin/miconapl -a boot_end
tswxl:~#
こっちも、すっと帰ってきた。

シリアルコンソールの有効化

シリアルコンソールの有効化も試してみる。
tswxl:~# /usr/local/sbin/miconapl -a serialmode_console
tswxl:~#
シリアルコンソール側で Enter を叩いてみる。

Debian GNU/Linux 5.0 tswxl ttyS0

tswxl login: BuffaloGpio_ChangePowerStatus > Writing 0x71

Debian GNU/Linux 5.0 tswxl ttyS0

tswxl login:
Debian GNU/Linux 5.0 tswxl ttyS0

tswxl login:
Debian GNU/Linux 5.0 tswxl ttyS0

tswxl login:
Debian GNU/Linux 5.0 tswxl ttyS0

tswxl login:
いけてるやん!

シリアルコンソールからログイン

Debian GNU/Linux 5.0 tswxl ttyS0

tswxl login: root
Password:
Linux tswxl 2.6.22.18-mv78100 #134 Thu Feb 4 11:14:40 JST 2010 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.
2 failures since last login.
Last was Wed Mar 24 08:20:14 2010 on pts/0.
tswxl:~#
GJ!

TS-WXL
楽天市場
amazon
Yahoo ショッピング
Livedoor デパート


ネットワーク対応HDD 計8製品の価格改定を実施 最大36%の値下げ
ハックの記録
LinkStation/玄箱 をハックしよう

miconapl で終了処理

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