Subversion Repositories SvarDOS

Rev

Rev 1888 | Rev 1922 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
134 mv_fox 1
#!/bin/bash
11 mv_fox 2
#
180 mateuszvis 3
# SvarDOS build script
791 mateusz.vi 4
# http://svardos.org
1698 mateusz.vi 5
#
1670 mateusz.vi 6
# Copyright (C) 2016-2024 Mateusz Viste
148 mv_fox 7
#
847 mateusz.vi 8
# This script builds floppy and CD images. It should be executed each time that
852 mateusz.vi 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.
11 mv_fox 11
#
854 mateusz.vi 12
# usage: ./build.sh outputdir buildver [noclean] > logfile
194 mateuszvis 13
#
2 mv_fox 14
 
11 mv_fox 15
### parameters block starts here ############################################
16
 
632 mateusz.vi 17
REPOROOT=`realpath ./packages`
1261 mateusz.vi 18
REPOROOTCORE=`realpath ./packages-core`
148 mv_fox 19
CUSTFILES=`realpath ./files`
2 mv_fox 20
 
171 mv_fox 21
GENISOIMAGE=''    # can be mkisofs, genisoimage or empty for autodetection
22
 
11 mv_fox 23
### parameters block ends here ##############################################
24
 
854 mateusz.vi 25
# look for mandatory output dir and build id
26
if [ "x$2" == "x" ] ; then
27
  echo "usage: build.sh outputdir buildver [noclean]"
836 mateusz.vi 28
  exit 1
29
fi
854 mateusz.vi 30
CURDATE="$2"
31
PUBDIR=`realpath "$1"`
836 mateusz.vi 32
 
33
CDROOT="$PUBDIR/tmp_cdroot.build"
34
FLOPROOT="$PUBDIR/tmp_floproot.build"
35
 
36
 
171 mv_fox 37
# auto-detect whether to use mkisofs or genisoimage
38
 
39
if [ "x$GENISOIMAGE" == "x" ] ; then
180 mateuszvis 40
mkisofs --help 2> /dev/null
171 mv_fox 41
if [ $? -eq 0 ] ; then
42
  GENISOIMAGE='mkisofs'
43
fi
44
fi
45
 
46
if [ "x$GENISOIMAGE" == "x" ] ; then
180 mateuszvis 47
genisoimage --help 2> /dev/null
171 mv_fox 48
if [ $? -eq 0 ] ; then
49
  GENISOIMAGE='genisoimage'
50
fi
51
fi
52
 
53
if [ "x$GENISOIMAGE" == "x" ] ; then
54
  echo "ERROR: neither genisoimage nor mkisofs was found on this system"
55
  exit 1
56
fi
57
 
1809 bernd.boec 58
SED='sed'
59
if [ `uname` == "Darwin" ] ; then
60
  SED='gsed'
61
fi
171 mv_fox 62
 
180 mateuszvis 63
# abort if anything fails
64
set -e
134 mv_fox 65
 
66
 
1920 mateusz.vi 67
# list of packages to be part of CORE (always installed), sort them from
68
# biggest to smallest to try utilizing the floppy disk space as efficiently
69
# as possible. -L means 'dereference', ie. look at the filesize of the target
70
# file, not the symlink.
71
COREPKGS=`ls -1LS 'packages-core' | grep -o '^[a-zA-Z0-9]*'`
192 mateuszvis 72
 
73
 
74
 
