2011年6月13日月曜日

obs600-07 bmake build

前回 obs600-06 USBメモリBoot に続いて、bmake buildをしてみます。

もとネタは、ぷらっとホームさんのページファームウェアの作成 をこの通りにやってみます。

(1) BootさせるUSBメモリの準備 sysinst
-rw-rw-r-- 1 root wheel  8761531 Apr 15 01:24 src.tgz
ssd-linux[24]# tar ztvf /usr/INST/src.tgz |head
ssd-linux[31]# tar zxfp /usr/INST/src.tgz -C /
(2) bmake build の実行 失敗
ssd-linux[14]# cd /usr/src
ssd-linux[15]# date; bmake build | tee -a bmake_1.log ; date
(省略)
Stop.
bmake: stopped in /usr/src/lib/modules/wireless/rtl8712
*** Error code 1*** Error code 1*** Error code 1
###こんな所で停止したので以下をコメントにした。
ssd-linux[13]# diff lib/modules/wireless/Makefile.org lib/modules/wireless/Makef ile
19,22c19,22
< .if ${SSDVERSION} == "0.5" || ${SSDVERSION} == "0.6"
< # Wireless LAN driver for Realtek 8712 8188 8191 8192SU
< SUBDIR= rtl8712
< .endif
---
> #.if ${SSDVERSION} == "0.5" || ${SSDVERSION} == "0.6"
> ## Wireless LAN driver for Realtek 8712 8188 8191 8192SU
> #SUBDIR= rtl8712
> #.endif
ssd-linux[14]# 
(3) bmake build の実行 再度
ssd-linux[14]# cd /usr/src
                                 (2回目以降 NOCLEANをつけた)
ssd-linux[15]# (date; bmake build -DNOCLEAN; date) | tee -a bmake_4.log

2〜3日放置しておくと、以下が出て終わっていました。
(省略)
/usr/src/distrib/powerpc-obs600/dtb/../../../linux/arch/powerpc/boot/dts/
(cd /usr/src/distrib/powerpc-obs600/dtb/../../../linux; make ARCH=powerpc  obs600.dtb)
arch/powerpc/boot/dtc -O dtb -o arch/powerpc/boot/obs600.dtb -b 0 -p 1024 /usr/src/linux-2.6.29/¥
arch/powerpc/boot/dts/obs600.dts
DTC: dts->dtb  on file "/usr/src/linux-2.6.29/arch/powerpc/boot/dts/obs600.dts"
cp /usr/src/distrib/powerpc-obs600/dtb/../../../linux/arch/powerpc/boot/obs600.dtb¥
 /usr/src/distrib/powerpc-obs600/dtb
mkimage -n "0.5-20110610" -A ppc -O linux -T multi -C gzip -d /usr/src/distrib/powerpc-obs600/¥
standard/treeboot/../../kernel/vmlinux.bin.gz:../initrd/ramdisk.image.gz:/usr/src/distrib/¥
powerpc-obs600/standard/treeboot/../../dtb/obs600.dtb uImage.initrd || (rm -f uImage.initrd; exit 1)
Image Name:   0.5-20110610
Created:      Fri Jun 10 05:50:48 2011
Image Type:   PowerPC Linux Multi-File Image (gzip compressed)
Data Size:    16062934 Bytes = 15686.46 kB = 15.32 MB
Load Address: 00000000
Entry Point:  00000000
Contents:
   Image 0: 1694826 Bytes = 1655.10 kB = 1.62 MB
   Image 1: 14360187 Bytes = 14023.62 kB = 13.69 MB
   Image 2: 7902 Bytes = 7.72 kB = 0.01 MB
Fri Jun 10 05:50:55 JST 2011
ssd-linux[68]# df     ・・・8GB-USBメモリのビルド後の容量は 4.2GB くらい
Filesystem           1K-blocks      Used Available Use% Mounted on
LABEL=/                7279852   4370024   2540032  64% /
ssd-linux[16]# 
(4) uImage.initrd の出来上がり。たぶん。
ssd-linux[70]# find /usr/src -name 'uImage.initrd*' -ls
-rw-r--r--1 root wheel  2119926 Jun 10 05:35 /usr/src/distrib/powerpc-obs600/cfboot/treeboot/uImage.initrd-cfboot
-rw-r--r--1 root wheel 16062998 Jun 10 05:50 /usr/src/distrib/powerpc-obs600/standard/treeboot/uImage.initrd

このuImageカーネルで起動する確認をしておきます。

scp -p /usr/src/distrib/powerpc-obs600/standard/treeboot/uImage.initrd ¥
    192.168.1.70:/tftpboot/uImage.initrd_20110610_0550
scp -p /usr/src/distrib/powerpc-obs600/cfboot/treeboot/uImage.initrd-cfboot ¥
    192.168.1.70:/tftpboot/uImage.initrd-cfboot_20110610_0535

=> setenv bootargs root=/dev/ram rootdelay=15 console=ttyS0,115200
=> tftpboot 0x400000 192.168.1.70:uImage.initrd_20110610_0550
=> bootm 0x400000

=> setenv bootargs root=/dev/sda1 rootdelay=15 console=ttyS0,115200
=> tftpboot 0x400000 192.168.1.70:uImage.initrd-cfboot_20110610_0535
=> bootm 0x400000

それぞれ問題なく以前のこれら、
0.5-RELEASE-20110407-cfboot   2122882 Apr 15 01:33 uImage.initrd-cfboot
0.5-RELEASE-20110407         15951278 Apr 15 01:33 uImage.initrd_R20110407
自前でコンパイルしたものでも同様に起動することが確認出来ました。

さらに、kernelバージョン2.6.29 を 2.6.36 にして同じように、ビルドします。
#Debian環境で2.6.36ビルド用

