2011年9月19日月曜日

obs600-12 DIPSW1_OFFの_cf_boot

いままで、DIPSW1_ONでPROMPTで停止し、手入力でbootmコマンドで起動させていました。もっといい方法があるような気もしますが、以下のようにしてbootm f8000000 を組み入れています。良く無い例かもしれません。が、メモとして残します。(1)〜(6)は事前調査です。
(1)bootcmd は _boot_sel
bootcmd=echo;echo Run Boot Selection Script;echo;run _boot_sel;

(2)_boot_sel は run _phase_1
_boot_sel=run _phase_1

(3)DIPSW1_OFF で _phase_2_1
_phase_1=if get_dip 1;then echo *** SW 1 IS OFF ***;echo;run _phase_2_1;else echo *** SW 1 IS ON ***;echo;
run _phase_2_2;fi

(4)_phase_2_1 DIPSW2_OFF で _phase_3
_phase_2_1=if get_dip 2;then echo *** SW 2 IS OFF ***;echo;run _phase_3;else echo *** SW 2 IS ON, DOWNLOAD
 STANDARD OS ***;echo;run os_load_prog;fi

(5)_phase_3 DIPSW3_ON で _cf_boot
_phase_3=run _initsw_sel;if get_dip 3;then echo *** SW 3 IS OFF, Standard Boot ***;echo;run ${_std_script};
else echo *** SW 3 IS ON, Boot from CF ***;echo;run _cf_boot;fi

(6)_cf_boot はこのように定義されている
_cf_boot=usb start;echo;echo Loading ...;${cf_fs}load usb ${usbdev} ${_kernel_addr_r} ${_cf_bootfile};
if test x$filesize = x ; then ${cf_fs}load usb ${usbdev} ${_kernel_addr_r} ${_cf_bootfile_alt}; fi;usb stop;
 run _cfargs _addtty _show_bootargs;bootm ${_kernel_addr_r}

(6)’_cf_boot を以下の一行に書き換える
_cf_boot=echo;echo NKBMobile_20110919 Booting...;echo; bootm ${_kernel_addr}

-------------------------------------------------------------------------
# 本当はU-Bootプロンプトで以下のように書き換えたかったのですが、
# 変数名_cf_bootのように'_'で始まると、どうもsetenvできませんでした。
=> setenv _cf_boot "bootm f8000000"
## Error: illegal character '_' in variable name head "_cf_boot"
=>
-------------------------------------------------------------------------

(7)タイムスタンプ2011/08/28 のflashcfgを使う
 #2011/03/09版では、-E,-Lオプションが使用できませんでした。
root@squeeze:Plathome# ls -l /usr/sbin/flashcfg.old /usr/sbin/flashcfg    
-r-xr-xr-x 1 root    root  22664 Aug 28 05:15 /usr/sbin/flashcfg
-r-xr-xr-x 1 root    root  6047 Mar  9  2011 /usr/sbin/flashcfg.old

(8)flashcfg -hの表示
root@squeeze:Plathome# /usr/sbin/flashcfg -h     [7] (11-09-19 Mon 21:07:14 PM)
usage: flashcfg                 Show this.
flashcfg -b              Show current boot setting
flashcfg -c rootdev      Change root file system [initrd|cf|sda-sdd[1-8]]
initrd       - Boot from FlashROM, / on Ramdisk
sda-sdd[1-8] - Boot from FlashROM, / on CF
cf           - Boot from CF,       / on CF
flashcfg -f boot_image   Load boot image to flash
flashcfg -s list_file    Save files to Parameter area
flashcfg -S list_file    Save files to User area
flashcfg -x              Restore files from Parameter area
flashcfg -X              Restore files from User area
flashcfg -d              Delete saved files from Parameter area
flashcfg -D              Delete saved files from User area
flashcfg -E env_file     Save params to U-Boot Environment area
flashcfg -L env_file     Load params from U-Boot Environment area
flashcfg -h              Show this.
root@squeeze:Plathome# 

(9)現在のU-Bootパラメータを読みこむ
root@squeeze:Plathome# /usr/sbin/flashcfg -L env_file
root@squeeze:Plathome#                          [10] (11-09-19 Mon 21:09:54 PM)
root@squeeze:Plathome# cp env_file env_file_20110919

(10) 前項(6)の値に57行目を置き替える
root@squeeze:Plathome# vi env_file_20110919     [11] (11-09-19 Mon 21:11:15 PM)
root@squeeze:Plathome# diff env_file env_file_20110919
57c57
< _cf_boot=usb start;echo;echo Loading ...;${cf_fs}load usb ${usbdev} ${_kernel_addr_r} ${_cf_bootfile};
if test x$filesize = x ; then ${cf_fs}load usb ${usbdev} ${_kernel_addr_r} ${_cf_bootfile_alt}; fi;usb stop;
 run _cfargs _addtty _show_bootargs;bootm ${_kernel_addr_r}
---
> _cf_boot=echo;echo NKBMobile_20110919 Booting...;echo; bootm ${_kernel_addr}
root@squeeze:Plathome#                     [ERROR:1] (11-09-19 Mon 21:13:02 PM)

(11) 置き換えた_cf_bootの内容を書き込む
root@squeeze:Plathome# /usr/sbin/flashcfg -E env_file_20110919
Change 1st U-Boot environment area
Change 2nd U-Boot environment area
root@squeeze:Plathome#                          [14] (11-09-19 Mon 21:14:06 PM)

