Added a create-template-list.sh which can be used to get new templates from dom0

pull/1/head
Jason Mehring 10 years ago
parent 64093db75a
commit c87c046fe1

1
.gitignore vendored

@ -5,3 +5,4 @@ cache_*
mnt_*
*.iso
*.fs
install-templates.sh

@ -25,6 +25,7 @@ rpms:
sudo -E ./prepare_image prepared_images/$(TEMPLATE_NAME).img && \
sudo -E ./qubeize_image prepared_images/$(TEMPLATE_NAME).img $(TEMPLATE_NAME) && \
./build_template_rpm $(TEMPLATE_NAME) || exit 1; \
./create-template-list.sh || : \
update-repo-installer:
[ -z "$$UPDATE_REPO" ] && UPDATE_REPO=../installer/yum/qubes-dom0;\

@ -0,0 +1,45 @@
#!/bin/bash
#
# Creates a small script to copy to dom0 to retrieve the generated template rpm's
#
TEMPLATES="./rpm/install-templates.sh"
TEMPLATES="$(readlink -m $TEMPLATES)"
touch "$TEMPLATES"
write() {
echo "$1" >> "$TEMPLATES"
}
write "#!/bin/bash"
write ""
if [ -x /usr/sbin/xenstore-read ]; then
XENSTORE_READ="/usr/sbin/xenstore-read"
else
XENSTORE_READ="/usr/bin/xenstore-read"
fi
VERSION="-$(cat ./version)"
name=$($XENSTORE_READ name)
path="$(readlink -m .)"
files=$(ls rpm/noarch)
for file in ${files[@]}; do
write "qvm-run --pass-io development-qubes 'cat ${path}/rpm/noarch/${file}' > ${file}"
write ""
write "yum erase $(echo "$file" | sed -r "s/($VERSION).+$//")"
write ""
write "yum install ${file}"
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"
Loading…
Cancel
Save