kraftsrv.net

Raspberry Pi 上の FreeBSD 環境のメジャーアップグレード

Raspberry Pi 上の FreeBSD 13.2-RELEASE 環境を 14.0-RELEASE にメジャーアップグレードする手順です。

アップグレード前の確認

OS リリースレベルとバージョン

アップグレード前の OS リリースレベルとバージョンを確認します。

OS リリースレベル

root@raspberrypi:~ # uname -r
13.2-RELEASE-p4

カーネルのバージョン

root@raspberrypi:~ # freebsd-version -k
13.2-RELEASE-p4

ユーザランドのバージョン

root@raspberrypi:~ # freebsd-version -u
13.2-RELEASE-p6

freebsd-update の設定

本稿では freebsd-update の設定は全てデフォルトを使用することとします。
以下は /etc/freebsd-update.conf の設定内容となります。

KeyPrint 800651ef4b4c71c27e60786d7b487188970f4b4169cc055784e21eb71d410cc5
ServerName update.FreeBSD.org
Components src world kernel
IgnorePaths
IDSIgnorePaths /usr/share/man/cat
IDSIgnorePaths /usr/share/man/whatis
IDSIgnorePaths /var/db/locate.database
IDSIgnorePaths /var/log
UpdateIfUnmodified /etc/ /var/ /root/ /.cshrc /.profile
MergeChanges /etc/ /boot/device.hints
# WorkDir /var/db/freebsd-update
# MailTo root
# AllowAdd yes
# AllowDelete yes
# KeepModifiedMetadata yes
# StrictComponents no
# BackupKernel yes
# BackupKernelDir /boot/kernel.old
# BackupKernelSymbolFiles no
# CreateBootEnv yes

アップグレードの準備

ファイルの取得

14.0-RELEASE へのアップグレードに必要なファイルを取得します。

root@raspberrypi:~ # freebsd-update -r 14.0-RELEASE upgrade

インストールされたコンポーネント確認のプロンプトが表示されます。
『y』を入力して Enter を押下します。

src component not installed, skipped
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching metadata signature for 13.2-RELEASE from update1.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata files... done.
Inspecting system... done.

The following components of FreeBSD seem to be installed:
kernel/generic kernel/generic-dbg world/base world/base-dbg

The following components of FreeBSD do not seem to be installed:

Does this look reasonable (y/n)? y

ファイルの取得処理が行われます。

Fetching metadata signature for 14.0-RELEASE from update1.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.
Fetching files from 13.2-RELEASE for merging... done.
Preparing to download files... done.
Fetching 10774 patches.....10....20....30....40....50....60....70....80....90....100....110....120....130....140....150..
....
....
..10700....10710....10720....10730....10740....10750....10760....10770.. done.
Applying patches... done.
Fetching 1363 files... ....10....20....30....40....50....60....70....80....90....100....110....120....130....140....150..
....
....
..1300....1310....1320....1330....1340....1350....1360. done.
Attempting to automatically merge changes in files... done.

/etc/group のマージが自動的に行われなかったため、手動での編集が必要であるメッセージが表示されます。
そのまま Enter を押下します。

The following file could not be merged automatically: /etc/group
Press Enter to edit this file in vi and resolve the conflicts
manually...

エディタ (vi) が起動して /etc/group の編集画面が表示されます。
※エディタの編集画面は行番号の表示を行っています。

      1 <<<<<<< current version
      2 # $FreeBSD$
      3 #
      4 wheel:*:0:root,admin
      5 =======
      6 wheel:*:0:root
      7 >>>>>>> 14.0-RELEASE
      8 daemon:*:1:
      9 kmem:*:2:
     10 sys:*:3:
     11 tty:*:4:
     12 operator:*:5:root
     13 mail:*:6:
     14 bin:*:7:
     15 news:*:8:
     16 man:*:9:
     17 games:*:13:
     18 ftp:*:14:
     19 staff:*:20:
     20 sshd:*:22:
     21 smmsp:*:25:
     22 mailnull:*:26:
     23 guest:*:31:
     24 video:*:44:
     25 realtime:*:47:
     26 idletime:*:48:
     27 bind:*:53:
     28 unbound:*:59:
     29 proxy:*:62:
     30 authpf:*:63:
     31 _pflogd:*:64:
     32 _dhcp:*:65:
     33 uucp:*:66:
     34 dialer:*:68:
     35 network:*:69:
     36 audit:*:77:
     37 www:*:80:
     38 u2f:*:116:
     39 ntpd:*:123:

本稿では admin ユーザを wheel グループに所属させているため、以下の内容となるよう編集を行うこととします。
編集後、エディタを保存終了します。

      1 wheel:*:0:root,admin
      2 daemon:*:1:
      3 kmem:*:2:
      4 sys:*:3:
      5 tty:*:4:
      6 operator:*:5:root
      7 mail:*:6:
      8 bin:*:7:
      9 news:*:8:
     10 man:*:9:
     11 games:*:13:
     12 ftp:*:14:
     13 staff:*:20:
     14 sshd:*:22:
     15 smmsp:*:25:
     16 mailnull:*:26:
     17 guest:*:31:
     18 video:*:44:
     19 realtime:*:47:
     20 idletime:*:48:
     21 bind:*:53:
     22 unbound:*:59:
     23 proxy:*:62:
     24 authpf:*:63:
     25 _pflogd:*:64:
     26 _dhcp:*:65:
     27 uucp:*:66:
     28 dialer:*:68:
     29 network:*:69:
     30 audit:*:77:
     31 www:*:80:
     32 u2f:*:116:
     33 ntpd:*:123:
     34 _ypldap:*:160:
     35 hast:*:845:
     36 tests:*:977:
     37 nogroup:*:65533:
     38 nobody:*:65534:
     39 admin:*:1002:

