OpenBSD 7.1
OpenBSD 7.1 released !
… a while ago. I upgraded all my boxes since quite a while, but i didn’t write a short post about it. There is nothing really unexpected, a stable, easy, straigh-forward development of my favourite OS, except that there is a need for more than 1G Free Disk Space in /var. That was a bit a problem for smalled Boxes like the APU with 16G Disk …
All the Changes are listed here: https://www.openbsd.org/71.html, or summarized: undeadly.org
Things i have to consider for my Boxes:
- lang/python. The default Python 3.x flavor has changed to Python 3.9
Upgrade Guide
As usual, 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 … !
copy/paste the section below
cat << 'EOF' > /root/upgrade_to_71.sh
#!/usr/bin/env bash
#
# OpenBSD Upgrade Script - Upgrade from 7.0 to 7.1
#
# Copyright (c) 2022 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
}
h6() {
cat << EOS
# $1
EOS
}
# Vars
ver="7.1"
# Version
version="v0.1 / 2022-04.20 / Stoege"
comment="Let's Upgrade to $ver"
# Path, Helpers, Hello
opwd=$(pwd); cd $(dirname $0); h1 "$comment $version"
check_diskfree () {
h1 "check if 1.1G Disk Free"
FREE=$(df -k /usr |awk '/usr/{ print $4 }')
if [[ $FREE -lt 1150000 ]]; then
FREE=$((FREE / 1024))
echo
h6 "you have ${FREE} MB free Diskspace at /usr. Need at least 1.1GB! Exit ..."
h2 "you may wanna remove GENERIC Kernel Stuff?"
h6 "rm -rf /usr/share/relink/kernel"
echo
exit 1
else
echo
echo "more than 1.1 GBs free! Let's proceed ..."
echo
fi;
}
prepare () {
h1 "let's update bsd.rd"
ftp -o /bsd.rd "https://cdn.openbsd.org/pub/OpenBSD/${ver}/amd64/bsd.rd"
h1 "let's upgrade to ${ver} ..."
}
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_${ver}.log
h2 "fw_update"
fw_update -v
fw_update -v |tee -a /var/log/upgrade_${ver}.log
h2 "syspatch"
syspatch |tee -a /var/log/upgrade_${ver}.log
h2 "pkg_add -Vu"
pkg_add -Vu |tee -a /var/log/upgrade_${ver}.log
h2 "remove python 3.8"
pkg_delete python--%3.8
h2 "find scripts with python3.8 @ shebang"
file /usr/{,local}/{s,}bin/* |grep -i python3.8
h2 "python 3.9 now default"
cd /usr/local/bin/
ln -sf python3.9 python3
ln -sf python3.9-config python3-config
h2 "pkg_delete -a"
pkg_delete -a |tee -a /var/log/upgrade_${ver}.log
h2 "updatedb &"
/usr/libexec/locate.updatedb &
}
# Main
_ver=$(uname -r)
if [ "$_ver" == "7.0" ]; then
check_diskfree
prepare
download
install
elif [ "$_ver" == "${ver}" ]; then
postwork
fi
exit 0
EOF
set permission
chmod u+x /root/upgrade_to_71.sh
run it twice ! 1 time to upgrade, 1 time after reboot to upgrade packages …
/root/upgrade_to_71.sh
behind Proxy …
if you’re ever behind a proxy which blocks some files by Mediatype (ARGHHHH!!!), you can do a workaround
download iso
ftp -o /tmp/install71.iso http://cdn.openbsd.org/pub/OpenBSD/7.1/amd64/install71.iso
mount locally
vnconfig vnd0 /tmp/install71.iso
mount -t cd9660 /dev/vnd0c /mnt
copy the files to /home/_sysupgrade
cp /mnt/7.1/amd64/* /home/_sysupgrade/
… and try the Script again :)
Happy Upgrade !
Any Comments ?
sha256: f964f64bb007503027e2b5ccf42167bd62f57c8a54200220271952227f9f375e