mkisoimages.sh revision 141066
1226031Sstas#!/bin/sh
2226031Sstas#
3226031Sstas# Module: mkisoimages.sh
4226031Sstas# Author: Jordan K Hubbard
5226031Sstas# Date:   22 June 2001
6226031Sstas#
7226031Sstas# $FreeBSD: head/release/i386/mkisoimages.sh 141066 2005-01-30 21:10:52Z kensmith $
8226031Sstas#
9226031Sstas# This script is used by release/Makefile to build the (optional) ISO images
10226031Sstas# for a FreeBSD release.  It is considered architecture dependent since each
11226031Sstas# platform has a slightly unique way of making bootable CDs.  This script
12226031Sstas# is also allowed to generate any number of images since that is more of
13226031Sstas# publishing decision than anything else.
14226031Sstas#
15226031Sstas# Usage:
16226031Sstas#
17226031Sstas# mkisoimages.sh [-b] image-label image-name base-bits-dir [extra-bits-dir]
18226031Sstas#
19226031Sstas# Where -b is passed if the ISO image should be made "bootable" by
20226031Sstas# whatever standards this architecture supports (may be unsupported),
21226031Sstas# image-label is the ISO image label, image-name is the filename of the
22226031Sstas# resulting ISO image, base-bits-dir contains the image contents and
23226031Sstas# extra-bits-dir, if provided, contains additional files to be merged
24226031Sstas# into base-bits-dir as part of making the image.
25226031Sstas
26226031Sstaspublisher="The FreeBSD Project.  http://www.freebsd.org/"
27226031Sstas
28226031Sstasif [ "x$1" = "x-b" ]; then
29226031Sstas	bootable="-b boot/cdboot -no-emul-boot"
30226031Sstas	shift
31226031Sstaselse
32226031Sstas	bootable=""
33226031Sstasfi
34226031Sstas
35226031Sstasif [ $# -lt 3 ]; then
36226031Sstas	echo Usage: $0 '[-b] image-label image-name base-bits-dir [extra-bits-dir]'
37226031Sstas	exit 1
38226031Sstasfi
39226031Sstas
40226031Sstastype mkisofs 2>&1 | grep " is " >/dev/null
41226031Sstasif [ $? -ne 0 ]; then
42226031Sstas	echo The cdrtools port is not installed.  Trying to get it now.
43226031Sstas	if [ -f /usr/ports/sysutils/cdrtools/Makefile ]; then
44226031Sstas		cd /usr/ports/sysutils/cdrtools && make install BATCH=yes && make clean
45226031Sstas	else
46226031Sstas		if ! pkg_add -r cdrtools; then
47226031Sstas			echo "Could not get it via pkg_add - please go install this"
48226031Sstas			echo "from the ports collection and run this script again."
49226031Sstas			exit 2
50226031Sstas		fi
51226031Sstas	fi
52226031Sstasfi
53226031Sstas
54226031SstasLABEL=$1; shift
55226031SstasNAME=$1; shift
56226031Sstas
57226031Sstasmkisofs $bootable -r -J -V $LABEL -publisher "$publisher" -o $NAME $*
58226031Sstas