2008-09-04 01:18:17 +00:00
|
|
|
# This is the config file for the catalyst-auto script. It should be pretty
|
|
|
|
# self-explanatory.
|
|
|
|
|
2011-09-15 23:17:45 +00:00
|
|
|
ARCH="amd64"
|
2012-10-13 04:06:36 +00:00
|
|
|
TYPE="auto"
|
|
|
|
host=$(hostname)
|
|
|
|
|
|
|
|
source /etc/catalyst/release/build.env
|
2011-09-15 23:17:45 +00:00
|
|
|
|
2012-02-13 01:10:01 +00:00
|
|
|
SPECS_DIR=${REPO_DIR}/releases/weekly/specs/${ARCH}
|
2008-11-29 02:15:02 +00:00
|
|
|
|
2015-12-27 02:37:12 +00:00
|
|
|
SETS="
|
2017-12-03 21:20:03 +00:00
|
|
|
multilib minimal_multilib
|
|
|
|
nomultilib minimal_nomultilib
|
2015-12-27 02:37:12 +00:00
|
|
|
x32
|
2017-12-03 21:20:03 +00:00
|
|
|
hardened_multilib minimal_hardened_multilib
|
|
|
|
hardened_nomultilib minimal_hardened_nomultilib
|
2016-01-13 22:12:39 +00:00
|
|
|
hardened_multilib_selinux hardened_nomultilib_selinux
|
2015-12-27 02:37:12 +00:00
|
|
|
"
|
2009-06-27 19:09:30 +00:00
|
|
|
|
2015-12-18 01:53:56 +00:00
|
|
|
SET_multilib_SPECS="stage1.spec stage2.spec stage3.spec"
|
2015-12-27 02:37:12 +00:00
|
|
|
SET_multilib_OPTIONAL_SPECS="installcd-stage1.spec installcd-stage2-minimal.spec"
|
2018-02-05 00:21:25 +00:00
|
|
|
SET_minimal_multilib_OPTIONAL_SPECS="stage4-minimal.spec"
|
2015-12-18 02:53:31 +00:00
|
|
|
SET_nomultilib_SPECS="stage1-nomultilib.spec stage2-nomultilib.spec stage3-nomultilib.spec"
|
2018-02-05 00:21:25 +00:00
|
|
|
SET_minimal_nomultilib_OPTIONAL_SPECS="stage4-nomultilib-minimal.spec"
|
2012-10-13 04:06:36 +00:00
|
|
|
|
2012-06-13 04:52:28 +00:00
|
|
|
SET_x32_SPECS="stage1-x32.spec stage2-x32.spec stage3-x32.spec"
|
2009-06-27 19:09:30 +00:00
|
|
|
|
2016-03-13 23:43:20 +00:00
|
|
|
|
2015-12-18 01:53:56 +00:00
|
|
|
SET_hardened_multilib_SPECS="hardened/stage1.spec hardened/stage2.spec hardened/stage3.spec"
|
2015-12-27 02:37:12 +00:00
|
|
|
SET_hardened_multilib_OPTIONAL_SPECS="hardened/admincd-stage1.spec hardened/admincd-stage2.spec"
|
2018-02-05 00:21:25 +00:00
|
|
|
SET_minimal_hardened_multilib_OPTIONAL_SPECS="hardened/stage4-minimal.spec"
|
2015-12-18 01:53:56 +00:00
|
|
|
SET_hardened_nomultilib_SPECS="hardened/stage1-nomultilib.spec hardened/stage2-nomultilib.spec hardened/stage3-nomultilib.spec"
|
2018-02-05 00:21:25 +00:00
|
|
|
SET_minimal_hardened_nomultilib_OPTIONAL_SPECS="hardened/stage4-nomultilib-minimal.spec"
|
2008-11-29 02:15:02 +00:00
|
|
|
|
2013-04-20 15:18:55 +00:00
|
|
|
SET_hardened_multilib_selinux_SPECS="hardened/stage1-selinux.spec hardened/stage2-selinux.spec hardened/stage3-selinux.spec"
|
|
|
|
SET_hardened_multilib_selinux_OPTIONAL_SPECS="hardened/admincd-stage1-selinux.spec hardened/admincd-stage2-selinux.spec"
|
|
|
|
SET_hardened_nomultilib_selinux_SPECS="hardened/stage1-selinux-nomultilib.spec hardened/stage2-selinux-nomultilib.spec hardened/stage3-selinux-nomultilib.spec"
|
|
|
|
|
2012-02-13 01:10:01 +00:00
|
|
|
KCONFIG_DIR=${REPO_DIR}/releases/weekly/kconfig/${ARCH}
|
2008-09-04 12:44:33 +00:00
|
|
|
|
2015-12-27 02:37:12 +00:00
|
|
|
EXTENSIONS="[.tar.xz,.tar.bz2,.tar.gz,.tar,.sfs]"
|
|
|
|
|
2011-01-14 05:53:24 +00:00
|
|
|
give_latest_from_dates() {
|
2012-06-27 23:58:05 +00:00
|
|
|
sed 's,-20,~20,g' | \
|
2017-12-08 08:04:40 +00:00
|
|
|
sort -k +1 -n -t '~' | \
|
2012-06-27 23:58:05 +00:00
|
|
|
awk -F\~ \
|
2016-04-26 22:35:19 +00:00
|
|
|
'BEGIN{i=$1; o=$0};
|
|
|
|
{ if($1 != i && i != "") { print o; }; i=$1; o=$0; }
|
2012-06-27 23:58:05 +00:00
|
|
|
END { print o; };' | \
|
|
|
|
tr '~' '-'
|
2011-01-14 05:53:24 +00:00
|
|
|
}
|
|
|
|
|
2016-05-05 10:07:20 +00:00
|
|
|
update_symlinks() {
|
2012-06-27 23:58:05 +00:00
|
|
|
# Symlink the latest stages3 to build from
|
|
|
|
for d in ${BUILD_SRCDIR_BASE}/{default,hardened} ; do
|
2016-06-15 01:29:20 +00:00
|
|
|
pushd $d >/dev/null
|
2015-12-27 02:37:12 +00:00
|
|
|
for f in $(ls stage3*${EXTENSIONS} | grep -v latest | give_latest_from_dates ) ; do
|
2017-12-08 07:40:09 +00:00
|
|
|
# 20yymmddThhmmssZ
|
|
|
|
# 20yymmddhhmmss
|
|
|
|
# 20yymmdd
|
|
|
|
# 20yy.n
|
|
|
|
of=$(perl -p \
|
|
|
|
-e 's/20\d{6}T\d{6}Z/latest/g;' \
|
|
|
|
-e 's/20\d{6}\d{6}/latest/g;' \
|
2017-12-08 08:04:40 +00:00
|
|
|
-e 's/20\d{6}/latest/g;' \
|
2017-12-08 07:40:09 +00:00
|
|
|
-e 's/20\d{2}\.\d{2}/latest/g;' \
|
|
|
|
<<<"$f")
|
2017-12-15 03:39:33 +00:00
|
|
|
ln -svf "$f" "$of"
|
2012-06-27 23:58:05 +00:00
|
|
|
done
|
2016-06-15 01:29:20 +00:00
|
|
|
popd >/dev/null
|
2012-06-27 23:58:05 +00:00
|
|
|
done
|
2008-09-28 04:43:08 +00:00
|
|
|
}
|
2008-12-02 22:46:21 +00:00
|
|
|
|
|
|
|
post_build() {
|
2017-12-15 05:48:20 +00:00
|
|
|
cmd=(
|
|
|
|
rsync
|
|
|
|
-e 'ssh -i /root/.ssh/id_rsa'
|
|
|
|
-a
|
|
|
|
--omit-dir-times
|
|
|
|
--delay-updates
|
|
|
|
)
|
|
|
|
case $HOSTNAME in
|
2017-12-22 11:02:44 +00:00
|
|
|
nightheron)
|
|
|
|
DEST_DEFAULT=${BUILD_DESTDIR_BASE}
|
|
|
|
DEST_HARDENED=${BUILD_DESTDIR_BASE}/hardened
|
|
|
|
;;
|
2017-12-22 11:29:30 +00:00
|
|
|
*)
|
2017-12-22 11:02:44 +00:00
|
|
|
DEST_DEFAULT=${ARCH}@nightheron.gentoo.org:${BUILD_DESTDIR_BASE}
|
|
|
|
DEST_HARDENED=${ARCH}@nightheron.gentoo.org:${BUILD_DESTDIR_BASE}/hardened
|
|
|
|
;;
|
2017-12-15 05:48:20 +00:00
|
|
|
esac
|
2016-06-15 01:29:20 +00:00
|
|
|
pushd ${BUILD_SRCDIR_BASE}/default >/dev/null
|
2017-12-15 05:48:20 +00:00
|
|
|
mkdir -p ${TMPDIR}/empty
|
2017-12-22 11:02:44 +00:00
|
|
|
"${cmd[@]}" ${TMPDIR}/empty ${DEST_DEFAULT}
|
2017-12-08 07:40:09 +00:00
|
|
|
for file in $(ls stage{3,4}*${DATESTAMP}*${EXTENSIONS} stage{3,4}*${TIMESTAMP}*${EXTENSIONS} ); do
|
2015-12-27 02:37:12 +00:00
|
|
|
if [ -f $file ]; then
|
2017-12-22 11:02:44 +00:00
|
|
|
"${cmd[@]}" ${file}* ${DEST_DEFAULT}
|
2012-06-28 00:20:00 +00:00
|
|
|
fi
|
2015-12-27 02:37:12 +00:00
|
|
|
done
|
|
|
|
if [ -f *${DATESTAMP}*.iso ]; then
|
2017-12-22 11:02:44 +00:00
|
|
|
"${cmd[@]}" *${DATESTAMP}*.iso* ${DEST_DEFAULT}
|
2017-12-08 07:40:09 +00:00
|
|
|
elif [ -f *${TIMESTAMP}*.iso ]; then
|
2017-12-22 11:02:44 +00:00
|
|
|
"${cmd[@]}" *${TIMESTAMP}*.iso* ${DEST_DEFAULT}
|
2012-06-27 23:58:05 +00:00
|
|
|
fi
|
2016-06-15 01:29:20 +00:00
|
|
|
popd >/dev/null
|
2012-06-28 00:20:00 +00:00
|
|
|
|
2016-06-15 01:29:20 +00:00
|
|
|
pushd ${BUILD_SRCDIR_BASE}/hardened >/dev/null
|
2017-12-22 11:02:44 +00:00
|
|
|
"${cmd[@]}" ${TMPDIR}/empty ${DEST_HARDENED}
|
2017-12-08 07:40:09 +00:00
|
|
|
for file in $(ls stage{3,4}*${DATESTAMP}*${EXTENSIONS} stage{3,4}*${TIMESTAMP}*${EXTENSIONS} ); do
|
2015-12-27 02:37:12 +00:00
|
|
|
if [ -f $file ]; then
|
2017-12-22 11:02:44 +00:00
|
|
|
"${cmd[@]}" $file* ${DEST_HARDENED}
|
2012-06-28 00:20:00 +00:00
|
|
|
fi
|
2015-12-27 02:37:12 +00:00
|
|
|
done
|
|
|
|
if [ -f *${DATESTAMP}*.iso ]; then
|
2017-12-22 11:02:44 +00:00
|
|
|
"${cmd[@]}" *${DATESTAMP}*.iso* ${DEST_HARDENED}
|
2017-12-08 07:40:09 +00:00
|
|
|
elif [ -f *${TIMESTAMP}*.iso ]; then
|
2017-12-22 11:02:44 +00:00
|
|
|
"${cmd[@]}" *${TIMESTAMP}*.iso* ${DEST_HARDENED}
|
2012-06-27 23:58:05 +00:00
|
|
|
fi
|
2017-12-27 02:54:39 +00:00
|
|
|
popd >/dev/null
|
2008-12-02 22:46:21 +00:00
|
|
|
}
|
|
|
|
|
2011-01-14 05:53:24 +00:00
|
|
|
# vim:ft=sh:
|