[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: slink_cd v 0.98



Steve McIntyre wrote:
> Anyway, check the script out at
> 
> 	http://www.chiark.greenend.org.uk/~stevem/DebianCD/
> 
> and give me feedback please...!
> 
> I'm now also producing plausible-looking trees for both m68k and alpha,
> apart from the fact large numbers of packages (mainly non-free, contrib,
> non-US) are simply missing as they haven't been ported yet. I understand
> people are working on the main section first, but we need to get the
> others done too if we're going to release properly.
> 
> And I haven't yet had a chance to even look at sparc or powerpc layouts,
> as neither of the mirrors I have access to can hold them at the moment. If
> some sparc/powerpc people can try things out, please do so.

Hello Steve,

  I just merged my patches to your latest slink_cd package (0.98).  The diffs
are attached to this mail.
It allows you to build sparc CD images.  However, sparc isn't yet frozen even
if all uploads we do are related to slink.  You need to get binary-sparc from
potato, remove all symlinks it gets into, recreate them to reference all
packages in slink's binary-all and finally rebuild the Packages files.
I did that locally but not added such weird patch in your slink_cd package.

In effect, the parts related to sparc support in slink_cd is small (just added
silo configuration in the BOOT & IMAGES sections, and postprocess after the
image was created), but I also provide you all my work on multi-disks Debian's
mirror support.
You don't need to put all the mirror contents on the same partition anymore:
all you need is to create one temp dir on each partition that contains a piece
of debian's mirror.  Set the TMPDIRLIST variable to the list of these
directories and TMPDIR to the first one.

Note1: 2 new helper programs are provided in these patches:
   - blockdev takes a list of directories (one per partition) and a list of
     files then tells on which partition a file really resides.
   - mksyms recreate the slink tree as symlinks to files under each temp dir
	 (allows to run dpkg-scanpackages only once per section).

Note2: you may need mkisofs 1.12b3 or newer to be able to merge the partial
trees built under each temp dir.

Note3: could you try it with mkhybrid ?  I don't know if it works with it...

Finally, I also fixed a small problem when the non-us tree is really put under
dists/slink (not a symlink).

Regards.

PS: I successfully created the first CD image for sparc but didn't try it yet
	(need to burn it before). Nevertheless I'd prefer to send you my patches
	in case you want to integrate it in your next release (I will try to burn
	it tomorrow evening... need to sleep now ;-( ).

-- 
 Eric Delaunay                 | "La guerre justifie l'existence des militaires.
 delaunay@lix.polytechnique.fr | En les supprimant." Henri Jeanson (1900-1970)
diff -uNr slink_cd-0.98/blockdev slink_cd-0.98.eric/blockdev
--- slink_cd-0.98/blockdev	Thu Jan  1 01:00:00 1970
+++ slink_cd-0.98.eric/blockdev	Sun Dec 27 20:02:39 1998
@@ -0,0 +1,19 @@
+#!/usr/bin/perl
+
+use POSIX;
+
+while (($arg = shift @ARGV) ne "--") {
+	($dev) = stat $arg;
+	$device[$dev] = $arg;
+#printf "%04x %s\n", $dev, $arg;
+}
+
+foreach $file (@ARGV) {
+	($dev,$ino,$mode) = stat $file;
+	unless (S_ISDIR($mode)) {
+		($dev,$ino,$mode) = lstat $file;
+	}
+#printf "%04x ", $dev;
+	print $device[$dev], ' ', $file, "\n";
+}
+
diff -uNr slink_cd-0.98/mksyms slink_cd-0.98.eric/mksyms
--- slink_cd-0.98/mksyms	Thu Jan  1 01:00:00 1970
+++ slink_cd-0.98.eric/mksyms	Mon Dec 28 23:27:12 1998
@@ -0,0 +1,67 @@
+#! /usr/bin/perl
+
+# (C) 1998, Eric Delaunay
+# Released under GPL
+
+# usage: mksyms <destdir> <srcdirlist>
+
+while (($_ = shift) =~ s/^-//) {
+	foreach $_ (split(//)) {
+		/n/ && ($noact = 1) ||
+		/q/ && ($quiet = 1) ||
+		die "usage: mksyms [-nq] destdir srcdirlist..."
+	}
+}
+$destdir=$_;
+
+# first create a tree of symlinks to all regular files from <srcdirlist> in <destdir>
+foreach $dir (@ARGV) {
+	next unless chdir $dir;		# skip unexistent directories
+	makesymlinks( $dir, "", $destdir );
+}
+
+# then make symlinks from binary-all to binary-sparc in <destdir>
+open F, "find $destdir/*/binary-all -type l -print |" || die "find: $!\n";
+while (<F>) {
+	chop;
+	$link = $_;
+	$dest = $_;
+	$dest =~ s:binary-all:binary-sparc:;
+	# all categories but non-US have sections
+	$link =~ s:.*/binary-all/(.*/.*):../../binary-all/$1: ||
+	$link =~ s:.*/binary-all:../binary-all:;
+	print "create link $dest -> $link\n" unless $quiet;
+	unless ($noact) {
+		symlink $link, $dest || die "$dest: $!\n";
+	}
+}
+close F;
+
+sub makesymlinks
+{
+	my ($abs, $dir, $dest) = @_;
+	my ($ldir) = ($dir);
+	$ldir = "." unless $dir;
+	opendir( DH, $ldir ) || die "$ldir: $!\n";
+	my (@dirlist) = readdir DH;
+	closedir DH;
+	foreach $entry (@dirlist) {
+		next if $entry =~ m/^\.\.?/;
+		$path = $dir ? "$dir/$entry" : $entry;
+		lstat $path;
+		if (-d _) {
+			print "create dir $dest/$path -> $abs/$path\n" unless $quiet;
+			unless ($noact) {
+				mkdir "$dest/$path", 0777 || die "$dest/$path: $!\n";
+			}
+			makesymlinks( $abs, $path, $dest );
+		}
+		elsif (-f _) {
+			print "create link $dest/$path -> $abs/$path\n" unless $quiet;
+			unless ($noact) {
+				symlink "$abs/$path", "$dest/$path" || die "$dest/$path: $!\n";
+			}
+		}
+	}
+}
+
diff -uNr slink_cd-0.98/flatten slink_cd-0.98.eric/flatten
--- slink_cd-0.98/flatten	Sun Jan  3 19:58:25 1999
+++ slink_cd-0.98.eric/flatten	Tue Jan  5 23:09:53 1999
@@ -8,20 +8,39 @@
 #     changes other links. Needs the directories of the mirror 
 #     and the non-us mirror.
 
-# syntax: "cat <files > | flatten mirror non-us"
+# syntax: "cat <files > | flatten [-vqnD] mirror non-us"
 
 # (c) 1998 Jens Ritter
 # Apply the GNU Public License V 2 or later if necessary.
 #
 # Released with slink_cd v 0.98 03 Jan 1999
 
+while (($_ = shift @ARGV) =~ s/^-//) {
+	foreach $_ (split(//)) {
+		/n/ && do { $noact=1 } ||
+		/v/ && do { $verbose=1 } ||
+		/q/ && do { $verbose=0; $quiet=1 } ||
+		/D/ && do { $debug=1 } ||
+		die "usage: cat <files> | flatten [-vqnD] mirror non-us\n";
+	}
+}
+$MIRROR=$_;
+$NONUS=shift;
+$nonus_hack = ($MIRROR ne $NONUS);
+
+@TMPDIRS = @ARGV;
+foreach $dir (@TMPDIRS) {
+	($dev) = stat $dir;
+	$device[$dev] = $dir."/";
+}
+
 # We extensively work on $_!
 while (<STDIN>)
 {
     chop;          # Chop "\n" from end.
     if ( ! -l )    # If not symlink, next.
     { 
-		print $_, ": normal file\n"; 
+		print $_, ": normal file\n" if $verbose;
         next; 
     }  
 
@@ -43,42 +62,70 @@
 
     $i = $linkname;
     $linkname =~ s/\.\.\///g;
-    $abslink = $ARGV[0] . "/dists/" . $linkname;
+    $abslink = $MIRROR . "/dists/" . $linkname;
 
     # Gross hack for non-US. Sort out the tree!!!
-    if ( /non-US/ ) 
+    if ( $nonus_hack && /non-US/ ) 
     {
 	$linkslash = $linkslash + 3;
-	$abslink = $ARGV[1] . "/" . $linkname;
+	$abslink = $NONUS . "/" . $linkname;
     }
  
     # And now for the top-level docs packages; why are these sym-links?
     if ( /package-developer/ ) 
     {
-	$abslink = $ARGV[0] . "/" . $linkname;
+	$abslink = $MIRROR . "/" . $linkname;
     }
 
     if ($dirslash < $linkslash)
     {
-	print $_, " out of tree; replacing\n";
+	print $_, " out of tree; replacing\n" unless $quiet;
 
 	# Debugging output.
-	print "remove: $_\n";
-	print "link: $abslink, $_\n";
+	print "remove: $_\n" if $debug;
+	print "link: $abslink, $_\n" if $debug;
 
 
 	# Uncomment next to lines to remove safeguard.
-	unlink;
-	link $abslink, $_;
+	$dest = $_;
+	$dest = fix_tree($dest,$abslink) if $#TMPDIRS > 1;
+	unless ($noact) {
+	    unlink && link( $abslink, $dest ) || warn "$_: $!\n";
+	}
     }
     else
     {
-	print $_, " inside of tree; leaving alone\n";
+	print $_, " inside of tree; leaving alone\n" if $verbose;
     }
     # print $_,",", $i,",", $abslink,".\n";
 }
 
 print "end\n";
 
+sub mkdirhier
+{
+    my ($dir) = @_;
+    my ($path) = ("");
+    foreach $elem (split(m:/:,$dir)) {
+	$path .= "/".$elem;
+	-d $path || mkdir $path, 0777;
+    }
+}
 
+sub fix_tree
+{
+    my ($dest,$source) = @_;
+    my ($odev) = lstat $dest;
+    my ($dev) = stat $source;
+    my ($path);
+    if ($odev != $dev) {
+	print "remap to: ", $device[$dev], "\n" if $debug;
+	# create the path to the file in the auxiliary tempdir if needed
+	$path = $device[$dev] . $dest;
+	$path =~ m:(.*)/:;
+	mkdirhier $1;
+	return $device[$dev] . $dest;
+    }
+    return $dest;
+}
 
diff -uNr slink_cd-0.98/slink_cd slink_cd-0.98.eric/slink_cd
--- slink_cd-0.98/slink_cd	Mon Jan  4 23:12:39 1999
+++ slink_cd-0.98.eric/slink_cd	Tue Jan  5 23:02:39 1999
@@ -104,6 +104,8 @@
 # "arch" script for an example.
 ###########################################################################
 
+set -x
+
 # Grab current directory for later use
 STARTDIR=$PWD
 
@@ -124,13 +126,17 @@
 # TMPDIR must be on the same partition as the mirror for hard links trick 
 # to work
 TMPDIR=${TMPDIR:-~stevem/slinkcd}
+TMPDIRLIST=${TMPDIRLIST:-$TMPDIR}
 
 # Target directory for output ISO images
 OUT=${OUT:-$MIRROR/local/images}
 
+# sparc (maybe other?) boot directory from where to grab the SILO boot loader
+BOOTDIR=${BOOTDIR:-/boot}
+
 # Sort out non-US link - this should be done better...
 if [ "$NONUS"x != ""x ] ; then
-    if [ ! -L $MIRROR/dists/slink/non-US ] ; then
+    if [ ! -L $MIRROR/dists/slink/non-US -a ! -d $MIRROR/dists/slink/non-US ] ; then
         (cd $MIRROR/dists/slink && ln -s $NONUS/dists/slink/non-US)
     fi
 fi
@@ -236,6 +242,10 @@
 	      ARCH=alpha
 	      shift 1
 	  ;;
+	  "sparc"x)
+	      ARCH=sparc
+	      shift 1
+	  ;;
 	  "m68k"x)
 	      ARCH=m68k
 	      shift 1
@@ -310,6 +320,15 @@
 SECTLIST="main contrib"
 DISKLIST="1 2 3 4"
 
+# temporary mount point (eg. for silo to create the bootable CD image)
+mountpoint=/var/tmp/slink_cd.mnt
+if [ -d $mountpoint ]; then
+    umount $mountpoint || true
+else
+    mkdir -p $mountpoint
+fi
+
+
 if [ "$NU"x = "1"x ] ; then
     SECTLIST="$SECTLIST non-US"
 fi
@@ -366,6 +385,10 @@
 	  echo Disk $i
 	  echo "   Make directories"
 	  mkdir -p $TMPDIR/slink$i/dists/slink
+	  for dir in $TMPDIRLIST; do
+	      rm -rvf $dir/slink$i
+	      mkdir -p $dir/slink$i/dists/slink
+	  done
 	  mkdir -p $TMPDIR/slink$i/.disk
 
 	  cd $TMPDIR/slink$i/dists 
@@ -388,9 +411,12 @@
 	      >slink$i/.disk/info
 	  cd $MIRROR
 	  echo "   Create tree"
-	  for file in `cat $TMPDIR/slink$i.list`
-	  do 
-	      cp -pRPl $file $TMPDIR/slink$i
+	  # put each link in the right temp dir (ie. on the same partition as
+	  # the original file).  Use blockdev helper.
+	  $STARTDIR/blockdev $TMPDIRLIST -- `cat $TMPDIR/slink$i.list` | \
+	  while read dest file
+	  do
+	      cp -pRPl $file $dest/slink$i
 	  done
         done
     fi
@@ -411,24 +437,40 @@
     fi
 fi
 
+rm -fr $TMPDIR/md5 $TMPDIR/sym
+
 # Generate the list of files we have
-cd $TMPDIR
 echo Generating file list:
 echo '   *.deb'
-find . -name *.deb >binary
+for dir in $TMPDIRLIST; do
+    cd $dir
+    find . -name *.deb >binary
+done
 echo '   *.tar.gz'
-find . -name *.tar.gz >targz
+for dir in $TMPDIRLIST; do
+    cd $dir
+    find . -name *.tar.gz >targz
+done
 echo '   *.diff.gz'
-find . -name *.diff.gz >>diffgz
+for dir in $TMPDIRLIST; do
+    cd $dir
+    find . -name *.diff.gz >diffgz
+done
 echo '   *.dsc'
-find . -name *.dsc >>dsc
+for dir in $TMPDIRLIST; do
+    cd $dir
+    find . -name *.dsc >dsc
+done
 
 # Now we need to flatten out links pointing outside the tree
 if [ $error -eq 0 ] ; then
     if [ "$FLATTEN"x = "1"x ] ; then
         echo Flattening external symlinks
         # This is done in perl.
-        cat binary targz diffgz dsc | $STARTDIR/flatten $MIRROR $NONUS
+	for dir in $TMPDIRLIST; do
+	    cd $dir
+	    cat binary targz diffgz dsc | $STARTDIR/flatten $MIRROR "$NONUS" $TMPDIRLIST
+	done
     fi
 fi
 
@@ -443,20 +485,19 @@
         echo Creating MD5 list of packages for comparison
         cd $MIRROR/dists/slink
 
-        PKGFILE="-e dummyegrepname"
-
-        # List of package files we don't want
-        if [ "$NF"x != "1"x ] ; then
-	  PKGFILE="$PKGFILE -e non-free"
-        fi
-        if [ "$NU"x != "1"x ] ; then
-	  PKGFILE="$PKGFILE -e non-US"
-        fi
-
-        # Need -follow here to catch the non-US file, but it slows us 
-        # down a LOT
-        zcat `find . -follow -name Packages.gz | \
-	  grep binary-$ARCH | egrep -v $PKGFILE` | awk '
+	# build the list of packages files to read (either compressed or not)
+	for sec in $SECTLIST; do
+	    dir=$sec/binary-$ARCH
+	    if [ -f $dir/Packages ]; then
+		PFILES="$PFILES $dir/Packages"
+	    elif [ -f $dir/Packages.gz ]; then
+		PFILES="$PFILES $dir/Packages.gz"
+	    else
+		echo "WARNING: no Packages file found for $dir."
+	    fi
+	done
+	# -f allows uncompressed files to be processed as wel
+	zcat -f $PFILES | awk '
 
 	/^Package:/	{package=$2}
 	/^Filename:/	{filename[package]=$2}
@@ -471,14 +512,18 @@
         rm -rf md5
         mkdir md5
         # Use the list we already generated earlier...
-        for file in `cat binary`
-        do
-	  ln -svf ../$file md5
-        done
+	for dir in $TMPDIRLIST
+	do
+	    cd $dir
+	    for file in `cat binary`
+	    do
+	      ln -svf $dir/$file $TMPDIR/md5
+	    done
+	done
 
         # Compare
         echo Comparing sums
-        cd md5
+        cd $TMPDIR/md5
         md5sum -cv ../debcheck_disks.1
         cd ..
         rm -rf md5 debcheck_disks.1
@@ -486,7 +531,7 @@
         # Now check source - use the .dsc files
         echo Creating MD5 list of source files for comparison
         cd $MIRROR/dists/slink
-        find . -name *.dsc -exec cat {} \; | awk '
+        find . -follow -name *.dsc -exec cat {} \; | awk '
 	  /^-----BEGIN PGP SIGNATURE/ {in_list=0}
 	  {
 	  if(in_list) {printf("%32.32s  %s\n",$1,$3)}
@@ -502,14 +547,18 @@
         fi
         mkdir md5
         # Use the list we already generated earlier...
-        for file in `cat targz diffgz`
-        do
-	  ln -svf ../$file md5
-        done
+	for dir in $TMPDIRLIST
+	do
+	    cd $dir
+	    for file in `cat targz diffgz`
+	    do
+	      ln -svf $dir/$file $TMPDIR/md5
+	    done
+	done
 
         # Compare
         echo Comparing sums
-        cd md5
+        cd $TMPDIR/md5
         md5sum -cv ../debcheck_disks.1
         cd ..
         rm -rf md5 debcheck_disks.1
@@ -517,7 +566,7 @@
         # Next we need to look at the boot-disks
 
         echo Checking boot disks areas:
-        for dir in `find $TMPDIR | grep disks-$ARCH$`
+        for dir in `find $TMPDIRLIST | grep disks-$ARCH$`
         do
 	  cd $dir
 	  echo $dir...
@@ -543,17 +592,27 @@
         # First lists by section and CD
         for i in $DISKLIST
         do
+	  # hack for multi-temp dirs:
+	  # create a tree of symlinks to run dpkg-scanpackages once for each CD set
+	  rm -fr sym
+	  mkdir sym
+	  dirlist=
+	  for dir in $TMPDIRLIST; do
+	    dirlist="$dirlist $dir/slink$i/dists/slink"
+	  done
+	  $STARTDIR/mksyms $TMPDIR/sym $dirlist
+
 	  echo Creating Packages-main for disc $i
-	  (cd $TMPDIR/slink$i/dists/stable/main && \
-	      dpkg-scanpackages -m "`cat ../../../.disk/info`" \
+	  (cd sym/main && \
+	      dpkg-scanpackages -m "`cat $TMPDIR/slink$i/.disk/info`" \
 	      binary-$ARCH $MIRROR/indices/override.slink.gz \
-	      dists/stable/main/ > ../../../../Packages-main.$i)
+	      dists/stable/main/ > $TMPDIR/Packages-main.$i)
 
 	  echo Creating Packages-contrib for disc $i
-	  (cd $TMPDIR/slink$i/dists/stable/contrib && \
-	      dpkg-scanpackages -m "`cat ../../../.disk/info`" \
+	  (cd sym/contrib && \
+	      dpkg-scanpackages -m "`cat $TMPDIR/slink$i/.disk/info`" \
 	      binary-$ARCH $MIRROR/indices/override.slink.contrib.gz \
-	      dists/stable/contrib/ > ../../../../Packages-contrib.$i)
+	      dists/stable/contrib/ > $TMPDIR/Packages-contrib.$i)
 
 	  if [ "$NU"x = "1"x ] ; then
 	      echo Creating Packages-non-US for disc $i
@@ -564,23 +623,28 @@
 	      OVER_NU=/foo # default catch-all
 	      if [ -f $NONUS/indices/override.slink.nonus ] ; then
 		OVER_NU=$NONUS/indices/override.slink.nonus
+	      elif [ -f $NONUS/indices/override.slink.nonus.gz ] ; then
+		OVER_NU=$NONUS/indices/override.slink.nonus.gz
 	      elif [ -f $MIRROR/indices/override.non-us.slink ] ; then
 		OVER_NU=$MIRROR/indices/override.non-us.slink
+	      elif [ -f $MIRROR/indices/override.non-us.slink.gz ] ; then
+		OVER_NU=$MIRROR/indices/override.non-us.slink.gz
 	      fi
-	      (cd $TMPDIR/slink$i/dists/stable/non-US && \
-		dpkg-scanpackages -m "`cat ../../../.disk/info`" \
+	      (cd sym/non-US && \
+		dpkg-scanpackages -m "`cat $TMPDIR/slink$i/.disk/info`" \
 		binary-$ARCH $OVER_NU \
-		dists/stable/non-US/ > ../../../../Packages-non-US.$i)
+		dists/stable/non-US/ > $TMPDIR/Packages-non-US.$i)
 	  fi
 
 	  if [ "$NF"x = "1"x ] ; then
 	      echo Creating Packages-non-free for disc $i
-	      (cd $TMPDIR/slink$i/dists/stable/non-free && \
-		dpkg-scanpackages -m "`cat ../../../.disk/info`" \
+	      (cd sym/non-free && \
+		dpkg-scanpackages -m "`cat $TMPDIR/slink$i/.disk/info`" \
 		binary-$ARCH $MIRROR/indices/override.slink.non-free.gz \
-		dists/stable/non-free/ > ../../../../Packages-non-free.$i)
+		dists/stable/non-free/ > $TMPDIR/Packages-non-free.$i)
 	  fi
         done
+	rm -fr sym
 
         # Copy the generated Packages files into place on all the disks, 
         # then the Contents files
@@ -590,24 +654,24 @@
 	  # First of all, create normal-type Packages files
 	  for SECT in $SECTLIST
 	  do
-	      rm -f slink$i/dists/stable/$SECT/binary-$ARCH/Packages*
+	      rm -f slink$i/dists/slink/$SECT/binary-$ARCH/Packages*
 	      cat Packages-$SECT.$i | \
 	      grep -v ^X-Medium \
-		>slink$i/dists/stable/$SECT/binary-$ARCH/Packages
+		>slink$i/dists/slink/$SECT/binary-$ARCH/Packages
 	      cat Packages-$SECT.$i | grep -v ^X-Medium | \
-	      gzip -9 >slink$i/dists/stable/$SECT/binary-$ARCH/Packages.gz
+	      gzip -9 >slink$i/dists/slink/$SECT/binary-$ARCH/Packages.gz
 	  done
-			
+
 	  # Now the Packages.cd files
 	  echo slink$i
-			
+
 	  for SECT in $SECTLIST
 	  do
 	      echo "   Packages-$SECT"
 	      cat Packages-$SECT* \
-		>slink$i/dists/stable/$SECT/binary-$ARCH/Packages.cd
+		>slink$i/dists/slink/$SECT/binary-$ARCH/Packages.cd
 	      cat Packages-$SECT* | gzip -9 > \
-		slink$i/dists/stable/$SECT/binary-$ARCH/Packages.cd.gz
+		slink$i/dists/slink/$SECT/binary-$ARCH/Packages.cd.gz
 	  done
 	  echo "   Contents-$ARCH.gz"
 	  cp -pl $MIRROR/dists/slink/Contents-$ARCH.gz slink$i/dists/slink
@@ -620,10 +684,14 @@
 if [ $error -eq 0 ] ; then
     if [ "$BOOT"x = "1"x ] ; then
         echo "Making bootable images for $ARCH..."
+	cd $TMPDIR
+
+	rm -fr slink1/install
+	mkdir -m 755 slink1/install
+	(cd slink1/dists/slink/main/disks-$ARCH/current/ ; \
+		cp install.txt install.html $TMPDIR/slink1/install )
 
         # Hack for bootable disks
-        rm -rf boot1 boot2
-        mkdir -p boot1/boot boot2/boot
 
         if [ "$ARCH"x = "i386"x ] ; then # We know what to do here...!
 	  echo "ARCH is $ARCH, we know what to do. Continuing..."
@@ -679,10 +747,9 @@
 	      echo "         rawrite 2.0 is much faster, but it locks up on some machines";\
 	      ) |todos > slink1/tools/README.tools
 
-	  mkdir -m 755 slink1/install
 	  (cd slink1/dists/slink/main/disks-$ARCH/current/ ; \
 	      cp resc*.bin linux root.bin \
-	      install.txt install.html $TMPDIR/slink1/install )
+	      $TMPDIR/slink1/install )
 
 	  cp slink1/tools/lodlin16/*.exe slink1/install
 	  cp slink1/tools/rawrite1/rawrite3.com slink1/install/rw1_3.com
@@ -694,6 +761,35 @@
 	      echo "smartdrv /c" ; \
 	      echo "loadlin.exe linux root=/dev/ram ro initrd=root.bin" ; \
 	      ) |todos > slink1/install/boot.bat
+
+	elif [ "$ARCH"x = "sparc"x ]; then	# bootable CD image with SILO
+	  rm -fr boot1
+
+	  # put the relevant parts of SILO boot loader
+	  mkdir -p boot1/boot
+	  cp -p $BOOTDIR/cd.b $BOOTDIR/second.b boot1/boot
+	  cat - > boot1/boot/silo.conf << __EOF__
+message=!cd1
+timeout=300
+image=!cd2
+	label=linux
+	initrd=!cd3
+image=!cd4
+	label=aout
+	initrd=!
+__EOF__
+	  # linux kernel & co are fetched directly from the install dir
+	  # ... put the message banner in boot/debian.txt
+
+	  (cd slink1/dists/slink/main/disks-$ARCH/current/ ; \
+	    cp -p linux-a.out root.bin sparc_release_note.txt \
+	    $BOOTDIR/linux \
+	    $TMPDIR/slink1/install )
+
+	  mount -o loop $MIRROR/dists/slink/main/disks-$ARCH/current/resc1440.bin $mountpoint
+	  cp -p $mountpoint/debian.txt boot1/boot/debian.txt
+	  umount $mountpoint
+
         else
 	  echo "Oops! We don't know what to do with $ARCH disks yet"
 	  echo "Leaving bootable CDs alone, you'll need to make boot"
@@ -702,6 +798,24 @@
     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
+# slink_cd with *both* BOOT & IMAGEx options enabled at one time)
+cd $TMPDIR
+if [ "$ARCH"x = "i386"x ] ; then
+    if [ -d boot1 ]; then
+	cd1_mkisofs_extra="-b boot/resc1440.bin -c boot/boot.catalog boot1"
+    fi
+    if [ -d boot2 ]; then
+	cd2_mkisofs_extra="boot2"
+    fi
+elif [ "$ARCH"x = "sparc"x ] ; then
+    if [ -d boot1 ]; then
+	cd1_mkisofs_extra="boot1"
+    fi
+fi
+
+
 if [ $error -eq 0 ] ; then
     if [ "$EXTRAS"x = "1"x ] ; then
         # Copy some extras onto disks to fill them, e.g. newest 2.1 and 
@@ -726,16 +840,41 @@
         echo "Generating md5sums for contents of each disk:"
         for i in $DISKLIST
         do
-	  cd $TMPDIR/slink$i
 	  echo "   Disk $i"
-	  find . -exec md5sum {} \; >md5sum.txt 2>/dev/null
+	  rm -f $TMPDIR/md5sum.txt
+	  for dir in $TMPDIRLIST; do
+	    cd $dir/slink$i
+	    find . -type f -exec md5sum {} \; >>$TMPDIR/md5sum.txt 2>/dev/null
+	  done
         done
         echo "Generating sizes of the trees"
+	# FIXME: these computed sizes are not relevant in multi-temp dir
+	#        configuration
         cd $TMPDIR
         du -l >du
     fi
 fi
 
+# create a list of directories to put on the CD image
+# (gathered from multi-temp dirs if requested)
+# result is returned in the "cd_dirlist" variable
+gendirlist ()
+{
+    local rootdir=$1
+    cd_dirlist=
+    for dir in $TMPDIRLIST; do
+	for entry in `ls $dir/$rootdir`; do
+	    if [ -d $dir/$rootdir/$entry ]; then
+		suffix=/
+	    else
+		suffix=
+	    fi
+	    cd_dirlist="$cd_dirlist $entry$suffix=$dir/$rootdir/$entry"
+	done
+    done
+}
+
+
 if [ $error -eq 0 ] ; then
 
     # Change the VOLID for each CD in the appropriate file. Maybe
@@ -751,41 +890,76 @@
     cd $TMPDIR
 
     if [ "$IMAGE1"x = "1"x ] ; then
-        echo "Making image of slink1 to $TMPDIR/slink1.raw"
+        echo "Making image of slink1 to $OUT/slink1.raw"
         echo $MKISOFS -V "$VOLID1" \
-	  -b boot/resc1440.bin -c boot/boot.catalog \
-	  -o $OUT/slink1.raw boot1 slink1
+	  -o $OUT/slink1.raw $cd1_mkisofs_extra slink1
+	gendirlist slink1
         $MKISOFS -V "$VOLID1" \
-	  -b boot/resc1440.bin -c boot/boot.catalog \
-	  -o $OUT/slink1.raw boot1/ slink1/
+	  -o $OUT/slink1.raw $cd1_mkisofs_extra $cd_dirlist
     fi
 
     if [ "$IMAGE2"x = "1"x ] ; then
-        echo "Making image of slink2 to $TMPDIR/slink2.raw"
-        echo $MKISOFS -V "$VOLID2" -o $OUT/slink2.raw boot2 slink2
-        $MKISOFS -V "$VOLID2" -o $OUT/slink2.raw boot2 slink2
+        echo "Making image of slink2 to $OUT/slink2.raw"
+        echo $MKISOFS -V "$VOLID2" -o $OUT/slink2.raw $cd2_mkisofs_extra slink2
+	gendirlist slink2
+        $MKISOFS -V "$VOLID2" -o $OUT/slink2.raw $cd2_mkisofs_extra $cd_dirlist
     fi
 
     if [ "$IMAGE3"x = "1"x ] ; then
-        echo "Making image of slink3 to $TMPDIR/slink3.raw"
-        echo $MKISOFS -V "$VOLID3" -o $OUT/slink3.raw slink3
-        $MKISOFS -V "$VOLID3" -o $OUT/slink3.raw slink3
+        echo "Making image of slink3 to $OUT/slink3.raw"
+        echo $MKISOFS -V "$VOLID3" -o $OUT/slink3.raw $cd3_mkisofs_extra slink3
+	gendirlist slink3
+        $MKISOFS -V "$VOLID3" -o $OUT/slink3.raw $cd3_mkisofs_extra $cd_dirlist
     fi
 
     if [ "$IMAGE4"x = "1"x ] ; then
-        echo "Making image of slink4 to $TMPDIR/slink4.raw"
-        echo $MKISOFS -V "$VOLID4" -o $OUT/slink4.raw slink4
-        $MKISOFS -V "$VOLID4" -o $OUT/slink4.raw slink4
+        echo "Making image of slink4 to $OUT/slink4.raw"
+        echo $MKISOFS -V "$VOLID4" -o $OUT/slink4.raw $cd4_mkisofs_extra slink4
+	gendirlist slink4
+        $MKISOFS -V "$VOLID4" -o $OUT/slink4.raw $cd4_mkisofs_extra $cd_dirlist
     fi
 
     if [ "$IMAGE5"x = "1"x ] ; then
-        echo "Making image of slink5 to $TMPDIR/slink5.raw"
+        echo "Making image of slink5 to $OUT/slink5.raw"
         if [ "$NF"x = "1"x ] ; then
-	  echo $MKISOFS -V "$VOLID5" -o $OUT/slink5.raw slink5
-	  $MKISOFS -V "$VOLID5" -o $OUT/slink5.raw slink5
+	  echo $MKISOFS -V "$VOLID5" -o $OUT/slink5.raw $cd5_mkisofs_extra slink5
+	  gendirlist slink5
+	  $MKISOFS -V "$VOLID5" -o $OUT/slink5.raw $cd5_mkisofs_extra $cd_dirlist
         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 = "sparc"x ] ; then
+	    echo "Making slink1 image bootable"
+	    EXECARCH=`dpkg --print-installation-architecture`
+	    if [ "$EXECARCH"x = "sparc"x ]; then
+		siloprog=silo
+	    elif [ "$EXECARCH"x = "i386"x ]; then
+		siloprog=$STARTDIR/intelsilo
+	    fi
+	    if [ -n "$siloprog" ]; then
+		cd1=/boot/debian.txt
+		cd2=/install/linux
+		cd3=/install/root.bin
+		cd4=/install/linux-a.out
+		loopdev=/dev/loop0
+		losetup -d $loopdev || true
+		losetup $loopdev $OUT/slink1.raw
+		mount $loopdev $mountpoint
+		$siloprog -r $mountpoint -c $OUT/slink1.raw -C /boot/silo.conf \
+			-l $cd1,$cd2,$cd3
+		umount $mountpoint
+		losetup -d $loopdev
+	    else
+		echo "Don't know how to make the sparc bootable image on $EXECARCH system!"
+	    fi
+	fi
+    fi
+fi
+
 
 if [ "$IMAGESMADE"x = "1"x ] ; then
     # Let's make md5sums of the images for people who may be

Reply to: