Subversion Repositories SvarDOS

Rev

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

Rev 1616 Rev 1670
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-2023 Mateusz Viste
5
# Copyright (C) 2016-2024 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
REPOROOTCORE=`realpath ./packages-core`
17
REPOROOTCORE=`realpath ./packages-core`
18
CUSTFILES=`realpath ./files`
18
CUSTFILES=`realpath ./files`
19
 
19
 
20
GENISOIMAGE=''    # can be mkisofs, genisoimage or empty for autodetection
20
GENISOIMAGE=''    # can be mkisofs, genisoimage or empty for autodetection
21
 
21
 
22
### parameters block ends here ##############################################
22
### parameters block ends here ##############################################
23
 
23
 
24
# look for mandatory output dir and build id
24
# look for mandatory output dir and build id
25
if [ "x$2" == "x" ] ; then
25
if [ "x$2" == "x" ] ; then
26
  echo "usage: build.sh outputdir buildver [noclean]"
26
  echo "usage: build.sh outputdir buildver [noclean]"
27
  exit 1
27
  exit 1
28
fi
28
fi
29
CURDATE="$2"
29
CURDATE="$2"
30
PUBDIR=`realpath "$1"`
30
PUBDIR=`realpath "$1"`
31
 
31
 
32
CDROOT="$PUBDIR/tmp_cdroot.build"
32
CDROOT="$PUBDIR/tmp_cdroot.build"
33
FLOPROOT="$PUBDIR/tmp_floproot.build"
33
FLOPROOT="$PUBDIR/tmp_floproot.build"
34
 
34
 
35
 
35
 
36
# auto-detect whether to use mkisofs or genisoimage
36
# auto-detect whether to use mkisofs or genisoimage
37
 
37
 
38
if [ "x$GENISOIMAGE" == "x" ] ; then
38
if [ "x$GENISOIMAGE" == "x" ] ; then
39
mkisofs --help 2> /dev/null
39
mkisofs --help 2> /dev/null
40
if [ $? -eq 0 ] ; then
40
if [ $? -eq 0 ] ; then
41
  GENISOIMAGE='mkisofs'
41
  GENISOIMAGE='mkisofs'
42
fi
42
fi
43
fi
43
fi
44
 
44
 
45
if [ "x$GENISOIMAGE" == "x" ] ; then
45
if [ "x$GENISOIMAGE" == "x" ] ; then
46
genisoimage --help 2> /dev/null
46
genisoimage --help 2> /dev/null
47
if [ $? -eq 0 ] ; then
47
if [ $? -eq 0 ] ; then
48
  GENISOIMAGE='genisoimage'
48
  GENISOIMAGE='genisoimage'
49
fi
49
fi
50
fi
50
fi
51
 
51
 
52
if [ "x$GENISOIMAGE" == "x" ] ; then
52
if [ "x$GENISOIMAGE" == "x" ] ; then
53
  echo "ERROR: neither genisoimage nor mkisofs was found on this system"
53
  echo "ERROR: neither genisoimage nor mkisofs was found on this system"
54
  exit 1
54
  exit 1
55
fi
55
fi
56
 
56
 
57
 
57
 
58
# abort if anything fails
58
# abort if anything fails
59
set -e
59
set -e
60
 
60
 
61
 
61
 
62
# list of packages to be part of CORE (always installed)
62
# list of packages to be part of CORE (always installed)
63
COREPKGS=`ls -1 'packages-core' | grep -o '^[a-z]*'`
63
COREPKGS=`ls -1 'packages-core' | grep -o '^[a-z]*'`
64
 
64
 
65
# list of packages to be part of EXTRA (only sometimes installed, typically drivers)
65
# list of packages to be part of EXTRA (only sometimes installed, typically drivers)
66
EXTRAPKGS="pcntpk udvd2"
66
EXTRAPKGS="pcntpk udvd2"
67
 
67
 
68
# all packages
68
# all packages
69
ALLPKGS="$COREPKGS $EXTRAPKGS"
69
ALLPKGS="$COREPKGS $EXTRAPKGS"
70
 
70
 
71
 
71
 
