2 |
mv_fox |
1 |
#!/bin/sh
|
11 |
mv_fox |
2 |
#
|
|
|
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
|
|
|
5 |
# modified, added or removed from any of the repositories.
|
|
|
6 |
#
|
2 |
mv_fox |
7 |
|
11 |
mv_fox |
8 |
### parameters block starts here ############################################
|
|
|
9 |
|
2 |
mv_fox |
10 |
REPOROOT=/srv/www/svarog386.viste.fr/repos/
|
16 |
mv_fox |
11 |
REPOROOTNOSRC=/srv/www/svarog386.viste.fr/repos-nosrc/
|
2 |
mv_fox |
12 |
BUILDIDX=/root/fdnpkg-buildidx/buildidx
|
11 |
mv_fox |
13 |
CDISODIR='/srv/www/svarog386.viste.fr/'
|
|
|
14 |
CDROOT='/root/svarog386/cdroot'
|
16 |
mv_fox |
15 |
CDROOTNOSRC='/root/svarog386/cdrootnosrc'
|
24 |
mv_fox |
16 |
CDROOTMICRO='/root/svarog386/cdrootmicro'
|
44 |
mv_fox |
17 |
CUSTFILES='/root/svarog386/files'
|
2 |
mv_fox |
18 |
|
11 |
mv_fox |
19 |
### parameters block ends here ##############################################
|
|
|
20 |
|
|
|
21 |
# remember where we are, so we can return there once all is done
|
|
|
22 |
origdir=`pwd`
|
|
|
23 |
|
16 |
mv_fox |
24 |
# clone the repositories into future 'no source' versions
|
|
|
25 |
echo "cloning $REPOROOT to $REPOROOTNOSRC..."
|
|
|
26 |
rsync -a --delete $REPOROOT $REPOROOTNOSRC
|
2 |
mv_fox |
27 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
16 |
mv_fox |
28 |
|
44 |
mv_fox |
29 |
# build the boot floppy image first
|
|
|
30 |
cp $CUSTFILES/bootmini.img $CDROOT/boot.img
|
52 |
mv_fox |
31 |
export MTOOLS_NO_VFAT=1
|
|
|
32 |
mcopy -sQm -i $CDROOT/boot.img $CUSTFILES/floppy/* ::/
|
44 |
mv_fox |
33 |
|
24 |
mv_fox |
34 |
# sync the boot.img file from full version to nosrc and micro
|
16 |
mv_fox |
35 |
cp $CDROOT/boot.img $CDROOTNOSRC/
|
2 |
mv_fox |
36 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
24 |
mv_fox |
37 |
cp $CDROOT/boot.img $CDROOTMICRO/
|
|
|
38 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
16 |
mv_fox |
39 |
|
|
|
40 |
# now strip the sources from the 'no source' clone
|
|
|
41 |
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "SOURCE/*" ';'
|
|
|
42 |
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "source/*" ';'
|
|
|
43 |
find $REPOROOTNOSRC/ -iname '*.zip' -exec zip "{}" -d "Source/*" ';'
|
|
|
44 |
|
|
|
45 |
# refresh all repositories
|
52 |
mv_fox |
46 |
$BUILDIDX $REPOROOT/core && $BUILDIDX $REPOROOTNOSRC/core
|
2 |
mv_fox |
47 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
16 |
mv_fox |
48 |
$BUILDIDX $REPOROOT/devel && $BUILDIDX $REPOROOTNOSRC/devel
|
2 |
mv_fox |
49 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
16 |
mv_fox |
50 |
$BUILDIDX $REPOROOT/drivers && $BUILDIDX $REPOROOTNOSRC/drivers
|
2 |
mv_fox |
51 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
16 |
mv_fox |
52 |
$BUILDIDX $REPOROOT/edit && $BUILDIDX $REPOROOTNOSRC/edit
|
2 |
mv_fox |
53 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
16 |
mv_fox |
54 |
$BUILDIDX $REPOROOT/emulatrs && $BUILDIDX $REPOROOTNOSRC/emulatrs
|
2 |
mv_fox |
55 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
16 |
mv_fox |
56 |
$BUILDIDX $REPOROOT/games && $BUILDIDX $REPOROOTNOSRC/games
|
2 |
mv_fox |
57 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
16 |
mv_fox |
58 |
$BUILDIDX $REPOROOT/net && $BUILDIDX $REPOROOTNOSRC/net
|
2 |
mv_fox |
59 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
16 |
mv_fox |
60 |
$BUILDIDX $REPOROOT/packers && $BUILDIDX $REPOROOTNOSRC/packers
|
|
|
61 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
|
|
62 |
$BUILDIDX $REPOROOT/sound && $BUILDIDX $REPOROOTNOSRC/sound
|
|
|
63 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
|
|
64 |
$BUILDIDX $REPOROOT/util && $BUILDIDX $REPOROOTNOSRC/util
|
|
|
65 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
2 |
mv_fox |
66 |
|
25 |
mv_fox |
67 |
# recompute the listing.txt file
|
|
|
68 |
rm $CDISODIR/listing.txt
|
52 |
mv_fox |
69 |
cat $REPOROOT/core/listing.txt >> $CDISODIR/listing.txt
|
25 |
mv_fox |
70 |
cat $REPOROOT/devel/listing.txt >> $CDISODIR/listing.txt
|
|
|
71 |
cat $REPOROOT/drivers/listing.txt >> $CDISODIR/listing.txt
|
|
|
72 |
cat $REPOROOT/edit/listing.txt >> $CDISODIR/listing.txt
|
|
|
73 |
cat $REPOROOT/emulatrs/listing.txt >> $CDISODIR/listing.txt
|
|
|
74 |
cat $REPOROOT/games/listing.txt >> $CDISODIR/listing.txt
|
|
|
75 |
cat $REPOROOT/net/listing.txt >> $CDISODIR/listing.txt
|
|
|
76 |
cat $REPOROOT/packers/listing.txt >> $CDISODIR/listing.txt
|
|
|
77 |
cat $REPOROOT/sound/listing.txt >> $CDISODIR/listing.txt
|
|
|
78 |
cat $REPOROOT/util/listing.txt >> $CDISODIR/listing.txt
|
|
|
79 |
|
16 |
mv_fox |
80 |
# compute a filename for the ISO files and build it
|
|
|
81 |
DATESTAMP=`date +%Y%m%d-%H%M`
|
|
|
82 |
CDISO="$CDISODIR/svarog386-full-$DATESTAMP.iso"
|
|
|
83 |
CDISONOSRC="$CDISODIR/svarog386-nosrc-$DATESTAMP.iso"
|
24 |
mv_fox |
84 |
CDISOMICRO="$CDISODIR/svarog386-micro-$DATESTAMP.iso"
|
63 |
mv_fox |
85 |
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -V SVAROG386 -o $CDISO.tmp $CDROOT
|
11 |
mv_fox |
86 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
63 |
mv_fox |
87 |
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -V SVAROG386 -o $CDISONOSRC.tmp $CDROOTNOSRC
|
16 |
mv_fox |
88 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
63 |
mv_fox |
89 |
genisoimage -input-charset cp437 -b boot.img -iso-level 1 -f -V SVAROG386 -o $CDISOMICRO.tmp $CDROOTMICRO
|
24 |
mv_fox |
90 |
if [ $? -ne 0 ] ; then exit 1 ; fi
|
11 |
mv_fox |
91 |
mv $CDISO.tmp $CDISO
|
16 |
mv_fox |
92 |
mv $CDISONOSRC.tmp $CDISONOSRC
|
24 |
mv_fox |
93 |
mv $CDISOMICRO.tmp $CDISOMICRO
|
2 |
mv_fox |
94 |
|
16 |
mv_fox |
95 |
# compute the MD5 of the ISO files, taking care to include only the filename in it
|
|
|
96 |
echo "computing md5 sums..."
|
11 |
mv_fox |
97 |
cd `dirname $CDISO`
|
|
|
98 |
md5sum `basename $CDISO` > $CDISO.md5
|
|
|
99 |
|
16 |
mv_fox |
100 |
cd `dirname $CDISONOSRC`
|
|
|
101 |
md5sum `basename $CDISONOSRC` > $CDISONOSRC.md5
|
|
|
102 |
|
24 |
mv_fox |
103 |
cd `dirname $CDISOMICRO`
|
|
|
104 |
md5sum `basename $CDISOMICRO` > $CDISOMICRO.md5
|
|
|
105 |
|
26 |
mv_fox |
106 |
# delete all *.iso and *.md5 files, leaving only the 16 most recent
|
|
|
107 |
echo "cleaning up old versions..."
|
|
|
108 |
ls -tp $CDISODIR/svarog386-*-*.iso* | tail -n +17 | xargs -I {} rm -- {}
|
|
|
109 |
|
11 |
mv_fox |
110 |
cd "$origdir"
|
|
|
111 |
|
16 |
mv_fox |
112 |
echo "all done!"
|
|
|
113 |
|
2 |
mv_fox |
114 |
exit 0
|