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

OpenBSD/Upgrade/72-armv7

INDEX

OpenBSD のアップグレード (7.1 to 7.2 ARMv7 on BBB 版)

BeagleBone Black に入れた OpenBSD 7.1 (Released Apr 21, 2022) から 7.2 (Released Oct 20, 2022) にアップグレードした際のメモ書き。

お決まりなのだけど、重要なサーバや物理サーバでリモート接続している場合は、最初に同一のローカルシステムで試すことを推奨。まっ、そんな環境ないので、必要なファイルをバックアップした上で、えぃやぁかな。アップグレードでなきゃ、インストールし直しするつもりなので。

OpenBSD 6.6 からは、sysupgrade(8) でアップグレードができる。このアップグレードは一つ次のリリースへのみがサポートされる。諸注意や詳細は、 OpenBSD Upgrade Guide: 7.1 to 7.2 を参照。

sysupgrade(8) を使用した 無人アップグレード 以外に、各アーキテクチャ用のRAMディスクカーネル bsd.rd を取得して、このカーネルが起動したら (U)pgrade を選択して、プロンプトの指示に従って行う インタラクティブ アップグレード 、完全に手動でファイルを更新する マニュアル アップグレード がある。

 確認事項

アップグレード

 アップグレードする前に

ダウンロードミラーサイトの設定

/etc/installurl に記載されたURLのサーバから取得される。インストール時に ftp や http を使用していれば、その時の設定が記載されている。

bbb# cat /etc/installurl
https://ftp.jaist.ac.jp/pub/OpenBSD

ディスク空き容量

sysupgrade(8) がダウンロードしたファイルを置く /home/_sysupgrade および、インストール先となる /usr の空き容量を確認する。足りないと失敗する。

/usr には、1.1G 必要とのこと。/home/_sysupgrade は、インストールセットの 500MB かな…。

bbb# df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/sd0a     26.9G    980M   24.6G     4%    /

横着して、1パーティションで構成してた…

 アップグレード

sysupgrade コマンド自体は、ssh 上でも可能。ただし、アップグレードが完了して立ち上がるまではつなげないので、様子を確認できない。

X 関連を除くため、自動で再起動しないように -n を指定して、X 関連の インストール セット を除外してから、再起動する。

bbb# uname -a
OpenBSD bbb.intranet 7.1 GENERIC#31 armv7
bbb# sysupgrade -n
Fetching from https://ftp.jaist.ac.jp/pub/OpenBSD/7.2/armv7/
SHA256.sig   100% |*************************************|  1875       00:00
Signature Verified
INSTALL.armv7 100% |************************************| 36731       00:00
base72.tgz   100% |*************************************|   130 MB    01:03
bsd          100% |*************************************|  6780 KB    00:05
bsd.rd       100% |*************************************| 14979 KB    00:09
comp72.tgz   100% |*************************************| 40850 KB    00:21
game72.tgz   100% |*************************************|  2700 KB    00:01
man72.tgz    100% |*************************************|  7611 KB    00:04
xbase72.tgz  100% |*************************************| 43211 KB    00:19
xfont72.tgz  100% |*************************************| 22968 KB    00:09
xserv72.tgz  100% |*************************************|  8117 KB    00:04
xshare72.tgz 100% |*************************************|  4561 KB    00:01
Verifying sets.
Fetching updated firmware.
fw_update: added none; updated none; kept none
Will upgrade on next reboot
bbb#

アップグレード前の再起動まできたら、不用な X 関連の インストールセットを外して、再起動する。

