diff --git a/common/qubes_check_for_updates.sh b/common/qubes_check_for_updates.sh deleted file mode 100755 index abb1fd1d..00000000 --- a/common/qubes_check_for_updates.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -DOM0_UPDATES_DIR=/var/lib/qubes/dom0-updates - -if ! [ -d "$DOM0_UPDATES_DIR" ]; then - echo "Dom0 updates dir does not exists: $DOM0_UPDATES_DIR" >&2 - exit 1 -fi - -mkdir -p $DOM0_UPDATES_DIR/etc -sed -i '/^reposdir\s*=/d' $DOM0_UPDATES_DIR/etc/yum.conf - -# check also for template updates -echo "Checking for template updates..." >&2 -TEMPLATEPKGLIST=`yum check-update -q | cut -f 1 -d ' '` -echo "template:$TEMPLATEPKGLIST" - -echo "Checking for dom0 updates..." >&2 -PKGLIST=`yum --installroot $DOM0_UPDATES_DIR check-update -q | cut -f 1 -d ' '` -echo "dom0:$PKGLIST" diff --git a/common/qubes_download_dom0_updates.sh b/common/qubes_download_dom0_updates.sh index 757f76e0..8901dbca 100755 --- a/common/qubes_download_dom0_updates.sh +++ b/common/qubes_download_dom0_updates.sh @@ -5,6 +5,7 @@ DOM0_UPDATES_DIR=/var/lib/qubes/dom0-updates DOIT=0 GUI=1 CLEAN=0 +CHECK_ONLY=0 OPTS="--installroot $DOM0_UPDATES_DIR" PKGLIST= while [ -n "$1" ]; do @@ -18,6 +19,9 @@ while [ -n "$1" ]; do --clean) CLEAN=1 ;; + --check-only) + CHECK_ONLY=1 + ;; -*) OPTS="$OPTS $1" ;; @@ -48,6 +52,15 @@ else PKGS_FROM_CMDLINE=1 fi +if [ "$CHECK_ONLY" = "1" ]; then + # check also for template updates + echo "Checking for template updates..." >&2 + TEMPLATEPKGLIST=`yum check-update -q | cut -f 1 -d ' '` + echo "template:$TEMPLATEPKGLIST" + echo "dom0:$PKGLIST" + exit +fi + if [ -z "$PKGLIST" ]; then # No new updates exit 0 diff --git a/dom0/aux-tools/qubes-watch-updates.sh b/dom0/aux-tools/qubes-watch-updates.sh index ecfda429..0064302b 100755 --- a/dom0/aux-tools/qubes-watch-updates.sh +++ b/dom0/aux-tools/qubes-watch-updates.sh @@ -22,7 +22,7 @@ flock --nonblock -s 200 || exit 1 /usr/lib/qubes/sync_rpmdb_updatevm.sh while true; do # Output of this script is UNTRUSTED! - $QREXEC_CLIENT -d $UPDATES_VM "user:/usr/lib/qubes/qubes_check_for_updates.sh" |\ + $QREXEC_CLIENT -d $UPDATES_VM "user:/usr/lib/qubes/qubes_download_dom0_updates.sh --check-only" |\ while IFS=: read -n 819200 domain packages; do if [ "x$domain" = "xtemplate" -a -n "$packages" ]; then TEMPLATE_UPDATE_COUNT=`echo "$packages" | wc -w` diff --git a/rpm_spec/core-commonvm.spec b/rpm_spec/core-commonvm.spec index 6f2fe779..101b2260 100644 --- a/rpm_spec/core-commonvm.spec +++ b/rpm_spec/core-commonvm.spec @@ -81,7 +81,6 @@ cp qubes_memory.rules $RPM_BUILD_ROOT/etc/udev/rules.d/50-qubes_memory.rules mkdir -p $RPM_BUILD_ROOT/usr/lib/qubes/ cp setup_ip $RPM_BUILD_ROOT/usr/lib/qubes/ cp qubes_download_dom0_updates.sh $RPM_BUILD_ROOT/usr/lib/qubes/ -cp qubes_check_for_updates.sh $RPM_BUILD_ROOT/usr/lib/qubes/ mkdir -p $RPM_BUILD_ROOT/etc/yum/post-actions cp qubes_trigger_sync_appmenus.action $RPM_BUILD_ROOT/etc/yum/post-actions/ mkdir -p $RPM_BUILD_ROOT/usr/lib/qubes @@ -247,5 +246,4 @@ rm -rf $RPM_BUILD_ROOT /etc/yum/post-actions/qubes_trigger_sync_appmenus.action /usr/lib/qubes/qubes_trigger_sync_appmenus.sh /usr/lib/qubes/qubes_download_dom0_updates.sh -/usr/lib/qubes/qubes_check_for_updates.sh /lib/firmware/updates