Subversion Repositories SvarDOS

Rev

Rev 838 | Rev 849 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 838 Rev 847
1
#!/bin/bash
1
#!/bin/bash
2
#
2
#
3
# SvarDOS build script
3
# SvarDOS build script
4
# http://svardos.org
4
# http://svardos.org
5
# Copyright (C) 2016-2022 Mateusz Viste
5
# Copyright (C) 2016-2022 Mateusz Viste
6
#
6
#
7
# This script generates the SvarDOS repository index and builds floppy and CD
7
# This script builds floppy and CD images. It should be executed each time that
-
 
8
# a CORE package has been modified or the build script changed. Before running
-
 
9
# it looks for the presence of a /tmp/svardos_repo_changed.flag and stops if
8
# images. It should be executed each time that a CORE package has been
10
# no such flag exists. This flag is expected to be created by an svn
9
# modified, added or removed.
11
# post-commit hook when an important svn change is detected.
10
#
12
#
11
# usage: ./build.sh outputdir [noclean]
13
# usage: ./build.sh outputdir [noclean] > logfile
12
#
14
#
13
 
15
 
14
### parameters block starts here ############################################
16
### parameters block starts here ############################################
15
 
17
 
16
CURDATE=`date +%Y%m%d`
18
CURDATE=`date +%Y%m%d`
17
REPOROOT=`realpath ./packages`
19
REPOROOT=`realpath ./packages`
18
CUSTFILES=`realpath ./files`
20
CUSTFILES=`realpath ./files`
19
 
21
 
20
GENISOIMAGE=''    # can be mkisofs, genisoimage or empty for autodetection
22
GENISOIMAGE=''    # can be mkisofs, genisoimage or empty for autodetection
21
 
23
 
22
### parameters block ends here ##############################################
24
### parameters block ends here ##############################################
23
 
25
 
24
# look for mandatory output dir
26
# look for mandatory output dir
25
if [ "x$1" == "x" ] ; then
27
if [ "x$1" == "x" ] ; then
26
  echo "usage: build.sh outputdir [noclean] > logfile"
28
  echo "usage: build.sh outputdir [noclean] > logfile"
27
  exit 1
29
  exit 1
28
fi
30
fi
29
PUBDIR=`realpath "$1"`/$CURDATE.staging
31
PUBDIR=`realpath "$1"`/$CURDATE
30
 
32
 
31
CDROOT="$PUBDIR/tmp_cdroot.build"
33
CDROOT="$PUBDIR/tmp_cdroot.build"
32
FLOPROOT="$PUBDIR/tmp_floproot.build"
34
FLOPROOT="$PUBDIR/tmp_floproot.build"
33
 
35
 
34
 
36
 
35
# auto-detect whether to use mkisofs or genisoimage
37
# auto-detect whether to use mkisofs or genisoimage
36
 
38
 
37
if [ "x$GENISOIMAGE" == "x" ] ; then
39
if [ "x$GENISOIMAGE" == "x" ] ; then
38
mkisofs --help 2> /dev/null
40
mkisofs --help 2> /dev/null
39
if [ $? -eq 0 ] ; then
41
if [ $? -eq 0 ] ; then
40
  GENISOIMAGE='mkisofs'
42
  GENISOIMAGE='mkisofs'
41
fi
43
fi
42
fi
44
fi
43
 
45
 
44
if [ "x$GENISOIMAGE" == "x" ] ; then
46
if [ "x$GENISOIMAGE" == "x" ] ; then
45
genisoimage --help 2> /dev/null
47
genisoimage --help 2> /dev/null
46
if [ $? -eq 0 ] ; then
48
if [ $? -eq 0 ] ; then
47
  GENISOIMAGE='genisoimage'
49
  GENISOIMAGE='genisoimage'
48
fi
50
fi
49
fi
51
fi
50
 
52
 
51
if [ "x$GENISOIMAGE" == "x" ] ; then
53
if [ "x$GENISOIMAGE" == "x" ] ; then
52
  echo "ERROR: neither genisoimage nor mkisofs was found on this system"
54
  echo "ERROR: neither genisoimage nor mkisofs was found on this system"
53
  exit 1