(12) 正しく書き込めていることをベリファイする
root@squeeze:Plathome# mv env_file env_file_old
root@squeeze:Plathome# /usr/sbin/flashcfg -L env_file
root@squeeze:Plathome# diff env_file env_file_20110919
root@squeeze:Plathome# sed -n 57p env_file      [16] (11-09-19 Mon 21:17:23 PM)
_cf_boot=echo;echo NKBMobile_20110919 Booting...;echo; bootm ${_kernel_addr}
root@squeeze:Plathome#                          [17] (11-09-19 Mon 21:27:47 PM)

<<<<<<<<< DIPSW1 ON → OFF にして起動を確認します >>>>>>>>>
他DIPSWは、DIPSW2_OFF,DIPSW3_ON,DIPSW4_OFF になっています。

● DIPSW1_ON のときPROMPTで停止

Run Boot Selection Script

*** SW 1 IS ON ***

*** SW 2 IS OFF, ENTER COMMAND PROMPT ***

=> printenv _cf_boot
_cf_boot=echo;echo NKBMobile_20110919 Booting...;echo; bootm ${_kernel_addr}
=>

● DIPSW1_OFF のときPROMPTで停止せずBootする

Run Boot Selection Script

*** SW 1 IS OFF ***

*** SW 2 IS OFF ***

*** SW 3 IS ON, Boot from CF ***


NKBMobile_20110919 Booting...

## Booting kernel from Legacy Image at f8000000 ...
Image Name:   20110620_1941-sda1
Created:      2011-06-20  10:41:40 UTC
Image Type:   PowerPC Linux Multi-File Image (gzip compressed)
Data Size:    2617598 Bytes =  2.5 MB
Load Address: 00000000
Entry Point:  00000000
Contents:
Image 0: 2192626 Bytes =  2.1 MB
Image 1: 417113 Bytes = 407.3 kB
Image 2: 7838 Bytes =  7.7 kB
Verifying Checksum ... OK
## Loading init Ramdisk from multi component Legacy Image at f8000000 ...
## Flattened Device Tree from multi component Image at F8000000
Booting using the fdt at 0xf827d2a0
(以降省略)
--

2011年6月21日火曜日

obs600-11 nfsrootマウント

U-Bootプロンプトさえ出てくれれば、ブートしなくなっても、uImage.initrd.squeezeのロードと起動であっさり回復は出来そうです。しかし、大きな変更をしたい時や、CFディスクを抜き差しせずに、バージョンの世代変更を確認したい時などは、NFS ルートファイルシステムで起動マウント出来ればそれなりに便利なことがありそうです。以下はnfsrootマウントを試した記録です。

(1) linux-2.6.36 の .config 変更
・make menuconfig の変更箇所 (→部分)

 │    [*] Networking support  --->
 │    --- Networking support
 │          Networking options  --->
→│    [*]   IP: kernel level autoconfiguration
→│    [*]     IP: DHCP support (NEW)          
→│    [*]     IP: BOOTP support (NEW)         
→│    [*]     IP: RARP support (NEW)
 
 │    [*] Network File Systems  --->
 │    --- Network File Systems 
→│    <*>   NFS client support
→│    [*]     Root file system on NFS

→│    <*>   NFS server support                                         
  │    -*-     NFS server support for NFS version 3                     
  │    [*]       NFS server support for the NFSv3 ACL protocol extension
  │    [*]     NFS server support for NFS version 4 (EXPERIMENTAL)      

・.config の差分

root@squeeze:linux-2.6.36# diff .config_3 .config
4c4
< # Mon Jun 13 10:33:02 2011
---
> # Mon Jun 20 14:24:56 2011
364c364,367
< # CONFIG_IP_PNP is not set
---
> CONFIG_IP_PNP=y
> CONFIG_IP_PNP_DHCP=y
> CONFIG_IP_PNP_BOOTP=y
> CONFIG_IP_PNP_RARP=y
1704c1707
< CONFIG_NFS_FS=m
---
> CONFIG_NFS_FS=y
1708a1712
> CONFIG_ROOT_NFS=y
1711c1715
< CONFIG_NFSD=m
---
> CONFIG_NFSD=y
1716c1720
< CONFIG_LOCKD=m
---
> CONFIG_LOCKD=y
1718,1719c1722,1723
< CONFIG_EXPORTFS=m
< CONFIG_NFS_ACL_SUPPORT=m
---
> CONFIG_EXPORTFS=y
> CONFIG_NFS_ACL_SUPPORT=y
1721,1723c1725,1727
< CONFIG_SUNRPC=m
< CONFIG_SUNRPC_GSS=m
< CONFIG_RPCSEC_GSS_KRB5=m
---
> CONFIG_SUNRPC=y
> CONFIG_SUNRPC_GSS=y
> CONFIG_RPCSEC_GSS_KRB5=y
1941c1945
< CONFIG_CRYPTO_MD5=m
---
> CONFIG_CRYPTO_MD5=y
1963c1967
< CONFIG_CRYPTO_DES=m
---
> CONFIG_CRYPTO_DES=y
root@squeeze:linux-2.6.36#               [ERROR:1] (11-06-20 Mon 14:26:20 PM)

このあと、 make uImage; make modules; make modules_install

UIMG=uImage.36_$(date +'%Y%m%d')
mkimage -n "$(date +'%Y%m%d_%H%M')-sda1" -A ppc -O linux -T multi -C gzip ¥
-d vmlinux.bin.gz:ramdisk.image-cfboot.gz:obs600.dtb ${UIMG}

