1 |
#!/bin/sh |
#!/bin/sh |
2 |
|
|
|
# Charlie Brady wrote on smeserver-developer: |
|
|
# [I'm sure I've said this before, but ...] there's no new anaconda SRPM. |
|
|
# The cdrom image I've been using comes directly from a CentOS one. |
|
|
|
|
|
# |
|
|
# What I've done is: |
|
|
# |
|
|
# - add CentOS/base/updates.img, made using mkcramfs from the updates directory |
|
|
# - delete unwanted RPMs |
|
|
# - add wanted RPMs |
|
|
# - replace comps.xml |
|
|
# - add install.cfg and update.cfg |
|
|
# - edit isolinux/isolinux.cfg |
|
|
# |
|
|
# Run this in the a 7.0alphaXX directory, containing cdrom.image |
|
|
# which contains the directory tree: |
|
|
|
|
|
|
|
|
echo "Checking packages not installed in CentOS workstation group" |
|
|
for package in anaconda anaconda-runtime bogl booty createrepo mkisofs zsync |
|
|
do |
|
|
rpm -q $package || exit "$package must be installed" |
|
|
done |
|
|
|
|
|
[ -d cdrom.image ] || (echo "No cdrom.image directory?"; exit 1) |
|
|
|
|
3 |
distname='SME Server' |
distname='SME Server' |
4 |
|
disttag='smeserver' |
5 |
distvers=$(basename $(pwd)) |
distvers=$(basename $(pwd)) |
6 |
|
distrel=${distvers:0:1} |
7 |
|
distarch=$(uname -i) |
8 |
|
|
9 |
[ -f cdrom.image/updates/anaconda ] && chmod a+rx cdrom.image/updates/anaconda |
if ! [ -d $distarch ] |
10 |
|
then |
11 |
chmod -R a+rX cdrom.image |
echo "No $distarch directory?" |
12 |
|
exit 1 |
13 |
|
fi |
14 |
|
|
15 |
for img in product updates |
for img in product updates |
16 |
do |
do |
17 |
|
if [ "$distrel" == "7" ] |
18 |
|
then |
19 |
/usr/bin/mkcramfs \ |
/usr/bin/mkcramfs \ |
20 |
$(pwd)/cdrom.image/$img \ |
$(pwd)/$distarch/$img \ |
21 |
$(pwd)/cdrom.image/CentOS/base/$img.img |
$(pwd)/$distarch/SME/base/$img.img |
22 |
|
else |
23 |
|
/sbin/mksquashfs \ |
24 |
|
$(pwd)/$distarch/$img \ |
25 |
|
$(pwd)/$distarch/images/$img.img \ |
26 |
|
-all-root -no-fragments -noappend |
27 |
|
sudo chmod 664 $(pwd)/$distarch/images/$img.img |
28 |
|
fi |
29 |
done |
done |
30 |
|
|
31 |
PYTHONPATH=/usr/lib/anaconda/ /usr/lib/anaconda-runtime/genhdlist \ |
if [ "$distrel" == "7" ] |
32 |
|
then |
33 |
|
PYTHONPATH=/usr/lib/anaconda/ /usr/lib/anaconda-runtime/genhdlist \ |
34 |
|
--productpath SME \ |
35 |
--withnumbers \ |
--withnumbers \ |
36 |
$(pwd)/cdrom.image/ |
$(pwd)/$distarch/ |
37 |
|
|
38 |
PYTHONPATH=/usr/lib/anaconda/ /usr/lib/anaconda-runtime/pkgorder \ |
PYTHONPATH=/usr/lib/anaconda/ /usr/lib/anaconda-runtime/pkgorder \ |
39 |
$(pwd)/cdrom.image \ |
--product SME \ |
40 |
i386 > pkgorder |
$(pwd)/$distarch \ |
41 |
|
$distarch > pkgorder |
42 |
|
|
43 |
PYTHONPATH=/usr/lib/anaconda/ /usr/lib/anaconda-runtime/genhdlist \ |
PYTHONPATH=/usr/lib/anaconda/ /usr/lib/anaconda-runtime/genhdlist \ |
44 |
|
--productpath SME \ |
45 |
--withnumbers \ |
--withnumbers \ |
46 |
--fileorder pkgorder \ |
--fileorder pkgorder \ |
47 |
$(pwd)/cdrom.image/ |
$(pwd)/$distarch/ |
48 |
|
fi |
|
rm -f smeserver-$distvers.iso smeserver.iso |
|
49 |
|
|
50 |
cd cdrom.image |
rm -f ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso ../iso/$distrel/$distarch/$disttag.iso |
51 |
|
|
52 |
yum-arch . |
if [ "$distrel" == "7" ] |
53 |
createrepo . |
then |
54 |
|
createrepo $(pwd)/$distarch/ |
55 |
|
else |
56 |
|
createrepo -g repodata/comps.xml -u "media://$(head -1 $distarch/.discinfo)" $(pwd)/$distarch/ |
57 |
|
fi |
58 |
|
sync; rm -rf $(pwd)/$distarch/.olddata |
59 |
|
repoview $(pwd)/$distarch/ |
60 |
|
sync; rm -rf $(pwd)/$distarch/.repodata |
61 |
|
|
62 |
bootimg='isolinux/isolinux.bin' |
bootimg='isolinux/isolinux.bin' |
63 |
bootcat='isolinux/boot.cat' |
bootcat='isolinux/boot.cat' |
64 |
#mkisopts='-r -N -L -d -D -J' |
mkisopts='-v -U -J -r -T' |
|
mkisopts='-r -J' |
|
65 |
today="$(date '+%d %b %Y')" |
today="$(date '+%d %b %Y')" |
66 |
mkisofs $mkisopts \ |
mkisofs $mkisopts \ |
67 |
-V "$distname $distvers" \ |
-V "$distname $distvers" \ |
68 |
-A "$distname created on $today" \ |
-A "$distname created on $today" \ |
69 |
-b "$bootimg" \ |
-b "$bootimg" \ |
70 |
-c "$bootcat" \ |
-c "$bootcat" \ |
71 |
-no-emul-boot -boot-load-size 4 -boot-info-table \ |
-no-emul-boot -boot-load-size 4 -boot-info-table \ |
72 |
|
-x lost+found \ |
73 |
|
-x CVS \ |
74 |
|
-o ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso \ |
75 |
|
$(pwd)/$distarch/ |
76 |
|
|
77 |
|
/usr/lib/anaconda-runtime/implantisomd5 ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso |
78 |
|
dd if=/dev/zero bs=2048 count=150 >> ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso |
79 |
|
md5sum ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso > ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso.md5sum |
80 |
|
sha1sum ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso > ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso.sha1sum |
81 |
|
zsyncmake -o ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso.zsync ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso |
82 |
|
mv ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso ../iso/$distrel/$distarch/$disttag.iso |
83 |
|
ln -sf $disttag.iso ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso |
84 |
|
|
85 |
|
if [ -d SRPMS -a "$distarch" == "i386" ] |
86 |
|
then |
87 |
|
rm -f ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso ../iso/$distrel/source/$disttag-SRPMS.iso |
88 |
|
|
89 |
|
mkisofs $mkisopts \ |
90 |
|
-V "$distname $distvers SRPMS" \ |
91 |
|
-A "$distname SRPMS created on $today" \ |
92 |
-x lost+found \ |
-x lost+found \ |
93 |
-x CVS \ |
-x CVS \ |
94 |
-o "../smeserver-$distvers".iso \ |
-o ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso \ |
95 |
. |
--graft-points \ |
96 |
|
./SRPMS=SRPMS \ |
97 |
cd .. |
GPL=$distarch/GPL \ |
98 |
/usr/lib/anaconda-runtime/implantisomd5 smeserver-$distvers.iso |
RPM-GPG-KEY-SMEServer=$distarch/RPM-GPG-KEY-SMEServer |
99 |
dd if=/dev/zero bs=2048 count=150 >> smeserver-$distvers.iso |
|
100 |
md5sum smeserver-$distvers.iso > smeserver-$distvers.iso.md5sum |
md5sum ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso > ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso.md5sum |
101 |
ls -lRt > smeserver-$distvers.iso.ls-lRt |
sha1sum ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso > ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso.sha1sum |
102 |
zsyncmake smeserver-$distvers.iso |
zsyncmake -o ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso.zsync ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso |
103 |
mv smeserver-$distvers.iso smeserver.iso |
mv ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso ../iso/$distrel/source/$disttag-SRPMS.iso |
104 |
ln -sf smeserver.iso smeserver-$distvers.iso |
ln -sf $disttag-SRPMS.iso ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso |
105 |
|
fi |
106 |
|
|
107 |
# That's it. |
# That's it. |
108 |
|
|