2
# slink_cd v 1.13 (c) Steve McIntyre <stevem@chiark.greenend.org.uk>
3
# Released under GPL 31 Mar 1999
4
# See the file COPYING for license details
5
# Greatly influenced by the older Makefile system in the Hamm debian-cd package
7
##############################################################################
9
# Read the README! IMPORTANT STUFF HERE!
11
##############################################################################
13
# Version number, to be used later
15
SLINKCD_SITE="http://www.chiark.greenend.org.uk/~stevem/DebianCD/"
17
###########################################################################
18
# Default options - we check for these in the environment first, so it
19
# is possible to drive this script entirely without changing these if
20
# you so desire. Where this really comes into its own is in automating
21
# the process for multiple architectures - try a script that sets the
22
# environment appropriately, then calls this for each architecture,
25
# ARCH=i386 TDIR=~/i386-tmp OUT=~/i386-out ./slink_cd <options>
26
# ARCH=m68k TDIR=~/m68k-tmp OUT=~/m68k-out ./slink_cd <options>
27
# ARCH=alpha TDIR=~/alpha-tmp OUT=~/alpha-out ./slink_cd <options>
28
# ARCH=sparc TDIR=~/sparc-tmp OUT=~/sparc-out ./slink_cd <options>
30
# It's not pretty but it should work... (TM) :-) - look at the included
31
# "arch" script for an example.
32
###########################################################################
34
# Grab current directory for later use. Can be over-ridden by $BASEDIR
36
BASEDIR=${BASEDIR:-$PWD}
38
# Architecture to build images for (i386, alpha, m68k, sparc, powerpc so far).
39
# Default, will be overridden by other options - use m68k, alpha or i386 on
40
# commandline to change
43
# Top level location of Debian mirror
44
MIRROR=${MIRROR:-/home/ftp/debian}
46
# Location of non-US mirror
47
NONUS=${NONUS:-$MIRROR/non-US}
49
# Path to use with mkisofs/mkhybrid
50
MKISOFS=${MKISOFS:-"mkhybrid"}
52
# Options to use with mkisofs/mkhybrid - one of these should do you
53
# If you're using i386 then -J will be added later to add Joliet stuff
54
# * Why can't Windows read RockRidge like any sensible OS? *
55
#MKISOFS_OPTS=${MKISOFS_OPTS:-"-a -r -T"} # For normal users
57
MKISOFS_OPTS=${MKISOFS_OPTS:-"-a -r -F -T"} # For sym-link farmers.
58
# Also make sure you have a patched mkhybrid - read the README
60
# TDIR must be on the same partition as the mirror for hard links trick
62
TDIR=${TDIR:-~stevem/slinkcd}
64
# Target directory for output ISO images
65
OUT=${OUT:-$MIRROR/local/images}
67
# Sparc (maybe other?) boot directory from where to grab the SILO boot loader
68
BOOTDIR=${BOOTDIR:-/boot}
70
. $BASEDIR/vecho # Local definitions for vecho, vvecho, vvvecho
78
if [ $# -gt 0 ] ; then
83
VERBOSE=$[ $VERBOSE + 1 ]
193
# Only set this if we have a location for it...
194
if [ "$NONUS"x != ""x ] ; then
204
echo \"$1\": invalid option.
231
if [ "$IMAGES"x = "1"x -a "$NF"x = "1"x ] ; then
236
vecho VERBOSE=$VERBOSE
238
vecho GENLIST=$GENLIST
240
vecho GENLINKS=$GENLINKS
241
vecho FLATTEN=$FLATTEN
242
vecho MD5CHECK=$MD5CHECK
243
vecho PACKAGES=$PACKAGES
246
vecho MD5LIST=$MD5LIST
253
vecho IMAGESUMS=$IMAGESUMS
257
vecho MKISOFS=$MKISOFS
260
vecho BASEDIR=$BASEDIR
263
vecho SINGLE_DISK=$SINGLE_DISK
265
# Sort out non-US link - this should be done better...
266
if [ "$NU"x = "1"x ] ; then
267
vecho Checking for non-US link in $MIRROR/dists/slink
268
if [ ! -L $MIRROR/dists/slink/non-US -a ! -d $MIRROR/dists/slink/non-US ] ; then
269
vecho "Does not exist; trying to make one"
270
(cd $MIRROR/dists/slink && ln -s $NONUS/dists/slink/non-US >/dev/null 2>&1 ) # Redirect errors - people may have a read-only mirror...
274
# Cope with relative paths; some people insist on using them.
275
vecho Checking TDIR is set OK
277
if [ ! -e $TDIR ] ; then
278
vecho "$TDIR does not exist - making it"
280
if [ $? -gt 0 ] ; then
281
echo "Temporary directory $TDIR does not exist and we cannot create it."
286
pushd $TDIR >/dev/null
287
if [ $? -gt 0 ] ; then
288
echo "Error in directory $TDIR"
294
vecho TDIR is now $TDIR
296
vecho Checking MIRROR is set OK
298
if [ ! -e $MIRROR ] ; then
299
echo "Mirror directory $MIRROR does not exist"
304
if [ "$NU"x = "1"x ] ; then
305
vecho Checking NONUS is set OK
307
if [ ! -e $NONUS ] ; then
308
echo "non-US Mirror directory $NONUS does not exist"
314
vecho Checking OUT is set OK
316
if [ ! -e $OUT ] ; then
317
vecho "$OUT does not exist - making it"
319
if [ $? -gt 0 ] ; then
320
echo "Image directory $OUT does not exist and we cannot create it."
325
pushd $OUT >/dev/null
326
if [ $? -gt 0 ] ; then
327
echo "Error in directory $OUT"
333
vecho OUT is now $OUT
335
# Check the user has done as told - make sure we're on the same
336
# partition as the mirror unless we have been told to "genlinks"
338
if [ "$GENLINKS"x != "1"x -a "$TREE"x = "1"x ] ; then
339
vecho Checking that TDIR is on the same partition as the mirror.
340
MIRRORPART=`df $MIRROR | grep -v ilesystem | awk '{print $1}'`
341
vvecho MIRROR is on $MIRRORPART
342
TMPPART=`df $TDIR | grep -v ilesystem | awk '{print $1}'`
343
vvecho TDIR is on $TMPPART
344
if [ "$MIRRORPART"x = "$TMPPART"x ] ; then
345
vecho "Good - they match."
347
echo "Read the instructions, the temporary dir specified must be on the"
348
echo "same partition as the mirror unless you specify \"genlinks\" to make a sym-link"
350
echo "$TMPPART != $MIRRORPART"
355
# Check to see if we're being asked to create md5sums for non-existent images
356
if [ "$IMAGESMADE"x != "1"x -a "$IMAGESUMS"x = "1"x ] ; then
357
echo "To create md5sums of CD images you first need to create the images!"
358
echo "Try again, either adding an image creation option (image[12345x])"
359
echo "or removing the \"imagesums\" option"
364
# If we're doing genlinks then check we have the required -F option
366
if [ "$GENLINKS"x = "1"x ] ; then
367
if ! (echo "$MKISOFS_OPTS" | grep -q \\-F ) ; then
368
echo "If you are using the \"genlinks\" option then you also need to use a patched"
369
echo "mkhybrid/mkisofs and add the \"-F\" flag to the command line for it. See the"
370
echo "README file for more details."
376
# Set up for later; non-free and non-US will be added as necessary
377
SECTLIST="main" # List of sections
378
DISKLIST="1 2 3 4" # List of all disks
379
BINLIST="1 2" # List of disks containing binaries
381
if [ "$SINGLE_DISK"x = "1"x ] ; then
383
if [ "$NU"x = "1"x -o "$NF"x = "1"x ] ; then
384
echo 'single_disk option is not compatible with either non-free or non-US.'
388
if [ "$IMAGE2"x = "1"x -o "$IMAGE3"x = "1"x -o "$IMAGE3" = "1"x -o "$IMAGE4"x = "1"x ] ; then
389
echo 'single_disk option is not compatible with creation of CD images other than #1.'
396
SECTLIST="$SECTLIST contrib"
399
if [ "$NU"x = "1"x ] ; then
400
SECTLIST="$SECTLIST non-US"
403
if [ "$NF"x = "1"x ] ; then
404
SECTLIST="$SECTLIST non-free"
405
DISKLIST="$DISKLIST 5"
409
vecho "About to run to create disk(s) $DISKLIST and section(s) $SECTLIST"
411
# Sanity check for combinations of options - creating sym-links then
412
# flattening them isn't just silly, it's stupid...
414
if [ "$GENLINKS"x = "1"x -a "$FLATTEN"x = "1"x ] ; then
415
echo "The \"genlinks\" and \"flatten\" options are incompatible."
420
if [ $error -eq 0 ] ; then
421
if [ "$CLEAN"x = "1"x ] ; then
423
vecho Removing old directories
424
if [ "$VERBOSE" -gt 1 ] ; then
433
vecho "Making working copies of config files, converting ARCH to $ARCH"
434
if [ -e $TDIR/slink1.list ] ; then
435
vecho "You already appear to have them. I therefore assume the ones in"
436
vecho "$TDIR are correct and I will leave them alone. If you"
437
vecho "want to generate new ones, delete the file \"slink1.list\" in"
438
vecho "$TDIR and try again."
442
for TYPE in list info volid extras optional
444
if [ -e slink$i.$TYPE ] ; then
445
vecho " slink$i.$TYPE"
446
cat slink$i.$TYPE | sed "s/ARCH/$ARCH/g" >$TDIR/slink$i.$TYPE
451
cat mkisofsrc | sed "s/ARCH/$ARCH/g" >$TDIR/.mkisofs
452
ln -s .mkisofs $TDIR/.mkisofsrc
453
vecho " slink1.needed"
455
if [ $? -gt 0 ] ; then
456
echo "\"slice master\" failed - do you have the slice package installed?"
460
echo "# Do not edit this file - it is automatically generated." >$TDIR/slink1.needed
461
echo "# Edit \"master\" instead." >>$TDIR/slink1.needed
462
cat master.$ARCH | awk -F':' '
463
/Packages:/ {packages++; next}
464
/.+.+/ {if(packages) {print $1}}
465
' |sort |uniq >>$TDIR/slink1.needed
468
vecho " slink1.useful"
470
if [ $? -gt 0 ] ; then
471
echo "\"slice useful\" failed - do you have the slice package installed?"
475
echo "# Do not edit this file - it is automatically generated." >$TDIR/slink1.useful
476
echo "# Edit \"useful\" instead." >>$TDIR/slink1.useful
477
cat useful.$ARCH | awk -F':' '
479
' |sort |uniq >>$TDIR/slink1.useful
482
# Check for non-US entries in these files - if we mention it then fix it...
483
if [ "$NU"x != "1"x ] ; then
484
vecho "non-US option not given, so removing non-US references from file lists"
485
for file in $TDIR/slink*.list
489
grep -v non-US $file.1 >$file
494
if [ $error -eq 0 ] ; then
495
if [ "$GENLIST"x = "1"x ] ; then
497
$BASEDIR/mklist "$MIRROR" "$BASEDIR" "$TDIR" "$ARCH" "$VERBOSE"
501
# Now combine the lists
502
if [ ! -e slink1.list ] ; then
503
echo mklist step failed - $TDIR/slink1.list not found
507
if [ ! -e list/OUT1 ] ; then
508
echo mklist step failed - $TDIR/list/OUT1 not found
512
mv slink1.list slink1.list.orig
513
cat slink1.list.orig | grep -v main/binary- >slink1.list
514
cat list/OUT1 | sed 's/dists\/frozen/dists\/slink/g;s/dists\/stable/dists\/slink/g' >>slink1.list
517
if [ "$SINGLE_DISK"x != "1"x ] ; then
518
# Now combine the lists
519
if [ ! -e slink2.list ] ; then
520
echo mklist step failed - $TDIR/slink2.list not found
524
if [ ! -e list/OUT2 ] ; then
525
echo mklist step failed - $TDIR/list/OUT2 not found
529
mv slink2.list slink2.list.orig
530
cat slink2.list.orig | grep -v main/binary- >slink2.list
531
cat list/OUT2 | sed 's/dists\/frozen/dists\/slink/g;s/dists\/stable/dists\/slink/g' >>slink2.list
537
# Make sym-link farm for those people that need it...
538
if [ $error -eq 0 ] ; then
539
if [ "$GENLINKS"x = "1"x ] ; then
541
vecho Making sym-link farm of parts of $MIRROR under $TDIR/tmp-mirror
545
cp -pRs $MIRROR/dists $MIRROR/doc $MIRROR/README* $MIRROR/hamm $MIRROR/indices $MIRROR/ls* $MIRROR/project $MIRROR/tools .
547
# Copy non-US separately if necessary...
548
if [ -L $MIRROR/dists/slink/non-US ] ; then
550
rm dists/slink/non-US
551
mkdir dists/slink/non-US
552
cp -dpRs $NONUS/slink/* dists/slink/non-US
556
vecho Putting binary-all links in
557
find . | $BASEDIR/mklinks $VERBOSE
558
MIRROR=$TDIR/tmp-mirror
562
# Make initial tree(s)
563
if [ $error -eq 0 ] ; then
564
if [ "$TREE"x = "1"x ] ; then
568
# First of all the general stuff to go on all disks.
572
vecho " Make directories"
573
mkdir -p $TDIR/slink$i/dists/slink
574
mkdir -p $TDIR/slink$i/.disk
576
# Oops. We're copying the dists stuff into the root
577
# directory, the boot-floppies install stuff wants it in
578
# /debian. Simple fix...
582
# Set up symlinks so things may work.
585
# Frozen no longer needed
591
vecho " Copy info file"
592
(cat slink$i.info | awk '{printf("%s",$0)}'; echo $DATE) \
594
vecho " Copy release notes"
595
cp $MIRROR/dists/slink/main/Release-Notes slink$i
596
vecho " Copy README.1ST"
597
echo "This Debian CD was created by slink_cd version $SLINKCD_VERSION on $DATE" >slink$i/README.1ST
598
echo "slink_cd is available from $SLINKCD_SITE">>slink$i/README.1ST
599
echo "This disc is labelled" >>slink$i/README.1ST
600
echo "" >>slink$i/README.1ST
601
cat slink$i/.disk/info >>slink$i/README.1ST
602
if [ -e $BASEDIR/README.multicd ] ; then
603
vecho " Copy README.multicd"
604
cat $BASEDIR/README.multicd >>slink$i/README.multicd
606
todos slink$i/README.1ST
609
for file in `cat $TDIR/slink$i.list`
611
cp -dpRPl $file $TDIR/slink$i
617
# And now the arch-specific stuff, NOT to go on the source disks.
621
vecho " Make binary directories"
622
for SECT in $SECTLIST
624
mkdir -p slink$i/dists/slink/$SECT/binary-$ARCH
625
mkdir -p slink$i/dists/slink/$SECT/binary-all
627
vecho " Finish README.1ST"
628
echo "" >>slink$i/README.1ST
629
if [ -e $BASEDIR/README.1ST.$ARCH ] ; then
630
cat $BASEDIR/README.1ST.$ARCH >>slink$i/README.1ST
632
if [ -e $BASEDIR/README.$ARCH ] ; then
633
vecho " Copy README.$ARCH"
634
cat $BASEDIR/README.$ARCH >>slink$i/README.$ARCH
638
# Add the Release files, munging if necessary
642
vecho " add Release files"
643
for SECT in $SECTLIST
645
if [ -e slink$i/dists/slink/$SECT/binary-$ARCH/Release ] ; then
646
rm -f slink$i/dists/slink/$SECT/binary-$ARCH/Release
649
if [ -d slink$i/dists/slink/$SECT/binary-$ARCH ] ; then
650
if [ -e slink$i/dists/slink/$SECT/binary-$ARCH/Release ] ; then
651
cat $MIRROR/dists/slink/$SECT/binary-$ARCH/Release \
652
| sed 's/frozen/stable/g' \
653
> slink$i/dists/slink/$SECT/binary-$ARCH/Release
659
# Add sym-links for the upgrade stuff if we have it.
660
if [ "$ARCH"x = "i386"x ] ; then
662
vecho " upgrade-2.0-i386"
663
(cd $TDIR/slink1 && ln -s dists/stable/main/upgrade-2.0-i386)
664
vecho " upgrade-older-i386"
665
(cd $TDIR/slink1 && ln -s dists/stable/main/upgrade-older-i386)
670
# Fix the crypt++el_2.84-2.deb brokenness in non-US - temporary workaround...
671
if [ "$NU"x = "1"x ] ; then
672
vecho "Looking for broken crypt++el_2.84-2.deb link in non-US..."
673
cd $TDIR/slink2/dists/slink/non-US/binary-$ARCH
674
if [ -L crypt++el_2.84-2.deb ] ; then
675
link=`ls -l crypt++el_2.84-2.deb | awk '{print $11}'`
676
if [ "$link"x != "../binary-all/crypt++el_2.84-2.deb"x ] ; then
678
vecho rm crypt++el_2.84-2.deb
679
rm crypt++el_2.84-2.deb
680
vecho ln -s ../binary-all/crypt++el_2.84-2.deb
681
ln -s ../binary-all/crypt++el_2.84-2.deb
682
vecho cd ../binary-all
684
vecho ln -s $NONUS/hamm/binary-all/crypt++el_2.84-2.deb
685
ln -s $NONUS/hamm/binary-all/crypt++el_2.84-2.deb
687
vecho "You do not have it - good"
692
# Generate the list of files we have
694
rm -f binary targz diffgz dsc
696
vecho Generating file list:
702
find slink$i -name *.deb >>binary
709
find slink$i -name *.tar.gz >>targz
716
find slink$i -name *.diff.gz >>diffgz
723
find slink$i -name *.dsc >>dsc
726
# Now we need to flatten out links pointing outside the tree
727
if [ $error -eq 0 ] ; then
728
if [ "$FLATTEN"x = "1"x ] ; then
730
vecho Flattening external symlinks
731
# This is done in perl.
732
cat binary targz diffgz dsc | $BASEDIR/flatten "$MIRROR" "$NONUS" "$VERBOSE"
736
# Now do a check for the MD5 sums of all the packages before creating
737
# the CD images. To avoid the pain of coping with different paths,
738
# cheat and make sym-links to the real files and compare against
739
# munged pathnames from the Packages files
741
if [ $error -eq 0 ] ; then
742
if [ "$MD5CHECK"x = "1"x ] ; then
744
# First grab all the details from the appropriate Packages files
745
vecho Creating MD5 list of packages for comparison
746
cd $MIRROR/dists/slink
748
# build the list of packages files to read (either compressed or not)
749
for SECT in $SECTLIST
751
dir=$SECT/binary-$ARCH
752
if [ -e $dir/Packages ] ; then
753
PFILES="$PFILES $dir/Packages"
754
elif [ -e $dir/Packages.gz ]; then
755
PFILES="$PFILES $dir/Packages.gz"
757
echo "WARNING: no Packages file(s) found for $dir."
761
# -f on zcat allows uncompressed files to be processed as well
762
# We find the local list of packages as otherwise the
763
# single_disk hack will fail, because of missing files that
764
# would have gone on other discs. Unfortunately this means we
765
# won't be able to detect missing files... Suggestions?
768
(cat $TDIR/binary | sed 's/.*\///g;s/_.*//g' ; cat $BASEDIR/EOP; zcat -f $PFILES) \
769
| grep -v '^#' |awk '
770
/END_OF_PROCESSING/ { yes_done++ ; next }
771
/.*/ { if(!yes_done) { yes[$1]=1 ; next } }
772
/^Package:/ {package=$2}
773
/^Filename:/ {filename[package]=$2}
774
/^MD5sum:/ {md5sum[package]=$2;
775
gsub(".*/","",filename[package]);
778
printf("%32.32s %s\n",md5sum[package],filename[package])
781
' >$TDIR/debcheck_disks.1
786
vecho Creating package sym-links
789
# Use the list we already generated earlier...
790
for file in `cat binary`
798
md5sum -c ../debcheck_disks.1
799
vecho Checking file sizes
800
find . -follow -size 0 >../sizecheck_disks.1
801
if [ -s ../sizecheck_disks.1 ] ; then
805
echo " The following files are of zero size:"
806
cat ../sizecheck_disks.1
807
echo "This is fatal. Exit."
814
# Now check source - use the .dsc files
815
vecho Creating MD5 list of source files for comparison
816
cat `cat dsc` | awk '
817
/^-----BEGIN PGP SIGNATURE/ {in_list=0}
819
if(in_list) {printf("%32.32s %s\n",$1,$3)}
821
/^Files:/ {in_list=1}
822
' >$TDIR/debcheck_disks.2
825
vecho Creating source file sym-links
830
# Use the list we already generated earlier...
831
for file in `cat targz diffgz`
839
md5sum -c ../debcheck_disks.2
840
vecho Checking file sizes
841
find . -follow -size 0 >../sizecheck_disks.2
842
if [ -s ../sizecheck_disks.2 ] ; then
846
echo " The following files are of zero size:"
847
cat ../sizecheck_disks.2
848
echo "This is fatal. Exit."
854
# Next we need to look at the boot-disks
856
vecho Checking boot disks areas:
857
for dir in `find $TDIR | grep disks-$ARCH$`
865
if [ -e md5sum.txt ] ; then
868
echo WARNING: no md5sum.txt file found in $dir/$dir1
876
if [ $error -eq 0 ] ; then
877
if [ "$PACKAGES"x = "1"x ] ; then
880
rm -vf Packages-{main,contrib,non-US,non-free}.[12345]
882
# Create Packages and Packages.cd files to go on the CDs
883
# First lists by section and CD
886
echo Creating Packages-main for disc $i
887
if [ ! -e $MIRROR/indices/override.slink.gz ] ; then
888
echo "Override file $MIRROR/indices/override.slink.gz not found. We cannot"
889
echo "generate our Packages file(s) without this file. Check you are mirroring the"
890
echo "indices/ directory"
894
(cd $TDIR/slink$i/dists/stable/main && \
895
dpkg-scanpackages -m "`cat $TDIR/slink$i/.disk/info`" \
896
binary-$ARCH $MIRROR/indices/override.slink.gz \
897
dists/stable/main/ > $TDIR/Packages-main.$i)
899
if [ "$SINGLE_DISK"x != "1"x ] ; then
900
echo Creating Packages-contrib for disc $i
901
if [ ! -e $MIRROR/indices/override.slink.contrib.gz ] ; then
902
echo "Override file $MIRROR/indices/override.slink.contrib.gz not found. We cannot"
903
echo "generate our Packages file(s) without this file. Check you are mirroring the"
904
echo "indices/ directory"
908
(cd $TDIR/slink$i/dists/stable/contrib && \
909
dpkg-scanpackages -m "`cat $TDIR/slink$i/.disk/info`" \
910
binary-$ARCH $MIRROR/indices/override.slink.contrib.gz \
911
dists/stable/contrib/ > $TDIR/Packages-contrib.$i)
914
if [ "$NU"x = "1"x ] ; then
915
echo Creating Packages-non-US for disc $i
916
# Hmmm, we have a problem here. My non-US mirror has the
917
# override file in $NONUS/indices but open has it in
918
# $MIRROR/indices (and with a different filename!!!)
919
# Check for both in turn...
920
OVER_NU=/foo # default catch-all
921
if [ -e $NONUS/indices/override.slink.nonus ] ; then
922
OVER_NU=$NONUS/indices/override.slink.nonus
923
elif [ -e $NONUS/indices/override.slink.nonus.gz ] ; then
924
OVER_NU=$NONUS/indices/override.slink.nonus.gz
925
elif [ -e $MIRROR/indices/override.non-us.slink ] ; then
926
OVER_NU=$MIRROR/indices/override.non-us.slink
927
elif [ -e $MIRROR/indices/override.non-us.slink.gz ] ; then
928
OVER_NU=$MIRROR/indices/override.non-us.slink.gz
930
if [ ! -e "$OVER_NU" ] ; then
931
echo "Override file "$OVER_NU" not found. We cannot"
932
echo "generate our Packages file(s) without this file. Check you are mirroring the"
933
echo "indices/ directory"
937
(cd $TDIR/slink$i/dists/stable/non-US && \
938
dpkg-scanpackages -m "`cat $TDIR/slink$i/.disk/info`" \
939
binary-$ARCH $OVER_NU \
940
dists/stable/non-US/ > $TDIR/Packages-non-US.$i)
943
if [ "$NF"x = "1"x ] ; then
944
echo Creating Packages-non-free for disc $i
945
if [ ! -e $MIRROR/indices/override.slink.non-free.gz ] ; then
946
echo "Override file $MIRROR/indices/override.slink.non-free.gz not found. We cannot"
947
echo "generate our Packages file(s) without this file. Check you are mirroring the"
948
echo "indices/ directory"
952
(cd $TDIR/slink$i/dists/stable/non-free && \
953
dpkg-scanpackages -m "`cat $TDIR/slink$i/.disk/info`" \
954
binary-$ARCH $MIRROR/indices/override.slink.non-free.gz \
955
dists/stable/non-free/ > $TDIR/Packages-non-free.$i)
959
echo "Checking dependencies"
962
$BASEDIR/pkg-order --nocheck-conflicts --nooutput-order --installed-packages /tmp/foo $TDIR/Packages-main.1 >$TDIR/pkg-order.1 2>&1
963
if [ $? -gt 0 ] ; then
964
echo "Dependencies of CD #1 cannot be met:"
965
cat $TDIR/pkg-order.1
966
if [ "$FORCE_DEPENDS"x != "1"x ] ; then
974
if [ "$SINGLE_DISK"x != "1"x ] ; then
976
# Use sed here to fix broken package Depends: line
977
cat $TDIR/Packages* | sed 's/^Suggests:\ metro-motif-devel\ (2/Suggests:\ metro-motif-devel\ (=\ 2/g' >$TDIR/Packages-all
978
$BASEDIR/pkg-order --nocheck-conflicts --nooutput-order --check-recommends --installed-packages /tmp/foo $TDIR/Packages-all >$TDIR/pkg-order.2 2>&1
979
if [ $? -gt 0 ] ; then
980
echo Dependencies of the CD set cannot be met:
981
if [ "$NF"x = 1 -a "$NU"x = 1 ] ; then
982
echo "As all sections have been covered, this is fatal..."
983
if [ "$FORCE_DEPENDS"x != "1"x ] ; then
988
echo "Not all sections have been included on the CD, so this is not fatal."
989
echo "However, some packages (especially in the contrib section) will not install"
995
# Copy the generated Packages files into place on the
996
# appropriate disks, then the Contents files
1000
# First of all, create normal-type Packages files
1001
for SECT in $SECTLIST
1003
rm -f slink$i/dists/stable/$SECT/binary-$ARCH/Packages*
1004
cat Packages-$SECT.$i | \
1006
>slink$i/dists/stable/$SECT/binary-$ARCH/Packages
1007
cat Packages-$SECT.$i | grep -v ^X-Medium | \
1008
gzip -9 >slink$i/dists/stable/$SECT/binary-$ARCH/Packages.gz
1011
# Now the Packages.cd files
1014
# Be slightly clever here - only copy Packages data for
1015
# disc nos. less than or equal to the one we're on - disc
1016
# 1 will not know about discs 2,5 but 5 will know about
1017
# both the others. The user should insert the last binary
1018
# disc they have for initial installation.
1023
if [ $j -le $i ] ; then
1024
for SECT in $SECTLIST
1026
if [ -e Packages-$SECT.$j ] ; then
1027
vecho " Packages-$SECT.$j"
1028
cat Packages-$SECT.$j >> \
1029
slink$i/dists/stable/$SECT/binary-$ARCH/Packages.cd
1030
cat Packages-$SECT.$j | gzip -9 >> \
1031
slink$i/dists/stable/$SECT/binary-$ARCH/Packages.cd.gz
1037
vecho " Contents-$ARCH.gz"
1038
cp -pl $MIRROR/dists/slink/Contents-$ARCH.gz slink$i/dists/stable
1043
# Now fix the missing bits
1045
if [ $error -eq 0 ] ; then
1046
if [ "$BOOT"x = "1"x ] ; then
1048
vecho "Making bootable images for $ARCH..."
1051
mkdir -m 755 slink1/install
1052
(cd slink1/dists/stable/main/disks-$ARCH/current/ ; \
1053
cp *.txt *.html $TDIR/slink1/install )
1056
for file in ../install/*.{html,txt}; do ln -s $file; done)
1058
# Hack for bootable disks
1063
"i386"x|"sparc"x|"m68k"x|"alpha"x)
1064
vecho "ARCH is $ARCH, we know what to do. Continuing..."
1066
$BASEDIR/boot-$ARCH $MIRROR $BASEDIR $TDIR $ARCH $VERBOSE $BOOTDIR
1067
if [ $? -gt 0 ] ; then
1068
echo "boot-$ARCH failed. Exit."
1073
echo "Oops! We don't know what to do with $ARCH disks yet"
1074
echo "Leaving bootable CDs alone, you'll need to make boot"
1075
echo "floppies by hand to install."
1081
# define extra mkisofs flags for CD image creation
1082
# (this part cannot fit in the above section because it is not required to run
1083
# slink_cd with *both* BOOT & IMAGEx options enabled at one time)
1087
if [ -d boot1 ]; then
1088
MKISOFS_OPTS_DISC1="-J -b boot/resc1440.bin -c boot/boot.catalog boot1"
1090
if [ -d boot2 ]; then
1091
MKISOFS_OPTS_DISC2="-J -b boot/resc1440tecra.bin -c boot/boot.catalog boot2"
1095
if [ -d boot1 ]; then
1096
MKISOFS_OPTS_DISC1="boot1"
1097
# move install tree to correct location
1098
if [ -d $TDIR/slink1/install ] ; then
1099
vecho "Moving install to boot1"
1100
rm -rf $TDIR/boot1/install || true
1101
mv $TDIR/slink1/install $TDIR/boot1
1106
if [ -d boot1 ]; then
1107
MKISOFS_OPTS_DISC1="-b install/bvme6000/resc1440.bin -c install/bvme6000/boot.catalog"
1111
if [ -d boot1 ]; then
1112
MKISOFS_OPTS_DISC1="-J boot1"
1117
if [ $error -eq 0 ] ; then
1118
if [ "$EXTRAS"x = "1"x ] ; then
1120
# Copy some extras onto disks to fill them, e.g. newest 2.1 and
1121
# 2.2 kernels and netscape
1122
vecho Copying extras onto disks:
1126
if [ -f $TDIR/slink$i.extras ] ; then
1127
vecho " slink$i extras:"
1128
mkdir slink$i/extras
1129
cp -R `cat $TDIR/slink$i.extras` slink$i/extras
1131
vecho " slink$i has no extras"
1137
if [ $error -eq 0 ] ; then
1138
if [ "$MD5LIST"x = "1"x ] ; then
1140
vecho "Generating md5sums for contents of each disk:"
1145
find . -follow -type f | grep -v "\./md5sum" | grep -v "/dists/stable" | xargs md5sum > md5sum.txt
1147
# Generate some sizes here. Unfortunately no use at all if we're
1148
# using a sym-link farm...
1149
if [ "$GENLINKS" != "1"x ] ; then
1150
vecho "Generating sizes of the trees"
1157
if [ $error -eq 0 ] ; then
1159
# Add HFS flags for m68k/powerpc for macs
1160
if [ "$ARCH"x = "powerpc"x -o "$ARCH"x = "m68k"x ] ; then
1161
MKISOFS_OPTS="--netatalk -j -hfs -probe -map $BASEDIR/hfs.map $MKISOFS_OPTS"
1166
if [ ! -d $OUT ] ; then
1170
if [ "$IMAGE1"x = "1"x ] ; then
1172
VOLID1=`cat $TDIR/slink1.volid`
1173
vecho "Making image of slink1 to $OUT/slink1-$ARCH.raw"
1174
vecho $MKISOFS $MKISOFS_OPTS -V "$VOLID1" \
1175
-o $OUT/slink1-$ARCH.raw $MKISOFS_OPTS_DISC1 slink1
1176
$MKISOFS $MKISOFS_OPTS -V "$VOLID1" \
1177
-o $OUT/slink1-$ARCH.raw $MKISOFS_OPTS_DISC1 slink1
1180
if [ "$IMAGE2"x = "1"x ] ; then
1182
VOLID2=`cat $TDIR/slink2.volid`
1183
vecho "Making image of slink2 to $OUT/slink2-$ARCH.raw"
1184
vecho $MKISOFS $MKISOFS_OPTS -V "$VOLID2" \
1185
-o $OUT/slink2-$ARCH.raw $MKISOFS_OPTS_DISC2 slink2
1186
$MKISOFS $MKISOFS_OPTS -V "$VOLID2" \
1187
-o $OUT/slink2-$ARCH.raw $MKISOFS_OPTS_DISC2 slink2
1190
if [ "$IMAGE3"x = "1"x ] ; then
1192
VOLID3=`cat $TDIR/slink3.volid`
1193
vecho "Making image of slink3 to $OUT/slink3.raw"
1194
vecho $MKISOFS $MKISOFS_OPTS -V "$VOLID3" \
1195
-o $OUT/slink3.raw $MKISOFS_OPTS_DISC3 slink3
1196
$MKISOFS $MKISOFS_OPTS -V "$VOLID3" \
1197
-o $OUT/slink3.raw $MKISOFS_OPTS_DISC3 slink3
1200
if [ "$IMAGE4"x = "1"x ] ; then
1202
VOLID4=`cat $TDIR/slink4.volid`
1203
vecho "Making image of slink4 to $OUT/slink4.raw"
1204
vecho $MKISOFS $MKISOFS_OPTS -V "$VOLID4" \
1205
-o $OUT/slink4.raw $MKISOFS_OPTS_DISC4 slink4
1206
$MKISOFS $MKISOFS_OPTS -V "$VOLID4" \
1207
-o $OUT/slink4.raw $MKISOFS_OPTS_DISC4 slink4
1210
if [ "$IMAGE5"x = "1"x ] ; then
1212
VOLID5=`cat $TDIR/slink5.volid`
1213
vecho "Making image of slink5 to $OUT/slink5-$ARCH.raw"
1214
if [ "$NF"x = "1"x ] ; then
1215
vecho $MKISOFS $MKISOFS_OPTS -V "$VOLID5" \
1216
-o $OUT/slink5-$ARCH.raw $MKISOFS_OPTS_DISC5 slink5
1217
$MKISOFS $MKISOFS_OPTS -V "$VOLID5" \
1218
-o $OUT/slink5-$ARCH.raw $MKISOFS_OPTS_DISC5 slink5
1223
# post-process of generated images (eg. to make the CD image bootable on sparc)
1224
if [ $error -eq 0 ] ; then
1225
if [ "$IMAGE1"x = "1"x ] ; then
1226
if [ "$ARCH"x = "alpha"x ] ; then
1227
vecho "Making slink1 image bootable"
1228
isomarkboot $OUT/slink1-$ARCH.raw /boot/bootlx /dists/slink/main/disks-al/1999-03-/root1440.bin
1230
if [ "$ARCH"x = "sparc"x ] ; then
1231
# temporary mount point (eg. for silo to create the
1232
# bootable CD image) only needed for Sparc so far...
1233
vecho Checking for temporary mount point for SILO
1234
mountpoint=/var/tmp/slink_cd.mnt
1235
if [ -d $mountpoint ]; then
1236
umount $mountpoint || true
1238
mkdir -p $mountpoint
1241
vecho "Making slink1 image bootable"
1242
EXECARCH=`dpkg --print-installation-architecture`
1243
if [ "$EXECARCH"x = "sparc"x ]; then
1245
elif [ "$EXECARCH"x = "i386"x ]; then
1248
if [ -n "$siloprog" ]; then
1249
cd1=/boot/debian.txt
1250
cd2=/install/linux-a.out
1251
cd3=/install/linux-2.2.1-a.out
1252
cd4=/install/linux-2.2.1-sun4u-a.out
1253
cd5=/install/root.bin
1254
echo "mount -o loop $OUT/slink1-$ARCH.raw $mountpoint"
1255
mount -o loop $OUT/slink1-$ARCH.raw $mountpoint
1256
vecho $siloprog -r $mountpoint -c $OUT/slink1-$ARCH.raw \
1257
-C /boot/silo.conf -l $cd1,$cd2,$cd3,$cd4,$cd5
1258
$siloprog -r $mountpoint -c $OUT/slink1-$ARCH.raw \
1259
-C /boot/silo.conf -l $cd1,$cd2,$cd3,$cd4,$cd5
1262
echo "Don't know how to make the sparc bootable image on $EXECARCH system!"
1268
if [ "$IMAGESUMS"x = "1"x ] ; then
1270
# Let's make md5sums of the images for people who may be
1274
vecho Generating md5sums for the CD images:
1278
md5sum $file >>MD5SUMS