bbb# ls -lA /home/_sysupgrade
total 571724
-rw-r--r--  1 root  wheel      36731 Sep 30  2022 INSTALL.armv7
-rw-r--r--  1 root  wheel       1723 May 23 11:03 SHA256
-rw-r--r--  1 root  wheel  136864357 Sep 30  2022 base72.tgz
-rw-r--r--  1 root  wheel    6943541 Sep 30  2022 bsd
-rw-r--r--  1 root  wheel   15338905 Sep 30  2022 bsd.rd
-rw-r--r--  1 root  wheel   41830463 Sep 30  2022 comp72.tgz
-rw-r--r--  1 root  wheel    2765178 Sep 30  2022 game72.tgz
-rw-r--r--  1 root  wheel    7794004 Sep 30  2022 man72.tgz
-rw-r--r--  1 root  wheel   44248169 Sep 30  2022 xbase72.tgz
-rw-r--r--  1 root  wheel   23519643 Sep 30  2022 xfont72.tgz
-rw-r--r--  1 root  wheel    8312282 Sep 30  2022 xserv72.tgz
-rw-r--r--  1 root  wheel    4670562 Sep 30  2022 xshare72.tgz
bbb# rm /home/_sysupgrade/x*
bbb# ls -lA /home/_sysupgrade
total 413740
-rw-r--r--  1 root  wheel      36731 Sep 30  2022 INSTALL.armv7
-rw-r--r--  1 root  wheel       1723 May 23 11:03 SHA256
-rw-r--r--  1 root  wheel  136864357 Sep 30  2022 base72.tgz
-rw-r--r--  1 root  wheel    6943541 Sep 30  2022 bsd
-rw-r--r--  1 root  wheel   15338905 Sep 30  2022 bsd.rd
-rw-r--r--  1 root  wheel   41830463 Sep 30  2022 comp72.tgz
-rw-r--r--  1 root  wheel    2765178 Sep 30  2022 game72.tgz
-rw-r--r--  1 root  wheel    7794004 Sep 30  2022 man72.tgz
bbb#
bbb# reboot

ということで、↑はSSH、↓はCOMコンソール

 :≪前略≫
OpenBSD/armv7 (bbb.intranet) (console)

login:
syncing disks... done
rebooting...

U-Boot SPL 2018.09-00002-g0b54a51eee (Sep 10 2018 - 19:41:39 -0500)
Trying to boot from MMC2
Loading Environment from EXT4... 
** Unable to use mmc 0:1 for loading the env **
 :≪中略≫
## Starting EFI application at 82000000 ...
disks: sd0* sd1
>> OpenBSD/armv7 BOOTARM 1.19
upgrade detected: switching to /bsd.upgrade
boot> 
 :≪中略≫
pmap Copyright (c) 1982, 1986, 1989, 1991, 1993
	The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2022 OpenBSD. All rights reserved.  https://www.OpenBSD.org

OpenBSD 7.2 (RAMDISK) #58: Thu Sep 29 12:55:21 MDT 2022
    deraadt@armv7.openbsd.org:/usr/src/sys/arch/armv7/compile/RAMDISK
 :≪中略≫
bootfile: sd0a:/bsd.upgrade
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 7.2 installation program.
Performing non-interactive upgrade...
Terminal type? [vt220] vt220
Available disks are: sd1.
Which disk is the root disk? ('?' for details) [sd1] sd1
Checking root filesystem (fsck -fp /dev/sd1a)... OK.
Mounting root filesystem (mount -o ro /dev/sd1a /mnt)... OK.
Force checking of clean non-root filesystems? [no] no
/dev/sd1a (56eca8534bce27d7.a) on /mnt type ffs (rw, local, noatime, wxallowed)

Let's upgrade the sets!
Location of sets? (disk http nfs or 'done') [http] disk
Is the disk partition already mounted? [yes] yes
Pathname to the sets? (or 'done') [7.2/armv7] /home/_sysupgrade/

Select sets by entering a set name, a file name pattern or 'all'. De-select
sets by prepending a '-', e.g.: '-game*'. Selected sets are labelled '[X]'.
    [X] bsd           [X] base72.tgz    [X] man72.tgz
    [X] bsd.rd        [X] comp72.tgz    [X] game72.tgz
Set name(s)? (or 'abort' or 'done') [done] done
Directory does not contain SHA256.sig. Continue without verification? [no] yes
Installing bsd          100% |**************************|  6780 KB    00:02
Installing bsd.rd       100% |**************************| 14979 KB    00:05
Installing base72.tgz   100% |**************************|   130 MB    01:46
Installing comp72.tgz   100% |**************************| 40850 KB    01:35
Installing man72.tgz    100% |**************************|  7611 KB    00:44
Installing game72.tgz   100% |**************************|  2700 KB    00:03
Location of sets? (disk http nfs or 'done') [done] done
Making all device nodes... done.
fw_update: added none; updated none; kept none
Relinking to create unique kernel... done.

CONGRATULATIONS! Your OpenBSD upgrade has been successfully completed!

syncing disks... done
rebooting...

U-Boot SPL 2018.09-00002-g0b54a51eee (Sep 10 2018 - 19:41:39 -0500)
Trying to boot from MMC2
Loading Environment from EXT4...
** Unable to use mmc 0:1 for loading the env **
 :≪中略≫
