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

OpenBSD/Upgrade/76-armv7

INDEX

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

BeagleBone Black に入れた 7.5 (Released April 5, 2024) から 7.6 (Released Oct 8, 2024) にアップグレードした際のメモ書き。

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

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

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

 確認事項

アップグレード

 アップグレードする前に

bbb# uname -a
OpenBSD bbb.intranet 7.5 GENERIC#209 armv7

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

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

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

が、2025-05-17 は、ftp.jaist.ac.jp が年次の法定電気点検でシャットダウンされていた…。なので、 https://ftp.openbsd.org/pub/OpenBSD/ に変更する。

bbb# cat /etc/installurl
https://ftp.openbsd.org/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    3.5G   22.0G    14%    /

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

 アップグレード

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

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

bbb# sysupgrade -n
Fetching from https://ftp.openbsd.org/pub/OpenBSD//7.6/armv7/
SHA256.sig   100% |*************************************|  1777       00:00
Signature Verified
Verifying old sets.
base76.tgz   100% |*************************************|   144 MB    01:54
bsd          100% |*************************************|  6823 KB    00:04
bsd.rd       100% |*************************************| 15095 KB    00:06
comp76.tgz   100% |*************************************| 44568 KB    00:30
game76.tgz   100% |*************************************|  2712 KB    00:02
man76.tgz    100% |*************************************|  8074 KB    00:07
xbase76.tgz  100% |*************************************| 45952 KB    00:24
xfont76.tgz  100% |*************************************| 23023 KB    00:17
xserv76.tgz  100% |*************************************|  8193 KB    00:05
xshare76.tgz 100% |*************************************|  4570 KB    00:03
Verifying sets.
Fetching updated firmware.
fw_update: add none; update none
Will upgrade on next reboot
bbb#

インストールセットが /home/_sysupgrade に取得される。

bbb# ls -lA /home/_sysupgrade
total 614284
-rw-r--r--  1 root  wheel      36472 Oct  1  2024 INSTALL.armv7
-rw-r--r--  1 root  wheel       1625 May 17 09:26 SHA256
-rw-r--r--  1 root  wheel  151243404 Oct  1  2024 base76.tgz
-rw-r--r--  1 root  wheel    6987422 Oct  1  2024 bsd
-rw-r--r--  1 root  wheel   15458232 Oct  1  2024 bsd.rd
-rw-r--r--  1 root  wheel   45638571 Oct  1  2024 comp76.tgz
-rw-r--r--  1 root  wheel    2777408 Oct  1  2024 game76.tgz
-rw-r--r--  1 root  wheel    8268126 Oct  1  2024 man76.tgz
-rw-r--r--  1 root  wheel   47055267 Oct  1  2024 xbase76.tgz
-rw-r--r--  1 root  wheel   23575638 Oct  1  2024 xfont76.tgz
-rw-r--r--  1 root  wheel    8390436 Oct  1  2024 xserv76.tgz
-rw-r--r--  1 root  wheel    4679769 Oct  1  2024 xshare76.tgz
bbb#

また、レスポンスファイル /auto_upgrade.conf が作成される。

bbb# cat /auto_upgrade.conf
Location of sets = disk
Pathname to the sets = /home/_sysupgrade/
Directory does not contain SHA256.sig. Continue without verification = yes
bbb# 

アップグレード前の再起動まできたら、取得したインストールセットから不用な X 関連のファイルを削除する。レスポンスファイル /auto_upgrade.conf を修正して、不用な X 関連の インストールセットを外すように修正する。

「Set name(s) = -x*」を追加して、X 一式をインストールセットの選択から外すようにする。

bbb# vi /auto_upgrade.conf
bbb# cat /auto_upgrade.conf
Location of sets = disk
Pathname to the sets = /home/_sysupgrade/
Set name(s) = -x*
Directory does not contain SHA256.sig. Continue without verification = yes
bbb#

準備ができたら、再起動する。

bbb# reboot

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

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

login: 
stopping package daemons: popa3d.
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...
 :≪中略≫
## Starting EFI application at 82000000 ...
disks: sd0* sd1
>> OpenBSD/armv7 BOOTARM 1.22
upgrade detected: switching to /bsd.upgrade
boot>
booting sd0a:/bsd.upgrade: 2390444+768848+11503920+475196 [187381+107+386912+213176]=0x0
OpenBSD/armv7 booting ...
 :≪中略≫
pmap Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2024 OpenBSD. All rights reserved.  https://www.OpenBSD.org

OpenBSD 7.6 (RAMDISK) #189: Mon Sep 30 06:52:01 MDT 2024
    deraadt@armv7.openbsd.org:/usr/src/sys/arch/armv7/compile/RAMDISK
