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.

Locally, without a USB drive

Use or follow this script:

#!/bin/sh

# Define ftp server

FTP=ftp://ftp.jaist.ac.jp/pub/OpenBSD/snapshots/amd64

# Remove previous snapshots

\rm /mnt/upgrade/*

# Fetch snapshots in /mnt/upgrade

cd /mnt/upgrade

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

Reboot

# cd /mnt/upgrade
# sysmerge -s etc61.tgz -x xetc61.tgz

(this usually shows nothing, as I am *only* modifying /etc/pkg.config and /etc/rc.conf.local)

Update the packages:

# pkg_add -vu

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 -vu