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

OpenBSD/Upgrade/74-armv7

INDEX

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

BeagleBone Black に入れた OpenBSD 7.3 (Released Apr 10, 2023) から 7.4 (Released Oct 16, 2023) にアップグレードした際のメモ書き。

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

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

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    1.3G   24.3G     5%    /

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

 アップグレード

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

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

bbb# uname -a
OpenBSD bbb.intranet 7.3 GENERIC#117 armv7
bbb# sysupgrade -n
Fetching from https://ftp.jaist.ac.jp/pub/OpenBSD/7.4/armv7/
SHA256.sig   100% |*************************************|  1875       00:00
Signature Verified
INSTALL.armv7 100% |************************************| 36646       00:00
base74.tgz   100% |*************************************|   131 MB    01:18
bsd          100% |*************************************|  6880 KB    00:05
bsd.rd       100% |*************************************| 15042 KB    00:11
comp74.tgz   100% |*************************************| 40793 KB    00:22
game74.tgz   100% |*************************************|  2699 KB    00:01
man74.tgz    100% |*************************************|  7832 KB    00:05
xbase74.tgz  100% |*************************************| 43758 KB    00:20
xfont74.tgz  100% |*************************************| 22969 KB    00:12
xserv74.tgz  100% |*************************************|  8112 KB    00:06
xshare74.tgz 100% |*************************************|  4580 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 576492
-rw-r--r--  1 root  wheel      36646 Feb 27 17:46 INSTALL.armv7
-rw-r--r--  1 root  wheel       1723 Feb 27 17:46 SHA256
-rw-r--r--  1 root  wheel  138380324 Feb 27 17:47 base74.tgz
-rw-r--r--  1 root  wheel    7045446 Feb 27 17:47 bsd
-rw-r--r--  1 root  wheel   15403376 Feb 27 17:48 bsd.rd
-rw-r--r--  1 root  wheel   41772793 Feb 27 17:48 comp74.tgz
-rw-r--r--  1 root  wheel    2764125 Feb 27 17:48 game74.tgz
-rw-r--r--  1 root  wheel    8020392 Feb 27 17:49 man74.tgz
-rw-r--r--  1 root  wheel   44809038 Feb 27 17:49 xbase74.tgz
-rw-r--r--  1 root  wheel   23520269 Feb 27 17:49 xfont74.tgz
-rw-r--r--  1 root  wheel    8307158 Feb 27 17:49 xserv74.tgz
-rw-r--r--  1 root  wheel    4690342 Feb 27 17:50 xshare74.tgz
bbb# rm /home/_sysupgrade/x*
bbb# ls -lA /home/_sysupgrade
total 417388
-rw-r--r--  1 root  wheel      36646 Feb 27 17:46 INSTALL.armv7
-rw-r--r--  1 root  wheel       1723 Feb 27 17:46 SHA256
-rw-r--r--  1 root  wheel  138380324 Feb 27 17:47 base74.tgz
-rw-r--r--  1 root  wheel    7045446 Feb 27 17:47 bsd
-rw-r--r--  1 root  wheel   15403376 Feb 27 17:48 bsd.rd
-rw-r--r--  1 root  wheel   41772793 Feb 27 17:48 comp74.tgz
-rw-r--r--  1 root  wheel    2764125 Feb 27 17:48 game74.tgz
-rw-r--r--  1 root  wheel    8020392 Feb 27 17:49 man74.tgz
bbb#
bbb# reboot

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

 :≪前略≫
Tue Feb 27 17:44:25 JST 2024

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...
** Unable to use mmc 0:1 for loading the env **
 :≪中略≫
## Starting EFI application at 82000000 ...
disks: sd0* sd1
>> OpenBSD/armv7 BOOTARM 1.20
upgrade detected: switching to /bsd.upgrade
boot>
booting sd0a:/bsd.upgrade: 2400584+712420+11505888+478188 [180459+107+384128+211116]=0x0
 :≪中略≫
pmap Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2023 OpenBSD. All rights reserved.  https://www.OpenBSD.org

OpenBSD 7.4 (RAMDISK) #132: Sun Oct  8 13:43:47 MDT 2023
    deraadt@armv7.openbsd.org:/usr/src/sys/arch/armv7/compile/RAMDISK
real mem  = 484102144 (461MB)
 :≪中略≫
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.4 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.4/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] base74.tgz    [X] man74.tgz
    [X] bsd.rd        [X] comp74.tgz    [X] game74.tgz
