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' |
disttag='smeserver' |
5 |
distvers=$(basename $(pwd)) |
distvers=$(basename $(readlink -f $(pwd))) |
6 |
|
distrel=${distvers:0:1} |
7 |
[ -f cdrom.image/updates/anaconda ] && chmod a+rx cdrom.image/updates/anaconda |
distarch=$(uname -i) |
8 |
|
|
9 |
chmod -R a+rX cdrom.image |
exec < /dev/null |
10 |
|
exec &> build_ISO.$distarch |
11 |
|
|
12 |
|
if ! [ -d $distarch ] |
13 |
|
then |
14 |
|
echo "No $distarch directory?" |
15 |
|
exit 1 |
16 |
|
fi |
17 |
|
|
18 |
for img in product updates |
for img in product updates |
19 |
do |
do |
20 |
|
if [ "$distrel" == "7" ] |
21 |
|
then |
22 |
/usr/bin/mkcramfs \ |
/usr/bin/mkcramfs \ |
23 |
$(pwd)/cdrom.image/$img \ |
$(pwd)/$distarch/$img \ |
24 |
$(pwd)/cdrom.image/CentOS/base/$img.img |
$(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 |
done |
34 |
|
|
35 |
PYTHONPATH=/usr/lib/anaconda/ /usr/lib/anaconda-runtime/genhdlist \ |
if [ "$distrel" == "7" ] |
36 |
|
then |
37 |
|
PYTHONPATH=/usr/lib/anaconda/ /usr/lib/anaconda-runtime/genhdlist \ |
38 |
|
--productpath SME \ |
39 |
--withnumbers \ |
--withnumbers \ |
40 |
$(pwd)/cdrom.image/ |
$(pwd)/$distarch/ |
41 |
|
|
42 |
PYTHONPATH=/usr/lib/anaconda/ /usr/lib/anaconda-runtime/pkgorder \ |
PYTHONPATH=/usr/lib/anaconda/ /usr/lib/anaconda-runtime/pkgorder \ |
43 |
$(pwd)/cdrom.image \ |
--product SME \ |
44 |
i386 > pkgorder |
$(pwd)/$distarch \ |
45 |
|
$distarch > pkgorder.$distarch |
46 |
|
|
47 |
PYTHONPATH=/usr/lib/anaconda/ /usr/lib/anaconda-runtime/genhdlist \ |
PYTHONPATH=/usr/lib/anaconda/ /usr/lib/anaconda-runtime/genhdlist \ |
48 |
|
--productpath SME \ |
49 |
--withnumbers \ |
--withnumbers \ |
50 |
--fileorder pkgorder \ |
--fileorder pkgorder.$distarch \ |
51 |
$(pwd)/cdrom.image/ |
$(pwd)/$distarch/ |
52 |
|
fi |
53 |
rm -f $disttag-$distvers.iso smeserver.iso |
|
54 |
|
rm -f ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso ../iso/$distrel/$distarch/$disttag.iso |
55 |
cd cdrom.image |
|
56 |
|
if [ "$distrel" == "7" ] |
57 |
yum-arch . |
then |
58 |
createrepo . |
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' |
bootimg='isolinux/isolinux.bin' |
67 |
bootcat='isolinux/boot.cat' |
bootcat='isolinux/boot.cat' |
68 |
#mkisopts='-r -N -L -d -D -J' |
mkisopts='-v -U -J -r -T' |
|
mkisopts='-r -J' |
|
69 |
today="$(date '+%d %b %Y')" |
today="$(date '+%d %b %Y')" |
70 |
mkisofs $mkisopts \ |
mkisofs $mkisopts \ |
71 |
-V "$distname $distvers" \ |
-V "$distname $distvers" \ |
72 |
-A "$distname created on $today" \ |
-A "$distname created on $today" \ |
73 |
-b "$bootimg" \ |
-b "$bootimg" \ |
74 |
-c "$bootcat" \ |
-c "$bootcat" \ |
75 |
-no-emul-boot -boot-load-size 4 -boot-info-table \ |
-no-emul-boot -boot-load-size 4 -boot-info-table \ |
76 |
-x lost+found \ |
-x lost+found -x product -x updates -x 'buildinstall.tree.*' -x CVS \ |
77 |
-x CVS \ |
-o ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso \ |
78 |
-o "../$disttag-$distvers".iso \ |
$(pwd)/$distarch/ |
79 |
. |
|
80 |
|
/usr/lib/anaconda-runtime/implantisomd5 ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso |
81 |
cd .. |
dd if=/dev/zero bs=2048 count=150 >> ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso |
82 |
/usr/lib/anaconda-runtime/implantisomd5 $disttag-$distvers.iso |
md5sum ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso > ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso.md5sum |
83 |
dd if=/dev/zero bs=2048 count=150 >> $disttag-$distvers.iso |
sha1sum ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso > ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso.sha1sum |
84 |
md5sum $disttag-$distvers.iso > $disttag-$distvers.iso.md5sum |
zsyncmake -u $disttag-$distvers-$distarch.iso -o ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso.zsync ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso |
85 |
ls -lRt > $disttag-$distvers.iso.ls-lRt |
mv ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso ../iso/$distrel/$distarch/$disttag.iso |
86 |
zsyncmake $disttag-$distvers.iso |
ln -sf $disttag.iso ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso |
87 |
mv $disttag-$distvers.iso $disttag.iso |
|
88 |
ln -sf $disttag.iso $disttag-$distvers.iso |
rsync -a --delete --delete-excluded \ |
89 |
|
--exclude 'repodata/' --exclude 'product/' --exclude 'updates/' \ |
90 |
echo "Building SRPMS ISO" |
--exclude 'lost+found/' --exclude 'CVS/' --exclude 'buildinstall.tree.*/' \ |
91 |
|
--link-dest=../$distarch/ $distarch/ $distarch.jigdo/ |
92 |
mkisofs $mkisopts \ |
jigdo-file make-template --force \ |
93 |
-V "$distname $distvers SRPMS" \ |
-i ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso \ |
94 |
-A "$distname SRPMS created on $today" \ |
-j ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.jigdo \ |
95 |
-x lost+found \ |
-t ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.template \ |
96 |
-x CVS \ |
--label SMEmirror=$distarch.jigdo/ \ |
97 |
-x cdrom.image \ |
--uri SMEmirror=http://mirror.contribs.org/releases/testing/$distrel/smeos/$distarch/ \ |
98 |
-o "$disttag-$distvers-SRPMS".iso \ |
$distarch.jigdo// |
99 |
--graft-points \ |
rm -rf $distarch.jigdo/ |
100 |
./SRPMS=SRPMS \ |
|
101 |
GPL=cdrom.image/GPL \ |
if [ -d SRPMS -a "$distarch" == "i386" ] |
102 |
RPM-GPG-KEY=cdrom.image/RPM-GPG-KEY \ |
then |
103 |
RPM-GPG-KEY-centos4=cdrom.image/RPM-GPG-KEY-centos4 \ |
rm -f ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso ../iso/$distrel/source/$disttag-SRPMS.iso |
104 |
RPM-GPG-KEY-SMEServer7=cdrom.image/RPM-GPG-KEY-SMEServer7 |
|
105 |
|
mkisofs $mkisopts \ |
106 |
md5sum $disttag-$distvers-SRPMS.iso > $disttag-$distvers-SRPMS.iso.md5sum |
-V "$distname $distvers SRPMS" \ |
107 |
zsyncmake $disttag-$distvers-SRPMS.iso |
-A "$distname SRPMS created on $today" \ |
108 |
mv $disttag-$distvers-SRPMS.iso $disttag-SRPMS.iso |
-x lost+found -x product -x updates -x 'buildinstall.tree.*' -x CVS \ |
109 |
ln -sf $disttag-SRPMS.iso $disttag-$distvers-SRPMS.iso |
-o ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso \ |
110 |
|
--graft-points \ |
111 |
|
./SRPMS=SRPMS \ |
112 |
|
GPL=$distarch/GPL \ |
113 |
|
RPM-GPG-KEY-SMEServer=$distarch/RPM-GPG-KEY-SMEServer |
114 |
|
|
115 |
|
md5sum ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso > ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso.md5sum |
116 |
|
sha1sum ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso > ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso.sha1sum |
117 |
|
zsyncmake -u $disttag-$distvers-SRPMS.iso -o ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso.zsync ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso |
118 |
|
mv ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso ../iso/$distrel/source/$disttag-SRPMS.iso |
119 |
|
ln -sf $disttag-SRPMS.iso ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso |
120 |
|
|
121 |
|
jigdo-file make-template --force \ |
122 |
|
-i ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso \ |
123 |
|
-j ../iso/$distrel/source/$disttag-$distvers-SRPMS.jigdo \ |
124 |
|
-t ../iso/$distrel/source/$disttag-$distvers-SRPMS.template \ |
125 |
|
--label SMEmirror=SRPMS/ \ |
126 |
|
--uri SMEmirror=http://mirror.contribs.org/releases/testing/$distrel/smeos/SRPMS/ \ |
127 |
|
SRPMS// |
128 |
|
fi |
129 |
|
|
130 |
# That's it. |
# That's it. |
|
|
|