4
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Raspberry Pi 3 B+ に FreeBSD 12.0-RELEASE をインストール

Last updated at Posted at 2018-12-21

FreeBSD 12.0 Released

12月11日に予定通り 12.0 がリリース され、amd64 や i386 そして arm, aarch64 等のイメージも公開された 。aarch64 には Raspberry Pi 3 向けのイメージも作成されている。

インストール手順

ダウンロード

Raspberry Pi 3 向け aarch64 のイメージは この辺 においてある、

  • FreeBSD-12.0-RELEASE-arm64-aarch64-RPI3.img.xz

のように、 aarch64-RPI3 となっているもの1を使う。

イメージの書き込み

アナウンスにあるとおり、 arm 系のイメージは、 UNIX系の OS だと dd で書き込む。この際 間違えたデバイスファイルに向けない ように。
あと、ダウンロードした直後の xz ファイルではなく、解凍して出てきたファイルを書き込むこと。2

# xz -d FreeBSD-12.0-RELEASE-arm64-aarch64-RPI3.img.xz
# dd if=./FreeBSD-12.0-RELEASE-arm64-aarch64-RPI3.img of=/dev/XXX conv=sync
5242880+0 records in
5242880+0 records out
2684354560 bytes transferred in 2009.617495 secs (1335754 bytes/sec)

起動確認

dmesg はこんな感じ。

---<<BOOT>>---
Copyright (c) 1992-2018 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 12.0-RELEASE r341666 GENERIC arm64
FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1)
VT(efifb): resolution 1280x1024
KLD file umodem.ko is missing dependencies
Starting CPU 1 (1)
Starting CPU 2 (2)
Starting CPU 3 (3)
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
random: unblocking device.
random: entropy device external interface
MAP 7ffe000 mode 2 pages 2
MAP 8007000 mode 2 pages 2
MAP 39f35000 mode 2 pages 1
MAP 39f3a000 mode 2 pages 1
MAP 3b347000 mode 2 pages 1
MAP 3f100000 mode 1 pages 1
kbd0 at kbdmux0
ofwbus0: <Open Firmware Device Tree>
simplebus0: <Flattened device tree simple bus> on ofwbus0
ofw_clkbus0: <OFW clocks bus> on ofwbus0
clk_fixed0: <Fixed clock> on ofw_clkbus0
clk_fixed1: <Fixed clock> on ofw_clkbus0
regfix0: <Fixed Regulator> on ofwbus0
regfix1: <Fixed Regulator> on ofwbus0
psci0: <ARM Power State Co-ordination Interface Driver> on ofwbus0
local_intc0: <BCM2836 Interrupt Controller> mem 0x40000000-0x400000ff on simplebus0
intc0: <BCM2835 Interrupt Controller> mem 0x7e00b200-0x7e00b3ff irq 20 on simplebus0
gpio0: <BCM2708/2835 GPIO controller> mem 0x7e200000-0x7e2000b3 irq 22,23 on simplebus0
gpiobus0: <OFW GPIO bus> on gpio0
generic_timer0: <ARMv7 Generic Timer> irq 0,1,2,3 on ofwbus0
Timecounter "ARM MPCore Timecounter" frequency 19200000 Hz quality 1000
Event timer "ARM MPCore Eventtimer" frequency 19200000 Hz quality 1000
bcm_dma0: <BCM2835 DMA Controller> mem 0x7e007000-0x7e007eff irq 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 on simplebus0
bcmwd0: <BCM2708/2835 Watchdog> mem 0x7e100000-0x7e100027 on simplebus0
bcmrng0: <Broadcom BCM2835 RNG> mem 0x7e104000-0x7e10400f on simplebus0
mbox0: <BCM2835 VideoCore Mailbox> mem 0x7e00b880-0x7e00b8bf irq 21 on simplebus0
gpioc0: <GPIO controller> on gpio0
uart0: <PrimeCell UART (PL011)> mem 0x7e201000-0x7e201fff irq 24 on simplebus0
uart0: console (115200,n,8,1)
spi0: <BCM2708/2835 SPI controller> mem 0x7e204000-0x7e204fff irq 26 on simplebus0
spibus0: <OFW SPI bus> on spi0
spibus0: <unknown card> at cs 0 mode 0
spibus0: <unknown card> at cs 1 mode 0
iichb0: <BCM2708/2835 BSC controller> mem 0x7e804000-0x7e804fff irq 37 on simplebus0
bcm283x_dwcotg0: <DWC OTG 2.0 integrated USB controller (bcm283x)> mem 0x7e980000-0x7e98ffff,0x7e006000-0x7e006fff irq 43,44 on simplebus0
usbus0 on bcm283x_dwcotg0
sdhci_bcm0: <Broadcom 2708 SDHCI controller> mem 0x7e300000-0x7e3000ff irq 46 on simplebus0
mmc0: <MMC/SD bus> on sdhci_bcm0
fb0: <BCM2835 VT framebuffer driver> on simplebus0
fbd0 on fb0
VT: Replacing driver "efifb" with new "fb".
fb0: 1280x1024(1280x1024@0,0) 24bpp
fb0: fbswap: 1, pitch 3840, base 0x3e83a000, screen_size 3932160
pmu0: <Performance Monitoring Unit> irq 50 on simplebus0
cpulist0: <Open Firmware CPU Group> on ofwbus0
cpu0: <Open Firmware CPU> on cpulist0
bcm2835_cpufreq0: <CPU Frequency Control> on cpu0
cpu1: <Open Firmware CPU> on cpulist0
cpu2: <Open Firmware CPU> on cpulist0
cpu3: <Open Firmware CPU> on cpulist0
gpioled0: <GPIO LEDs> on ofwbus0
gpioled0: <led1> failed to map pin
cryptosoft0: <software crypto>
Timecounters tick every 1.000 msec
iicbus0: <OFW I2C bus> on iichb0
iic0: <I2C generic I/O> on iicbus0
usbus0: 480Mbps High Speed USB v2.0
ugen0.1: <DWCOTG OTG Root HUB> at usbus0
uhub0: <DWCOTG OTG Root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
mmcsd0: 31GB <SDHC SA32G 3.4 SN 27F27221 MFG 02/2018 by 2 TM> at mmc0 50.0MHz/4bit/65535-block
mbox0: mbox response error
bcm2835_cpufreq0: can't get clock rate (id=8)
bcm2835_cpufreq0: ARM 600MHz, Core 250MHz, SDRAM -999MHz, Turbo OFF
Release APs...done
CPU  0: ARM Cortex-A53 r0p4 affinity:  0
Trying to mount root from ufs:/dev/ufs/rootfs [rw]...
 Instruction Set Attributes 0 = <CRC32>
 Instruction Set Attributes 1 = <>
         Processor Features 0 = <AdvSIMD,Float,EL3 32,EL2 32,EL1 32,EL0 32>
         Processor Features 1 = <0>
      Memory Model Features 0 = <4k Granule,64k Granule,MixedEndian,S/NS Mem,16bit ASID,1TB PA>
      Memory Model Features 1 = <>
      Memory Model Features 2 = <32b CCIDX,48b VA>
             Debug Features 0 = <2 CTX Breakpoints,4 Watchpoints,6 Breakpoints,PMUv3,Debug v8>
             Debug Features 1 = <0>
         Auxiliary Features 0 = <0>
         Auxiliary Features 1 = <0>
