diff --git a/.gitignore b/.gitignore index 573534c..a2269fc 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ cache_* mnt_* *.iso *.fs +install-templates.sh diff --git a/Makefile b/Makefile index f69810e..c510f76 100644 --- a/Makefile +++ b/Makefile @@ -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;\ diff --git a/create-template-list.sh b/create-template-list.sh new file mode 100755 index 0000000..0feaf73 --- /dev/null +++ b/create-template-list.sh @@ -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" + +