2 |
|
|
3 |
# get configuration |
# get configuration |
4 |
BUILDSERVER_CONFIG_DIR="/etc/mage-buildserver" |
BUILDSERVER_CONFIG_DIR="/etc/mage-buildserver" |
5 |
|
BUILDSERVER_CACHE_DIR="/var/cache/mage-buildserver" |
6 |
source ${BUILDSERVER_CONFIG_DIR}/buildserver.conf |
source ${BUILDSERVER_CONFIG_DIR}/buildserver.conf |
7 |
|
|
8 |
source ${BUILDSERVER_LIB_DIR}/buildserver-functions.sh |
source ${BUILDSERVER_LIB_DIR}/buildserver-functions.sh |
22 |
# create buildroot layout |
# create buildroot layout |
23 |
install -d ${BUILDROOT}/.stamps |
install -d ${BUILDROOT}/.stamps |
24 |
install -d ${BUILDROOT}/tmp/mage-tree |
install -d ${BUILDROOT}/tmp/mage-tree |
25 |
|
install -d ${BUILDROOT}/ssh |
26 |
for arch in ${BUILD_ARCH[*]} src |
for arch in ${BUILD_ARCH[*]} src |
27 |
do |
do |
28 |
install -d ${BUILDROOT}/${arch} |
install -d ${BUILDROOT}/${arch} |
29 |
install -d ${BUILDROOT}/packages/${arch} |
install -d ${BUILDROOT}/packages/${arch} |
30 |
install -d ${BUILDROOT}/meta/${arch} |
install -d ${BUILDROOT}/meta/${arch} |
31 |
|
install -d ${BUILDROOT}/build-info/${arch} |
32 |
done |
done |
33 |
|
|
34 |
# |
# |
67 |
[[ -n ${no_proxy} ]] && echo "no_proxy=\"${no_proxy}\"" >> ${BUILDROOT}/${arch}/etc/env.d/01proxy |
[[ -n ${no_proxy} ]] && echo "no_proxy=\"${no_proxy}\"" >> ${BUILDROOT}/${arch}/etc/env.d/01proxy |
68 |
runarch ${arch} env-rebuild || die "${arch} environment rebuild for proxy setup" |
runarch ${arch} env-rebuild || die "${arch} environment rebuild for proxy setup" |
69 |
|
|
70 |
|
# always enable bootstrap mode to supress the startups of any services |
71 |
|
:> ${BUILDROOT}/${arch}/etc/env.d/00mage-buildserver |
72 |
|
echo "MAGE_BOOTSTRAP=\"true\"" >> ${BUILDROOT}/${arch}/etc/env.d/00mage-buildserver |
73 |
|
|
74 |
# install subversion |
# install subversion |
75 |
if [ ! -f ${BUILDROOT}/.stamps/${arch}_subversion-ok ] |
if [ ! -f ${BUILDROOT}/.stamps/${arch}_subversion-ok ] |
76 |
then |
then |
120 |
# update-ca-certificates |
# update-ca-certificates |
121 |
runarch "${arch}" update-ca-certificates # no die here, cmd may missing |
runarch "${arch}" update-ca-certificates # no die here, cmd may missing |
122 |
|
|
123 |
|
# create list of protected packages |
124 |
|
echo "BUILDSERVER_CACHE_DIR=\"${BUILDSERVER_CACHE_DIR}\"" > ${BUILDROOT}/${arch}/.runrc |
125 |
|
cat >> ${BUILDROOT}/${arch}/.runrc << "EOF" |
126 |
|
if [ -f /etc/rc.d/init.d/functions ] |
127 |
|
then |
128 |
|
source /etc/rc.d/init.d/functions |
129 |
|
else |
130 |
|
die "/etc/rc.d/init.d/functions not found" |
131 |
|
fi |
132 |
|
if [ -f /etc/mage.rc.global ] |
133 |
|
then |
134 |
|
source /etc/mage.rc.global |
135 |
|
else |
136 |
|
die "/etc/mage.rc.global not found" |
137 |
|
fi |
138 |
|
if [ -f /etc/mage.rc ] |
139 |
|
then |
140 |
|
source /etc/mage.rc |
141 |
|
else |
142 |
|
die "/etc/mage.rc not found" |
143 |
|
fi |
144 |
|
|
145 |
|
env-rebuild |
146 |
|
source /etc/profile |
147 |
|
|
148 |
|
echo "generate protected packages info data" |
149 |
|
install -d ${BUILDSERVER_CACHE_DIR}/protected |
150 |
|
|
151 |
|
for mage in $(find ${INSTALLDB} -name \*.${MAGESUFFIX}) |
152 |
|
do |
153 |
|
pkgname=$(basename ${mage} .${MAGESUFFIX}) |
154 |
|
pkgname="${pkgname%-*-*}" |
155 |
|
echo "${pkgname}" > ${BUILDSERVER_CACHE_DIR}/protected/"${pkgname}" |
156 |
|
done |
157 |
|
EOF |
158 |
|
runarch-script ${arch} .runrc || die "${arch} protect-gen failed" |
159 |
|
if [ -f ${BUILDROOT}/${arch}/.runrc ] |
160 |
|
then |
161 |
|
rm ${BUILDROOT}/${arch}/.runrc |
162 |
|
fi |
163 |
|
|
164 |
# cleanup |
# cleanup |
165 |
runarch "${arch}" mage clean || die "${arch} mage clean" |
runarch "${arch}" mage clean || die "${arch} mage clean" |
166 |
|
|