Armadillo-9へNetBSD/evbarmをインストールする (MicroDrive編)

NetBSD/evbarm (Armadiilo-9)へ戻る

Armadillo-9で動作するNetBSD/evbarmを4Gbytesの容量を持つMicroDriveを使ってインストールする実際の様子をログ形式で掲載しています。ですから懇切丁寧なインストール手順ではなく、インストールの一例、ケーススタディとして見ていただければと思います。

インストールのほとんどの作業はPCで動作するNetBSD/i386上で行います。ただし、MicroDriveのfdiskやext2ファイルシステムの作成など一部の作業についてはArmadillo-9の実機を用いました。

PCでの作業ではプロンプトがroot@r1>となっています。ちなみに、shellにzshを使っていてプロンプトの右側にカレントディレクトリが[/mnt]などと表示されています。

確認

まずMicroDriveの購入直後初期状態でdisklabelを確認します。このときにはfdiskを確認するのを忘れていました。

root@r1>disklabel sd0                                      [/export/bin/mpc860]
# /dev/rsd0d:
type: SCSI
disk: mydisk
label: fictitious
flags: removable
bytes/sector: 512
sectors/track: 32
tracks/cylinder: 64
sectors/cylinder: 2048
cylinders: 3906
total sectors: 7999488
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0 

5 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 d:   7999488         0     unused      0     0        # (Cyl.      0 -   3905)
 e:   7999425        63      MSDOS                     # (Cyl.      0*-   3905)
disklabel: boot block size 0
disklabel: super block size 0

Armadillo-9を使ったMicroDriveのパーティショニング

Armadillo-9を起動すると最初にCFスロットを見に行きます。CFスロットにCFやMicroDriveが物理的に存在すれば、ext2パーティションを探し、ext2パーティションの中にある/boot/Imageまたは/boot/Image.gzをロードし、起動します。

ということで、MicroDriveにext2パーティションを作ります。最終的にはここに/bootというディレクトリを作ってImage.gzというNetBSDカーネルを置いてArmadillo-9に読ませるわけです。ですから、NetBSDカーネルが入るだけの小さなパーティションで良いわけです。

Armadillo-9の実機で作業を行います。

Armadillo-9のCFスロット横のJP2をONにします (ジャンパピンを取り付ける)。

MicroDriveを挿入し電源を入れます。


Hermit v1.3-armadillo9-3 compiled at 16:20:09, Apr 21 2005
Hermit v1.3-armadillo9-3 compiled at 16:20:09, Apr 21 2005
Disk drive detected: HMS360604D5CF00 DP4OC40D       DNP450B4VB3DSA 
hermit> 

プロンプト (hermit>) にbootと入力して内蔵flashからLinuxを起動します。

