Subversion Repositories SvarDOS

Rev

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

Rev 1127 Rev 1212
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
  LIST=$ALLPKGS
86
  LIST=$ALLPKGS
87
 
87
 
88
  while [ ! -z "$LIST" ] ; do
88
  while [ ! -z "$LIST" ] ; do
89
 
89
 
90
    unset PENDING
90
    unset PENDING
91
    for p in $LIST ; do
91
    for p in $LIST ; do
92
      # if copy fails, then probably the floppy is full - try other packages
92
      # if copy fails, then probably the floppy is full - try other packages
93
      # but remember all that fails so they will be retried on a new floppy
93
      # but remember all that fails so they will be retried on a new floppy
94
      if ! mcopy -mi "$WORKDIR/disk$curdisk.img" "$CDROOT/$p.svp" ::/ ; then
94
      if ! mcopy -mi "$WORKDIR/disk$curdisk.img" "$CDROOT/$p.svp" ::/ ; then
95
        PENDING="$PENDING $p"
95
        PENDING="$PENDING $p"
96
      fi
96
      fi
97
    done
97
    done
98
 
98
 
99
    LIST="$PENDING"
99
    LIST="$PENDING"
100
    # if there are any pending items, then create a new floppy and try pushing pending packages to it
100
    # if there are any pending items, then create a new floppy and try pushing pending packages to it
101
    if [ ! -z "$PENDING" ] ; then
101
    if [ ! -z "$PENDING" ] ; then
102
      curdisk=$((curdisk+1))
102
      curdisk=$((curdisk+1))
103
      mformat -C -t $1 -h $2 -s $3 -v SVARDOS -i "$WORKDIR/disk$curdisk.img"
103
      mformat -C -t $1 -h $2 -s $3 -v SVARDOS -i "$WORKDIR/disk$curdisk.img"
104
    fi
104
    fi
105
 
105
 
106
  done
106
  done
107
 
107
 
108
  # add a short readme
108
  # add a short readme
109
  echo "This directory contains a set of $curdisk floppy images of the SvarDOS distribution in the $4 KB floppy format." > "$WORKDIR/readme.txt"
109
  echo "This directory contains a set of $curdisk floppy images of the SvarDOS distribution in the $4 KB floppy format." > "$WORKDIR/readme.txt"
110
  echo "" >> "$WORKDIR/readme.txt"
110
  echo "" >> "$WORKDIR/readme.txt"
111
  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"
111
  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"
112
  echo "" >> "$WORKDIR/readme.txt"
112
  echo "" >> "$WORKDIR/readme.txt"
113
  echo "Latest SvarDOS version is available on the project's homepage: http://svardos.org" >> "$WORKDIR/readme.txt"
113
  echo "Latest SvarDOS version is available on the project's homepage: http://svardos.org" >> "$WORKDIR/readme.txt"
114
 
114
 
115
  unix2dos "$WORKDIR/readme.txt"
115
  unix2dos "$WORKDIR/readme.txt"
116
 
116
 
117
  # make a copy of the image, if requested
117
  # make a copy of the image, if requested
118
  if [ "x$6" != "x" ] ; then
118
  if [ "x$6" != "x" ] ; then
119
    cp "$WORKDIR/disk1.img" $6
119
    cp "$WORKDIR/disk1.img" $6
120
  fi
120
  fi
121
 
121
 
122
  # zip the images (and remove them at the same time)
122
  # zip the images (and remove them at the same time)
123
  rm -f "$PUBDIR/svardos-floppy-$4k.zip"
123
  rm -f "$PUBDIR/svardos-floppy-$4k.zip"
