mkisoimages.sh revision 132203
1204076Spjd#!/bin/sh
2204076Spjd#
3217965Spjd# Module: mkisoimages.sh
4204076Spjd# Author: Jordan K Hubbard
5204076Spjd# Date:   22 June 2001
6204076Spjd#
7204076Spjd# $FreeBSD: head/release/i386/mkisoimages.sh 132203 2004-07-15 09:28:03Z murray $
8204076Spjd#
9204076Spjd# This script is used by release/Makefile to build the (optional) ISO images
10204076Spjd# for a FreeBSD release.  It is considered architecture dependent since each
11204076Spjd# platform has a slightly unique way of making bootable CDs.  This script
12204076Spjd# is also allowed to generate any number of images since that is more of
13204076Spjd# publishing decision than anything else.
14204076Spjd#
15204076Spjd# Usage:
16204076Spjd#
17204076Spjd# mkisoimages.sh [-[e]b] image-label image-name base-bits-dir [extra-bits-dir]
18204076Spjd#
19204076Spjd# Where -[e]b is passed if the ISO image should be made "bootable" by
20204076Spjd# whatever standards this architecture supports (may be unsupported),
21204076Spjd# image-label is the ISO image label, image-name is the filename of the
22204076Spjd# resulting ISO image, base-bits-dir contains the image contents and
23204076Spjd# extra-bits-dir, if provided, contains additional files to be merged
24204076Spjd# into base-bits-dir as part of making the image.
25204076Spjd
26204076Spjdpublisher="The FreeBSD Project.  http://www.freebsd.org/"
27204076Spjd
28204076Spjdif [ "x$1" = "x-b" ]; then
29204076Spjd	bootable="-b boot/cdboot -no-emul-boot"
30204076Spjd	shift
31204076Spjdelif [ "x$1" = "x-eb" ]; then
32204076Spjd	bootable="-b floppies/boot.flp -c floppies/boot.catalog"
33204076Spjd	shift
34204076Spjdelse
35204076Spjd	bootable=""
36204076Spjdfi
37204076Spjd
38204076Spjdif [ $# -lt 3 ]; then
39204076Spjd	echo Usage: $0 '[-b] image-label image-name base-bits-dir [extra-bits-dir]'
40204076Spjd	exit 1
41204076Spjdfi
42204076Spjd
43204076Spjdtype mkisofs 2>&1 | grep " is " >/dev/null
44204076Spjdif [ $? -ne 0 ]; then
45217965Spjd	echo The cdrtools port is not installed.  Trying to get it now.
46217965Spjd	if [ -f /usr/ports/sysutils/cdrtools/Makefile ]; then
47217965Spjd		cd /usr/ports/sysutils/cdrtools && make install BATCH=yes && make clean
48204076Spjd	else
49204076Spjd		if ! pkg_add -r cdrtools; then
50204076Spjd			echo "Could not get it via pkg_add - please go install this"
51204076Spjd			echo "from the ports collection and run this script again."
52204076Spjd			exit 2
53204076Spjd		fi
54204076Spjd	fi
55217731Spjdfi
56204076Spjd
57204076SpjdLABEL=$1; shift
58204076SpjdNAME=$1; shift
59204076Spjd
60204076Spjdmkisofs $bootable -r -J -V $LABEL -P "$publisher" -o $NAME $*
61204076Spjd