hermit> boot
Uncompressing  kernel...........................................................
Uncompressing ramdisk.........................................................................................................................done.
Doing console=ttyAM0,115200
Doing mtdparts=armadillo9-nor:0x10000(bootloader)ro,0x170000(kernel),0x670000(us
Linux version 2.4.27-a9-5 (hanada@pc-nsx) (gcc version 3.4.1 (Debian 3.4.1-4sarg
CPU: Arm920Tid(wb) revision 0
Machine: Armadillo-9
alloc_bootmem_low
memtable_init
On node 0 totalpages: 16384
zone(0): 24576 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: console=ttyAM0,115200 mtdparts=armadillo9-nor:0x10000(bootl
Console: colour dummy device 80x30
Calibrating delay loop... 99.73 BogoMIPS
Memory: 32MB 32MB = 64MB total
Memory: 55924KB available (1840K code, 355K data, 68K init)
Dentry cache hash table entries: 8192 (order: 4, 65536 bytes)
Inode cache hash table entries: 4096 (order: 3, 32768 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 4096 (order: 2, 16384 bytes)
Page-cache hash table entries: 16384 (order: 4, 65536 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Journalled Block Device driver loaded
i2c-core.o: i2c core module version 2.6.1 (20010830)
i2c-algo-bit.o: i2c bit algorithm module
i2c-armadillo9: i2c Armadillo9 driver, (C) 2004-2005 Atmark Techno, Inc.
i2c-s3531a: Device Type [S-353x0A]
i2c-s3531a: i2c S-3531A driver, (C) 2001-2005 Atmark Techno, Inc.
i2c-at24cxx: i2c at24cxx eeprom driver, (C) 2004 Atmark Techno, Inc.
Console: switching to colour frame buffer device 80x60
ttyAM0 at MMIO 0xff8c0000 (irq = 52) is a AMBA
ttyAM1 at MMIO 0xff8d0000 (irq = 54) is a AMBA
ttyAM2 at MMIO 0xff8e0000 (irq = 55) is a AMBA
ep93xx_eth() version: ep93xx_eth.c: V1.0 09/04/2003 Cirrus Logic
RAMDISK driver initialized: 16 RAM disks of 12288K size 1024 blocksize
loop: loaded (max 8 devices)
Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
 Fixed Disk Card
 IDE interface 
 [rotating] [unique] [single] [sleep] [standby] [idle] [low power]
Trying to free nonexistent resource <c699d000-c699d00f>
hdc: HMS360604D5CF00, CFA DISK drive
ide1 at 0xc699d000-0xc699d007,0xc699d00e on irq 49
hdc: attached ide-disk driver.
hdc: 7999488 sectors (4096 MB) w/128KiB Cache, CHS=7936/16/63
Partition check:
 hdc: [PTBL] [992/128/63] hdc1
SCSI subsystem driver Revision: 1.00
ARMADILLO9-NOR:0x00800000 at 0x60000000
 Amd/Fujitsu Extended Query Table v1.3 at 0x0040
number of CFI chips: 1
cfi_cmdset_0002: Disabling fast programming due to code brokenness.
ARMADILLO9-NOR:using command line partition definition
Creating 4 MTD partitions on "NOR flash on ARMADILLO9":
0x00000000-0x00010000 : "bootloader"
0x00010000-0x00180000 : "kernel"
0x00180000-0x007f0000 : "userland"
0x007f0000-0x00800000 : "config"
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
host/usb-ohci.c: USB OHCI at membase 0xff020000, IRQ 56
host/usb-ohci.c: usb-, ep93xx
usb.c: new USB bus registered, assigned bus number 1
Product: USB OHCI Root Hub
SerialNumber: ff020000
hub.c: USB hub found
hub.c: 3 ports detected
usb.c: registered new driver hid
hid-core.c: v1.8.1 Andreas Gal, Vojtech Pavlik <vojtech@suse.cz>
hid-core.c: USB HID support drivers
usb.c: registered new driver audio
audio.c: v1.0.0:USB Audio Class driver
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 4096 bind 8192)
ip_tables: (C) 2000-2002 Netfilter core team
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NetWinder Floating Point Emulator V0.97 (double precision)
RAMDISK: ext2 filesystem found at block 0
RAMDISK: Loading 6592 blocks [1 disk] into ram disk... done.
Freeing initrd memory: 6592K
VFS: Mounted root (ext2 filesystem).
Freeing init memory: 68K
init started:  BusyBox v1.00 (2005.03.14-09:24+0000) multi-call binary
Starting fsck for root filesystem.
fsck 1.25 (20-Sep-2001)
ext2fs_check_if_mount: No such file or directory while determining whether /dev/
/dev/ram0: clean, 632/800 files, 5923/6592 blocks
Checking root filesystem: done
Remounting root rw: done
Mounting proc: done
Setting hostname: done
Cleaning up system: done
Running local start scripts.
Changing file permissions: done
Starting syslogd: done
Starting klogd: done
Starting basic firewall: done
Configuring network interfaces: done
Starting thttpd: done
Starting inetd: done

Armadillo Linux V2.0.1
Linux 2.4.27-a9-5 [armv4l arch]

armadillo9 login: 

ログインします。rootのパスワードはrootです。

armadillo9 login: root
Password: 
[root@armadillo9 (ttyAM0) ~]# 

まずはfdiskということでfdisk /dev/hdcと入力します (必要に応じてmを押してメニューを表示させることができます)。

[root@armadillo9 (ttyAM0) ~]# fdisk /dev/hdc
 hdc: hdc1

Command (m for help): m
Command action
        a       toggle a bootable flag
        b       edit bsd disklabel
        c       toggle the dos compatibility flag
        d       delete a partition
        l       list known partition types
        m       print this menu
        n       add a new partition
        o       create a new empty DOS partition table
        p       print the partition table
        q       quit without saving changes
        s       create a new empty Sun disklabel
        t       change a partition's system id
        u       change display/entry units
        v       verify the partition table
        w       write table to disk and exit
        x       extra functionality (experts only)

Command (m for help):

pでパーティションテーブル表示させます。

Command (m for help): p

Disk /dev/hdc: 4095 MB, 4095737856 bytes
128 heads, 63 sectors/track, 992 cylinders
Units = cylinders of 8064 * 512 = 4128768 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hdc1   *           1         992     3999712+   b  Win95 FAT32

Command (m for help): 

購入直後なのですべてがWin95 FAT32になっています。このパーティションは不要なのでdで/dev/hdc1を消します。

Command (m for help): d
Selected partition 1

Command (m for help):

消したことを確認します。

Command (m for help): p

Disk /dev/hdc: 4095 MB, 4095737856 bytes
128 heads, 63 sectors/track, 992 cylinders
Units = cylinders of 8064 * 512 = 4128768 bytes

   Device Boot    Start       End    Blocks   Id  System

Command (m for help):

/dev/hdc1として6Mbytesの小さなLinuxパーティションを作ります。NetBSDカーネルを入れるだけなのでもっと小さいなパーティションサイズでも良いのですが、古いカーネルをリネームして残しておくこともあるでしょうから6Mbytesとしています。

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-992, default 1): 
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-992, default 992): +6000K

Command (m for help):

作成したパーティションを確認します。LinuxパーティションのIDは83です。

Command (m for help): p

Disk /dev/hdc: 4095 MB, 4095737856 bytes
128 heads, 63 sectors/track, 992 cylinders
Units = cylinders of 8064 * 512 = 4128768 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hdc1               1           2        8032+  83  Linux

Command (m for help):

次に、NetBSD用のパーティションを同じやり方で作成します。パーティションサイズは空いている領域のすべてを割り当てます。

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (3-992, default 3): 
Using default value 3
Last cylinder or +size or +sizeM or +sizeK (3-992, default 992): 
Using default value 992

Command (m for help): p

Disk /dev/hdc: 4095 MB, 4095737856 bytes
128 heads, 63 sectors/track, 992 cylinders
Units = cylinders of 8064 * 512 = 4128768 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hdc1               1           2        8032+  83  Linux
/dev/hdc2               3         992     3991680   83  Linux

Command (m for help):

このままではhdc2がLinuxパーティションなのでパーティションIDをD変更してNetBSDパーティションに変更します。

パーティション変更はtです。hdc2をNetBSDのパーティションに変更します。NetBSDパーティションのパーティションIDは16進数で0xa9です (10進数だと169)。

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): L

 0  Empty           12  Compaq diagnost 81  Minix / old Lin a8  Darwin UFS     
 1  FAT12           14  Hidden FAT16 <3 82  Linux swap      a9  NetBSD         
 4  FAT16 <32M      16  Hidden FAT16    83  Linux           ab  Darwin boot    
 5  Extended        17  Hidden HPFS/NTF 84  OS/2 hidden C:  b7  BSDI fs        
 6  FAT16           1b  Hidden Win95 FA 85  Linux extended  b8  BSDI swap      
 7  HPFS/NTFS       1c  Hidden Win95 FA 86  NTFS volume set be  Solaris boot   
 a  OS/2 Boot Manag 1e  Hidden Win95 FA 87  NTFS volume set eb  BeOS fs        
 b  Win95 FAT32     3c  PartitionMagic  8e  Linux LVM       ee  EFI GPT        
 c  Win95 FAT32 (LB 41  PPC PReP Boot   9f  BSD/OS          ef  EFI (FAT-12/16/
 e  Win95 FAT16 (LB 42  SFS             a0  IBM Thinkpad hi f0  Linux/PA-RISC b
 f  Win95 Ext'd (LB 63  GNU HURD or Sys a5  FreeBSD         f2  DOS secondary  
11  Hidden FAT12    80  Old Minix       a6  OpenBSD         fd  Linux raid auto
Hex code (type L to list codes): a9
Changed system type of partition 2 to a9 (NetBSD)

Command (m for help):

変更を確認します。

Command (m for help): p

Disk /dev/hdc: 4095 MB, 4095737856 bytes
128 heads, 63 sectors/track, 992 cylinders
Units = cylinders of 8064 * 512 = 4128768 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hdc1               1           2        8032+  83  Linux
/dev/hdc2               3         992     3991680   a9  NetBSD

Command (m for help): 

変更した内容を書き込んで終了します。

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
 hdc: hdc1 hdc2
 hdc: hdc1 hdc2
Syncing disks.
[root@armadillo9 (ttyAM0) ~]# 

パーティションの作成は完了しましたがフォーマットされていません。ということで、最初に作成した小さなLinuxのパーティション (/dev/hdc1) をフォーマットします。

[root@armadillo9 (ttyAM0) ~]# mke2fs -O none /dev/hdc1
mke2fs 1.25 (20-Sep-2001)
 hdc: hdc1 hdc2
 hdc: hdc1 hdc2
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
2008 inodes, 8032 blocks
401 blocks (4%) reserved for the super user
First data block=1
1 block group
8192 blocks per group, 8192 fragments per group
2008 inodes per group

Writing inode tables: done                            
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 22 mounts or
180.00 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@armadillo9 (ttyAM0) ~]#

フォーマットができたのでLinuxパーティションを/mntにマウントし、bootというディレクトリを作成します。

[root@armadillo9 (ttyAM0) ~]# mount /dev/hdc1 /mnt
 hdc: hdc1 hdc2
 hdc: hdc1 hdc2
ext3: No journal on filesystem on ide1(22,1)
 hdc: hdc1 hdc2
 hdc: hdc1 hdc2
[root@armadillo9 (ttyAM0) ~]# mkdir /mnt/boot
[root@armadillo9 (ttyAM0) ~]# 

マウントを解除します。

[root@armadillo9 (ttyAM0) /]# umount /mnt

シャットダウンします。

[root@armadillo9 (ttyAM0) /]# poweroff
[root@armadillo9 (ttyAM0) /]# 
System is going down for system reboot now.

Starting local stop scripts.
Exiting Syslogd!
Syncing all filesystems: done
Unmounting all filesystems: done
The system is going down NOW !!
Sending SIGTERM to all processes.
The system is halted. Press Reset or turn off power
flushing ide devices: hdc 
Power down.

なお、ここではLinuxパーティションの作成などをArmadillo-9の実機を使って行いました。実はNetBSDのpkgsrcにあるsysutils/e2fsprogsに含まれるmke2fsを使う方法があるそうです。e2fsprogsを使うとすべての作業がPCだけで完結するのでそちらを使ってもよいでしょう。早い話が、これをやった時にはe2fsprogsを知らなかったのです...

PCを使ったNetBSD/evbarmのインストール

ここからPCでの作業となります。

先ほどの作業を確認する意味でLinuxによるパーティショニング後のdisklabelを見てみます。

root@r1>disklabel sd0                                                       [~]
# /dev/rsd0d:
type: SCSI
disk: mydisk
label: fictitious
flags: removable
bytes/sector: 512
sectors/track: 32
tracks/cylinder: 64
sectors/cylinder: 2048
cylinders: 3906
total sectors: 7999488
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0 

6 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 c:   7983360     16128     unused      0     0        # (Cyl.      7*-   3905)
 d:   7999488         0     unused      0     0        # (Cyl.      0 -   3905)
 e:     16065        63 Linux Ext2      0     0        # (Cyl.      0*-      7*)
 f:   7983360     16128     4.2BSD      0     0     0  # (Cyl.      7*-   3905)
disklabel: boot block size 0
disklabel: super block size 0
root@r1>

先ほど忘れていたfdiskを確認します。

root@r1>fdisk /dev/sd0                                                      [~]
Disk: /dev/sd0d
NetBSD disklabel disk geometry:
cylinders: 3906, heads: 64, sectors/track: 32 (2048 sectors/cylinder)
total sectors: 7999488

BIOS disk geometry:
cylinders: 992, heads: 128, sectors/track: 63 (8064 sectors/cylinder)
total sectors: 7999488

Partition table:
0: Linux native (sysid 131)
    start 63, size 16065 (8 MB, Cyls 0-2)
1: NetBSD (sysid 169)
    start 16128, size 7983360 (3898 MB, Cyls 2-992)
2: <UNUSED>
3: <UNUSED>
root@r1>

期待どおり小さなLinuxパーティションと大きなNetBSDパーティションが見えています。

disklabelを書くわけですが、今回はディスクの先頭から次のように利用することにします。

作りたいdisklabelは次のようなものです。

#        size    offset     fstype [fsize bsize cpg/sgs]
 a:   7720960     16128     4.2BSD      0     0     0  # (Cyl.      7*-   3777*)
 b:    262400   7737088       swap                     # (Cyl.   3777*-   3905)
 e:     16065        63 Linux Ext2      0     0        # (Cyl.      0*-      7*)

ということでdisklabelコマンドを実行します。この例では何の確認もなく進めていますが、実際には試行錯誤しながらサイズを調整すると思います。

root@r1>disklabel -i -I sd0                                                 [~]
partition> P
6 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 c:   7983360     16128     unused      0     0        # (Cyl.      7*-   3905)
 d:   7999488         0     unused      0     0        # (Cyl.      0 -   3905)
 e:     16065        63 Linux Ext2      0     0        # (Cyl.      0*-      7*)
 f:   7983360     16128     4.2BSD      0     0     0  # (Cyl.      7*-   3905)
partition> a
Filesystem type [?] [unused]: 4.2BSD
Start offset ('x' to start after partition 'x') [0c, 0s, 0M]: e
Partition size ('$' for all remaining) [0c, 0s, 0M]: 3770c
 a:   7720960     16128     4.2BSD      0     0     0  # (Cyl.      7*-   3777*)
partition> b
Filesystem type [?] [unused]: swap
Start offset ('x' to start after partition 'x') [0c, 0s, 0M]: a
Partition size ('$' for all remaining) [0c, 0s, 0M]: $
 b:    262400   7737088       swap                     # (Cyl.   3777*-   3905)
partition> c
Filesystem type [?] [unused]: unused
Start offset ('x' to start after partition 'x') [7.875c, 16128s, 7.875M]: 0
Partition size ('$' for all remaining) [3898.12c, 7983360s, 3898.12M]: 0
partition> d
Filesystem type [?] [unused]: unused
Start offset ('x' to start after partition 'x') [0c, 0s, 0M]: 0
Partition size ('$' for all remaining) [3906c, 7999488s, 3906M]: 0
partition> f
Filesystem type [?] [4.2BSD]: unused
Start offset ('x' to start after partition 'x') [7.875c, 16128s, 7.875M]: 0
Partition size ('$' for all remaining) [3898.12c, 7983360s, 3898.12M]: 0
partition> P
6 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:   7720960     16128     4.2BSD      0     0     0  # (Cyl.      7*-   3777*)
 b:    262400   7737088       swap                     # (Cyl.   3777*-   3905)
 e:     16065        63 Linux Ext2      0     0        # (Cyl.      0*-      7*)
partition> W
Label disk [n]? y
NetBSD slice at 16128, partition C at 0
Write outside MBR partition? [n]: y
Label written
partition> Q
root@r1> 

disklabelができたので/dev/rsd0aをnewfsします。

root@r1>newfs -O 2 /dev/rsd0a                                               [~]
/dev/rsd0a: 3770.0MB (7720960 sectors) block size 16384, fragment size 2048
        using 21 cylinder groups of 179.53MB, 11490 blks, 22272 inodes.
super-block backups (for fsck -b #) at:
     160,  367840,  735520, 1103200, 1470880, 1838560, 2206240, 2573920,
 2941600, 3309280, 3676960, 4044640, 4412320, 4780000, 5147680, 5515360,
 5883040, 6250720, 6618400, 6986080, 7353760,
root@r1>

Linuxパーティションをマウントし、NetBSD kernelをコピーします。この例では~/evbarmにNetBSDの配布物 (カーネルやbase.tgz, etc.tgzなど) が格納されているとします。

CFスロットのMicroDriveはNetBSDカーネルからwdデバイスとして見えるので自動的にwdをルートでマウントしてくれるnetbsd-wd0.bin-ARMADILLO9.gzを使いました。

root@r1>mount -t ext2fs /dev/sd0e /mnt                                      [~]
root@r1> 
root@r1>cp netbsd-wd0.bin-ARMADILLO9.gz /mnt/boot/Image.gz           [~/evbarm]
root@r1> 
root@r1>ls -l /mnt/boot                                              [~/evbarm]
total 2290
-rw-r--r--  1 root  wheel  1166214 Oct  4 04:02 Image.gz
root@r1>umount /mnt                                                  [~/evbarm]
root@r1>

ルートパーティションをマウントし、NetBSD配布物を展開します。MicroDriveに配布物をいったんコピーしていますが、これは作業者の好みです (PCから直接展開してもなんの問題もないでしょう)。

なお、先ほど使ったLinuxのパーティションがumountされているか確認しておいたほうが良いでしょう。

root@r1>mount -t ffs /dev/sd0a /mnt                                  [~/evbarm]
root@r1>mkdir /mnt/sets                                              [~/evbarm]
root@r1>cp base.tgz comp.tgz etc.tgz games.tgz man.tgz misc.tgz text.tgz kern-ARMADILLO9.tgz /mnt/sets
root@r1>cd /mnt                                                      [~/evbarm]
root@r1>foreach i (/mnt/sets/*.tgz)                                      [/mnt]
foreach> pax -rzpe -f $i
foreach> end
root@r1>

ここから先は手動でNetBSDをインストールする時の手順と大差ないです。

ファイルの展開後の処理を行います。まずはデバイスの作成です。

root@r1>cd dev                                                           [/mnt]
root@r1>./MAKEDEV all                                                [/mnt/dev]
root@r1> 

fstabを作成します。

root@r1>cd /mnt/etc                                                  [/mnt/dev]
root@r1>echo /dev/wd0a / ffs rw,softdep 1 1 > fstab                  [/mnt/etc]
root@r1>echo /dev/wd0b none swap sw 0 0 >> fstab                     [/mnt/etc]
root@r1>cat fstab                                                    [/mnt/etc]
/dev/wd0a / ffs rw,softdep 1 1
/dev/wd0b none swap sw 0 0
root@r1>

せっかくなのでマルチユーザモードで起動しようということでrc.confを設定します。

root@r1>mv rc.conf rc.conf.orig                                      [/mnt/etc]
root@r1>lv rc.conf.orig                                              [/mnt/etc]
root@r1>sed s/=NO/=YES/ rc.conf.orig > rc.conf                       [/mnt/etc]
root@r1>echo hostname=armadillo9 >> rc.conf                          [/mnt/etc]
root@r1>echo ifconfig_epe0="inet 192.168.100.20 netmask 255.255.255.0" >> rc.conf
root@r1>echo defaultroute=192.168.100.1 >> rc.conf                          [/mnt/etc]
root@r1>echo sshd=YES >> rc.conf                                            [/mnt/etc]
root@r1>cat rc.conf                                                         [/mnt/etc]
#       $NetBSD: rc.conf,v 1.96 2000/10/14 17:01:29 wiz Exp $
#
# see rc.conf(5) for more information.
#
# Use program=YES to enable program, NO to disable it. program_flags are
# passed to the program on the command line.
#

# Load the defaults in from /etc/defaults/rc.conf (if it's readable).
# These can be overridden below.
#
if [ -r /etc/defaults/rc.conf ]; then
        . /etc/defaults/rc.conf
fi

# If this is not set to YES, the system will drop into single-user mode.
#
rc_configured=YES

# Add local overrides below
#
hostname=armadillo9
ifconfig_epe0=inet 192.168.100.20 netmask 255.255.255.0
defaultroute=192.168.100.1
sshd=YES
root@r1>

よく見ると上ではifconfig_epe0の行が間違っていますね。正しくはinet以降をダブルクオーテーションで囲んでおかなければいけませんでした。

念のためsyncしてumountします。

root@r1>cd /                                                                [/mnt/etc]
root@r1>sync                                                                       [/]
root@r1>umount /mnt                                                                [/]
root@r1>

それでは、起動してみましょう。

Hermit v1.3-armadillo9-3 compiled at 16:20:09, Apr 21 2005
Disk drive detected: HMS360604D5CF00 DP4OC40D       DNP450B4VB3DSA 
/dev/hdc1: start=0x0000003f, size=0x00003ec1
Image.gz is found.
Copying        kernel......done.
Uncompressing  kernel...............................................................................done.
Doing console=ttyAM0,115200
Doing mtdparts=armadillo9-nor:0x10000(bootloader)ro,0x170000(kernel),0x670000(userland),-(config)
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 3.99.9 (ARMADILLO9) #2: Tue Sep 27 18:53:31 UTC 2005
        root@mini:/usr/export/o/20050924/evbarm/sys/arch/evbarm/compile/ARMADILLO9
total memory = 65536 KB
avail memory = 60704 KB
mainbus0 (root)
cpu0 at mainbus0: ARM920T rev 0 (ARM9TDMI core)
cpu0: DC enabled IC enabled WB enabled EABT
cpu0: 16KB/32B 64-way Instruction cache
cpu0: 16KB/32B 64-way write-back-locking-A Data cache
epsoc0 at mainbus0: Cirrus Logic EP93xx SoC rev E0
epsoc0: fclk 200.02 Mhz hclk 100.01 Mhz pclk 50.00 Mhz
epclk0 at epsoc0 addr 0x80810000-0x8081008f intr 35
epgpio0 at epsoc0 addr 0x80840000-0x808400cb intr 59
a9iic0 at epsoc0
iic0 at a9iic0: I2C bus
seeprom0 at iic0 addr 0x50: AT24Cxx EEPROM
ohci0 at epsoc0 addr 0x80020000-0x80020fff intr 56
epe0 at epsoc0 addr 0x80010000-0x8001ffff intr 39
epe0: MAC address 00:11:0c:02:06:23
OUI 0x0020f3 model 0x000e rev 2 at epe0 phy 0 not configured
ifmedia_set: no match for 0x20/0xfffffff
epcom0 at epsoc0 addr 0x808c0000-0x808c0fff intr 52
epcom0: console
epcom1 at epsoc0 addr 0x808d0000-0x808d0fff intr 54
epcom2 at epsoc0 addr 0x808e0000-0x808e0fff intr 55
epwdt0 at epsoc0 addr 0x80940000-0x80940007 intr 36
eppcic0 at epsoc0 addr 0x80080020-0x80080043 intr 49
pcmcia0 at eppcic0
ohci0: OHCI version 1.0
usb0 at ohci0: USB revision 1.0
uhub0 at usb0
uhub0: Cirrus Logic OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 3 ports with 3 removable, self powered
wdc0 at pcmcia0 function 0: <HITACHI, microdrive>
wdc0: i/o mapped mode
atabus0 at wdc0 channel 0
wd0 at atabus0 drive 0: <HMS360604D5CF00>
wd0: drive supports 32-sector PIO transfers, LBA addressing
wd0: 3906 MB, 7936 cyl, 16 head, 63 sec, 512 bytes/sect x 7999488 sectors
wd0: drive supports PIO mode 4
boot device: <unknown>
root on wd0a dumps on wd0b
WARNING: CHECK AND RESET THE DATE!
192.168.100.20: not found
Tue Oct  4 04:47:10 UTC 2005
swapctl: /dev/wd0b: Function not implemented
Checking for botched superblock upgrades: done.
Starting file system checks:
/dev/rwd0a: file system is clean; not checking
Setting tty flags.
Setting sysctl variables:
Starting network.
Hostname: armadillo9
IPv6 mode: host
Configuring network interfaces: epe0.
add net default: gateway 192.168.100.1
Adding interface aliases:
Building databases...
Starting syslogd.
Checking for core dump...
savecore: no core dump
Mounting all filesystems...
Clearing /tmp.
Creating a.out runtime link editor directory cache.
Checking quotas: done.
Setting securelevel: kern.securelevel: 0 -> 1
/etc/rc: WARNING: No swap space configured!
Starting virecover.
Starting local daemons:.
Updating motd.
Generating public/private rsa1 key pair.
Your identification has been saved in /etc/ssh/ssh_host_key.
Your public key has been saved in /etc/ssh/ssh_host_key.pub.
The key fingerprint is:
01:40:1a:b5:10:7b:b2:3d:d7:8b:60:5d:93:13:cd:94 root@armadillo9
Generating public/private dsa key pair.
Your identification has been saved in /etc/ssh/ssh_host_dsa_key.
Your public key has been saved in /etc/ssh/ssh_host_dsa_key.pub.
The key fingerprint is:
03:3d:66:e3:f1:71:8a:0f:6c:4f:58:63:cd:f3:82:e9 root@armadillo9
Generating public/private rsa key pair.
Your identification has been saved in /etc/ssh/ssh_host_rsa_key.
Your public key has been saved in /etc/ssh/ssh_host_rsa_key.pub.
The key fingerprint is:
a3:91:18:e1:94:e8:bb:ae:c8:1a:d3:56:72:1d:14:9b root@armadillo9
Starting sshd.
192.168.100.20: not found
sendmail: /etc/mail/aliases.db not present, generating
WARNING: local host name (armadillo9) is not qualified; see cf/README: WHO AM I?
/etc/mail/aliases: 22 aliases, longest 10 bytes, 246 bytes total
Starting sendmail.
Starting inetd.
Starting cron.
Tue Oct  4 04:47:48 UTC 2005

NetBSD/evbarm (armadillo9) (console)

login:

無事に起動しました。でもやっぱりrc.confのifconfigの行が変だったのでちょっとおかしいですね。rootでログインしましょう。

dmesgはこんな感じです。

armadillo9# dmesg
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 3.99.9 (ARMADILLO9) #2: Tue Sep 27 18:53:31 UTC 2005
        root@mini:/usr/export/o/20050924/evbarm/sys/arch/evbarm/compile/ARMADILLO9
total memory = 65536 KB
avail memory = 60704 KB
mainbus0 (root)
cpu0 at mainbus0: ARM920T rev 0 (ARM9TDMI core)
cpu0: DC enabled IC enabled WB enabled EABT
cpu0: 16KB/32B 64-way Instruction cache
cpu0: 16KB/32B 64-way write-back-locking-A Data cache
epsoc0 at mainbus0: Cirrus Logic EP93xx SoC rev E0
epsoc0: fclk 200.02 Mhz hclk 100.01 Mhz pclk 50.00 Mhz
epclk0 at epsoc0 addr 0x80810000-0x8081008f intr 35
epgpio0 at epsoc0 addr 0x80840000-0x808400cb intr 59
a9iic0 at epsoc0
iic0 at a9iic0: I2C bus
seeprom0 at iic0 addr 0x50: AT24Cxx EEPROM
ohci0 at epsoc0 addr 0x80020000-0x80020fff intr 56
epe0 at epsoc0 addr 0x80010000-0x8001ffff intr 39
epe0: MAC address 00:11:0c:02:06:23
lxtphy0 at epe0 phy 0: LXT971/2 10/100 media interface, rev. 2
lxtphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
epcom0 at epsoc0 addr 0x808c0000-0x808c0fff intr 52
epcom0: console
epcom1 at epsoc0 addr 0x808d0000-0x808d0fff intr 54
epcom2 at epsoc0 addr 0x808e0000-0x808e0fff intr 55
epwdt0 at epsoc0 addr 0x80940000-0x80940007 intr 36
eppcic0 at epsoc0 addr 0x80080020-0x80080043 intr 49
pcmcia0 at eppcic0
ohci0: OHCI version 1.0
usb0 at ohci0: USB revision 1.0
uhub0 at usb0
uhub0: Cirrus Logic OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 3 ports with 3 removable, self powered
wdc0 at pcmcia0 function 0: <HITACHI, microdrive>
wdc0: i/o mapped mode
atabus0 at wdc0 channel 0
wd0 at atabus0 drive 0: <HMS360604D5CF00>
wd0: drive supports 32-sector PIO transfers, LBA addressing
wd0: 3906 MB, 7936 cyl, 16 head, 63 sec, 512 bytes/sect x 7999488 sectors
wd0: drive supports PIO mode 4
boot device: <unknown>
root on wd0a dumps on wd0b
WARNING: CHECK AND RESET THE DATE!
armadillo9#

unameです。

armadillo9# uname -a
NetBSD armadillo9 3.99.9 NetBSD 3.99.9 (ARMADILLO9) #2: Tue Sep 27 18:53:31 UTC 2005  root@mini:/usr/export/o/20050924/evbarm/sys/arch/evbarm/compile/ARMADILLO9 evbarm
armadillo9#

以上でインストールは完了です。

ようこそNetBSDの世界へ。