Subversion Repositories SvarDOS

Rev

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

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