にて、
-rw-r--r-- 1 root root 2617662 Jun 20 19:41 uImage.36_20110620
ができあがりました。これを、
/usr/sbin/flashcfg -f uImage.36_20110620 しました。
(2) nfsroot 指定による起動
以下のように起動しました。冗長ですが、コンソールログです。
U-Boot 2009.01-ph20100607-01 (Jun 07 2010 - 18:10:57)

CPU:   AMCC PowerPC 405EX Rev. D at 400 MHz (PLB=200, OPB=100, EBC=100 MHz)
       Security support
       Bootstrap Option C - Boot ROM Location EBC (16 bits)
       16 kB I-Cache 16 kB D-Cache
Board: OBS600 - Plat'Home OBS600 Board
I2C:   ready
DRAM:   1 GB
FLASH: 128 MB
Net:   ppc_4xx_eth0, ppc_4xx_eth1
*** SW 4 IS OFF, CPU Clock TO 600MHZ ***

*** WILL RESET CHIP TO TAKE EFFECT ***

U-Boot 2009.01-ph20100607-01 (Jun 07 2010 - 18:10:57)

CPU:   AMCC PowerPC 405EX Rev. D at 600 MHz (PLB=200, OPB=100, EBC=100 MHz)
       Security support
       Bootstrap Option C - Boot ROM Location EBC (16 bits)
       16 kB I-Cache 16 kB D-Cache
Board: OBS600 - Plat'Home OBS600 Board
I2C:   ready
DRAM:   1 GB
FLASH: 128 MB
Net:   ppc_4xx_eth0, ppc_4xx_eth1
*** SW 4 IS OFF, CPU Clock TO 600MHZ ***

Display the current time of RTC by UTC.
Date: 2011-06-21 (Tuesday)    Time:  5:54:17

Hit any key to stop autoboot:  0 

Run Boot Selection Script

*** SW 1 IS ON ***

*** SW 2 IS OFF, ENTER COMMAND PROMPT ***

=> setenv bootargs console=ttyS0,115200 root=/dev/nfs rw ¥
nfsroot=192.168.1.70:/mnt/share/OBS600/Debian/nfs_squeeze ip=dhcp; bootm 0xf8000000
## Booting kernel from Legacy Image at f8000000 ...
   Image Name:   20110620_1941-sda1
   Created:      2011-06-20  10:41:40 UTC
   Image Type:   PowerPC Linux Multi-File Image (gzip compressed)
   Data Size:    2617598 Bytes =  2.5 MB
   Load Address: 00000000
   Entry Point:  00000000
   Contents:
      Image 0: 2192626 Bytes =  2.1 MB
      Image 1: 417113 Bytes = 407.3 kB
      Image 2: 7838 Bytes =  7.7 kB
   Verifying Checksum ... OK
## Loading init Ramdisk from multi component Legacy Image at f8000000 ...
## Flattened Device Tree from multi component Image at F8000000
   Booting using the fdt at 0xf827d2a0
   Uncompressing Multi-File Image ... OK
   Loading Ramdisk to 0fdfe000, end 0fe63d59 ... OK
   Loading Device Tree to 007fb000, end 007ffe9d ... OK
Using OpenBlockS 600 machine description
Linux version 2.6.36_obs600 (root@squeeze) (gcc version 4.4.5 (Debian 4.4.5-8) ) ¥
#5 Mon Jun 20 18:01:14 JST 2011
Found initrd at 0xcfdfe000:0xcfe63d59
Zone PFN ranges:
  DMA      0x00000000 -> 0x00020000
  Normal   empty
  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: console=ttyS0,115200 root=/dev/nfs rw ¥
nfsroot=192.168.1.70:/mnt/share/OBS600/Debian/nfs_squeeze ip=dhcp
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 1034648k/1048576k available (4540k kernel code, 13928k reserved, ¥
180k data, 146k bss, 164k init)
Kernel virtual memory layout:
  * 0xfffcf000..0xfffff000  : fixmap
  * 0xff800000..0xffc00000  : highmem PTEs
  * 0xff600000..0xff800000  : consistent mem
  * 0xff5fe000..0xff600000  : early ioremap
  * 0xe1000000..0xff5fe000  : vmalloc & ioremap
Hierarchical RCU implementation.
 RCU-based detection of stalled CPUs is disabled.
 Verbose stalled-CPUs detection is disabled.
NR_IRQS:512
UIC0 (32 IRQ sources) at DCR 0xc0
UIC1 (32 IRQ sources) at DCR 0xd0
UIC2 (32 IRQ sources) at DCR 0xe0
clocksource: timebase mult[6aaaab] shift[22] registered
Console: colour dummy device 80x25
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
devtmpfs: initialized
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switching to clocksource timebase
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
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Trying to unpack rootfs image as initramfs...
rootfs image is not initramfs (no cpio magic); looks like an initrd
Freeing initrd memory: 407k freed
audit: initializing netlink socket (disabled)
type=2000 audit(0.128:1): initialized
highmem bounce pool size: 64 pages
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
msgmni has been set to 997
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
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 U6_16550A
console [ttyS0] enabled
serial8250.0: ttyS1 at MMIO 0xef600300 (irq = 16) is a U6_16550A
brd: module loaded
f8000000.nor_flash: Found 1 x16 devices at 0x0 in 16-bit bank. ¥
Manufacturer ID 0x000001 Chip ID 0x002801
Amd/Fujitsu Extended Query Table at 0x0040
  Amd/Fujitsu Extended Query version 1.3.
