diff scripts/bundi @ 1875:298e596aa143

New method of creating BUNDIs
author boisy
date Thu, 11 Aug 2005 13:06:24 +0000
parents 9db5440eef21
children 38899e05f2f3
line wrap: on
line diff
--- a/scripts/bundi	Thu Aug 11 03:21:53 2005 +0000
+++ b/scripts/bundi	Thu Aug 11 13:06:24 2005 +0000
@@ -11,6 +11,10 @@
 #
 # Size of image is 90,624 256-byte sectors, which fits in
 # $00B100 OS-9 Offset in HDB-DOS
+
+use IO::File;
+use POSIX qw(tmpnam);
+
 #
 # ATTENTION!  Set the HDB-DOS offset in your HDB-DOS ROM here! (must be in decimal)
 $hdbdos_offset = 45312;		# 0x00B100
@@ -18,18 +22,20 @@
 $num_hdbdos_disks = 128;
 $NITROS9DIR = $ENV{'NITROS9DIR'};
 $CLOUD9DIR = $ENV{'CLOUD9DIR'};
+$DISTRO = "6809l2";
 
 
 # Check for proper number of arguments
 $numargs = $#ARGV + 1;
-if ($numargs != 2)
+if ($numargs != 3)
 {
-	print "Usage: bundi <bootscript> <diskname>\n";
+	print "Usage: bundi <bootlist> <tracklist> <diskname>\n";
 	exit;
 }
 
-$scriptname = $ARGV[0];
-$diskname = $ARGV[1];
+$bootlist = $ARGV[0];
+$tracklist = $ARGV[1];
+$diskname = $ARGV[2];
 
 
 $multiplier = 2;
@@ -60,18 +66,60 @@
 
 print "Step 1 - Format the disk and make the boot disk\n";
 system("os9 format -qe -l$os9_sectors tmp.dsk");
-system("./$scriptname>&/dev/null");
-system("os9 gen -b=bootfile -t=boottrack tmp.dsk>&/dev/null");
-system("os9 copy -o=0 $NITROS9DIR/6309l2/modules/sysgo_dd tmp.dsk,sysgo");
+
+
+# Read bootlist file and expand any variables
+open(FILE, "$bootlist") or die ("Unable to open $bootlist");
+@bootarray = <FILE>;
+close(FILE);
+foreach $element (@bootarray)
+{
+	if ($element =~ /^#/)
+	{
+		$element = "";
+	}
+	else
+	{
+		$element =~ s/\$(\w+)/${$1}/g;
+		$element =~ s/\s+$//;
+	}
+}
+
+
+
+$bls = "@bootarray";
+system("cat $bls>bootfile");
+
+# Read tracklist file and expand any variables
+open(FILE, "$tracklist") or die ("Unable to open $tracklist");
+@trackarray = <FILE>;
+close(FILE);
+foreach $element (@trackarray)
+{
+	if ($element =~ /^#/)
+	{
+		$element = "";
+	}
+	else
+	{
+		$element =~ s/\$(\w+)/${$1}/g;
+		$element =~ s/\s+$//;
+	}
+}
+
+$tls = "@trackarray";
+system("cat $tls>trackfile");
+
+system("os9 gen -b=bootfile -t=trackfile tmp.dsk>&/dev/null");
+system("os9 copy -o=0 $NITROS9DIR/$DISTRO/modules/sysgo_dd tmp.dsk,sysgo");
 system("os9 attr tmp.dsk,sysgo -epepr");
-system("os9 dsave -e $NITROS9DIR/6309l2/nos96309l2_80d.dsk, tmp.dsk, >&/dev/null");
+system("os9 dsave -e $NITROS9DIR/$DISTRO/nos9$DISTRO_80d.dsk, tmp.dsk, >&/dev/null");
 system("os9 dsave -e $NITROS9DIR/3rdparty/packages/uucpbb/uucpbb21_6309.dsk, tmp.dsk, >&/dev/null");
 system("os9 dsave -e $NITROS9DIR/3rdparty/packages/cc/cc.dsk, tmp.dsk, >&/dev/null");
 system("os9 dsave -e $NITROS9DIR/3rdparty/packages/basic09/basic09v010100.dsk, tmp.dsk, >&/dev/null");
 system("os9 dsave -e $CLOUD9DIR/Products/Ved/Software/ved.dsk, tmp.dsk, >&/dev/null");
 system("os9 format -qe -ss -dd boot.dsk");
-system("os9 gen -b=bootfile -t=boottrack boot.dsk>&/dev/null");
-system("rm bootfile boottrack");
+system("os9 gen -b=bootfile -t=trackfile boot.dsk>&/dev/null");
 
 print "Step 2 - Build the HDB-DOS drives\n";
 system("rm hdbdrives.dsk");