October 21, 2016

OpenBSD: Follow -current

Remeber: This is an unofficial guide

Read this for the real thing. This is just meant as a reminder for myself.

First things

Set PKG_PATH and installurl to fastly


# cat /etc/installurl
https://fastly.cdn.openbsd.org/pub/OpenBSD

# echo $PKG_PATH
https://fastly.cdn.openbsd.org/pub/OpenBSD/snapshots/packages/amd64

The easiest and safest way: My way

Download bsd.rd from fastly and place it in /

After that, boot from bsd.rd

When prompted for the snapshots, choose http and no proxy and type fastly.cdn.openbsd.org

Make sure you choose the path

pub/OpenBSD/snapshots/amd64

because the script upgrade will point to the last release number, and not to snapshots.

Follow the usual process and reboot.

In case of, please check the bottom of the page

http://www.openbsd.org/faq/current.html

Update your binaries

After upgrading, do not forget to update your binaries with

$ pkg_add -Iuv

Important is to note that during a release cycle, i.e. when

$ dmesg | grep OpenBSD

does NOT show the word “current”, you need to explicitly point to pkg_add to the snapshot directory:

$ pkg_add -D snap -Iuv

Locally, without a USB drive

Use or follow this script:

#!/bin/sh

# Define ftp server for ftp
FTP=ftp://ftp.spline.de/pub/OpenBSD/snapshots/amd64

# Define http server for wget

HTTP=http://fastly.cdn.openbsd.org/pub/OpenBSD/snapshots/amd64
alias WGET='wget -r -l1 -H -t1 -nd -N -np -erobots=off -A'

# Remove previous snapshots

\rm /mnt/upgrade/*

# Fetch snapshots in /mnt/upgrade

cd /mnt/upgrade

# If using http, employ wget to retrieve files

WGET bsd\* $HTTP
WGET INS\* $HTTP
WGET index.txt $HTTP
WGET \*tgz $HTTP
WGET SHA\* $HTTP

# If using ftp, uncomment this one
#ftp -i $FTP/{INS\*,index.txt,bsd\*,\*tgz,SHA\*}

# Make a backup of previous bsd.rd and move new one
# to / so that we can update

cp /bsd.rd /bsd.rd.old
cp bsd.rd /

# Ask the user whether running bsd should be backup'ed

echo ""
echo "Do you want to backup the current kernel bsd as bsd.old?"
echo ""
read answer
case $answer in
yes|Yes|y|Y|S|s)
cp /bsd /bsd.old && echo "" && echo "Current bsd backup'ed..."
;;
no|n|N)
echo "Current bsd not backup'ed..."
;;
esac

# Final note

echo ""
echo "Reboot, boot bsd.rd and choose for the location of the sets:"
echo ""
echo " [disk] with path /mnt/upgrade"
echo ""

Run upgrade and when getting to

Location of sets? (cd disk ftp http or 'done') [cd]

choose disk, give /mnt/upgrade as path and complete the upgrade in the usual way

Update the packages:

# pkg_add -Iuv

With a USB drive

Download install.fs and SHA256.sig from -current (change install60.fs to current number, which is the one used in -stable)

wget -c http://ftp.openbsd.org/pub/OpenBSD/snapshots/amd64/install60.fs
wget -c http://ftp.openbsd.org/pub/OpenBSD/snapshots/amd64/SHA256.sig

Verify the downloaded files

$ signify -Cp /etc/signify -Cp /etc/signify/openbsd-60-base.pub -x SHA256.sig install60.fs

Create a usb installer

$ doas dd if=install.fs of=/dev/rsd2c bs=1m

After it successfully created the usb, copy the SHA256.sig to it

$ doas mount .dev.sd2a /mnt
$ doas cp SHA256.sig /mnt/6.0/amd64/

Then boot from that drive and run (U)pgrade, and then

# pkg_add -Iuv