Subversion Repositories SvarDOS

Rev

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

Rev 568 Rev 574
1
#!/bin/bash
1
#!/bin/bash
2
#
2
#
3
# SvarDOS build script
3
# SvarDOS build script
4
# http://svardos.osdn.io
4
# http://svardos.osdn.io
5
# Copyright (C) 2016-2022 Mateusz Viste
5
# Copyright (C) 2016-2022 Mateusz Viste
6
#
6
#
7
# This script generates the SvarDOS repository index and builds ISO CD images.
7
# This script generates the SvarDOS repository index and builds ISO CD images.
8
# It should be executed each time that a package has been modified, added or
8
# It should be executed each time that a package has been modified, added or
9
# removed.
9
# removed.
10
#
10
#
11
# usage: ./build.sh [noclean]
11
# usage: ./build.sh [noclean]
12
#
12
#
13
 
13
 
14
### parameters block starts here ############################################
14
### parameters block starts here ############################################
15
 
15
 
16
PKGDIR=`realpath ./packages`
16
PKGDIR=`realpath ./packages`
17
REPOROOT=`realpath ./website/repo`
17
REPOROOT=`realpath ./website/repo`
18
BUILDIDX=`realpath ./buildidx/buildidx.php`
18
BUILDIDX=`realpath ./buildidx/buildidx.php`
19
PUBDIR=`realpath ./website/download`
19
PUBDIR=`realpath ./website/download`
20
CDROOT=`realpath ./cdroot`
20
CDROOT=`realpath ./cdroot`
21
FLOPROOT=`realpath ./floproot`
21
FLOPROOT=`realpath ./floproot`
22
CUSTFILES=`realpath ./files`
22
CUSTFILES=`realpath ./files`
23
 
23
 
24
GENISOIMAGE=''    # can be mkisofs, genisoimage or empty for autodetection
24
GENISOIMAGE=''    # can be mkisofs, genisoimage or empty for autodetection
25
 
25
 
26
### parameters block ends here ##############################################
26
### parameters block ends here ##############################################
27
 
27
 
28
# auto-detect whether to use mkisofs or genisoimage
28
# auto-detect whether to use mkisofs or genisoimage
29
 
29
 
30
if [ "x$GENISOIMAGE" == "x" ] ; then
30
if [ "x$GENISOIMAGE" == "x" ] ; then
31
mkisofs --help 2> /dev/null
31
mkisofs --help 2> /dev/null
32
if [ $? -eq 0 ] ; then
32
if [ $? -eq 0 ] ; then
33
  GENISOIMAGE='mkisofs'
33
  GENISOIMAGE='mkisofs'
34
fi
34
fi
35
fi
35
fi
36
 
36
 
37
if [ "x$GENISOIMAGE" == "x" ] ; then
37
if [ "x$GENISOIMAGE" == "x" ] ; then
38
genisoimage --help 2> /dev/null
38
genisoimage --help 2> /dev/null
39
if [ $? -eq 0 ] ; then
39
if [ $? -eq 0 ] ; then
40
  GENISOIMAGE='genisoimage'
40
  GENISOIMAGE='genisoimage'
41
fi
41
fi
42
fi
42
fi
43
 
43
 
44
if [ "x$GENISOIMAGE" == "x" ] ; then
44
if [ "x$GENISOIMAGE" == "x" ] ; then
45
  echo "ERROR: neither genisoimage nor mkisofs was found on this system"
45
  echo "ERROR: neither genisoimage nor mkisofs was found on this system"
46
  exit 1
46
  exit 1
47
fi
47
fi
48
 
48
 
49
 
49
 
50
# abort if anything fails
50
# abort if anything fails
51
set -e
51
set -e
52
 
52
 
53
 
53
 
54
# list of packages to be part of CORE (always installed)
54
# list of packages to be part of CORE (always installed)
55
COREPKGS="amb attrib chkdsk choice command cpidos deltree devload diskcopy display dosfsck edit fc fdapm fdisk find format help himemx kernel keyb keyb_lay label localcfg mem mode more move pkg pkgnet shsucdx sort tree"
55
COREPKGS="amb attrib chkdsk choice command cpidos debug deltree devload diskcopy display dosfsck edit fc fdapm fdisk find format help himemx kernel keyb keyb_lay label localcfg mem mode more move pkg pkgnet shsucdx sort tree"
56
 