# diff /etc/mk.conf.org /etc/mk.conf
15c15
< HAVE_CVS?=    yes
---
> HAVE_CVS?=    no
25a26,27
> 
> KERNEL_PATCHLEVEL=36
SSD/Linux環境でビルド出来たので次は、Debian環境でのビルドを試みます。
--

2011年6月8日水曜日

obs600-06 USBメモリBoot

USBメモリにssd-linuxをインストールして、src.tgzのコンパイルビルドをしてみたいと思います。まずは準備編でUSBメモリBootしてみます。
用意したのは「そんな装備でだいじょうぶか」というような低価格なUSBメモリ8GB容量です。2つのUSBスロットのどちらに差しても同じ結果になると思います。今回は下側に挿しました。
もとネタは、ぷらっとホームさんのページセルフ開発環境構築 をこの通りにやってみます。

(1) BootさせるUSBメモリの準備 sysinst
ssh 192.168.1.70 ls -l /tftpboot/uImage.initrd_R20110407                                                        
-rw-rw-r--  1 root  wheel  15951278 Apr 15 01:33 /tftpboot/uImage.initrd_R20110407

=> setenv bootargs root=/dev/ram rootdelay=15 console=ttyS0,115200
=> tftpboot 0x400000 192.168.1.70:uImage.initrd_R20110407
=> bootm 0x400000
(省略)
   Image Name:   0.5-RELEASE-20110407
   Created:      2011-04-14  14:34:50 UTC
(省略)
Welcome to SSD/Linux
ssd-linux login: root
Password: 
ssd-linux[1]# dhclient eth0
ssd-linux[3]# fdisk -l /dev/sdb

Disk /dev/sdb: 8015 MB, 8015314944 bytes
43 heads, 43 sectors/track, 8466 cylinders
Units = cylinders of 1849 * 512 = 946688 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               5        8467     7823424    c  W95 FAT32 (LBA)

ssd-linux[6]# sysinst
SSD/Linux 0.5-RELEASE-20110407/2.6.29 Installer
Are you sure to install [y/N] ? 
Error: any partition for linux not detected.
       run 'fdisk' and setup partition first.

ssd-linux[6]# fdisk /dev/sdb
(省略)
Disk /dev/sdb: 8015 MB, 8015314944 bytes
43 heads, 43 sectors/track, 8466 cylinders
Units = cylinders of 1849 * 512 = 946688 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        8000     7395978+  83  Linux
/dev/sdb2            8001        8466      430817   82  Linux

Command (m for help): w
The partition table has been altered!
(省略)
Syncing disks.
ssd-linux[9]# 
ssd-linux[9]# 
ssd-linux[10]# sysinst

SSD/Linux 0.5-RELEASE-20110407/2.6.29 Installer

Are you sure to install [y/N] ? 

Setup Filesystem

           Use Boot Device      MB     FStype   BSize fsck  Mount Point     
           --- ---- ----------  ------ -------  ----- ----- -----------     
        0.  *       /dev/sdb1     7222 ext3      4096  no   /
        1.  *       /dev/sdb2      420 swap            no   swap

    x.  Exit this menu.

Enter number [0-1 or x] : 0

Setup /dev/sdb1

           Use Boot Device      MB     FStype   BSize fsck  Mount Point     
           --- ---- ----------  ------ -------  ----- ----- -----------     
    >   0.  *       /dev/sdb1     7222 ext3      4096  no   /
        1.  *       /dev/sdb2      420 swap            no   swap

    a. Toggle use this partition.  c. Toggle mke2fs/mkswap with fsck.
    f. Toggle fs type ext2/ext3.   m. Enter/Change mount point.
    b. Change block size.
    x. Exit this menu.

Enter command [a, c, f, m, b or x] : x

Setup Filesystem

           Use Boot Device      MB     FStype   BSize fsck  Mount Point     
           --- ---- ----------  ------ -------  ----- ----- -----------     
        0.  *       /dev/sdb1     7222 ext3      4096  no   /
        1.  *       /dev/sdb2      420 swap            no   swap

    x.  Exit this menu.

Enter number [0-1 or x] : x


Taking mkswap and mke2fs.
Are you sure [y/N] ? y

Setting up swapspace version 1, size = 441151 kB
no label, UUID=8a6cf799-bf7f-4c6d-ab2f-641c6584c290
Adding 430808k swap on /dev/sdb2.  Priority:-1 extents:1 across:430808k 
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
924768 inodes, 1848994 blocks
92449 blocks (5.00%) reserved for the super user
First data block=0
57 block groups
32768 blocks per group, 32768 fragments per group
16224 inodes per group
Superblock backups stored on blocks: 
 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Writing inode tables:  0/57 ...

Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 27 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
kjournald starting.  Commit interval 5 seconds
EXT3 FS on sdb1, internal journal
EXT3-fs: mounted filesystem with ordered data mode.

Select Distributions

     0. Kernel Modules        :  yes 
     1. Base                  :  yes 
     2. System (/etc)         :  yes 
     3. Compiler              :  yes 
     4. Manuals               :  yes 
     5. Source                :  no  

     x. Exit this menu.

Enter number [0-5 or x] : x

Select install media

     * Network : eth0

    x. Exit this menu.

Enter command [x] : x


Setup for FTP download

    0. FTP server      : ftp.plathome.co.jp
    1. Remote pathname : /pub/OBS600/0.5-RELEASE-20110407/powerpc-obs600/binary
    2. Local pathname  : /usr/INST
    3. FTP proxy       : 
    4. Login name      : ftp
    5. Login Password  : Your_Mail_Address

    x. Exit this menu.

Enter number [0-5 or x] : 5
Enter password : nkbmobile@gmail.com

Setup for FTP download

    0. FTP server      : ftp.plathome.co.jp
    1. Remote pathname : /pub/OBS600/0.5-RELEASE-20110407/powerpc-obs600/binary
    2. Local pathname  : /usr/INST
    3. FTP proxy       : 
    4. Login name      : ftp
    5. Login Password  : nkbmobile@gmail.com

    x. Exit this menu.

