Mercurial > hg > Members > kono > nitros9-code
comparison scripts/bndi @ 1999:0a302a23acaa
new script
author | boisy |
---|---|
date | Thu, 23 Feb 2006 02:28:30 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1998:31ec6767f46c | 1999:0a302a23acaa |
---|---|
1 #!/usr/bin/perl | |
2 # | |
3 # BNDI - Build a NitrOS-9 Disk Image | |
4 # | |
5 # This script builds a NitrOS-9 disk image | |
6 | |
7 use IO::File; | |
8 use POSIX qw(tmpnam); | |
9 | |
10 $NITROS9DIR = $ENV{'NITROS9DIR'}; | |
11 $CLOUD9DIR = $ENV{'CLOUD9DIR'}; | |
12 $DISTRO = "6809l2"; | |
13 | |
14 | |
15 # Check for proper number of arguments | |
16 $numargs = $#ARGV + 1; | |
17 if ($numargs != 4) | |
18 { | |
19 print "Usage: bundi <bootlist> <tracklist> <diskname> <distro>\n"; | |
20 exit; | |
21 } | |
22 | |
23 $bootlist = $ARGV[0]; | |
24 $tracklist = $ARGV[1]; | |
25 $diskname = $ARGV[2]; | |
26 $DISTRO = $ARGV[3]; | |
27 | |
28 printf("Building '%s' distribution onto '%s'\n", $DISTRO, $diskname); | |
29 | |
30 $os9_sectors = 4096; | |
31 printf("Number of sectors: %d\n", $os9_sectors); | |
32 | |
33 print "########## PART I ##########\n"; | |
34 print "# #\n"; | |
35 print "# Assemble EVERYTHING! #\n"; | |
36 print "# #\n"; | |
37 print "#############################\n\n"; | |
38 | |
39 print "Step 1 - Making the ENTIRE NitrOS-9 Project (could take a while)...\n"; | |
40 #system("cd $NITROS9DIR; make dsk>&/dev/null"); | |
41 | |
42 print "Step 2 - Making the HDB-DOS Product...\n"; | |
43 system("cd $CLOUD9DIR/Products/HDB-DOS/Software; make dsk>&/dev/null"); | |
44 | |
45 print "Step 3 - Making the Ved Product...\n"; | |
46 system("cd $ENV{'CLOUD9DIR'}/Products/Ved/Software; make dsk>&/dev/null"); | |
47 | |
48 print "########## PART II ##########\n"; | |
49 print "# #\n"; | |
50 print "# Prepare the Disk Image #\n"; | |
51 print "# #\n"; | |
52 print "#############################\n\n"; | |
53 | |
54 print "Step 1 - Format the disk and make the boot disk\n"; | |
55 system("os9 format -qe -l$os9_sectors tmp.dsk"); | |
56 | |
57 | |
58 # Read bootlist file and expand any variables | |
59 open(FILE, "$bootlist") or die ("Unable to open $bootlist"); | |
60 @bootarray = <FILE>; | |
61 close(FILE); | |
62 foreach $element (@bootarray) | |
63 { | |
64 if (($element =~ /^#/) || ($element =~ /^\*/)) | |
65 { | |
66 $element = ""; | |
67 } | |
68 else | |
69 { | |
70 $element =~ s/\$(\w+)/${$1}/g; | |
71 $element =~ s/\s+$//; | |
72 } | |
73 } | |
74 | |
75 $bls = "@bootarray"; | |
76 system("cat $bls>bootfile"); | |
77 | |
78 # Read tracklist file and expand any variables | |
79 open(FILE, "$tracklist") or die ("Unable to open $tracklist"); | |
80 @trackarray = <FILE>; | |
81 close(FILE); | |
82 foreach $element (@trackarray) | |
83 { | |
84 if (($element =~ /^#/) || ($element =~ /^\*/)) | |
85 { | |
86 $element = ""; | |
87 } | |
88 else | |
89 { | |
90 $element =~ s/\$(\w+)/${$1}/g; | |
91 $element =~ s/\s+$//; | |
92 } | |
93 } | |
94 | |
95 $tls = "@trackarray"; | |
96 system("cat $tls>trackfile"); | |
97 system("os9 padrom 4608 trackfile"); | |
98 | |
99 system("os9 gen -b=bootfile -t=trackfile tmp.dsk>&/dev/null"); | |
100 system("os9 copy -o=0 $NITROS9DIR/$DISTRO/modules/sysgo_dd tmp.dsk,sysgo"); | |
101 system("os9 attr tmp.dsk,sysgo -epepr"); | |
102 system("os9 dsave -e $NITROS9DIR/$DISTRO/nos9"."$DISTRO"."_80d.dsk, tmp.dsk, >&/dev/null"); | |
103 system("os9 copy -o=0 $NITROS9DIR/3rdparty/p2mods/noice/calldbg tmp.dsk,cmds/calldbg"); | |
104 system("os9 attr tmp.dsk,cmds/calldbg -epepr"); | |
105 | |
106 print "Step 3 - Put it all together\n"; | |
107 system("mv tmp.dsk $diskname"); | |
108 | |
109 print "Ok, we're done! The file $diskname is now a fresh disk image.\n"; |