yasunari@qube:~$ telnet qvl Trying 192.168.2.56... Connected to qvl.yamasita.jp. Escape character is '^]'. BUFFALO INC. LinkStation series sh-3.2#
sh-3.2# date Sun Jun 17 17:23:34 JST 2012 sh-3.2#あってる
sh-3.2# mkdir /mnt/disk1 sh-3.2#さて、どのデバイスをマウントしてら良い?
sh-3.2# cat /proc/mdstat Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4] unused devices:md がない。sh-3.2#
assemble する
sh-3.2# mdadm --assemble -scan mdadm: /dev/md/21 has been started with 1 drive (out of 2). mdadm: /dev/md/10 has been started with 1 drive (out of 4). mdadm: /dev/md/1 has been started with 1 drive (out of 4). mdadm: /dev/md/0 has been started with 1 drive (out of 4). sh-3.2#マウントする
sh-3.2# ls /mnt/disk1/ mt-daapd share spool sh-3.2# ls /mnt/disk1/share/hackkit/ 091128_lenny hackkit_squeeze_110112.sh hackkit_config.sample mkimage hackkit_squeeze_110103.tar.gz ramroot_091128.sh sh-3.2#よしよし。
sh-3.2# date Sun Jun 17 17:31:39 JST 2012 sh-3.2#あってる
sh-3.2# cd /mnt/disk1/share/hackkit sh-3.2# vi hackkit_config.samp sh-3.2# cp hackkit_config.sample hackkit_config sh-3.2# vi hackkit_config : : sh-3.2# cat !$ cat hackkit_config ADDRESS=192.168.2.56 GATEWAY=192.168.2.96 HOSTNAME=qvl sh-3.2#
sh-3.2# cp hackkit_squeeze_110112.sh hackkit_squeeze_120617.sh sh-3.2# vi !$ vi hackkit_squeeze_120617.sh : : sh-3.2# diff -au hackkit_squeeze_110112.sh hackkit_squeeze_120617.sh --- hackkit_squeeze_110112.sh Wed Jan 12 00:26:28 2011 +++ hackkit_squeeze_120617.sh Sun Jun 17 17:39:18 2012 @@ -808,6 +808,17 @@ RAID=yes ;; +0x00004001) + MACHINE=LSQVL + + BOOTPARTITION=/dev/md0 + BOOTPARTITIONTYPE=ext3 + ROOTPARTITION=/dev/md1 + SWAPPARTITION=/dev/md10 + DATAPARTITION="" + + RAID=yes + ;; *) echo unknown PRODUCTID = "$PRODUCTID" exit sh-3.2#こんなんでいいのか??
sh-3.2# sh hackkit_squeeze_120617.sh PRODUCTID = 0x00004001 MACHINE LSQVL building md... -- rebuild mdadm.conf for BOOT, ROOTFS -- -- setup max error counts -- /sys/block/md0/md/maxerr_cnt is setted to -1 /sys/block/md1/md/maxerr_cnt is setted to -1 /sys/block/md10/md/maxerr_cnt is setted to -1 mounting root file system ... mount: mounting /dev/md1 on /mnt/debinst failed: Invalid argument sh-3.2#早速エラー。
-x つきで実行してトレースみる
sh-3.2# sh -x hackkit_squeeze_120617.sh + ADDRESS=192.168.2.47 + NETWORK=192.168.2.0 + NETMASK=255.255.255.0 + BROADCAST=192.168.2.255 : : : + mount -t xfs /dev/md1 /mnt/debinst mount: mounting /dev/md1 on /mnt/debinst failed: Invalid argument + exit sh-3.2#mount がエラーになっている。 -t xfs が悪いの?
sh-3.2# mount -t xfs /dev/md1 /mnt/debinst mount: mounting /dev/md1 on /mnt/debinst failed: Invalid argument sh-3.2# mount /dev/md1 /mnt/debinst sh-3.2#なんで??
sh-3.2# mount rootfs on / type rootfs (rw) /dev/root.old on / type ext2 (rw,relatime,errors=continue) proc on /proc type proc (rw,relatime) sysfs on /sys type sysfs (rw,relatime) devpts on /dev/pts type devpts (rw,relatime,gid=4,mode=620) udev on /dev type tmpfs (rw,nosuid,relatime,size=10240k,mode=755) /dev/ram1 on /mnt/ram type tmpfs (rw,relatime,size=15360k) usbfs on /proc/bus/usb type usbfs (rw,relatime) /dev/md/21 on /mnt/disk1 type xfs (rw,relatime,noquota) /dev/md1 on /mnt/debinst type ext3 (rw,relatime,errors=continue,data=writeback) sh-3.2#ext3 でマウントされている。
sh-3.2# umount /mnt/debinst/ sh-3.2# mount -t ext3 /dev/md1 /mnt/debinst/ sh-3.2# !um umount /mnt/debinst/ sh-3.2#確かに、ext3。
インストーラを修正する。
sh-3.2# !diff diff -au hackkit_squeeze_110112.sh hackkit_squeeze_120617.sh --- hackkit_squeeze_110112.sh Wed Jan 12 00:26:28 2011 +++ hackkit_squeeze_120617.sh Sun Jun 17 17:58:05 2012 @@ -26,6 +26,7 @@ BOOTPARTITION=/dev/sdb1 BOOTPARTITIONTYPE=ext3 ROOTPARTITION=/dev/sdb2 +ROOTPARTITIONTYPE=xfs SWAPPARTITION=/dev/sdb3 DATAPARTITION=/dev/sdb4 @@ -80,7 +81,7 @@ then mkdir $MOUNTPOINT || exit fi - mount -t xfs $ROOTPARTITION $MOUNTPOINT || exit + mount -t $ROOTPARTITIONTYPE $ROOTPARTITION $MOUNTPOINT || exit if [ $RAID = yes ] then @@ -803,6 +804,18 @@ BOOTPARTITION=/dev/md0 BOOTPARTITIONTYPE=ext3 ROOTPARTITION=/dev/md1 + SWAPPARTITION=/dev/md10 + DATAPARTITION="" + + RAID=yes + ;; +0x00004001) + MACHINE=LSQVL + + BOOTPARTITION=/dev/md0 + BOOTPARTITIONTYPE=ext3 + ROOTPARTITION=/dev/md1 + ROOTPARTITIONTYPE=ext3 SWAPPARTITION=/dev/md10 DATAPARTITION="" sh-3.2#もう一回実行
sh-3.2# !sh sh -x hackkit_squeeze_120617.sh + 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=hackkit + WORK=/mnt/disk1/share/hackkit + HACKKIT=/mnt/disk1/share/hackkit/hackkit_squeeze_110103.tar.gz + MOUNTPOINT=/mnt/debinst + cd /mnt/disk1/share/hackkit + '[' -f /mnt/disk1/share/hackkit/hackkit_config ']' + . /mnt/disk1/share/hackkit/hackkit_config ++ ADDRESS=192.168.2.56 ++ GATEWAY=192.168.2.96 ++ HOSTNAME=qvl + BOOTPARTITION=/dev/sdb1 + BOOTPARTITIONTYPE=ext3 + ROOTPARTITION=/dev/sdb2 + ROOTPARTITIONTYPE=xfs + SWAPPARTITION=/dev/sdb3 + DATAPARTITION=/dev/sdb4 + ETH=eth0 + RAID=no + '[' '!' -r /mnt/disk1/share/hackkit/hackkit_squeeze_110103.tar.gz ']' + '[' '!' -r /mnt/disk1/share/hackkit/mkimage ']' + '[' '!' -f /proc/buffalo/firmware ']' ++ sed -n -e 's/^PRODUCTID=\(.*\)$/\1/p' /proc/buffalo/firmware + PRODUCTID=0x00004001 + echo PRODUCTID = 0x00004001 PRODUCTID = 0x00004001 + case "$PRODUCTID" in + MACHINE=LSQVL + BOOTPARTITION=/dev/md0 + BOOTPARTITIONTYPE=ext3 + ROOTPARTITION=/dev/md1 + ROOTPARTITIONTYPE=ext3 + SWAPPARTITION=/dev/md10 + DATAPARTITION= + RAID=yes + echo MACHINE LSQVL MACHINE LSQVL + format_disk + '[' yes = yes ']' + return + mount_root + '[' yes = yes ']' + echo building md... building md... + /etc/init.d/startSysMd.sh -- rebuild mdadm.conf for BOOT, ROOTFS -- -- setup max error counts -- /sys/block/md0/md/maxerr_cnt is setted to -1 /sys/block/md1/md/maxerr_cnt is setted to -1 /sys/block/md10/md/maxerr_cnt is setted to -1 + echo mounting root file system ... mounting root file system ... + '[' '!' -d /mnt/debinst ']' + mount -t ext3 /dev/md1 /mnt/debinst + '[' yes = yes ']' + mkdir /mnt/debinst/.buffalo + mkdir /mnt/debinst/.buffalo/modules ++ uname -r + mv /mnt/debinst/lib/modules/2.6.31.8 /mnt/debinst/.buffalo/modules + rm -fr /mnt/debinst/bin /mnt/debinst/boot /mnt/debinst/dev /mnt/debinst/etc /mnt/debinst/home /mnt/debinst/initrd /mnt/debinst/lib /mnt/debinst/lost+found /mnt/debinst/mnt /mnt/debinst/proc /mnt/debinst/root /mnt/debinst/sbin /mnt/debinst/sys /mnt/debinst/tmp /mnt/debinst/usr /mnt/debinst/var /mnt/debinst/www + mkdir /mnt/debinst/lib + mkdir /mnt/debinst/lib/modules ++ uname -r + mv /mnt/debinst/.buffalo/modules/2.6.31.8 /mnt/debinst/lib/modules + rmdir /mnt/debinst/.buffalo/modules + rmdir /mnt/debinst/.buffalo + extract_hackkit + echo extracting hackkit archive ... extracting hackkit archive ... + cd /mnt/debinst + tar zxvf /mnt/disk1/share/hackkit/hackkit_squeeze_110103.tar.gz ./ ./var/ ./var/lib/ ./var/lib/apt/ ./var/lib/apt/lists/ : : ./sys/ ./srv/ ./opt/ ./media/ ./initrd/ + '[' yes = yes ']' + mkdir /mnt/debinst/mnt/disk1 + mkdir /mnt/debinst/mnt/disk2 + mknod /mnt/debinst/dev/md0 b 9 0 + mknod /mnt/debinst/dev/md1 b 9 1 + mknod /mnt/debinst/dev/md10 b 9 10 + create_fstab + echo creating /etc/fstab ... creating /etc/fstab ... + cat + '[' yes = no ']' + cat + echo '/dev/md0 /boot ext3 defaults,noatime 0 0' + echo '/dev/sda6 /mnt/disk1 xfs defaults,noatime 0 0' + '[' LSQVL = LSWSGL ']' + copy_miconapl + '[' LSQVL '!=' LSGL -a LSQVL '!=' HSDHGL ']' + return + create_miconapl + echo creating miconapl ... creating miconapl ... + cd /mnt/debinst + '[' LSQVL '!=' LSGL -a LSQVL '!=' HSDHGL ']' + cat + chmod +x etc/init.d/miconapl + chroot /mnt/debinst update-rc.d miconapl defaults update-rc.d: using dependency based boot sequencing + create_fancontrol + echo creating fancontrol ... creating fancontrol ... + cd /mnt/debinst + cat + cat + echo '*/5 * * * * nice /bin/sh /usr/local/sbin/fancontrol 2>/dev/null 1>/dev/null' + chmod 600 var/spool/cron/crontabs/root + create_kernelmon + echo creating kernelmon ... creating kernelmon ... + cd /mnt/debinst + cat + chmod +x /mnt/debinst/etc/init.d/kernelmon + chroot /mnt/debinst update-rc.d kernelmon defaults update-rc.d: using dependency based boot sequencing + '[' LSQVL = LSGL -o LSQVL = HSDHGL ']' + cat + chmod +x /mnt/debinst/usr/local/sbin/kernelmon + copy_modules + '[' yes = yes ']' + return + create_usb + echo creating usb ... creating usb ... + cd /mnt/debinst + cat + chmod +x etc/init.d/usb + chroot /mnt/debinst update-rc.d usb defaults update-rc.d: using dependency based boot sequencing + network_interfaces + cat + echo ' address 192.168.2.56' + echo ' network 192.168.2.0' + echo ' netmask 255.255.255.0' + echo ' broadcast 192.168.2.255' + echo ' gateway 192.168.2.96' + resolv_conf + echo 'nameserver 192.168.1.2' + hosts + echo '192.168.2.56 qvl' + hostname + echo qvl + umount_root + cd / + umount /mnt/debinst + mount_boot + echo checking /dev/md0 checking /dev/md0 + fsck -f -y /dev/md0 fsck 1.40.5 (27-Jan-2008) e2fsck 1.40.5 (27-Jan-2008) Superblock last mount time is in the future. Fix? yes Superblock last write time is in the future. Fix? yes 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 Block bitmap differences: -(18432--18447) -(24576--24587) Fix? yes Free blocks count wrong for group #0 (20312, counted=20340). Fix? yes Free blocks count wrong (235659, counted=235687). Fix? yes /dev/md0: ***** FILE SYSTEM WAS MODIFIED ***** /dev/md0: 19/62720 files (21.1% non-contiguous), 14409/250096 blocks + echo mounting /boot ... mounting /boot ... + cd / + '[' '!' -d /mnt/debinst/boot ']' + mkdir -p /mnt/debinst/boot + mount -t ext3 /dev/md0 /mnt/debinst/boot + copy_boot + '[' yes = yes ']' + return + edit_initrd + echo editing initrd ... editing initrd ... + dd if=/mnt/debinst/boot/initrd.buffalo of=/mnt/debinst/boot/initrd.gz bs=64 skip=1 154544+1 records in 154544+1 records out + echo gunziping /mnt/debinst/boot/initrd.gz ... gunziping /mnt/debinst/boot/initrd.gz ... + gunzip /mnt/debinst/boot/initrd.gz + '[' '!' -d /tmp/root ']' + mkdir /tmp/root + for minor in 0 1 2 3 4 5 6 7 8 9 + '[' '!' -e /dev/loop0 ']' + for minor in 0 1 2 3 4 5 6 7 8 9 + '[' '!' -e /dev/loop1 ']' + for minor in 0 1 2 3 4 5 6 7 8 9 + '[' '!' -e /dev/loop2 ']' + for minor in 0 1 2 3 4 5 6 7 8 9 + '[' '!' -e /dev/loop3 ']' + for minor in 0 1 2 3 4 5 6 7 8 9 + '[' '!' -e /dev/loop4 ']' + for minor in 0 1 2 3 4 5 6 7 8 9 + '[' '!' -e /dev/loop5 ']' + for minor in 0 1 2 3 4 5 6 7 8 9 + '[' '!' -e /dev/loop6 ']' + for minor in 0 1 2 3 4 5 6 7 8 9 + '[' '!' -e /dev/loop7 ']' + for minor in 0 1 2 3 4 5 6 7 8 9 + '[' '!' -e /dev/loop8 ']' + mknod /dev/loop8 b 7 8 + for minor in 0 1 2 3 4 5 6 7 8 9 + '[' '!' -e /dev/loop9 ']' + mknod /dev/loop9 b 7 9 + mount -o loop /mnt/debinst/boot/initrd /tmp/root + mv /tmp/root/linuxrc /tmp/root/linuxrc.orig + '[' yes = yes ']' + cat + chmod 700 /tmp/root/linuxrc + umount /tmp/root + echo gziping /mnt/debinst/boot/initrd ... wait 5 minutes gziping /mnt/debinst/boot/initrd ... wait 5 minutes + gzip /mnt/debinst/boot/initrd + chmod 755 /mnt/disk1/share/hackkit/mkimage + chown root.root /mnt/disk1/share/hackkit/mkimage + /mnt/disk1/share/hackkit/mkimage -A ARM -O Linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initrd -d /mnt/debinst/boot/initrd.gz /mnt/debinst/boot/initrd.buffalo Image Name: initrd Created: Sun Jun 17 18:00:23 2012 Image Type: ARM Linux RAMDisk Image (gzip compressed) Data Size: 9890438 Bytes = 9658.63 kB = 9.43 MB Load Address: 0x00000000 Entry Point: 0x00000000 + rm -f /mnt/debinst/boot/initrd.gz + umount_boot + echo unmount /boot ... unmount /boot ... + sync + umount /mnt/debinst/boot sh-3.2#できた。
yasunari@qube:~$ telnet qvl Trying 192.168.2.56... telnet: Unable to connect to remote host: No route to host yasunari@qube:~$さすがに一発通しとは行かない。
yasunari@qube:~$ ping qvl PING qvl.yamasita.jp (192.168.2.56) 56(84) bytes of data. From qube (192.168.2.50) icmp_seq=1 Destination Host Unreachable From qube (192.168.2.50) icmp_seq=2 Destination Host Unreachable From qube (192.168.2.50) icmp_seq=3 Destination Host Unreachable From qube (192.168.2.50) icmp_seq=5 Destination Host Unreachable From qube (192.168.2.50) icmp_seq=6 Destination Host Unreachable From qube (192.168.2.50) icmp_seq=7 Destination Host Unreachable From qube (192.168.2.50) icmp_seq=9 Destination Host Unreachable From qube (192.168.2.50) icmp_seq=10 Destination Host Unreachable From qube (192.168.2.50) icmp_seq=11 Destination Host Unreachable From qube (192.168.2.50) icmp_seq=13 Destination Host Unreachable From qube (192.168.2.50) icmp_seq=14 Destination Host Unreachable From qube (192.168.2.50) icmp_seq=15 Destination Host Unreachable --- qvl.yamasita.jp ping statistics --- 16 packets transmitted, 0 received, +12 errors, 100% packet loss, time 15008ms pipe 3 yasunari@qube:~$ネットワーク I/F が上がっていない?
こういうのはシリアルコンソールがあれば、すぐわかるのに、、、
|
← RAM root にログイン |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ ハックキットのインストール(2) |
Copyright (C) 2003-2012 Yasunari Yamashita. All Rights Reserved.
yasunari @ yamasita.jp 山下康成@京都府向日市