#!/bin/sh - # # Oliver Fromme # # BSD-style copyright and standard disclaimer applies. # # This script performs a few standard jobs that I need to # be done after a ``make release''. It prepares the # first two CD-ROMs. Among other things, it copies the # XF86336 stuff and the "tools" directory. Requires # cpdup to be installed (/usr/ports/sysutils/cpdup). # # Note: Additionally, this script creates a "combi" CD # and a "mini" CD. The combi one can be used for # installation and fixit purposes at the same # time. The mini one contains just the bin dist # and nothing else, this can be useful for low- # bandwidth people. Neither of them contains any # packages. # # The following things have to be done afterwards. # Currently I do this (more or less) manually. # # Miscellaneous tasks: # # - CD1: add docs (update if necessary) # - all: add README # - CD2: create/copy floppies (so CD2 is bootable, too) # - CD2: add gzipped CVS-Repository # - CD2: optional (if space left): add Alpha/AXP-Dist # - CD2: optional (if space left): add email list archives # # Package-related tasks: # # - CD1: select the most important packages and their # dependencies (see the pkg_dep script and # src/release/scripts/print-cdrom-packages.sh) # - all: distribute remaining packages among the other CDs # - all: use the make_package_stuff script to create the # package infrastructure (INDEX, Latest, category # symlinks) # ME="`basename $0`" umask 022 MKISOFS=/usr/local/bin/mkisofs # These will go into the ISO9660 cdrom master block. # Preparer of the CD-ROM (128 chars max!): PREP="Oliver Fromme , Thiemo Nordenholz " # Publisher of the CD-ROM (128 chars max!): PUBL="Lehmanns Fachbuchhandlung , http://www.lob.de/" ERROR() { echo "${ME}: ERROR -- $*!" >&2 exit 1 } test `id -u` = 0 \ || ERROR "You must run me as root" test -n "$CHROOTDIR" -a -d "$CHROOTDIR" \ || ERROR '$CHROOTDIR is not set or not a directory' test -n "$XF86336DIR" -a -d "$XF86336DIR" \ || ERROR '$XF86336DIR is not set or not a directory' test -n "$TOOLSDIR" -a -d "$TOOLSDIR" \ || ERROR '$TOOLSDIR is not set or not a directory' cd $CHROOTDIR/R/cdrom \ || ERROR "Can't cd to $CHROOTDIR/R/cdrom (wrong \$CHROOTDIR?)" test -d disc1 -a -d disc2 \ || ERROR "Missing disc1 or disc2 (wrong \$CHROOTDIR?)" test -d mini -o -d combi \ && ERROR "Directory mini or combi exists -- remove them first" test -x $MKISOFS \ || ERROR "$MKISOFS not found or not executable" mkdir disc3 disc4 disc5 echo "" echo "Expanding \"disc1\" cdrom." echo "Copying XF86336 from $XF86336DIR ..." cpdup $XF86336DIR disc1/XF86336 echo "Copying tools from $TOOLSDIR ..." cpdup $TOOLSDIR disc1/tools echo "Done." echo "" echo "Expanding \"disc2\" cdrom." if [ ! -d disc2/usr/src/sys ]; then echo "Removing useless sys symlink ..." rm -f disc2/sys fi echo "Done." echo "" echo "Creating \"mini\" cdrom." mkdir -p mini/bin echo "Hardlinking bin dist ..." ln disc1/bin/* mini/bin echo "Hardlinking floppies ..." mkdir mini/floppies ln disc1/floppies/* mini/floppies echo "Hardlinking tools ..." mkdir mini/tools (cd disc1/tools; find . -depth -print | cpio -dumpl ../../mini/tools) echo "Hardlinking cdrom.inf, kernel and text files ..." ln disc1/cdrom.inf disc1/kernel disc1/*.TXT mini echo "Creating filename.txt ..." (cd mini; make_filename.txt) echo "Done." echo "" echo "Creating \"combi\" cdrom." mkdir -p combi/FreeBSD echo "Hardlinking dist files ..." (cd disc1; find . -depth -print | cpio -dumpl ../combi/FreeBSD) ln combi/FreeBSD/kernel combi echo "Hardlinking live files ... (this will take a while)" (cd disc2; find . -depth -print | cpio -dumpl ../combi) echo "Creating filename.txt ..." (cd combi; make_filename.txt) echo "Done." echo "" echo "Creating ISO9660 cdrom images." VERSION=`sed -n 's/^CD_VERSION[ ]*=[ ]*\(.*\)[ ]*$/\1/p' disc1/cdrom.inf` test -n "$VERSION" \ || ERROR "Cannot determine CD_VERSION from disc1/cdrom.inf" MINIBOOT="-b floppies/boot.flp -c floppies/boot.catalog" COMBIBOOT="-b FreeBSD/floppies/boot.flp -c FreeBSD/floppies/boot.catalog" MINILOG="-log-file /tmp/mkisofs.mini.log" COMBILOG="-log-file /tmp/mkisofs.combi.log" GENOPTS="-d -N -D -hide-joliet-trans-tbl -J -R -T" APPL="The FreeBSD operating system, version $VERSION, Lehmanns Edition" # Notes: # The volume name shouldn't exceed 32 chars, and no spaces! # The application, preparer and publisher strings can be # up to 128 chars and may contain spaces. VOLUME="FreeBSD-$VERSION" MINIOPTS="$MINIBOOT $GENOPTS -V $VOLUME $MINILOG -o ${VERSION}-mini.iso" COMBIOPTS="$COMBIBOOT $GENOPTS -V $VOLUME $COMBILOG -o ${VERSION}-combi.iso" echo "Mini cdrom, mkisofs output goes to /tmp/mkisofs.mini.log ..." $MKISOFS $MINIOPTS -A "$APPL" -p "$PREP" -P "$PUBL" ./mini echo "Combi cdrom, mkisofs output goes to /tmp/mkisofs.combi.log ..." $MKISOFS $COMBIOPTS -A "$APPL" -p "$PREP" -P "$PUBL" ./combi echo "Done." echo "" echo "All done." echo "" #--