72
# prepares image for floppy sets of:
72
# prepares image for floppy sets of:
73
# $1 cylinders
73
# $1 cylinders
74
# $2 heads (sides)
74
# $2 heads (sides)
75
# $3 sectors per track
75
# $3 sectors per track
76
# $4 size
76
# $4 size
77
# $5 working directory (for temporary files etc)
77
# $5 working directory (for temporary files etc)
78
# $6 name of the set (eg. "1440k" or "1440k-EN")
78
# $6 name of the set (eg. "1440k" or "1440k-EN")
79
# $7 where to put a copy of the image (optional)
79
# $7 where to put a copy of the image (optional)
80
function prep_flop {
80
function prep_flop {
81
  WORKDIR="$5/$6"
81
  WORKDIR="$5/$6"
82
  mkdir "$WORKDIR"
82
  mkdir "$WORKDIR"
83
  mformat -C -t $1 -h $2 -s $3 -v SVARDOS -B "$CUSTFILES/floppy.mbr" -i "$WORKDIR/disk1.img"
83
  mformat -C -t $1 -h $2 -s $3 -v SVARDOS -B "$CUSTFILES/floppy.mbr" -i "$WORKDIR/disk1.img"
84
  mcopy -sQm -i "$WORKDIR/disk1.img" "$FLOPROOT/"* ::/
84
  mcopy -sQm -i "$WORKDIR/disk1.img" "$FLOPROOT/"* ::/
85
 
85
 
86
  # now populate the floppies
86
  # now populate the floppies
87
  curdisk=1
87
  curdisk=1
88
  LIST=$ALLPKGS
88
  LIST=$ALLPKGS
89
 
89
 
90
  while [ ! -z "$LIST" ] ; do
90
  while [ ! -z "$LIST" ] ; do
91
 
91
 
92
    unset PENDING
92
    unset PENDING
93
    for p in $LIST ; do
93
    for p in $LIST ; do
94
      # if copy fails, then probably the floppy is full - try other packages
94
      # if copy fails, then probably the floppy is full - try other packages
95
      # but remember all that fails so they will be retried on a new floppy
95
      # but remember all that fails so they will be retried on a new floppy
96
      if ! mcopy -mi "$WORKDIR/disk$curdisk.img" "$CDROOT/$p.svp" ::/ ; then
96
      if ! mcopy -mi "$WORKDIR/disk$curdisk.img" "$CDROOT/$p.svp" ::/ ; then
97
        PENDING="$PENDING $p"
97
        PENDING="$PENDING $p"
98
      fi
98
      fi
99
    done
99
    done
100
 
100
 
101
    LIST="$PENDING"
101
    LIST="$PENDING"
102
    # if there are any pending items, then create a new floppy and try pushing pending packages to it
102
    # if there are any pending items, then create a new floppy and try pushing pending packages to it
103
    if [ ! -z "$PENDING" ] ; then
103
    if [ ! -z "$PENDING" ] ; then
104
      curdisk=$((curdisk+1))
104
      curdisk=$((curdisk+1))
105
      mformat -C -t $1 -h $2 -s $3 -v SVARDOS -i "$WORKDIR/disk$curdisk.img"
105
      mformat -C -t $1 -h $2 -s $3 -v SVARDOS -i "$WORKDIR/disk$curdisk.img"
106
    fi
106
    fi
107
 
107
 
108
  done
108
  done
109
 
109
 
110
  # add a short readme
110
  # add a short readme
111
  echo "This directory contains a set of $curdisk floppy images of the SvarDOS distribution in the $4 KB floppy format." > "$WORKDIR/readme.txt"
111
  echo "This directory contains a set of $curdisk floppy images of the SvarDOS distribution in the $4 KB floppy format." > "$WORKDIR/readme.txt"
112
  echo "" >> "$WORKDIR/readme.txt"
112
  echo "" >> "$WORKDIR/readme.txt"
113
  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"
113
  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"
114
  echo "" >> "$WORKDIR/readme.txt"
114
  echo "" >> "$WORKDIR/readme.txt"
115
  echo "Latest SvarDOS version is available on the project's homepage: http://svardos.org" >> "$WORKDIR/readme.txt"
115
  echo "Latest SvarDOS version is available on the project's homepage: http://svardos.org" >> "$WORKDIR/readme.txt"
116
 
116
 
117
  unix2dos "$WORKDIR/readme.txt"
117
  unix2dos "$WORKDIR/readme.txt"
118
 
118
 
119
  # make a copy of the image, if requested
119
  # make a copy of the image, if requested
120
  if [ "x$7" != "x" ] ; then
120
  if [ "x$7" != "x" ] ; then
121
    cp "$WORKDIR/disk1.img" $7
121
    cp "$WORKDIR/disk1.img" $7
122
  fi
122
  fi
123
 
123
 
124
  # zip the images (and remove them at the same time)
124
  # zip the images (and remove them at the same time)
125
  zip -9 -rmj "$PUBDIR/svardos-$CURDATE-floppy-$6.zip" "$WORKDIR"/*
125
  zip -9 -rmj "$PUBDIR/svardos-$CURDATE-floppy-$6.zip" "$WORKDIR"/*
126
 
126
 
127
  # clean up
127
  # clean up
128
  rmdir "$WORKDIR"
128
  rmdir "$WORKDIR"
129
}
129
}
130
 
130
 
131
 
131
 
132
### actual code flow starts here ############################################
132
### actual code flow starts here ############################################
133
 
133
 
134
# remember where I am, so I can get back here once all is done
134
# remember where I am, so I can get back here once all is done
135
origdir=`pwd`
135
origdir=`pwd`
136
 
136
 
137
echo "###############################################################################"
137
echo "###############################################################################"
138
echo " STARTING BUILD $CURDATE"
138
echo " STARTING BUILD $CURDATE"
139
echo "###############################################################################"
139
echo "###############################################################################"
140
echo "dest dir: $PUBDIR"
140
echo "dest dir: $PUBDIR"
141
echo "current time is `date` and it's a beautiful day somewhere in the world"
141
echo "current time is `date` and it's a beautiful day somewhere in the world"
142
echo
142
echo
143
 
143
 
144
mkdir "$CDROOT"
144
mkdir "$CDROOT"
145
mkdir "$FLOPROOT"
145
mkdir "$FLOPROOT"
146
 
146
 
147
# add CORE packages to CDROOT + create the list of packages on floppy
147
# add CORE packages to CDROOT + create the list of packages on floppy
148
for pkg in $COREPKGS ; do
148
for pkg in $COREPKGS ; do
149
  cp "$REPOROOTCORE/$pkg.svp" "$CDROOT/"
149
  cp "$REPOROOTCORE/$pkg.svp" "$CDROOT/"
150
  echo "$pkg" >> "$FLOPROOT/install.lst"
150
  echo "$pkg" >> "$FLOPROOT/install.lst"
151
done
151
done
152
 
152
 
153
# add EXTRA packages to CDROOT (but not in the list of packages to install)
153
# add EXTRA packages to CDROOT (but not in the list of packages to install)
154
for pkg in $EXTRAPKGS ; do
154
for pkg in $EXTRAPKGS ; do
155
  cp "$REPOROOT/$pkg.svp" "$CDROOT/"
155
  cp "$REPOROOT/$pkg.svp" "$CDROOT/"
156
done
156
done
157
 
157
 
158
 
158
 
159
echo
159
echo
160
echo "### Populating the floppy root at $FLOPROOT"
160
echo "### Populating the floppy root at $FLOPROOT"
161
echo
161
echo
162
 
162
 
163
# prepare the content of the boot (install) floppy, unzipping everything
163
# prepare the content of the boot (install) floppy, unzipping everything
164
# in lowercase (-L) to avoid any case mismatching later in the build process
164
# in lowercase (-L) to avoid any case mismatching later in the build process
165
cp -r "$CUSTFILES/floppy/"* "$FLOPROOT/"
165
cp -r "$CUSTFILES/floppy/"* "$FLOPROOT/"
166
unzip -CLj "$REPOROOTCORE/cpidos.svp" 'cpi/ega*.cpx' -d "$FLOPROOT/"
166
unzip -CLj "$REPOROOTCORE/cpidos.svp" 'cpi/ega*.cpx' -d "$FLOPROOT/"
167
unzip -CLj "$REPOROOTCORE/svarcom.svp" command.com -d "$FLOPROOT/"
167
unzip -CLj "$REPOROOTCORE/svarcom.svp" command.com -d "$FLOPROOT/"
168
unzip -CLj "$REPOROOTCORE/display.svp" bin/display.exe -d "$FLOPROOT/"
168
unzip -CLj "$REPOROOTCORE/display.svp" bin/display.exe -d "$FLOPROOT/"
169
unzip -CLj "$REPOROOTCORE/fdapm.svp" bin/fdapm.com -d "$FLOPROOT/"
169
unzip -CLj "$REPOROOTCORE/fdapm.svp" bin/fdapm.com -d "$FLOPROOT/"
170
unzip -CLj "$REPOROOTCORE/fdisk.svp" bin/fdisk.exe -d "$FLOPROOT/"
170
unzip -CLj "$REPOROOTCORE/fdisk.svp" bin/fdisk.exe -d "$FLOPROOT/"
171
unzip -CLj "$REPOROOTCORE/format.svp" bin/format.exe -d "$FLOPROOT/"
171
unzip -CLj "$REPOROOTCORE/format.svp" bin/format.exe -d "$FLOPROOT/"
172
unzip -CLj "$REPOROOTCORE/kernel.svp" bin/kernel.sys bin/sys.com -d "$FLOPROOT/"
172
unzip -CLj "$REPOROOTCORE/kernel.svp" bin/kernel.sys bin/sys.com -d "$FLOPROOT/"
173
unzip -CLj "$REPOROOTCORE/mem.svp" bin/mem.exe -d "$FLOPROOT/"
173
unzip -CLj "$REPOROOTCORE/mem.svp" bin/mem.exe -d "$FLOPROOT/"
174
unzip -CLj "$REPOROOTCORE/mode.svp" bin/mode.com -d "$FLOPROOT/"
174
unzip -CLj "$REPOROOTCORE/mode.svp" bin/mode.com -d "$FLOPROOT/"
175
unzip -CLj "$REPOROOTCORE/more.svp" bin/more.com -d "$FLOPROOT/"
175
unzip -CLj "$REPOROOTCORE/more.svp" bin/more.com -d "$FLOPROOT/"
176
unzip -CLj "$REPOROOTCORE/pkg.svp" bin/pkg.exe -d "$FLOPROOT/"
176
unzip -CLj "$REPOROOTCORE/pkg.svp" bin/pkg.exe -d "$FLOPROOT/"
177
unzip -CLj "$REPOROOTCORE/sved.svp" bin/sved.com -d "$FLOPROOT/"
177
unzip -CLj "$REPOROOTCORE/sved.svp" bin/sved.com -d "$FLOPROOT/"
178
 
178
 
179
# generate a simple autoexec.bat file
179
# generate a simple autoexec.bat file
180
echo '@ECHO OFF' > "$FLOPROOT/autoexec.bat"
180
echo '@ECHO OFF' > "$FLOPROOT/autoexec.bat"
181
echo '' >> "$FLOPROOT/autoexec.bat"
181
echo '' >> "$FLOPROOT/autoexec.bat"
182
echo 'REM Load DISPLAY driver if present' >> "$FLOPROOT/autoexec.bat"
182
echo 'REM Load DISPLAY driver if present' >> "$FLOPROOT/autoexec.bat"
183
echo 'IF EXIST DISPLAY.EXE DISPLAY CON=(EGA,,1)' >> "$FLOPROOT/autoexec.bat"
183
echo 'IF EXIST DISPLAY.EXE DISPLAY CON=(EGA,,1)' >> "$FLOPROOT/autoexec.bat"
184
echo '' >> "$FLOPROOT/autoexec.bat"
184
echo '' >> "$FLOPROOT/autoexec.bat"
185
echo 'FDAPM APMDOS' >> "$FLOPROOT/autoexec.bat"
185
echo 'FDAPM APMDOS' >> "$FLOPROOT/autoexec.bat"
186
echo '' >> "$FLOPROOT/autoexec.bat"
186
echo '' >> "$FLOPROOT/autoexec.bat"
187
echo 'ECHO.' >> "$FLOPROOT/autoexec.bat"
187
echo 'ECHO.' >> "$FLOPROOT/autoexec.bat"
188
echo 'ECHO  ********************' >> "$FLOPROOT/autoexec.bat"
188
echo 'ECHO  ********************' >> "$FLOPROOT/autoexec.bat"
189
echo 'ECHO   WELCOME TO SVARDOS' >> "$FLOPROOT/autoexec.bat"
189
echo 'ECHO   WELCOME TO SVARDOS' >> "$FLOPROOT/autoexec.bat"
190
echo 'ECHO  ********************' >> "$FLOPROOT/autoexec.bat"
190
echo 'ECHO  ********************' >> "$FLOPROOT/autoexec.bat"
191
echo "ECHO  build: $CURDATE" >> "$FLOPROOT/autoexec.bat"
191
echo "ECHO  build: $CURDATE" >> "$FLOPROOT/autoexec.bat"
192
echo 'ECHO.' >> "$FLOPROOT/autoexec.bat"
192
echo 'ECHO.' >> "$FLOPROOT/autoexec.bat"
193
echo '' >> "$FLOPROOT/autoexec.bat"
193
echo '' >> "$FLOPROOT/autoexec.bat"
194
echo "INSTALL $CURDATE" >> "$FLOPROOT/autoexec.bat"
194
echo "INSTALL $CURDATE" >> "$FLOPROOT/autoexec.bat"
195
unix2dos "$FLOPROOT/autoexec.bat"
195
unix2dos "$FLOPROOT/autoexec.bat"
196
 
196
 
197
 
197
 
198
echo
198
echo
199
echo "### Computing the USB image"
199
echo "### Computing the USB image"
200
echo
200
echo
201
 
201
 
202
# prepare the USB bootable image
202
# prepare the USB bootable image
203
USBIMG=$PUBDIR/svardos-usb.img
203
USBIMG=$PUBDIR/svardos-usb.img
204
cp files/boot-svardos.img $USBIMG
204
cp files/boot-svardos.img $USBIMG
205
mcopy -sQm -i "$USBIMG@@32256" "$FLOPROOT/"* ::/
205
mcopy -sQm -i "$USBIMG@@32256" "$FLOPROOT/"* ::/
206
for p in $ALLPKGS ; do
206
for p in $ALLPKGS ; do
207
  mcopy -mi "$USBIMG@@32256" "$CDROOT/$p.svp" ::/
207
  mcopy -mi "$USBIMG@@32256" "$CDROOT/$p.svp" ::/
208
done
208
done
209
 
209
 
210
# compress the USB image
210
# compress the USB image
211
zip -mj9 "$PUBDIR/svardos-$CURDATE-usb.zip" "$USBIMG"
211
zip -mj9 "$PUBDIR/svardos-$CURDATE-usb.zip" "$USBIMG"
212
 
212
 
213
 
213
 
214
echo
214
echo
215
echo "### Creating floppy images"
215
echo "### Creating floppy images"
216
echo
216
echo
217
echo "You might notice a lot of DISK FULL warnings below. Do not worry, these"
217
echo "You might notice a lot of DISK FULL warnings below. Do not worry, these"
218
echo "are expected and are perfectly normal. It is a side effect of trying to"
218
echo "are expected and are perfectly normal. It is a side effect of trying to"
219
echo "fit as many packages as possible on the floppy sets."
219
echo "fit as many packages as possible on the floppy sets."
220
echo
220
echo
221
 
221
 
222
# build the boot (CD) floppy image
222
# build the boot (CD) floppy image
223
export MTOOLS_NO_VFAT=1
223
export MTOOLS_NO_VFAT=1
224
 
224
 
225
# prepare images for floppies in different sizes (args are C H S SIZE)
225
# prepare images for floppies in different sizes (args are C H S SIZE)
226
prep_flop 80 2 36 2880 "$PUBDIR" "2.88M" "$CDROOT/boot.img"
226
prep_flop 80 2 36 2880 "$PUBDIR" "2.88M" "$CDROOT/boot.img"
227
prep_flop 80 2 18 1440 "$PUBDIR" "1.44M"
227
prep_flop 80 2 18 1440 "$PUBDIR" "1.44M"
228
prep_flop 80 2 15 1200 "$PUBDIR" "1.2M"
228
prep_flop 80 2 15 1200 "$PUBDIR" "1.2M"
229
prep_flop 80 2  9  720 "$PUBDIR" "720K"
229
prep_flop 80 2  9  720 "$PUBDIR" "720K"
230
 
230
 
231
 
231
 
232
echo
232
echo
233
echo "### Computing DOSEMU.zip"
233
echo "### Computing DOSEMU.zip"
234
echo
234
echo
235
 
235
 
236
# prepare the DOSEMU boot zip
236
# prepare the DOSEMU boot zip
237
DOSEMUDIR="$PUBDIR/tmp_dosemu-prep-files.build"
237
DOSEMUDIR="$PUBDIR/tmp_dosemu-prep-files.build"
238
mkdir "$DOSEMUDIR"
238
mkdir "$DOSEMUDIR"
239
# INSTALL.BAT
239
# INSTALL.BAT
240
echo 'IF NOT EXIST C:\TEMP\NUL MKDIR C:\TEMP' >> "$DOSEMUDIR/install.bat"
240
echo 'IF NOT EXIST C:\TEMP\NUL MKDIR C:\TEMP' >> "$DOSEMUDIR/install.bat"
241
echo 'mkdir %DOSDIR%' >> "$DOSEMUDIR/install.bat"
241
echo 'mkdir %DOSDIR%' >> "$DOSEMUDIR/install.bat"
242
echo 'mkdir %DOSDIR%\cfg' >> "$DOSEMUDIR/install.bat"
242
echo 'mkdir %DOSDIR%\cfg' >> "$DOSEMUDIR/install.bat"
243
echo 'ECHO # pkg config file - specifies locations where packages should be installed >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
243
echo 'ECHO # pkg config file - specifies locations where packages should be installed >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
-
 
244
echo 'ECHO DIR BIN %DOSDIR% >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
244
echo 'ECHO DIR PROGS C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
245
echo 'ECHO DIR PROGS C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
245
echo 'ECHO DIR GAMES C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
246
echo 'ECHO DIR GAMES C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
246
echo 'ECHO DIR DRIVERS C:\DRIVERS\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
247
echo 'ECHO DIR DRIVERS C:\DRIVERS\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
247
echo 'ECHO DIR DEVEL C:\DEVEL\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
248
echo 'ECHO DIR DEVEL C:\DEVEL\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
248
for p in $COREPKGS ; do
249
for p in $COREPKGS ; do
249
  cp "$CDROOT/$p.svp" "$DOSEMUDIR/"
250
  cp "$CDROOT/$p.svp" "$DOSEMUDIR/"
250
  echo "pkg install $p.svp" >> "$DOSEMUDIR/install.bat"
251
  echo "pkg install $p.svp" >> "$DOSEMUDIR/install.bat"
251
  echo "del $p.svp" >> "$DOSEMUDIR/install.bat"
252
  echo "del $p.svp" >> "$DOSEMUDIR/install.bat"
252
done
253
done
253
echo 'ECHO my_ip = dhcp >> %DOSDIR%\CFG\WATTCP.CFG' >> "$DOSEMUDIR/install.bat"
254
echo 'ECHO my_ip = dhcp >> %DOSDIR%\CFG\WATTCP.CFG' >> "$DOSEMUDIR/install.bat"
254
echo 'del pkg.exe' >> "$DOSEMUDIR/install.bat"
255
echo 'del pkg.exe' >> "$DOSEMUDIR/install.bat"
255
echo 'DEL C:\CONFIG.SYS' >> "$DOSEMUDIR/install.bat"
256
echo 'DEL C:\CONFIG.SYS' >> "$DOSEMUDIR/install.bat"
256
echo 'COPY C:\CONFIG.NEW C:\CONFIG.SYS' >> "$DOSEMUDIR/install.bat"
257
echo 'COPY C:\CONFIG.NEW C:\CONFIG.SYS' >> "$DOSEMUDIR/install.bat"
257
echo 'DEL C:\CONFIG.NEW' >> "$DOSEMUDIR/install.bat"
258
echo 'DEL C:\CONFIG.NEW' >> "$DOSEMUDIR/install.bat"
258
echo 'SET COMSPEC=C:\COMMAND.COM' >> "$DOSEMUDIR/install.bat"
259
echo 'SET COMSPEC=C:\COMMAND.COM' >> "$DOSEMUDIR/install.bat"
259
echo 'DEL C:\CMD.COM' >> "$DOSEMUDIR/install.bat"
260
echo 'DEL C:\CMD.COM' >> "$DOSEMUDIR/install.bat"
260
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
261
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
261
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
262
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
262
echo 'ECHO  SVARDOS SETUP COMPLETED' >> "$DOSEMUDIR/install.bat"
263
echo 'ECHO  SVARDOS SETUP COMPLETED' >> "$DOSEMUDIR/install.bat"
263
echo 'ECHO   PLEASE RESTART DOSEMU' >> "$DOSEMUDIR/install.bat"
264
echo 'ECHO   PLEASE RESTART DOSEMU' >> "$DOSEMUDIR/install.bat"
264
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
265
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
265
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
266
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
266
unzip -Cj "$REPOROOTCORE/kernel.svp" bin/kernel.sys -d "$DOSEMUDIR/"
267
unzip -Cj "$REPOROOTCORE/kernel.svp" bin/kernel.sys -d "$DOSEMUDIR/"
267
unzip -CLj "$REPOROOTCORE/svarcom.svp" command.com -d "$DOSEMUDIR/"
268
unzip -CLj "$REPOROOTCORE/svarcom.svp" command.com -d "$DOSEMUDIR/"
268
mv "$DOSEMUDIR/command.com" "$DOSEMUDIR/cmd.com"
269
mv "$DOSEMUDIR/command.com" "$DOSEMUDIR/cmd.com"
269
unzip -Cj "$REPOROOTCORE/pkg.svp" bin/pkg.exe -d "$DOSEMUDIR/"
270
unzip -Cj "$REPOROOTCORE/pkg.svp" bin/pkg.exe -d "$DOSEMUDIR/"
270
# CONFIG.SYS
271
# CONFIG.SYS
271
echo 'FILES=25' >> "$DOSEMUDIR/config.sys"
272
echo 'FILES=25' >> "$DOSEMUDIR/config.sys"
272
echo 'DOS=HIGH,UMB' >> "$DOSEMUDIR/config.sys"
273
echo 'DOS=HIGH,UMB' >> "$DOSEMUDIR/config.sys"
273
echo 'DOSDATA=UMB' >> "$DOSEMUDIR/config.sys"
274
echo 'DOSDATA=UMB' >> "$DOSEMUDIR/config.sys"
274
echo 'DEVICE=D:\dosemu\emufs.sys' >> "$DOSEMUDIR/config.sys"
275
echo 'DEVICE=D:\dosemu\emufs.sys' >> "$DOSEMUDIR/config.sys"
275
echo 'DEVICE=D:\dosemu\umb.sys' >> "$DOSEMUDIR/config.sys"
276
echo 'DEVICE=D:\dosemu\umb.sys' >> "$DOSEMUDIR/config.sys"
276
echo 'DEVICEHIGH=D:\dosemu\ems.sys' >> "$DOSEMUDIR/config.sys"
277
echo 'DEVICEHIGH=D:\dosemu\ems.sys' >> "$DOSEMUDIR/config.sys"
277
echo 'INSTALL=D:\dosemu\emufs.com' >> "$DOSEMUDIR/config.sys"
278
echo 'INSTALL=D:\dosemu\emufs.com' >> "$DOSEMUDIR/config.sys"
278
cp "$DOSEMUDIR/config.sys" "$DOSEMUDIR/config.new"
279
cp "$DOSEMUDIR/config.sys" "$DOSEMUDIR/config.new"
279
echo 'SHELL=C:\CMD.COM /P' >> "$DOSEMUDIR/config.sys"
280
echo 'SHELL=C:\CMD.COM /P' >> "$DOSEMUDIR/config.sys"
280
echo 'SHELL=C:\COMMAND.COM /P' >> "$DOSEMUDIR/config.new"
281
echo 'SHELL=C:\COMMAND.COM /P' >> "$DOSEMUDIR/config.new"
281
# AUTOEXEC.BAT
282
# AUTOEXEC.BAT
282
echo "@ECHO OFF" >> "$DOSEMUDIR/autoexec.bat"
283
echo "@ECHO OFF" >> "$DOSEMUDIR/autoexec.bat"
283
echo 'SET DOSDIR=C:\SVARDOS' >> "$DOSEMUDIR/autoexec.bat"
284
echo 'SET DOSDIR=C:\SVARDOS' >> "$DOSEMUDIR/autoexec.bat"
284
echo 'SET WATTCP.CFG=%DOSDIR%\CFG' >> "$DOSEMUDIR/autoexec.bat"
285
echo 'SET WATTCP.CFG=%DOSDIR%\CFG' >> "$DOSEMUDIR/autoexec.bat"
285
echo 'SET DIRCMD=/p/ogne' >> "$DOSEMUDIR/autoexec.bat"
286
echo 'SET DIRCMD=/p/ogne' >> "$DOSEMUDIR/autoexec.bat"
286
echo 'SET TEMP=C:\TEMP' >> "$DOSEMUDIR/autoexec.bat"
287
echo 'SET TEMP=C:\TEMP' >> "$DOSEMUDIR/autoexec.bat"
287
echo 'PATH %DOSDIR%\BIN' >> "$DOSEMUDIR/autoexec.bat"
288
echo 'PATH %DOSDIR%' >> "$DOSEMUDIR/autoexec.bat"
288
echo "" >> "$DOSEMUDIR/autoexec.bat"
289
echo "" >> "$DOSEMUDIR/autoexec.bat"
289
echo 'IF NOT EXIST INSTALL.BAT GOTO NORMBOOT' >> "$DOSEMUDIR/autoexec.bat"
290
echo 'IF NOT EXIST INSTALL.BAT GOTO NORMBOOT' >> "$DOSEMUDIR/autoexec.bat"
290
echo "REM *** this is a one-time setup script used only during first initialization ***" >> "$DOSEMUDIR/autoexec.bat"
291
echo "REM *** this is a one-time setup script used only during first initialization ***" >> "$DOSEMUDIR/autoexec.bat"
291
echo 'CALL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
292
echo 'CALL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
292
echo 'DEL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
293
echo 'DEL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
293
echo 'GOTO ENDOFFILE' >> "$DOSEMUDIR/autoexec.bat"
294
echo 'GOTO ENDOFFILE' >> "$DOSEMUDIR/autoexec.bat"
294
echo "" >> "$DOSEMUDIR/autoexec.bat"
295
echo "" >> "$DOSEMUDIR/autoexec.bat"
295
echo ":NORMBOOT" >> "$DOSEMUDIR/autoexec.bat"
296
echo ":NORMBOOT" >> "$DOSEMUDIR/autoexec.bat"
296
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
297
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
297
echo "ECHO Welcome to SvarDOS (powered by DOSEMU)! Type HELP if you are lost." >> "$DOSEMUDIR/autoexec.bat"
298
echo "ECHO Welcome to SvarDOS (powered by DOSEMU)! Type HELP if you are lost." >> "$DOSEMUDIR/autoexec.bat"
298
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
299
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
299
echo ":ENDOFFILE" >> "$DOSEMUDIR/autoexec.bat"
300
echo ":ENDOFFILE" >> "$DOSEMUDIR/autoexec.bat"
300
rm -f "$PUBDIR/svardos-dosemu.zip"
301
rm -f "$PUBDIR/svardos-dosemu.zip"
301
zip -rm9jk "$PUBDIR/svardos-$CURDATE-dosemu.zip" "$DOSEMUDIR"
302
zip -rm9jk "$PUBDIR/svardos-$CURDATE-dosemu.zip" "$DOSEMUDIR"
302
rmdir "$DOSEMUDIR"
303
rmdir "$DOSEMUDIR"
303
 
304
 
304
echo
305
echo
305
echo "### Generating ISO CD image"
306
echo "### Generating ISO CD image"
306
echo
307
echo
307
 
308
 
308
CDISO="$PUBDIR/svardos-$CURDATE-cd.iso"
309
CDISO="$PUBDIR/svardos-$CURDATE-cd.iso"
309
CDZIP="$PUBDIR/svardos-$CURDATE-cd.zip"
310
CDZIP="$PUBDIR/svardos-$CURDATE-cd.zip"
310
 
311
 
311
$GENISOIMAGE -input-charset cp437 -b boot.img -iso-level 1 -f -V SVARDOS -o "$CDISO" "$CDROOT/boot.img"
312
$GENISOIMAGE -input-charset cp437 -b boot.img -iso-level 1 -f -V SVARDOS -o "$CDISO" "$CDROOT/boot.img"
312
 
313
 
313
# compress the ISO
314
# compress the ISO
314
zip -mj9 "$CDZIP" "$CDISO"
315
zip -mj9 "$CDZIP" "$CDISO"
315
 
316
 
316
 
317
 
317
###############################################################################
318
###############################################################################
318
# remove internationalization files for EN-ONLY releases. This is the only    #
319
# remove internationalization files for EN-ONLY releases. This is the only    #
319
# way to build the 360K variant                                               #
320
# way to build the 360K variant                                               #
320
###############################################################################
321
###############################################################################
321
 
322
 
322
rm "$FLOPROOT"/*.cpx
323
rm "$FLOPROOT"/*.cpx
323
rm "$FLOPROOT"/install.lng
324
rm "$FLOPROOT"/install.lng
324
rm "$FLOPROOT"/display.exe
325
rm "$FLOPROOT"/display.exe
325
rm "$FLOPROOT"/mode.com
326
rm "$FLOPROOT"/mode.com
326
 
327
 
327
###############################################################################
328
###############################################################################
328
# remove NLS and LNG files from packages to build EN-ONLY builds              #
329
# remove NLS and LNG files from packages to build EN-ONLY builds              #
329
###############################################################################
330
###############################################################################
330
 
331
 
331
echo "### remove NLS and LNG files from packages to build EN-ONLY builds"
332
echo "### remove NLS and LNG files from packages to build EN-ONLY builds"
332
for p in $COREPKGS ; do
333
for p in $COREPKGS ; do
333
  # the || true bit is because zip returns a non-zero exit code on no file match
334
  # the || true bit is because zip returns a non-zero exit code on no file match
334
  zip -dq "$CDROOT/$p.svp" 'bin/*.lng' 'BIN/*.LNG' 'nls/*' 'NLS/*' || true
335
  zip -dq "$CDROOT/$p.svp" 'bin/*.lng' 'BIN/*.LNG' 'nls/*' 'NLS/*' || true
335
done
336
done
336
 
337
 
337
prep_flop 80 2 18 1440 "$PUBDIR" "1.44M-EN_ONLY"
338
prep_flop 80 2 18 1440 "$PUBDIR" "1.44M-EN_ONLY"
338
#prep_flop 80 2 21 1680 "$PUBDIR" "1.44M-DMF-EN_ONLY"
339
#prep_flop 80 2 21 1680 "$PUBDIR" "1.44M-DMF-EN_ONLY"
339
prep_flop 80 2 15 1200 "$PUBDIR" "1.2M-EN_ONLY"
340
prep_flop 80 2 15 1200 "$PUBDIR" "1.2M-EN_ONLY"
340
prep_flop 80 2  9  720 "$PUBDIR" "720K-EN_ONLY"
341
prep_flop 80 2  9  720 "$PUBDIR" "720K-EN_ONLY"
341
prep_flop 40 2  9  360 "$PUBDIR" "360K-EN_ONLY"
342
prep_flop 40 2  9  360 "$PUBDIR" "360K-EN_ONLY"
342
 
343
 
343
 
344
 
344
###############################################################################
345
###############################################################################
345
# cleanup all temporary things                                                #
346
# cleanup all temporary things                                                #
346
###############################################################################
347
###############################################################################
347
 
348
 
348
if [ "x$2" != "xnoclean" ] ; then
349
if [ "x$2" != "xnoclean" ] ; then
349
  echo
350
  echo
350
  echo "### Cleanup of temporary directories:"
351
  echo "### Cleanup of temporary directories:"
351
  echo "# $CDROOT"
352
  echo "# $CDROOT"
352
  echo "# $FLOPROOT"
353
  echo "# $FLOPROOT"
353
  echo
354
  echo
354
  rm -rf "$CDROOT" "$FLOPROOT"
355
  rm -rf "$CDROOT" "$FLOPROOT"
355
fi
356
fi
356
 
357
 
357
cd "$origdir"
358
cd "$origdir"
358
 
359
 
359
echo
360
echo
360
echo "### ALL DONE! ###"
361
echo "### ALL DONE! ###"
361
 
362
 
362
exit 0
363
exit 0
363
 
364