#!/bin/sh # Do not forget : # - http://www.openbsd.org/donations.html # - http://www.openbsd.org/items.html # - http://www.openbsd.org/tshirts.html # # Based on "How to make an OpenBSD bootable install CD" # located at http://www.pantz.org/os/openbsd/makingaopenbsdcd.shtml echo "$1" | grep -E '^(snapshots|stable|[1-9][0-9]*.[0-9])$' > /dev/null if [ $? -ne 0 ]; then echo "Bad version number" exit 1; fi if [ $1 = "stable" ]; then vernum=$(expr \( $(date +"%Y") \* 2 - 3973 \)) month=$(date +"%m") if [ $month -lt 5 ]; then vernum=$(expr $vernum - 1) elif [ $month -gt 10 ]; then vernum=$(expr $vernum + 1) fi vernum=$(expr $vernum / 10).$(expr $vernum % 10) echo "Stable should be v. $vernum" else vernum=$1 fi #default_src_host=ftp.dkuug.dk default_src_host=openbsd.informatik.uni-erlangen.de #default_src_host="ftp://ftp.crans.org" #default_src_path="ftp://ftp.crans.org/pub/OpenBSD" if [ -z "$2" ]; then echo "No source supplied using default $default_src_host" src_host=$default_src_host else src_host=$2 fi mkdir -p OpenBSD/$vernum/i386 cd OpenBSD/$vernum/i386 ftp_path=/pub/OpenBSD/$vernum/i386 packages="MD5" if [ "$vernum" = "snapshots" ]; then ncftpget $src_host . $ftp_path/MD5 undotted_vernum=`sed -e '/^MD5 (base/!d;s/\(^MD5 (base\)\([0-9]*\)\(.*\)$/\2/' MD5` packages="" else undotted_vernum=$(echo $vernum | sed -e 's/\.//') fi packages="$packages base$undotted_vernum.tgz" packages="$packages bsd" packages="$packages bsd.rd" packages="$packages cdrom$undotted_vernum.fs" packages="$packages comp$undotted_vernum.tgz" packages="$packages etc$undotted_vernum.tgz" packages="$packages floppy$undotted_vernum.fs" packages="$packages game$undotted_vernum.tgz" packages="$packages man$undotted_vernum.tgz" packages="$packages misc$undotted_vernum.tgz" packages="$packages xbase$undotted_vernum.tgz" packages="$packages xetc$undotted_vernum.tgz" packages="$packages xfont$undotted_vernum.tgz" packages="$packages xserv$undotted_vernum.tgz" packages="$packages xshare$undotted_vernum.tgz" packages="$packages ../ports.tar.gz" if [ $vernum != "snapshots" ]; then packages="$packages ../src.tar.gz" packages="$packages ../sys.tar.gz" fi package_list='' for package in $packages do package_list="$package_list $ftp_path/$package" done ncftpget $src_host . $package_list if [ -f "src.tar.gz" ]; then mv src.tar.gz .. fi if [ -f "sys.tar.gz" ]; then mv sys.tar.gz .. fi cd ../../ mkisofs -vrTJV "OpenBSD$undotted_vernum" \ -b $vernum/i386/cdrom$undotted_vernum.fs \ -c boot.catalog \ -o OpenBSD$undotted_vernum.iso \ ../OpenBSD/