core-admin/dom0/qvm-tools/qvm-dom0-upgrade
Marek Marczykowski 2d97c3399e dom0/qvm-dom0-upgrade: Run yum after downloading new packages
yum will ask for confirmation.
2011-09-03 16:43:22 +02:00

31 lines
831 B
Bash
Executable File

#!/bin/bash
UPDATEVM=`qvm-get-updatevm`
if [ -z "$UPDATEVM" ]; then
echo "UpdateVM not set, exiting"
exit 1
fi
# We should ensure the clocks in Dom0 and UpdateVM are in sync
# becuase otherwise yum might complain about future timestamps
qvm-sync-dom0-clock
echo "Checking for dom0 updates"
# Start VM if not running already
qvm-run -a $UPDATEVM true || exit 1
/usr/lib/qubes/sync_rpmdb_updatevm.sh || exit 1
qvm-run --pass_io $UPDATEVM "/usr/lib/qubes/qubes_download_dom0_updates.sh $*" || exit 1
# Wait for download completed
while pidof -x qubes-receive-updates >/dev/null; do sleep 0.5; done
if [ $# -gt 0 ]; then
yum install $@
elif [ -f /var/lib/qubes/updates/repodata/repomd.xml ]; then
yum check-update
if [ $? -eq 100 ]; then
gpk-update-viewer
fi
else
echo "No updates avaliable"
fi