number of CFI chips: 1
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"
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-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-1 /plb/opb/ethernet@ef600a00, MAC 00:0a:85:04:99:9e
eth1: found Generic MII PHY (0x03)
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
dwc_otg: version 1.05
Using DMA mode
of:dwc_otg ef6c0000.usbotg: DWC OTG Controller
of:dwc_otg ef6c0000.usbotg: new USB bus registered, assigned bus number 1
of:dwc_otg ef6c0000.usbotg: irq 33, io mem 0x00000000
Init: Port Power? op_state=a_host
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.36_obs600 dwc_otg_hcd
usb usb1: SerialNumber: dwc_otg_hcd
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
of:ibm-iic ef600400.i2c: using standard (100 kHz) mode
rtc-ds1307 0-0068: rtc core: registered ds1340 as rtc0
of:ibm-iic ef600500.i2c: using standard (100 kHz) mode
Netfilter messages via NETLINK v0.30.
NET: Registered protocol family 17
Registering the dns_resolver key type
registered taskstats version 1
rtc-ds1307 0-0068: setting system clock to 2011-06-21 05:54:49 UTC (1308635689)
 ++OTG Interrupt: Debounce Done++
usb 1-1: new high speed USB device using of:dwc_otg and address 2
eth0: link is down
eth1: link is down
usb 1-1: New USB device found, idVendor=0424, idProduct=2514
usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
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 of: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-storage 1-1.1:1.0: Quirks match for vid 05e3 pid 0702: 520
scsi0 : usb-storage 1-1.1:1.0
eth0: link is up, 100 FDX, pause enabled
Sending DHCP requests ., OK
IP-Config: Got DHCP answer from 0.0.0.0, my address is 192.168.1.29
IP-Config: Complete:
     device=eth0, addr=192.168.1.29, mask=255.255.255.0, gw=192.168.1.28,
     host=192.168.1.29, domain=gjs.or.jp, nis-domain=(none),
     bootserver=0.0.0.0, rootserver=192.168.1.70, rootpath=
RAMDISK: gzip image found at block 0
VFS: Mounted root (ext2 filesystem) on device 1:0.
Setting real-root-dev to nfs.
Looking up port of RPC 100003/2 on 192.168.1.70
Looking up port of RPC 100005/1 on 192.168.1.70
VFS: Mounted root (nfs filesystem) on device 0:15.
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: 164k init
scsi 0:0:0:0: Direct-Access     SanDisk  SDCFH-004G       0014 PQ: 0 ANSI: 0
sd 0:0:0:0: [sda] 7813120 512-byte logical blocks: (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] Assuming drive cache: write through
 sda: sda1 sda2
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Attached SCSI disk
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...done.
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.
Cleaning up temporary files....
Setting kernel variables ...done.
INIT: Entering runlevel: 2
Using makefile-style concurrent boot in runlevel 2.
Starting portmap daemon...Already running..
Starting NFS common utilities: statd.
Starting enhanced syslogd: rsyslogd.
Starting periodic command scheduler: cron.
Starting internet superserver: inetd.
Starting OpenBSD Secure Shell server: sshdNET: Registered protocol family 10
lo: Disabled Privacy Extensions

Debian GNU/Linux 6.0 squeeze ttyS0

squeeze login: root
Password: 
Last login: Tue Jun 21 14:46:10 JST 2011 on ttyS0
Linux squeeze 2.6.36_obs600 #5 Mon Jun 20 18:01:14 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:‾# 
root@squeeze:‾# df
Filesystem           1K-blocks      Used Available Use% Mounted on
192.168.1.70:/       112877656  90367260  16776540  85% /
tmpfs                   517608         0    517608   0% /lib/init/rw
udev                     10240        64     10176   1% /dev
tmpfs                   517608         4    517604   1% /dev/shm

root@squeeze:‾# mount   (NFSルートマウントになっています)
192.168.1.70:/ on / type nfs (rw,vers=4,addr=192.168.1.70,clientaddr=192.168.1.29)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
root@squeeze:‾# 
root@squeeze:‾# fdisk -l  (CFディスクも見えています)

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         892     3596512   83  Linux
/dev/sda2             893         968      302400   82  Linux swap
root@squeeze:‾# 
                (母艦側は 玄箱 KURO-BOX[100BASE-TX版]です。)
root@squeeze:‾# ssh 192.168.1.70 uname -a|nkf -w
root@192.168.1.70's password: 
Linux kuro 2.4.17_mvl21 #24 2004年 10月 19日 火曜日 17:17:03 JST ppc GNU/Linux
root@squeeze:‾# 

(bootargsのip=の書式)
ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>
ここでは、ip=dhcp としましたが、
ip=192.168.1.29:192.168.1.70:192.168.1.28:255.255.255.0:::off
とかでもよさそうです。
(母艦側の準備)
rsync -ax / 192.168.1.70:/mnt/share/OBS600/Debian/nfs_squeeze
CFディスクを、まるごと母艦側にコピーしました。
一箇所 etc/fstab は "192.168.1.70:/ / nfs defaults 0 0" に変更。
nfsroot指定の起動後、負荷をかけたテストとかはしていないので、問題があるかもしれません。今回参考になったのは、linux-2.6.36/Documentation/filesystems/nfs/nfsroot.txt や 3.4 NFS ルートファイルシステムに関する起動時引数 などです。
--

2011年6月19日日曜日

obs600-10 BUFFALOアダブタ

前回のPLANEX GW-US300MiniSはパソコンショップで最下段の棚で売れ残りのごとくスミにあったものを偶然見つけて、とてもラッキーに思いました。無線LANチップは何が動くか当たるも八卦当たらぬも八卦で、気が向いたものを買って試しています。現在は、BUFFALO製品が目に入り、そのうちで手に入れた以下を紹介します。

