(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年9月19日月曜日
obs600-12 DIPSW1_OFFの_cf_boot
いままで、DIPSW1_ONでPROMPTで停止し、手入力でbootmコマンドで起動させていました。もっといい方法があるような気もしますが、以下のようにしてbootm f8000000 を組み入れています。良く無い例かもしれません。が、メモとして残します。(1)〜(6)は事前調査です。
--
2011年6月21日火曜日
obs600-11 nfsrootマウント
U-Bootプロンプトさえ出てくれれば、ブートしなくなっても、uImage.initrd.squeezeのロードと起動であっさり回復は出来そうです。しかし、大きな変更をしたい時や、CFディスクを抜き差しせずに、バージョンの世代変更を確認したい時などは、NFS ルートファイルシステムで起動マウント出来ればそれなりに便利なことがありそうです。以下はnfsrootマウントを試した記録です。
--
(1) linux-2.6.36 の .config 変更
以下のように起動しました。冗長ですが、コンソールログです。
nfsroot指定の起動後、負荷をかけたテストとかはしていないので、問題があるかもしれません。今回参考になったのは、linux-2.6.36/Documentation/filesystems/nfs/nfsroot.txt や 3.4 NFS ルートファイルシステムに関する起動時引数 などです。・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" に変更。--
2011年6月19日日曜日
obs600-10 BUFFALOアダブタ
前回のPLANEX GW-US300MiniSはパソコンショップで最下段の棚で売れ残りのごとくスミにあったものを偶然見つけて、とてもラッキーに思いました。無線LANチップは何が動くか当たるも八卦当たらぬも八卦で、気が向いたものを買って試しています。現在は、BUFFALO製品が目に入り、そのうちで手に入れた以下を紹介します。
--
(1) 当方が手に入れたものの動作結果
※1 WLI-UC-G301NはLEDが点灯せず
※2 ソースコードにProduct IDの追加が必要でした。
※3 インターフェイスは出現するが、SSIDが検索リストに出現しない。
(2) 当方の環境での11g電波強度の測定 (単位dBm)
当方、木造2階の一軒家では、いずれのUSBアダプタも使用に支障はないようです。
現在11nは未テストです。11n動作は、将来の楽しみとしたいです。当面は主にWLI-UC-GNの11gモードで、ロングラン・エージングテストを行い、安定動作の確認を行おうと思います。| メーカ 型番 | 搭載チップ 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アダプタも使用に支障はないようです。
--
2011年6月18日土曜日
obs600-09 GW-US300MiniSでAP化
無線LAN USBアダプタをアクセスポイントにすることが、可能となっている方がいらっしゃるようなので、同じようにやってみました。
おおもとのネタは、http://wireless.kernel.org/ から頂きました。前回のDebian環境 kernel 2.6.36にて試しました。
--
おおもとのネタは、http://wireless.kernel.org/ から頂きました。前回のDebian環境 kernel 2.6.36にて試しました。
(1) make oldconfigでの表示
初めは、linux-2.6.36/ツリーにカブせて、make oldconfig しようとしました。「Support for 802.11n」 にて 11nサポートも始まりつつあるようです。しかし引き続きmakeすると、とてもうまくいきそうにないのでこれは断念します。
http://wireless.kernel.org/en/users/Download の目次にしたがってインストール処理します。入手したのは、2011-06-17日付です。
無事にhostapdで "handshake completed (WPA)"が出ており、deannaにWifi接続良好です。hostapd起動後6時間くらいスマホ3台接続して様子をみてますが、問題なくWifiネットワーク動作しています。さらに次は、手持ちの無線LANのUSBアダブタで他にも動作するものがあるか試してみたいです。初めは、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 tarballshttp://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になっています)--
2011年6月13日月曜日
obs600-08 Debianでmkimage
Debianで運用しだした時、kernelをアップデートするときだけ、ssd-linuxにしてkernelビルドするより、Debianのままでコンパイルするほうが、ドライバの動作テスト等にはスピーディで都合が良いので、ためしにDebianでkernelを2.6.36にしてみたいと思います。
細かい調整をしつつ、次回は、無線LANのAP化に挑戦したいです。
--
(1) ソースとパッチの入手
ただし、obs600.dtb と ramdisk.image-cfboot.gz はssd-linuxのものを持ってきます。
なんとなく、Debian環境で2.6.36 をビルドして、2.6.36_obs600 が起動しました。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 uImagessd-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
細かい調整をしつつ、次回は、無線LANのAP化に挑戦したいです。
--
obs600-07 bmake build
前回 obs600-06 USBメモリBoot に続いて、bmake buildをしてみます。
もとネタは、ぷらっとホームさんのページファームウェアの作成 をこの通りにやってみます。
--
もとネタは、ぷらっとホームさんのページファームウェアの作成 をこの通りにやってみます。
(1) BootさせるUSBメモリの準備 sysinst
SSD/Linux環境でビルド出来たので次は、Debian環境でのビルドを試みます。-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
--
2011年6月8日水曜日
obs600-06 USBメモリBoot
USBメモリにssd-linuxをインストールして、src.tgzのコンパイルビルドをしてみたいと思います。まずは準備編でUSBメモリBootしてみます。
用意したのは「そんな装備でだいじょうぶか」というような低価格なUSBメモリ8GB容量です。2つのUSBスロットのどちらに差しても同じ結果になると思います。今回は下側に挿しました。
もとネタは、ぷらっとホームさんのページセルフ開発環境構築 をこの通りにやってみます。
--
用意したのは「そんな装備でだいじょうぶか」というような低価格なUSBメモリ8GB容量です。2つのUSBスロットのどちらに差しても同じ結果になると思います。今回は下側に挿しました。
もとネタは、ぷらっとホームさんのページセルフ開発環境構築 をこの通りにやってみます。
(1) BootさせるUSBメモリの準備 sysinst
次は、ファームウェアの作成、Linuxカーネルのビルドを試みます。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: /
--
登録:
投稿 (Atom)
