玄箱 PRO #2

multi-user modeで起動するまでを、備忘録としてまとめる。全面的に書き直し。

host(192.168.0.19)での作業

% su -
# cd /usr/src
# setenv DESTDIR /nfsroot/arm-8-le
# mkdir -p $DESTDIR
# make -j 4 buildworld TARGET_ARCH=arm
# make installworld TARGET_ARCH=arm
# make distrib-dirs TARGET_ARCH=arm
# make distribution TARGET_ARCH=arm
  • kernelを作る
# make buildkernel TARGET_ARCH=arm KERNCONF=DB-88F5XXX
  • kernel.binを、hostの/tftproot/mv5281/にコピー
# cp /usr/obj/arm/usr/src/sys/DB-88F5XXX/kernel.bin /tftproot/mv5281/
  • hostマシンのtftp、dhcpを設定する

玄箱PROを起動してsingle-user modeで起動するか確認

玄箱PROを起動して、U-Bootのプロンプトに落とす。

Orion1   CPU =  Low

=== KURO U-Boot. ===
 ** LOADER **
 ** KUROBOX BOARD: KURO_BOX  LE (CFG_ENV_ADDR=fffff000)


U-Boot 1.1.1 (Apr 10 2007 - 18:10:08) Marvell version: 1.12.1 - TINY

DRAM CS[0] base 0x00000000   size 128MB
DRAM Total size 128MB
[256kB@fffc0000] Flash: 256 kB
Addresses 20M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (20M - 16M): Done
NAND: 256 MB

Soc: 88F5182 A2
CPU: ARM926 (Rev 0) running @ 500Mhz
Orion 1 streaming disabled
SysClock = 250Mhz , TClock = 166Mhz


USB 0: host mode
USB 1: host mode
PCI 0: PCI Express Root Complex Interface
PCI 1: Conventional PCI, speed = 33000000
Net:   egiga0 [PRIME]
Using 88E1118 phy
Found boot image
hit any key to switch tftp boot.
Hit any key to stop autoboot:  0  <-- ここでは何も押さない
<<system_bootend>>
Hit any key to stop autoboot:  0  <-- ここでキーを押す
Marvell>> 

一つ前で、キーを押すと、ピーピー音が出る。その場合には、スイッチを長押しすることで、音だけ消すことはできる。

Marvell>> setenv ipaddr 192.168.0.35          <-- 玄箱のIPアドレス
Marvell>> setenv serverip 192.168.0.19        <-- hostのIPアドレス
Marvell>> tftpboot 400000 mv5281/kernel.bin
Using egiga0 device
TFTP from server 192.168.0.19; our IP address is 192.168.0.35
Filename 'mv5281/kernel.bin'.
Load address: 0x400000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #########################################
done
Bytes transferred = 2867904 (2bc2c0 hex)
Marvell>> 

これで、kernelが玄箱のメモリに読み込まれた。

Marvell>> go 0x400000

とすると、FreeBSDが起動する。問題がなければsingle-user modeに落ちるはず。

玄箱 PROのmulti-user modeでの起動

最低限の/etc/rc.conf (/nfsroot/arm-8-le/etc/rc.conf)と/etc/fstab (/nfsroot/arm-8-le/etc/fstab)の設定を書く。あと、/etc/ttysも適切に直す必要がある。

/etc/rc.conf

sshd_enable="YES"
rpcbind_enable="YES"
nfs_client_enable="YES"
rpc_lockd_enable="YES"
rpc_statd_enable="YES"

/etc/fstab

192.168.0.19:/nfsroot/arm-8-le   /           nfs     rw              0       0

上記の手順で起動して、single-user modeからexitで抜ければmulti-user modeでの処理が始まる。
(現在の8.0-CURRENTは、lock order reversal:と、いろいろうるさいログを出すので省略)

Marvell>> go 0x400000
## Starting application at 0x00400000 ...
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2008 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 8.0-CURRENT #1: Sun Nov  9 18:50:22 JST 2008
    xxxxxxxx@thebe.xxxxx.xxx:/usr/obj/arm/usr/src/sys/IO
WARNING: WITNESS option enabled, expect reduced performance.
WARNING: DIAGNOSTIC option enabled, expect reduced performance.
Preloaded elf kernel "elf kernel" at 0xc0835a58.
CPU: ARM926EJ-S rev 0 (ARM9EJ-S core)
  DC enabled IC enabled WB enabled EABT branch prediction enabled
  32KB/32B 1-way Instruction cache
  32KB/32B 1-way write-back-locking-C Data cache
