Subversion Repositories SvarDOS

Rev

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

Rev 847 Rev 849
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. Before running
8
# a CORE package has been modified or the build script changed. Before running
9
# it looks for the presence of a /tmp/svardos_repo_changed.flag and stops if
9
# it looks for the presence of a /tmp/svardos_repo_changed.flag and stops if
10
# no such flag exists. This flag is expected to be created by an svn
10
# no such flag exists. This flag is expected to be created by an svn
11
# post-commit hook when an important svn change is detected.
11
# post-commit hook when an important svn change is detected.
12
#
12
#
13
# usage: ./build.sh outputdir [noclean] > logfile
13
# usage: ./build.sh outputdir [noclean] > logfile
14
#
14
#
15
 
15
 
16
### parameters block starts here ############################################
16
### parameters block starts here ############################################
17
 
17
 
18
CURDATE=`date +%Y%m%d`
18
CURDATE=`date +%Y%m%d`
19
REPOROOT=`realpath ./packages`
19
REPOROOT=`realpath ./packages`
20
CUSTFILES=`realpath ./files`
20
CUSTFILES=`realpath ./files`
21
 
21
 
22
GENISOIMAGE=''    # can be mkisofs, genisoimage or empty for autodetection
22
GENISOIMAGE=''    # can be mkisofs, genisoimage or empty for autodetection
23
 
23
 
24
### parameters block ends here ##############################################
24
### parameters block ends here ##############################################
25
 
25
 
26
# look for mandatory output dir
26
# look for mandatory output dir
27
if [ "x$1" == "x" ] ; then
27
if [ "x$1" == "x" ] ; then
28
  echo "usage: build.sh outputdir [noclean] > logfile"
28
  echo "usage: build.sh outputdir [noclean] > logfile"
29
  exit 1
29
  exit 1
30
fi
30
fi
31
PUBDIR=`realpath "$1"`/$CURDATE
31
PUBDIR=`realpath "$1"`/$CURDATE
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)
66
# list of packages to be part of EXTRA (only sometimes installed, typically drivers)
67
EXTRAPKGS="pcntpk udvd2"
67
EXTRAPKGS="pcntpk udvd2"
68
 
68
 
69
# all packages
69
# all packages
70
ALLPKGS="$COREPKGS $EXTRAPKGS"
70
ALLPKGS="$COREPKGS $EXTRAPKGS"
71
 
71
 
72
 
72
 
73
# prepares image for floppy sets of:
73
# prepares image for floppy sets of:
74
# $1 cylinders
74
# $1 cylinders
75
# $2 heads (sides)
75
# $2 heads (sides)
76
# $3 sectors per track
76
# $3 sectors per track
77
# $4 size
77
# $4 size
-
 
