1 |
#!/bin/sh |
#!/bin/sh |
2 |
|
|
3 |
if [ -d cdrom.image ] |
distname='SME Server' |
4 |
|
disttag='smeserver' |
5 |
|
distvers=$(basename $(readlink -f $(pwd))) |
6 |
|
distrel=${distvers:0:1} |
7 |
|
distarch=$(uname -i) |
8 |
|
|
9 |
|
exec < /dev/null |
10 |
|
exec &> build_ISO.$distarch |
11 |
|
|
12 |
|
if ! [ -d $distarch ] |
13 |
then |
then |
14 |
distname='SME Server' |
echo "No $distarch directory?" |
15 |
disttag='smeserver' |
exit 1 |
|
distvers=$(basename $(pwd)) |
|
|
|
|
|
[ -f cdrom.image/updates/anaconda ] && chmod a+rx cdrom.image/updates/anaconda |
|
|
|
|
|
for img in product updates |
|
|
do |
|
|
/usr/bin/mkcramfs \ |
|
|
$(pwd)/cdrom.image/$img \ |
|
|
$(pwd)/cdrom.image/SME/base/$img.img |
|
|
done |
|
|
|
|
|
PYTHONPATH=/usr/lib/anaconda/ /usr/lib/anaconda-runtime/genhdlist \ |
|
|
--productpath SME \ |
|
|
--withnumbers \ |
|
|
$(pwd)/cdrom.image/ |
|
|
|
|
|
PYTHONPATH=/usr/lib/anaconda/ /usr/lib/anaconda-runtime/pkgorder \ |
|
|
--product SME \ |
|
|
$(pwd)/cdrom.image \ |
|
|
$(uname -i) > pkgorder |
|
|
|
|
|
PYTHONPATH=/usr/lib/anaconda/ /usr/lib/anaconda-runtime/genhdlist \ |
|
|
--productpath SME \ |
|
|
--withnumbers \ |
|
|
--fileorder pkgorder \ |
|
|
$(pwd)/cdrom.image/ |
|
|
|
|
|
rm -f $disttag-$distvers.iso smeserver.iso |
|
|
|
|
|
cd cdrom.image |
|
|
|
|
|
createrepo . |
|
|
sync; rm -rf .olddata |
|
|
repoview . |
|
|
sync; rm -rf .repodata |
|
|
|
|
|
bootimg='isolinux/isolinux.bin' |
|
|
bootcat='isolinux/boot.cat' |
|
|
mkisopts='-v -U -J -r -T' |
|
|
today="$(date '+%d %b %Y')" |
|
|
mkisofs $mkisopts \ |
|
|
-V "$distname $distvers" \ |
|
|
-A "$distname created on $today" \ |
|
|
-b "$bootimg" \ |
|
|
-c "$bootcat" \ |
|
|
-no-emul-boot -boot-load-size 4 -boot-info-table \ |
|
|
-x lost+found \ |
|
|
-x CVS \ |
|
|
-o "../$disttag-$distvers".iso \ |
|
|
. |
|
|
|
|
|
cd .. |
|
|
/usr/lib/anaconda-runtime/implantisomd5 $disttag-$distvers.iso |
|
|
dd if=/dev/zero bs=2048 count=150 >> $disttag-$distvers.iso |
|
|
md5sum $disttag-$distvers.iso > $disttag-$distvers.iso.md5sum |
|
|
ls -lRt > $disttag-$distvers.iso.ls-lRt |
|
|
zsyncmake $disttag-$distvers.iso |
|
|
mv $disttag-$distvers.iso $disttag.iso |
|
|
ln -sf $disttag.iso $disttag-$distvers.iso |
|
|
|
|
|
if [ -d SRPMS ] |
|
|
then |
|
|
echo "Building SRPMS ISO" |
|
|
|
|
|
distvers=$(echo $distvers | sed 's/-i386//;s/-x86_64//') |
|
|
rm -f $disttag-SRPMS.iso $disttag-$distvers-SRPMS.iso |
|
|
|
|
|
mkisofs $mkisopts \ |
|
|
-V "$distname $distvers SRPMS" \ |
|
|
-A "$distname SRPMS created on $today" \ |
|
|
-x lost+found \ |
|
|
-x CVS \ |
|
|
-x cdrom.image \ |
|
|
-o "$disttag-$distvers-SRPMS".iso \ |
|
|
--graft-points \ |
|
|
./SRPMS=SRPMS \ |
|
|
GPL=cdrom.image/GPL \ |
|
|
RPM-GPG-KEY-SMEServer7=cdrom.image/RPM-GPG-KEY-SMEServer |
|
|
|
|
|
md5sum $disttag-$distvers-SRPMS.iso > $disttag-$distvers-SRPMS.iso.md5sum |
|
|
zsyncmake $disttag-$distvers-SRPMS.iso |
|
|
mv $disttag-$distvers-SRPMS.iso $disttag-SRPMS.iso |
|
|
ln -sf $disttag-SRPMS.iso $disttag-$distvers-SRPMS.iso |
|
|
fi |
|
16 |
fi |
fi |
17 |
|
|
18 |
# That's it. |
for img in product updates |
19 |
|
do |
20 |
|
if [ "$distrel" == "7" ] |
21 |
|
then |
22 |
|
/usr/bin/mkcramfs \ |
23 |
|
$(pwd)/$distarch/$img \ |
24 |
|
$(pwd)/$distarch/SME/base/$img.img |
25 |
|
elif [ -d "$(pwd)/$distarch/$img" ] |
26 |
|
then |
27 |
|
/sbin/mksquashfs \ |
28 |
|
$(pwd)/$distarch/$img \ |
29 |
|
$(pwd)/$distarch/images/$img.img \ |
30 |
|
-all-root -no-fragments -noappend |
31 |
|
sudo chmod 664 $(pwd)/$distarch/images/$img.img |
32 |
|
fi |
33 |
|
done |
34 |
|
|
35 |
|
if [ "$distrel" == "7" ] |
36 |
|
then |
37 |
|
PYTHONPATH=/usr/lib/anaconda/ /usr/lib/anaconda-runtime/genhdlist \ |
38 |
|
--productpath SME \ |
39 |
|
--withnumbers \ |
40 |
|
$(pwd)/$distarch/ |
41 |
|
|
42 |
|
PYTHONPATH=/usr/lib/anaconda/ /usr/lib/anaconda-runtime/pkgorder \ |
43 |
|
--product SME \ |
44 |
|
$(pwd)/$distarch \ |
45 |
|
$distarch > pkgorder.$distarch |
46 |
|
|
47 |
|
PYTHONPATH=/usr/lib/anaconda/ /usr/lib/anaconda-runtime/genhdlist \ |
48 |
|
--productpath SME \ |
49 |
|
--withnumbers \ |
50 |
|
--fileorder pkgorder.$distarch \ |
51 |
|
$(pwd)/$distarch/ |
52 |
|
fi |
53 |
|
|
54 |
|
rm -f ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso ../iso/$distrel/$distarch/$disttag.iso |
55 |
|
|
56 |
|
if [ "$distrel" == "7" ] |
57 |
|
then |
58 |
|
createrepo --update --database $(pwd)/$distarch/ |
59 |
|
else |
60 |
|
createrepo --update --database --groupfile repodata/comps.xml -u "media://$(head -1 $distarch/.discinfo)" $(pwd)/$distarch/ |
61 |
|
fi |
62 |
|
sync; rm -rf $(pwd)/$distarch/.olddata |
63 |
|
repoview $(pwd)/$distarch/ |
64 |
|
sync; rm -rf $(pwd)/$distarch/.repodata |
65 |
|
|
66 |
|
bootimg='isolinux/isolinux.bin' |
67 |
|
bootcat='isolinux/boot.cat' |
68 |
|
mkisopts='-v -U -J -r -T' |
69 |
|
today="$(date '+%d %b %Y')" |
70 |
|
mkisofs $mkisopts \ |
71 |
|
-V "$distname $distvers" \ |
72 |
|
-A "$distname created on $today" \ |
73 |
|
-b "$bootimg" \ |
74 |
|
-c "$bootcat" \ |
75 |
|
-no-emul-boot -boot-load-size 4 -boot-info-table \ |
76 |
|
-x lost+found \ |
77 |
|
-x CVS \ |
78 |
|
-o ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso \ |
79 |
|
$(pwd)/$distarch/ |
80 |
|
|
81 |
|
/usr/lib/anaconda-runtime/implantisomd5 ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso |
82 |
|
dd if=/dev/zero bs=2048 count=150 >> ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso |
83 |
|
md5sum ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso > ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso.md5sum |
84 |
|
sha1sum ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso > ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso.sha1sum |
85 |
|
zsyncmake -u $disttag-$distvers-$distarch.iso -o ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso.zsync ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso |
86 |
|
mv ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso ../iso/$distrel/$distarch/$disttag.iso |
87 |
|
ln -sf $disttag.iso ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso |
88 |
|
|
89 |
|
if [ -d SRPMS -a "$distarch" == "i386" ] |
90 |
|
then |
91 |
|
rm -f ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso ../iso/$distrel/source/$disttag-SRPMS.iso |
92 |
|
|
93 |
|
mkisofs $mkisopts \ |
94 |
|
-V "$distname $distvers SRPMS" \ |
95 |
|
-A "$distname SRPMS created on $today" \ |
96 |
|
-x lost+found \ |
97 |
|
-x CVS \ |
98 |
|
-o ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso \ |
99 |
|
--graft-points \ |
100 |
|
./SRPMS=SRPMS \ |
101 |
|
GPL=$distarch/GPL \ |
102 |
|
RPM-GPG-KEY-SMEServer=$distarch/RPM-GPG-KEY-SMEServer |
103 |
|
|
104 |
|
md5sum ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso > ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso.md5sum |
105 |
|
sha1sum ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso > ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso.sha1sum |
106 |
|
zsyncmake -u $disttag-$distvers-SRPMS.iso -o ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso.zsync ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso |
107 |
|
mv ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso ../iso/$distrel/source/$disttag-SRPMS.iso |
108 |
|
ln -sf $disttag-SRPMS.iso ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso |
109 |
|
fi |
110 |
|
|
111 |
|
# That's it. |