real memory  = 134217728 (128 MB)
Physical memory chunk(s):
00000000 - 0x3fffff, 4194304 bytes (1024 pages)
0x92b000 - 0x7d8efff, 122044416 bytes (29796 pages)
avail memory = 125231104 (119 MB)
SOC: (0x5182:0x02) Marvell 88F5182 rev A2, TClock 166MHz
mem: <memory>
null: <null device, zero device>
nfslock: pseudo-device
random: <entropy source, Software, Yarrow>
mbus0: <Marvell Internal Bus (Mbus)> on motherboard
ic0: <Marvell Integrated Interrupt Controller> at mem 0xf1020200-0xf102023b on mbus0
timer0: <Marvell CPU Timer> at mem 0xf1020300-0xf102032f irq 0 on mbus0
timer0: [FILTER]
gpio0: <Marvell Integrated GPIO Controller> at mem 0xf1010100-0xf101011f irq 6,7,8,9 on mbus0
gpio0: [FILTER]
gpio0: [FILTER]
gpio0: [FILTER]
gpio0: [FILTER]
uart0: <16550 or compatible> at mem 0xf1012000-0xf101201f irq 3 on mbus0
uart0: [FILTER]
uart0: fast interrupt
uart0: console (115200,n,8,1)
uart1: <16550 or compatible> at mem 0xf1012100-0xf101211f irq 4 on mbus0
uart1: [FILTER]
uart1: fast interrupt
ehci0: <Marvell Integrated USB 2.0 controller> at mem 0xf1050000-0xf1050fff irq 16,17 on mbus0
ehci0: [GIANT-LOCKED]
ehci0: [ITHREAD]
ehci0: 5.24 GL USB-2 workaround enabled
usb0: EHCI version 1.0
usb0 on ehci0
usb0: USB revision 2.0
uhub0: <Marvell EHCI root hub, class 9/0, rev 2.00/1.00, addr 1> on usb0
uhub0: 1 port with 1 removable, self powered
mge0: <Marvell Gigabit Ethernet controller> at mem 0xf1072000-0xf1073fff irq 18,19,20,21,22 on mbus0
mge0: bpf attached
mge0: Ethernet address: 00:16:01:a4:ed:7f
miibus0: <MII bus> on mge0
e1000phy0: <Marvell 88E1116 Gigabit PHY> PHY 8 on miibus0
e1000phy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseTX-FDX, auto
mge0: [MPSAFE]
mge0: [ITHREAD]
mge0: [MPSAFE]
mge0: [ITHREAD]
twsi0: <Marvell Integrated I2C Bus Controller> at mem 0xf1011000-0xf101101f on mbus0
iicbus0: <Philips I2C bus> on twsi0
iicbus0: <unknown card> at addr 0
iic0: <I2C generic I/O> on iicbus0
Timecounter "CPU Timer" frequency 166666667 Hz quality 1000
Timecounters tick every 1.000 msec
lo0: bpf attached
bootpc_init: wired to interface 'mge0'
Sending DHCP Discover packet from interface mge0 (00:16:01:a4:ed:7f)
mge0: link state changed to UP
Received DHCP Offer packet on mge0 from 0.0.0.0 (accepted) (no root path)
Received DHCP Offer packet on mge0 from 0.0.0.0 (ignored) (no root path)
Sending DHCP Request packet from interface mge0 (00:xx:xx:xx:xx:xx)
Received DHCP Ack packet on mge0 from 0.0.0.0 (accepted) (got root path)
mge0 at 192.168.0.35 server 0.0.0.0
subnet mask 255.255.255.0 rootfs 192.168.0.19:/nfsroot/arm-8-le/
Adjusted interface mge0
ATA PseudoRAID loaded
WARNING: WITNESS option enabled, expect reduced performance.
WARNING: DIAGNOSTIC option enabled, expect reduced performance.
Trying to mount root from nfs:
NFS ROOT: 192.168.0.19:/nfsroot/arm-8-le/
warning: no time-of-day clock registered, system time will not be set accurately
warning: no time-of-day clock registered, system time will not be set accurately
start_init: trying /sbin/init
Enter full pathname of shell or RETURN for /bin/sh:     <-- Reternでsingle-user modeに落ちる。
# exit           <-- exitしてmulti-user modeへの処理が始まる。
Interface mge0 IP-Address 192.168.0.35 Broadcast 192.168.0.255
No suitable dump device was found.
Entropy harvesting: interrupts ethernet point_to_point kickstart.
Fast boot: skipping disk checks.
mount_nfs: can't update /var/db/mounttab for jupiter:/nfsroot/arm-8-le
in_delmulti_locked: purging ifma 0xc1393860
Starting Network: lo0 mge0.
add net default: gateway 192.168.0.1
devd: cannot open pid file: Operation not supported
Mounting NFS file systems:.
syslogd: cannot open pid file: Operation not supported
Jan  1 00:00:55  syslogd: /var/log/slip.log: No such file or directory
/etc/rc: WARNING: Dump device does not exist.  Savecore not run.

Thu Jan  1 00:01:17 UTC 1970

FreeBSD/arm (io.xxxxx.xxx) (ttyu0)

login: 

とりあえずmult-user modeで起動はした。

時刻が合ってないので、あわせる必要がある。ハードディスクが見えてないのが、少し悲しい。

今回の敗因

8.0-CURRENTから公開されたNFSが、マウントできるがInput/output errorでみることもできないので、NFSサーバーを移す際、ファイルのflagsが正しく移されていなかった。suできなくて、気づいた。paxが何とかしてくれると思ったのが間違い、というか、正しいオプションを指定していなかったのが間違い。NFSでマウントした先にinstallworldすれば、正しくインストールできた。

disklessの問題かと思ったが、全くそういう問題ではなった。ま、いろいろ分かったからよしとしよう。