real mem  = 484106240 (461MB)
avail mem = 456323072 (435MB)
 :≪中略≫
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.6 installation program.
Performing non-interactive upgrade...
Terminal type? [vt220] vt220
Available disks are: sd0.
Which disk is the root disk? ('?' for details) [sd0] sd0
Checking root filesystem (fsck -fp /dev/sd0a)... OK.
Mounting root filesystem (mount -o ro /dev/sd0a /mnt)... OK.
Force checking of clean non-root filesystems? [no] no
/dev/sd0a (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.6/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] comp76.tgz    [X] xbase76.tgz   [X] xserv76.tgz
    [X] bsd.rd        [X] man76.tgz     [X] xshare76.tgz
    [X] base76.tgz    [X] game76.tgz    [X] xfont76.tgz
Set name(s)? (or 'abort' or 'done') [done] -x*
    [X] bsd           [X] comp76.tgz    [ ] xbase76.tgz   [ ] xserv76.tgz
    [X] bsd.rd        [X] man76.tgz     [ ] xshare76.tgz
    [X] base76.tgz    [X] game76.tgz    [ ] xfont76.tgz
Set name(s)? (or 'abort' or 'done') [done] done
Directory does not contain SHA256.sig. Continue without verification? [no] yes
Installing bsd          100% |**************************|  6823 KB    00:02
Installing bsd.rd       100% |**************************| 15095 KB    00:04
Installing base76.tgz   100% |**************************|   144 MB    02:14
Installing comp76.tgz   100% |**************************| 44568 KB    02:16
Installing man76.tgz    100% |**************************|  8074 KB    00:48
Installing game76.tgz   100% |**************************|  2712 KB    00:03
Location of sets? (disk http nfs or 'done') [done] done
Making all device nodes... done.
fw_update: add none; update 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...
 :≪中略≫
## Starting EFI application at 82000000 ...
disks: sd0* sd1
>> OpenBSD/armv7 BOOTARM 1.23
boot>
booting sd0a:/bsd: 4892972+1010592+140412+598656 [286033+107+345120+307318]=0x0

OpenBSD/armv7 booting ...
 :≪中略≫