CPU  1: ARM Cortex-A53 r0p4 affinity:  1
CPU  2: ARM Cortex-A53 r0p4 affinity:  2
CPU  3: ARM Cortex-A53 r0p4 affinity:  3
Warning: no time-of-day clock registered, system time will not be set accurately
uhub0: 1 port with 1 removable, self powered
ugen0.2: <vendor 0x0424 product 0x2514> at usbus0
uhub1 on uhub0
uhub1: <vendor 0x0424 product 0x2514, class 9/0, rev 2.00/b.b3, addr 2> on usbus0
uhub1: MTT enabled
uhub1: 4 ports with 3 removable, self powered
ugen0.3: <vendor 0x0424 product 0x2514> at usbus0
uhub2 on uhub1
uhub2: <vendor 0x0424 product 0x2514, class 9/0, rev 2.00/b.b3, addr 3> on usbus0
uhub2: MTT enabled
lo0: link state changed to UP
uhub2: 3 ports with 2 removable, self powered
ugen0.4: <vendor 0x0424 product 0x7800> at usbus0
muge0 on uhub2
muge0: <vendor 0x0424 product 0x7800, rev 2.10/3.00, addr 4> on usbus0
muge0: Chip ID 0x7800 rev 0002
miibus0: <MII bus> on muge0
ukphy0: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto
ue0: <USB Ethernet> on muge0
ue0: Ethernet address: xx:xx:xx:xx:xx:xx
ugen0.5: <vendor 0x04f3 product 0x0103> at usbus0
ukbd0 on uhub1
ukbd0: <vendor 0x04f3 product 0x0103, class 0/0, rev 1.10/1.07, addr 5> on usbus0
kbd1 at ukbd0
ue0: link state changed to UP
muge0: Chip ID 0x7800 rev 0002
ue0: link state changed to DOWN
ue0: link state changed to UP
uhid0 on uhub1
uhid0: <vendor 0x04f3 product 0x0103, class 0/0, rev 1.10/1.07, addr 5> on usbus0

FreeBSD/arm64 (generic) (ttyv1)

login:

初期状態だと root ユーザのパスワードは root と設定され、 rc.conf を見ると

/etc/rc.conf
hostname="generic"
ifconfig_DEFAULT="DHCP"
sshd_enable="YES"
sendmail_enable="NONE"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
growfs_enable="YES"

として、 sshd が有効になっている。
また、 /etc/passwd を見ると

freebsd:*:1001:1001:FreeBSD User:/home/freebsd:/bin/csh

のように、初期ユーザ freebsd がパスワード freebsd として設定もされているため、
割り当てられた IP アドレスがわかりさえすればこの時点から ssh 越しでの作業が可能となる。

これ以降は、

  • root ユーザのパスワード変更
  • タイムゾーンの設定
  • 新規ユーザの追加

等、ほぼインストール直後の素の FreeBSD と同等の作業が続く。

補足

今回は Raspberry Pi 3B+ を使用しているが、少なくとも今の状態では 無線LAN インターフェイスが見えていない ので使えない。
詳細なサポート状況諸々は この辺 参照のこと。

  1. イメージの命名規則については snapshot と同様

  2. 毎回 xz ファイルを書き込んで「起動しないなぁ」と無駄な時間を消費する羽目に

4
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?