OpenBSD 7.0

Page content

OpenBSD 7.0 released !

the 7.0 Release was released on 14. Oct 2021, two weeks before the official Launch Date (1. Nov).

All the Changes are listed here: https://www.openbsd.org/70.html, or summarized: undeadly.org

Things i have to consider for my Boxes:

Upgrade Guide

Follow to official Upgrade Guide. You can Upgrade with an USB Stick, ISO Image, PXE Boot or inline (from a running system).

As with other Versions, i have my own upgrade Script for upgrading all my boxes. Use it at your own risk and test it somewhere before you do this on your productive environment.

Upgrade Script

you have been warned … !

you can download it ..

ftp -o /root/upgrade_to_70.sh https://blog.stoege.net/scripts/upgrade_to_70.sh

or do copy/paste the section below

cat << 'EOF' > /root/upgrade_to_70.sh
#!/usr/bin/env bash
#
# OpenBSD Upgrade Script - Upgrade from 6.9 to 7.0
#
# Copyright (c) 2021 StockerSolutions / @stoege
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# Functions
h1() {
cat << EOS

############################################################
##
## $1
##
############################################################

EOS
}

h2() {
cat << EOS

########################################
# $1
########################################

EOS
}

# Vars
ver="7.0"

# Version
version="v0.1 / 2021-10-15 / Stöge"
comment="Let's Upgrade to $ver"

# Path, Helpers, Hello
opwd=$(pwd); cd $(dirname $0); h1 "$comment $version"

remove_cert() {

  h1 "let's remove the expired Cert first"

  line=$(fgrep -n "O=Digital Signature Trust Co./CN=DST Root CA X3" /etc/ssl/cert.pem |cut -d":" -f 1)
  if [[ $line -ge 1 ]]; then
    start=$((line - 2))
    end=$((start + 43))
    sed -i.bak ${start},${end}d /etc/ssl/cert.pem
  fi

}

prepare () {

  h1 "let's do syspatch"

  syspatch || remove_cert
  syspatch

  h1 "let's update bsd.rd"

  ftp -o /bsd.rd https://cdn.openbsd.org/pub/OpenBSD/7.0/amd64/bsd.rd

  h1 "let's upgrade to ${ver} ..."

  rm -f /usr/X11R6/lib/libdmx.* \
        /usr/X11R6/include/X11/extensions/dmxext.h \
        /usr/X11R6/lib/pkgconfig/dmx.pc \
        /usr/X11R6/man/man3/DMX*.3
}

download() {

  local _response=$(sysupgrade -n)

  if [[ $_response == *reboot ]]; then
    h1 "Installed! Let's reboot ..."
    rm /home/_sysupgrade/{xf,xs}*
  else
    h1 "Nothing todo ..."
  fi

}

install() {
  reboot
}

postwork() {

  h1 "let's do some postwork after upgrade to ${ver} ..."

  h2 "make dev"
  cd /dev
  ./MAKEDEV all

  h2 "install boot"
  _boot=$(mount |awk -F'[/ ]' '/ on \/ / {print $3}')
  installboot ${_boot%?}

  h2 "sysmerge"
  sysmerge |tee -a /var/log/upgrade_70.log

  h2 "fw_update"
  fw_update -v
  fw_update -v |tee -a /var/log/upgrade_70.log

  h2 "syspatch"
  syspatch |tee -a /var/log/upgrade_70.log

  h2 "pkg_add -Vu"
  pkg_add -Vu |tee -a /var/log/upgrade_70.log

  h2 "pkg_delete -a"
  pkg_delete -a |tee -a /var/log/upgrade_70.log

  h2 "updatedb &"
  /usr/libexec/locate.updatedb &

}

# Main
_ver=$(uname -r)

if [ "$_ver" == "6.9" ]; then

  prepare
  download
  install

elif [ "$_ver" == "7.0" ]; then

  postwork

fi

exit 0
EOF

Usage

how to use the Update Script

# Get Scripts
Copy/Paste the Script to your Server

# Set Permission
chmod 700 /root/upgrade_to_70.sh

# Run to Upgrade
/root/upgrade_to_70.sh

# reboot automatically

# Run for Cleanup
/root/upgrade_to_70.sh

# Check dmesg, fail services, log, ...

-> you get a log file in /var/log/upgrade_70.log

Enjoy !


Any Comments ?

sha256: 85291ea5b14515930b8c6f14ffae81cde7562b3fc7f72e56ab6418afe46024dc