On 17.05.2015 17:08, Peter Leber wrote:
I want to build a test system based on OpenBSD 5.7 which updates
in an automated fashion.
The goal is to have a remotely located machine which runs OpenBSD 5.7
and is constantly updated. While restarting the machine remotely via
SSH
is perfectly fine to me, I do not want to access the machine locally in
order to interrupt the automatic reboot in order to trigger the manual
upgrading process. I'm fine with following -stable and -current alike.
I recognize that there's m:tier's binary patching service
(https://stable.mtier.org), but the packages are signed
by m:tier rather than the OpenBSD project. While following m:tier's
binary patches is a good compromise to me, it's not a perfect solution.
I'm perfectly fine with running the -current flavour of OpenBSD
feature-
and stability-wise, but I did not have the success of remotely
triggering
a script, rebooting the machine and have an up and running updated
machine.
While I did find the autoinstall(8) feature, which, since 5.7, should
be
able to trigger an automatic upgrade if the file /auto_upgrade.conf is
present, I did not see an effect in the bootup messages on the virtual
machine I'm using for testing things out.
Furthermore, I did find a tool named snap, aiming at making running
-current more enjoyable (see https://github.com/qbit/snap), but it does
also seem to be relying on the user to manually start the upgrading
process on system reboot, if I got everything correctly.
Is there someone aware of a procedure which could help me solving my
problem?
I thank you very much in advance.
Peter
Hi,
autoinstall(8) is your friend:
[ns]~/upgrade$ cat download
#!/bin/sh
rd=bsd.rd
#URL=http://mirror.telepoint.bg/OpenBSD/snapshots/amd64/
#URL=http://ftp.openbsd.org/pub/OpenBSD/snapshots/amd64/
URL=http://ftp5.eu.openbsd.org/ftp/pub/OpenBSD/snapshots/amd64/
#URL=http://ftp2.eu.openbsd.org/pub/OpenBSD/snapshots/amd64/
wget -r -N -l1 -nd -R.gif,.html -Abs*,.tgz,index.txt,SHA*,INS* $URL
sudo cp $rd /tmp
# build rdsetroot
( cd /usr/src/distrib/common && cc -o /tmp/rdsetroot elf32.c elf64.c
elfrdsetroot.c )
# extract ramdisk from bsd.rd
/tmp/rdsetroot -x /tmp/bsd.rd /tmp/ramdisk.img
# mount ramdisk
sudo vnconfig vnd0 /tmp/ramdisk.img
sudo mount /dev/vnd0a /mnt
# copy config file
sudo cp /auto_upgrade.conf /mnt/auto_upgrade.conf
# umount ramdisk
sudo umount /dev/vnd0a
sudo vnconfig -u vnd0
# put modified ramdisk in bsd.rd
sudo /tmp/rdsetroot /tmp/bsd.rd /tmp/ramdisk.img
# backup /bsd to /obsd
sudo mv /bsd /obsd
# cleanup
sudo rm /tmp/ramdisk.img
sudo mv /tmp/bsd.rd /bsd
#EOF
[ns]~/upgrade$ cat /auto_upgrade.conf
Which disk is the root disk = sd2
Root filesystem = sd2a
Force checking of clean non-root filesystems = no
Location of sets = disk
Is the disk partition already mounted = yes
Pathname to the sets = /mnt/home/vlado/upgrade
#EOF
Run download script, reboot and you are up-to-date!