Enter number [0-5 or x] : x


Start fetch binaries and extract.
Are you sure [y/N] ? y

Fetch kern.tgz ...
Fetch base.tgz ...
Fetch etc.tgz ...
Fetch comp.tgz ...
Fetch man.tgz ...
Extract kern.tgz ...
./uImage.initrd-cfboot
./System.map
./System.map.2629
./lib/modules/
./lib/modules/2.6.29/
./lib/modules/2.6.29/kernel/
./lib/modules/2.6.29/kernel/crypto/
./lib/modules/2.6.29/kernel/crypto/anubis.ko.gz
(省略)
./usr/share/man/cat8/
./usr/share/man/cat8/audit-packages.0
./usr/share/man/cat8/download-vulnerability-list.0
Make device files...
Write /etc/fstab.
Modify /etc/rc.conf.
Remove /mnt/usr/INST
Are you sure [y/N] ? N
Skip...
Set root passwd
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Boot from CF
Change 1st U-Boot environment area
Change 2nd U-Boot environment area
Boot device change to cf

Installation Completed.

  Good luck...

ssd-linux[11]# reboot
(2) USBメモリの/dev/sdb1からのBoot
=> setenv bootargs root=/dev/sdb1 rootdelay=15 console=ttyS0,115200
=> tftpboot 0x400000 192.168.1.70:uImage.initrd_R20110407
=> bootm 0x400000

ssd-linux[4]# df    起動後は /dev/sdb1が rootになっています。
Filesystem           1K-blocks      Used Available Use% Mounted on
LABEL=/                7279852    789024   6121032  12% /
ssd-linux[65]# cat /proc/mounts|head -2
rootfs / rootfs rw 0 0
/dev/root / ext3 rw,errors=continue,data=ordered 0 0
ssd-linux[66]# dumpe2fs -h /dev/sdb1|grep volume
dumpe2fs 1.39 (29-May-2006)
Filesystem volume name:   /
次は、ファームウェアの作成、Linuxカーネルのビルドを試みます。
--

2011年6月5日日曜日

obs600-05 設定その1

本格的に設定を進めていきます。このメモは、読みやすさより実際のコマンド入力を重視しており、見苦しく申し訳ないです。

(1) kernel module コピー
cd ${どこか1}/OBS600/Plathome
scp -p ftp.plathome.co.jp/pub/OBS600/0.5-RELEASE-20110407/powerpc-obs600/binary/kern.tgz obs600:/boot/Plathome
root@squeeze:Plathome# cd /boot/Plathome; ls -l kern.tgz
-rw-rw-r-- 1 root root 7254182 Apr 15 01:34 kern.tgz

root@squeeze:Plathome# tar zxfp kern.tgz -C / # kern.tgzを展開
root@squeeze:Plathome# ls -F /lib/modules/
2.6.29/
#勉強不足 *ko.gz での depmod がわからないので、*ko.gz展開してしまう。
root@squeeze:Plathome# find /lib/modules/2.6.29 -name '*.ko.gz'|xargs gunzip
root@squeeze:Plathome# find /lib/modules/2.6.29 -name '*.ko'|wc
    518     518   28899
#再起動したのち、# depmod -a する
(2) ひとまずのネットワーク設定
root@squeeze:Plathome# cat /etc/network/interfaces 
# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
#
#lo の UP。これを漏らすと、/etc/init.d/portmap stop で pmap_dump の

Stopping portmap daemon... で止まる straceで状況確認する