pmap [ using 939116 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-2024 OpenBSD. All rights reserved.  https://www.OpenBSD.org

OpenBSD 7.6 (GENERIC) #242: Mon Sep 30 05:55:13 MDT 2024
    deraadt@armv7.openbsd.org:/usr/src/sys/arch/armv7/compile/GENERIC
real mem  = 484102144 (461MB)
avail mem = 464510976 (442MB)
 :≪中略≫
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
ifconfig: net: bad value
reordering: ld.so libc libcrypto sshd sshd-session ssh-agent.
starting early daemons: syslogd pflogd ntpd.
starting RPC daemons:.
savecore: no core dump
checking quotas: done.
clearing /tmp
pin 21: caps: in out pu pd, flags: -> out
pin 22: caps: in out pu pd, flags: -> out
pin 23: caps: in out pu pd, flags: -> out
pin 24: caps: in out pu pd, flags: -> out
kern.securelevel: 0 -> 1
creating runtime link editor directory cache.
preserving editor files.
running rc.sysmerge
===> Adding the _dhcp6leased group
===> Adding the _dhcp6leased user
===> Updating /etc/changelist
===> Updating /etc/login.conf
===> Updating /etc/mail.rc
starting network daemons: sshd smtpd slowcgi httpd sndiod.
running rc.firsttime
fw_update: add none; update none
starting package daemons: popa3d
popa3d[38476]: pinsyscalls addr 9892b734 code 253, pinoff 0xffffffff (pin 330 b0ab0000-b0abdd30 dd30)  (libcpin 0 0-0 0) error 78
(failed). 
starting  SoftEther VPN Server
vpnserver [15795]: pinsyscalls addr afcf3c74 code 253, pinoff 0xffffffff (pin 330 b1460000-b146dd30 dd30) (libcpin  0 0-0 0) error 78
Abort tra p (core dumped)
starting  SoftEther VPN Client
vpnclient [29875]: pinsyscalls addr 9f298c74 code 253, pinoff 0xffffffff (pin 330 a44a0000-a44add30 dd30) (libcpin  0 0-0 0) error 78
Abort tra p (core dumped)
starting  rdgw
starting  http-relayd
starting  local daemons: cron.
Sat May 1 7 09:48:53 JST 2025

OpenBSD/armv7 (bbb.intranet) (console)

login:

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

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

 アップグレード後

bbb# uname -a
OpenBSD bbb.intranet 7.6 GENERIC#242 armv7

設定ファイルの更新

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

bbb# sysmerge

ファームウェアの更新

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

bbb# fw_update -v -n
fw_update: add none; update none

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

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

bbb# syspatch -c
syspatch: Error retrieving https://ftp.openbsd.org/pub/OpenBSD//syspatch/7.6/armv7/SHA256.sig: 404 Not Found

古いファイルの削除

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

7.6 のリリースで削除するものはない。

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

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

7.5 のリリースで変わったものはない。

パッケージ変更

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

プログラムの変更

アップデート後に起動に失敗するデーモンがある。

popa3d については、pkg_add でパッケージをアップデートする。

bbb# pkg_add -u popa3d
quirks-7.50:updatedb-0p0->0p0: ok
quirks-7.50 signed on 2024-10-27T20:33:03Z
popa3d-1.0.3p2->1.0.3p2: ok
Read shared items: ok
bbb#
bbb# rcctl start popa3d
popa3d(ok)
bbb#

vpnserver および については、ビルドし直す。

 アップグレードログ

root 宛にアップグレードのログが送られる。

upgrade response file

From: Charlie Root <root@bbb.intranet>
Date: Sat, 17 May 2025 09:48:48 +0900 (JST)
To: root@bbb.intranet
Subject: bbb.intranet upgrade response file
Message-ID: <bcd517bb5958e746@bbb.intranet>

Which disk is the root disk = sd0
Force checking of clean non-root filesystems = no
Location of sets = disk
Is the disk partition already mounted = yes
Pathname to the sets = /home/_sysupgrade/
Set name(s) = -x*
Set name(s) = done
Directory does not contain SHA256.sig. Continue without verification = yes
Location of sets = done

upgrade log

From: Charlie Root <root@bbb.intranet>
Date: Sat, 17 May 2025 09:48:48 +0900 (JST)
To: root@bbb.intranet
Subject: bbb.intranet upgrade log
Message-ID: <bcd517bca0ad0ca6@bbb.intranet>

Terminal type? [vt220] vt220
Available disks are: sd0.
Which disk is the root disk? ('?' for details) [sd0] sd0
Checking root filesystem (fsck -fp /dev/sd0a)... OK.
Mounting root filesystem (mount -o ro /dev/sd0a /mnt)... OK.
Force checking of clean non-root filesystems? [no] no
/dev/sd0a (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.6/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] comp76.tgz    [X] xbase76.tgz   [X] xserv76.tgz
    [X] bsd.rd        [X] man76.tgz     [X] xshare76.tgz
    [X] base76.tgz    [X] game76.tgz    [X] xfont76.tgz
Set name(s)? (or 'abort' or 'done') [done] -x*
    [X] bsd           [X] comp76.tgz    [ ] xbase76.tgz   [ ] xserv76.tgz
    [X] bsd.rd        [X] man76.tgz     [ ] xshare76.tgz
    [X] base76.tgz    [X] game76.tgz    [ ] xfont76.tgz
Set name(s)? (or 'abort' or 'done') [done] done
Directory does not contain SHA256.sig. Continue without verification? [no] yes
Installing bsd          100% |**************************|  6823 KB    00:02    
Installing bsd.rd       100% |**************************| 15095 KB    00:04    
Installing base76.tgz   100% |**************************|   144 MB    02:14    
Installing comp76.tgz   100% |**************************| 44568 KB    02:16    
Installing man76.tgz    100% |**************************|  8074 KB    00:48    
Installing game76.tgz   100% |**************************|  2712 KB    00:03    
Location of sets? (disk http nfs or 'done') [done] done
Making all device nodes... done.
fw_update: add none; update none
Relinking to create unique kernel... done.

CONGRATULATIONS! Your OpenBSD upgrade has been successfully completed!

sysmerge output

From: Charlie Root <root@bbb.intranet>
Date: Sat, 17 May 2025 09:48:45 +0900 (JST)
To: root@bbb.intranet
Subject: bbb.intranet rc.sysmerge output
Message-ID: <bcd517b607c33b3d@bbb.intranet>

===> Adding the _dhcp6leased group
===> Adding the _dhcp6leased user
===> Updating /etc/changelist
===> Updating /etc/login.conf
===> Updating /etc/mail.rc

rc.firsttime output

From: Charlie Root <root@bbb.intranet>
Date: Sat, 17 May 2025 09:48:49 +0900 (JST)
To: root@bbb.intranet
Subject: bbb.intranet rc.firsttime output
Message-ID: <bcd517c14cc85143@bbb.intranet>

fw_update: add none; update none

メモ

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

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

あと、アップデート後に、いくつかのデーモンの起動に失敗してる。なので、該当プログラムのパッケージを更新するか、ビルドし直す。ビルドのし直しで解決するので、恐らく、共有ライブラリが更新されたことによると思う…

最終更新時間:2025年05月17日 13時29分47秒 指摘や意見などあればSandBoxのBBSへ。