Contributed by marco on from the who-wants-to-drive-100miles dept.
Today I released a new version of YaifO with works fine to install OpenBSD 3.8 remotely via Secure Shell.
See the project page:
http://openbsd-geek.de/projects/yaifo
It is very useful to do installations of dedicated servers in colocations which often comes with Linux preinstalled.
Note: This has not been tested by the undeadly editors so please add some postings with success/failure stories.
(Comments are closed)
By Matt Van Mater (69.255.1.181) on
In any case, I think this is a great idea and support it strongly. I hope it gains support from others as well.
An even better alternative to this would be the ability to create a jumpstart like script that can install a full obsd just by grabbing a few variables out of a 'install.conf' file (ie partition choices, ftp mirror, install sets, etc). An even better option would be to save your installation choices to a text file for 'replay'. I started working with Expect to create a script like this, but never got far down that road. Anyone else interested in something like this?
Comments
By Anonymous Coward (69.70.207.240) on
By Matt Van Mater (69.255.1.181) on
#!/bin/sh
#Based on the work found here: http://www.openbsd.de/~wbx/
# This code written by Matt Van Mater
echo Getting the yaifo code
ftp -a http://www.openbsd.de/~wbx/yaifo-0.1.tgz
echo Uncompressing it
tar zxf yaifo-0.1.tgz
cd yaifo
echo Now we have to manually edit the config to make it point at the right DNS, gateway, etc
echo Enter DNS
read DNS_
echo Enter IP address
read IP_
echo Enter netmask
read NETMASK_
echo Enter gateway
read GATEWAY_
echo
echo Enter a short name for this configuration with no spaces in it
read CFG_NAME
echo Do you want to fetch the src files? y or n
read GET_SRC
echo Do you want to include the install sets for your arch on the cd? y or n
read GET_TGZs
echo
#values currently in config file, need to replace them below
#DHCP=on
#DNS=192.168.2.1
#IP=
#NETMASK=255.255.255.255
#GATEWAY=10.255.255.1
sed s/DHCP=on/DHCP=off/g config > config.1
sed s/DNS=192.168.2.1/DNS=$DNS_/g config.1 > config.2
sed s/IP=/IP=$IP_/g config.2 > config.3
sed s/NETMASK=255.255.255.255/NETMASK=$NETMASK_/g config.3 > config.4
sed s/GATEWAY=10.255.255.1/GATEWAY=$GATEWAY_/g config.4 > config.5
mv config.5 config
rm config.*
echo Generating SSH key.
echo Just press enter 3 times '(store key in default location, and give blank password)'
ssh-keygen -t rsa
cp ~/.ssh/id_rsa.pub authorized_keys
if [ $GET_SRC == "y" ]
then
export HERE=`pwd`
cd /usr/src
ftp -a ftp://ftp3.usa.openbsd.org/pub/OpenBSD/`uname -r`/src.tar.gz
clear
echo Decompressing src
tar zxf src.tar.gz
ftp -a ftp://ftp3.usa.openbsd.org/pub/OpenBSD/`uname -r`/sys.tar.gz
clear
echo Decompressing sys
tar zxf sys.tar.gz
cd $HERE
fi
make clean
make obj
make
clear
echo Making ISO
mkdir -p cd-dir/`uname -r`/`arch -s`
mkdir -p cd-dir/etc
echo "echo Welcome to the YAIFO remote installation CD" > cd-dir/etc/boot.conf
echo "set image /`uname -r`/`arch -s`/yaifo.rd" >> cd-dir/etc/boot.conf
cp yaifo.rd cd-dir/`uname -r`/`arch -s`/
cp /usr/mdec/cdb* cd-dir/`uname -r`/`arch -s`
if [ $GET_TGZs == "y" ]
then
echo Getting various sources
export HERE=`pwd`
cd cd-dir/`uname -r`/
# Try to capitalize on files you may have already downloaded
if [ -e /usr/src/src.tar.gz ]
then
cp /usr/src/src.tar.gz .
else
ftp -a ftp://ftp3.usa.openbsd.org/pub/OpenBSD/`uname -r`/src.tar.gz
fi
if [ -e /usr/src/sys.tar.gz ]
then
cp /usr/src/sys.tar.gz .
else
ftp -a ftp://ftp3.usa.openbsd.org/pub/OpenBSD/`uname -r`/sys.tar.gz
fi
# Do not forget the others
ftp -a ftp://ftp3.usa.openbsd.org/pub/OpenBSD/`uname -r`/ports.tar.gz
ftp -a ftp://ftp3.usa.openbsd.org/pub/OpenBSD/`uname -r`/XF4.tar.gz
cd `arch -s`/
# Get list of what there is to download for your arch
ftp -a ftp://ftp3.usa.openbsd.org/pub/OpenBSD/`uname -r`/`arch -s`/index.txt
for i in `cat index.txt`
do
ftp -a ftp://ftp3.usa.openbsd.org/pub/OpenBSD/`uname -r`/`arch -s`/$i
done
rm index.txt
cd $HERE
fi
# EXTREMELY UNSAFE, but convenient
cp ~/.ssh/id_rsa cd-dir/
mkhybrid -l -J -R -V $CFG_NAME -b `uname -r`/`arch -s`/cdbr -c `uname -r`/`arch -s`/boot.catalog -o $CFG_NAME-yaifo.iso cd-dir/
By Archite (69.238.133.30) adam@akarsoft.com on http://akarsoft.com
If you have not tried yaifo yet, please do! It is a great project and fills a great need!
By Marco Peereboom (67.64.89.177) marco@peereboom.us on http://www.peereboom.us
By Brendan Strejcek (128.135.11.3) on http://praksys.blogspot.com/
Automated installation is one of those really important features that is not present in the official OpenBSD base. (At least, it is really important to those of us that manage lots of OpenBSD machines.)
This was my solution, a while back:
http://people.cs.uchicago.edu/~brendan/howtos/openbsd_install/
I should probably update this as it is no longer in sync with the scripts that I actually use... my most recent version can install any version of OpenBSD.
YaifO looks very cool (and a bit more polished than my crufty howto).
By Anonymous Coward (65.92.66.92) on