/etc/master.passwd のマージが自動的に行われなかったため、手動での編集が必要であるメッセージが表示されます。
そのまま Enter を押下します。

The following file could not be merged automatically: /etc/master.passwd
Press Enter to edit this file in vi and resolve the conflicts
manually...

エディタが起動して /etc/master.passwd の編集画面が表示されます。

      1 <<<<<<< current version
      2 # $FreeBSD$
      3 #
      4 root:$6$14h/j********wHRbe/j/:0:0::0:0:Charlie &:/root:/bin/csh
      5 =======
      6 root::0:0::0:0:Charlie &:/root:/bin/sh
      7 >>>>>>> 14.0-RELEASE
      8 toor:*:0:0::0:0:Bourne-again Superuser:/root:
      9 daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin
     10 operator:*:2:5::0:0:System &:/:/usr/sbin/nologin
     11 bin:*:3:7::0:0:Binaries Commands and Source:/:/usr/sbin/nologin
     12 tty:*:4:65533::0:0:Tty Sandbox:/:/usr/sbin/nologin
     13 kmem:*:5:65533::0:0:KMem Sandbox:/:/usr/sbin/nologin
     14 games:*:7:13::0:0:Games pseudo-user:/:/usr/sbin/nologin
     15 news:*:8:8::0:0:News Subsystem:/:/usr/sbin/nologin
     16 man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/usr/sbin/nologin
     17 sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin
     18 smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin
     19 mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin
     20 bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin
     21 unbound:*:59:59::0:0:Unbound DNS Resolver:/var/unbound:/usr/sbin/nologin
     22 proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin
     23 _pflogd:*:64:64::0:0:pflogd privsep user:/var/empty:/usr/sbin/nologin
     24 _dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin
     25 uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/local/libexec/uucp/uucico
     26 pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin
     27 auditdistd:*:78:77::0:0:Auditdistd unprivileged user:/var/empty:/usr/sbin/nologin
     28 www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin
     29 ntpd:*:123:123::0:0:NTP Daemon:/var/db/ntp:/usr/sbin/nologin
     30 _ypldap:*:160:160::0:0:YP LDAP unprivileged user:/var/empty:/usr/sbin/nologin
     31 hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologin
     32 tests:*:977:977::0:0:Unprivileged user for tests:/nonexistent:/usr/sbin/nologin
     33 nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin
     34 admin:$6$buQkr********IByGDjS1:1002:1002::0:0:User &:/home/admin:/usr/local/bin/bash

FreeBSD 14 から root ユーザのデフォルトのシェルは sh(1) となります。
本稿ではその変更に従って以下の内容となるよう編集を行うこととします。
編集後、エディタを保存終了します。

      1 root:$6$14h/j********wHRbe/j/:0:0::0:0:Charlie &:/root:/bin/sh
      2 toor:*:0:0::0:0:Bourne-again Superuser:/root:
      3 daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin
      4 operator:*:2:5::0:0:System &:/:/usr/sbin/nologin
      5 bin:*:3:7::0:0:Binaries Commands and Source:/:/usr/sbin/nologin
      6 tty:*:4:65533::0:0:Tty Sandbox:/:/usr/sbin/nologin
      7 kmem:*:5:65533::0:0:KMem Sandbox:/:/usr/sbin/nologin
      8 games:*:7:13::0:0:Games pseudo-user:/:/usr/sbin/nologin
      9 news:*:8:8::0:0:News Subsystem:/:/usr/sbin/nologin
     10 man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/usr/sbin/nologin
     11 sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin
     12 smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin
     13 mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin
     14 bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin
     15 unbound:*:59:59::0:0:Unbound DNS Resolver:/var/unbound:/usr/sbin/nologin
     16 proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin
     17 _pflogd:*:64:64::0:0:pflogd privsep user:/var/empty:/usr/sbin/nologin
     18 _dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin
     19 uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/local/libexec/uucp/uucico
     20 pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin
     21 auditdistd:*:78:77::0:0:Auditdistd unprivileged user:/var/empty:/usr/sbin/nologin
     22 www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin
     23 ntpd:*:123:123::0:0:NTP Daemon:/var/db/ntp:/usr/sbin/nologin
     24 _ypldap:*:160:160::0:0:YP LDAP unprivileged user:/var/empty:/usr/sbin/nologin
     25 hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologin
     26 tests:*:977:977::0:0:Unprivileged user for tests:/nonexistent:/usr/sbin/nologin
     27 nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin
     28 admin:$6$buQkr********IByGDjS1:1002:1002::0:0:User &:/home/admin:/usr/local/bin/bash

/etc/ntp.conf のマージが自動的に行われなかったため、手動での編集が必要であるメッセージが表示されます。
そのまま Enter を押下します。

The following file could not be merged automatically: /etc/ntp.conf
Press Enter to edit this file in vi and resolve the conflicts
manually...