connect(3, {sa_family=AF_INET, sin_port=htons(111), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ETIMEDOUT (Connection timed out)

#6分間のタイムアウト待ちになります。ifconfig lo を見たり
#lsof -i:111 や telnet localhost 111 でチェックすると良い。
(3) runled,pshd と flashcfg* のコピー
ここの{どこか2}とはobs600-01 到着 初期バックアップ の (3)念のため展開 した所です。

cd ${どこか2}/OBS600/RootGz/flash_2011_0601/Root
rsync -a etc/init.d/runled obs600:/etc/init.d/runled
rsync -a etc/rc0.d/K01runled obs600:/etc/rc0.d/K01runled
rsync -a etc/rc2.d/S99runled obs600:/etc/rc2.d/S99runled
rsync -a etc/rc6.d/K01runled obs600:/etc/rc6.d/K01runled
rsync -a usr/sbin/runled obs600:/usr/sbin/runled
rsync -a etc/init.d/pshd obs600:/etc/init.d/pshd
rsync -a etc/rc0.d/K01pshd obs600:/etc/rc0.d/K01pshd
rsync -a etc/rc2.d/S99pshd obs600:/etc/rc2.d/S99pshd
rsync -a etc/rc6.d/K01pshd obs600:/etc/rc6.d/K01pshd
rsync -a usr/sbin/pshd obs600:/usr/sbin/pshd
rsync -a usr/sbin/flashcfg* obs600:/usr/sbin

#CPU負荷が増すと、橙緑赤の点滅速度が速くなって、忙しいのが
#ビジュアルに判ってカッこいいです。
(4) uImage.initrd-cfboot の書き込み
# 毎回 => tftpboot 0x400000 192.168.1.70:uImage.initrd-cfboot
# これを打つのをしなくて良くなります。

root@squeeze:Plathome# ls -l uImage.initrd-cfboot
-rw-rw-r-- 1 root root 2122882 Apr 14 16:33 uImage.initrd-cfboot
root@squeeze:Plathome# ls -l /usr/sbin/flashcfg*
-r-xr-xr-x 1 root root   6047 Mar  9 04:28 /usr/sbin/flashcfg
-r-xr-xr-x 1 root root 730005 Mar  9 04:28 /usr/sbin/flashcfg-debian

root@squeeze:Plathome# /usr/sbin/flashcfg -f uImage.initrd-cfboot
Save firmware file to FlashROM.
Are you ok? [y|N] y

Load boot image to FlashROM
*****************
done
root@squeeze:Plathome# 

# bootargs も記憶させる
=> printenv bootargs
## Error: "bootargs" not defined
=> setenv bootargs root=/dev/sda1 rootdelay=15 console=ttyS0,115200
=> saveenv
(5) ここまでにインストールしたパッケージ
#必須ではありません。
apt-get install strace
apt-get install psmisc  (killall)
apt-get install ntpdate
apt-get install jless less
apt-get install lsof
apt-get install screen
apt-get install gnu-fdisk (fdisk)
apt-get install sudo bzip2
apt-get install telnet
だんだんよくなるホッケの太鼓。少しずついい感じになって来ました。
--

2011年6月4日土曜日

obs600-04 CF_Boot とりあえず

前回 obs600-02 debootstrap で構成した、すっぴんなDebianをCFに移してCF Bootしてみたいと思います。
CFを装着。 ここでは【4GB】サンディスク Ultra 30MB/秒(200倍速) コンパクトフラッシュ (海外リテール品) SDCFH-004G で低価格なものを使っています。#安物で信頼性に難ありそうです。

(1) CF区画の作成
root@squeeze:〜# fdisk -l /dev/sda
Disk /dev/sda: 3 GB, 3996647424 bytes
128 heads, 63 sectors/track, 968 cylinders
Units = cylinders of 8064 * 512 = 4128768 bytes

   Device Boot      Start         End      Blocks   Id  System 
/dev/sda1   *           1         969     3906976    b  FAT32
Warning: Partition 1 does not end on cylinder boundary.                   
root@squeeze:〜# 

root@squeeze:〜# fdisk /dev/sda

   Device Boot      Start         End      Blocks   Id  System 
/dev/sda1               1         892     3596512   83  Linux
/dev/sda2             893         968      302400   82  Linux swap
Command (m for help): w
(2) CFのフォーマット
root@squeeze:〜# mke2fs -j /dev/sda1
root@squeeze:〜# tune2fs -c 0 -i 0 /dev/sda1
root@squeeze:〜# mkswap /dev/sda2
(3) すっぴんなDebianをCFに移す
root@squeeze:〜# mkdir -p /net/tiger
root@squeeze:〜# mount -t nfs 192.168.1.50:/dsk/hda11/OBS600 /net/tiger
root@squeeze:〜# mount /dev/sda1 /mnt
root@squeeze:〜# rsync -a tiger:/dsk/hda11/OBS600/Debian/nfs_squeeze/ /mnt
(4) 起動に必要な変更追加
root@squeeze:〜# rsync -auv /dev/ttyS* /mnt/dev
root@squeeze:〜# ls -l /mnt/dev/ttyS*
crw------- 1 root tty     4, 64 Jun  3 22:05 /mnt/dev/ttyS0
crw-rw---- 1 root dialout 4, 65 Jun  3 21:11 /mnt/dev/ttyS1
crw-rw---- 1 root dialout 4, 66 Jun  3 21:11 /mnt/dev/ttyS2
crw-rw---- 1 root dialout 4, 67 Jun  3 21:11 /mnt/dev/ttyS3

root@squeeze:〜# diff /etc/inittab /mnt/etc/inittab
root@squeeze:〜# grep T0 /mnt/etc/inittab
T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100

root@squeeze:〜# cd /mnt
root@squeeze:/mnt# ls
bin   dev  home  lib64       media  opt   root  selinux  sys  usr
boot  etc  lib   lost+found  mnt    proc  sbin  srv      tmp  var
root@squeeze:/mnt# chroot ./ /bin/bash
root@squeeze:/# mount /proc

root@squeeze:〜# cat /etc/apt/sources.list
deb http://ftp.jp.debian.org/debian squeeze main
#deb http://security.debian.org/ squeeze/updates main
#deb ftp://ftp.plathome.co.jp/pub/OBS600/debian/squeeze ./

#必要そうなものをapt-getする
ping ftp.jp.debian.org
apt-get update
apt-get upgrade
apt-get install nfs-common
apt-get install dump
apt-get install rsync
apt-get install u-boot
apt-get install dselect
apt-get install openssh-client openssh-server

#後日こんなのも、つでにapt-getする
apt-get install ftp ftpd lftp ncftp
apt-get install patch
apt-get install make
apt-get install libncurses5-dev (make menuconfig)
apt-get install usbutils
apt-get install wireless-tools
apt-get install hostapd
apt-get install firmware-ralink
apt-get install bridge-utils
apt-get install zd1211-firmware
apt-get install cpp gcc    (hostapdコンパイル)
apt-get install libssl-dev (hostapdコンパイル)
apt-get install libnl-dev  (hostapdコンパイル)
apt-get install zip unzip

root@squeeze:〜# passwd root
root@squeeze:〜# useradd myuser
root@squeeze:〜# passwd myuser

root@squeeze:〜# cd
root@squeeze:〜# umount /proc
root@squeeze:〜# exit
exit
root@squeeze:/mnt# cd
root@squeeze:〜# umount /mnt
root@squeeze:〜# 
(5) uImage.initrd-cfboot でCF Boot
wget -N ftp://ftp.plathome.co.jp/pub/OBS600/0.5-RELEASE-20110407/powerpc-obs600/installation/uImage.initrd-cfboot
サイズとタイムスタンプ 2122882 Apr 15 01:33 uImage.initrd-cfboot

=> setenv bootargs root=/dev/sda1 rootdelay=15 console=ttyS0,115200
=> tftpboot 0x400000 192.168.1.70:uImage.initrd-cfboot
Waiting for PHY auto negotiation to complete.. done
ENET Speed is 100 Mbps - FULL duplex connection (EMAC0)
Using ppc_4xx_eth0 device
TFTP from server 192.168.1.70; our IP address is 192.168.1.29
Filename 'uImage.initrd-cfboot'.
Load address: 0x400000
Loading: *#################################################################
  #################################################################
  ###############
done
Bytes transferred = 2122882 (206482 hex)
=> bootm 0x400000
## Booting kernel from Legacy Image at 00400000 ...
   Image Name:   0.5-RELEASE-20110407-cfboot
   Created:      2011-04-14  14:28:31 UTC
   Image Type:   PowerPC Linux Multi-File Image (gzip compressed)
   Data Size:    2122818 Bytes =  2 MB
   Load Address: 00000000
   Entry Point:  00000000
   Contents:
      Image 0: 1694843 Bytes =  1.6 MB
      Image 1: 420055 Bytes = 410.2 kB
      Image 2: 7902 Bytes =  7.7 kB
   Verifying Checksum ... OK
## Loading init Ramdisk from multi component Legacy Image at 00400000 ...
## Flattened Device Tree from multi component Image at 00400000
   Booting using the fdt at 0x6045a4
   Uncompressing Multi-File Image ... OK
   Loading Ramdisk to 0fdfe000, end 0fe648d7 ... OK
Using OpenBlockS 600 machine description
Linux version 2.6.29 (root@obs600-official) (gcc version 4.2.3) #1 Wed Apr 13 16:46:11 JST 2011
Found initrd at 0xcfdfe000:0xcfe648d7
Zone PFN ranges:
  DMA      0x00000000 -> 0x00020000
  Normal   0x00020000 -> 0x00020000
  HighMem  0x00020000 -> 0x00040000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00040000
MMU: Allocated 1088 bytes of context maps for 255 contexts
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260096
Kernel command line: root=/dev/sda1 rootdelay=15 console=ttyS0,115200
UIC0 (32 IRQ sources) at DCR 0xc0
UIC1 (32 IRQ sources) at DCR 0xd0
UIC2 (32 IRQ sources) at DCR 0xe0
PID hash table entries: 2048 (order: 11, 8192 bytes)
clocksource: timebase mult[6aaaab] shift[22] registered
Console: colour dummy device 80x25
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 1034884k/1048576k available (3292k kernel code, 12624k reserved, 148k data, 102k bss, 140k init)
Calibrating delay loop... 1196.03 BogoMIPS (lpj=2392064)
Mount-cache hash table entries: 512
net_namespace: 988 bytes
NET: Registered protocol family 16
bio: create slab  at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
cfg80211: Using static regulatory domain info
cfg80211: Regulatory domain: US
 (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
 (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
 (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
 (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
 (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
 (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
 (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
cfg80211: Calling CRDA for country: US
NET: Registered protocol family 2
IP route cache hash table entries: 16384 (order: 4, 65536 bytes)
TCP established hash table entries: 65536 (order: 7, 524288 bytes)
TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 65536 bind 65536)
TCP reno registered
NET: Registered protocol family 1
checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
Freeing initrd memory: 410k freed
audit: initializing netlink socket (disabled)
type=2000 audit(0.604:1): initialized
highmem bounce pool size: 64 pages
Registering unionfs 2.5.7 (for 2.6.29.6)
msgmni has been set to 1000
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
OBS600 LED driver v0.2
Push switch driver v0.1
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xef600200 (irq = 26) is a 16550A
console [ttyS0] enabled
serial8250.0: ttyS1 at MMIO 0xef600300 (irq = 16) is a 16550A
brd: module loaded
PPC 4xx OCP EMAC driver, version 3.54
MAL v2 /plb/mcmal, 2 TX channels, 2 RX channels
RGMII /plb/opb/emac-rgmii@ef600b00 initialized with MDIO support
/plb/opb/emac-rgmii@ef600b00: input 0 in RGMII mode
eth0 (emac): not using net_device_ops yet
eth0: EMAC-0 /plb/opb/ethernet@ef600900, MAC 00:0a:85:04:19:9e
eth0: found Generic MII PHY (0x02)
/plb/opb/emac-rgmii@ef600b00: input 1 in RGMII mode
eth1 (emac): not using net_device_ops yet
eth1: EMAC-1 /plb/opb/ethernet@ef600a00, MAC 00:0a:85:04:99:9e
eth1: found Generic MII PHY (0x03)
Driver 'sd' needs updating - please use bus_type methods
f8000000.nor_flash: Found 1 x16 devices at 0x0 in 16-bit bank
 Amd/Fujitsu Extended Query Table at 0x0040
f8000000.nor_flash: CFI does not contain boot bank location. Assuming top.
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
cmdlinepart partition parsing not available
RedBoot partition parsing not available
Creating 7 MTD partitions on "f8000000.nor_flash":
0x000000000000-0x000003de0000 : "kernel + initrd"
0x000003de0000-0x000003e60000 : "user config area"
0x000003e60000-0x000007e60000 : "user program area"
0x000007e60000-0x000007ee0000 : "flat device tree"
0x000007ee0000-0x000007f60000 : "test program"
0x000007f60000-0x000007fa0000 : "u-boot env"
0x000007fa0000-0x000008000000 : "u-boot"
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
dwc_otg: version 2.60a 22-NOV-2006
dwc_otg: Shared Tx FIFO mode
dwc_otg: Using DMA mode
dwc_otg dwc_otg.0: DWC OTG Controller
dwc_otg dwc_otg.0: new USB bus registered, assigned bus number 1
dwc_otg dwc_otg.0: irq 17, io mem 0x00000000
dwc_otg: Init: Port Power? op_state=1
dwc_otg: Init: Power Port (0)
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: DWC OTG Controller
usb usb1: Manufacturer: Linux 2.6.29 dwc_otg_hcd
usb usb1: SerialNumber: dwc_otg.0
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
mice: PS/2 mouse device common for all mice
i2c /dev entries driver
ibm-iic ef600400.i2c: using standard (100 kHz) mode
ibm-iic ef600500.i2c: using standard (100 kHz) mode
DS1340: I2C based RTC driver.
DS1340: found DS1340 on IBM IIC
Netfilter messages via NETLINK v0.30.
NET: Registered protocol family 17
registered taskstats version 1
Waiting 15sec before mounting root device...
usb 1-1: new high speed USB device using dwc_otg and address 2
usb 1-1: New USB device found, idVendor=0424, idProduct=2514
usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
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
usb 1-1.1: new high speed USB device using dwc_otg and address 3
usb 1-1.1: New USB device found, idVendor=05e3, idProduct=0702
usb 1-1.1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
usb 1-1.1: Product: USB Storage
usb 1-1.1: configuration #1 chosen from 1 choice
scsi0 : SCSI emulation for USB Mass Storage devices
scsi 0:0:0:0: Direct-Access     SanDisk  SDCFH-004G       0014 PQ: 0 ANSI: 0
sd 0:0:0:0: [sda] 7813120 512-byte hardware sectors: (4.00 GB/3.72 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] 7813120 512-byte hardware sectors: (4.00 GB/3.72 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1 sda2
sd 0:0:0:0: [sda] Attached SCSI disk
RAMDISK: Compressed image found at block 0
VFS: Mounted root (ext2 filesystem) on device 1:0.
Segmentation fault
Segmentation fault
Setting real-root-dev to sda1.
kjournald starting.  Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly on device 8:1.
Trying to move old root to /initrd ... /initrd does not exist. Ignored.
Unmounting old root
Trying to free ramdisk memory ... okay
[prepare_namespace] Executing flashcfg...
[prepare_namespace] Finished executing flashcfg
Freeing unused kernel memory: 140k init
modprobe: FATAL: Could not load /lib/modules/2.6.29/modules.dep: No such file or directory

INIT: version 2.88 booting
Using makefile-style concurrent boot in runlevel S.
.udev/ already exists on the static /dev! ... (warning).
Starting the hotplug events dispatcher: udevd.
Synthesizing the initial hotplug events...done.
Waiting for /dev to be fully populated...done.
Activating swap...Adding 306424k swap on /dev/sda2.  Priority:-1 extents:1 across:306424k 
done.
Checking root file system...fsck from util-linux-ng 2.17.2
/dev/sda1: clean, 12377/224896 files, 115319/899128 blocks
done.
EXT3 FS on sda1, internal journal
Cleaning up ifupdown....
Setting up networking....
Loading kernel modules...done.
Activating lvm and md swap...done.
Checking file systems...fsck from util-linux-ng 2.17.2
done.
Mounting local filesystems...done.
Activating swapfile swap...done.
Cleaning up temporary files....
Configuring network interfaces...done.
Starting portmap daemon....
Starting NFS common utilities: statd failed!
Cleaning up temporary files....
Setting kernel variables ...done.
startpar: service(s) returned failure: nfs-common ... failed!
INIT: Entering runlevel: 2
Using makefile-style concurrent boot in runlevel 2.
Starting portmap daemon...Already running..
Starting NFS common utilities: statd failed!
Starting enhanced syslogd: rsyslogd.
Starting periodic command scheduler: cron.
Starting OpenBSD Secure Shell server: sshd.
startpar: service(s) returned failure: nfs-common ... failed!

Debian GNU/Linux 6.0 squeeze ttyS0

squeeze login: root
Password: 
Linux squeeze 2.6.29 #1 Wed Apr 13 16:46:11 JST 2011 ppc

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.
root@squeeze:〜# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1              3540000    404812   2955364  13% /
tmpfs                   518252         0    518252   0% /lib/init/rw
udev                     10240        64     10176   1% /dev
tmpfs                   518252         0    518252   0% /dev/shm
root@squeeze:〜# uname -a
Linux squeeze 2.6.29 #1 Wed Apr 13 16:46:11 JST 2011 ppc GNU/Linux

root@squeeze:〜# dhclient eth0
eth0: link is up, 100 FDX, pause enabled
root@squeeze:〜# ifconfig -a eth0
eth0      Link encap:Ethernet  HWaddr 00:0a:85:04:19:9e  
          inet addr:192.168.1.29  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:744 (744.0 B)  TX bytes:684 (684.0 B)
          Interrupt:25 

root@squeeze:〜# ping -c 2 www.google.com
PING www.l.google.com (66.249.89.99) 56(84) bytes of data.
64 bytes from nrt04s01-in-f99.1e100.net (66.249.89.99): icmp_req=1 ttl=53 time=30.5 ms
64 bytes from nrt04s01-in-f99.1e100.net (66.249.89.99): icmp_req=2 ttl=53 time=29.1 ms
root@squeeze:〜# 
すっぴんなDebianがCFからBootしました。いっぱいエラーがでてます。
Segmentation fault     does not exist. Ignored.
No such file or directory (warning)   failed!
まだ、とりあえず状態です。これらエラーを解消したり、
OBS600独自の/usr/sbin/runledや/usr/sbin/pshdのコピーはおいおい行います。
ここが自分ごのみのOpenBlockSにするスタート地点です。
--

2011年6月3日金曜日

obs600-03 工場出荷状態への戻し

どじなことやうっかりで起動しなくなることがあります。OBS600Dは軽くて小さいので文鎮にも漬物石にもなりません。いまのうちに工場出荷状態へ戻せることの確認をしておきます。

ぷらっとホームさんのFAQページ ファームウェアアップデートを実行したら起動しなくなりました。どうすれば復旧できますか。 をこの通りにやってみます。
但し、uImage.initrd は後述にて得たものを使っています。

(1) DIP-SW 2 ONにして、本体Power ON
=> setenv ipaddr 192.168.1.29
=> setenv serverip 192.168.1.70              
=> setenv tftpserver 192.168.1.70
=> saveenv  

(省略)
*** SW 1 IS OFF ***

*** SW 2 IS ON, DOWNLOAD STANDARD OS ***

Waiting for PHY auto negotiation to complete.. done
ENET Speed is 100 Mbps - FULL duplex connection (EMAC0)
Using ppc_4xx_eth0 device
host 192.168.1.70 is alive
Using ppc_4xx_eth0 device
TFTP from server 192.168.1.70; our IP address is 192.168.1.29
Filename 'uImage.initrd'.
Load address: 0x400000
Loading: * #################################################################
  #################################################################
  #################################################################
(省略)
  #################################################################
  #################################################################
  #################################################################
  ###################
done
Bytes transferred = 44168542 (2a1f55e hex)
Un-Protected 337 sectors

................................................................................................................................................................................................................................................................................................................................................. done
Erased 337 sectors
Copy to Flash... done
=> 
(2) uImage.initrdの種類とブート時のメッセージ
その1ssd-linux用
wget -N ftp://ftp.plathome.co.jp/pub/OBS600/0.5-RELEASE-20110407/powerpc-obs600/installation/uImage.initrd
サイズとタイムスタンプ 15951278 Apr 15 01:33 uImage.initrd
## Booting kernel from Legacy Image at f8000000 ...
   Image Name:   0.5-RELEASE-20110407
   Created:      2011-04-14  14:34:50 UTC
   Image Type:   PowerPC Linux Multi-File Image (gzip compressed)
   Data Size:    15951214 Bytes = 15.2 MB

その2Debian squeeze用
wget -N ftp://ftp.plathome.co.jp/pub/OBS600/debian/files/squeeze/2.6.29-1/uImage.initrd.squeeze
サイズとタイムスタンプ 44168542 Mar  9 15:51 uImage.initrd.squeeze
## Booting kernel from Legacy Image at f8000000 ...
   Image Name:   Debian GNU/Linux 6.0 - 20110309
   Created:      2011-03-09   6:50:42 UTC
   Image Type:   PowerPC Linux Multi-File Image (gzip compressed)
   Data Size:    44168478 Bytes = 42.1 MB
Flashに書きこむ時間は、その2のファイルはデカイので10分以上かかったような。いずれはNFS-rootでブートできるようにしたいです。
2011年6月1日に入手したOBS600Dでは、その2で工場出荷状態に戻せるようです。
--

obs600-02 debootstrap

2011年6月1日に到着したOBS600DはすでにDebian 6.0 squeezeです。これをベースにCFに移してもよさそうですが、すっぴんなDebianをインストールして進めることにします。obs600-01で 別ホストに ramファイルシステムをバックアップしてルートファイル構成したように、同様なユーザランドの解析研究向けにNFSマウント先にdebootstrapを使って、サーバー上にルートファイル構成をしてみます。

(1) 母艦tigerにNFSマウント
root@squeeze:〜# mkdir -p /net/tiger
root@squeeze:〜# mount -t nfs tiger:/dsk/hda11/OBS600 /net/tiger
RPC: Registered tcp transport module.
mount: wrong fs type, bad option, bad superblock on tiger:/dsk/hda11/OBS600,
root@squeeze:〜# ls -l /sbin/mount.nfs
ls: cannot access /sbin/mount.nfs: No such file or directory
root@squeeze:〜# apt-get install nfs-common
root@squeeze:〜# ls -l /sbin/mount.nfs
-rwsr-xr-x 1 root root 97120 Aug 27  2010 /sbin/mount.nfs
root@squeeze:〜# mount -t nfs 192.168.1.50:/dsk/hda11/OBS600 /net/tiger
root@squeeze:〜# 
root@squeeze:〜# cd /net/tiger/Debian/nfs_squeeze/
root@squeeze:/net/tiger/Debian/nfs_squeeze# 
root@squeeze:4.1# set|grep PS1
PS1='${debian_chroot:+($debian_chroot)}¥u@¥h:¥w¥$ '
root@squeeze:/net/tiger/Debian/nfs_squeeze# export PS1='${debian_chroot:+($debian_chroot)}¥u@¥h:¥W¥$ '
root@squeeze:nfs_squeeze# 
(2) debootstrap のインストール
root@squeeze:nfs_squeeze# apt-get install debootstrap
Root@squeeze:nfs_squeeze# ls -l /usr/sbin/debootstrap
-rwxr-xr-x 1 root root 18227 Mar  4 20:53 /usr/sbin/debootstrap
root@squeeze:nfs_squeeze# pwd
/net/tiger/Debian/nfs_squeeze
(3) debootstrap の実行
root@squeeze:nfs_squeeze# date; /usr/sbin/debootstrap --arch powerpc squeeze ./; date
Wed Jun  1 17:04:47 JST 2011
I: Retrieving Release
I: Retrieving Packages
(省略)
I: Configuring apt-utils...
I: Configuring aptitude...
I: Configuring tasksel-data...
I: Configuring tasksel...
I: Base system installed successfully.
Wed Jun  1 17:43:55 JST 2011
root@squeeze:nfs_squeeze# 
root@squeeze:〜# du -sh /net/tiger/Debian/nfs_squeeze
238M    /net/tiger/Debian/nfs_squeeze
root@squeeze:〜# ls -F /net/tiger/Debian/nfs_squeeze
bin/            home/           mnt/            sbin/           tmp/
boot/           lib/            opt/            selinux/        usr/
dev/            lib64/          proc/           srv/            var/
etc/            media/          root/           sys/
(4) 母艦側のNFS設定
root@tiger:Debian# tail -1 /etc/exports         [61] (11-06-01 Wed 16:28:36 PM)
/dsk/hda11/OBS600 192.168.1.0/255.255.255.0(rw,sync,no_subtree_check,no_root_squash)
root@tiger:Debian# exportfs -a  (-r)            [67] (11-06-01 Wed 16:29:17 PM)
root@tiger:Debian# exportfs -v                  [68] (11-06-01 Wed 16:29:20 PM)
/dsk/hda11/OBS600
                192.168.1.0/255.255.255.0(rw,wdelay,no_root_squash,no_subtree_check)
(5) 母艦側から見たnfs_squeeze/
user@tiger:〜% mkdir -p /dsk/hda11/OBS600/Debian/nfs_squeeze
user@tiger:〜% ls -F /dsk/hda11/OBS600/Debian/nfs_squeeze
bin/   dev/  home/  lib64/  mnt/  proc/  sbin/     srv/  tmp/  var/
boot/  etc/  lib/   media/  opt/  root/  selinux/  sys/  usr/
root@tiger:〜# du -sh /dsk/hda11/OBS600/Debian/nfs_squeeze
238M    /dsk/hda11/OBS600/Debian/nfs_squeeze
root@tiger:〜#                                [4] (11-06-01 Wed 18:09:05 PM)
次は、この Debian/nfs_squeeze/ に出来ているルートファイルをCFに移して、CFブートを試みます。
--

2011年6月1日水曜日

obs600-01 到着 初期バックアップ

現行のおうちルータとして活躍している、OpenMicroServer(oms400)からリプレースする自分用備忘メモを記録していきます。Debianリリースで、oms400をetchで使っていて、etch->lenny にしたあたりから、メインメモリが128MB では厳しくなってきたのと、リリースのおいてきぼりにならないよう、Debian 6.0 ("squeeze") — 現在の安定版リリース にしたい理由から、リプレースに至りました。

注文していた OpenBlockS 600Dが到着しました。
まずは開梱、火入れ、初期バックアップまでを行います。

新しい物をさわるときには、ワクワクします。

同梱の内容ブツです。

現行の Open Micro Server (oms400) の上に乗っけた画像です。二回り小さく見えます。






(1) コンソールをつないで、問題なく起動したのを確認して、rootで入ります。
root@squeeze:〜# head -4 /etc/apt/sources.list
deb http://ftp.jp.debian.org/debian squeeze main
deb-src http://ftp.jp.debian.org/debian squeeze main

deb http://security.debian.org/ squeeze/updates main

root@squeeze:〜# ifconfig eth0 192.168.1.29
root@squeeze:〜# route add default gw 192.168.1.28
root@squeeze:〜# echo "nameserver 192.168.1.28" > /etc/resolv.conf
root@squeeze:〜# ping -c 3 ftp.jp.debian.org
PING jp.cdn.araki.net (150.65.7.130) 56(84) bytes of data.
64 bytes from ftp.jaist.ac.jp (150.65.7.130): icmp_seq=1 ttl=238 time=33.6 ms
64 bytes from ftp.jaist.ac.jp (150.65.7.130): icmp_seq=2 ttl=238 time=35.4 ms
64 bytes from ftp.jaist.ac.jp (150.65.7.130): icmp_seq=3 ttl=238 time=34.0 ms

root@squeeze:〜# apt-get update
root@squeeze:〜# apt-get install dump
Reading package lists... Done
Building dependency tree        
Reading state information... Done
The following NEW packages will be installed:
  dump
0 upgraded, 1 newly installed, 0 to remove and 7 not upgraded.
Need to get 290 kB of archives.
After this operation, 745 kB of additional disk space will be used.
Get:1 http://ftp.jp.debian.org/debian/ squeeze/main dump powerpc 0.4b43-1 [290 kB]
Fetched 290 kB in 0s (438 kB/s)
unionfs: new lower inode mtime (bindex=0, name=debconf)
unionfs: new lower inode mtime (bindex=0, name=apt)
unionfs: new lower inode mtime (bindex=0, name=dpkg)
unionfs: new lower inode mtime (bindex=0, name=triggers)
Selecting previously deselected package dump.
(Reading database ... 8622 files and directories currently installed.)
Unpacking dump (from .../dump_0.4b43-1_powerpc.deb) ...
Processing triggers for man-db ...
fopen: Permission denied
Setting up dump (0.4b43-1) ...
update-alternatives: using /usr/sbin/rmt-dump to provide /usr/sbin/rmt (rmt) in auto mode.
root@squeeze:〜# ls -l /sbin/dump
-rwxr-xr-x 1 root root 190060 Jun 12  2010 /sbin/dump
root@squeeze:〜# 
(2) 別ホストに flashイメージ(ramファイルシステム)をバックアップ
root@tiger:RootGz# pwd                          [11] (11-06-01 Wed 14:13:37 PM)
/dsk/hda11/OBS600/RootGz/flash_2011_0601
# ssh obs600 '/sbin/dump 0usf 99999 - /dev/ram0' | bzip2 -c > ram0_2011_0601.dump.bz2
# ls -l ram0_2011_0601.dump.bz2
-rw-rw-r-- 1 root root 37483049 Jun  1 14:08 ram0_2011_0601.dump.bz2
(3) 念のため展開
# mkdir Root; cd Root
# bzip2 -dc ../ram0_2011_0601.dump.bz2 | restore rf -
root@tiger:Root# du -sh .; ls -F                [21] (11-06-01 Wed 14:17:28 PM)
116M    .
bin/   etc/   lost+found/  opt/             root/     srv/  usr/
boot/  home/  media/       proc/            sbin/     sys/  var/
dev/   lib/   mnt/         restoresymtable  selinux/  tmp/
root@tiger:Root#                                [22] (11-06-01 Wed 14:17:45 PM)
バックアップといいつつ、uImage.initrd.squeeze ユーザランドの解析研究用です。
--