mkisoimages.sh revision 133950
1133950Sgrehan#!/bin/sh 2133950Sgrehan# 3133950Sgrehan# Module: mkisoimages.sh 4133950Sgrehan# Author: Jordan K Hubbard 5133950Sgrehan# Date: 22 June 2001 6133950Sgrehan# 7133950Sgrehan# $FreeBSD: head/release/powerpc/mkisoimages.sh 133950 2004-08-18 11:08:19Z grehan $ 8133950Sgrehan# 9133950Sgrehan# This script is used by release/Makefile to build the (optional) ISO images 10133950Sgrehan# for a FreeBSD release. It is considered architecture dependent since each 11133950Sgrehan# platform has a slightly unique way of making bootable CDs. This script 12133950Sgrehan# is also allowed to generate any number of images since that is more of 13133950Sgrehan# publishing decision than anything else. 14133950Sgrehan# 15133950Sgrehan# Usage: 16133950Sgrehan# 17133950Sgrehan# mkisoimages.sh [-b] image-label image-name base-bits-dir [extra-bits-dir] 18133950Sgrehan# 19133950Sgrehan# Where -b is passed if the ISO image should be made "bootable" by 20133950Sgrehan# whatever standards this architecture supports (may be unsupported), 21133950Sgrehan# image-label is the ISO image label, image-name is the filename of the 22133950Sgrehan# resulting ISO image, base-bits-dir contains the image contents and 23133950Sgrehan# extra-bits-dir, if provided, contains additional files to be merged 24133950Sgrehan# into base-bits-dir as part of making the image. 25133950Sgrehan 26133950Sgrehanif [ "x$1" = "x-b" ]; then 27133950Sgrehan cp /usr/src/release/powerpc/boot.tbxi ${4}/boot 28133950Sgrehan bootable="-hfs-bless ${4}/boot -map /usr/src/release/powerpc/hfs.map" 29133950Sgrehan shift 30133950Sgrehanelse 31133950Sgrehan bootable="" 32133950Sgrehanfi 33133950Sgrehan 34133950Sgrehanif [ $# -lt 3 ]; then 35133950Sgrehan echo Usage: $0 '[-b] image-label image-name base-bits-dir [extra-bits-dir]' 36133950Sgrehan rm -f ${IMG} 37133950Sgrehan exit 1 38133950Sgrehanfi 39133950Sgrehan 40133950Sgrehantype mkisofs 2>&1 | grep " is " >/dev/null 41133950Sgrehanif [ $? -ne 0 ]; then 42133950Sgrehan echo The cdrtools port is not installed. Trying to get it now. 43133950Sgrehan if [ -f /usr/ports/sysutils/cdrtools/Makefile ]; then 44133950Sgrehan cd /usr/ports/sysutils/cdrtools && make install BATCH=yes && make clean 45133950Sgrehan else 46133950Sgrehan if ! pkg_add -r cdrtools; then 47133950Sgrehan echo "Could not get it via pkg_add - please go install this" 48133950Sgrehan echo "from the ports collection and run this script again." 49133950Sgrehan exit 2 50133950Sgrehan fi 51133950Sgrehan fi 52133950Sgrehanfi 53133950Sgrehan 54133950SgrehanLABEL=$1; shift 55133950SgrehanNAME=$1; shift 56133950Sgrehan 57133950Sgrehanmkisofs $bootable -r -hfs -part -no-desktop -hfs-volid $LABEL -l -J -L -o $NAME $* 58