エディタが起動して /etc/ntp.conf の編集画面が表示されます。

     21 #
     22 # The following pool statements will give you a random set of IPv4 and IPv6
     23 # NTP servers geographically close to you.  A single pool statement adds
     24 # multiple servers from the pool, according to the tos minclock/maxclock
     25 # targets.
     26 # See http://www.pool.ntp.org/ for details.  Note, pool.ntp.org encourages
     27 # users with a static IP and good upstream NTP servers to add a server
     28 # to the pool.  See http://www.pool.ntp.org/join.html if you are interested.
     29 #
     30 # The option `iburst' is used for faster initial synchronization.
     31 #
     32 <<<<<<< current version
     33 #pool 0.freebsd.pool.ntp.org iburst
     34 server ntp1.jst.mfeed.ad.jp iburst
     35 server ntp2.jst.mfeed.ad.jp iburst
     36 server ntp3.jst.mfeed.ad.jp iburst
     37 =======
     38 pool 0.freebsd.pool.ntp.org iburst
     39 pool 2.freebsd.pool.ntp.org iburst
     40 >>>>>>> 14.0-RELEASE
     41
     42 #
     43 # If you want to pick yourself which country's public NTP server
     44 # you want to sync against, comment out the above pool statements,
     45 # uncomment the next ones, and replace CC with the country's abbreviation.
     46 # Make sure that the hostnames resolves to a proper IP address!
     47 #
     48 # pool 0.CC.pool.ntp.org iburst
     49 # pool 2.CC.pool.ntp.org iburst
     50
     51 #
     52 # To configure a specific server, such as an organization-wide local
     53 # server, add lines similar to the following.  One or more specific
     54 # servers can be configured in addition to, or instead of, any server
     55 # pools specified above.  When both are configured, ntpd first adds all
     56 # the specific servers, then adds servers from the pool until the tos
     57 # minclock/maxclock targets are met.
     58 #
     59 #server time.my-internal.org iburst

本稿では以下の内容となるよう編集を行うこととします。
編集後、エディタを保存終了します。

     21 #
     22 # The following pool statements will give you a random set of IPv4 and IPv6
     23 # NTP servers geographically close to you.  A single pool statement adds
     24 # multiple servers from the pool, according to the tos minclock/maxclock
     25 # targets.
     26 # See http://www.pool.ntp.org/ for details.  Note, pool.ntp.org encourages
     27 # users with a static IP and good upstream NTP servers to add a server
     28 # to the pool.  See http://www.pool.ntp.org/join.html if you are interested.
     29 #
     30 # The option `iburst' is used for faster initial synchronization.
     31 #
     32 #pool 0.freebsd.pool.ntp.org iburst
     33 server ntp1.jst.mfeed.ad.jp iburst
     34 server ntp2.jst.mfeed.ad.jp iburst
     35 server ntp3.jst.mfeed.ad.jp iburst
     36
     37 #
     38 # If you want to pick yourself which country's public NTP server
     39 # you want to sync against, comment out the above pool statements,
     40 # uncomment the next ones, and replace CC with the country's abbreviation.
     41 # Make sure that the hostnames resolves to a proper IP address!
     42 #
     43 # pool 0.CC.pool.ntp.org iburst
     44 # pool 2.CC.pool.ntp.org iburst
     45
     46 #
     47 # To configure a specific server, such as an organization-wide local
     48 # server, add lines similar to the following.  One or more specific
     49 # servers can be configured in addition to, or instead of, any server
     50 # pools specified above.  When both are configured, ntpd first adds all
     51 # the specific servers, then adds servers from the pool until the tos
     52 # minclock/maxclock targets are met.
     53 #
     54 #server time.my-internal.org iburst
     55
     56 #
     57 # Security:
     58 #
     59 # By default, only allow time queries and block all other requests

/etc/ttys のマージが自動的に行われなかったため、手動での編集が必要であるメッセージが表示されます。
そのまま Enter を押下します。

The following file could not be merged automatically: /etc/ttys
Press Enter to edit this file in vi and resolve the conflicts
manually...

エディタが起動して /etc/ttys の編集画面が表示されます。

     21 # status Must be on or off.  If on, init will run the getty program on
     22 #        the specified port.  If the word "secure" appears, this tty
     23 #        allows root login.
     24 #
     25 # name  getty                           type    status          comments
     26 #
     27 # If console is marked "insecure", then init will ask for the root password
     28 # when going to single-user mode.
     29 console none                            unknown off secure
     30 #
     31 ttyv0   "/usr/libexec/getty Pc"         xterm   onifexists secure
     32 # Virtual terminals
     33 ttyv1   "/usr/libexec/getty Pc"         xterm   onifexists secure
     34 ttyv2   "/usr/libexec/getty Pc"         xterm   onifexists secure
     35 ttyv3   "/usr/libexec/getty Pc"         xterm   onifexists secure
     36 ttyv4   "/usr/libexec/getty Pc"         xterm   onifexists secure
     37 ttyv5   "/usr/libexec/getty Pc"         xterm   onifexists secure
     38 ttyv6   "/usr/libexec/getty Pc"         xterm   onifexists secure
     39 ttyv7   "/usr/libexec/getty Pc"         xterm   onifexists secure
     40 ttyv8   "/usr/local/bin/xdm -nodaemon"  xterm   off secure
     41 # Serial terminals
     42 # The 'dialup' keyword identifies dialin lines to login, fingerd etc.
     43 ttyu0   "/usr/libexec/getty 3wire"      vt100   onifconsole secure
     44 ttyu1   "/usr/libexec/getty 3wire"      vt100   onifconsole secure
     45 ttyu2   "/usr/libexec/getty 3wire"      vt100   onifconsole secure
     46 ttyu3   "/usr/libexec/getty 3wire"      vt100   onifconsole secure
     47 # Dumb console
     48 dcons   "/usr/libexec/getty std.115200" vt100   off secure
     49 # Xen Virtual console
     50 xc0     "/usr/libexec/getty Pc"         xterm   onifconsole secure
     51 # RISC-V HTIF console
     52 <<<<<<< current version
     53 rcons   "/usr/libexec/getty std.9600"   vt100   onifconsole secure
     54 # USB OTG virtual serial port
     55 ttyU0   "/usr/libexec/getty 3wire"      vt100   onifconsole  secure
     56 ttyU1   "/usr/libexec/getty 3wire"      vt100   onifconsole  secure
     57 =======
     58 rcons   "/usr/libexec/getty std.115200" vt100   onifconsole secure
     59 >>>>>>> 14.0-RELEASE

