--- /dev/null
+#!/bin/bash
+# usage
+# ./mg-centos-installer-update 7 amd64
+
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2017 Citrix Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+set -e -o posix
+
+. ./cri-getconfig
+. ./mgi-common
+
+releasever=$1 # $suite
+arch=$2
+
+case $arch in
+ amd64) basearch=x86_64 ;;
+esac
+
+site=http://mirror.centos.org/centos
+sbase=$site/$releasever
+
+src=$sbase/os/$basearch/images/pxeboot
+
+case ${releasever}_${arch} in
+ 7_amd64)
+ files="initrd.img:initrd.img vmlinuz:vmlinuz"
+ ;;
+ *)
+ exit 1
+ ;;
+esac
+
+tftpciversion=`getconfig_TftpCentosInstallerVersion_release $releasever`
+dstroot=`getconfig TftpPath`/`getconfig TftpCentosInstallerBase`
+date=`date +%Y-%m-%d`
+dst=$arch/$date-$releasever
+harness_rev=$(perl -e 'use Osstest; print get_harness_rev();')
+
+case "`getconfig HttpProxy`" in
+?*) export http_proxy=`getconfig HttpProxy` ;;
+esac
+
+cd $dstroot
+mkdir -p $dst
+cd $dst
+echo >&2 "working in $dstroot/$dst"
+
+now=$(date -R)
+echo >>osstest-touched.log "$now: $harness_rev"
+
+for f in $files; do
+ echo >&2 "fetching $f"
+ s=${f/:*} ; d=${f/*:}
+ echo >&2 "$src/$s => $d.new"
+ fetch $src/$s >$d.new
+done
+
+for f in $files; do
+ s=${f/:*} ; d=${f/*:}
+ mv -f $d.new $d
+done
+
+if [ "$tftpciversion" = current ]; then
+ cd $dstroot/$arch
+ rm -rf current-$releasever.new
+ ln -s $date-$releasever current-$releasever.new
+ mv -Tf current-$releasever.new current-$releasever
+fi
+
+echo "CentosInstallerVersion $date"
+echo "CentosInstallerVersion_$releasever $date"
+# ^ above two lines parsed ad-hoc by standalone-reset
+echo >&2 "downloaded $dstroot/$dst"
+