(1) 当方が手に入れたものの動作結果

メーカ
型番
搭載チップ
Vendor:Product
通信
結果
コメント
PLANEX
GW-US300MiniS
rt2870
2019:ab24
11b/g
問題なし
BUFFALO
WLI-UC-GN
rt2870
0411:015d
11b/g
問題なし
BUFFALO
WLI-UC-G301N
rt2870
0411:016f
11b/g
問題なし※1
BUFFALO
WLI-UC-GNT
rt2870
0411:014f
問題あり
※2
BUFFALO
WLI-UC-GNM
rt2870
0411:01a2
×問題あり
※3

※1 WLI-UC-G301NはLEDが点灯せず

※2 ソースコードにProduct IDの追加が必要でした。
# diff drivers/net/wireless/rt2x00/rt2800usb.c.org drivers/net/wireless/rt2x00/rt2800usb.c
1121a1122
>       { USB_DEVICE(0x0411, 0x014f) },
さらに、自動でbrctl addif br0 wlanXが追加されない。

※3 インターフェイスは出現するが、SSIDが検索リストに出現しない。
# ifconfig wlan0
wlan0     IEEE 802.11bgn  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on
・MacAddressが変。
wlan0     Link encap:Ethernet  HWaddr 42:76:e6:4c:00:00  

(2) 当方の環境での11g電波強度の測定 (単位dBm)

メーカ
型番
同室の
電波強度
2F,1F間の
電波強度
PLANEX
GW-US300MiniS
-54-72
BUFFALO
WLI-UC-GN
-41-58
BUFFALO
WLI-UC-G301N
-40-55
BUFFALO
WLI-UC-GNT
-43-61
La Fonera
FON2100E(参考)
-41-56

当方、木造2階の一軒家では、いずれのUSBアダプタも使用に支障はないようです。
現在11nは未テストです。11n動作は、将来の楽しみとしたいです。当面は主にWLI-UC-GNの11gモードで、ロングラン・エージングテストを行い、安定動作の確認を行おうと思います。
--

2011年6月18日土曜日

obs600-09 GW-US300MiniSでAP化

無線LAN USBアダプタをアクセスポイントにすることが、可能となっている方がいらっしゃるようなので、同じようにやってみました。

おおもとのネタは、http://wireless.kernel.org/ から頂きました。前回のDebian環境 kernel 2.6.36にて試しました。

(1) make oldconfigでの表示
初めは、linux-2.6.36/ツリーにカブせて、make oldconfig しようとしました。「Support for 802.11n」 にて 11nサポートも始まりつつあるようです。しかし引き続きmakeすると、とてもうまくいきそうにないのでこれは断念します。
*
* Wireless LAN
*
Wireless LAN (WLAN) [Y/n/?] y
  Marvell 8xxx Libertas WLAN driver support with thin firmware (LIBERTAS_THINFIRM) [M/n/?] m
    Enable full debugging output in the Libertas thin firmware module. (LIBERTAS_THINFIRM_DEBUG) [N/y/?] n
    Marvell Libertas 8388 USB 802.11b/g cards with thin firmware (LIBERTAS_THINFIRM_USB) [M/n/?] m
  Atmel at76c503/at76c505/at76c505a USB cards (AT76C50X_USB) [N/m/?] n
  USB ZD1201 based Wireless device support (USB_ZD1201) [M/n/y/?] m
  Wireless RNDIS USB support (USB_NET_RNDIS_WLAN) [M/n/?] m
  Realtek 8187 and 8187B USB support (RTL8187) [M/n/?] m
  Simulated radio testing tool for mac80211 (MAC80211_HWSIM) [M/n/?] m
  *
  * Atheros Wireless Cards
  *
  Atheros Wireless Cards (ATH_COMMON) [N/m/?] n
  Broadcom 43xx wireless support (mac80211 stack) (B43) [M/n/?] m
    Support for 802.11n (N-PHY) devices (EXPERIMENTAL) (B43_PHY_N) [N/y/?] (NEW) 
    Support for low-power (LP-PHY) devices (EXPERIMENTAL) (B43_PHY_LP) [Y/n/?] y
    Broadcom 43xx debugging (B43_DEBUG) [N/y/?] n
  Broadcom 43xx-legacy wireless support (mac80211 stack) (B43LEGACY) [M/n/?] m
    Broadcom 43xx-legacy debugging (B43LEGACY_DEBUG) [Y/n/?] y
    Broadcom 43xx-legacy data transfer mode
    > 1. DMA + PIO (B43LEGACY_DMA_AND_PIO_MODE)
      2. DMA (Direct Memory Access) only (B43LEGACY_DMA_MODE)
      3. PIO (Programmed I/O) only (B43LEGACY_PIO_MODE)
    choice[1-3]: 1
  IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP) (HOSTAP) [M/n/y/?] m
    Support downloading firmware images with Host AP driver (HOSTAP_FIRMWARE) [Y/n/?] y
      Support for non-volatile firmware download (HOSTAP_FIRMWARE_NVRAM) [Y/n/?] y
  Marvell 8xxx Libertas WLAN driver support (LIBERTAS) [M/n/?] m
    Marvell Libertas 8388 USB 802.11b/g cards (LIBERTAS_USB) [M/n/?] m
    Enable full debugging output in the Libertas module. (LIBERTAS_DEBUG) [Y/n/?] y
    Enable mesh support (LIBERTAS_MESH) [Y/n/?] y
  Softmac Prism54 support (P54_COMMON) [M/n/?] m
    Prism54 USB support (P54_USB) [M/n/?] m
  *
  * Ralink driver support
  *
  Ralink driver support (RT2X00) [M/n/?] m
    Ralink rt2500 (USB) support (RT2500USB) [M/n/?] m
    Ralink rt2501/rt73 (USB) support (RT73USB) [M/n/?] m
    Ralink rt27xx/rt28xx/rt30xx (USB) support (RT2800USB) [M/n/?] m
      rt2800usb - Include support for rt33xx devices (RT2800USB_RT33XX) [Y/n/?] (NEW) 
      rt2800usb - Include support for rt35xx devices (EXPERIMENTAL) (RT2800USB_RT35XX) [Y/n/?] y
      rt2800usb - Include support for rt53xx devices (EXPERIMENTAL) (RT2800USB_RT53XX) [N/y/?] (NEW) 
         rt2800usb - Include support for unknown (USB) devices (RT2800USB_UNKNOWN) [Y/n/?] y
    Ralink debug output (RT2X00_DEBUG) [N/y/?] n
  *
  * TI wl12xx driver support
  *
  TI wl12xx driver support (WL12XX_MENU) [N/m/?] (NEW)
   ZyDAS ZD1211/ZD1211B USB-wireless support (ZD1211RW) [M/n/?] m
    ZyDAS ZD1211 debugging (ZD1211RW_DEBUG) [N/y/?] n
