トップ 履歴 一覧 カテゴリ ソース 検索 ヘルプ RSS ログイン

OpenBSD/Install/60-armv7

INDEX

BBB に OpenBSD を入れていくメモ

OpenBSD/armv7 6.0 インストール

  インストールSDカード作成

OpenBSD ( http://www.openbsd.org/ ) のサイトからブートイメージ miniroot-am335x-60.fs をダウンロードし、SDカードに書き込む。

Windows 10 x64 で作業

dd for windows ( http://www.chrysocome.net/dd )を使用して、イメージを書き込む。

管理者で実行し、"dd --list"でSDカードのディバイスを確認。以下のようにコマンドを実行しイメージを書き込む。

C:\>dd if=miniroot-am335x-60.fs of=\\?\Device\Harddisk1\Partition0 --progress
rawwrite dd for windows version 0.6beta3.
Written by John Newbigin <jn@it.swin.edu.au>
This program is covered by terms of the GPL Version 2.

18,874,368
36864+0 records in
36864+0 records out

C:\>

  インストール

作成したSDカードを挿入し、SDカードから起動する。

U-Boot SPL 2016.07 (Jul 26 2016 - 02:40:03)
Trying to boot from MMC1
MMC partition switch failed
*** Warning - MMC partition switch failed, using default environment

reading u-boot.img
reading u-boot.img


U-Boot 2016.07 (Jul 26 2016 - 02:40:03 -0600)

       Watchdog enabled
I2C:   ready
DRAM:  512 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - bad CRC, using default environment

Net:   <ethaddr> not set. Validating first E-fuse MAC
cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
reading boot.scr
** Unable to read file boot.scr **
reading uEnv.txt
** Unable to read file uEnv.txt **
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
reading /am335x-boneblack.dtb
32577 bytes read in 9 ms (3.5 MiB/s)
Found EFI removable media binary efi/boot/bootarm.efi
reading efi/boot/bootarm.efi
65276 bytes read in 14 ms (4.4 MiB/s)
## Starting EFI application at 0x82000000 ...
Scanning disks on usb...
Scanning disks on mmc...
MMC Device 2 not found
MMC Device 3 not found
Found 6 disks
>> OpenBSD/armv7 BOOTARM 0.1
boot>
cannot open sd0a:/etc/random.seed: No such file or directory
booting sd0a:/bsd: 2094344+7928824+428472 [64+297600+142893]=0xa64014

OpenBSD/armv7 booting ...
arg0 0x0 arg1 0xe05 arg2 0x88000000
Allocating page tables
freestart = 0x80d65000, free_pages = 127643 (0x0001f29b)
IRQ stack: p0x80d93000 v0xc0d93000
ABT stack: p0x80d94000 v0xc0d94000
UND stack: p0x80d95000 v0xc0d95000
SVC stack: p0x80d96000 v0xc0d96000
Creating L1 page table at 0x80d68000
Mapping kernel
Constructing L2 page tables
undefined page pmap board type: 3589
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2016 OpenBSD. All rights reserved.  http://www.OpenBSD.org

OpenBSD 6.0 (RAMDISK) #93: Thu Jul 28 13:47:27 AEST 2016
    jsg@armv7.jsg.id.au:/usr/src/sys/arch/armv7/compile/RAMDISK
real mem  = 536870912 (512MB)
avail mem = 512237568 (488MB)
mainbus0 at root: TI AM335x BeagleBone Black
cpu0 at mainbus0: ARM Cortex A8 R3 rev 2 (ARMv7 core)
cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled
cpu0: 32KB(64b/l,4way) I-cache, 32KB(64b/l,4way) wr-back D-cache
omap0 at mainbus0
prcm0 at omap0 rev 0.2
sitaracm0 at omap0: control module, rev 1.0
intc0 at omap0 rev 5.0
edma0 at omap0 rev 0.0
dmtimer0 at omap0 rev 3.1
dmtimer1 at omap0 rev 3.1
omgpio0 at omap0: rev 0.1
gpio0 at omgpio0: 32 pins
omgpio1 at omap0: rev 0.1
gpio1 at omgpio1: 32 pins
omgpio2 at omap0: rev 0.1
gpio2 at omgpio2: 32 pins
omgpio3 at omap0: rev 0.1
gpio3 at omgpio3: 32 pins
simplebus0 at mainbus0: "ocp"
simplebus1 at simplebus0: "l4_wkup"
simplebus2 at simplebus1: "scm"
com0 at simplebus0: ti16750, 64 byte fifo
com0: console
tiiic0 at simplebus0 rev 0.11
iic0 at tiiic0
"ti,tps65217" at iic0 addr 0x24 not configured
"at,24c256" at iic0 addr 0x50 not configured
"nxp,tda998x" at iic0 addr 0x70 not configured
tiiic1 at simplebus0 rev 0.11
iic1 at tiiic1
"at,24c256" at iic1 addr 0x54 not configured
"at,24c256" at iic1 addr 0x55 not configured
"at,24c256" at iic1 addr 0x56 not configured
"at,24c256" at iic1 addr 0x57 not configured
ommmc0 at simplebus0
sdmmc0 at ommmc0: 1-bit, mmc high-speed
ommmc1 at simplebus0
sdmmc1 at ommmc1: 1-bit, mmc high-speed
omdog0 at simplebus0 rev 0.1
cpsw0 at simplebus0: version 1.12 (0), address xx:xx:xx:xx:xx:xx
ukphy0 at cpsw0 phy 0: Generic IEEE 802.3u media interface, rev. 1: OUI 0x0001f0, model 0x000f
scsibus0 at sdmmc0: 2 targets, initiator 0
sd0 at scsibus0 targ 1 lun 0: <SD/MMC, SD8GB, 0030> SCSI2 0/direct fixed
sd0: 7600MB, 512 bytes/sector, 15564800 sectors
scsibus1 at sdmmc1: 2 targets, initiator 0
sd1 at scsibus1 targ 1 lun 0: <Kingston, MMC04G, 0000> SCSI2 0/direct fixed
sd1: 3688MB, 512 bytes/sector, 7553024 sectors
boot device: sd0
root on rd0a swap on rd0b dump on rd0b
WARNING: CHECK AND RESET THE DATE!
erase ^?, werase ^W, kill ^U, intr ^C, status ^T

Welcome to the OpenBSD/armv7 6.0 installation program.
(I)nstall, (U)pgrade, (A)utoinstall or (S)hell? i
At any prompt except password prompts you can escape to a shell by
typing '!'. Default answers are shown in []'s and are selected by
pressing RETURN.  You can exit this program at any time by pressing
Control-C, but this can leave your system in an inconsistent state.

Terminal type? [vt220]
System hostname? (short form, e.g. 'foo') bbb

Available network interfaces are: cpsw0.
Which network interface do you wish to configure? (or 'done') [cpsw0]
IPv4 address for cpsw0? (or 'dhcp' or 'none') [dhcp] 192.168.0.254
Netmask for cpsw0? [255.255.255.0]
IPv6 address for cpsw0? (or 'rtsol' or 'none') [none]
Available network interfaces are: cpsw0.
Which network interface do you wish to configure? (or 'done') [done]
Default IPv4 route? (IPv4 address or none) 192.168.0.1
add net default: gateway 192.168.0.1
DNS domain name? (e.g. 'bar.com') [my.domain] intranet
DNS nameservers? (IP address list or 'none') [none] 192.168.0.1

Password for root account? (will not echo)
Password for root account? (again)
Start sshd(8) by default? [yes]
Setup a user? (enter a lower-case loginname, or 'no') [no] username
Full name for user username? [username]
Password for user username? (will not echo)
Password for user username? (again)
WARNING: root is targeted by password guessing attacks, pubkeys are safer.
Allow root ssh login? (yes, no, prohibit-password) [no]

Available disks are: sd0 sd1.
Which disk is the root disk? ('?' for details) [sd0] ?
sd0: SD/MMC SD8GB (7.4G)
sd1: Kingston MMC04G (3.6G)
Available disks are: sd0 sd1.
Which disk is the root disk? ('?' for details) [sd0]
Disk: sd0       geometry: 968/255/63 [15564800 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
*0: 0C      0  32  33 -      0  97  33 [        2048:        4096 ] Win95 FAT32L
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 3: A6      0  97  34 -      2  75   9 [        6144:       30720 ] OpenBSD
Use (W)hole disk$ or (E)dit the MBR? [whole]
Creating a msdos partition and an OpenBSD partition for rest of sd0...done.
/dev/rsd0i: 32668 sectors in 8167 FAT16 clusters (2048 bytes/cluster)
bps=512 spc=4 res=1 nft=2 rde=512 sec=32768 mid=0xf8 spf=32 spt=63 hds=255 hid=2048
The auto-allocated layout for sd0 is:
#                size           offset  fstype [fsize bsize  cpg]
  a:           100.7M            34816  4.2BSD   2048 16384    1 # /
  b:           121.5M           241120    swap
  c:          7600.0M                0  unused
  d:           153.2M           489952  4.2BSD   2048 16384    1 # /tmp
  e:           133.9M           803680  4.2BSD   2048 16384    1 # /var
  f:           920.7M          1077984  4.2BSD   2048 16384    1 # /usr
  g:           524.4M          2963648  4.2BSD   2048 16384    1 # /usr/X11R6
  h:          2089.5M          4037696  4.2BSD   2048 16384    1 # /usr/local
  i:            16.0M             2048   MSDOS
  j:          1032.3M          8316960  4.2BSD   2048 16384    1 # /usr/src
  k:          1316.6M         10431104  4.2BSD   2048 16384    1 # /usr/obj
  l:          1190.0M         13127488  4.2BSD   2048 16384    1 # /home
Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout? [a] c
Label editor (enter '?' for help at any prompt)
> a a
offset: [34816]
size: [15529984] 7344M
Rounding size to cylinder (16065 sectors): 15050219
FS type: [4.2BSD]
mount point: [none] /
Rounding size to bsize (32 sectors): 15050208
> a b
offset: [15085024]
size: [479776]
FS type: [swap]
> p M
OpenBSD area: 34816-15564800; size: 7583.0M; free: 0.0M
#                size           offset  fstype [fsize bsize  cpg]
  a:          7348.7M            34816  4.2BSD   2048 16384    1 # /
  b:           234.3M         15085024    swap
  c:          7600.0M                0  unused
  i:            16.0M             2048   MSDOS
> q
Write new label?: [y]
/dev/rsd0a: 7348.7MB in 15050208 sectors of 512 bytes
37 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
Available disks are: sd1.
Which disk do you wish to initialize? (or 'done') [done]
/dev/sd0a (b8e4fae9983283dd.a) on /mnt type ffs (rw, asynchronous, local)

Let's install the sets!
Location of sets? (disk http nfs or 'done') [http]
HTTP proxy URL? (e.g. 'http://proxy:8080', or 'none') [none]
(Unable to get list from ftp.openbsd.org, but that is OK)
HTTP Server? (hostname or 'done') ftp.jaist.ac.jp
Server directory? [pub/OpenBSD/6.0/armv7]

Select sets by entering a set name, a file name pattern or 'all'. De-select
sets by prepending a '-' to the set name, file name pattern or 'all'. Selected
sets are labelled '[X]'.
    [X] bsd           [X] comp60.tgz    [X] xbase60.tgz   [X] xserv60.tgz
    [X] bsd.rd        [X] man60.tgz     [X] xshare60.tgz
    [X] base60.tgz    [X] game60.tgz    [X] xfont60.tgz
Set name(s)? (or 'abort' or 'done') [done] -x*
    [X] bsd           [X] comp60.tgz    [ ] xbase60.tgz   [ ] xserv60.tgz
    [X] bsd.rd        [X] man60.tgz     [ ] xshare60.tgz
    [X] base60.tgz    [X] game60.tgz    [ ] xfont60.tgz
Set name(s)? (or 'abort' or 'done') [done]
Get/Verify SHA256.sig   100% |**************************|  1978       00:00
Signature Verified
Get/Verify bsd          100% |**************************|  4399 KB    00:12
Get/Verify bsd.rd       100% |**************************| 10225 KB    00:34
Get/Verify base60.tgz   100% |**************************| 49681 KB    02:20
Get/Verify comp60.tgz   100% |**************************| 43395 KB    02:02
Get/Verify man60.tgz    100% |**************************|  8619 KB    00:22
Get/Verify game60.tgz   100% |**************************|  2614 KB    00:07
Installing bsd          100% |**************************|  4399 KB    00:03
Installing bsd.rd       100% |**************************| 10225 KB    00:05
Installing base60.tgz   100% |**************************| 49681 KB    01:49
Extracting etc.tgz      100% |**************************|   186 KB    00:00
Installing comp60.tgz   100% |**************************| 43395 KB    01:25
Installing man60.tgz    100% |**************************|  8619 KB    00:36
Installing game60.tgz   100% |**************************|  2614 KB    00:03
Location of sets? (disk http nfs or 'done') [done]

What timezone are you in? ('?' for list) [Canada/Mountain] Asia/Tokyo
Saving configuration files...done.
Making all device nodes...done.

CONGRATULATIONS! Your OpenBSD install has been successfully completed!
To boot the new system, enter 'reboot' at the command prompt.
When you login to your new system the first time, please read your mail
using the 'mail' command.

# reboot
syncing disks... done
rebooting...

U-Boot SPL 2016.07 (Jul 26 2016 - 02:40:03)
Trying to boot from MMC1
MMC partition switch failed
*** Warning - MMC partition switch failed, using default environment

reading u-boot.img
reading u-boot.img


U-Boot 2016.07 (Jul 26 2016 - 02:40:03 -0600)

       Watchdog enabled
I2C:   ready
DRAM:  512 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - bad CRC, using default environment

Net:   <ethaddr> not set. Validating first E-fuse MAC
cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
reading boot.scr
** Unable to read file boot.scr **
reading uEnv.txt
** Unable to read file uEnv.txt **
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
reading /am335x-boneblack.dtb
32577 bytes read in 9 ms (3.5 MiB/s)
Found EFI removable media binary efi/boot/bootarm.efi
reading efi/boot/bootarm.efi
65276 bytes read in 15 ms (4.1 MiB/s)
## Starting EFI application at 0x82000000 ...
Scanning disks on usb...
Scanning disks on mmc...
MMC Device 2 not found
MMC Device 3 not found
Found 6 disks
>> OpenBSD/armv7 BOOTARM 0.1
boot>
booting sd0a:/bsd: 3676224+100656+479232 [64+491216+230278]=0x4c5d3c

OpenBSD/armv7 booting ...
arg0 0x0 arg1 0xe05 arg2 0x88000000
Allocating page tables
freestart = 0x807c6000, free_pages = 129082 (0x0001f83a)
IRQ stack: p0x807f4000 v0xc07f4000
ABT stack: p0x807f5000 v0xc07f5000
UND stack: p0x807f6000 v0xc07f6000
SVC stack: p0x807f7000 v0xc07f7000
Creating L1 page table at 0x807c8000
Mapping kernel
Constructing L2 page tables
undefined page pmap [ using 721932 bytes of bsd ELF symbol table ]
board type: 3589
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2016 OpenBSD. All rights reserved.  http://www.OpenBSD.org

OpenBSD 6.0 (GENERIC) #286: Thu Jul 28 12:33:51 AEST 2016
    jsg@armv7.jsg.id.au:/usr/src/sys/arch/armv7/compile/GENERIC
real mem  = 536870912 (512MB)
avail mem = 518017024 (494MB)
mainbus0 at root: TI AM335x BeagleBone Black
cpu0 at mainbus0: ARM Cortex A8 R3 rev 2 (ARMv7 core)
cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled
cpu0: 32KB(64b/l,4way) I-cache, 32KB(64b/l,4way) wr-back D-cache
omap0 at mainbus0
prcm0 at omap0 rev 0.2
sitaracm0 at omap0: control module, rev 1.0
intc0 at omap0 rev 5.0
edma0 at omap0 rev 0.0
dmtimer0 at omap0 rev 3.1
dmtimer1 at omap0 rev 3.1
omgpio0 at omap0: rev 0.1
gpio0 at omgpio0: 32 pins
omgpio1 at omap0: rev 0.1
gpio1 at omgpio1: 32 pins
omgpio2 at omap0: rev 0.1
gpio2 at omgpio2: 32 pins
omgpio3 at omap0: rev 0.1
gpio3 at omgpio3: 32 pins
simplebus0 at mainbus0: "ocp"
simplebus1 at simplebus0: "l4_wkup"
simplebus2 at simplebus1: "scm"
com0 at simplebus0: ti16750, 64 byte fifo
com0: console
tiiic0 at simplebus0 rev 0.11
iic0 at tiiic0
"ti,tps65217" at iic0 addr 0x24 not configured
"at,24c256" at iic0 addr 0x50 not configured
"nxp,tda998x" at iic0 addr 0x70 not configured
tiiic1 at simplebus0 rev 0.11
iic1 at tiiic1
"at,24c256" at iic1 addr 0x54 not configured
"at,24c256" at iic1 addr 0x55 not configured
"at,24c256" at iic1 addr 0x56 not configured
"at,24c256" at iic1 addr 0x57 not configured
ommmc0 at simplebus0
sdmmc0 at ommmc0: 1-bit, mmc high-speed
ommmc1 at simplebus0
sdmmc1 at ommmc1: 1-bit, mmc high-speed
omdog0 at simplebus0 rev 0.1
cpsw0 at simplebus0: version 1.12 (0), address xx:xx:xx:xx:xx:xx
ukphy0 at cpsw0 phy 0: Generic IEEE 802.3u media interface, rev. 1: OUI 0x0001f0, model 0x000f
scsibus0 at sdmmc0: 2 targets, initiator 0
sd0 at scsibus0 targ 1 lun 0: <SD/MMC, SD8GB, 0030> SCSI2 0/direct fixed
sd0: 7600MB, 512 bytes/sector, 15564800 sectors
scsibus1 at sdmmc1: 2 targets, initiator 0
sd1 at scsibus1 targ 1 lun 0: <Kingston, MMC04G, 0000> SCSI2 0/direct fixed
sd1: 3688MB, 512 bytes/sector, 7553024 sectors
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
boot device: sd0
root on sd0a (b8e4fae9983283dd.a) swap on sd0b dump on sd0b
WARNING: CHECK AND RESET THE DATE!
Automatic boot in progress: starting file system checks.
/dev/sd0a (b8e4fae9983283dd.a): file system is clean; not checking
setting tty flags
pf enabled
starting network
reordering libraries: done.
openssl: generating isakmpd/iked RSA keys... done.
ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519
starting early daemons: syslogd pflogd ntpd.
starting RPC daemons:.
savecore: no core dump
checking quotas: done.
clearing /tmp
kern.securelevel: 0 -> 1
creating runtime link editor directory cache.
preserving editor files.
starting network daemons: sshd smtpd sndiod.
Path to firmware: http://firmware.openbsd.org/firmware/6.0/
No devices found which need firmware files to be downloaded.
starting local daemons: cron.
Thu Jul 28 14:31:58 JST 2016

OpenBSD/armv7 (diana.intranet) (console)

login: root
Password:
OpenBSD 6.0 (GENERIC) #286: Thu Jul 28 12:33:51 AEST 2016

Welcome to OpenBSD: The proactively secure Unix-like operating system.

Please use the sendbug(1) utility to report bugs in the system.
Before reporting a bug, please try to reproduce it with the latest
version of the code.  With bug reports, please try to ensure that
enough information to reproduce the problem is enclosed, and if a
known fix for it exists, include that as well.

You have mail.
# 

  ローカル時刻の更新

rdate で NTPサーバと同期しローカル時刻を更新する

# rdate -ncv ntp.nict.jp
Mon Sep 19 13:22:37 JST 2016
rdate: adjust local clock by 4573883.078969 seconds

  時刻同期(NTP)

時刻同期のNTPサーバを設定する

# cat /etc/ntpd.conf
# $OpenBSD: ntpd.conf,v 1.14 2015/07/15 20:28:37 ajacoutot Exp $
#
# See ntpd.conf(5) and /etc/examples/ntpd.conf

# Addresses to listen on (ntpd does not listen by default)
#listen on *

# NICT - http://www2.nict.go.jp/aeri/sts/tsp/PubNtp/index.html
servers ntp.nict.jp
# MFEED - http://www.jst.mfeed.ad.jp/
servers ntp.jst.mfeed.ad.jp

# sync to a single server
#server ntp.example.org

# use a random selection of NTP Pool Time Servers
# see http://support.ntp.org/bin/view/Servers/NTPPoolServers
#servers pool.ntp.org

# use all detected timedelta sensors
#sensor *

# get the time constraint from a well-known HTTPS site
constraints from "https://www.google.com"
#

  アクセスタイムの記録停止

アクセス時刻の更新を行わないように "noatime" オプションを追加して、SDカードの更新頻度を減らす。

# cat /etc/fstab
b8e4fae9983283dd.b none swap sw
b8e4fae9983283dd.a / ffs rw,wxallowed 1 1
# vi /etc/fstab
# cat /etc/fstab
b8e4fae9983283dd.b none swap sw
b8e4fae9983283dd.a / ffs rw,wxallowed,noatime 1 1
# 

  Web サーバ

rc.local を編集し起動するようにする。

# cat /etc/rc.local
httpd_flags=

/etc/httpd.conf を編集する。

# cat /etc/httpd.conf
# httpd.conf
ext_ip="192.168.0.254"
ext_if="cpsw0"

types { include "/usr/share/misc/mime.types" }

server "default" {
        listen on $ext_if port 80
#       listen on $ext_if tls port 443
        server_name apis.jpn.ph
        root /var/www/htdocs
}
#

  root 宛てのメールを管理者ユーザに転送する

root 宛てのメールを管理者用に作成したユーザに転送する。インストール時にユーザを作成してる場合は、自動的に設定されている。

# cat /root/.forward
username

  管理者ユーザのSSH公開鍵を設定する

SSH公開鍵でログイン出来るように公開鍵を設定する。

# echo "ssh-rsa AAAA〜中略〜= my public server">/home/username/.ssh/authorized_keys

最終更新時間:2019年10月21日 16時31分14秒 指摘や意見などあればSandBoxのBBSへ。

teraterm.log