Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / release / i386 / mkisoimages.sh
1 #!/bin/sh
2 #
3 # Module: mkisoimages.sh
4 # Author: Jordan K Hubbard
5 # Date:   22 June 2001
6 #
7 # $FreeBSD: src/release/i386/mkisoimages.sh,v 1.2.2.4 2002/01/25 05:21:54 murray Exp $
8 # $DragonFly: src/release/i386/Attic/mkisoimages.sh,v 1.2 2003/06/17 04:27:20 dillon Exp $
9 #
10 # This script is used by release/Makefile to build the (optional) ISO images
11 # for a FreeBSD release.  It is considered architecture dependent since each
12 # platform has a slightly unique way of making bootable CDs.  This script
13 # is also allowed to generate any number of images since that is more of
14 # publishing decision than anything else.
15 #
16 # Usage:
17 #
18 # mkisoimages.sh [-b] image-label image-name base-bits-dir [extra-bits-dir]
19 #
20 # Where -b is passed if the ISO image should be made "bootable" by
21 # whatever standards this architecture supports (may be unsupported),
22 # image-label is the ISO image label, image-name is the filename of the
23 # resulting ISO image, base-bits-dir contains the image contents and
24 # extra-bits-dir, if provided, contains additional files to be merged
25 # into base-bits-dir as part of making the image.
26
27 if [ "x$1" = "x-b" ]; then
28         # This is highly x86-centric and will be used directly below.
29         bootable="-b floppies/boot.flp -c floppies/boot.catalog"
30         shift
31 else
32         bootable=""
33 fi
34
35 if [ $# -lt 3 ]; then
36         echo Usage: $0 '[-b] image-label image-name base-bits-dir [extra-bits-dir]'
37         exit 1
38 fi
39
40 type mkisofs 2>&1 | grep " is " >/dev/null
41 if [ $? -ne 0 ]; then
42         echo The mkisofs port is not installed.  Trying to get it now.
43         if [ -f /usr/ports/sysutils/mkisofs/Makefile ]; then
44                 cd /usr/ports/sysutils/mkisofs && make install && make clean
45         else
46                 if ! pkg_add -r mkisofs; then
47                         echo "Could not get it via pkg_add - please go install this"
48                         echo "from the ports collection and run this script again."
49                         exit 2
50                 fi
51         fi
52 fi
53
54 LABEL=$1; shift
55 NAME=$1; shift
56
57 mkisofs $bootable -r -J -V $LABEL -o $NAME $*