#
# configuration written to .config
#
(2) Archive of compat-wireless-2.6 tarballs
http://wireless.kernel.org/en/users/Download の目次にしたがってインストール処理します。入手したのは、2011-06-17日付です。
root@squeeze:src# wget http://wireless.kernel.org/download/compat-wireless-2.6/compat-wireless-2011-06-17.tar.bz2
root@squeeze:src# tar jxf compat-wireless-2011-06-17.tar.bz2
root@squeeze:src# cd compat-wireless-2011-06-17
root@squeeze:compat-wireless-2011-06-17# ./scripts/driver-select rt2x00
root@squeeze:compat-wireless-2011-06-17# make
root@squeeze:compat-wireless-2011-06-17# make install
# find /lib/modules/2.6.36_obs600/ -name '*.ko.gz'|xargs gunzip
# ls -l /lib/modules/2.6.36_obs600/updates/drivers/net/wireless/rt2x00
total 228
-rw-r--r-- 1 root root 28300 Jun 18 18:02 rt2500usb.ko
-rw-r--r-- 1 root root 51130 Jun 18 18:02 rt2800lib.ko
-rw-r--r-- 1 root root 38947 Jun 18 18:02 rt2800usb.ko
-rw-r--r-- 1 root root 47986 Jun 18 18:02 rt2x00lib.ko
-rw-r--r-- 1 root root 15963 Jun 18 18:02 rt2x00usb.ko
-rw-r--r-- 1 root root 37897 Jun 18 18:02 rt73usb.ko

モジュールは出来ているようです。
(3) GW-US300MiniS をUSBポートに挿す
% lsusb 
Bus 001 Device 005: ID 2019:ab24 PLANEX GW-US300MiniS

usb 1-1.2: new high speed USB device using of:dwc_otg and address 5
usb 1-1.2: New USB device found, idVendor=2019, idProduct=ab24
usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.2: Product: 802.11 n WLAN
usb 1-1.2: Manufacturer: Ralink
usb 1-1.2: SerialNumber: 1.0
Compat-wireless backport release: compat-wireless-2011-06-14
Backport based on linux-next.git next-20110617
cfg80211: Calling CRDA to update world regulatory domain
usbcore: registered new interface driver rt2800usb
udev[1474]: renamed network interface wlan0 to wlan6

# lsmod
Module                  Size  Used by
arc4                     986  2 
rt2800usb              13129  0 
rt2800lib              42724  1 rt2800usb
rt2x00usb               9701  1 rt2800usb
rt2x00lib              34399  3 rt2800usb,rt2800lib,rt2x00usb
mac80211              225540  3 rt2800lib,rt2x00usb,rt2x00lib
cfg80211              163672  2 rt2x00lib,mac80211
compat                  5755  2 mac80211,cfg80211
ipv6                  295073  10 

# iwconfig wlan6
wlan6     IEEE 802.11bgn  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on
          
# ifconfig wlan6
wlan6     Link encap:Ethernet  HWaddr 00:22:cf:YY:YY:YY  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
(4) RT2870ファームウェア
http://www.ralinktech.com/ の
Firmware RT28XX/RT30XX USB series (RT2870/RT2770/RT3572/RT3070)
 で
# ls -l /lib/firmware/rt2870.bin
-rw-r--r-- 1 root root 8192 Dec 28  2009 /lib/firmware/rt2870.bin
にコピーしました。
(5) hostapdの起動
# egrep -v '^#|^$' /etc/hostapd/hostapd.conf6
interface=wlan6
bridge=br0
driver=nl80211
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
dump_file=/tmp/hostapd.dump
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
ssid=deanna
hw_mode=g
channel=6
beacon_int=100
dtim_period=2
max_num_sta=255
rts_threshold=2347
fragm_threshold=2346
macaddr_acl=0
auth_algs=3
ignore_broadcast_ssid=0
wme_enabled=1
wme_ac_bk_cwmin=4
wme_ac_bk_cwmax=10
wme_ac_bk_aifs=7
wme_ac_bk_txop_limit=0
wme_ac_bk_acm=0
wme_ac_be_aifs=3
wme_ac_be_cwmin=4
wme_ac_be_cwmax=10
wme_ac_be_txop_limit=0
wme_ac_be_acm=0
wme_ac_vi_aifs=2
wme_ac_vi_cwmin=3
wme_ac_vi_cwmax=4
wme_ac_vi_txop_limit=94
wme_ac_vi_acm=0
wme_ac_vo_aifs=2
wme_ac_vo_cwmin=2
wme_ac_vo_cwmax=3
wme_ac_vo_txop_limit=47
wme_ac_vo_acm=0
ieee8021x=0
eapol_key_index_workaround=0
eap_server=0
own_ip_addr=127.0.0.1
wpa=1
wpa_passphrase=aaaaqqqq
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
# 