55
  exit 1
54
fi
56
fi
55
 
57
 
56
 
58
 
57
# abort if anything fails
59
# abort if anything fails
58
set -e
60
set -e
59
 
61
 
60
 
62
 
61
# list of packages to be part of CORE (always installed)
63
# list of packages to be part of CORE (always installed)
62
COREPKGS=`ls -1 'packages/core' | grep -o '^[a-z]*'`
64
COREPKGS=`ls -1 'packages/core' | grep -o '^[a-z]*'`
63
 
65
 
64
# list of packages to be part of EXTRA (only sometimes installed, typically drivers)
66
# list of packages to be part of EXTRA (only sometimes installed, typically drivers)
65
EXTRAPKGS="pcntpk udvd2"
67
EXTRAPKGS="pcntpk udvd2"
66
 
68
 
67
# all packages
69
# all packages
68
ALLPKGS="$COREPKGS $EXTRAPKGS"
70
ALLPKGS="$COREPKGS $EXTRAPKGS"
69
 
71
 
70
 
72
 
71
# prepares image for floppy sets of:
73
# prepares image for floppy sets of:
72
# $1 cylinders
74
# $1 cylinders
73
# $2 heads (sides)
75
# $2 heads (sides)
74
# $3 sectors per track
76
# $3 sectors per track
75
# $4 size
77
# $4 size
76
# $5 where to put a copy of the image (optional)
78
# $5 where to put a copy of the image (optional)
77
function prep_flop {
79
function prep_flop {
78
  mkdir $4
80
  mkdir $4
79
  mformat -C -t $1 -h $2 -s $3 -v SVARDOS -B "$CUSTFILES/floppy.mbr" -i "$4/disk1.img"
81
  mformat -C -t $1 -h $2 -s $3 -v SVARDOS -B "$CUSTFILES/floppy.mbr" -i "$4/disk1.img"
80
  mcopy -sQm -i "$4/disk1.img" "$FLOPROOT/"* ::/
82
  mcopy -sQm -i "$4/disk1.img" "$FLOPROOT/"* ::/
81
 
83
 
82
  # now populate the floppies
84
  # now populate the floppies
83
  curdisk=1
85
  curdisk=1
84
  for p in $ALLPKGS ; do
86
  for p in $ALLPKGS ; do
85
    # if copy fails, then probably the floppy is full - try again after
87
    # if copy fails, then probably the floppy is full - try again after
86
    # creating an additional floppy image
88
    # creating an additional floppy image
87
    if ! mcopy -mi "$4/disk$curdisk.img" "$CDROOT/$p.svp" ::/ ; then
89
    if ! mcopy -mi "$4/disk$curdisk.img" "$CDROOT/$p.svp" ::/ ; then
88
      curdisk=$((curdisk+1))
90
      curdisk=$((curdisk+1))
89
      mformat -C -t $1 -h $2 -s $3 -v SVARDOS -i "$4/disk$curdisk.img"
91
      mformat -C -t $1 -h $2 -s $3 -v SVARDOS -i "$4/disk$curdisk.img"
90
      mcopy -mi "$4/disk$curdisk.img" "$CDROOT/$p.svp" ::/
92
      mcopy -mi "$4/disk$curdisk.img" "$CDROOT/$p.svp" ::/
91
    fi
93
    fi
92
  done
94
  done
93
 
95
 
94
  # add a short readme
96
  # add a short readme
95
  echo "This directory contains a set of $curdisk floppy images of the SvarDOS distribution in the $4 KB floppy format." > "$4/readme.txt"
97
  echo "This directory contains a set of $curdisk floppy images of the SvarDOS distribution in the $4 KB floppy format." > "$4/readme.txt"
96
  echo "" >> "$4/readme.txt"
98
  echo "" >> "$4/readme.txt"
97
  echo "These images are raw floppy disk dumps. To write them on an actual floppy disk, you have to use a low-level sector copying tool, like dd." >> "$4/readme.txt"
99
  echo "These images are raw floppy disk dumps. To write them on an actual floppy disk, you have to use a low-level sector copying tool, like dd." >> "$4/readme.txt"
98
  echo "" >> "$4/readme.txt"
100
  echo "" >> "$4/readme.txt"
99
  echo "Latest SvarDOS version is available on the project's homepage: http://svardos.osdn.io" >> "$4/readme.txt"
101
  echo "Latest SvarDOS version is available on the project's homepage: http://svardos.osdn.io" >> "$4/readme.txt"
100
 
102
 
101
  unix2dos "$4/readme.txt"
103
  unix2dos "$4/readme.txt"
102
 
104
 
103
  # make a copy of the image, if requested
105
  # make a copy of the image, if requested
104
  if [ "x$5" != "x" ] ; then
106
  if [ "x$5" != "x" ] ; then
105
    cp "$4/disk1.img" $5
107
    cp "$4/disk1.img" $5
106
  fi
108
  fi
107
 
109
 
108
  # zip the images (and remove them at the same time)
110
  # zip the images (and remove them at the same time)
109
  rm -f "$PUBDIR/svardos-floppy-$4k.zip"
111
  rm -f "$PUBDIR/svardos-floppy-$4k.zip"
110
  zip -9 -rmj "$PUBDIR/svardos-$CURDATE-floppy-$4k.zip" $4/*
112
  zip -9 -rmj "$PUBDIR/svardos-$CURDATE-floppy-$4k.zip" $4/*
111
 
113
 
112
  # clean up
114
  # clean up
113
  rmdir $4
115
  rmdir $4
114
}
116
}
115
 
117
 
116
 
118
 
117
### actual code flow starts here ############################################
119
### actual code flow starts here ############################################
118
 
120
 
119
# remember where I am, so I can get back here once all is done
121
# remember where I am, so I can get back here once all is done
120
origdir=`pwd`
122
origdir=`pwd`
121
 
123
 
122
echo "###############################################################################"
124
echo "###############################################################################"
123
echo " STARTING BUILD $CURDATE"
125
echo " STARTING BUILD $CURDATE"
124
echo "###############################################################################"
126
echo "###############################################################################"
125
echo "dest dir: $PUBDIR"
127
echo "dest dir: $PUBDIR"
126
echo "current time is `date` and it's a beautiful day somewhere in the world"
128
echo "current time is `date` and it's a beautiful day somewhere in the world"
127
echo
129
echo
128
 
130
 
-
 
131
# remove dest dir if it exists already, then recreate it empty
-
 
132
rm -rf "$PUBDIR"
129
mkdir "$PUBDIR"
133
mkdir "$PUBDIR"
-
 
134
 
130
mkdir "$CDROOT"
135
mkdir "$CDROOT"
131
mkdir "$FLOPROOT"
136
mkdir "$FLOPROOT"
132
 
137
 
133
# add CORE packages to CDROOT + create the list of packages on floppy
138
# add CORE packages to CDROOT + create the list of packages on floppy
134
for pkg in $COREPKGS ; do
139
for pkg in $COREPKGS ; do
135
  cp "$REPOROOT/core/$pkg.svp" "$CDROOT/"
140
  cp "$REPOROOT/core/$pkg.svp" "$CDROOT/"
136
  echo "$pkg" >> "$FLOPROOT/install.lst"
141
  echo "$pkg" >> "$FLOPROOT/install.lst"
137
done
142
done
138
 
143
 
139
# add EXTRA packages to CDROOT (but not in the list of packages to install)
144
# add EXTRA packages to CDROOT (but not in the list of packages to install)
140
for pkg in $EXTRAPKGS ; do
145
for pkg in $EXTRAPKGS ; do
141
  cp "$REPOROOT/$pkg.svp" "$CDROOT/"
146
  cp "$REPOROOT/$pkg.svp" "$CDROOT/"
142
done
147
done
143
 
148
 
144
 
149
 
145
echo
150
echo
146
echo "### Populating the floppy root at $FLOPROOT"
151
echo "### Populating the floppy root at $FLOPROOT"
147
echo
152
echo
148
 
153
 
149
# prepare the content of the boot (install) floppy
154
# prepare the content of the boot (install) floppy
150
cp -r "$CUSTFILES/floppy/"* "$FLOPROOT/"
155
cp -r "$CUSTFILES/floppy/"* "$FLOPROOT/"
151
unzip -Cj "$REPOROOT/core/cpidos.svp" 'cpi/ega*.cpx' -d "$FLOPROOT/"
156
unzip -Cj "$REPOROOT/core/cpidos.svp" 'cpi/ega*.cpx' -d "$FLOPROOT/"
152
unzip -Cj "$REPOROOT/core/command.svp" bin/command.com -d "$FLOPROOT/"
157
unzip -Cj "$REPOROOT/core/command.svp" bin/command.com -d "$FLOPROOT/"
153
unzip -Cj "$REPOROOT/core/display.svp" bin/display.exe -d "$FLOPROOT/"
158
unzip -Cj "$REPOROOT/core/display.svp" bin/display.exe -d "$FLOPROOT/"
154
unzip -Cj "$REPOROOT/core/edit.svp" bin/edit.exe -d "$FLOPROOT/"
159
unzip -Cj "$REPOROOT/core/edit.svp" bin/edit.exe -d "$FLOPROOT/"
155
unzip -Cj "$REPOROOT/core/fdapm.svp" bin/fdapm.com -d "$FLOPROOT/"
160
unzip -Cj "$REPOROOT/core/fdapm.svp" bin/fdapm.com -d "$FLOPROOT/"
156
unzip -Cj "$REPOROOT/core/fdisk.svp" bin/fdisk.exe bin/fdiskpt.ini -d "$FLOPROOT/"
161
unzip -Cj "$REPOROOT/core/fdisk.svp" bin/fdisk.exe bin/fdiskpt.ini -d "$FLOPROOT/"
157
unzip -Cj "$REPOROOT/core/format.svp" bin/format.exe -d "$FLOPROOT/"
162
unzip -Cj "$REPOROOT/core/format.svp" bin/format.exe -d "$FLOPROOT/"
158
unzip -Cj "$REPOROOT/core/kernel.svp" bin/kernel.sys bin/sys.com -d "$FLOPROOT/"
163
unzip -Cj "$REPOROOT/core/kernel.svp" bin/kernel.sys bin/sys.com -d "$FLOPROOT/"
159
unzip -Cj "$REPOROOT/core/mem.svp" bin/mem.exe -d "$FLOPROOT/"
164
unzip -Cj "$REPOROOT/core/mem.svp" bin/mem.exe -d "$FLOPROOT/"
160
unzip -Cj "$REPOROOT/core/mode.svp" bin/mode.com -d "$FLOPROOT/"
165
unzip -Cj "$REPOROOT/core/mode.svp" bin/mode.com -d "$FLOPROOT/"
161
unzip -Cj "$REPOROOT/core/more.svp" bin/more.exe -d "$FLOPROOT/"
166
unzip -Cj "$REPOROOT/core/more.svp" bin/more.exe -d "$FLOPROOT/"
162
unzip -Cj "$REPOROOT/core/pkg.svp" bin/pkg.exe -d "$FLOPROOT/"
167
unzip -Cj "$REPOROOT/core/pkg.svp" bin/pkg.exe -d "$FLOPROOT/"
163
 
168
 
164
echo
169
echo
165
echo "### Creating floppy images"
170
echo "### Creating floppy images"
166
echo
171
echo
167
 
172
 
168
# build the boot (CD) floppy image
173
# build the boot (CD) floppy image
169
export MTOOLS_NO_VFAT=1
174
export MTOOLS_NO_VFAT=1
170
 
175
 
171
# prepare images for floppies in different sizes (args are C H S SIZE)
176
# prepare images for floppies in different sizes (args are C H S SIZE)
172
prep_flop 80 2 36 2880 "$CDROOT/boot.img"
177
prep_flop 80 2 36 2880 "$CDROOT/boot.img"
173
prep_flop 80 2 18 1440
178
prep_flop 80 2 18 1440
174
prep_flop 80 2 15 1200
179
prep_flop 80 2 15 1200
175
prep_flop 80 2  9  720
180
prep_flop 80 2  9  720
176
 
181
 
177
echo
182
echo
178
echo "### Computing DOSEMU.zip"
183
echo "### Computing DOSEMU.zip"
179
echo
184
echo
180
 
185
 
181
# prepare the DOSEMU boot zip
186
# prepare the DOSEMU boot zip
182
DOSEMUDIR="$PUBDIR/tmp_dosemu-prep-files.build"
187
DOSEMUDIR="$PUBDIR/tmp_dosemu-prep-files.build"
183
mkdir "$DOSEMUDIR"
188
mkdir "$DOSEMUDIR"
184
# INSTALL.BAT
189
# INSTALL.BAT
185
echo 'IF NOT EXIST C:\TEMP\NUL MKDIR C:\TEMP' >> "$DOSEMUDIR/install.bat"
190
echo 'IF NOT EXIST C:\TEMP\NUL MKDIR C:\TEMP' >> "$DOSEMUDIR/install.bat"
186
echo 'mkdir %DOSDIR%' >> "$DOSEMUDIR/install.bat"
191
echo 'mkdir %DOSDIR%' >> "$DOSEMUDIR/install.bat"
187
echo 'mkdir %DOSDIR%\cfg' >> "$DOSEMUDIR/install.bat"
192
echo 'mkdir %DOSDIR%\cfg' >> "$DOSEMUDIR/install.bat"
188
echo 'ECHO # pkg config file - specifies locations where packages should be installed >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
193
echo 'ECHO # pkg config file - specifies locations where packages should be installed >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
189
echo 'ECHO DIR PROGS C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
194
echo 'ECHO DIR PROGS C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
190
echo 'ECHO DIR GAMES C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
195
echo 'ECHO DIR GAMES C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
191
echo 'ECHO DIR DRIVERS C:\DRIVERS\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
196
echo 'ECHO DIR DRIVERS C:\DRIVERS\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
192
echo 'ECHO DIR DEVEL C:\DEVEL\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
197
echo 'ECHO DIR DEVEL C:\DEVEL\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
193
for p in $COREPKGS ; do
198
for p in $COREPKGS ; do
194
  cp "$CDROOT/$p.svp" "$DOSEMUDIR/"
199
  cp "$CDROOT/$p.svp" "$DOSEMUDIR/"
195
  echo "pkg install $p.svp" >> "$DOSEMUDIR/install.bat"
200
  echo "pkg install $p.svp" >> "$DOSEMUDIR/install.bat"
196
  echo "del $p.svp" >> "$DOSEMUDIR/install.bat"
201
  echo "del $p.svp" >> "$DOSEMUDIR/install.bat"
197
done
202
done
198
echo 'ECHO my_ip = dhcp >> %DOSDIR%\CFG\WATTCP.CFG' >> "$DOSEMUDIR/install.bat"
203
echo 'ECHO my_ip = dhcp >> %DOSDIR%\CFG\WATTCP.CFG' >> "$DOSEMUDIR/install.bat"
199
echo 'del pkg.exe' >> "$DOSEMUDIR/install.bat"
204
echo 'del pkg.exe' >> "$DOSEMUDIR/install.bat"
200
echo 'ECHO SHELLHIGH=C:\SVARDOS\BIN\COMMAND.COM /P >> C:\CONFIG.SYS' >> "$DOSEMUDIR/install.bat"
205
echo 'ECHO SHELLHIGH=C:\SVARDOS\BIN\COMMAND.COM /P >> C:\CONFIG.SYS' >> "$DOSEMUDIR/install.bat"
201
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
206
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
202
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
207
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
203
echo 'ECHO  SVARDOS SETUP COMPLETED ' >> "$DOSEMUDIR/install.bat"
208
echo 'ECHO  SVARDOS SETUP COMPLETED ' >> "$DOSEMUDIR/install.bat"
204
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
209
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
205
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
210
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
206
unzip -Cj "$REPOROOT/core/kernel.svp" bin/kernel.sys -d "$DOSEMUDIR/"
211
unzip -Cj "$REPOROOT/core/kernel.svp" bin/kernel.sys -d "$DOSEMUDIR/"
207
unzip -Cj "$REPOROOT/core/command.svp" bin/command.com -d "$DOSEMUDIR/"
212
unzip -Cj "$REPOROOT/core/command.svp" bin/command.com -d "$DOSEMUDIR/"
208
unzip -Cj "$REPOROOT/core/pkg.svp" bin/pkg.exe -d "$DOSEMUDIR/"
213
unzip -Cj "$REPOROOT/core/pkg.svp" bin/pkg.exe -d "$DOSEMUDIR/"
209
# CONFIG.SYS
214
# CONFIG.SYS
210
echo 'FILES=50' >> "$DOSEMUDIR/config.sys"
215
echo 'FILES=50' >> "$DOSEMUDIR/config.sys"
211
echo 'DOS=HIGH,UMB' >> "$DOSEMUDIR/config.sys"
216
echo 'DOS=HIGH,UMB' >> "$DOSEMUDIR/config.sys"
212
echo 'DOSDATA=UMB' >> "$DOSEMUDIR/config.sys"
217
echo 'DOSDATA=UMB' >> "$DOSEMUDIR/config.sys"
213
echo 'DEVICE=D:\dosemu\emufs.sys' >> "$DOSEMUDIR/config.sys"
218
echo 'DEVICE=D:\dosemu\emufs.sys' >> "$DOSEMUDIR/config.sys"
214
echo 'DEVICE=D:\dosemu\umb.sys' >> "$DOSEMUDIR/config.sys"
219
echo 'DEVICE=D:\dosemu\umb.sys' >> "$DOSEMUDIR/config.sys"
215
echo 'DEVICEHIGH=D:\dosemu\ems.sys' >> "$DOSEMUDIR/config.sys"
220
echo 'DEVICEHIGH=D:\dosemu\ems.sys' >> "$DOSEMUDIR/config.sys"
216
echo 'INSTALL=D:\dosemu\emufs.com' >> "$DOSEMUDIR/config.sys"
221
echo 'INSTALL=D:\dosemu\emufs.com' >> "$DOSEMUDIR/config.sys"
217
# AUTOEXEC.BAT
222
# AUTOEXEC.BAT
218
echo "@ECHO OFF" >> "$DOSEMUDIR/autoexec.bat"
223
echo "@ECHO OFF" >> "$DOSEMUDIR/autoexec.bat"
219
echo 'SET DOSDIR=C:\SVARDOS' >> "$DOSEMUDIR/autoexec.bat"
224
echo 'SET DOSDIR=C:\SVARDOS' >> "$DOSEMUDIR/autoexec.bat"
220
echo 'SET WATTCP.CFG=%DOSDIR%\CFG' >> "$DOSEMUDIR/autoexec.bat"
225
echo 'SET WATTCP.CFG=%DOSDIR%\CFG' >> "$DOSEMUDIR/autoexec.bat"
221
echo 'SET DIRCMD=/p/ogne' >> "$DOSEMUDIR/autoexec.bat"
226
echo 'SET DIRCMD=/p/ogne' >> "$DOSEMUDIR/autoexec.bat"
222
echo 'SET TEMP=C:\TEMP' >> "$DOSEMUDIR/autoexec.bat"
227
echo 'SET TEMP=C:\TEMP' >> "$DOSEMUDIR/autoexec.bat"
223
echo 'PATH %DOSDIR%\BIN' >> "$DOSEMUDIR/autoexec.bat"
228
echo 'PATH %DOSDIR%\BIN' >> "$DOSEMUDIR/autoexec.bat"
224
echo "" >> "$DOSEMUDIR/autoexec.bat"
229
echo "" >> "$DOSEMUDIR/autoexec.bat"
225
echo "REM *** this is a one-time setup script used only during first initialization ***" >> "$DOSEMUDIR/autoexec.bat"
230
echo "REM *** this is a one-time setup script used only during first initialization ***" >> "$DOSEMUDIR/autoexec.bat"
226
echo 'IF EXIST INSTALL.BAT CALL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
231
echo 'IF EXIST INSTALL.BAT CALL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
227
echo 'IF EXIST INSTALL.BAT DEL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
232
echo 'IF EXIST INSTALL.BAT DEL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
228
echo "" >> "$DOSEMUDIR/autoexec.bat"
233
echo "" >> "$DOSEMUDIR/autoexec.bat"
229
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
234
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
230
echo "ECHO Welcome to SvarDOS (powered by DOSEMU)! Type HELP if you are lost." >> "$DOSEMUDIR/autoexec.bat"
235
echo "ECHO Welcome to SvarDOS (powered by DOSEMU)! Type HELP if you are lost." >> "$DOSEMUDIR/autoexec.bat"
231
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
236
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
232
rm -f "$PUBDIR/svardos-dosemu.zip"
237
rm -f "$PUBDIR/svardos-dosemu.zip"
233
zip -rm9jk "$PUBDIR/svardos-$CURDATE-dosemu.zip" "$DOSEMUDIR"
238
zip -rm9jk "$PUBDIR/svardos-$CURDATE-dosemu.zip" "$DOSEMUDIR"
234
rmdir "$DOSEMUDIR"
239
rmdir "$DOSEMUDIR"
235
 
240
 
236
echo
241
echo
237
echo "### Computing the USB image"
242
echo "### Computing the USB image"
238
echo
243
echo
239
 
244
 
240
# prepare the USB bootable image
245
# prepare the USB bootable image
241
USBIMG=$PUBDIR/svardos-usb.img
246
USBIMG=$PUBDIR/svardos-usb.img
242
cp files/boot-svardos.img $USBIMG
247
cp files/boot-svardos.img $USBIMG
243
mcopy -sQm -i "$USBIMG@@32256" "$FLOPROOT/"* ::/
248
mcopy -sQm -i "$USBIMG@@32256" "$FLOPROOT/"* ::/
244
for p in $ALLPKGS ; do
249
for p in $ALLPKGS ; do
245
  mcopy -mi "$USBIMG@@32256" "$CDROOT/$p.svp" ::/
250
  mcopy -mi "$USBIMG@@32256" "$CDROOT/$p.svp" ::/
246
done
251
done
247
 
252
 
248
# compress the USB image
253
# compress the USB image
249
zip -mj9 "$PUBDIR/svardos-$CURDATE-usb.zip" "$USBIMG"
254
zip -mj9 "$PUBDIR/svardos-$CURDATE-usb.zip" "$USBIMG"
250
 
255
 
251
echo
256
echo
252
echo "### Generating ISO CD image"
257
echo "### Generating ISO CD image"
253
echo
258
echo
254
 
259
 
255
CDISO="$PUBDIR/svardos-$CURDATE-cd.iso"
260
CDISO="$PUBDIR/svardos-$CURDATE-cd.iso"
256
CDZIP="$PUBDIR/svardos-$CURDATE-cd.zip"
261
CDZIP="$PUBDIR/svardos-$CURDATE-cd.zip"
257
 
262
 
258
$GENISOIMAGE -input-charset cp437 -b boot.img -iso-level 1 -f -V SVARDOS -o "$CDISO" "$CDROOT/boot.img"
263
$GENISOIMAGE -input-charset cp437 -b boot.img -iso-level 1 -f -V SVARDOS -o "$CDISO" "$CDROOT/boot.img"
259
 
264
 
260
# compress the ISO
265
# compress the ISO
261
zip -mj9 "$CDZIP" "$CDISO"
266
zip -mj9 "$CDZIP" "$CDISO"
262
 
267
 
263
# cleanup temporary things
268
# cleanup temporary things
264
if [ "x$2" != "xnoclean" ] ; then
269
if [ "x$2" != "xnoclean" ] ; then
265
  echo
270
  echo
266
  echo "### Clenup of temporary directories:"
271
  echo "### Clenup of temporary directories:"
267
  echo "# $CDROOT"
272
  echo "# $CDROOT"
268
  echo "# $FLOPROOT"
273
  echo "# $FLOPROOT"
269
  echo
274
  echo
270
  rm -rf "$CDROOT" "$FLOPROOT"
275
  rm -rf "$CDROOT" "$FLOPROOT"
271
fi
276
fi
272
 
277
 
273
cd "$origdir"
278
cd "$origdir"
274
 
279
 
275
echo
280
echo
276
echo "### ALL DONE! ###"
281
echo "### ALL DONE! ###"
277
 
282
 
278
exit 0
283
exit 0
279
 
284