# Date : 2006.07.22
# Purpose : Automatic download file sets and create an OpenBSD -release or
# -snapshots ISO.
# Version : 0.1
# Usage : ./mk_openbsd_iso.sh [3.9|4.0|snapshots] [i386|amd64|sparc64]
VERSION="$1" # Special OpenBSD version, like 3.9, 4.0, snapshots.
ARCH="$2" # Maechine architecture, like i386, amd64.
TMP_ARCHIVE="$HOME/tmp/openbsd" # Store all openbsd file sets.
SETS_ARCHIVE="$TMP_ARCHIVE/$VERSION/$ARCH" # Store all installation file sets.
PKGS_ARCHIVE="$TMP_ARCHIVE/$VERSION/$ARCH/packages" # Store all packages.
FETCH_CMD="wget"
CDROM_FS=$(basename ${SETS_ARCHIVE}/cdrom*.fs)
# Check the following URL to choose a mirror near you:
# http://www.openbsd.org/ftp.html
#MIRROR="ftp://ftp.openbsd.org/pub/OpenBSD"
MIRROR="http://mirror.openbsd.org.cn/ftp"
MKISOFS_CMD="mkisofs -vrlTJV "OpenBSD_${VERSION}_$ARCH" \
-b $VERSION/$ARCH/${CDROM_FS} \
-c boot.catalog \
-o $HOME/OpenBSD_${VERSION}_$ARCH.iso $TMP_ARCHIVE"
USAGE()
{
if [ X"$#" != X"2" ]; then
echo "USAGE: $0 VERSION ARCH"
echo "e.g.: $0 [3.9|4.0|snapshots] [i386|amd64|...]"
exit 255
fi
}
CHECK_APPS()
{
# Set all nessessary applications into an ARRAY: APPS.
APPS_ARRAY="mkisofs $FETCH_CMD"
echo "Checking neccessary applications..."
for i in $APPS_ARRAY
do
if [ ! $(whereis "$i") ]
then
echo "ERROR: $i is not installed, you should installed first"
case $i in
mkisofs)
echo "mkisofs is always included in package 'cdrtools'.";;
esac
exit
fi
done
}
CHECK_DIRS()
{
# Set all nessessary dir into an ARRAY: DIRS.
DIRS_ARRAY="$SETS_ARCHIVE $PKGS_ARCHIVE"
echo "Checking neccessary directories..."
# Check and create dirs.
for dir in ${DIRS_ARRAY}
do
if [ ! -d "$dir" ]; then
echo -ne "\tWARNNING: $dir NOT exist, creating it..."
mkdir -p $dir
echo "DONE"
fi
如果您对本文有任何疑问或者建议,请到讨论区发表您的意见:
>>
论坛入口 <<
上一页12 3 下一页
上一篇:福布斯:Open BSD老板对Linux大肆攻击 下一篇:NetBSD的创建人之一为NetBSD未来担忧