246 mateuszvis 75
# prepares image for floppy sets of:
76
# $1 cylinders
77
# $2 heads (sides)
78
# $3 sectors per track
79
# $4 size
849 mateusz.vi 80
# $5 working directory (for temporary files etc)
1527 mateusz.vi 81
# $6 name of the set (eg. "1440k" or "1440k-EN")
1750 mateusz.vi 82
# $7 list of packages
83
# $8 where to put a copy of the image (optional)
194 mateuszvis 84
function prep_flop {
1527 mateusz.vi 85
  WORKDIR="$5/$6"
1750 mateusz.vi 86
  LIST=$7
849 mateusz.vi 87
  mkdir "$WORKDIR"
1671 mateusz.vi 88
  mformat -C -t $1 -h $2 -s $3 -v $CURDATE -B "$CUSTFILES/floppy.mbr" -i "$WORKDIR/disk1.img"
849 mateusz.vi 89
  mcopy -sQm -i "$WORKDIR/disk1.img" "$FLOPROOT/"* ::/
196 mateuszvis 90
 
91
  # now populate the floppies
92
  curdisk=1
1127 mateusz.vi 93
 
94
  while [ ! -z "$LIST" ] ; do
95
 
96
    unset PENDING
97
    for p in $LIST ; do
98
      # if copy fails, then probably the floppy is full - try other packages
99
      # but remember all that fails so they will be retried on a new floppy
100
      if ! mcopy -mi "$WORKDIR/disk$curdisk.img" "$CDROOT/$p.svp" ::/ ; then
101
        PENDING="$PENDING $p"
102
      fi
103
    done
104
 
105
    LIST="$PENDING"
106
    # if there are any pending items, then create a new floppy and try pushing pending packages to it
107
    if [ ! -z "$PENDING" ] ; then
196 mateuszvis 108
      curdisk=$((curdisk+1))
849 mateusz.vi 109
      mformat -C -t $1 -h $2 -s $3 -v SVARDOS -i "$WORKDIR/disk$curdisk.img"
196 mateuszvis 110
    fi
1127 mateusz.vi 111
 
194 mateuszvis 112
  done
196 mateuszvis 113
 
205 mateuszvis 114
  # add a short readme
849 mateusz.vi 115
  echo "This directory contains a set of $curdisk floppy images of the SvarDOS distribution in the $4 KB floppy format." > "$WORKDIR/readme.txt"
116
  echo "" >> "$WORKDIR/readme.txt"
117
  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"
118
  echo "" >> "$WORKDIR/readme.txt"
862 mateusz.vi 119
  echo "Latest SvarDOS version is available on the project's homepage: http://svardos.org" >> "$WORKDIR/readme.txt"
205 mateuszvis 120
 
849 mateusz.vi 121
  unix2dos "$WORKDIR/readme.txt"
205 mateuszvis 122
 
279 mateuszvis 123
  # make a copy of the image, if requested
1750 mateusz.vi 124
  if [ "x$8" != "x" ] ; then
125
    cp "$WORKDIR/disk1.img" $8
279 mateuszvis 126
  fi
127
 
196 mateuszvis 128
  # zip the images (and remove them at the same time)
1527 mateusz.vi 129
  zip -9 -rmj "$PUBDIR/svardos-$CURDATE-floppy-$6.zip" "$WORKDIR"/*
196 mateuszvis 130
 
131
  # clean up
849 mateusz.vi 132
  rmdir "$WORKDIR"
194 mateuszvis 133
}
134
 
135
 
134 mv_fox 136
### actual code flow starts here ############################################
137
 
148 mv_fox 138
# remember where I am, so I can get back here once all is done
11 mv_fox 139
origdir=`pwd`
140
 
836 mateusz.vi 141
echo "###############################################################################"
142
echo " STARTING BUILD $CURDATE"
143
echo "###############################################################################"
144
echo "dest dir: $PUBDIR"
145
echo "current time is `date` and it's a beautiful day somewhere in the world"
146
echo
147
 
189 mateuszvis 148
mkdir "$CDROOT"
192 mateuszvis 149
mkdir "$FLOPROOT"
189 mateuszvis 150
 
192 mateuszvis 151
# add CORE packages to CDROOT + create the list of packages on floppy
195 mateuszvis 152
for pkg in $COREPKGS ; do
1261 mateusz.vi 153
  cp "$REPOROOTCORE/$pkg.svp" "$CDROOT/"
192 mateuszvis 154
  echo "$pkg" >> "$FLOPROOT/install.lst"
155
done
156
 
1750 mateusz.vi 157
# add some extra packages to CDROOT but not in the list of packages to install
158
cp "$REPOROOT/pcntpk.svp" "$CDROOT/"
159
cp "$REPOROOT/videcdd-2.14.svp" "$CDROOT/videcdd.svp"
300 mateuszvis 160
 
1750 mateusz.vi 161
#
300 mateuszvis 162
 
1750 mateusz.vi 163
 
836 mateusz.vi 164
echo
165
echo "### Populating the floppy root at $FLOPROOT"
166
echo
167
 
862 mateusz.vi 168
# prepare the content of the boot (install) floppy, unzipping everything
169
# in lowercase (-L) to avoid any case mismatching later in the build process
192 mateuszvis 170
cp -r "$CUSTFILES/floppy/"* "$FLOPROOT/"
1261 mateusz.vi 171
unzip -CLj "$REPOROOTCORE/cpidos.svp" 'cpi/ega*.cpx' -d "$FLOPROOT/"
172
unzip -CLj "$REPOROOTCORE/svarcom.svp" command.com -d "$FLOPROOT/"
173
unzip -CLj "$REPOROOTCORE/display.svp" bin/display.exe -d "$FLOPROOT/"
174
unzip -CLj "$REPOROOTCORE/fdapm.svp" bin/fdapm.com -d "$FLOPROOT/"
1478 mateusz.vi 175
unzip -CLj "$REPOROOTCORE/fdisk.svp" bin/fdisk.exe -d "$FLOPROOT/"
1261 mateusz.vi 176
unzip -CLj "$REPOROOTCORE/format.svp" bin/format.exe -d "$FLOPROOT/"
1833 mateusz.vi 177
unzip -CLj "$REPOROOTCORE/kernledr.svp" kernel.sys -d "$FLOPROOT/"
1261 mateusz.vi 178
unzip -CLj "$REPOROOTCORE/mem.svp" bin/mem.exe -d "$FLOPROOT/"
179
unzip -CLj "$REPOROOTCORE/mode.svp" bin/mode.com -d "$FLOPROOT/"
1499 mateusz.vi 180
unzip -CLj "$REPOROOTCORE/more.svp" bin/more.com -d "$FLOPROOT/"
1261 mateusz.vi 181
unzip -CLj "$REPOROOTCORE/pkg.svp" bin/pkg.exe -d "$FLOPROOT/"
1465 mateusz.vi 182
unzip -CLj "$REPOROOTCORE/sved.svp" bin/sved.com -d "$FLOPROOT/"
1809 bernd.boec 183
unzip -CLj "$REPOROOTCORE/sys.svp" bin/sys.com -d "$FLOPROOT/"
192 mateuszvis 184
 
867 mateusz.vi 185
# generate a simple autoexec.bat file
186
echo '@ECHO OFF' > "$FLOPROOT/autoexec.bat"
187
echo '' >> "$FLOPROOT/autoexec.bat"
188
echo 'REM Load DISPLAY driver if present' >> "$FLOPROOT/autoexec.bat"
189
echo 'IF EXIST DISPLAY.EXE DISPLAY CON=(EGA,,1)' >> "$FLOPROOT/autoexec.bat"
190
echo '' >> "$FLOPROOT/autoexec.bat"
191
echo 'FDAPM APMDOS' >> "$FLOPROOT/autoexec.bat"
192
echo '' >> "$FLOPROOT/autoexec.bat"
193
echo 'ECHO.' >> "$FLOPROOT/autoexec.bat"
194
echo 'ECHO  ********************' >> "$FLOPROOT/autoexec.bat"
195
echo 'ECHO   WELCOME TO SVARDOS' >> "$FLOPROOT/autoexec.bat"
196
echo 'ECHO  ********************' >> "$FLOPROOT/autoexec.bat"
197
echo "ECHO  build: $CURDATE" >> "$FLOPROOT/autoexec.bat"
198
echo 'ECHO.' >> "$FLOPROOT/autoexec.bat"
199
echo '' >> "$FLOPROOT/autoexec.bat"
1671 mateusz.vi 200
echo "INSTALL" >> "$FLOPROOT/autoexec.bat"
867 mateusz.vi 201
unix2dos "$FLOPROOT/autoexec.bat"
862 mateusz.vi 202
 
867 mateusz.vi 203
 
836 mateusz.vi 204
echo
862 mateusz.vi 205
echo "### Computing the USB image"
206
echo
207
 
208
# prepare the USB bootable image
209
USBIMG=$PUBDIR/svardos-usb.img
210
cp files/boot-svardos.img $USBIMG
1808 bttr 211
mlabel -i "$USBIMG@@32256" ::$CURDATE
862 mateusz.vi 212
mcopy -sQm -i "$USBIMG@@32256" "$FLOPROOT/"* ::/
1750 mateusz.vi 213
for p in $COREPKGS ; do
862 mateusz.vi 214
  mcopy -mi "$USBIMG@@32256" "$CDROOT/$p.svp" ::/
215
done
216
 
217
# compress the USB image
218
zip -mj9 "$PUBDIR/svardos-$CURDATE-usb.zip" "$USBIMG"
219
 
220
 
221
echo
836 mateusz.vi 222
echo "### Creating floppy images"
223
echo
1212 mateusz.vi 224
echo "You might notice a lot of DISK FULL warnings below. Do not worry, these"
225
echo "are expected and are perfectly normal. It is a side effect of trying to"
226
echo "fit as many packages as possible on the floppy sets."
227
echo
836 mateusz.vi 228
 
194 mateuszvis 229
# build the boot (CD) floppy image
192 mateuszvis 230
export MTOOLS_NO_VFAT=1
231
 
246 mateuszvis 232
# prepare images for floppies in different sizes (args are C H S SIZE)
1750 mateusz.vi 233
echo "videcdd" >> "$FLOPROOT/install.lst"
234
prep_flop 80 2 36 2880 "$PUBDIR" "2.88M" "$COREPKGS pcntpk videcdd" "$CDROOT/boot.img"
235
# no videcdd for non-2.88M images
1809 bernd.boec 236
$SED -i '/^videcdd$/d' "$FLOPROOT/install.lst"
1750 mateusz.vi 237
prep_flop 80 2 18 1440 "$PUBDIR" "1.44M" "$COREPKGS pcntpk"
238
prep_flop 80 2 15 1200 "$PUBDIR" "1.2M" "$COREPKGS"
239
prep_flop 80 2  9  720 "$PUBDIR" "720K" "$COREPKGS"
194 mateuszvis 240
 
862 mateusz.vi 241
 
836 mateusz.vi 242
echo
243
echo "### Computing DOSEMU.zip"
244
echo
245
 
321 mateuszvis 246
# prepare the DOSEMU boot zip
836 mateusz.vi 247
DOSEMUDIR="$PUBDIR/tmp_dosemu-prep-files.build"
321 mateuszvis 248
mkdir "$DOSEMUDIR"
322 mateuszvis 249
# INSTALL.BAT
624 mateuszvis 250
echo 'IF NOT EXIST C:\TEMP\NUL MKDIR C:\TEMP' >> "$DOSEMUDIR/install.bat"
322 mateuszvis 251
echo 'mkdir %DOSDIR%' >> "$DOSEMUDIR/install.bat"
252
echo 'mkdir %DOSDIR%\cfg' >> "$DOSEMUDIR/install.bat"
253
echo 'ECHO # pkg config file - specifies locations where packages should be installed >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
1670 mateusz.vi 254
echo 'ECHO DIR BIN %DOSDIR% >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
322 mateuszvis 255
echo 'ECHO DIR PROGS C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
256
echo 'ECHO DIR GAMES C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
257
echo 'ECHO DIR DRIVERS C:\DRIVERS\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
258
echo 'ECHO DIR DEVEL C:\DEVEL\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
321 mateuszvis 259
for p in $COREPKGS ; do
700 mateusz.vi 260
  cp "$CDROOT/$p.svp" "$DOSEMUDIR/"
261
  echo "pkg install $p.svp" >> "$DOSEMUDIR/install.bat"
262
  echo "del $p.svp" >> "$DOSEMUDIR/install.bat"
321 mateuszvis 263
done
322 mateuszvis 264
echo 'ECHO my_ip = dhcp >> %DOSDIR%\CFG\WATTCP.CFG' >> "$DOSEMUDIR/install.bat"
265
echo 'del pkg.exe' >> "$DOSEMUDIR/install.bat"
1103 mateusz.vi 266
echo 'DEL C:\CONFIG.SYS' >> "$DOSEMUDIR/install.bat"
267
echo 'COPY C:\CONFIG.NEW C:\CONFIG.SYS' >> "$DOSEMUDIR/install.bat"
268
echo 'DEL C:\CONFIG.NEW' >> "$DOSEMUDIR/install.bat"
269
echo 'SET COMSPEC=C:\COMMAND.COM' >> "$DOSEMUDIR/install.bat"
270
echo 'DEL C:\CMD.COM' >> "$DOSEMUDIR/install.bat"
322 mateuszvis 271
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
272
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
1103 mateusz.vi 273
echo 'ECHO  SVARDOS SETUP COMPLETED' >> "$DOSEMUDIR/install.bat"
274
echo 'ECHO   PLEASE RESTART DOSEMU' >> "$DOSEMUDIR/install.bat"
322 mateuszvis 275
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
276
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
1833 mateusz.vi 277
unzip -Cj "$REPOROOTCORE/kernledr.svp" kernel.sys -d "$DOSEMUDIR/"
1261 mateusz.vi 278
unzip -CLj "$REPOROOTCORE/svarcom.svp" command.com -d "$DOSEMUDIR/"
1103 mateusz.vi 279
mv "$DOSEMUDIR/command.com" "$DOSEMUDIR/cmd.com"
1261 mateusz.vi 280
unzip -Cj "$REPOROOTCORE/pkg.svp" bin/pkg.exe -d "$DOSEMUDIR/"
322 mateuszvis 281
# CONFIG.SYS
1103 mateusz.vi 282
echo 'FILES=25' >> "$DOSEMUDIR/config.sys"
322 mateuszvis 283
echo 'DOS=HIGH,UMB' >> "$DOSEMUDIR/config.sys"
326 mateuszvis 284
echo 'DOSDATA=UMB' >> "$DOSEMUDIR/config.sys"
325 mateuszvis 285
echo 'DEVICE=D:\dosemu\emufs.sys' >> "$DOSEMUDIR/config.sys"
322 mateuszvis 286
echo 'DEVICE=D:\dosemu\umb.sys' >> "$DOSEMUDIR/config.sys"
325 mateuszvis 287
echo 'DEVICEHIGH=D:\dosemu\ems.sys' >> "$DOSEMUDIR/config.sys"
322 mateuszvis 288
echo 'INSTALL=D:\dosemu\emufs.com' >> "$DOSEMUDIR/config.sys"
1103 mateusz.vi 289
cp "$DOSEMUDIR/config.sys" "$DOSEMUDIR/config.new"
290
echo 'SHELL=C:\CMD.COM /P' >> "$DOSEMUDIR/config.sys"
291
echo 'SHELL=C:\COMMAND.COM /P' >> "$DOSEMUDIR/config.new"
322 mateuszvis 292
# AUTOEXEC.BAT
321 mateuszvis 293
echo "@ECHO OFF" >> "$DOSEMUDIR/autoexec.bat"
322 mateuszvis 294
echo 'SET DOSDIR=C:\SVARDOS' >> "$DOSEMUDIR/autoexec.bat"
295
echo 'SET WATTCP.CFG=%DOSDIR%\CFG' >> "$DOSEMUDIR/autoexec.bat"
296
echo 'SET DIRCMD=/p/ogne' >> "$DOSEMUDIR/autoexec.bat"
624 mateuszvis 297
echo 'SET TEMP=C:\TEMP' >> "$DOSEMUDIR/autoexec.bat"
1670 mateusz.vi 298
echo 'PATH %DOSDIR%' >> "$DOSEMUDIR/autoexec.bat"
322 mateuszvis 299
echo "" >> "$DOSEMUDIR/autoexec.bat"
1103 mateusz.vi 300
echo 'IF NOT EXIST INSTALL.BAT GOTO NORMBOOT' >> "$DOSEMUDIR/autoexec.bat"
322 mateuszvis 301
echo "REM *** this is a one-time setup script used only during first initialization ***" >> "$DOSEMUDIR/autoexec.bat"
1103 mateusz.vi 302
echo 'CALL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
303
echo 'DEL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
304
echo 'GOTO ENDOFFILE' >> "$DOSEMUDIR/autoexec.bat"
322 mateuszvis 305
echo "" >> "$DOSEMUDIR/autoexec.bat"
1103 mateusz.vi 306
echo ":NORMBOOT" >> "$DOSEMUDIR/autoexec.bat"
321 mateuszvis 307
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
308
echo "ECHO Welcome to SvarDOS (powered by DOSEMU)! Type HELP if you are lost." >> "$DOSEMUDIR/autoexec.bat"
309
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
1103 mateusz.vi 310
echo ":ENDOFFILE" >> "$DOSEMUDIR/autoexec.bat"
321 mateuszvis 311
rm -f "$PUBDIR/svardos-dosemu.zip"
643 mateusz.vi 312
zip -rm9jk "$PUBDIR/svardos-$CURDATE-dosemu.zip" "$DOSEMUDIR"
321 mateuszvis 313
rmdir "$DOSEMUDIR"
314
 
836 mateusz.vi 315
echo
316
echo "### Generating ISO CD image"
317
echo
318
 
643 mateusz.vi 319
CDISO="$PUBDIR/svardos-$CURDATE-cd.iso"
320
CDZIP="$PUBDIR/svardos-$CURDATE-cd.zip"
194 mateuszvis 321
 
279 mateuszvis 322
$GENISOIMAGE -input-charset cp437 -b boot.img -iso-level 1 -f -V SVARDOS -o "$CDISO" "$CDROOT/boot.img"
2 mv_fox 323
 
204 mateuszvis 324
# compress the ISO
325
zip -mj9 "$CDZIP" "$CDISO"
326
 
1616 mateusz.vi 327
 
328
###############################################################################
329
# remove internationalization files for EN-ONLY releases. This is the only    #
330
# way to build the 360K variant                                               #
331
###############################################################################
332
 
333
rm "$FLOPROOT"/*.cpx
334
rm "$FLOPROOT"/install.lng
335
rm "$FLOPROOT"/display.exe
336
rm "$FLOPROOT"/mode.com
337
 
338
###############################################################################
339
# remove NLS and LNG files from packages to build EN-ONLY builds              #
340
###############################################################################
341
 
342
echo "### remove NLS and LNG files from packages to build EN-ONLY builds"
343
for p in $COREPKGS ; do
344
  # the || true bit is because zip returns a non-zero exit code on no file match
345
  zip -dq "$CDROOT/$p.svp" 'bin/*.lng' 'BIN/*.LNG' 'nls/*' 'NLS/*' || true
346
done
347
 
1750 mateusz.vi 348
prep_flop 80 2 18 1440 "$PUBDIR" "1.44M-EN_ONLY" "$COREPKGS"
1616 mateusz.vi 349
#prep_flop 80 2 21 1680 "$PUBDIR" "1.44M-DMF-EN_ONLY"
1750 mateusz.vi 350
prep_flop 80 2 15 1200 "$PUBDIR" "1.2M-EN_ONLY" "$COREPKGS"
351
prep_flop 80 2  9  720 "$PUBDIR" "720K-EN_ONLY" "$COREPKGS"
352
prep_flop 40 2  9  360 "$PUBDIR" "360K-EN_ONLY" "$COREPKGS"
1616 mateusz.vi 353
 
354
 
355
###############################################################################
1772 mateusz.vi 356
# compute the svardos stub, useful for migrating alien DOS systems to SvarDOS #
357
###############################################################################
358
 
359
echo
360
echo "### generating the pkgstub zip archive"
361
 
362
mkdir "$PUBDIR"/pkgstub
363
unzip -jC "$REPOROOTCORE"/pkgnet.svp bin/pkgnet.exe -d "$PUBDIR"/pkgstub
364
unzip -jC "$REPOROOTCORE"/pkg.svp bin/pkg.exe -d "$PUBDIR"/pkgstub
365
 
366
cat <<EOF > "$PUBDIR"/pkgstub/readme.txt
367
 
368
        SvarDOS stub, or how to plant a SvarDOS seed in a foreign land
369
        --------------------------------------------------------------
370
 
371
This archive contains files that allow to install a SvarDOS stub within
372
another DOS system. This makes it possible to use the SvarDOS online repository
373
of packages on non-SvarDOS systems, assuming you have a network card connected
374
to the internet and a suitable packet driver.
375
 
376
If you do not have internet connectivity, then you will still be able to
377
install SvarDOS packages (*.SVP) once you copy them to your PC. You can fetch
378
SvarDOS packages at <http://svardos.org>.
379
 
380
Follow the guide now:
381
 
382
=======================================
383
MKDIR C:\\SVARDOS
384
MKDIR C:\\SVARDOS\\CFG
385
 
386
SET WATTCP.CFG=C:\\SVARDOS\\CFG
387
SET DOSDIR=C:\\SVARDOS
388
SET LANG=EN
389
SET PATH=%PATH%;C:\SVARDOS
390
 
391
COPY *.EXE C:\\SVARDOS\\
392
COPY *.CFG C:\\SVARDOS\CFG\\
393
=======================================
394
 
395
If in doubt, reach out to us at <http://svardos.org>.
396
EOF
397
 
398
cat <<EOF > "$PUBDIR"/pkgstub/wattcp.cfg
399
# Rely on DHCP by default
400
my_ip = dhcp
401
 
402
# modify (and uncomment) these if you have a fix IP setup:
403
#
404
#my_ip = 0.0.0.0  ; IP address
405
#netmask = 255.255.255.0  ; netmask
406
#nameserver = 0.0.0.0  ; primary DNS, mandatory if not using DHCP
407
#nameserver = 0.0.0.0  ; secondary DNS, optional
408
#gateway = 0.0.0.0  ; default gateway
409
EOF
410
 
411
cat <<EOF > "$PUBDIR"/pkgstub/pkg.cfg
412
# pkg config file - specifies locations where SvarDOS packages will be installed
413
 
414
# SvarDOS core files
415
DIR BIN C:\\SVARDOS\\
416
 
417
# General location for programs
418
DIR PROGS C:\\
419
 
420
# Games
421
DIR GAMES C:\\
422
 
423
# Drivers
424
DIR DRIVERS C:\\DRIVERS\\
425
 
426
# Development tools
427
DIR DEVEL C:\\DEVEL\\
428
EOF
429
 
430
zip -m -k9jr "$PUBDIR"/svarstub.zip "$PUBDIR"/pkgstub
431
rmdir "$PUBDIR"/pkgstub
432
 
433
 
434
 
435
###############################################################################
1616 mateusz.vi 436
# cleanup all temporary things                                                #
437
###############################################################################
438
 
836 mateusz.vi 439
if [ "x$2" != "xnoclean" ] ; then
440
  echo
904 bttr 441
  echo "### Cleanup of temporary directories:"
836 mateusz.vi 442
  echo "# $CDROOT"
443
  echo "# $FLOPROOT"
444
  echo
194 mateuszvis 445
  rm -rf "$CDROOT" "$FLOPROOT"
446
fi
189 mateuszvis 447
 
11 mv_fox 448
cd "$origdir"
449
 
836 mateusz.vi 450
echo
451
echo "### ALL DONE! ###"
16 mv_fox 452
 
2 mv_fox 453
exit 0