## Starting EFI application at 82000000 ...
disks: sd0* sd1
>> OpenBSD/armv7 BOOTARM 1.19
boot>
 :≪中略≫
pmap [ using 916536 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2022 OpenBSD. All rights reserved.  https://www.OpenBSD.org

OpenBSD 7.2 (GENERIC) #71: Thu Sep 29 11:47:02 MDT 2022
    deraadt@armv7.openbsd.org:/usr/src/sys/arch/armv7/compile/GENERIC
 :≪中略≫
bootfile: sd0a:/bsd
boot device: sd0
root on sd0a (56eca8534bce27d7.a) swap on sd0b dump on sd0b
WARNING: CHECK AND RESET THE DATE!
Automatic boot in progress: starting file system checks.
/dev/sd0a (56eca8534bce27d7.a): file system is clean; not checking
pf enabled
net.inet.esp.enable: 1 -> 0
net.inet.ah.enable: 1 -> 0
starting network
reordering libraries: done.
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.
running rc.sysmerge
===> Adding the _bgplgd group
===> Adding the _agentx group
===> Adding the _bgplgd user
===> Updating /etc/changelist
===> Updating /etc/skel/.cshrc
===> Updating /etc/skel/.profile
===> Updating /etc/ssl/cert.pem
===> Updating /etc/mail/aliases
starting network daemons: sshd smtpd slowcgi httpd sndiod.
running rc.firsttime
fw_update: added none; updated none; kept none
starting package daemons: popa3d.
starting SoftEther VPN Server
The SoftEther VPN Server service has been started.
starting local daemons: cron.
Tue May 23 11:19:46 JST 2023

OpenBSD/armv7 (bbb.intranet) (console)

login:

CPUの性能とかにもよるだろうけど、完了するまで20分くらい。

アップデートの中で、 sysmerge(8)fw_update(1) が実行される模様。

 アップグレード後

bbb# uname -a
OpenBSD bbb.intranet 7.2 GENERIC#71 armv7

設定ファイルの更新

アップデートの中で実行されるので、基本は不要。

bbb# sysmerge

ファームウェアの更新

アップデートの中で実行されるので、基本は不要(下記コマンドは確認のみ)。

bbb# fw_update -v -n
fw_update: added none; updated none; kept none

バイナリパッチのアップデート

リリース直後であればほどんとないと思う(下記コマンドは適用可能なパッチ一覧のみ)。ただし、バイナリパッチが提供されるのは i386, amd64 および arm64 のアーキテクチャのみっぽい。

bbb# syspatch -c
syspatch: Error retrieving https://ftp.jaist.ac.jp/pub/OpenBSD/syspatch/7.2/armv7/SHA256.sig: 404 Not Found

古いファイルの削除

Files to remove を参考に、古いファイルを削除する。

bbb# userdel _switchd
bbb# groupdel _switchd
bbb# rm /etc/rc.d/switchd \
>    /usr/sbin/switchctl \
>    /usr/sbin/switchd \
>    /usr/share/man/man4/switch.4 \
>    /usr/share/man/man5/switchd.conf.5 \
>    /usr/share/man/man8/switchctl.8 \
>    /usr/share/man/man8/switchd.8
rm: /etc/rc.d/switchd: No such file or directory
rm: /usr/sbin/switchctl: No such file or directory
rm: /usr/sbin/switchd: No such file or directory
rm: /usr/share/man/man4/switch.4: No such file or directory
rm: /usr/share/man/man5/switchd.conf.5: No such file or directory
rm: /usr/share/man/man8/switchctl.8: No such file or directory
rm: /usr/share/man/man8/switchd.8: No such file or directory
bbb#

設定ファイルと構文の変更

Configuration and syntax changes を参考に、設定ファイルを更新する。

パッケージ変更

Special packages を参考に、パッケージ更新する。

メモ

比較的簡単にできる。特に何もなければ、コマンドを実行して2,30分で完了する。

全てのインストールセットがアップデート(インストール)されるので、不要なものがある場合は、 -n オプションを指定して、自動的に再起動しないようにして、/home/_sysupgrade に取得されたファイルから不要なものを削除してから、再起動する(_sysupgrade にあるすべてのファイルが対象になる)。

最終更新時間:2023年05月23日 12時19分45秒 指摘や意見などあればSandBoxのBBSへ。