Subversion Repositories SvarDOS

Rev

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

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