mkisoimages.sh revision 223001
1149487Stjr#!/bin/sh 260786Sps# 3195941Sdelphij# Module: mkisoimages.sh 460786Sps# Author: Jordan K Hubbard 560786Sps# Date: 22 June 2001 660786Sps# 760786Sps# $FreeBSD: head/release/powerpc/mkisoimages.sh 223001 2011-06-12 00:14:57Z nwhitehorn $ 860786Sps# 960786Sps# This script is used by release/Makefile to build the (optional) ISO images 1060786Sps# for a FreeBSD release. It is considered architecture dependent since each 1160786Sps# platform has a slightly unique way of making bootable CDs. This script 1260786Sps# is also allowed to generate any number of images since that is more of 1360786Sps# publishing decision than anything else. 1460786Sps# 1560786Sps# Usage: 1660786Sps# 1760786Sps# mkisoimages.sh [-b] image-label image-name base-bits-dir [extra-bits-dir] 1860786Sps# 1960786Sps# Where -b is passed if the ISO image should be made "bootable" by 20161478Sdelphij# whatever standards this architecture supports (may be unsupported), 2160786Sps# image-label is the ISO image label, image-name is the filename of the 22161478Sdelphij# resulting ISO image, base-bits-dir contains the image contents and 2389019Sps# extra-bits-dir, if provided, contains additional files to be merged 2489019Sps# into base-bits-dir as part of making the image. 2560786Sps 26161478Sdelphijif [ "x$1" = "x-b" ]; then 2760786Sps # Apple boot code 2889019Sps uudecode -o /tmp/hfs-boot-block.bz2 `dirname $0`/hfs-boot.bz2.uu 2989019Sps bzip2 -d /tmp/hfs-boot-block.bz2 3089019Sps OFFSET=$(hd /tmp/hfs-boot-block | grep 'Loader START' | cut -f 1 -d ' ') 3160786Sps OFFSET=0x$(echo 0x$OFFSET | awk '{printf("%x\n",$1/512);}') 3260786Sps dd if=$4/boot/loader of=/tmp/hfs-boot-block seek=$OFFSET conv=notrunc 3360786Sps 3460786Sps bootable="-o bootimage=macppc;/tmp/hfs-boot-block -o no-emul-boot" 3560786Sps 36128345Stjr # pSeries/PAPR boot code 3760786Sps mkdir -p $4/ppc/chrp 3863128Sps cp $4/boot/loader $4/ppc/chrp 3960786Sps cat > $4/ppc/bootinfo.txt << EOF 4060786Sps<chrp-boot> 4160786Sps<description>FreeBSD Install</description> 42161478Sdelphij<os-name>FreeBSD</os-name> 4360786Sps<boot-script>boot &device;:&partition;,\ppc\chrp\loader</boot-script> 44161478Sdelphij</chrp-boot> 45161478SdelphijEOF 4660786Sps bootable="$bootable -o chrp-boot" 4760786Sps 48161478Sdelphij shift 4960786Spselse 5060786Sps bootable="" 5160786Spsfi 5260786Sps 5360786Spsif [ $# -lt 3 ]; then 5463128Sps echo Usage: $0 '[-b] image-label image-name base-bits-dir [extra-bits-dir]' 5560786Sps exit 1 5660786Spsfi 5760786Sps 5860786SpsLABEL=$1; shift 5960786SpsNAME=$1; shift 6060786Sps 6160786Spsecho "/dev/iso9660/`echo $LABEL | tr '[:lower:]' '[:upper:]'` / cd9660 ro 0 0" > $1/etc/fstab 6263128Spsmakefs -t cd9660 $bootable -o rockridge -o label=$LABEL $NAME $* 6363128Spsrm $1/etc/fstab 6460786Spsrm /tmp/hfs-boot-block 65161478Sdelphijrm -rf $1/ppc 66161478Sdelphij 67161478Sdelphij