56
 
57
# list of packages to be part of EXTRA (only sometimes installed, typically drivers)
57
# list of packages to be part of EXTRA (only sometimes installed, typically drivers)
58
EXTRAPKGS="pcntpk udvd2"
58
EXTRAPKGS="pcntpk udvd2"
59
 
59
 
60
# all packages
60
# all packages
61
ALLPKGS="$COREPKGS $EXTRAPKGS"
61
ALLPKGS="$COREPKGS $EXTRAPKGS"
62
 
62
 
63
 
63
 
64
# function that builds the packages repository
64
# function that builds the packages repository
65
function dorepo {
65
function dorepo {
66
  # clear out the web repo and copy all zip files to it
66
  # clear out the web repo and copy all zip files to it
67
  rm "$REPOROOT"/*.zip
67
  rm "$REPOROOT"/*.zip
68
  cp "$PKGDIR"/*.zip "$REPOROOT/"
68
  cp "$PKGDIR"/*.zip "$REPOROOT/"
69
  # now strip the sources from repo versions
69
  # now strip the sources from repo versions
70
  find "$REPOROOT/" -iname '*.zip' -exec zip "{}" -d "SOURCE/*" ';'
70
  find "$REPOROOT/" -iname '*.zip' -exec zip "{}" -d "SOURCE/*" ';'
71
  find "$REPOROOT/" -iname '*.zip' -exec zip "{}" -d "source/*" ';'
71
  find "$REPOROOT/" -iname '*.zip' -exec zip "{}" -d "source/*" ';'
72
  find "$REPOROOT/" -iname '*.zip' -exec zip "{}" -d "Source/*" ';'
72
  find "$REPOROOT/" -iname '*.zip' -exec zip "{}" -d "Source/*" ';'
73
 
73
 
74
  # build repo index
74
  # build repo index
75
  php "$BUILDIDX" "$REPOROOT"
75
  php "$BUILDIDX" "$REPOROOT"
76
}
76
}
77
 
77
 
78
 
78
 
79
# prepares image for floppy sets of:
79
# prepares image for floppy sets of:
80
# $1 cylinders
80
# $1 cylinders
81
# $2 heads (sides)
81
# $2 heads (sides)
82
# $3 sectors per track
82
# $3 sectors per track
83
# $4 size
83
# $4 size
84
# $5 where to put a copy of the image (optional)
84
# $5 where to put a copy of the image (optional)
85
function prep_flop {
85
function prep_flop {
86
  mkdir $4
86
  mkdir $4
87
  mformat -C -t $1 -h $2 -s $3 -v SVARDOS -B "$CUSTFILES/floppy.mbr" -i "$4/disk1.img"
87
  mformat -C -t $1 -h $2 -s $3 -v SVARDOS -B "$CUSTFILES/floppy.mbr" -i "$4/disk1.img"
88
  mcopy -sQm -i "$4/disk1.img" "$FLOPROOT/"* ::/
88
  mcopy -sQm -i "$4/disk1.img" "$FLOPROOT/"* ::/
89
 
89
 
90
  # now populate the floppies
90
  # now populate the floppies
91
  curdisk=1
91
  curdisk=1
92
  for p in $ALLPKGS ; do
92
  for p in $ALLPKGS ; do
93
    # if copy fails, then probably the floppy is full - try again after
93
    # if copy fails, then probably the floppy is full - try again after
94
    # creating an additional floppy image
94
    # creating an additional floppy image
95
    if ! mcopy -mi "$4/disk$curdisk.img" "$CDROOT/$p.zip" ::/ ; then
95
    if ! mcopy -mi "$4/disk$curdisk.img" "$CDROOT/$p.zip" ::/ ; then
96
      curdisk=$((curdisk+1))
96
      curdisk=$((curdisk+1))
97
      mformat -C -t $1 -h $2 -s $3 -v SVARDOS -i "$4/disk$curdisk.img"
97
      mformat -C -t $1 -h $2 -s $3 -v SVARDOS -i "$4/disk$curdisk.img"
98
      mcopy -mi "$4/disk$curdisk.img" "$CDROOT/$p.zip" ::/
98
      mcopy -mi "$4/disk$curdisk.img" "$CDROOT/$p.zip" ::/
99
    fi
99
    fi
100
  done
100
  done
101
 
101
 
102
  # add a short readme
102
  # add a short readme
103
  echo "This directory contains a set of $curdisk floppy images of the SvarDOS distribution in the $4 KB floppy format." > "$4/readme.txt"
103
  echo "This directory contains a set of $curdisk floppy images of the SvarDOS distribution in the $4 KB floppy format." > "$4/readme.txt"
104
  echo "" >> "$4/readme.txt"
104
  echo "" >> "$4/readme.txt"
105
  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"
105
  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"
106
  echo "" >> "$4/readme.txt"
106
  echo "" >> "$4/readme.txt"
107
  echo "Latest SvarDOS version is available on the project's homepage: http://svardos.osdn.io" >> "$4/readme.txt"
107
  echo "Latest SvarDOS version is available on the project's homepage: http://svardos.osdn.io" >> "$4/readme.txt"
108
 
108
 
109
  unix2dos "$4/readme.txt"
109
  unix2dos "$4/readme.txt"
110
 
110
 
111
  # make a copy of the image, if requested
111
  # make a copy of the image, if requested
112
  if [ "x$5" != "x" ] ; then
112
  if [ "x$5" != "x" ] ; then
113
    cp "$4/disk1.img" $5
113
    cp "$4/disk1.img" $5
114
  fi
114
  fi
115
 
115
 
116
  # zip the images (and remove them at the same time)
116
  # zip the images (and remove them at the same time)
117
  rm -f "$PUBDIR/svardos-floppy-$4k.zip"
117
  rm -f "$PUBDIR/svardos-floppy-$4k.zip"
118
  zip -9 -rmj "$PUBDIR/svardos-floppy-$4k.zip" $4/*
118
  zip -9 -rmj "$PUBDIR/svardos-floppy-$4k.zip" $4/*
119
 
119
 
120
  # clean up
120
  # clean up
121
  rmdir $4
121
  rmdir $4
122
}
122
}
123
 
123
 
124
 
124
 
125
### actual code flow starts here ############################################
125
### actual code flow starts here ############################################
126
 
126
 
127
# check presence of the buildidx tool
127
# check presence of the buildidx tool
128
if [ ! -f "$BUILDIDX" ] ; then
128
if [ ! -f "$BUILDIDX" ] ; then
129
  echo "buildidx not found at $BUILDIDX"
129
  echo "buildidx not found at $BUILDIDX"
130
  exit 1
130
  exit 1
131
fi
131
fi
132
 
132
 
133
# remember where I am, so I can get back here once all is done
133
# remember where I am, so I can get back here once all is done
134
origdir=`pwd`
134
origdir=`pwd`
135
 
135
 
136
mkdir "$CDROOT"
136
mkdir "$CDROOT"
137
mkdir "$FLOPROOT"
137
mkdir "$FLOPROOT"
138
 
138
 
139
# build the repo (also builds the listing.txt file)
139
# build the repo (also builds the listing.txt file)
140
dorepo
140
dorepo
141
 
141
 
142
# add CORE packages to CDROOT + create the list of packages on floppy
142
# add CORE packages to CDROOT + create the list of packages on floppy
143
for pkg in $COREPKGS ; do
143
for pkg in $COREPKGS ; do
144
  cp "$REPOROOT/$pkg.zip" "$CDROOT/"
144
  cp "$REPOROOT/$pkg.zip" "$CDROOT/"
145
  echo "$pkg" >> "$FLOPROOT/install.lst"
145
  echo "$pkg" >> "$FLOPROOT/install.lst"
146
done
146
done
147
 
147
 
148
# add EXTRA packages to CDROOT (but not in the list of packages so instal won't install them by default)
148
# add EXTRA packages to CDROOT (but not in the list of packages so instal won't install them by default)
149
for pkg in $EXTRAPKGS ; do
149
for pkg in $EXTRAPKGS ; do
150
  cp "$REPOROOT/$pkg.zip" "$CDROOT/"
150
  cp "$REPOROOT/$pkg.zip" "$CDROOT/"
151
done
151
done
152
 
152
 
153
 
153
 
154
# prepare the content of the boot (install) floppy
154
# prepare the content of the boot (install) floppy
155
cp "install/install.com" "$FLOPROOT/"
155
cp "install/install.com" "$FLOPROOT/"
156
cp "install/nls/"install.?? "$FLOPROOT/"
156
cp "install/nls/"install.?? "$FLOPROOT/"
157
cp -r "$CUSTFILES/floppy/"* "$FLOPROOT/"
157
cp -r "$CUSTFILES/floppy/"* "$FLOPROOT/"
158
unzip -Cj packages/cpidos.zip 'cpi/ega*.cpx' -d "$FLOPROOT/"
158
unzip -Cj packages/cpidos.zip 'cpi/ega*.cpx' -d "$FLOPROOT/"
159
unzip -Cj packages/command.zip bin/command.com -d "$FLOPROOT/"
159
unzip -Cj packages/command.zip bin/command.com -d "$FLOPROOT/"
160
unzip -Cj packages/display.zip bin/display.exe -d "$FLOPROOT/"
160
unzip -Cj packages/display.zip bin/display.exe -d "$FLOPROOT/"
161
unzip -Cj packages/edit.zip bin/edit.exe -d "$FLOPROOT/"
161
unzip -Cj packages/edit.zip bin/edit.exe -d "$FLOPROOT/"
162
unzip -Cj packages/fdapm.zip bin/fdapm.com -d "$FLOPROOT/"
162
unzip -Cj packages/fdapm.zip bin/fdapm.com -d "$FLOPROOT/"
163
unzip -Cj packages/fdisk.zip bin/fdisk.exe bin/fdiskpt.ini -d "$FLOPROOT/"
163
unzip -Cj packages/fdisk.zip bin/fdisk.exe bin/fdiskpt.ini -d "$FLOPROOT/"
164
unzip -Cj packages/format.zip bin/format.exe -d "$FLOPROOT/"
164
unzip -Cj packages/format.zip bin/format.exe -d "$FLOPROOT/"
165
unzip -Cj packages/kernel.zip bin/kernel.sys bin/sys.com -d "$FLOPROOT/"
165
unzip -Cj packages/kernel.zip bin/kernel.sys bin/sys.com -d "$FLOPROOT/"
166
unzip -Cj packages/mem.zip bin/mem.exe -d "$FLOPROOT/"
166
unzip -Cj packages/mem.zip bin/mem.exe -d "$FLOPROOT/"
167
unzip -Cj packages/mode.zip bin/mode.com -d "$FLOPROOT/"
167
unzip -Cj packages/mode.zip bin/mode.com -d "$FLOPROOT/"
168
unzip -Cj packages/more.zip bin/more.exe -d "$FLOPROOT/"
168
unzip -Cj packages/more.zip bin/more.exe -d "$FLOPROOT/"
169
unzip -Cj packages/pkg.zip bin/pkg.exe -d "$FLOPROOT/"
169
unzip -Cj packages/pkg.zip bin/pkg.exe -d "$FLOPROOT/"
170
 
170
 
171
# build the boot (CD) floppy image
171
# build the boot (CD) floppy image
172
export MTOOLS_NO_VFAT=1
172
export MTOOLS_NO_VFAT=1
173
#mformat -C -f 2880 -v SVARDOS -B "$CUSTFILES/floppy.mbr" -i "$CDROOT/boot.img"
173
#mformat -C -f 2880 -v SVARDOS -B "$CUSTFILES/floppy.mbr" -i "$CDROOT/boot.img"
174
#mcopy -sQm -i "$CDROOT/boot.img" "$FLOPROOT/"* ::/
174
#mcopy -sQm -i "$CDROOT/boot.img" "$FLOPROOT/"* ::/
175
 
175
 
176
# prepare images for floppies in different sizes (args are C H S SIZE)
176
# prepare images for floppies in different sizes (args are C H S SIZE)
177
prep_flop 80 2 36 2880 "$CDROOT/boot.img"
177
prep_flop 80 2 36 2880 "$CDROOT/boot.img"
178
prep_flop 80 2 18 1440
178
prep_flop 80 2 18 1440
179
prep_flop 80 2 15 1200
179
prep_flop 80 2 15 1200
180
prep_flop 80 2  9  720
180
prep_flop 80 2  9  720
181
#prep_flop 96 64 32 98304 "$PUBDIR/svardos-zip100.img" # ZIP 100M (for USB boot in "USB-ZIP mode")
181
#prep_flop 96 64 32 98304 "$PUBDIR/svardos-zip100.img" # ZIP 100M (for USB boot in "USB-ZIP mode")
182
 
182
 
183
# prepare the DOSEMU boot zip
183
# prepare the DOSEMU boot zip
184
DOSEMUDIR='dosemu-prep-files'
184
DOSEMUDIR='dosemu-prep-files'
185
mkdir "$DOSEMUDIR"
185
mkdir "$DOSEMUDIR"
186
# INSTALL.BAT
186
# INSTALL.BAT
187
echo 'IF NOT EXIST C:\TMP\NUL MKDIR C:\TMP'
187
echo 'IF NOT EXIST C:\TMP\NUL MKDIR C:\TMP'
188
echo 'mkdir %DOSDIR%' >> "$DOSEMUDIR/install.bat"
188
echo 'mkdir %DOSDIR%' >> "$DOSEMUDIR/install.bat"
189
echo 'mkdir %DOSDIR%\cfg' >> "$DOSEMUDIR/install.bat"
189
echo 'mkdir %DOSDIR%\cfg' >> "$DOSEMUDIR/install.bat"
190
echo 'ECHO # pkg config file - specifies locations where packages should be installed >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
190
echo 'ECHO # pkg config file - specifies locations where packages should be installed >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
191
echo 'ECHO DIR PROGS C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
191
echo 'ECHO DIR PROGS C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
192
echo 'ECHO DIR GAMES C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
192
echo 'ECHO DIR GAMES C:\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
193
echo 'ECHO DIR DRIVERS C:\DRIVERS\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
193
echo 'ECHO DIR DRIVERS C:\DRIVERS\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
194
echo 'ECHO DIR DEVEL C:\DEVEL\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
194
echo 'ECHO DIR DEVEL C:\DEVEL\ >> %DOSDIR%\cfg\pkg.cfg' >> "$DOSEMUDIR/install.bat"
195
for p in $COREPKGS ; do
195
for p in $COREPKGS ; do
196
  cp "$CDROOT/$p.zip" "$DOSEMUDIR/"
196
  cp "$CDROOT/$p.zip" "$DOSEMUDIR/"
197
  echo "pkg install $p.zip" >> "$DOSEMUDIR/install.bat"
197
  echo "pkg install $p.zip" >> "$DOSEMUDIR/install.bat"
198
  echo "del $p.zip" >> "$DOSEMUDIR/install.bat"
198
  echo "del $p.zip" >> "$DOSEMUDIR/install.bat"
199
done
199
done
200
echo 'ECHO my_ip = dhcp >> %DOSDIR%\CFG\WATTCP.CFG' >> "$DOSEMUDIR/install.bat"
200
echo 'ECHO my_ip = dhcp >> %DOSDIR%\CFG\WATTCP.CFG' >> "$DOSEMUDIR/install.bat"
201
echo 'del pkg.exe' >> "$DOSEMUDIR/install.bat"
201
echo 'del pkg.exe' >> "$DOSEMUDIR/install.bat"
202
echo 'ECHO SHELLHIGH=C:\SVARDOS\BIN\COMMAND.COM /P >> C:\CONFIG.SYS' >> "$DOSEMUDIR/install.bat"
202
echo 'ECHO SHELLHIGH=C:\SVARDOS\BIN\COMMAND.COM /P >> C:\CONFIG.SYS' >> "$DOSEMUDIR/install.bat"
203
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
203
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
204
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
204
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
205
echo 'ECHO  SVARDOS SETUP COMPLETED ' >> "$DOSEMUDIR/install.bat"
205
echo 'ECHO  SVARDOS SETUP COMPLETED ' >> "$DOSEMUDIR/install.bat"
206
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
206
echo 'ECHO -------------------------' >> "$DOSEMUDIR/install.bat"
207
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
207
echo 'ECHO.' >> "$DOSEMUDIR/install.bat"
208
unzip -Cj packages/kernel.zip bin/kernel.sys -d "$DOSEMUDIR/"
208
unzip -Cj packages/kernel.zip bin/kernel.sys -d "$DOSEMUDIR/"
209
unzip -Cj packages/command.zip bin/command.com -d "$DOSEMUDIR/"
209
unzip -Cj packages/command.zip bin/command.com -d "$DOSEMUDIR/"
210
unzip -Cj packages/pkg.zip bin/pkg.exe -d "$DOSEMUDIR/"
210
unzip -Cj packages/pkg.zip bin/pkg.exe -d "$DOSEMUDIR/"
211
# CONFIG.SYS
211
# CONFIG.SYS
212
echo 'FILES=50' >> "$DOSEMUDIR/config.sys"
212
echo 'FILES=50' >> "$DOSEMUDIR/config.sys"
213
echo 'DOS=HIGH,UMB' >> "$DOSEMUDIR/config.sys"
213
echo 'DOS=HIGH,UMB' >> "$DOSEMUDIR/config.sys"
214
echo 'DOSDATA=UMB' >> "$DOSEMUDIR/config.sys"
214
echo 'DOSDATA=UMB' >> "$DOSEMUDIR/config.sys"
215
echo 'DEVICE=D:\dosemu\emufs.sys' >> "$DOSEMUDIR/config.sys"
215
echo 'DEVICE=D:\dosemu\emufs.sys' >> "$DOSEMUDIR/config.sys"
216
echo 'DEVICE=D:\dosemu\umb.sys' >> "$DOSEMUDIR/config.sys"
216
echo 'DEVICE=D:\dosemu\umb.sys' >> "$DOSEMUDIR/config.sys"
217
echo 'DEVICEHIGH=D:\dosemu\ems.sys' >> "$DOSEMUDIR/config.sys"
217
echo 'DEVICEHIGH=D:\dosemu\ems.sys' >> "$DOSEMUDIR/config.sys"
218
echo 'INSTALL=D:\dosemu\emufs.com' >> "$DOSEMUDIR/config.sys"
218
echo 'INSTALL=D:\dosemu\emufs.com' >> "$DOSEMUDIR/config.sys"
219
# AUTOEXEC.BAT
219
# AUTOEXEC.BAT
220
echo "@ECHO OFF" >> "$DOSEMUDIR/autoexec.bat"
220
echo "@ECHO OFF" >> "$DOSEMUDIR/autoexec.bat"
221
echo 'SET DOSDIR=C:\SVARDOS' >> "$DOSEMUDIR/autoexec.bat"
221
echo 'SET DOSDIR=C:\SVARDOS' >> "$DOSEMUDIR/autoexec.bat"
222
echo 'SET WATTCP.CFG=%DOSDIR%\CFG' >> "$DOSEMUDIR/autoexec.bat"
222
echo 'SET WATTCP.CFG=%DOSDIR%\CFG' >> "$DOSEMUDIR/autoexec.bat"
223
echo 'SET DIRCMD=/p/ogne' >> "$DOSEMUDIR/autoexec.bat"
223
echo 'SET DIRCMD=/p/ogne' >> "$DOSEMUDIR/autoexec.bat"
224
echo 'SET TEMP=C:\TMP' >> "$DOSEMUDIR/autoexec.bat"
224
echo 'SET TEMP=C:\TMP' >> "$DOSEMUDIR/autoexec.bat"
225
echo 'PATH %DOSDIR%\BIN' >> "$DOSEMUDIR/autoexec.bat"
225
echo 'PATH %DOSDIR%\BIN' >> "$DOSEMUDIR/autoexec.bat"
226
echo "" >> "$DOSEMUDIR/autoexec.bat"
226
echo "" >> "$DOSEMUDIR/autoexec.bat"
227
echo "REM *** this is a one-time setup script used only during first initialization ***" >> "$DOSEMUDIR/autoexec.bat"
227
echo "REM *** this is a one-time setup script used only during first initialization ***" >> "$DOSEMUDIR/autoexec.bat"
228
echo 'IF EXIST INSTALL.BAT CALL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
228
echo 'IF EXIST INSTALL.BAT CALL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
229
echo 'IF EXIST INSTALL.BAT DEL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
229
echo 'IF EXIST INSTALL.BAT DEL INSTALL.BAT' >> "$DOSEMUDIR/autoexec.bat"
230
echo "" >> "$DOSEMUDIR/autoexec.bat"
230
echo "" >> "$DOSEMUDIR/autoexec.bat"
231
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
231
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
232
echo "ECHO Welcome to SvarDOS (powered by DOSEMU)! Type HELP if you are lost." >> "$DOSEMUDIR/autoexec.bat"
232
echo "ECHO Welcome to SvarDOS (powered by DOSEMU)! Type HELP if you are lost." >> "$DOSEMUDIR/autoexec.bat"
233
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
233
echo "ECHO." >> "$DOSEMUDIR/autoexec.bat"
234
rm -f "$PUBDIR/svardos-dosemu.zip"
234
rm -f "$PUBDIR/svardos-dosemu.zip"
235
zip -rm9jk "$PUBDIR/svardos-dosemu.zip" "$DOSEMUDIR"
235
zip -rm9jk "$PUBDIR/svardos-dosemu.zip" "$DOSEMUDIR"
236
rmdir "$DOSEMUDIR"
236
rmdir "$DOSEMUDIR"
237
 
237
 
238
# prepare the USB bootable image
238
# prepare the USB bootable image
239
USBIMG=$PUBDIR/svardos-usb.img
239
USBIMG=$PUBDIR/svardos-usb.img
240
cp files/boot-svardos.img $USBIMG
240
cp files/boot-svardos.img $USBIMG
241
mcopy -sQm -i "$USBIMG@@32256" "$FLOPROOT/"* ::/
241
mcopy -sQm -i "$USBIMG@@32256" "$FLOPROOT/"* ::/
242
for p in $ALLPKGS ; do
242
for p in $ALLPKGS ; do
243
  mcopy -mi "$USBIMG@@32256" "$CDROOT/$p.zip" ::/
243
  mcopy -mi "$USBIMG@@32256" "$CDROOT/$p.zip" ::/
244
done
244
done
245
 
245
 
246
# compress the USB image
246
# compress the USB image
247
rm -f "$PUBDIR/svardos-usb.zip"
247
rm -f "$PUBDIR/svardos-usb.zip"
248
zip -mj9 "$PUBDIR/svardos-usb.zip" "$USBIMG"
248
zip -mj9 "$PUBDIR/svardos-usb.zip" "$USBIMG"
249
 
249
 
250
# prepare the USB-ZIP bootable image
250
# prepare the USB-ZIP bootable image
251
#USBZIPIMG=$PUBDIR/svardos-usbzip.img
251
#USBZIPIMG=$PUBDIR/svardos-usbzip.img
252
#cat files/usb-zip.mbr "$PUBDIR/svardos-zip100.img" > $USBZIPIMG
252
#cat files/usb-zip.mbr "$PUBDIR/svardos-zip100.img" > $USBZIPIMG
253
 
253
 
254
CDISO="$PUBDIR/svardos-cd.iso"
254
CDISO="$PUBDIR/svardos-cd.iso"
255
CDZIP="$PUBDIR/svardos-cd.zip"
255
CDZIP="$PUBDIR/svardos-cd.zip"
256
 
256
 
257
# delete previous (if any) iso
257
# delete previous (if any) iso
258
echo "cleaning up old versions..."
258
echo "cleaning up old versions..."
259
rm -f "$CDISO" "$CDZIP"
259
rm -f "$CDISO" "$CDZIP"
260
 
260
 
261
$GENISOIMAGE -input-charset cp437 -b boot.img -iso-level 1 -f -V SVARDOS -o "$CDISO" "$CDROOT/boot.img"
261
$GENISOIMAGE -input-charset cp437 -b boot.img -iso-level 1 -f -V SVARDOS -o "$CDISO" "$CDROOT/boot.img"
262
 
262
 
263
# compress the ISO
263
# compress the ISO
264
zip -mj9 "$CDZIP" "$CDISO"
264
zip -mj9 "$CDZIP" "$CDISO"
265
 
265
 
266
# cleanup temporary things
266
# cleanup temporary things
267
if [ "x$1" != "xnoclean" ] ; then
267
if [ "x$1" != "xnoclean" ] ; then
268
  rm -rf "$CDROOT" "$FLOPROOT"
268
  rm -rf "$CDROOT" "$FLOPROOT"
269
fi
269
fi
270
 
270
 
271
cd "$origdir"
271
cd "$origdir"
272
 
272
 
273
#cd svnlschk
273
#cd svnlschk
274
#./webgen.sh
274
#./webgen.sh
275
#cd ..
275
#cd ..
276
 
276
 
277
echo "ALL DONE!"
277
echo "ALL DONE!"
278
 
278
 
279
exit 0
279
exit 0
280
 
280