2014-10-18 12:59:21 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#
|
|
|
|
# Creates a small script to copy to dom0 to retrieve the generated template rpm's
|
|
|
|
#
|
|
|
|
|
|
|
|
TEMPLATES="./rpm/install-templates.sh"
|
|
|
|
|
|
|
|
write() {
|
|
|
|
echo "$1" >> "$TEMPLATES"
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ -x /usr/sbin/xenstore-read ]; then
|
|
|
|
XENSTORE_READ="/usr/sbin/xenstore-read"
|
|
|
|
else
|
|
|
|
XENSTORE_READ="/usr/bin/xenstore-read"
|
|
|
|
fi
|
|
|
|
|
2014-10-18 14:53:11 +00:00
|
|
|
TEMPLATES="$(readlink -m $TEMPLATES)"
|
2014-10-18 12:59:21 +00:00
|
|
|
VERSION="-$(cat ./version)"
|
|
|
|
name=$($XENSTORE_READ name)
|
|
|
|
path="$(readlink -m .)"
|
|
|
|
files=$(ls rpm/noarch)
|
|
|
|
|
2014-10-18 14:53:11 +00:00
|
|
|
#
|
|
|
|
# Write to install-templates
|
|
|
|
#
|
|
|
|
|
|
|
|
echo "#!/bin/bash" > "$TEMPLATES"
|
|
|
|
write ""
|
|
|
|
|
2014-10-18 12:59:21 +00:00
|
|
|
for file in ${files[@]}; do
|
|
|
|
write "qvm-run --pass-io development-qubes 'cat ${path}/rpm/noarch/${file}' > ${file}"
|
|
|
|
write ""
|
2014-10-20 16:25:31 +00:00
|
|
|
write "sudo yum erase $(echo "$file" | sed -r "s/($VERSION).+$//")"
|
2014-10-18 12:59:21 +00:00
|
|
|
write ""
|
2014-10-20 16:25:31 +00:00
|
|
|
write "sudo yum install ${file}"
|
2014-10-18 12:59:21 +00:00
|
|
|
write ""
|
|
|
|
write ""
|
|
|
|
done
|
|
|
|
|
|
|
|
write "# Use the following command in DOM0 to retreive this file:"
|
|
|
|
write "# qvm-run --pass-io $name 'cat ${TEMPLATES}' > install-templates.sh"
|
|
|
|
|
|
|
|
echo "Use the following command in DOM0 to retreive this file:"
|
|
|
|
echo "qvm-run --pass-io $name 'cat ${TEMPLATES}' > install-templates.sh"
|
|
|
|
|
|
|
|
|