78
# $5 working directory (for temporary files etc)
78
# $5 where to put a copy of the image (optional)
79
# $6 where to put a copy of the image (optional)
79
function prep_flop {
80
function prep_flop {
-
 
81
  WORKDIR="$5/$4"
80
  mkdir $4
82
  mkdir "$WORKDIR"
81
  mformat -C -t $1 -h $2 -s $3 -v SVARDOS -B "$CUSTFILES/floppy.mbr" -i "$4/disk1.img"
83
  mformat -C -t $1 -h $2 -s $3 -v SVARDOS -B "$CUSTFILES/floppy.mbr" -i "$WORKDIR/disk1.img"
82
  mcopy -sQm -i "$4/disk1.img" "$FLOPROOT/"* ::/
84
  mcopy -sQm -i "$WORKDIR/disk1.img" "$FLOPROOT/"* ::/
83
 
85
 
84
  # now populate the floppies
86
  # now populate the floppies
85
  curdisk=1
87
  curdisk=1
86
  for p in $ALLPKGS ; do
88
  for p in $ALLPKGS ; do
87
    # if copy fails, then probably the floppy is full - try again after
89
    # if copy fails, then probably the floppy is full - try again after
88
    # creating an additional floppy image
90
    # creating an additional floppy image
89
    if ! mcopy -mi "$4/disk$curdisk.img" "$CDROOT/$p.svp" ::/ ; then
91
    if ! mcopy -mi "$WORKDIR/disk$curdisk.img" "$CDROOT/$p.svp" ::/ ; then
90
      curdisk=$((curdisk+1))
92
      curdisk=$((curdisk+1))
91
      mformat -C -t $1 -h $2 -s $3 -v SVARDOS -i "$4/disk$curdisk.img"
93
      mformat -C -t $1 -h $2 -s $3 -v SVARDOS -i "$WORKDIR/disk$curdisk.img"
92
      mcopy -mi "$4/disk$curdisk.img" "$CDROOT/$p.svp" ::/
94
      mcopy -mi "$WORKDIR/disk$curdisk.img" "$CDROOT/$p.svp" ::/
93
    fi
95
    fi
94
  done
96
  done
95
 
97
 
96
  # add a short readme
98
  # add a short readme
97
  echo "This directory contains a set of $curdisk floppy images of the SvarDOS distribution in the $4 KB floppy format." > "$4/readme.txt"
99
  echo "This directory contains a set of $curdisk floppy images of the SvarDOS distribution in the $4 KB floppy format." > "$WORKDIR/readme.txt"
98
  echo "" >> "$4/readme.txt"
100
  echo "" >> "$WORKDIR/readme.txt"
99
  echo "These images are raw floppy disk dumps. To write them on an actual floppy disk, you have to use a low-level sector copying tool, like dd." >> "$4/readme.txt"
101
  echo "These images are raw floppy disk dumps. To write them on an actual floppy disk, you have to use a low-level sector copying tool, like dd." >> "$WORKDIR/readme.txt"
100
  echo "" >> "$4/readme.txt"
102
  echo "" >> "$WORKDIR/readme.txt"
101
  echo "Latest SvarDOS version is available on the project's homepage: http://svardos.osdn.io" >> "$4/readme.txt"
103
  echo "Latest SvarDOS version is available on the project's homepage: http://svardos.osdn.io" >> "$WORKDIR/readme.txt"
102
 
104
 
103
  unix2dos "$4/readme.txt"
105
  unix2dos "$WORKDIR/readme.txt"
104
 
106
 
105
  # make a copy of the image, if requested
107
  # make a copy of the image, if requested
106
  if [ "x$5" != "x" ] ; then
108
  if [ "x$6" != "x" ] ; then
107
    cp "$4/disk1.img" $5
109
    cp "$WORKDIR/disk1.img" $6
108
  fi
110
  fi
109
 
111
 
110
  # zip the images (and remove them at the same time)
112
  # zip the images (and remove them at the same time)
111
  rm -f "$PUBDIR/svardos-floppy-$4k.zip"
113
  rm -f "$PUBDIR/svardos-floppy-$4k.zip"
112
  zip -9 -rmj "$PUBDIR/svardos-$CURDATE-floppy-$4k.zip" $4/*
114
  zip -9 -rmj "$PUBDIR/svardos-$CURDATE-floppy-$4k.zip" "$WORKDIR"/*
113
 
115
 
114
  # clean up
116
  # clean up
115
  rmdir $4
117
  rmdir "$WORKDIR"
116
}
118
}
117
 
119
 
118
 
120
 
119
### actual code flow starts here ############################################
121
### actual code flow starts here ############################################
120
 
122
 
121
# remember where I am, so I can get back here once all is done
123
# remember where I am, so I can get back here once all is done
122
origdir=`pwd`
124
origdir=`pwd`
123
 
125
 
124
echo "###############################################################################"
126
echo "###############################################################################"
125
echo " STARTING BUILD $CURDATE"
127
echo " STARTING BUILD $CURDATE"
126
echo "###############################################################################"
128
echo "###############################################################################"
127
echo "dest dir: $PUBDIR"
129
echo "dest dir: $PUBDIR"
128
echo "current time is `date` and it's a beautiful day somewhere in the world"
130
echo "current time is `date` and it's a beautiful day somewhere in the world"
129
echo
131
echo
130
 
132
 
131
# remove dest dir if it exists already, then recreate it empty
133
# remove dest dir if it exists already, then recreate it empty
132
rm -rf "$PUBDIR"
134
rm -rf "$PUBDIR"
133
mkdir "$PUBDIR"
135
mkdir "$PUBDIR"
134
 
136
 
135
mkdir "$CDROOT"
137
mkdir "$CDROOT"
136
mkdir "$FLOPROOT"
138
mkdir "$FLOPROOT"
137
 
139
 
138
# add CORE packages to CDROOT + create the list of packages on floppy
140
# add CORE packages to CDROOT + create the list of packages on floppy
139
for pkg in $COREPKGS ; do
141
for pkg in $COREPKGS ; do
140
  cp "$REPOROOT/core/$pkg.svp" "$CDROOT/"
142
  cp "$REPOROOT/core/$pkg.svp" "$CDROOT/"
141
  echo "$pkg" >> "$FLOPROOT/install.lst"
143
  echo "$pkg" >> "$FLOPROOT/install.lst"
142
done
144
done
143
 
145
 
144
# add EXTRA packages to CDROOT (but not in the list of packages to install)
146
# add EXTRA packages to CDROOT (but not in the list of packages to install)
145
for pkg in $EXTRAPKGS ; do
147
for pkg in $EXTRAPKGS ; do
146
  cp "$REPOROOT/$pkg.svp" "$CDROOT/"
148
  cp "$REPOROOT/$pkg.svp" "$CDROOT/"
147
done
149
done
148
 
150
 
149
 
151
 
150
echo
152
echo
151
echo "### Populating the floppy root at $FLOPROOT"
153
echo "### Populating the floppy root at $FLOPROOT"
152
echo
154
echo
153
 
155
 
154
# prepare the content of the boot (install) floppy
156
# prepare the content of the boot (install) floppy
155
cp -r "$CUSTFILES/floppy/"* "$FLOPROOT/"
157
cp -r "$CUSTFILES/floppy/"* "$FLOPROOT/"
156
unzip -Cj "$REPOROOT/core/cpidos.svp" 'cpi/ega*.cpx' -d "$FLOPROOT/"
158
unzip -Cj "$REPOROOT/core/cpidos.svp" 'cpi/ega*.cpx' -d "$FLOPROOT/"
157
unzip -Cj "$REPOROOT/core/command.svp" bin/command.com -d "$FLOPROOT/"
159
unzip -Cj "$REPOROOT/core/command.svp" bin/command.com -d "$FLOPROOT/"
158
unzip -Cj "$REPOROOT/core/display.svp" bin/display.exe -d "$FLOPROOT/"
160
unzip -Cj "$REPOROOT/core/display.svp" bin/display.exe -d "$FLOPROOT/"
159
unzip -Cj "$REPOROOT/core/edit.svp" bin/edit.exe -d "$FLOPROOT/"
161
unzip -Cj "$REPOROOT/core/edit.svp" bin/edit.exe -d "$FLOPROOT/"
160
unzip -Cj "$REPOROOT/core/fdapm.svp" bin/fdapm.com -d "$FLOPROOT/"
162
unzip -Cj "$REPOROOT/core/fdapm.svp" bin/fdapm.com -d "$FLOPROOT/"
161
unzip -Cj "$REPOROOT/core/fdisk.svp" bin/fdisk.exe bin/fdiskpt.ini -d "$FLOPROOT/"
163
unzip -Cj "$REPOROOT/core/fdisk.svp" bin/fdisk.exe bin/fdiskpt.ini -d "$FLOPROOT/"
162
unzip -Cj "$REPOROOT/core/format.svp" bin/format.exe -d "$FLOPROOT/"
164
unzip -Cj "$REPOROOT/core/format.svp" bin/format.exe -d "$FLOPROOT/"
163
unzip -Cj "$REPOROOT/core/kernel.svp" bin/kernel.sys bin/sys.com -d "$FLOPROOT/"
165
unzip -Cj "$REPOROOT/core/kernel.svp" bin/kernel.sys bin/sys.com -d "$FLOPROOT/"
164
unzip -Cj "$REPOROOT/core/mem.svp" bin/mem.exe -d "$FLOPROOT/"
166
unzip -Cj "$REPOROOT/core/mem.svp" bin/mem.exe -d "$FLOPROOT/"
165
unzip -Cj "$REPOROOT/core/mode.svp" bin/mode.com -d "$FLOPROOT/"
167
unzip -Cj "$REPOROOT/core/mode.svp" bin/mode.com -d "$FLOPROOT/"
166
unzip -Cj "$REPOROOT/core/more.svp" bin/more.exe -d "$FLOPROOT/"
168
unzip -Cj "$REPOROOT/core/more.svp" bin/more.exe -d "$FLOPROOT/"
167
unzip -Cj "$REPOROOT/core/pkg.svp" bin/pkg.exe -d "$FLOPROOT/"
169
unzip -Cj "$REPOROOT/core/pkg.svp" bin/pkg.exe -d "$FLOPROOT/"
168
 
170
 
169
echo
171
echo
170
echo "### Creating floppy images"
172
echo "### Creating floppy images"
171
echo
173
echo
172
 
174
 
173
# build the boot (CD) floppy image
175
# build the boot (CD) floppy image
174
export MTOOLS_NO_VFAT=1
176
export MTOOLS_NO_VFAT=1
175
 
177
 
176
# prepare images for floppies in different sizes (args are C H S SIZE)
178
# prepare images for floppies in different sizes (args are C H S SIZE)
177
prep_flop 80 2 36 2880 "$CDROOT/boot.img"
179
prep_flop 80 2 36 2880 "$PUBDIR" "$CDROOT/boot.img"
178
prep_flop 80 2 18 1440
180
prep_flop 80 2 18 1440 "$PUBDIR"
179
prep_flop 80 2 15 1200
181
prep_flop 80 2 15 1200 "$PUBDIR"
180
prep_flop 80 2  9  720
182
prep_flop 80 2  9  720 "$PUBDIR"
181
 
183
 
182
echo
184
echo
183
echo "### Computing DOSEMU.zip"
185
echo "### Computing DOSEMU.zip"
184
echo
186
echo
185
 
187
 
186
# prepare the DOSEMU boot zip
188
# prepare the DOSEMU boot zip
187
DOSEMUDIR="$PUBDIR/tmp_dosemu-prep-files.build"
189
DOSEMUDIR="$PUBDIR/tmp_dosemu-prep-files.build"
188
mkdir "$DOSEMUDIR"
190
mkdir "$DOSEMUDIR"
189
# INSTALL.BAT
191
# INSTALL.BAT
190
echo 'IF NOT EXIST C:\TEMP\NUL MKDIR C:\TEMP' >> "$DOSEMUDIR/install.bat"
192
echo 'IF NOT EXIST C:\TEMP\NUL MKDIR C:\TEMP' >> "$DOSEMUDIR/install.bat"
191
echo 'mkdir %DOSDIR%' >> "$DOSEMUDIR/install.bat"
193
echo 'mkdir %DOSDIR%' >> "$DOSEMUDIR/install.bat"
192
echo 'mkdir %DOSDIR%\cfg' >> "$DOSEMUDIR/install.bat"
194
echo 'mkdir %DOSDIR%\cfg' >> "$DOSEMUDIR/install.bat"
193
echo 'ECHO # pkg config file - specifies locations where packages should be installed >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
195
echo 'ECHO # pkg config file - specifies locations where packages should be installed >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
194
echo 'ECHO DIR PROGS C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
196
echo 'ECHO DIR PROGS C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
195
echo 'ECHO DIR GAMES C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
197
echo 'ECHO DIR GAMES C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
196
echo 'ECHO DIR DRIVERS C:\DRIVERS\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
198
echo 'ECHO DIR DRIVERS C:\DRIVERS\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
197
echo 'ECHO DIR DEVEL C:\DEVEL\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
199
echo 'ECHO DIR DEVEL C:\DEVEL\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
198
for p in $COREPKGS ; do
200
for p in $COREPKGS ; do
199
  cp "$CDROOT/$p.svp" "$DOSEMUDIR/"
201
  cp "$CDROOT/$p.svp" "$DOSEMUDIR/"
200
  echo "pkg install $p.svp" >> "$DOSEMUDIR/install.bat"
202
  echo "pkg install $p.svp" >> "$DOSEMUDIR/install.bat"
201
  echo "del $p.svp" >> "$DOSEMUDIR/install.bat"
203
  echo "del $p.svp" >> "$DOSEMUDIR/install.bat"
202
done
204
done
203
echo 'ECHO my_ip = dhcp >> %DOSDIR%\CFG\WATTCP.CFG' >> "$DOSEMUDIR/install.bat"
205
echo 'ECHO my_ip = dhcp >> %DOSDIR%\CFG\WATTCP.CFG' >> "$DOSEMUDIR/install.bat"
204
echo 'del pkg.exe' >> "$DOSEMUDIR/install.bat"
206
echo 'del pkg.exe' >> "$DOSEMUDIR/install.bat"
205
echo 'ECHO SHELLHIGH=C:\SVARDOS\BIN\COMMAND.COM /P >> C:\CONFIG.SYS' >> "$DOSEMUDIR/install.bat"
207
echo 'ECHO SHELLHIGH=C:\SVARDOS\BIN\COMMAND.COM /P >> C:\CONFIG.SYS' >> "$DOSEMUDIR/install.bat"
206
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
208
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
207
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
209
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
208
echo 'ECHO  SVARDOS SETUP COMPLETED ' >> "$DOSEMUDIR/install.bat"
210
echo 'ECHO  SVARDOS SETUP COMPLETED ' >> "$DOSEMUDIR/install.bat"
209
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
211
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
210
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
212
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
211
unzip -Cj "$REPOROOT/core/kernel.svp" bin/kernel.sys -d "$DOSEMUDIR/"
213
unzip -Cj "$REPOROOT/core/kernel.svp" bin/kernel.sys -d "$DOSEMUDIR/"
212
unzip -Cj "$REPOROOT/core/command.svp" bin/command.com -d "$DOSEMUDIR/"
214
unzip -Cj "$REPOROOT/core/command.svp" bin/command.com -d "$DOSEMUDIR/"
213
unzip -Cj "$REPOROOT/core/pkg.svp" bin/pkg.exe -d "$DOSEMUDIR/"
215
unzip -Cj "$REPOROOT/core/pkg.svp" bin/pkg.exe -d "$DOSEMUDIR/"
214
# CONFIG.SYS
216
# CONFIG.SYS
215
echo 'FILES=50' >> "$DOSEMUDIR/config.sys"
217
echo 'FILES=50' >> "$DOSEMUDIR/config.sys"
216
echo 'DOS=HIGH,UMB' >> "$DOSEMUDIR/config.sys"
218
echo 'DOS=HIGH,UMB' >> "$DOSEMUDIR/config.sys"
217
echo 'DOSDATA=UMB' >> "$DOSEMUDIR/config.sys"
219
echo 'DOSDATA=UMB' >> "$DOSEMUDIR/config.sys"
218
echo 'DEVICE=D:\dosemu\emufs.sys' >> "$DOSEMUDIR/config.sys"
220
echo 'DEVICE=D:\dosemu\emufs.sys' >> "$DOSEMUDIR/config.sys"
219
echo 'DEVICE=D:\dosemu\umb.sys' >> "$DOSEMUDIR/config.sys"
221
echo 'DEVICE=D:\dosemu\umb.sys' >> "$DOSEMUDIR/config.sys"
220
echo 'DEVICEHIGH=D:\dosemu\ems.sys' >> "$DOSEMUDIR/config.sys"
222
echo 'DEVICEHIGH=D:\dosemu\ems.sys' >> "$DOSEMUDIR/config.sys"
221
echo 'INSTALL=D:\dosemu\emufs.com' >> "$DOSEMUDIR/config.sys"
223
echo 'INSTALL=D:\dosemu\emufs.com' >> "$DOSEMUDIR/config.sys"
222
# AUTOEXEC.BAT
224
# AUTOEXEC.BAT
223
echo "@ECHO OFF" >> "$DOSEMUDIR/autoexec.bat"
225
echo "@ECHO OFF" >> "$DOSEMUDIR/autoexec.bat"
224
echo 'SET DOSDIR=C:\SVARDOS' >> "$DOSEMUDIR/autoexec.bat"
226
echo 'SET DOSDIR=C:\SVARDOS' >> "$DOSEMUDIR/autoexec.bat"
225
echo 'SET WATTCP.CFG=%DOSDIR%\CFG' >> "$DOSEMUDIR/autoexec.bat"
227
echo 'SET WATTCP.CFG=%DOSDIR%\CFG' >> "$DOSEMUDIR/autoexec.bat"
226
echo 'SET DIRCMD=/p/ogne' >> "$DOSEMUDIR/autoexec.bat"
228
echo 'SET DIRCMD=/p/ogne' >> "$DOSEMUDIR/autoexec.bat"
227
echo 'SET TEMP=C:\TEMP' >> "$DOSEMUDIR/autoexec.bat"
229
echo 'SET TEMP=C:\TEMP' >> "$DOSEMUDIR/autoexec.bat"
228
echo 'PATH %DOSDIR%\BIN' >> "$DOSEMUDIR/autoexec.bat"
230
echo 'PATH %DOSDIR%\BIN' >> "$DOSEMUDIR/autoexec.bat"
229
echo "" >> "$DOSEMUDIR/autoexec.bat"
231
echo "" >> "$DOSEMUDIR/autoexec.bat"
230
echo "REM *** this is a one-time setup script used only during first initialization ***" >> "$DOSEMUDIR/autoexec.bat"
232
echo "REM *** this is a one-time setup script used only during first initialization ***" >> "$DOSEMUDIR/autoexec.bat"
231
echo 'IF EXIST INSTALL.BAT CALL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
233
echo 'IF EXIST INSTALL.BAT CALL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
232
echo 'IF EXIST INSTALL.BAT DEL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
234
echo 'IF EXIST INSTALL.BAT DEL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
233
echo "" >> "$DOSEMUDIR/autoexec.bat"
235
echo "" >> "$DOSEMUDIR/autoexec.bat"
234
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
236
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
235
echo "ECHO Welcome to SvarDOS (powered by DOSEMU)! Type HELP if you are lost." >> "$DOSEMUDIR/autoexec.bat"
237
echo "ECHO Welcome to SvarDOS (powered by DOSEMU)! Type HELP if you are lost." >> "$DOSEMUDIR/autoexec.bat"
236
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
238
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
237
rm -f "$PUBDIR/svardos-dosemu.zip"
239
rm -f "$PUBDIR/svardos-dosemu.zip"
238
zip -rm9jk "$PUBDIR/svardos-$CURDATE-dosemu.zip" "$DOSEMUDIR"
240
zip -rm9jk "$PUBDIR/svardos-$CURDATE-dosemu.zip" "$DOSEMUDIR"
239
rmdir "$DOSEMUDIR"
241
rmdir "$DOSEMUDIR"
240
 
242
 
241
echo
243
echo
242
echo "### Computing the USB image"
244
echo "### Computing the USB image"
243
echo
245
echo
244
 
246
 
245
# prepare the USB bootable image
247
# prepare the USB bootable image
246
USBIMG=$PUBDIR/svardos-usb.img
248
USBIMG=$PUBDIR/svardos-usb.img
247
cp files/boot-svardos.img $USBIMG
249
cp files/boot-svardos.img $USBIMG
248
mcopy -sQm -i "$USBIMG@@32256" "$FLOPROOT/"* ::/
250
mcopy -sQm -i "$USBIMG@@32256" "$FLOPROOT/"* ::/
249
for p in $ALLPKGS ; do
251
for p in $ALLPKGS ; do
250
  mcopy -mi "$USBIMG@@32256" "$CDROOT/$p.svp" ::/
252
  mcopy -mi "$USBIMG@@32256" "$CDROOT/$p.svp" ::/
251
done
253
done
252
 
254
 
253
# compress the USB image
255
# compress the USB image
254
zip -mj9 "$PUBDIR/svardos-$CURDATE-usb.zip" "$USBIMG"
256
zip -mj9 "$PUBDIR/svardos-$CURDATE-usb.zip" "$USBIMG"
255
 
257
 
256
echo
258
echo
257
echo "### Generating ISO CD image"
259
echo "### Generating ISO CD image"
258
echo
260
echo
259
 
261
 
260
CDISO="$PUBDIR/svardos-$CURDATE-cd.iso"
262
CDISO="$PUBDIR/svardos-$CURDATE-cd.iso"
261
CDZIP="$PUBDIR/svardos-$CURDATE-cd.zip"
263
CDZIP="$PUBDIR/svardos-$CURDATE-cd.zip"
262
 
264
 
263
$GENISOIMAGE -input-charset cp437 -b boot.img -iso-level 1 -f -V SVARDOS -o "$CDISO" "$CDROOT/boot.img"
265
$GENISOIMAGE -input-charset cp437 -b boot.img -iso-level 1 -f -V SVARDOS -o "$CDISO" "$CDROOT/boot.img"
264
 
266
 
265
# compress the ISO
267
# compress the ISO
266
zip -mj9 "$CDZIP" "$CDISO"
268
zip -mj9 "$CDZIP" "$CDISO"
267
 
269
 
268
# cleanup temporary things
270
# cleanup temporary things
269
if [ "x$2" != "xnoclean" ] ; then
271
if [ "x$2" != "xnoclean" ] ; then
270
  echo
272
  echo
271
  echo "### Clenup of temporary directories:"
273
  echo "### Clenup of temporary directories:"
272
  echo "# $CDROOT"
274
  echo "# $CDROOT"
273
  echo "# $FLOPROOT"
275
  echo "# $FLOPROOT"
274
  echo
276
  echo
275
  rm -rf "$CDROOT" "$FLOPROOT"
277
  rm -rf "$CDROOT" "$FLOPROOT"
276
fi
278
fi
277
 
279
 
278
cd "$origdir"
280
cd "$origdir"
279
 
281
 
280
echo
282
echo
281
echo "### ALL DONE! ###"
283
echo "### ALL DONE! ###"
282
 
284
 
283
exit 0
285
exit 0
284
 
286