本稿では以下の内容となるよう編集を行うこととします。
編集後、エディタを保存終了します。

     17 #      For virtual consoles, the correct type is typically xterm.
     18 #      Other common values include dialup for incoming modem ports, and
     19 #      unknown when the terminal type cannot be predetermined.
     20 #
     21 # status Must be on or off.  If on, init will run the getty program on
     22 #        the specified port.  If the word "secure" appears, this tty
     23 #        allows root login.
     24 #
     25 # name  getty                           type    status          comments
     26 #
     27 # If console is marked "insecure", then init will ask for the root password
     28 # when going to single-user mode.
     29 console none                            unknown off secure
     30 #
     31 ttyv0   "/usr/libexec/getty Pc"         xterm   onifexists secure
     32 # Virtual terminals
     33 ttyv1   "/usr/libexec/getty Pc"         xterm   onifexists secure
     34 ttyv2   "/usr/libexec/getty Pc"         xterm   onifexists secure
     35 ttyv3   "/usr/libexec/getty Pc"         xterm   onifexists secure
     36 ttyv4   "/usr/libexec/getty Pc"         xterm   onifexists secure
     37 ttyv5   "/usr/libexec/getty Pc"         xterm   onifexists secure
     38 ttyv6   "/usr/libexec/getty Pc"         xterm   onifexists secure
     39 ttyv7   "/usr/libexec/getty Pc"         xterm   onifexists secure
     40 ttyv8   "/usr/local/bin/xdm -nodaemon"  xterm   off secure
     41 # Serial terminals
     42 # The 'dialup' keyword identifies dialin lines to login, fingerd etc.
     43 ttyu0   "/usr/libexec/getty 3wire"      vt100   onifconsole secure
     44 ttyu1   "/usr/libexec/getty 3wire"      vt100   onifconsole secure
     45 ttyu2   "/usr/libexec/getty 3wire"      vt100   onifconsole secure
     46 ttyu3   "/usr/libexec/getty 3wire"      vt100   onifconsole secure
     47 # Dumb console
     48 dcons   "/usr/libexec/getty std.115200" vt100   off secure
     49 # Xen Virtual console
     50 xc0     "/usr/libexec/getty Pc"         xterm   onifconsole secure
     51 # RISC-V HTIF console
     52 rcons   "/usr/libexec/getty std.9600"   vt100   onifconsole secure
     53 # USB OTG virtual serial port
     54 ttyU0   "/usr/libexec/getty 3wire"      vt100   onifconsole  secure
     55 ttyU1   "/usr/libexec/getty 3wire"      vt100   onifconsole  secure

/etc/devd.conf のアップグレードに因る差分確認のプロンプトが表示されます。
『y』を入力して Enter を押下します。

The following changes, which occurred between FreeBSD 13.2-RELEASE and
FreeBSD 14.0-RELEASE have been merged into /etc/devd.conf:
--- current version
+++ new version
@@ -1,6 +1,5 @@
-# $FreeBSD$
 #
 # Refer to devd.conf(5) and devd(8) man pages for the details on how to
 # run and configure devd.
 #

@@ -17,12 +16,12 @@
        pid-file "/var/run/devd.pid";

        # Setup some shorthand for regex that we use later in the file.
        #XXX Yes, this is gross -- imp
        set wifi-driver-regex
-               "(ath|bwi|bwn|ipw|iwlwifi|iwi|iwm|iwn|malo|mwl|otus|ral|rsu|rtw|rtwn|rum|\
-               run|uath|upgt|ural|urtw|wpi|wtap|zyd)[0-9]+";
+               "(ath|ath[0-9]+k|bwi|bwn|ipw|iwlwifi|iwi|iwm|iwn|malo|mwl|mt79|otus|\
+               ral|rsu|rtw|rtwn|rum|run|uath|upgt|ural|urtw|wpi|wtap|zyd)[0-9]+";
 };

 # Note that the attach/detach with the highest value wins, so that one can
 # override these general rules.

@@ -43,23 +42,10 @@
        match "type"            "ATTACH";
        action "/etc/pccard_ether $subsystem start";
 };

 #
-# Try to start dhclient on Ethernet-like interfaces when the link comes
-# up.  Only devices that are configured to support DHCP will actually
-# run it.  No link down rule exists because dhclient automatically exits
-# when the link goes down.
-#
-notify 0 {
-       match "system"          "IFNET";
-       match "type"            "LINK_UP";
-       media-type              "ethernet";
-       action "service dhclient quietstart $subsystem";
-};
-
-#
 # Like Ethernet devices, but separate because 802.11 require spawning
 # wlan(4) interface.
 #
 attach 0 {
        device-name "$wifi-driver-regex";
@@ -67,16 +53,10 @@
 };
 detach 0 {
        device-name "$wifi-driver-regex";
        action "/etc/pccard_ether $device-name stopchildren";
 };
-notify 0 {
-       match "system"          "IFNET";
-       match "type"            "LINK_UP";
-       media-type              "802.11";
-       action "service dhclient quietstart $subsystem";
-};

 # An entry like this might be in a different file, but is included here
 # as an example of how to override things.  Normally 'ed50' would match
 # the above attach/detach stuff, but the value of 100 makes it
 # hard wired to 1.2.3.4.
@@ -86,73 +66,17 @@
 };
 detach 100 {
        device-name "ed50";
 };

