!!! OpenBSD のアップグレード (7.4 to 7.5 ARMv7 on BBB 版) {{category OpenBSD,nolink}}BeagleBone Black に入れた OpenBSD 7.4 (Released Oct 16, 2023) から 7.5 (Released April 5, 2024) にアップグレードした際のメモ書き。 お決まりなのだけど、重要なサーバや物理サーバでリモート接続している場合は、最初に同一のローカルシステムで試すことを推奨。 まっ、そんな環境ないので、必要なファイルをバックアップした上で、えぃやぁかな。アップグレードでなきゃ、インストールし直しするつもりなので。 OpenBSD 6.6 からは、[sysupgrade(8)|https://man.openbsd.org/sysupgrade.8] でアップグレードができる。 このアップグレードは一つ次のリリースへのみがサポートされる。 諸注意や詳細は、 [OpenBSD Upgrade Guide: 7.4 to 7.5|https://www.openbsd.org/faq/upgrade75.html] を参照。 アップグレード方法は、[sysupgrade(8)|https://man.openbsd.org/sysupgrade.8] を使用した ''無人アップグレード'' 以外に、 各アーキテクチャ用のRAMディスクカーネル '''bsd.rd''' を取得して、このカーネルが起動したら '''(U)pgrade''' を選択して、プロンプトの指示に従って行う ''インタラクティブ アップグレード'' 、 完全に手動でファイルを更新する ''マニュアル アップグレード'' がある。 * Install [[7.1|OpenBSD/Install/71-armv7]], Upgrade [[to 7.2|OpenBSD/Upgrade/72-armv7]] [[to 7.3|OpenBSD/Upgrade/73-armv7]] [[to 7.4|OpenBSD/Upgrade/74-armv7]] [[to 7.5|OpenBSD/Upgrade/75-armv7]] !!確認事項 !!!アップグレード !!アップグレードする前に bbb# uname -a OpenBSD bbb.intranet 7.4 GENERIC#165 armv7 !ダウンロードミラーサイトの設定 '''/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.9G 23.6G 8% / 横着して、1パーティションで構成してた… !!アップグレード sysupgrade コマンド自体は、ssh 上でも可能。ただし、アップグレードが完了して立ち上がるまではつなげないので、様子を確認できない。 X 関連を除くため、自動で再起動しないように '''-n''' を指定して、X 関連の インストール セット を除外してから、再起動する。 bbb# sysupgrade -n Fetching from https://ftp.jaist.ac.jp/pub/OpenBSD/7.5/armv7/ SHA256.sig 100% |*************************************| 1875 00:00 Signature Verified Verifying old sets. base75.tgz 100% |*************************************| 142 MB 01:26 bsd 100% |*************************************| 6806 KB 00:05 bsd.rd 100% |*************************************| 15105 KB 00:19 comp75.tgz 100% |*************************************| 43878 KB 00:34 game75.tgz 100% |*************************************| 2698 KB 00:01 man75.tgz 100% |*************************************| 7871 KB 00:05 xbase75.tgz 100% |*************************************| 44729 KB 00:26 xfont75.tgz 100% |*************************************| 22968 KB 00:10 xserv75.tgz 100% |*************************************| 8133 KB 00:04 xshare75.tgz 100% |*************************************| 4581 KB 00:02 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 605804 -rw-r--r-- 1 root wheel 36574 Mar 24 11:50 INSTALL.armv7 -rw-r--r-- 1 root wheel 1723 May 31 11:17 SHA256 -rw-r--r-- 1 root wheel 149204642 Mar 24 10:56 base75.tgz -rw-r--r-- 1 root wheel 6970226 Mar 24 10:51 bsd -rw-r--r-- 1 root wheel 15468169 Mar 24 11:50 bsd.rd -rw-r--r-- 1 root wheel 44931194 Mar 24 10:58 comp75.tgz -rw-r--r-- 1 root wheel 2763237 Mar 24 10:58 game75.tgz -rw-r--r-- 1 root wheel 8060278 Mar 24 10:58 man75.tgz -rw-r--r-- 1 root wheel 45802955 Mar 24 18:50 xbase75.tgz -rw-r--r-- 1 root wheel 23520154 Mar 24 18:51 xfont75.tgz -rw-r--r-- 1 root wheel 8328387 Mar 24 18:52 xserv75.tgz -rw-r--r-- 1 root wheel 4691060 Mar 24 18:52 xshare75.tgz bbb# また、レスポンスファイル '''/auto_upgrade.conf''' が作成される。 bbb# cat /auto_upgrade.conf Location of sets = disk Pathname to the sets = /home/_sysupgrade/ Set name(s) = done Directory does not contain SHA256.sig. Continue without verification = yes bbb# アップグレード前の再起動まできたら、==取得したインストールセットから不用な X 関連のファイルを削除する。== レスポンスファイル '''/auto_upgrade.conf''' を修正して、不用な X 関連の インストールセットを外すように修正する。 「Set name(s) = -x*」を追加して、X 一式をインストールセットの選択から外すようにする。 bbb# cat /auto_upgrade.conf Location of sets = disk Pathname to the sets = /home/_sysupgrade/ Set name(s) = done Directory does not contain SHA256.sig. Continue without verification = yes bbb# vi /auto_upgrade.conf bbb# cat /auto_upgrade.conf Location of sets = disk Pathname to the sets = /home/_sysupgrade/ Set name(s) = -x* Set name(s) = done Directory does not contain SHA256.sig. Continue without verification = yes bbb# 準備ができたら、再起動する。 bbb# reboot ということで、↑はSSH、↓はCOMコンソール  :≪前略≫ Fri May 31 10:59:55 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...  :≪中略≫ ## Starting EFI application at 82000000 ... disks: sd0* sd1 >> OpenBSD/armv7 BOOTARM 1.20 upgrade detected: switching to /bsd.upgrade boot> booting sd0a:/bsd.upgrade: 2400336+763808+11507088+474540 [186855+107+386496+212697]=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.5 (RAMDISK) #157: Sat Mar 23 20:49:21 MDT 2024 deraadt@armv7.openbsd.org:/usr/src/sys/arch/armv7/compile/RAMDISK real mem = 484102144 (461MB) avail mem = 456306688 (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.5 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.5/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] comp75.tgz [X] xbase75.tgz [X] xserv75.tgz [X] bsd.rd [X] man75.tgz [X] xshare75.tgz [X] base75.tgz [X] game75.tgz [X] xfont75.tgz Set name(s)? (or 'abort' or 'done') [done] -x* [X] bsd [X] comp75.tgz [ ] xbase75.tgz [ ] xserv75.tgz [X] bsd.rd [X] man75.tgz [ ] xshare75.tgz [X] base75.tgz [X] game75.tgz [ ] xfont75.tgz Set name(s)? (or 'abort' or 'done') [done] done Directory does not contain SHA256.sig. Continue without verification? [no] yes Installing bsd 100% |**************************| 6806 KB 00:01 Installing bsd.rd 100% |**************************| 15105 KB 00:04 Installing base75.tgz 100% |**************************| 142 MB 02:01 Installing comp75.tgz 100% |**************************| 43878 KB 01:42 Installing man75.tgz 100% |**************************| 7871 KB 00:41 Installing game75.tgz 100% |**************************| 2698 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.22 boot> booting sd0a:/bsd: 4872708+1005028+140008+599884 [284864+107+344320+306454]=0x0 OpenBSD/armv7 booting ...  :≪中略≫ pmap [ using 936280 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.5 (GENERIC) #209: Sat Mar 23 19:51:21 MDT 2024 deraadt@armv7.openbsd.org:/usr/src/sys/arch/armv7/compile/GENERIC real mem = 484106240 (461MB) avail mem = 464539648 (443MB)  :≪中略≫ 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 ===> Updating /.profile ===> Updating /etc/changelist ===> Updating /etc/login.conf ===> Installing /etc/rpki/afrinic.constraints ===> Installing /etc/rpki/apnic.constraints ===> Installing /etc/rpki/arin.constraints ===> Installing /etc/rpki/lacnic.constraints ===> Installing /etc/rpki/ripe.constraints ===> Updating /etc/skel/.login ===> Updating /etc/ssl/cert.pem ===> Updating /etc/ssl/ikeca.cnf ===> Updating /root/.login ===> Updating /root/.profile ===> Installing /var/account/acct ===> Updating /var/www/conf/bgplg.foot ===> Updating /var/www/conf/bgplg.head ===> Updating /var/www/htdocs/bgplg/index.html 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. Fri May 31 12:02:11 JST 2024 OpenBSD/armv7 (bbb.intranet) (console) login: CPUの性能とかにもよるだろうけど、完了するまで10分くらい。 アップデートの中で、 [sysmerge(8)|https://man.openbsd.org/sysmerge] と [fw_update(1)|https://man.openbsd.org/fw_update] が実行される模様。 !!アップグレード後 bbb# uname -a OpenBSD bbb.intranet 7.5 GENERIC#209 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.5/armv7/SHA256.sig: 404 Not Found !古いファイルの削除 [Files to remove|https://www.openbsd.org/faq/upgrade75.html#RmFiles] を参考に、古いファイルを削除する。 7.5 のリリースで削除するものはない。 !設定ファイルと構文の変更 [Configuration and syntax changes|https://www.openbsd.org/faq/upgrade75.html#ConfigChanges] を参考に、設定ファイルを更新する。 7.5 のリリースで変わったものはない。 !パッケージ変更 [Special packages|https://www.openbsd.org/faq/upgrade75.html#SpecialPackages] を参考に、パッケージ更新する。 !!アップグレードログ root 宛にアップグレードのログが送られる。 !sysmerge output !rc.firsttime output !upgrade log !upgrade response file !!!メモ sysupgrade コマンドで、比較的簡単にできる。特に何もなければ、2,30分で完了できる。 全てのインストールセットがアップデート(インストール)されるので、不要なものがある場合は、 '''-n''' オプションを指定して、自動的に再起動しないようにして、'''/home/_sysupgrade''' に取得されたファイルから不要なものを削除してから、再起動する(_sysupgrade にあるすべてのファイルが対象になる)。