mkisoimages.sh revision 290283
1193326Sed#!/bin/sh
2193326Sed#
3193326Sed# Module: mkisoimages.sh
4193326Sed# Author: Jordan K Hubbard
5193326Sed# Date:   22 June 2001
6193326Sed#
7193326Sed# $FreeBSD: stable/10/release/i386/mkisoimages.sh 290283 2015-11-02 21:58:19Z dteske $
8193326Sed#
9193326Sed# This script is used by release/Makefile to build the (optional) ISO images
10193326Sed# for a FreeBSD release.  It is considered architecture dependent since each
11193326Sed# platform has a slightly unique way of making bootable CDs.  This script
12193326Sed# is also allowed to generate any number of images since that is more of
13193326Sed# publishing decision than anything else.
14193326Sed#
15193326Sed# Usage:
16249423Sdim#
17249423Sdim# mkisoimages.sh [-b] image-label image-name base-bits-dir [extra-bits-dir]
18193326Sed#
19193326Sed# Where -b is passed if the ISO image should be made "bootable" by
20234353Sdim# whatever standards this architecture supports (may be unsupported),
21249423Sdim# image-label is the ISO image label, image-name is the filename of the
22249423Sdim# resulting ISO image, base-bits-dir contains the image contents and
23193326Sed# extra-bits-dir, if provided, contains additional files to be merged
24193326Sed# into base-bits-dir as part of making the image.
25194179Sed
26249423Sdimif [ "x$1" = "x-b" ]; then
27218893Sdim	# This is highly x86-centric and will be used directly below.
28193326Sed	bootable="-o bootimage=i386;$4/boot/cdboot -o no-emul-boot"
29249423Sdim	shift
30249423Sdimelse
31249423Sdim	bootable=""
32198893Srdivackyfi
33198092Srdivacky
34193326Sedif [ $# -lt 3 ]; then
35234353Sdim	echo "Usage: $0 [-b] image-label image-name base-bits-dir [extra-bits-dir]"
36193326Sed	exit 1
37193326Sedfi
38239462Sdim
39239462SdimLABEL=`echo "$1" | tr '[:lower:]' '[:upper:]'`; shift
40239462SdimNAME="$1"; shift
41239462Sdim
42239462Sdimpublisher="The FreeBSD Project.  http://www.FreeBSD.org/"
43239462Sdimecho "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$1/etc/fstab"
44239462Sdimmakefs -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@"
45239462Sdimrm "$1/etc/fstab"
46239462Sdim