124
  zip -9 -rmj "$PUBDIR/svardos-$CURDATE-floppy-$4k.zip" "$WORKDIR"/*
124
  zip -9 -rmj "$PUBDIR/svardos-$CURDATE-floppy-$4k.zip" "$WORKDIR"/*
125
 
125
 
126
  # clean up
126
  # clean up
127
  rmdir "$WORKDIR"
127
  rmdir "$WORKDIR"
128
}
128
}
129
 
129
 
130
 
130
 
131
### actual code flow starts here ############################################
131
### actual code flow starts here ############################################
132
 
132
 
133
# remember where I am, so I can get back here once all is done
133
# remember where I am, so I can get back here once all is done
134
origdir=`pwd`
134
origdir=`pwd`
135
 
135
 
136
echo "###############################################################################"
136
echo "###############################################################################"
137
echo " STARTING BUILD $CURDATE"
137
echo " STARTING BUILD $CURDATE"
138
echo "###############################################################################"
138
echo "###############################################################################"
139
echo "dest dir: $PUBDIR"
139
echo "dest dir: $PUBDIR"
140
echo "current time is `date` and it's a beautiful day somewhere in the world"
140
echo "current time is `date` and it's a beautiful day somewhere in the world"
141
echo
141
echo
142
 
142
 
143
mkdir "$CDROOT"
143
mkdir "$CDROOT"
144
mkdir "$FLOPROOT"
144
mkdir "$FLOPROOT"
145
 
145
 
146
# add CORE packages to CDROOT + create the list of packages on floppy
146
# add CORE packages to CDROOT + create the list of packages on floppy
147
for pkg in $COREPKGS ; do
147
for pkg in $COREPKGS ; do
148
  cp "$REPOROOT/core/$pkg.svp" "$CDROOT/"
148
  cp "$REPOROOT/core/$pkg.svp" "$CDROOT/"
149
  echo "$pkg" >> "$FLOPROOT/install.lst"
149
  echo "$pkg" >> "$FLOPROOT/install.lst"
150
done
150
done
151
 
151
 
152
# add EXTRA packages to CDROOT (but not in the list of packages to install)
152
# add EXTRA packages to CDROOT (but not in the list of packages to install)
153
for pkg in $EXTRAPKGS ; do
153
for pkg in $EXTRAPKGS ; do
154
  cp "$REPOROOT/$pkg.svp" "$CDROOT/"
154
  cp "$REPOROOT/$pkg.svp" "$CDROOT/"
155
done
155
done
156
 
156
 
157
 
157
 
158
echo
158
echo
159
echo "### Populating the floppy root at $FLOPROOT"
159
echo "### Populating the floppy root at $FLOPROOT"
160
echo
160
echo
161
 
161
 
162
# prepare the content of the boot (install) floppy, unzipping everything
162
# prepare the content of the boot (install) floppy, unzipping everything
163
# in lowercase (-L) to avoid any case mismatching later in the build process
163
# in lowercase (-L) to avoid any case mismatching later in the build process
164
cp -r "$CUSTFILES/floppy/"* "$FLOPROOT/"
164
cp -r "$CUSTFILES/floppy/"* "$FLOPROOT/"
165
unzip -CLj "$REPOROOT/core/cpidos.svp" 'cpi/ega*.cpx' -d "$FLOPROOT/"
165
unzip -CLj "$REPOROOT/core/cpidos.svp" 'cpi/ega*.cpx' -d "$FLOPROOT/"
166
unzip -CLj "$REPOROOT/core/svarcom.svp" command.com -d "$FLOPROOT/"
166
unzip -CLj "$REPOROOT/core/svarcom.svp" command.com -d "$FLOPROOT/"
167
unzip -CLj "$REPOROOT/core/display.svp" bin/display.exe -d "$FLOPROOT/"
167
unzip -CLj "$REPOROOT/core/display.svp" bin/display.exe -d "$FLOPROOT/"
168
unzip -CLj "$REPOROOT/core/edit.svp" bin/edit.exe -d "$FLOPROOT/"
168
unzip -CLj "$REPOROOT/core/edit.svp" bin/edit.exe -d "$FLOPROOT/"
169
unzip -CLj "$REPOROOT/core/fdapm.svp" bin/fdapm.com -d "$FLOPROOT/"
169
unzip -CLj "$REPOROOT/core/fdapm.svp" bin/fdapm.com -d "$FLOPROOT/"
170
unzip -CLj "$REPOROOT/core/fdisk.svp" bin/fdisk.exe bin/fdiskpt.ini -d "$FLOPROOT/"
170
unzip -CLj "$REPOROOT/core/fdisk.svp" bin/fdisk.exe bin/fdiskpt.ini -d "$FLOPROOT/"
171
unzip -CLj "$REPOROOT/core/format.svp" bin/format.exe -d "$FLOPROOT/"
171
unzip -CLj "$REPOROOT/core/format.svp" bin/format.exe -d "$FLOPROOT/"
172
unzip -CLj "$REPOROOT/core/kernel.svp" bin/kernel.sys bin/sys.com -d "$FLOPROOT/"
172
unzip -CLj "$REPOROOT/core/kernel.svp" bin/kernel.sys bin/sys.com -d "$FLOPROOT/"
173
unzip -CLj "$REPOROOT/core/mem.svp" bin/mem.exe -d "$FLOPROOT/"
173
unzip -CLj "$REPOROOT/core/mem.svp" bin/mem.exe -d "$FLOPROOT/"
174
unzip -CLj "$REPOROOT/core/mode.svp" bin/mode.com -d "$FLOPROOT/"
174
unzip -CLj "$REPOROOT/core/mode.svp" bin/mode.com -d "$FLOPROOT/"
175
unzip -CLj "$REPOROOT/core/more.svp" bin/more.exe -d "$FLOPROOT/"
175
unzip -CLj "$REPOROOT/core/more.svp" bin/more.exe -d "$FLOPROOT/"
176
unzip -CLj "$REPOROOT/core/pkg.svp" bin/pkg.exe -d "$FLOPROOT/"
176
unzip -CLj "$REPOROOT/core/pkg.svp" bin/pkg.exe -d "$FLOPROOT/"
177
 
177
 
178
# generate a simple autoexec.bat file
178
# generate a simple autoexec.bat file
179
echo '@ECHO OFF' > "$FLOPROOT/autoexec.bat"
179
echo '@ECHO OFF' > "$FLOPROOT/autoexec.bat"
180
echo '' >> "$FLOPROOT/autoexec.bat"
180
echo '' >> "$FLOPROOT/autoexec.bat"
181
echo 'REM Load DISPLAY driver if present' >> "$FLOPROOT/autoexec.bat"
181
echo 'REM Load DISPLAY driver if present' >> "$FLOPROOT/autoexec.bat"
182
echo 'IF EXIST DISPLAY.EXE DISPLAY CON=(EGA,,1)' >> "$FLOPROOT/autoexec.bat"
182
echo 'IF EXIST DISPLAY.EXE DISPLAY CON=(EGA,,1)' >> "$FLOPROOT/autoexec.bat"
183
echo '' >> "$FLOPROOT/autoexec.bat"
183
echo '' >> "$FLOPROOT/autoexec.bat"
184
echo 'FDAPM APMDOS' >> "$FLOPROOT/autoexec.bat"
184
echo 'FDAPM APMDOS' >> "$FLOPROOT/autoexec.bat"
185
echo '' >> "$FLOPROOT/autoexec.bat"
185
echo '' >> "$FLOPROOT/autoexec.bat"
186
echo 'ECHO.' >> "$FLOPROOT/autoexec.bat"
186
echo 'ECHO.' >> "$FLOPROOT/autoexec.bat"
187
echo 'ECHO  ********************' >> "$FLOPROOT/autoexec.bat"
187
echo 'ECHO  ********************' >> "$FLOPROOT/autoexec.bat"
188
echo 'ECHO   WELCOME TO SVARDOS' >> "$FLOPROOT/autoexec.bat"
188
echo 'ECHO   WELCOME TO SVARDOS' >> "$FLOPROOT/autoexec.bat"
189
echo 'ECHO  ********************' >> "$FLOPROOT/autoexec.bat"
189
echo 'ECHO  ********************' >> "$FLOPROOT/autoexec.bat"
190
echo "ECHO  build: $CURDATE" >> "$FLOPROOT/autoexec.bat"
190
echo "ECHO  build: $CURDATE" >> "$FLOPROOT/autoexec.bat"
191
echo 'ECHO.' >> "$FLOPROOT/autoexec.bat"
191
echo 'ECHO.' >> "$FLOPROOT/autoexec.bat"
192
echo '' >> "$FLOPROOT/autoexec.bat"
192
echo '' >> "$FLOPROOT/autoexec.bat"
193
echo "INSTALL $CURDATE" >> "$FLOPROOT/autoexec.bat"
193
echo "INSTALL $CURDATE" >> "$FLOPROOT/autoexec.bat"
194
unix2dos "$FLOPROOT/autoexec.bat"
194
unix2dos "$FLOPROOT/autoexec.bat"
195
 
195
 
196
 
196
 
197
echo
197
echo
198
echo "### Computing the USB image"
198
echo "### Computing the USB image"
199
echo
199
echo
200
 
200
 
201
# prepare the USB bootable image
201
# prepare the USB bootable image
202
USBIMG=$PUBDIR/svardos-usb.img
202
USBIMG=$PUBDIR/svardos-usb.img
203
cp files/boot-svardos.img $USBIMG
203
cp files/boot-svardos.img $USBIMG
204
mcopy -sQm -i "$USBIMG@@32256" "$FLOPROOT/"* ::/
204
mcopy -sQm -i "$USBIMG@@32256" "$FLOPROOT/"* ::/
205
for p in $ALLPKGS ; do
205
for p in $ALLPKGS ; do
206
  mcopy -mi "$USBIMG@@32256" "$CDROOT/$p.svp" ::/
206
  mcopy -mi "$USBIMG@@32256" "$CDROOT/$p.svp" ::/
207
done
207
done
208
 
208
 
209
# compress the USB image
209
# compress the USB image
210
zip -mj9 "$PUBDIR/svardos-$CURDATE-usb.zip" "$USBIMG"
210
zip -mj9 "$PUBDIR/svardos-$CURDATE-usb.zip" "$USBIMG"
211
 
211
 
212
 
212
 
213
echo
213
echo
214
echo "### Creating floppy images"
214
echo "### Creating floppy images"
215
echo
215
echo
-
 
216
echo "You might notice a lot of DISK FULL warnings below. Do not worry, these"
-
 
217
echo "are expected and are perfectly normal. It is a side effect of trying to"
-
 
218
echo "fit as many packages as possible on the floppy sets."
-
 
219
echo
216
 
220
 
217
# build the boot (CD) floppy image
221
# build the boot (CD) floppy image
218
export MTOOLS_NO_VFAT=1
222
export MTOOLS_NO_VFAT=1
219
 
223
 
220
# prepare images for floppies in different sizes (args are C H S SIZE)
224
# prepare images for floppies in different sizes (args are C H S SIZE)
221
prep_flop 80 2 36 2880 "$PUBDIR" "$CDROOT/boot.img"
225
prep_flop 80 2 36 2880 "$PUBDIR" "$CDROOT/boot.img"
222
prep_flop 80 2 18 1440 "$PUBDIR"
226
prep_flop 80 2 18 1440 "$PUBDIR"
223
prep_flop 80 2 15 1200 "$PUBDIR"
227
prep_flop 80 2 15 1200 "$PUBDIR"
224
prep_flop 80 2  9  720 "$PUBDIR"
228
prep_flop 80 2  9  720 "$PUBDIR"
225
 
229
 
226
# special case for 360K diskettes: some files must be deleted to make some room,
230
# special case for 360K diskettes: some files must be deleted to make some room,
227
# for this reason the 360K floppy must be generated as last (after all other
231
# for this reason the 360K floppy must be generated as last (after all other
228
# floppies and after the USB image)
232
# floppies and after the USB image)
229
rm "$FLOPROOT"/*.cpx
233
rm "$FLOPROOT"/*.cpx
230
rm "$FLOPROOT"/install.lng
234
rm "$FLOPROOT"/install.lng
231
rm "$FLOPROOT"/display.exe
235
rm "$FLOPROOT"/display.exe
232
rm "$FLOPROOT"/mode.com
236
rm "$FLOPROOT"/mode.com
233
rm "$FLOPROOT"/edit.*
237
rm "$FLOPROOT"/edit.*
234
#
238
#
235
prep_flop 40 2  9  360 "$PUBDIR"
239
prep_flop 40 2  9  360 "$PUBDIR"
236
 
240
 
237
 
241
 
238
echo
242
echo
239
echo "### Computing DOSEMU.zip"
243
echo "### Computing DOSEMU.zip"
240
echo
244
echo
241
 
245
 
242
# prepare the DOSEMU boot zip
246
# prepare the DOSEMU boot zip
243
DOSEMUDIR="$PUBDIR/tmp_dosemu-prep-files.build"
247
DOSEMUDIR="$PUBDIR/tmp_dosemu-prep-files.build"
244
mkdir "$DOSEMUDIR"
248
mkdir "$DOSEMUDIR"
245
# INSTALL.BAT
249
# INSTALL.BAT
246
echo 'IF NOT EXIST C:\TEMP\NUL MKDIR C:\TEMP' >> "$DOSEMUDIR/install.bat"
250
echo 'IF NOT EXIST C:\TEMP\NUL MKDIR C:\TEMP' >> "$DOSEMUDIR/install.bat"
247
echo 'mkdir %DOSDIR%' >> "$DOSEMUDIR/install.bat"
251
echo 'mkdir %DOSDIR%' >> "$DOSEMUDIR/install.bat"
248
echo 'mkdir %DOSDIR%\cfg' >> "$DOSEMUDIR/install.bat"
252
echo 'mkdir %DOSDIR%\cfg' >> "$DOSEMUDIR/install.bat"
249
echo 'ECHO # pkg config file - specifies locations where packages should be installed >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
253
echo 'ECHO # pkg config file - specifies locations where packages should be installed >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
250
echo 'ECHO DIR PROGS C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
254
echo 'ECHO DIR PROGS C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
251
echo 'ECHO DIR GAMES C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
255
echo 'ECHO DIR GAMES C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
252
echo 'ECHO DIR DRIVERS C:\DRIVERS\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
256
echo 'ECHO DIR DRIVERS C:\DRIVERS\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
253
echo 'ECHO DIR DEVEL C:\DEVEL\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
257
echo 'ECHO DIR DEVEL C:\DEVEL\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
254
for p in $COREPKGS ; do
258
for p in $COREPKGS ; do
255
  cp "$CDROOT/$p.svp" "$DOSEMUDIR/"
259
  cp "$CDROOT/$p.svp" "$DOSEMUDIR/"
256
  echo "pkg install $p.svp" >> "$DOSEMUDIR/install.bat"
260
  echo "pkg install $p.svp" >> "$DOSEMUDIR/install.bat"
257
  echo "del $p.svp" >> "$DOSEMUDIR/install.bat"
261
  echo "del $p.svp" >> "$DOSEMUDIR/install.bat"
258
done
262
done
259
echo 'ECHO my_ip = dhcp >> %DOSDIR%\CFG\WATTCP.CFG' >> "$DOSEMUDIR/install.bat"
263
echo 'ECHO my_ip = dhcp >> %DOSDIR%\CFG\WATTCP.CFG' >> "$DOSEMUDIR/install.bat"
260
echo 'del pkg.exe' >> "$DOSEMUDIR/install.bat"
264
echo 'del pkg.exe' >> "$DOSEMUDIR/install.bat"
261
echo 'DEL C:\CONFIG.SYS' >> "$DOSEMUDIR/install.bat"
265
echo 'DEL C:\CONFIG.SYS' >> "$DOSEMUDIR/install.bat"
262
echo 'COPY C:\CONFIG.NEW C:\CONFIG.SYS' >> "$DOSEMUDIR/install.bat"
266
echo 'COPY C:\CONFIG.NEW C:\CONFIG.SYS' >> "$DOSEMUDIR/install.bat"
263
echo 'DEL C:\CONFIG.NEW' >> "$DOSEMUDIR/install.bat"
267
echo 'DEL C:\CONFIG.NEW' >> "$DOSEMUDIR/install.bat"
264
echo 'SET COMSPEC=C:\COMMAND.COM' >> "$DOSEMUDIR/install.bat"
268
echo 'SET COMSPEC=C:\COMMAND.COM' >> "$DOSEMUDIR/install.bat"
265
echo 'DEL C:\CMD.COM' >> "$DOSEMUDIR/install.bat"
269
echo 'DEL C:\CMD.COM' >> "$DOSEMUDIR/install.bat"
266
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
270
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
267
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
271
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
268
echo 'ECHO  SVARDOS SETUP COMPLETED' >> "$DOSEMUDIR/install.bat"
272
echo 'ECHO  SVARDOS SETUP COMPLETED' >> "$DOSEMUDIR/install.bat"
269
echo 'ECHO   PLEASE RESTART DOSEMU' >> "$DOSEMUDIR/install.bat"
273
echo 'ECHO   PLEASE RESTART DOSEMU' >> "$DOSEMUDIR/install.bat"
270
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
274
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
271
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
275
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
272
unzip -Cj "$REPOROOT/core/kernel.svp" bin/kernel.sys -d "$DOSEMUDIR/"
276
unzip -Cj "$REPOROOT/core/kernel.svp" bin/kernel.sys -d "$DOSEMUDIR/"
273
unzip -CLj "$REPOROOT/core/svarcom.svp" command.com -d "$DOSEMUDIR/"
277
unzip -CLj "$REPOROOT/core/svarcom.svp" command.com -d "$DOSEMUDIR/"
274
mv "$DOSEMUDIR/command.com" "$DOSEMUDIR/cmd.com"
278
mv "$DOSEMUDIR/command.com" "$DOSEMUDIR/cmd.com"
275
unzip -Cj "$REPOROOT/core/pkg.svp" bin/pkg.exe -d "$DOSEMUDIR/"
279
unzip -Cj "$REPOROOT/core/pkg.svp" bin/pkg.exe -d "$DOSEMUDIR/"
276
# CONFIG.SYS
280
# CONFIG.SYS
277
echo 'FILES=25' >> "$DOSEMUDIR/config.sys"
281
echo 'FILES=25' >> "$DOSEMUDIR/config.sys"
278
echo 'DOS=HIGH,UMB' >> "$DOSEMUDIR/config.sys"
282
echo 'DOS=HIGH,UMB' >> "$DOSEMUDIR/config.sys"
279
echo 'DOSDATA=UMB' >> "$DOSEMUDIR/config.sys"
283
echo 'DOSDATA=UMB' >> "$DOSEMUDIR/config.sys"
280
echo 'DEVICE=D:\dosemu\emufs.sys' >> "$DOSEMUDIR/config.sys"
284
echo 'DEVICE=D:\dosemu\emufs.sys' >> "$DOSEMUDIR/config.sys"
281
echo 'DEVICE=D:\dosemu\umb.sys' >> "$DOSEMUDIR/config.sys"
285
echo 'DEVICE=D:\dosemu\umb.sys' >> "$DOSEMUDIR/config.sys"
282
echo 'DEVICEHIGH=D:\dosemu\ems.sys' >> "$DOSEMUDIR/config.sys"
286
echo 'DEVICEHIGH=D:\dosemu\ems.sys' >> "$DOSEMUDIR/config.sys"
283
echo 'INSTALL=D:\dosemu\emufs.com' >> "$DOSEMUDIR/config.sys"
287
echo 'INSTALL=D:\dosemu\emufs.com' >> "$DOSEMUDIR/config.sys"
284
cp "$DOSEMUDIR/config.sys" "$DOSEMUDIR/config.new"
288
cp "$DOSEMUDIR/config.sys" "$DOSEMUDIR/config.new"
285
echo 'SHELL=C:\CMD.COM /P' >> "$DOSEMUDIR/config.sys"
289
echo 'SHELL=C:\CMD.COM /P' >> "$DOSEMUDIR/config.sys"
286
echo 'SHELL=C:\COMMAND.COM /P' >> "$DOSEMUDIR/config.new"
290
echo 'SHELL=C:\COMMAND.COM /P' >> "$DOSEMUDIR/config.new"
287
# AUTOEXEC.BAT
291
# AUTOEXEC.BAT
288
echo "@ECHO OFF" >> "$DOSEMUDIR/autoexec.bat"
292
echo "@ECHO OFF" >> "$DOSEMUDIR/autoexec.bat"
289
echo 'SET DOSDIR=C:\SVARDOS' >> "$DOSEMUDIR/autoexec.bat"
293
echo 'SET DOSDIR=C:\SVARDOS' >> "$DOSEMUDIR/autoexec.bat"
290
echo 'SET WATTCP.CFG=%DOSDIR%\CFG' >> "$DOSEMUDIR/autoexec.bat"
294
echo 'SET WATTCP.CFG=%DOSDIR%\CFG' >> "$DOSEMUDIR/autoexec.bat"
291
echo 'SET DIRCMD=/p/ogne' >> "$DOSEMUDIR/autoexec.bat"
295
echo 'SET DIRCMD=/p/ogne' >> "$DOSEMUDIR/autoexec.bat"
292
echo 'SET TEMP=C:\TEMP' >> "$DOSEMUDIR/autoexec.bat"
296
echo 'SET TEMP=C:\TEMP' >> "$DOSEMUDIR/autoexec.bat"
293
echo 'PATH %DOSDIR%\BIN' >> "$DOSEMUDIR/autoexec.bat"
297
echo 'PATH %DOSDIR%\BIN' >> "$DOSEMUDIR/autoexec.bat"
294
echo "" >> "$DOSEMUDIR/autoexec.bat"
298
echo "" >> "$DOSEMUDIR/autoexec.bat"
295
echo 'IF NOT EXIST INSTALL.BAT GOTO NORMBOOT' >> "$DOSEMUDIR/autoexec.bat"
299
echo 'IF NOT EXIST INSTALL.BAT GOTO NORMBOOT' >> "$DOSEMUDIR/autoexec.bat"
296
echo "REM *** this is a one-time setup script used only during first initialization ***" >> "$DOSEMUDIR/autoexec.bat"
300
echo "REM *** this is a one-time setup script used only during first initialization ***" >> "$DOSEMUDIR/autoexec.bat"
297
echo 'CALL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
301
echo 'CALL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
298
echo 'DEL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
302
echo 'DEL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
299
echo 'GOTO ENDOFFILE' >> "$DOSEMUDIR/autoexec.bat"
303
echo 'GOTO ENDOFFILE' >> "$DOSEMUDIR/autoexec.bat"
300
echo "" >> "$DOSEMUDIR/autoexec.bat"
304
echo "" >> "$DOSEMUDIR/autoexec.bat"
301
echo ":NORMBOOT" >> "$DOSEMUDIR/autoexec.bat"
305
echo ":NORMBOOT" >> "$DOSEMUDIR/autoexec.bat"
302
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
306
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
303
echo "ECHO Welcome to SvarDOS (powered by DOSEMU)! Type HELP if you are lost." >> "$DOSEMUDIR/autoexec.bat"
307
echo "ECHO Welcome to SvarDOS (powered by DOSEMU)! Type HELP if you are lost." >> "$DOSEMUDIR/autoexec.bat"
304
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
308
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
305
echo ":ENDOFFILE" >> "$DOSEMUDIR/autoexec.bat"
309
echo ":ENDOFFILE" >> "$DOSEMUDIR/autoexec.bat"
306
rm -f "$PUBDIR/svardos-dosemu.zip"
310
rm -f "$PUBDIR/svardos-dosemu.zip"
307
zip -rm9jk "$PUBDIR/svardos-$CURDATE-dosemu.zip" "$DOSEMUDIR"
311
zip -rm9jk "$PUBDIR/svardos-$CURDATE-dosemu.zip" "$DOSEMUDIR"
308
rmdir "$DOSEMUDIR"
312
rmdir "$DOSEMUDIR"
309
 
313
 
310
echo
314
echo
311
echo "### Generating ISO CD image"
315
echo "### Generating ISO CD image"
312
echo
316
echo
313
 
317
 
314
CDISO="$PUBDIR/svardos-$CURDATE-cd.iso"
318
CDISO="$PUBDIR/svardos-$CURDATE-cd.iso"
315
CDZIP="$PUBDIR/svardos-$CURDATE-cd.zip"
319
CDZIP="$PUBDIR/svardos-$CURDATE-cd.zip"
316
 
320
 
317
$GENISOIMAGE -input-charset cp437 -b boot.img -iso-level 1 -f -V SVARDOS -o "$CDISO" "$CDROOT/boot.img"
321
$GENISOIMAGE -input-charset cp437 -b boot.img -iso-level 1 -f -V SVARDOS -o "$CDISO" "$CDROOT/boot.img"
318
 
322
 
319
# compress the ISO
323
# compress the ISO
320
zip -mj9 "$CDZIP" "$CDISO"
324
zip -mj9 "$CDZIP" "$CDISO"
321
 
325
 
322
# cleanup temporary things
326
# cleanup temporary things
323
if [ "x$2" != "xnoclean" ] ; then
327
if [ "x$2" != "xnoclean" ] ; then
324
  echo
328
  echo
325
  echo "### Cleanup of temporary directories:"
329
  echo "### Cleanup of temporary directories:"
326
  echo "# $CDROOT"
330
  echo "# $CDROOT"
327
  echo "# $FLOPROOT"
331
  echo "# $FLOPROOT"
328
  echo
332
  echo
329
  rm -rf "$CDROOT" "$FLOPROOT"
333
  rm -rf "$CDROOT" "$FLOPROOT"
330
fi
334
fi
331
 
335
 
332
cd "$origdir"
336
cd "$origdir"
333
 
337
 
334
echo
338
echo
335
echo "### ALL DONE! ###"
339
echo "### ALL DONE! ###"
336
 
340
 
337
exit 0
341
exit 0
338
 
342