-# When a USB Bluetooth dongle appears, activate it
-attach 100 {
-       device-name "ubt[0-9]+";
-       action "service bluetooth quietstart $device-name";
-};
-detach 100 {
-       device-name "ubt[0-9]+";
-       action "service bluetooth quietstop $device-name";
-};
-
 # Firmware downloader for Atheros AR3011 based USB Bluetooth devices
 #attach 100 {
 #      match "vendor" "0x0cf3";
 #      match "product" "0x3000";
 #      action "sleep 2 && /usr/sbin/ath3kfw -d $device-name -f /usr/local/etc/ath3k-1.fw";
 #};

-# When a USB keyboard arrives, attach it as the console keyboard.
-attach 100 {
-       device-name "ukbd0";
-       action "service syscons setkeyboard /dev/ukbd0";
-};
-detach 100 {
-       device-name "ukbd0";
-       action "service syscons setkeyboard /dev/kbd0";
-};
-
-notify 100 {
-       match "system" "DEVFS";
-       match "subsystem" "CDEV";
-       match "type" "CREATE";
-       match "cdev" "atp[0-9]+";
-
-       action "service moused quietstart $cdev";
-};
-
-notify 100 {
-       match "system" "DEVFS";
-       match "subsystem" "CDEV";
-       match "type" "CREATE";
-       match "cdev" "ums[0-9]+";
-
-       action "service moused quietstart $cdev";
-};
-
-notify 100 {
-       match "system" "DEVFS";
-       match "subsystem" "CDEV";
-       match "type" "CREATE";
-       match "cdev" "wsp[0-9]+";
-
-       action "service moused quietstart $cdev";
-};
-
-notify 100 {
-       match "system" "DEVFS";
-       match "subsystem" "CDEV";
-       match "type" "DESTROY";
-       match "cdev" "ums[0-9]+";
-
-       action "service moused stop $cdev";
-};
-
 # Don't even try to second guess what to do about drivers that don't
 # match here.  Instead, pass it off to syslog.  Commented out for the
 # moment, as the pnpinfo variable isn't set in devd yet.  Individual
 # variables within the bus supplied pnpinfo are set.
 nomatch 0 {
@@ -170,17 +94,10 @@
 # show the CIS info there.
 nomatch 10 {
        match "bus" "cardbus[0-9]+";
        action "logger Unknown Cardbus device: device $device class $class \
                vendor $vendor bus $bus";
-};
-
-# Switch power profiles when the AC line state changes.
-notify 10 {
-       match "system"          "ACPI";
-       match "subsystem"       "ACAD";
-       action "service power_profile $notify";
 };

 # Notify all users before beginning emergency shutdown when we get
 # a _CRT or _HOT thermal event and we're going to power down the system
 # very soon.
Does this look reasonable (y/n)? y

/etc/group のアップグレードに因る差分確認のプロンプトが表示されます。
『y』を入力して Enter を押下します。

The following changes, which occurred between FreeBSD 13.2-RELEASE and
FreeBSD 14.0-RELEASE have been merged into /etc/group:
--- current version
+++ new version
@@ -1,7 +1,5 @@
-# $FreeBSD$
-#
 wheel:*:0:root,admin
 daemon:*:1:
 kmem:*:2:
 sys:*:3:
 tty:*:4:
@@ -29,10 +27,11 @@
 uucp:*:66:
 dialer:*:68:
 network:*:69:
 audit:*:77:
 www:*:80:
+u2f:*:116:
 ntpd:*:123:
 _ypldap:*:160:
 hast:*:845:
 tests:*:977:
 nogroup:*:65533:
Does this look reasonable (y/n)? y

/etc/master.passwd のアップグレードに因る差分確認のプロンプトが表示されます。
『y』を入力して Enter を押下します。

The following changes, which occurred between FreeBSD 13.2-RELEASE and
FreeBSD 14.0-RELEASE have been merged into /etc/master.passwd:
--- current version
+++ new version
@@ -1,8 +1,6 @@
-# $FreeBSD$
-#
-root:$6$14h/j********wHRbe/j/:0:0::0:0:Charlie &:/root:/bin/csh
+root:$6$14h/j********wHRbe/j/:0:0::0:0:Charlie &:/root:/bin/sh
 toor:*:0:0::0:0:Bourne-again Superuser:/root:
 daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin
 operator:*:2:5::0:0:System &:/:/usr/sbin/nologin
 bin:*:3:7::0:0:Binaries Commands and Source:/:/usr/sbin/nologin
 tty:*:4:65533::0:0:Tty Sandbox:/:/usr/sbin/nologin
Does this look reasonable (y/n)? y

/etc/ntp.conf のアップグレードに因る差分確認のプロンプトが表示されます。
『y』を入力して Enter を押下します。

The following changes, which occurred between FreeBSD 13.2-RELEASE and
FreeBSD 14.0-RELEASE have been merged into /etc/ntp.conf:
--- current version
+++ new version
@@ -1,7 +1,6 @@
 #
-# $FreeBSD$
 #
 # Default NTP servers for the FreeBSD operating system.
 #
 # Don't forget to enable ntpd in /etc/rc.conf with:
 # ntpd_enable="YES"
@@ -18,31 +17,33 @@
 # servers are providing good consistent time.
 #
 tos minclock 3 maxclock 6

 #
-# The following pool statement will give you a random set of NTP servers
-# geographically close to you.  A single pool statement adds multiple
-# servers from the pool, according to the tos minclock/maxclock targets.
+# The following pool statements will give you a random set of IPv4 and IPv6
+# NTP servers geographically close to you.  A single pool statement adds
+# multiple servers from the pool, according to the tos minclock/maxclock
+# targets.
 # See http://www.pool.ntp.org/ for details.  Note, pool.ntp.org encourages
 # users with a static IP and good upstream NTP servers to add a server
-# to the pool. See http://www.pool.ntp.org/join.html if you are interested.
+# to the pool.  See http://www.pool.ntp.org/join.html if you are interested.
 #
 # The option `iburst' is used for faster initial synchronization.
 #
 #pool 0.freebsd.pool.ntp.org iburst
 server ntp1.jst.mfeed.ad.jp iburst
 server ntp2.jst.mfeed.ad.jp iburst
 server ntp3.jst.mfeed.ad.jp iburst

 #
 # If you want to pick yourself which country's public NTP server
-# you want to sync against, comment out the above pool, uncomment
-# the next one, and replace CC with the country's abbreviation.
-# Make sure that the hostname resolves to a proper IP address!
+# you want to sync against, comment out the above pool statements,
+# uncomment the next ones, and replace CC with the country's abbreviation.
+# Make sure that the hostnames resolves to a proper IP address!
 #
 # pool 0.CC.pool.ntp.org iburst
+# pool 2.CC.pool.ntp.org iburst

 #
 # To configure a specific server, such as an organization-wide local
 # server, add lines similar to the following.  One or more specific
 # servers can be configured in addition to, or instead of, any server
Does this look reasonable (y/n)? y

/etc/passwd のアップグレードに因る差分確認のプロンプトが表示されます。
『y』を入力して Enter を押下します。

The following changes, which occurred between FreeBSD 13.2-RELEASE and
FreeBSD 14.0-RELEASE have been merged into /etc/passwd:
--- current version
+++ new version
@@ -1,6 +1,6 @@
-root:*:0:0:Charlie &:/root:/bin/csh
+root:*:0:0:Charlie &:/root:/bin/sh
 toor:*:0:0:Bourne-again Superuser:/root:
 daemon:*:1:1:Owner of many system processes:/root:/usr/sbin/nologin
 operator:*:2:5:System &:/:/usr/sbin/nologin
 bin:*:3:7:Binaries Commands and Source:/:/usr/sbin/nologin
 tty:*:4:65533:Tty Sandbox:/:/usr/sbin/nologin
Does this look reasonable (y/n)? y

/etc/shells のアップグレードに因る差分確認のプロンプトが表示されます。
『y』を入力して Enter を押下します。

The following changes, which occurred between FreeBSD 13.2-RELEASE and
FreeBSD 14.0-RELEASE have been merged into /etc/shells:
--- current version
+++ new version
@@ -1,9 +1,7 @@
-# $FreeBSD$
-#
 # List of acceptable shells for chpass(1).
-# Ftpd will not allow users to connect who are not using
+# ftpd(8) will not allow users to connect who are not using
 # one of these shells.

 /bin/sh
 /bin/csh
 /bin/tcsh
Does this look reasonable (y/n)? y

/etc/ttys のアップグレードに因る差分確認のプロンプトが表示されます。
『y』を入力して Enter を押下します。

The following changes, which occurred between FreeBSD 13.2-RELEASE and
FreeBSD 14.0-RELEASE have been merged into /etc/ttys:
--- current version
+++ new version
@@ -1,7 +1,6 @@
 #
-# $FreeBSD$
 #      @(#)ttys        5.1 (Berkeley) 4/17/89
 #
 # This file specifies various information about terminals on the system.
 # It is used by several different programs.  Common entries for the
 # various columns include:
@@ -44,11 +43,11 @@
 ttyu0  "/usr/libexec/getty 3wire"      vt100   onifconsole secure
 ttyu1  "/usr/libexec/getty 3wire"      vt100   onifconsole secure
 ttyu2  "/usr/libexec/getty 3wire"      vt100   onifconsole secure
 ttyu3  "/usr/libexec/getty 3wire"      vt100   onifconsole secure
 # Dumb console
-dcons  "/usr/libexec/getty std.9600"   vt100   off secure
+dcons  "/usr/libexec/getty std.115200" vt100   off secure
 # Xen Virtual console
 xc0    "/usr/libexec/getty Pc"         xterm   onifconsole secure
 # RISC-V HTIF console
 rcons  "/usr/libexec/getty std.9600"   vt100   onifconsole secure
 # USB OTG virtual serial port
Does this look reasonable (y/n)? y

アップグレードに因り削除されるファイルの一覧が表示されます。
内容は PAGER に渡されるため、末尾の『:』の表示には『q』を押下して PAGER を終了します。

The following files will be removed as part of updating to
14.0-RELEASE-p1:
/boot/dtb/overlays/rk3328-dwc3.dtbo
/boot/dtb/overlays/sun50i-a64-opp.dtbo
/boot/kernel/amr.ko
/boot/kernel/amr_cam.ko
/boot/kernel/cloudabi.ko
/boot/kernel/cloudabi32.ko
/boot/kernel/cloudabi64.ko
/boot/kernel/esp.ko
/boot/kernel/geom_part_vtoc8.ko
/boot/kernel/if_ath_pci.ko
/boot/kernel/iscsi_initiator.ko
/boot/kernel/iwlwifi-Qu-b0-hr-b0-73.ucode.ko
/boot/kernel/iwlwifi-Qu-b0-jf-b0-73.ucode.ko
/boot/kernel/iwlwifi-Qu-c0-hr-b0-73.ucode.ko
/boot/kernel/iwlwifi-Qu-c0-jf-b0-73.ucode.ko
/boot/kernel/iwlwifi-QuZ-a0-hr-b0-73.ucode.ko
/boot/kernel/iwlwifi-QuZ-a0-jf-b0-73.ucode.ko
/boot/kernel/iwlwifi-cc-a0-73.ucode.ko
/boot/kernel/iwlwifi-so-a0-gf-a0-73.ucode.ko
/boot/kernel/iwlwifi-so-a0-gf4-a0-73.ucode.ko
/boot/kernel/iwlwifi-so-a0-hr-b0-73.ucode.ko
/boot/kernel/iwlwifi-so-a0-jf-b0-73.ucode.ko
/boot/kernel/iwlwifi-ty-a0-gf-a0-73.ucode.ko
/boot/kernel/ktls_ocf.ko
/boot/kernel/ng_atmllc.ko
/boot/kernel/ng_ccatm.ko
/boot/kernel/ng_sppp.ko
/boot/kernel/ng_sscfu.ko
/boot/kernel/ng_sscop.ko
/boot/kernel/ng_uni.ko
/boot/kernel/ngatmbase.ko
/boot/kernel/snd_ad1816.ko
/boot/kernel/snd_ds1.ko
/boot/kernel/snd_ess.ko
/boot/kernel/snd_maestro.ko
/boot/kernel/snd_sb16.ko
/boot/kernel/snd_sb8.ko
:

アップグレードに因り追加されるファイルの一覧が表示されます。
『q』を押下して PAGER を終了します。

The following files will be added as part of updating to
14.0-RELEASE-p1:
/bin/cpuset
/boot/dtb/freescale/fsl-ls1028a-rdb.dtb
/boot/dtb/overlays/sun50i-a64-mmc0-disable.dtbo
/boot/dtb/overlays/sun50i-a64-mmc1-disable.dtbo
/boot/dtb/overlays/sun50i-a64-mmc2-disable.dtbo
/boot/dtb/rockchip/rk3328-nanopi-r2s.dtb
/boot/dtb/rockchip/rk3328-rock-pi-e.dtb
/boot/dtb/rockchip/rk3399-nanopc-t4.dtb
/boot/dtb/rockchip/rk3399-nanopi-r4s.dtb
/boot/kernel/cc_newreno.ko
/boot/kernel/e6000sw.ko
/boot/kernel/felix.ko
/boot/kernel/flexspi.ko
/boot/kernel/geom_union.ko
/boot/kernel/hv_hid.ko
/boot/kernel/hv_netvsc.ko
/boot/kernel/hv_sock.ko
/boot/kernel/hv_storvsc.ko
/boot/kernel/hv_utils.ko
/boot/kernel/hv_vmbus.ko
/boot/kernel/ibcore.ko
/boot/kernel/ice_ddp.ko
/boot/kernel/if_enetc.ko
/boot/kernel/if_gve.ko
/boot/kernel/if_ice.ko
/boot/kernel/if_mvneta.ko
/boot/kernel/if_ovpn.ko
/boot/kernel/ipoib.ko
/boot/kernel/irdma.ko
/boot/kernel/iser.ko
/boot/kernel/iw_cxgbe.ko
/boot/kernel/iwlwifi-Qu-b0-hr-b0-77.ucode.ko
/boot/kernel/iwlwifi-Qu-b0-jf-b0-77.ucode.ko
/boot/kernel/iwlwifi-Qu-c0-hr-b0-77.ucode.ko
/boot/kernel/iwlwifi-Qu-c0-jf-b0-77.ucode.ko
/boot/kernel/iwlwifi-QuZ-a0-hr-b0-77.ucode.ko
/boot/kernel/iwlwifi-QuZ-a0-jf-b0-77.ucode.ko
:

アップグレードに因り更新されるファイルの一覧が表示されます。
『q』を押下して PAGER を終了します。

The following files will be updated as part of updating to
14.0-RELEASE-p1:
/.cshrc
/.profile
/COPYRIGHT
/bin/[
/bin/cat
/bin/chflags
/bin/chio
/bin/chmod
/bin/cp
/bin/csh
/bin/date
/bin/dd
/bin/df
/bin/domainname
/bin/echo
/bin/ed
/bin/expr
/bin/freebsd-version
/bin/getfacl
/bin/hostname
/bin/kenv
/bin/kill
/bin/link
/bin/ln
/bin/ls
/bin/mkdir
/bin/mv
/bin/nproc
/bin/pax
/bin/pgrep
/bin/pkill
/bin/ps
/bin/pwait
/bin/pwd
/bin/realpath
/bin/red
/bin/rm
:

アップグレードのインストールを実行するコマンドのメッセージが表示されます。

To install the downloaded upgrades, run "/usr/sbin/freebsd-update install".

アップグレードのインストール

ファイルのインストール

取得したファイルをインストール (1 回目の freebsd-update コマンドを実行) します。

root@raspberrypi:~ # freebsd-update install
src component not installed, skipped
Installing updates...
Kernel updates have been installed.  Please reboot and run
"/usr/sbin/freebsd-update install" again to finish installing updates.

再起動

FreeBSD を再起動します。

root@raspberrypi:~ # shutdown -r now

ユーザランドのアップグレードのインストール

ファイルのインストール

取得したファイルをインストール (2 回目の freebsd-update コマンドを実行) します。

root@raspberrypi:~ # freebsd-update install
src component not installed, skipped
Installing updates...install: ///var/db/etcupdate/current/etc/devd/bluetooth.conf: No such file or directory
install: ///var/db/etcupdate/current/etc/devd/dhclient.conf: No such file or directory
install: ///var/db/etcupdate/current/etc/devd/hyperv.conf: No such file or directory
install: ///var/db/etcupdate/current/etc/devd/moused.conf: No such file or directory
install: ///var/db/etcupdate/current/etc/devd/power_profile.conf: No such file or directory
install: ///var/db/etcupdate/current/etc/devd/syscons.conf: No such file or directory
install: ///var/db/etcupdate/current/etc/mtree/BSD.lib32.dist: No such file or directory
install: ///var/db/etcupdate/current/etc/rc.d/dnctl: No such file or directory
install: ///var/db/etcupdate/current/etc/rc.d/ggated: No such file or directory
install: ///var/db/etcupdate/current/etc/rc.d/zpoolupgrade: No such file or directory
rm: ///usr/include/c++/v1/__string: is a directory

Restarting sshd after upgrade
Performing sanity check on sshd configuration.
Stopping sshd.
Waiting for PIDS: 934.
Performing sanity check on sshd configuration.
Starting sshd.
Scanning /usr/share/certs/untrusted for certificates...
Scanning /usr/share/certs/trusted for certificates...

Completing this upgrade requires removing old shared object files.
Please rebuild all installed 3rd party software (e.g., programs
installed from the ports tree) and then run "/usr/sbin/freebsd-update install"
again to finish installing updates.

パッケージのアップグレード

パッケージのアップグレード

メジャーアップグレードの場合は ABI も変わるため、インストール済みパッケージのアップグレードが必要となります。
pkg-static コマンドを使用してパッケージをアップグレードします。
※本稿の環境では bash と apache24 パッケージがインストール済みであるとします。

コマンド実行後、アップグレード確認のプロンプトが表示されます。
『y』を入力します。

root@raspberrypi:~ # pkg-static upgrade -f
pkg-static: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
Updating FreeBSD repository catalogue...
pkg-static: Repository FreeBSD has a wrong packagesite, need to re-create database
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01
Fetching packagesite.pkg: 100%    7 MiB   6.9MB/s    00:01
Processing entries: 100%
FreeBSD repository update completed. 32806 packages processed.
All repositories are up to date.
Checking for upgrades (20 candidates): 100%
Processing candidates (20 candidates): 100%
The following 20 package(s) will be affected (of 0 checked):

Installed packages to be REINSTALLED:
        apache24-2.4.58_1
        apr-1.7.3.1.6.3_1 (ABI changed: 'freebsd:13:aarch64:64' -> 'freebsd:14:aarch64:64')
        bash-5.2.15
        curl-8.4.0 (ABI changed: 'freebsd:13:aarch64:64' -> 'freebsd:14:aarch64:64')
        db18-18.1.40 (ABI changed: 'freebsd:13:aarch64:64' -> 'freebsd:14:aarch64:64')
        expat-2.5.0 (ABI changed: 'freebsd:13:aarch64:64' -> 'freebsd:14:aarch64:64')
        gdbm-1.23 (ABI changed: 'freebsd:13:aarch64:64' -> 'freebsd:14:aarch64:64')
        gettext-runtime-0.22_1 (ABI changed: 'freebsd:13:aarch64:64' -> 'freebsd:14:aarch64:64')
        indexinfo-0.3.1 (ABI changed: 'freebsd:13:aarch64:64' -> 'freebsd:14:aarch64:64')
        jansson-2.14 (ABI changed: 'freebsd:13:aarch64:64' -> 'freebsd:14:aarch64:64')
        libidn2-2.3.4 (ABI changed: 'freebsd:13:aarch64:64' -> 'freebsd:14:aarch64:64')
        libnghttp2-1.57.0 (ABI changed: 'freebsd:13:aarch64:64' -> 'freebsd:14:aarch64:64')
        libpsl-0.21.2_3 (ABI changed: 'freebsd:13:aarch64:64' -> 'freebsd:14:aarch64:64')
        libssh2-1.11.0,3 (ABI changed: 'freebsd:13:aarch64:64' -> 'freebsd:14:aarch64:64')
        libunistring-1.1 (ABI changed: 'freebsd:13:aarch64:64' -> 'freebsd:14:aarch64:64')
        libxml2-2.10.4_1 (ABI changed: 'freebsd:13:aarch64:64' -> 'freebsd:14:aarch64:64')
        pcre2-10.42 (ABI changed: 'freebsd:13:aarch64:64' -> 'freebsd:14:aarch64:64')
        perl5-5.34.1_3 (ABI changed: 'freebsd:13:aarch64:64' -> 'freebsd:14:aarch64:64')
        pkg-1.20.8 (ABI changed: 'freebsd:13:aarch64:64' -> 'freebsd:14:aarch64:64')
        readline-8.2.1 (ABI changed: 'freebsd:13:aarch64:64' -> 'freebsd:14:aarch64:64')

Number of packages to be reinstalled: 20

The process will require 7 MiB more space.
55 MiB to be downloaded.

Proceed with this action? [y/N]: y

アップグレードプロセスの完了

アップグレードプロセスを完了させます (3 回目の freebsd-update コマンドを実行します)。

root@raspberrypi:~ # freebsd-update install
src component not installed, skipped
Installing updates...rmdir: ///usr/tests/usr.bin/uuencode: Directory not empty
rmdir: ///usr/tests/usr.bin/uudecode: Directory not empty
 done.

再起動

FreeBSD を再起動します。

root@raspberrypi:~ # shutdown -r now

アップグレード後の確認

OS リリースレベルとバージョン

アップグレード後の OS リリースレベルとバージョンを確認します。

OS リリースレベル

root@raspberrypi:~ # uname -r
14.0-RELEASE

カーネルのバージョン

root@raspberrypi:~ # freebsd-version -k
14.0-RELEASE

ユーザランドのバージョン

root@raspberrypi:~ # freebsd-version -u
14.0-RELEASE-p1