# brctl addbr br0        (ブリッジ設定)
# brctl addif br0 eth0   (wlan6はhostapdが追加してくれる)

# ./hostapd -v (http://hostap.epitest.fi/releases/hostapd-0.7.3.tar.gz)
hostapd v0.7.3
# ./hostapd /etc/hostapd/hostapd.conf6 (hostapdの起動)
Configuration file: /etc/hostapd/hostapd.conf6
Using interface wlan6 with hwaddr 00:22:cf:YY:YY:YY and ssid 'deanna'

wlan6: STA 5c:59:48:XX:XX:XX IEEE 802.11: authenticated
wlan6: STA 5c:59:48:XX:XX:XX IEEE 802.11: associated (aid 1)
AP-STA-CONNECTED 5c:59:48:XX:XX:XX
wlan6: STA 5c:59:48:XX:XX:XX RADIUS: starting accounting session 4DFC7383-00000000
wlan6: STA 5c:59:48:XX:XX:XX WPA: pairwise key handshake completed (WPA)
wlan6: STA 5c:59:48:XX:XX:XX WPA: group key handshake completed (WPA)

(DHCPサーバ側の/var/log/syslog DHCP IPアドレス配布OK)
Jun 18 22:41:14 oms dhcpd: uid lease 192.168.1.234 for client 5c:59:48:XX:XX:XX is duplicate on 192.168.1/24
Jun 18 22:41:14 oms dhcpd: DHCPDISCOVER from 5c:59:48:XX:XX:XX via br0
Jun 18 22:41:14 oms dhcpd: DHCPOFFER on 192.168.1.46 to 5c:59:48:XX:XX:XX via br0
Jun 18 22:41:15 oms dhcpd: uid lease 192.168.1.234 for client 5c:59:48:XX:XX:XX is duplicate on 192.168.1/24
Jun 18 22:41:15 oms dhcpd: DHCPREQUEST for 192.168.1.46 (192.168.1.28) from 5c:59:48:XX:XX:XX via br0
Jun 18 22:41:15 oms dhcpd: DHCPACK on 192.168.1.46 to 5c:59:48:XX:XX:XX via br0

(hostapd起動後は)
# iwconfig wlan6
wlan6     IEEE 802.11bgn  Mode:Master  Frequency:2.437 GHz  Tx-Power=20 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
(Mode:Masterになっています)
無事にhostapdで "handshake completed (WPA)"が出ており、deannaにWifi接続良好です。hostapd起動後6時間くらいスマホ3台接続して様子をみてますが、問題なくWifiネットワーク動作しています。さらに次は、手持ちの無線LANのUSBアダブタで他にも動作するものがあるか試してみたいです。
--

2011年6月13日月曜日

obs600-08 Debianでmkimage

Debianで運用しだした時、kernelをアップデートするときだけ、ssd-linuxにしてkernelビルドするより、Debianのままでコンパイルするほうが、ドライバの動作テスト等にはスピーディで都合が良いので、ためしにDebianでkernelを2.6.36にしてみたいと思います。

(1) ソースとパッチの入手
http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.36.tar.bz2
http://www.kernel.org/pub/linux/kernel/v2.6/patch-2.6.36.4.bz2
http://download.filesystems.org/unionfs/unionfs-2.x/unionfs-2.5.8_for_2.6.36.4.diff.gz

http://ftp.plathome.co.jp/pub/ssdlinux/0.5-LATEST/source/src.tgz
-rw-rw-r-- 1 root wheel  8761531 Apr 15 01:24 src.tgz
#src.tgzから
/usr/src/mkdist/kernel/2.6.36/patches
-rw-r--r-- 1 root root      0 Oct 28  2010 Makefile.patch
-rw-r--r-- 1 root root  22277 Oct 28  2010 arch_powerpc.patch
-rw-r--r-- 1 root root   6852 Oct 28  2010 drivers_char.patch
-rw-r--r-- 1 root root    477 Oct 28  2010 drivers_net.patch
-rw-r--r-- 1 root root    543 Oct 28  2010 drivers_serial.patch
-rw-r--r-- 1 root root 494645 Oct 28  2010 drivers_usb.patch
-rw-r--r-- 1 root root    678 Oct 28  2010 include_asm_generic.patch
-rw-r--r-- 1 root root   3702 Oct 28  2010 include_linux.patch
-rw-r--r-- 1 root root   6493 Oct 28  2010 init.patch
-rw-r--r-- 1 root root   1390 Oct 28  2010 kernel.patch
-rw-r--r-- 1 root root    563 Mar 31 16:32 scripts.patch
(2) patchあて
#手でひとつずつpatchあては面倒なのでスクリプトを用意

