1999-04-01 06:58:02 +00:00
#!/bin/bash
1999-05-27 23:42:36 +00:00
# debian_cd v pre1.14 (c) Steve McIntyre <stevem@chiark.greenend.org.uk>
1999-04-01 06:58:02 +00:00
# Released under GPL 31 Mar 1999
# See the file COPYING for license details
# Greatly influenced by the older Makefile system in the Hamm debian-cd package
#
1999-05-27 23:42:36 +00:00
# Changes for using $CODENAME (C) 1999 Jens Ritter <grimaldi@debian.org>
1999-06-14 00:34:24 +00:00
# 06-13-99 updated locations for override.potato.gz in non-US <jwest@debian.org>
1999-07-06 15:55:05 +00:00
# 07-06-99 moved master & useful to release directories <jwest>
1999-05-27 23:42:36 +00:00
#
1999-04-01 06:58:02 +00:00
##############################################################################
#
# Read the README! IMPORTANT STUFF HERE!
#
##############################################################################
# Version number, to be used later
1999-05-27 23:42:36 +00:00
DEBIANCD_VERSION=pre1.14
DEBIANCD_SITE="http://cvs.debian.org/cgi-bin/cvs-web/debian-boot/debian-cd/"
# For which branch of the ftp archive do you want to generate images?
# Note: This two do have to correspond with your mirror!!
# In addition CODENAME determines which master config file
# subdirectory is used, when generating the file lists of the CDs.
CODENAME=${CODENAME:-potato}
CODENAME_STATUS=${CODENAME_STATUS:-unstable}
1999-04-01 06:58:02 +00:00
###########################################################################
# Default options - we check for these in the environment first, so it
# is possible to drive this script entirely without changing these if
# you so desire. Where this really comes into its own is in automating
# the process for multiple architectures - try a script that sets the
# environment appropriately, then calls this for each architecture,
# something like:
#
1999-05-27 23:42:36 +00:00
# ARCH=i386 TDIR=~/i386-tmp OUT=~/i386-out ./debian_cd <options>
# ARCH=m68k TDIR=~/m68k-tmp OUT=~/m68k-out ./debian_cd <options>
# ARCH=alpha TDIR=~/alpha-tmp OUT=~/alpha-out ./debian_cd <options>
# ARCH=sparc TDIR=~/sparc-tmp OUT=~/sparc-out ./debian_cd <options>
1999-05-28 11:32:28 +00:00
# ARCH=powerpc TDIR=~/powerpc-tmp OUT=~/powerpc-out ./debian_cd <options>
1999-04-01 06:58:02 +00:00
#
# It's not pretty but it should work... (TM) :-) - look at the included
# "arch" script for an example.
###########################################################################
# Grab current directory for later use. Can be over-ridden by $BASEDIR
# in the environment
BASEDIR=${BASEDIR:-$PWD}
# Architecture to build images for (i386, alpha, m68k, sparc, powerpc so far).
# Default, will be overridden by other options - use m68k, alpha or i386 on
# commandline to change
ARCH=${ARCH:-i386}
# Top level location of Debian mirror
MIRROR=${MIRROR:-/home/ftp/debian}
# Location of non-US mirror
NONUS=${NONUS:-$MIRROR/non-US}
# Path to use with mkisofs/mkhybrid
MKISOFS=${MKISOFS:-"mkhybrid"}
# Options to use with mkisofs/mkhybrid - one of these should do you
# If you're using i386 then -J will be added later to add Joliet stuff
# * Why can't Windows read RockRidge like any sensible OS? *
1999-06-08 19:26:16 +00:00
MKISOFS_OPTS=${MKISOFS_OPTS:-"-a -r -T"} # For normal users
1999-04-01 06:58:02 +00:00
1999-06-08 19:26:16 +00:00
#MKISOFS_OPTS=${MKISOFS_OPTS:-"-a -r -F -T"} # For sym-link farmers.
1999-04-01 06:58:02 +00:00
# Also make sure you have a patched mkhybrid - read the README
# TDIR must be on the same partition as the mirror for hard links trick
# to work
1999-05-27 23:42:36 +00:00
TDIR=${TDIR:-/mnt/mirror/jens/potatocd}
1999-04-01 06:58:02 +00:00
# Target directory for output ISO images
1999-05-27 23:42:36 +00:00
OUT=${OUT:-/mnt/mirror/jens/images}
1999-04-01 06:58:02 +00:00
# Sparc (maybe other?) boot directory from where to grab the SILO boot loader
BOOTDIR=${BOOTDIR:-/boot}
. $BASEDIR/vecho # Local definitions for vecho, vvecho, vvvecho
1999-05-27 23:42:36 +00:00
# I patch dpkg-scanpackages to ignore zero length files,
# because I don't mirror slink any more (only potato). I have a script
# which touches every file a symlink from potato points to (in slink).
# By changing only one line in dpkg-scanpackages I am able to generate
# potato only cds.
1999-06-08 19:26:16 +00:00
# Take care to use the dpkg-scanpackages from multi_cd ...
if [ -x $BASEDIR/dpkg-scanpackages ]; then
SCANPACKAGES=${SCANPACKAGES:-$BASEDIR/dpkg-scanpackages}
else
SCANPACKAGES=${SCANPACKAGES:-/usr/bin/dpkg-scanpackages}
fi
1999-05-27 23:42:36 +00:00
1999-04-01 06:58:02 +00:00
# Default debug level
VERBOSE=0
DATE=`date +%Y%m%d`
# Parse options
if [ $# -gt 0 ] ; then
while [ $# -gt 0 ]
do
case "$1"x in
"-v"x)
VERBOSE=$[ $VERBOSE + 1 ]
shift 1
;;
"clean"x)
CLEAN=1
shift 1
;;
"genlist"x)
GENLIST=1
shift 1
;;
"tree"x)
TREE=1
shift 1
;;
"genlinks"x)
GENLINKS=1
shift 1
;;
"flatten"x)
FLATTEN=1
shift 1
;;
"md5check"x)
MD5CHECK=1
shift 1
;;
"packages"x)
PACKAGES=1
shift 1
;;
"boot"x)
BOOT=1
shift 1
;;
"extras"x)
EXTRAS=1
shift 1
;;
"md5list"x)
MD5LIST=1
shift 1
;;
"images"x)
IMAGES=1
IMAGE1=1
IMAGE2=1
IMAGE3=1
IMAGE4=1
IMAGESMADE=1
shift 1
;;
"image1"x)
IMAGE1=1
IMAGESMADE=1
shift 1
;;
"image2"x)
IMAGE2=1
IMAGESMADE=1
shift 1
;;
"image3"x)
IMAGE3=1
IMAGESMADE=1
shift 1
;;
"image4"x)
IMAGE4=1
IMAGESMADE=1
shift 1
;;
"image5"x)
IMAGE5=1
IMAGESMADE=1
shift 1
;;
"imagesums"x)
IMAGESUMS=1
shift 1
;;
"alpha"x)
ARCH=alpha
shift 1
;;
"sparc"x)
ARCH=sparc
shift 1
;;
"powerpc"x)
ARCH=powerpc
shift 1
;;
"m68k"x)
ARCH=m68k
shift 1
;;
"i386"x)
ARCH=i386
shift 1
;;
"single_disk"x)
SINGLE_DISK=1
shift 1
;;
"force_deps"x)
FORCE_DEPENDS=1
shift 1
;;
"non-US"x|"non-us"x)
# Only set this if we have a location for it...
if [ "$NONUS"x != ""x ] ; then
NU=1
fi
shift 1
;;
"non-free"x)
NF=1
shift 1
;;
*)
echo \"$1\": invalid option.
exit 1
;;
esac
done
else
CLEAN=1
GENLIST=1
TREE=1
GENLINKS=0
FLATTEN=1
MD5CHECK=1
PACKAGES=1
BOOT=1
EXTRAS=1
MD5LIST=1
IMAGE1=0
IMAGE2=0
IMAGE3=0
IMAGE4=0
IMAGE5=0
IMAGESUMS=0
NU=0
NF=0
SINGLE_DISK=0
fi
if [ "$IMAGES"x = "1"x -a "$NF"x = "1"x ] ; then
IMAGE5=1
fi
error=0
vecho VERBOSE=$VERBOSE
vecho CLEAN=$CLEAN
vecho GENLIST=$GENLIST
vecho TREE=$TREE
vecho GENLINKS=$GENLINKS
vecho FLATTEN=$FLATTEN
vecho MD5CHECK=$MD5CHECK
vecho PACKAGES=$PACKAGES
vecho BOOT=$BOOT
vecho EXTRAS=$EXTRAS
vecho MD5LIST=$MD5LIST
vecho IMAGES=$IMAGES
vecho IMAGE1=$IMAGE1
vecho IMAGE2=$IMAGE2
vecho IMAGE3=$IMAGE3
vecho IMAGE4=$IMAGE4
vecho IMAGE5=$IMAGE5
vecho IMAGESUMS=$IMAGESUMS
vecho ARCH=$ARCH
vecho MIRROR=$MIRROR
vecho NONUS=$NONUS
vecho MKISOFS=$MKISOFS
vecho TDIR=$TDIR
vecho OUT=$OUT
vecho BASEDIR=$BASEDIR
vecho NU=$NU
vecho NF=$NF
vecho SINGLE_DISK=$SINGLE_DISK
# Sort out non-US link - this should be done better...
1999-07-06 15:55:05 +00:00
1999-04-01 06:58:02 +00:00
if [ "$NU"x = "1"x ] ; then
1999-05-27 23:42:36 +00:00
vecho Checking for non-US link in $MIRROR/dists/$CODENAME
if [ ! -L $MIRROR/dists/$CODENAME/non-US -a ! -d $MIRROR/dists/$CODENAME/non-US ] ; then
1999-04-01 06:58:02 +00:00
vecho "Does not exist; trying to make one"
1999-07-06 15:55:05 +00:00
# (cd $MIRROR/dists/$CODENAME && ln -s $NONUS/dists/$CODENAME/non-US >/dev/null 2>&1 ) # Redirect errors - people may have a read-only mirror...
(cd $MIRROR/dists/$CODENAME && ln -s $NONUS/dists/$CODENAME/non-US/main non-US >/dev/null 2>&1 ) # Redirect errors - people may have a read-only mirror...
1999-04-01 06:58:02 +00:00
fi
fi
# Cope with relative paths; some people insist on using them.
vecho Checking TDIR is set OK
# Does it exist?
if [ ! -e $TDIR ] ; then
vecho "$TDIR does not exist - making it"
mkdir $TDIR
if [ $? -gt 0 ] ; then
echo "Temporary directory $TDIR does not exist and we cannot create it."
echo "Exit."
exit 1
fi
fi
pushd $TDIR >/dev/null
if [ $? -gt 0 ] ; then
echo "Error in directory $TDIR"
echo "Exit."
exit 1
fi
TDIR=$PWD
popd >/dev/null
vecho TDIR is now $TDIR
vecho Checking MIRROR is set OK
# Does it exist?
if [ ! -e $MIRROR ] ; then
echo "Mirror directory $MIRROR does not exist"
echo "Exit."
exit 1
fi
if [ "$NU"x = "1"x ] ; then
vecho Checking NONUS is set OK
# Does it exist?
if [ ! -e $NONUS ] ; then
echo "non-US Mirror directory $NONUS does not exist"
echo "Exit."
exit 1
fi
fi
vecho Checking OUT is set OK
# Does it exist?
if [ ! -e $OUT ] ; then
vecho "$OUT does not exist - making it"
mkdir $OUT
if [ $? -gt 0 ] ; then
echo "Image directory $OUT does not exist and we cannot create it."
echo "Exit."
exit 1
fi
fi
pushd $OUT >/dev/null
if [ $? -gt 0 ] ; then
echo "Error in directory $OUT"
echo "Exit."
exit 1
fi
OUT=$PWD
popd >/dev/null
vecho OUT is now $OUT
# Check the user has done as told - make sure we're on the same
# partition as the mirror unless we have been told to "genlinks"
if [ "$GENLINKS"x != "1"x -a "$TREE"x = "1"x ] ; then
vecho Checking that TDIR is on the same partition as the mirror.
MIRRORPART=`df $MIRROR | grep -v ilesystem | awk '{print $1}'`
vvecho MIRROR is on $MIRRORPART
TMPPART=`df $TDIR | grep -v ilesystem | awk '{print $1}'`
vvecho TDIR is on $TMPPART
if [ "$MIRRORPART"x = "$TMPPART"x ] ; then
vecho "Good - they match."
else
echo "Read the instructions, the temporary dir specified must be on the"
echo "same partition as the mirror unless you specify \"genlinks\" to make a sym-link"
echo "farm"
echo "$TMPPART != $MIRRORPART"
exit 1
fi
fi
# Check to see if we're being asked to create md5sums for non-existent images
if [ "$IMAGESMADE"x != "1"x -a "$IMAGESUMS"x = "1"x ] ; then
echo "To create md5sums of CD images you first need to create the images!"
echo "Try again, either adding an image creation option (image[12345x])"
echo "or removing the \"imagesums\" option"
echo "Exit."
exit 1
fi
# If we're doing genlinks then check we have the required -F option
# for mkhybrid
if [ "$GENLINKS"x = "1"x ] ; then
if ! (echo "$MKISOFS_OPTS" | grep -q \\-F ) ; then
echo "If you are using the \"genlinks\" option then you also need to use a patched"
echo "mkhybrid/mkisofs and add the \"-F\" flag to the command line for it. See the"
echo "README file for more details."
echo "Exit."
exit 1
fi
fi
# Set up for later; non-free and non-US will be added as necessary
SECTLIST="main" # List of sections
DISKLIST="1 2 3 4" # List of all disks
BINLIST="1 2" # List of disks containing binaries
if [ "$SINGLE_DISK"x = "1"x ] ; then
# Sanity check...
if [ "$NU"x = "1"x -o "$NF"x = "1"x ] ; then
echo 'single_disk option is not compatible with either non-free or non-US.'
echo Exit.
exit 1
fi
if [ "$IMAGE2"x = "1"x -o "$IMAGE3"x = "1"x -o "$IMAGE3" = "1"x -o "$IMAGE4"x = "1"x ] ; then
echo 'single_disk option is not compatible with creation of CD images other than #1.'
echo Exit.
exit 1
fi
DISKLIST="1"
BINLIST="1"
else
SECTLIST="$SECTLIST contrib"
fi
if [ "$NU"x = "1"x ] ; then
SECTLIST="$SECTLIST non-US"
fi
if [ "$NF"x = "1"x ] ; then
SECTLIST="$SECTLIST non-free"
DISKLIST="$DISKLIST 5"
BINLIST="$BINLIST 5"
fi
vecho "About to run to create disk(s) $DISKLIST and section(s) $SECTLIST"
# Sanity check for combinations of options - creating sym-links then
# flattening them isn't just silly, it's stupid...
if [ "$GENLINKS"x = "1"x -a "$FLATTEN"x = "1"x ] ; then
echo "The \"genlinks\" and \"flatten\" options are incompatible."
echo "Exit."
exit 1
fi
if [ $error -eq 0 ] ; then
if [ "$CLEAN"x = "1"x ] ; then
echo CLEAN:
vecho Removing old directories
if [ "$VERBOSE" -gt 1 ] ; then
rm -rvf $TDIR
else
rm -rf $TDIR
fi
mkdir $TDIR
fi
fi
vecho "Making working copies of config files, converting ARCH to $ARCH"
1999-05-27 23:42:36 +00:00
if [ -e $TDIR/cd1.list ] ; then
1999-04-01 06:58:02 +00:00
vecho "You already appear to have them. I therefore assume the ones in"
vecho "$TDIR are correct and I will leave them alone. If you"
1999-05-27 23:42:36 +00:00
vecho "want to generate new ones, delete the file \"cd1.list\" in"
1999-04-01 06:58:02 +00:00
vecho "$TDIR and try again."
else
for i in $DISKLIST
do
for TYPE in list info volid extras optional
do
1999-05-27 23:42:36 +00:00
if [ -e $CODENAME/cd$i.$TYPE ] ; then
vecho " cd$i.$TYPE"
cat $CODENAME/cd$i.$TYPE | sed "s/ARCH/$ARCH/g" >$TDIR/cd$i.$TYPE
1999-04-01 06:58:02 +00:00
fi
done
done
vecho " mkisofsrc"
cat mkisofsrc | sed "s/ARCH/$ARCH/g" >$TDIR/.mkisofs
ln -s .mkisofs $TDIR/.mkisofsrc
1999-05-27 23:42:36 +00:00
vecho " cd1.needed"
1999-07-06 15:55:05 +00:00
slice $CODENAME/master
1999-04-01 06:58:02 +00:00
if [ $? -gt 0 ] ; then
1999-07-06 15:55:05 +00:00
echo "\"slice $CODENAME\master\" failed - do you have the slice package installed?"
1999-04-01 06:58:02 +00:00
echo Exit.
exit 1
fi
1999-05-27 23:42:36 +00:00
echo "# Do not edit this file - it is automatically generated." >$TDIR/cd1.needed
1999-07-06 15:55:05 +00:00
echo "# Edit \"$CODENAME/master\" instead." >>$TDIR/cd1.needed
1999-04-01 06:58:02 +00:00
cat master.$ARCH | awk -F':' '
/Packages:/ {packages++; next}
/.+.+/ {if(packages) {print $1}}
1999-05-27 23:42:36 +00:00
' |sort |uniq >>$TDIR/cd1.needed
1999-04-01 06:58:02 +00:00
rm master.*
1999-05-27 23:42:36 +00:00
vecho " cd1.useful"
1999-07-06 15:55:05 +00:00
slice $CODENAME/useful
1999-04-01 06:58:02 +00:00
if [ $? -gt 0 ] ; then
1999-07-06 15:55:05 +00:00
echo "\"slice $CODENAME/useful\" failed - do you have the slice package installed?"
1999-04-01 06:58:02 +00:00
echo Exit.
exit 1
fi
1999-05-27 23:42:36 +00:00
echo "# Do not edit this file - it is automatically generated." >$TDIR/cd1.useful
1999-07-06 15:55:05 +00:00
echo "# Edit \"$CODENAME/useful\" instead." >>$TDIR/cd1.useful
1999-04-01 06:58:02 +00:00
cat useful.$ARCH | awk -F':' '
/.+.+/ {print $1}
1999-05-27 23:42:36 +00:00
' |sort |uniq >>$TDIR/cd1.useful
1999-04-01 06:58:02 +00:00
rm useful.*
# Check for non-US entries in these files - if we mention it then fix it...
if [ "$NU"x != "1"x ] ; then
vecho "non-US option not given, so removing non-US references from file lists"
1999-05-27 23:42:36 +00:00
for file in $TDIR/cd*.list
1999-04-01 06:58:02 +00:00
do
mv $file $file.1
vecho " $file"
grep -v non-US $file.1 >$file
done
fi
fi
if [ $error -eq 0 ] ; then
if [ "$GENLIST"x = "1"x ] ; then
echo GENLIST:
1999-05-27 23:42:36 +00:00
$BASEDIR/mklist "$MIRROR" "$BASEDIR" "$TDIR" "$ARCH" "$CODENAME" \
"$CODENAME_STATUS" "$SCANPACKAGES" "$VERBOSE"
1999-04-01 06:58:02 +00:00
cd $TDIR
# Now combine the lists
1999-05-27 23:42:36 +00:00
if [ ! -e cd1.list ] ; then
echo mklist step failed - $TDIR/cd1.list not found
1999-04-01 06:58:02 +00:00
echo Exit.
exit 1
fi
if [ ! -e list/OUT1 ] ; then
echo mklist step failed - $TDIR/list/OUT1 not found
echo Exit.
exit 1
fi
1999-05-27 23:42:36 +00:00
mv cd1.list cd1.list.orig
cat cd1.list.orig | grep -v main/binary- >cd1.list
cat list/OUT1 | sed 's/dists\/frozen/dists\/$CODENAME/g;s/dists\/$CODENAME_STATUS/dists\/$CODENAME/g' >>cd1.list
rm cd1.list.orig
1999-04-01 06:58:02 +00:00
if [ "$SINGLE_DISK"x != "1"x ] ; then
# Now combine the lists
1999-05-27 23:42:36 +00:00
if [ ! -e cd2.list ] ; then
echo mklist step failed - $TDIR/cd2.list not found
1999-04-01 06:58:02 +00:00
echo Exit.
exit 1
fi
if [ ! -e list/OUT2 ] ; then
echo mklist step failed - $TDIR/list/OUT2 not found
echo Exit.
exit 1
fi
1999-05-27 23:42:36 +00:00
mv cd2.list cd2.list.orig
cat cd2.list.orig | grep -v main/binary- >cd2.list
cat list/OUT2 | sed "s/dists\/frozen/dists\/$CODENAME/g;s/dists\/$CODENAME_STATUS/dists\/$CODENAME/g" >>cd2.list
rm cd2.list.orig
1999-04-01 06:58:02 +00:00
fi
fi
fi
# Make sym-link farm for those people that need it...
if [ $error -eq 0 ] ; then
if [ "$GENLINKS"x = "1"x ] ; then
echo GENLINKS:
vecho Making sym-link farm of parts of $MIRROR under $TDIR/tmp-mirror
cd $TDIR
mkdir tmp-mirror
cd tmp-mirror
cp -pRs $MIRROR/dists $MIRROR/doc $MIRROR/README* $MIRROR/hamm $MIRROR/indices $MIRROR/ls* $MIRROR/project $MIRROR/tools .
# Copy non-US separately if necessary...
1999-05-27 23:42:36 +00:00
if [ -L $MIRROR/dists/$CODENAME/non-US ] ; then
1999-04-01 06:58:02 +00:00
vecho Adding non-US
1999-05-27 23:42:36 +00:00
rm dists/$CODENAME/non-US
mkdir dists/$CODENAME/non-US
cp -dpRs $NONUS/$CODENAME/* dists/$CODENAME/non-US
1999-04-01 06:58:02 +00:00
fi
1999-05-27 23:42:36 +00:00
cd dists/$CODENAME
1999-04-01 06:58:02 +00:00
vecho Putting binary-all links in
find . | $BASEDIR/mklinks $VERBOSE
MIRROR=$TDIR/tmp-mirror
fi
fi
# Make initial tree(s)
if [ $error -eq 0 ] ; then
if [ "$TREE"x = "1"x ] ; then
echo TREE:
cd $TDIR
# First of all the general stuff to go on all disks.
for i in $DISKLIST
do
vecho Disk $i
vecho " Make directories"
1999-05-27 23:42:36 +00:00
mkdir -p $TDIR/$CODENAME$i/dists/$CODENAME
mkdir -p $TDIR/$CODENAME$i/.disk
1999-04-01 06:58:02 +00:00
# Oops. We're copying the dists stuff into the root
# directory, the boot-floppies install stuff wants it in
# /debian. Simple fix...
1999-05-27 23:42:36 +00:00
cd $TDIR/$CODENAME$i
1999-04-01 06:58:02 +00:00
ln -s . debian
# Set up symlinks so things may work.
cd dists
1999-05-27 23:42:36 +00:00
ln -s $CODENAME $CODENAME_STATUS
1999-04-01 06:58:02 +00:00
# Frozen no longer needed
1999-05-27 23:42:36 +00:00
# ln -s $CODENAME frozen
1999-04-01 06:58:02 +00:00
cd $TDIR
vecho " Copy info file"
1999-05-27 23:42:36 +00:00
(cat cd$i.info | awk '{printf("%s",$0)}'; echo $DATE) \
>$CODENAME$i/.disk/info
1999-04-01 06:58:02 +00:00
vecho " Copy release notes"
1999-05-27 23:42:36 +00:00
cp $MIRROR/dists/$CODENAME/main/Release-Notes $CODENAME$i
1999-04-01 06:58:02 +00:00
vecho " Copy README.1ST"
1999-05-27 23:42:36 +00:00
echo "This Debian CD was created by debian_cd version $DEBIANCD_VERSION on $DATE" >$CODENAME$i/README.1ST
echo "debian_cd is available from $DEBIANCD_SITE">>$CODENAME$i/README.1ST
echo "This disc is labelled" >>$CODENAME$i/README.1ST
echo "" >>$CODENAME$i/README.1ST
cat $CODENAME$i/.disk/info >>$CODENAME$i/README.1ST
1999-04-01 06:58:02 +00:00
if [ -e $BASEDIR/README.multicd ] ; then
vecho " Copy README.multicd"
1999-05-27 23:42:36 +00:00
cat $BASEDIR/README.multicd >>$CODENAME$i/README.multicd
1999-04-01 06:58:02 +00:00
fi
1999-05-27 23:42:36 +00:00
todos $CODENAME$i/README.1ST
1999-04-01 06:58:02 +00:00
cd $MIRROR
vecho " Create tree"
1999-05-27 23:42:36 +00:00
for file in `cat $TDIR/cd$i.list`
1999-04-01 06:58:02 +00:00
do
1999-05-27 23:42:36 +00:00
vecho "cp -dpRPl $file $TDIR/$CODENAME$i"
cp -dpRPl $file $TDIR/$CODENAME$i
1999-04-01 06:58:02 +00:00
done
done
cd $TDIR
# And now the arch-specific stuff, NOT to go on the source disks.
for i in $BINLIST
do
vecho Disk $i
vecho " Make binary directories"
for SECT in $SECTLIST
do
1999-05-27 23:42:36 +00:00
mkdir -p $CODENAME$i/dists/$CODENAME/$SECT/binary-$ARCH
mkdir -p $CODENAME$i/dists/$CODENAME/$SECT/binary-all
1999-04-01 06:58:02 +00:00
done
vecho " Finish README.1ST"
1999-05-27 23:42:36 +00:00
echo "" >>$CODENAME$i/README.1ST
1999-04-01 06:58:02 +00:00
if [ -e $BASEDIR/README.1ST.$ARCH ] ; then
1999-05-27 23:42:36 +00:00
cat $BASEDIR/README.1ST.$ARCH >>$CODENAME$i/README.1ST
1999-04-01 06:58:02 +00:00
fi
if [ -e $BASEDIR/README.$ARCH ] ; then
vecho " Copy README.$ARCH"
1999-05-27 23:42:36 +00:00
cat $BASEDIR/README.$ARCH >>$CODENAME$i/README.$ARCH
1999-04-01 06:58:02 +00:00
fi
done
# Add the Release files, munging if necessary
for i in $BINLIST
do
vecho Disk $i
vecho " add Release files"
for SECT in $SECTLIST
do
1999-05-27 23:42:36 +00:00
if [ -e $CODENAME$i/dists/$CODENAME/$SECT/binary-$ARCH/Release ] ; then
rm -f $CODENAME$i/dists/$CODENAME/$SECT/binary-$ARCH/Release
1999-04-01 06:58:02 +00:00
fi
1999-05-27 23:42:36 +00:00
if [ -d $CODENAME$i/dists/$CODENAME/$SECT/binary-$ARCH ] ; then
if [ -e $CODENAME$i/dists/$CODENAME/$SECT/binary-$ARCH/Release ] ; then
cat $MIRROR/dists/$CODENAME/$SECT/binary-$ARCH/Release \
1999-04-01 06:58:02 +00:00
| sed 's/frozen/stable/g' \
1999-05-27 23:42:36 +00:00
> $CODENAME$i/dists/$CODENAME/$SECT/binary-$ARCH/Release
1999-04-01 06:58:02 +00:00
fi
fi
done
done
# Add sym-links for the upgrade stuff if we have it.
if [ "$ARCH"x = "i386"x ] ; then
vecho "Disk 1"
vecho " upgrade-2.0-i386"
1999-06-08 19:26:16 +00:00
(cd $TDIR/${CODENAME}1 && ln -s dists/$CODENAME_STATUS/main/upgrade-2.0-i386)
1999-04-01 06:58:02 +00:00
vecho " upgrade-older-i386"
1999-06-08 19:26:16 +00:00
(cd $TDIR/${CODENAME}1 && ln -s dists/$CODENAME_STATUS/main/upgrade-older-i386)
1999-04-01 06:58:02 +00:00
fi
fi
fi
# Fix the crypt++el_2.84-2.deb brokenness in non-US - temporary workaround...
if [ "$NU"x = "1"x ] ; then
vecho "Looking for broken crypt++el_2.84-2.deb link in non-US..."
1999-06-08 19:26:16 +00:00
cd $TDIR/${CODENAME}2/dists/$CODENAME/non-US/binary-$ARCH
1999-04-01 06:58:02 +00:00
if [ -L crypt++el_2.84-2.deb ] ; then
link=`ls -l crypt++el_2.84-2.deb | awk '{print $11}'`
if [ "$link"x != "../binary-all/crypt++el_2.84-2.deb"x ] ; then
vecho "Fixing it"
vecho rm crypt++el_2.84-2.deb
rm crypt++el_2.84-2.deb
vecho ln -s ../binary-all/crypt++el_2.84-2.deb
ln -s ../binary-all/crypt++el_2.84-2.deb
vecho cd ../binary-all
cd ../binary-all
vecho ln -s $NONUS/hamm/binary-all/crypt++el_2.84-2.deb
ln -s $NONUS/hamm/binary-all/crypt++el_2.84-2.deb
else
vecho "You do not have it - good"
fi
fi
fi
# Generate the list of files we have
cd $TDIR
rm -f binary targz diffgz dsc
vecho Generating file list:
vecho ' *.deb'
for i in $BINLIST
do
1999-05-27 23:42:36 +00:00
vecho " $CODENAME$i"
find $CODENAME$i -name *.deb >>binary
1999-04-01 06:58:02 +00:00
done
vecho ' *.tar.gz'
for i in $DISKLIST
do
1999-05-27 23:42:36 +00:00
vecho " $CODENAME$i"
find $CODENAME$i -name *.tar.gz >>targz
1999-04-01 06:58:02 +00:00
done
vecho ' *.diff.gz'
for i in $DISKLIST
do
1999-05-27 23:42:36 +00:00
vecho " $CODENAME$i"
find $CODENAME$i -name *.diff.gz >>diffgz
1999-04-01 06:58:02 +00:00
done
vecho ' *.dsc'
for i in $DISKLIST
do
1999-05-27 23:42:36 +00:00
vecho " $CODENAME$i"
find $CODENAME$i -name *.dsc >>dsc
1999-04-01 06:58:02 +00:00
done
# Now we need to flatten out links pointing outside the tree
if [ $error -eq 0 ] ; then
if [ "$FLATTEN"x = "1"x ] ; then
echo FLATTEN:
vecho Flattening external symlinks
# This is done in perl.
cat binary targz diffgz dsc | $BASEDIR/flatten "$MIRROR" "$NONUS" "$VERBOSE"
fi
fi
# Now do a check for the MD5 sums of all the packages before creating
# the CD images. To avoid the pain of coping with different paths,
# cheat and make sym-links to the real files and compare against
# munged pathnames from the Packages files
if [ $error -eq 0 ] ; then
if [ "$MD5CHECK"x = "1"x ] ; then
echo MD5CHECK:
# First grab all the details from the appropriate Packages files
vecho Creating MD5 list of packages for comparison
1999-05-27 23:42:36 +00:00
cd $MIRROR/dists/$CODENAME
1999-04-01 06:58:02 +00:00
# build the list of packages files to read (either compressed or not)
for SECT in $SECTLIST
do
dir=$SECT/binary-$ARCH
if [ -e $dir/Packages ] ; then
PFILES="$PFILES $dir/Packages"
elif [ -e $dir/Packages.gz ]; then
PFILES="$PFILES $dir/Packages.gz"
else
echo "WARNING: no Packages file(s) found for $dir."
fi
done
# -f on zcat allows uncompressed files to be processed as well
# We find the local list of packages as otherwise the
# single_disk hack will fail, because of missing files that
# would have gone on other discs. Unfortunately this means we
# won't be able to detect missing files... Suggestions?
echo " binary"
(cat $TDIR/binary | sed 's/.*\///g;s/_.*//g' ; cat $BASEDIR/EOP; zcat -f $PFILES) \
| grep -v '^#' |awk '
/END_OF_PROCESSING/ { yes_done++ ; next }
/.*/ { if(!yes_done) { yes[$1]=1 ; next } }
/^Package:/ {package=$2}
/^Filename:/ {filename[package]=$2}
/^MD5sum:/ {md5sum[package]=$2;
gsub(".*/","",filename[package]);
if(yes[package])
{
printf("%32.32s %s\n",md5sum[package],filename[package])
}
}
' >$TDIR/debcheck_disks.1
cd $TDIR
# Now the sym-links
vecho Creating package sym-links
rm -rf md5
mkdir md5
# Use the list we already generated earlier...
for file in `cat binary`
do
ln -sf ../$file md5
done
# Compare
vecho Comparing sums
cd md5
md5sum -c ../debcheck_disks.1
vecho Checking file sizes
find . -follow -size 0 >../sizecheck_disks.1
if [ -s ../sizecheck_disks.1 ] ; then
echo " Awooga!"
echo " Awooga!"
echo " Awooga!"
echo " The following files are of zero size:"
cat ../sizecheck_disks.1
echo "This is fatal. Exit."
exit 1
fi
cd ..
rm -rf md5
echo " source"
# Now check source - use the .dsc files
vecho Creating MD5 list of source files for comparison
1999-06-08 19:26:16 +00:00
cat dsc | xargs cat | awk '
1999-04-01 06:58:02 +00:00
/^-----BEGIN PGP SIGNATURE/ {in_list=0}
{
if(in_list) {printf("%32.32s %s\n",$1,$3)}
}
/^Files:/ {in_list=1}
' >$TDIR/debcheck_disks.2
# Now the sym-links
vecho Creating source file sym-links
if [ -d md5 ] ; then
rm -rf md5
fi
mkdir md5
# Use the list we already generated earlier...
for file in `cat targz diffgz`
do
ln -sf ../$file md5
done
# Compare
vecho Comparing sums
cd md5
md5sum -c ../debcheck_disks.2
vecho Checking file sizes
find . -follow -size 0 >../sizecheck_disks.2
if [ -s ../sizecheck_disks.2 ] ; then
echo " Awooga!"
echo " Awooga!"
echo " Awooga!"
echo " The following files are of zero size:"
cat ../sizecheck_disks.2
echo "This is fatal. Exit."
exit 1
fi
cd ..
rm -rf md5
# Next we need to look at the boot-disks
vecho Checking boot disks areas:
1999-06-08 19:26:16 +00:00
for dir in `find $TDIR -type d | grep disks-$ARCH$`
1999-04-01 06:58:02 +00:00
do
cd $dir
vecho $dir...
for dir1 in *
do
cd $dir1
vecho $dir/$dir1...
if [ -e md5sum.txt ] ; then
md5sum -c md5sum.txt
else
echo WARNING: no md5sum.txt file found in $dir/$dir1
fi
cd ..
done
done
fi
fi
if [ $error -eq 0 ] ; then
if [ "$PACKAGES"x = "1"x ] ; then
echo PACKAGES:
cd $TDIR
rm -vf Packages-{main,contrib,non-US,non-free}.[12345]
# Create Packages and Packages.cd files to go on the CDs
# First lists by section and CD
for i in $BINLIST
do
echo Creating Packages-main for disc $i
1999-05-27 23:42:36 +00:00
if [ ! -e $MIRROR/indices/override.$CODENAME.gz ] ; then
echo "Override file $MIRROR/indices/override.$CODENAME.gz not found. We cannot"
1999-04-01 06:58:02 +00:00
echo "generate our Packages file(s) without this file. Check you are mirroring the"
echo "indices/ directory"
echo "Exit."
exit 1
fi
1999-05-27 23:42:36 +00:00
(cd $TDIR/$CODENAME$i/dists/$CODENAME_STATUS/main && \
$SCANPACKAGES -m "`cat $TDIR/$CODENAME$i/.disk/info`" \
binary-$ARCH $MIRROR/indices/override.$CODENAME.gz \
dists/$CODENAME_STATUS/main/ > $TDIR/Packages-main.$i)
1999-04-01 06:58:02 +00:00
if [ "$SINGLE_DISK"x != "1"x ] ; then
echo Creating Packages-contrib for disc $i
1999-05-27 23:42:36 +00:00
if [ ! -e $MIRROR/indices/override.$CODENAME.contrib.gz ] ; then
echo "Override file $MIRROR/indices/override.$CODENAME.contrib.gz not found. We cannot"
1999-04-01 06:58:02 +00:00
echo "generate our Packages file(s) without this file. Check you are mirroring the"
echo "indices/ directory"
echo "Exit."
exit 1
fi
1999-05-27 23:42:36 +00:00
(cd $TDIR/$CODENAME$i/dists/$CODENAME_STATUS/contrib && \
$SCANPACKAGES -m "`cat $TDIR/$CODENAME$i/.disk/info`" \
binary-$ARCH $MIRROR/indices/override.$CODENAME.contrib.gz \
dists/$CODENAME_STATUS/contrib/ > $TDIR/Packages-contrib.$i)
1999-04-01 06:58:02 +00:00
fi
if [ "$NU"x = "1"x ] ; then
echo Creating Packages-non-US for disc $i
# Hmmm, we have a problem here. My non-US mirror has the
# override file in $NONUS/indices but open has it in
# $MIRROR/indices (and with a different filename!!!)
# Check for both in turn...
OVER_NU=/foo # default catch-all
1999-05-27 23:42:36 +00:00
if [ -e $NONUS/indices/override.$CODENAME.nonus ] ; then
OVER_NU=$NONUS/indices/override.$CODENAME.nonus
1999-06-14 00:34:24 +00:00
elif [ -e $NONUS/indices-non-US/override.$CODENAME.gz ] ; then
OVER_NU=$NONUS/indices-non-US/override.$CODENAME.gz
1999-05-27 23:42:36 +00:00
elif [ -e $NONUS/indices/override.$CODENAME.nonus.gz ] ; then
OVER_NU=$NONUS/indices/override.$CODENAME.nonus.gz
elif [ -e $MIRROR/indices/override.non-us.$CODENAME ] ; then
OVER_NU=$MIRROR/indices/override.non-us.$CODENAME
elif [ -e $MIRROR/indices/override.non-us.$CODENAME.gz ] ; then
OVER_NU=$MIRROR/indices/override.non-us.$CODENAME.gz
1999-04-01 06:58:02 +00:00
fi
if [ ! -e "$OVER_NU" ] ; then
echo "Override file "$OVER_NU" not found. We cannot"
echo "generate our Packages file(s) without this file. Check you are mirroring the"
echo "indices/ directory"
echo "Exit."
exit 1
fi
1999-05-27 23:42:36 +00:00
(cd $TDIR/$CODENAME$i/dists/$CODENAME_STATUS/non-US && \
$SCANPACKAGES -m "`cat $TDIR/$CODENAME$i/.disk/info`" \
1999-04-01 06:58:02 +00:00
binary-$ARCH $OVER_NU \
1999-05-27 23:42:36 +00:00
dists/$CODENAME_STATUS/non-US/ > $TDIR/Packages-non-US.$i)
1999-04-01 06:58:02 +00:00
fi
if [ "$NF"x = "1"x ] ; then
echo Creating Packages-non-free for disc $i
1999-05-27 23:42:36 +00:00
if [ ! -e $MIRROR/indices/override.$CODENAME.non-free.gz ] ; then
echo "Override file $MIRROR/indices/override.$CODENAME.non-free.gz not found. We cannot"
1999-04-01 06:58:02 +00:00
echo "generate our Packages file(s) without this file. Check you are mirroring the"
echo "indices/ directory"
echo "Exit."
exit 1
fi
1999-05-27 23:42:36 +00:00
(cd $TDIR/$CODENAME$i/dists/$CODENAME_STATUS/non-free && \
$SCANPACKAGES -m "`cat $TDIR/$CODENAME$i/.disk/info`" \
binary-$ARCH $MIRROR/indices/override.$CODENAME.non-free.gz \
dists/$CODENAME_STATUS/non-free/ > $TDIR/Packages-non-free.$i)
1999-04-01 06:58:02 +00:00
fi
done
echo "Checking dependencies"
echo " CD #1"
1999-05-27 23:42:36 +00:00
# >/tmp/foo
1999-04-01 06:58:02 +00:00
$BASEDIR/pkg-order --nocheck-conflicts --nooutput-order --installed-packages /tmp/foo $TDIR/Packages-main.1 >$TDIR/pkg-order.1 2>&1
if [ $? -gt 0 ] ; then
echo "Dependencies of CD #1 cannot be met:"
cat $TDIR/pkg-order.1
if [ "$FORCE_DEPENDS"x != "1"x ] ; then
echo Exit.
exit 1
fi
else
echo " seems OK"
fi
if [ "$SINGLE_DISK"x != "1"x ] ; then
echo " All CDs"
# Use sed here to fix broken package Depends: line
cat $TDIR/Packages* | sed 's/^Suggests:\ metro-motif-devel\ (2/Suggests:\ metro-motif-devel\ (=\ 2/g' >$TDIR/Packages-all
$BASEDIR/pkg-order --nocheck-conflicts --nooutput-order --check-recommends --installed-packages /tmp/foo $TDIR/Packages-all >$TDIR/pkg-order.2 2>&1
if [ $? -gt 0 ] ; then
echo Dependencies of the CD set cannot be met:
if [ "$NF"x = 1 -a "$NU"x = 1 ] ; then
echo "As all sections have been covered, this is fatal..."
if [ "$FORCE_DEPENDS"x != "1"x ] ; then
echo Exit.
exit 1
fi
else
echo "Not all sections have been included on the CD, so this is not fatal."
echo "However, some packages (especially in the contrib section) will not install"
echo "correctly."
fi
fi
fi
# Copy the generated Packages files into place on the
# appropriate disks, then the Contents files
for i in $BINLIST
do
# First of all, create normal-type Packages files
for SECT in $SECTLIST
do
1999-05-27 23:42:36 +00:00
rm -f $CODENAME$i/dists/$CODENAME_STATUS/$SECT/binary-$ARCH/Packages*
1999-04-01 06:58:02 +00:00
cat Packages-$SECT.$i | \
grep -v ^X-Medium \
1999-05-27 23:42:36 +00:00
>$CODENAME$i/dists/$CODENAME_STATUS/$SECT/binary-$ARCH/Packages
1999-04-01 06:58:02 +00:00
cat Packages-$SECT.$i | grep -v ^X-Medium | \
1999-05-27 23:42:36 +00:00
gzip -9 >$CODENAME$i/dists/$CODENAME_STATUS/$SECT/binary-$ARCH/Packages.gz
1999-04-01 06:58:02 +00:00
done
# Now the Packages.cd files
1999-05-27 23:42:36 +00:00
vecho $CODENAME$i
1999-04-01 06:58:02 +00:00
# Be slightly clever here - only copy Packages data for
# disc nos. less than or equal to the one we're on - disc
# 1 will not know about discs 2,5 but 5 will know about
# both the others. The user should insert the last binary
# disc they have for initial installation.
for j in $BINLIST
do
if [ $j -le $i ] ; then
for SECT in $SECTLIST
do
if [ -e Packages-$SECT.$j ] ; then
vecho " Packages-$SECT.$j"
cat Packages-$SECT.$j >> \
1999-05-27 23:42:36 +00:00
$CODENAME$i/dists/$CODENAME_STATUS/$SECT/binary-$ARCH/Packages.cd
1999-04-01 06:58:02 +00:00
cat Packages-$SECT.$j | gzip -9 >> \
1999-05-27 23:42:36 +00:00
$CODENAME$i/dists/$CODENAME_STATUS/$SECT/binary-$ARCH/Packages.cd.gz
1999-04-01 06:58:02 +00:00
fi
done
fi
done
vecho " Contents-$ARCH.gz"
1999-05-27 23:42:36 +00:00
cp -pl $MIRROR/dists/$CODENAME/Contents-$ARCH.gz $CODENAME$i/dists/$CODENAME_STATUS
1999-04-01 06:58:02 +00:00
done
fi
fi
# Now fix the missing bits
if [ $error -eq 0 ] ; then
if [ "$BOOT"x = "1"x ] ; then
echo BOOT:
vecho "Making bootable images for $ARCH..."
cd $TDIR
1999-06-08 19:26:16 +00:00
mkdir -m 755 ${CODENAME}1/install
(cd ${CODENAME}1/dists/$CODENAME_STATUS/main/disks-$ARCH/current/ ; \
cp *.txt *.html $TDIR/${CODENAME}1/install )
1999-04-01 06:58:02 +00:00
1999-06-08 19:26:16 +00:00
(cd ${CODENAME}1/doc;
1999-04-01 06:58:02 +00:00
for file in ../install/*.{html,txt}; do ln -s $file; done)
# Hack for bootable disks
rm -rf boot1 boot2
mkdir -p boot1/boot
case "$ARCH"x in
1999-05-28 11:32:28 +00:00
"i386"x|"sparc"x|"m68k"x|"alpha"x|"powerpc"x)
1999-04-01 06:58:02 +00:00
vecho "ARCH is $ARCH, we know what to do. Continuing..."
$BASEDIR/boot-$ARCH $MIRROR $BASEDIR $TDIR $ARCH $VERBOSE $BOOTDIR
if [ $? -gt 0 ] ; then
echo "boot-$ARCH failed. Exit."
exit 1
fi
;;
*)
echo "Oops! We don't know what to do with $ARCH disks yet"
echo "Leaving bootable CDs alone, you'll need to make boot"
echo "floppies by hand to install."
;;
esac
fi
fi
# define extra mkisofs flags for CD image creation
# (this part cannot fit in the above section because it is not required to run
1999-05-27 23:42:36 +00:00
# debian_cd with *both* BOOT & IMAGEx options enabled at one time)
1999-04-01 06:58:02 +00:00
cd $TDIR
case "$ARCH"x in
"i386"x)
if [ -d boot1 ]; then
MKISOFS_OPTS_DISC1="-J -b boot/resc1440.bin -c boot/boot.catalog boot1"
fi
if [ -d boot2 ]; then
MKISOFS_OPTS_DISC2="-J -b boot/resc1440tecra.bin -c boot/boot.catalog boot2"
fi
;;
"sparc"x)
if [ -d boot1 ]; then
MKISOFS_OPTS_DISC1="boot1"
# move install tree to correct location
1999-06-08 19:26:16 +00:00
if [ -d $TDIR/${CODENAME}1/install ] ; then
1999-04-01 06:58:02 +00:00
vecho "Moving install to boot1"
rm -rf $TDIR/boot1/install || true
1999-06-08 19:26:16 +00:00
mv $TDIR/${CODENAME}1/install $TDIR/boot1
1999-04-01 06:58:02 +00:00
fi
fi
;;
1999-05-28 11:32:28 +00:00
"powerpc"x)
if [ -d boot1 ]; then
MKISOFS_OPTS_DISC1="-b install/prep/resc1440.bin -c install/prep/boot.catalog"
fi
;;
1999-04-01 06:58:02 +00:00
"m68k"x)
if [ -d boot1 ]; then
MKISOFS_OPTS_DISC1="-b install/bvme6000/resc1440.bin -c install/bvme6000/boot.catalog"
fi
;;
"alpha"x)
if [ -d boot1 ]; then
MKISOFS_OPTS_DISC1="-J boot1"
fi
;;
esac
if [ $error -eq 0 ] ; then
if [ "$EXTRAS"x = "1"x ] ; then
echo EXTRAS:
# Copy some extras onto disks to fill them, e.g. newest 2.1 and
# 2.2 kernels and netscape
vecho Copying extras onto disks:
cd $TDIR
for i in $DISKLIST
do
1999-05-27 23:42:36 +00:00
if [ -f $TDIR/cd$i.extras ] ; then
vecho " $CODENAME$i extras:"
mkdir $CODENAME$i/extras
cp -R `cat $TDIR/cd$i.extras` $CODENAME$i/extras
1999-04-01 06:58:02 +00:00
else
1999-05-27 23:42:36 +00:00
vecho " $CODENAME$i has no extras"
1999-04-01 06:58:02 +00:00
fi
done
fi
fi
if [ $error -eq 0 ] ; then
if [ "$MD5LIST"x = "1"x ] ; then
echo MD5LIST:
vecho "Generating md5sums for contents of each disk:"
for i in $DISKLIST
do
1999-05-27 23:42:36 +00:00
cd $TDIR/$CODENAME$i
1999-04-01 06:58:02 +00:00
vecho " Disk $i"
1999-05-27 23:42:36 +00:00
find . -follow -type f | grep -v "\./md5sum" | grep -v "/dists/$CODENAME_STATUS" | xargs md5sum > md5sum.txt
1999-04-01 06:58:02 +00:00
done
# Generate some sizes here. Unfortunately no use at all if we're
# using a sym-link farm...
if [ "$GENLINKS" != "1"x ] ; then
vecho "Generating sizes of the trees"
cd $TDIR
du -l >du
fi
fi
fi
if [ $error -eq 0 ] ; then
# Add HFS flags for m68k/powerpc for macs
if [ "$ARCH"x = "powerpc"x -o "$ARCH"x = "m68k"x ] ; then
MKISOFS_OPTS="--netatalk -j -hfs -probe -map $BASEDIR/hfs.map $MKISOFS_OPTS"
fi
cd $TDIR
if [ ! -d $OUT ] ; then
mkdir -p $OUT
fi
if [ "$IMAGE1"x = "1"x ] ; then
echo IMAGE1:
1999-05-27 23:42:36 +00:00
VOLID1=`cat $TDIR/cd1.volid`
1999-06-08 19:26:16 +00:00
vecho "Making image of cd1 to $OUT/${CODENAME}1-$ARCH.raw"
1999-04-01 06:58:02 +00:00
vecho $MKISOFS $MKISOFS_OPTS -V "$VOLID1" \
1999-06-08 19:26:16 +00:00
-o $OUT/${CODENAME}1-$ARCH.raw $MKISOFS_OPTS_DISC1 ${CODENAME}1
1999-04-01 06:58:02 +00:00
$MKISOFS $MKISOFS_OPTS -V "$VOLID1" \
1999-06-08 19:26:16 +00:00
-o $OUT/${CODENAME}1-$ARCH.raw $MKISOFS_OPTS_DISC1 ${CODENAME}1
1999-04-01 06:58:02 +00:00
fi
if [ "$IMAGE2"x = "1"x ] ; then
echo IMAGE2:
1999-05-27 23:42:36 +00:00
VOLID2=`cat $TDIR/cd2.volid`
1999-06-08 19:26:16 +00:00
vecho "Making image of cd2 to $OUT/${CODENAME}2-$ARCH.raw"
1999-04-01 06:58:02 +00:00
vecho $MKISOFS $MKISOFS_OPTS -V "$VOLID2" \
1999-06-08 19:26:16 +00:00
-o $OUT/${CODENAME}2-$ARCH.raw $MKISOFS_OPTS_DISC2 ${CODENAME}2
1999-04-01 06:58:02 +00:00
$MKISOFS $MKISOFS_OPTS -V "$VOLID2" \
1999-06-08 19:26:16 +00:00
-o $OUT/${CODENAME}2-$ARCH.raw $MKISOFS_OPTS_DISC2 ${CODENAME}2
1999-04-01 06:58:02 +00:00
fi
if [ "$IMAGE3"x = "1"x ] ; then
echo IMAGE3:
1999-05-27 23:42:36 +00:00
VOLID3=`cat $TDIR/cd3.volid`
1999-06-08 19:26:16 +00:00
vecho "Making image of cd3 to $OUT/${CODENAME}3.raw"
1999-04-01 06:58:02 +00:00
vecho $MKISOFS $MKISOFS_OPTS -V "$VOLID3" \
1999-06-08 19:26:16 +00:00
-o $OUT/${CODENAME}3.raw $MKISOFS_OPTS_DISC3 ${CODENAME}3
1999-04-01 06:58:02 +00:00
$MKISOFS $MKISOFS_OPTS -V "$VOLID3" \
1999-06-08 19:26:16 +00:00
-o $OUT/${CODENAME}3.raw $MKISOFS_OPTS_DISC3 ${CODENAME}3
1999-04-01 06:58:02 +00:00
fi
if [ "$IMAGE4"x = "1"x ] ; then
echo IMAGE4:
1999-05-27 23:42:36 +00:00
VOLID4=`cat $TDIR/cd4.volid`
1999-06-08 19:26:16 +00:00
vecho "Making image of cd4 to $OUT/${CODENAME}4.raw"
1999-04-01 06:58:02 +00:00
vecho $MKISOFS $MKISOFS_OPTS -V "$VOLID4" \
1999-06-08 19:26:16 +00:00
-o $OUT/${CODENAME}4.raw $MKISOFS_OPTS_DISC4 ${CODENAME}4
1999-04-01 06:58:02 +00:00
$MKISOFS $MKISOFS_OPTS -V "$VOLID4" \
1999-06-08 19:26:16 +00:00
-o $OUT/${CODENAME}4.raw $MKISOFS_OPTS_DISC4 ${CODENAME}4
1999-04-01 06:58:02 +00:00
fi
if [ "$IMAGE5"x = "1"x ] ; then
echo IMAGE5:
1999-05-27 23:42:36 +00:00
VOLID5=`cat $TDIR/cd5.volid`
1999-06-08 19:26:16 +00:00
vecho "Making image of cd5 to $OUT/${CODENAME}5-$ARCH.raw"
1999-04-01 06:58:02 +00:00
if [ "$NF"x = "1"x ] ; then
vecho $MKISOFS $MKISOFS_OPTS -V "$VOLID5" \
1999-06-08 19:26:16 +00:00
-o $OUT/${CODENAME}5-$ARCH.raw $MKISOFS_OPTS_DISC5 ${CODENAME}5
1999-04-01 06:58:02 +00:00
$MKISOFS $MKISOFS_OPTS -V "$VOLID5" \
1999-06-08 19:26:16 +00:00
-o $OUT/${CODENAME}5-$ARCH.raw $MKISOFS_OPTS_DISC5 ${CODENAME}5
1999-04-01 06:58:02 +00:00
fi
fi
fi
# post-process of generated images (eg. to make the CD image bootable on sparc)
if [ $error -eq 0 ] ; then
if [ "$IMAGE1"x = "1"x ] ; then
if [ "$ARCH"x = "alpha"x ] ; then
1999-05-27 23:42:36 +00:00
vecho "Making $CODNAME1 image bootable"
1999-06-08 19:26:16 +00:00
isomarkboot $OUT/${CODENAME}1-$ARCH.raw /boot/bootlx /dists/$CODENAME/main/disks-al/1999-03-/root1440.bin
1999-05-27 23:42:36 +00:00
fi
1999-04-01 06:58:02 +00:00
if [ "$ARCH"x = "sparc"x ] ; then
# temporary mount point (eg. for silo to create the
# bootable CD image) only needed for Sparc so far...
vecho Checking for temporary mount point for SILO
1999-06-08 19:26:16 +00:00
mountpoint=/var/tmp/${CODENAME}_cd.mnt
1999-04-01 06:58:02 +00:00
if [ -d $mountpoint ]; then
umount $mountpoint || true
else
mkdir -p $mountpoint
fi
1999-06-08 19:26:16 +00:00
vecho "Making ${CODENAME}1 image bootable"
1999-04-01 06:58:02 +00:00
EXECARCH=`dpkg --print-installation-architecture`
if [ "$EXECARCH"x = "sparc"x ]; then
siloprog=silo
elif [ "$EXECARCH"x = "i386"x ]; then
siloprog=intelsilo
fi
if [ -n "$siloprog" ]; then
cd1=/boot/debian.txt
cd2=/install/linux-a.out
cd3=/install/linux-2.2.1-a.out
cd4=/install/linux-2.2.1-sun4u-a.out
cd5=/install/root.bin
1999-06-08 19:26:16 +00:00
echo "mount -o loop $OUT/${CODENAME}1-$ARCH.raw $mountpoint"
mount -o loop $OUT/${CODENAME}1-$ARCH.raw $mountpoint
vecho $siloprog -r $mountpoint -c $OUT/${CODENAME}1-$ARCH.raw \
1999-04-01 06:58:02 +00:00
-C /boot/silo.conf -l $cd1,$cd2,$cd3,$cd4,$cd5
1999-06-08 19:26:16 +00:00
$siloprog -r $mountpoint -c $OUT/${CODENAME}1-$ARCH.raw \
1999-04-01 06:58:02 +00:00
-C /boot/silo.conf -l $cd1,$cd2,$cd3,$cd4,$cd5
umount $mountpoint
else
echo "Don't know how to make the sparc bootable image on $EXECARCH system!"
fi
fi
fi
fi
if [ "$IMAGESUMS"x = "1"x ] ; then
echo IMAGESUMS:
# Let's make md5sums of the images for people who may be
# downloading them
cd $OUT
>MD5SUMS
vecho Generating md5sums for the CD images:
for file in *.raw
do
vecho " $file"
md5sum $file >>MD5SUMS
done
fi