1 |
#!/bin/sh
|
1 |
#!/bin/sh
|
2 |
#
|
2 |
#
|
3 |
# This script generates indexes of Svarog386 repositories and builds the ISO
|
3 |
# This script generates indexes of Svarog386 repositories and builds the ISO
|
4 |
# CD images. It should be executed each time that a package file have been
|
4 |
# CD images. It should be executed each time that a package file have been
|
5 |
# modified, added or removed from any of the repositories.
|
5 |
# modified, added or removed from any of the repositories.
|
6 |
#
|
6 |
#
|
7 |
|
7 |
|
8 |
### parameters block starts here ############################################
|
8 |
### parameters block starts here ############################################
|
9 |
|
9 |
|
10 |
REPOROOT=/srv/www/svarog386.viste.fr/repos/
|
10 |
REPOROOT=/srv/www/svarog386.viste.fr/repos/
|
11 |
REPOROOTNOSRC=/srv/www/svarog386.viste.fr/repos-nosrc/
|
11 |
REPOROOTNOSRC=/srv/www/svarog386.viste.fr/repos-nosrc/
|
12 |
BUILDIDX=/root/fdnpkg-buildidx/buildidx
|
12 |
BUILDIDX=/root/fdnpkg-buildidx/buildidx
|
13 |
CDISODIR='/srv/www/svarog386.viste.fr/'
|
13 |
CDISODIR='/srv/www/svarog386.viste.fr/'
|
14 |
CDROOT='/root/svarog386/cdroot'
|
14 |
CDROOT='/root/svarog386/cdroot'
|
15 |
CDROOTNOSRC='/root/svarog386/cdrootnosrc'
|
15 |
CDROOTNOSRC='/root/svarog386/cdrootnosrc'
|
16 |
CDROOTMICRO='/root/svarog386/cdrootmicro'
|
16 |
CDROOTMICRO='/root/svarog386/cdrootmicro'
|
- |
|
17 |
CUSTFILES='/root/svarog386/files'
|
17 |
|
18 |
|
18 |
### parameters block ends here ##############################################
|
19 |
### parameters block ends here ##############################################
|
19 |
|
20 |
|
20 |
# remember where we are, so we can return there once all is done
|
21 |
# remember where we are, so we can return there once all is done
|
21 |
origdir=`pwd`
|
22 |
origdir=`pwd`
|
22 |
|
23 |
|
23 |
# clone the repositories into future 'no source' versions
|
24 |
# clone the repositories into future 'no source' versions
|
24 |
echo "cloning $REPOROOT to $REPOROOTNOSRC..."
|
25 |
echo "cloning $REPOROOT to $REPOROOTNOSRC..."
|
25 |
rsync -a --delete $REPOROOT $REPOROOTNOSRC
|
26 |
rsync -a --delete $REPOROOT $REPOROOTNOSRC
|
26 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
27 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
27 |
|
28 |
|
- |
|
29 |
# build the boot floppy image first
|
- |
|
30 |
cp $CUSTFILES/bootmini.img $CDROOT/boot.img
|
- |
|
31 |
mcopy -i $CDROOT/boot.img $CUSTFILES/install.com ::/INSTALL.COM
|
- |
|
32 |
mcopy -i $CDROOT/boot.img $CUSTFILES/autoexec.bat ::/AUTOEXEC.BAT
|
- |
|
33 |
mcopy -i $CDROOT/boot.img $CUSTFILES/config.sys ::/CONFIG.SYS
|
- |
|
34 |
mcopy -i $CDROOT/boot.img $CUSTFILES/display.exe ::/DISPLAY.EXE
|
- |
|
35 |
mcopy -i $CDROOT/boot.img $CUSTFILES/fdnpkg.cfg ::/FDNPKG.CFG
|
- |
|
36 |
mcopy -i $CDROOT/boot.img $CUSTFILES/mode.com ::/MODE.COM
|
- |
|
37 |
mcopy -i $CDROOT/boot.img $CUSTFILES/ega.cpx ::/EGA.CPX
|
- |
|
38 |
mcopy -i $CDROOT/boot.img $CUSTFILES/ega2.cpx ::/EGA2.CPX
|
- |
|
39 |
mcopy -i $CDROOT/boot.img $CUSTFILES/ega3.cpx ::/EGA3.CPX
|
- |
|
40 |
mcopy -i $CDROOT/boot.img $CUSTFILES/ega4.cpx ::/EGA4.CPX
|
- |
|
41 |
mcopy -i $CDROOT/boot.img $CUSTFILES/ega5.cpx ::/EGA5.CPX
|
- |
|
42 |
mcopy -i $CDROOT/boot.img $CUSTFILES/ega6.cpx ::/EGA6.CPX
|
- |
|
43 |
mcopy -i $CDROOT/boot.img $CUSTFILES/ega7.cpx ::/EGA7.CPX
|
- |
|
44 |
mcopy -i $CDROOT/boot.img $CUSTFILES/ega8.cpx ::/EGA8.CPX
|
- |
|
45 |
mcopy -i $CDROOT/boot.img $CUSTFILES/ega9.cpx ::/EGA9.CPX
|
- |
|
46 |
mcopy -i $CDROOT/boot.img $CUSTFILES/ega10.cpx ::/EGA10.CPX
|
- |
|
47 |
mmd -i $CDROOT/boot.img ::/NLS
|
- |
|
48 |
mcopy -i $CDROOT/boot.img $CUSTFILES/nls/*.* ::/NLS/
|
- |
|
49 |
|
28 |
# sync the boot.img file from full version to nosrc and micro
|
50 |
# sync the boot.img file from full version to nosrc and micro
|
29 |
cp $CDROOT/boot.img $CDROOTNOSRC/
|
51 |
cp $CDROOT/boot.img $CDROOTNOSRC/
|
30 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
52 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
31 |
cp $CDROOT/boot.img $CDROOTMICRO/
|
53 |
cp $CDROOT/boot.img $CDROOTMICRO/
|
32 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
54 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
33 |
|
55 |
|
34 |
# now strip the sources from the 'no source' clone
|
56 |
# now strip the sources from the 'no source' clone
|
35 |
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "SOURCE/*" ';'
|
57 |
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "SOURCE/*" ';'
|
36 |
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "source/*" ';'
|
58 |
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "source/*" ';'
|
37 |
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "Source/*" ';'
|
59 |
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "Source/*" ';'
|
38 |
|
60 |
|
39 |
# refresh all repositories
|
61 |
# refresh all repositories
|
40 |
$BUILDIDX $REPOROOT/base && $BUILDIDX $REPOROOTNOSRC/base
|
62 |
$BUILDIDX $REPOROOT/base && $BUILDIDX $REPOROOTNOSRC/base
|
41 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
63 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
42 |
$BUILDIDX $REPOROOT/devel && $BUILDIDX $REPOROOTNOSRC/devel
|
64 |
$BUILDIDX $REPOROOT/devel && $BUILDIDX $REPOROOTNOSRC/devel
|
43 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
65 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
44 |
$BUILDIDX $REPOROOT/drivers && $BUILDIDX $REPOROOTNOSRC/drivers
|
66 |
$BUILDIDX $REPOROOT/drivers && $BUILDIDX $REPOROOTNOSRC/drivers
|
45 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
67 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
46 |
$BUILDIDX $REPOROOT/edit && $BUILDIDX $REPOROOTNOSRC/edit
|
68 |
$BUILDIDX $REPOROOT/edit && $BUILDIDX $REPOROOTNOSRC/edit
|
47 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
69 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
48 |
$BUILDIDX $REPOROOT/emulatrs && $BUILDIDX $REPOROOTNOSRC/emulatrs
|
70 |
$BUILDIDX $REPOROOT/emulatrs && $BUILDIDX $REPOROOTNOSRC/emulatrs
|
49 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
71 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
50 |
$BUILDIDX $REPOROOT/games && $BUILDIDX $REPOROOTNOSRC/games
|
72 |
$BUILDIDX $REPOROOT/games && $BUILDIDX $REPOROOTNOSRC/games
|
51 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
73 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
52 |
$BUILDIDX $REPOROOT/net && $BUILDIDX $REPOROOTNOSRC/net
|
74 |
$BUILDIDX $REPOROOT/net && $BUILDIDX $REPOROOTNOSRC/net
|
53 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
75 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
54 |
$BUILDIDX $REPOROOT/packers && $BUILDIDX $REPOROOTNOSRC/packers
|
76 |
$BUILDIDX $REPOROOT/packers && $BUILDIDX $REPOROOTNOSRC/packers
|
55 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
77 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
56 |
$BUILDIDX $REPOROOT/sound && $BUILDIDX $REPOROOTNOSRC/sound
|
78 |
$BUILDIDX $REPOROOT/sound && $BUILDIDX $REPOROOTNOSRC/sound
|
57 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
79 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
58 |
$BUILDIDX $REPOROOT/util && $BUILDIDX $REPOROOTNOSRC/util
|
80 |
$BUILDIDX $REPOROOT/util && $BUILDIDX $REPOROOTNOSRC/util
|
59 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
81 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
60 |
|
82 |
|
61 |
# recompute the listing.txt file
|
83 |
# recompute the listing.txt file
|
62 |
rm $CDISODIR/listing.txt
|
84 |
rm $CDISODIR/listing.txt
|
63 |
cat $REPOROOT/base/listing.txt >> $CDISODIR/listing.txt
|
85 |
cat $REPOROOT/base/listing.txt >> $CDISODIR/listing.txt
|
64 |
cat $REPOROOT/devel/listing.txt >> $CDISODIR/listing.txt
|
86 |
cat $REPOROOT/devel/listing.txt >> $CDISODIR/listing.txt
|
65 |
cat $REPOROOT/drivers/listing.txt >> $CDISODIR/listing.txt
|
87 |
cat $REPOROOT/drivers/listing.txt >> $CDISODIR/listing.txt
|
66 |
cat $REPOROOT/edit/listing.txt >> $CDISODIR/listing.txt
|
88 |
cat $REPOROOT/edit/listing.txt >> $CDISODIR/listing.txt
|
67 |
cat $REPOROOT/emulatrs/listing.txt >> $CDISODIR/listing.txt
|
89 |
cat $REPOROOT/emulatrs/listing.txt >> $CDISODIR/listing.txt
|
68 |
cat $REPOROOT/games/listing.txt >> $CDISODIR/listing.txt
|
90 |
cat $REPOROOT/games/listing.txt >> $CDISODIR/listing.txt
|
69 |
cat $REPOROOT/net/listing.txt >> $CDISODIR/listing.txt
|
91 |
cat $REPOROOT/net/listing.txt >> $CDISODIR/listing.txt
|
70 |
cat $REPOROOT/packers/listing.txt >> $CDISODIR/listing.txt
|
92 |
cat $REPOROOT/packers/listing.txt >> $CDISODIR/listing.txt
|
71 |
cat $REPOROOT/sound/listing.txt >> $CDISODIR/listing.txt
|
93 |
cat $REPOROOT/sound/listing.txt >> $CDISODIR/listing.txt
|
72 |
cat $REPOROOT/util/listing.txt >> $CDISODIR/listing.txt
|
94 |
cat $REPOROOT/util/listing.txt >> $CDISODIR/listing.txt
|
73 |
|
95 |
|
74 |
# compute a filename for the ISO files and build it
|
96 |
# compute a filename for the ISO files and build it
|
75 |
DATESTAMP=`date +%Y%m%d-%H%M`
|
97 |
DATESTAMP=`date +%Y%m%d-%H%M`
|
76 |
CDISO="$CDISODIR/svarog386-full-$DATESTAMP.iso"
|
98 |
CDISO="$CDISODIR/svarog386-full-$DATESTAMP.iso"
|
77 |
CDISONOSRC="$CDISODIR/svarog386-nosrc-$DATESTAMP.iso"
|
99 |
CDISONOSRC="$CDISODIR/svarog386-nosrc-$DATESTAMP.iso"
|
78 |
CDISOMICRO="$CDISODIR/svarog386-micro-$DATESTAMP.iso"
|
100 |
CDISOMICRO="$CDISODIR/svarog386-micro-$DATESTAMP.iso"
|
79 |
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -o $CDISO.tmp $CDROOT
|
101 |
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -o $CDISO.tmp $CDROOT
|
80 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
102 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
81 |
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -o $CDISONOSRC.tmp $CDROOTNOSRC
|
103 |
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -o $CDISONOSRC.tmp $CDROOTNOSRC
|
82 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
104 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
83 |
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -o $CDISOMICRO.tmp $CDROOTMICRO
|
105 |
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -o $CDISOMICRO.tmp $CDROOTMICRO
|
84 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
106 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
85 |
mv $CDISO.tmp $CDISO
|
107 |
mv $CDISO.tmp $CDISO
|
86 |
mv $CDISONOSRC.tmp $CDISONOSRC
|
108 |
mv $CDISONOSRC.tmp $CDISONOSRC
|
87 |
mv $CDISOMICRO.tmp $CDISOMICRO
|
109 |
mv $CDISOMICRO.tmp $CDISOMICRO
|
88 |
|
110 |
|
89 |
# compute the MD5 of the ISO files, taking care to include only the filename in it
|
111 |
# compute the MD5 of the ISO files, taking care to include only the filename in it
|
90 |
echo "computing md5 sums..."
|
112 |
echo "computing md5 sums..."
|
91 |
cd `dirname $CDISO`
|
113 |
cd `dirname $CDISO`
|
92 |
md5sum `basename $CDISO` > $CDISO.md5
|
114 |
md5sum `basename $CDISO` > $CDISO.md5
|
93 |
|
115 |
|
94 |
cd `dirname $CDISONOSRC`
|
116 |
cd `dirname $CDISONOSRC`
|
95 |
md5sum `basename $CDISONOSRC` > $CDISONOSRC.md5
|
117 |
md5sum `basename $CDISONOSRC` > $CDISONOSRC.md5
|
96 |
|
118 |
|
97 |
cd `dirname $CDISOMICRO`
|
119 |
cd `dirname $CDISOMICRO`
|
98 |
md5sum `basename $CDISOMICRO` > $CDISOMICRO.md5
|
120 |
md5sum `basename $CDISOMICRO` > $CDISOMICRO.md5
|
99 |
|
121 |
|
100 |
# delete all *.iso and *.md5 files, leaving only the 16 most recent
|
122 |
# delete all *.iso and *.md5 files, leaving only the 16 most recent
|
101 |
echo "cleaning up old versions..."
|
123 |
echo "cleaning up old versions..."
|
102 |
ls -tp $CDISODIR/svarog386-*-*.iso* | tail -n +17 | xargs -I {} rm -- {}
|
124 |
ls -tp $CDISODIR/svarog386-*-*.iso* | tail -n +17 | xargs -I {} rm -- {}
|
103 |
|
125 |
|
104 |
cd "$origdir"
|
126 |
cd "$origdir"
|
105 |
|
127 |
|
106 |
echo "all done!"
|
128 |
echo "all done!"
|
107 |
|
129 |
|
108 |
exit 0
|
130 |
exit 0
|
109 |
|
131 |
|