Set name(s)? (or 'abort' or 'done') [done] done
Directory does not contain SHA256.sig. Continue without verification? [no] yes
Installing bsd          100% |**************************|  6880 KB    00:01
Installing bsd.rd       100% |**************************| 15042 KB    00:04
Installing base74.tgz   100% |**************************|   131 MB    01:51
Installing comp74.tgz   100% |**************************| 40793 KB    01:42
Installing man74.tgz    100% |**************************|  7832 KB    00:41
Installing game74.tgz   100% |**************************|  2699 KB    00:02
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...
** Unable to use mmc 0:1 for loading the env **
 :≪中略≫
## Starting EFI application at 82000000 ...
disks: sd0* sd1
>> OpenBSD/armv7 BOOTARM 1.20
boot>
booting sd0a:/bsd: 5005244+959524+140188+604488 [277318+107+344368+305366]=0x0
 :≪中略≫
pmap [ using 927696 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-2023 OpenBSD. All rights reserved.  https://www.OpenBSD.org

OpenBSD 7.4 (GENERIC) #165: Tue Oct 10 10:01:38 MDT 2023
    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: ld.so libc libcrypto sshd.
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 _shutdown group
===> Updating /etc/changelist
===> Updating /etc/ssh/ssh_config
===> Updating /etc/ssl/cert.pem
starting network daemons: sshd smtpd slowcgi httpd sndiod.
running rc.firsttime
fw_update: add none; update none
starting package daemons: popa3d.
starting SoftEther VPN Server
The SoftEther VPN Server service has been started.
starting local daemons: cron.
Tue Feb 27 18:05:07 JST 2024

OpenBSD/armv7 (bbb.intranet) (console)

login:

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

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

 アップグレード後

bbb# uname -a
OpenBSD bbb.intranet 7.4 GENERIC#165 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.jaist.ac.jp/pub/OpenBSD/syspatch/7.4/armv7/SHA256.sig: 404 Not Found

古いファイルの削除

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

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

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

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

_shutdown グループが追加された。このグループに所属するユーザも shutdown(8) コマンドを実行することができる。

と言うことで、普段使うユーザを所属させる。シャットダウンやリブートさせる際に、都度、su でスーパーユーザになったり、doas で実行する必要がなくなる。ただ、reboot コマンドはダメっぽい…

bbb# usermod -G _shutdown youername

パッケージ変更

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

 アップグレードログ

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

sysmerge output

From: Charlie Root <root@bbb.intranet>
To: root@bbb.intranet
Subject: bbb.intranet rc.sysmerge output
Date: Tue, 27 Feb 2024 18:04:47 +0900 (JST)

===> Adding the _shutdown group
===> Updating /etc/changelist
===> Updating /etc/ssh/ssh_config
===> Updating /etc/ssl/cert.pem

rc.firsttime output

From: Charlie Root <root@bbb.intranet>
To: root@bbb.intranet
Subject: bbb.intranet rc.firsttime output
Date: Tue, 27 Feb 2024 18:04:50 +0900 (JST)

fw_update: add none; update none

upgrade log

From: Charlie Root <root@bbb.intranet>
To: root@bbb.intranet
Subject: bbb.intranet upgrade log
Date: Tue, 27 Feb 2024 18:04:50 +0900 (JST)

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.4/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] base74.tgz    [X] man74.tgz
    [X] bsd.rd        [X] comp74.tgz    [X] game74.tgz
Set name(s)? (or 'abort' or 'done') [done] done
Directory does not contain SHA256.sig. Continue without verification? [no] yes
Installing bsd          100% |**************************|  6880 KB    00:01    
Installing bsd.rd       100% |**************************| 15042 KB    00:04    
Installing base74.tgz   100% |**************************|   131 MB    01:51    
Installing comp74.tgz   100% |**************************| 40793 KB    01:42    
Installing man74.tgz    100% |**************************|  7832 KB    00:41    
Installing game74.tgz   100% |**************************|  2699 KB    00:02    
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!

upgrade response file

From: Charlie Root <root@bbb.intranet>
To: root@bbb.intranet
Subject: bbb.intranet upgrade response file
Date: Tue, 27 Feb 2024 18:04:50 +0900 (JST)

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) = done
Directory does not contain SHA256.sig. Continue without verification = yes
Location of sets = done

メモ

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

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

最終更新時間:2024年04月04日 23時44分46秒 指摘や意見などあればSandBoxのBBSへ。