180183Sjkh#!/bin/sh
280183Sjkh#
380183Sjkh# Module: mkisoimages.sh
480183Sjkh# Author: Jordan K Hubbard
580183Sjkh# Date:   22 June 2001
680183Sjkh#
780183Sjkh# $FreeBSD$
880183Sjkh#
980183Sjkh# This script is used by release/Makefile to build the (optional) ISO images
1080183Sjkh# for a FreeBSD release.  It is considered architecture dependent since each
1180183Sjkh# platform has a slightly unique way of making bootable CDs.  This script
1280183Sjkh# is also allowed to generate any number of images since that is more of
1380183Sjkh# publishing decision than anything else.
1480183Sjkh#
1580183Sjkh# Usage:
1680183Sjkh#
17138275Sjhb# mkisoimages.sh [-b] image-label image-name base-bits-dir [extra-bits-dir]
1880183Sjkh#
19138275Sjhb# Where -b is passed if the ISO image should be made "bootable" by
2080183Sjkh# whatever standards this architecture supports (may be unsupported),
2180183Sjkh# image-label is the ISO image label, image-name is the filename of the
2280183Sjkh# resulting ISO image, base-bits-dir contains the image contents and
2380183Sjkh# extra-bits-dir, if provided, contains additional files to be merged
2480183Sjkh# into base-bits-dir as part of making the image.
2580183Sjkh
2680183Sjkhif [ "x$1" = "x-b" ]; then
27221466Snwhitehorn	# This is highly x86-centric and will be used directly below.
28221466Snwhitehorn	bootable="-o bootimage=i386;$4/boot/cdboot -o no-emul-boot"
2980183Sjkh	shift
3080183Sjkhelse
3180183Sjkh	bootable=""
3280183Sjkhfi
3380183Sjkh
3480183Sjkhif [ $# -lt 3 ]; then
35221466Snwhitehorn	echo Usage: $0 '[-b] image-label image-name base-bits-dir [extra-bits-dir]'
3680183Sjkh	exit 1
3780183Sjkhfi
3880183Sjkh
39245177ShrsLABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift
4080183SjkhNAME=$1; shift
4180183Sjkh
42246283Shrspublisher="The FreeBSD Project.  http://www.FreeBSD.org/"
43245177Shrsecho "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab
44246283Shrsmakefs -t cd9660 $bootable -o rockridge -o label=$LABEL -o publisher="$publisher" $NAME $*
45219856Snwhitehornrm $1/etc/fstab
46