root@squeeze:src# cat /usr/src/my_2636_patch.sh
#! /bin/bash
# cd /usr/src
# tar jxf /usr/src/dist/distfiles/linux-2.6.36.tar.bz2
# cd linux-2.6.36
# ../my_2636_patch.sh 2>&1 | tee my_2636_patch.log
MYCWD=`pwd`
if [ "/usr/src/linux-2.6.36" != "${MYCWD}" ]; then
  echo "Must be /usr/src/linux-2.6.36 (Now=${MYCWD})"
  exit 0
fi
date
KPATCH=/usr/src/dist/distfiles/patch-2.6.36.4.bz2
if [ ! -f ${KPATCH} ]; then
  echo "Not Found ${KPATCH}"
  exit 0
fi

echo "(0) bzip2 -dc ${KPATCH} | patch -p1"
bzip2 -dc ${KPATCH} | patch -p1

SPDIR=/usr/src/mkdist/kernel/2.6.36/patches
if [ ! -d ${SPDIR} ]; then
  echo "Not Found DIR ${SPDIR}"
  exit 0
fi

echo "OBS600 Patch START."
CUR=1
while read file
do
  ppath="${SPDIR}/${file}"
  echo -n "($CUR) cat ${ppath} | patch -p1"
  cat ${ppath} | patch -p1
  CUR=`expr $CUR + 1`
  echo ""
done <<EOF
arch_powerpc.patch
drivers_char.patch
drivers_net.patch
drivers_serial.patch
drivers_usb.patch
include_asm_generic.patch
include_linux.patch
init.patch
kernel.patch
scripts.patch
EOF
echo ""
date
exit 0
(3) make uImage
ssd-linux[10]# pwd
/usr/src/linux-2.6.36
ssd-linux[11]# cp -p /usr/src/mkdist/kernel/2.6.36/dot.config.powerpc-obs600.ipv6 .config
# diff Makefile.org Makefile    
4c4
< EXTRAVERSION = .4
---
> EXTRAVERSION = _obs600
ssd-linux[12]# make oldconfig
ssd-linux[13]# make uImage
ssd-linux[14]# make modules
ssd-linux[15]# make modules_install
ssd-linux[16]# 
(4) Debianで mkimage して uImage.initrd を作る
ただし、obs600.dtb と ramdisk.image-cfboot.gz はssd-linuxのものを持ってきます。
cp -p /dsk/sdb1/usr/src/distrib/powerpc-obs600/dtb/obs600.dtb /usr/src/linux-2.6.36
cp -p /dsk/sdb1/usr/src/distrib/powerpc-obs600/cfboot/initrd/ramdisk.image-cfboot.gz /usr/src/linux-2.6.36

# dpkg -S /usr/bin/mkimage
u-boot: /usr/bin/mkimage

# cd /usr/src/linux-2.6.36
# mkimage -n 20110613_1047-sda1 -A ppc -O linux -T multi -C gzip -d vmlinux.bin.gz:ramdisk.image-cfboot.gz:obs600.dtb uImage.36_20110613
Image Name:   20110613_1047-sda1
Created:      Mon Jun 13 10:47:09 2011
Image Type:   PowerPC Linux Multi-File Image (gzip compressed)
Data Size:    2264402 Bytes = 2211.33 kB = 2.16 MB
Load Address: 00000000
Entry Point:  00000000
Contents:
   Image 0: 1839432 Bytes = 1796.32 kB = 1.75 MB
   Image 1: 417113 Bytes = 407.34 kB = 0.40 MB
   Image 2: 7838 Bytes = 7.65 kB = 0.01 MB

新しい uImage.initrd で起動してみる

=> tftpboot 0x400000 192.168.1.70:uImage.36_20110613
=> bootm 0x400000
## Booting kernel from Legacy Image at 00400000 ...
   Image Name:   20110613_1047-sda1
   Created:      2011-06-13   1:47:09 UTC

root@squeeze:〜# uname -a
Linux squeeze 2.6.36_obs600 #3 Mon Jun 13 10:35:47 JST 2011 ppc GNU/Linux
なんとなく、Debian環境で2.6.36 をビルドして、2.6.36_obs600 が起動しました。
細かい調整をしつつ、次回は、無線LANのAP化に挑戦したいです。
--

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 ユーザランドの解析研究用です。
--

2011年5月30日月曜日

iPhone実機RUNでエラー(証明書期限切れ)

Xcode4で実機デバッグしようと、iPhoneをつないでRUNすると次のエラーになりました。

A valid provisioning profile for this executable was not found.

! Check dependencies
! CodeSign error: Certificate identity 'iPhone Developer: NNNNN MMMMM (999X9XX9XX)' appears more than once in the keychain. The codesign tool requires there only be one.

Build failed 1 error

昨日までは動いてくれていたのに、いつも色々いじっているのでどこが影響したか少し悩みました。

結論は、Developer 証明書の期限切れでした。エラーを解消するには、developer.apple.comの

iOS Developer Program(右) の iOS Provisioning Portal >
Home(左) の [Certificates] の
Development タブで、Your Certificateの有効行 を [Download]します。
このダウロードした developer_identity.cer をダブルクリックして、
キーチェーンアクセスを開いて証明書の登録をします。

期限切れ 2011年5月28日 'iPhone Developer: NNNNN MMMMM (999X9XX9XX)' は削除。
登録した 2012年5月28日 'iPhone Developer: NNNNN MMMMM (999X9XX9XX)' の行があることを確認します。

ここで、Distribution 証明書も有効期限が迫っているので、近々更新するのを忘れないようにしたいです。

※関連する証明書
Apple Worldwide Developer Relations Certification Authority
iPhone Developer: NNNNN MMMMM
iPhone Distribution: NNNNN MMMMM