From 994bd72363761823fc34b2c42cc6b4d3c5b74c9d Mon Sep 17 00:00:00 2001 From: donoban Date: Fri, 23 Feb 2018 10:48:06 +0100 Subject: [PATCH 1/3] Make dir dom0-updates if not exists on UpdateVM https://github.com/QubesOS/qubes-issues/issues/3620 --- dom0-updates/qubes-dom0-update | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dom0-updates/qubes-dom0-update b/dom0-updates/qubes-dom0-update index e5169bf..617344e 100755 --- a/dom0-updates/qubes-dom0-update +++ b/dom0-updates/qubes-dom0-update @@ -166,6 +166,8 @@ rm -f /var/lib/qubes/updates/errors echo "Using $UPDATEVM as UpdateVM to download updates for Dom0; this may take some time..." >&2 # qvm-run by default auto-starts the VM if not running +qvm-run --nogui -q -u root $UPDATEVM 'mkdir -m 775 /var/lib/qubes/dom0-updates/' || exit 1 +qvm-run --nogui -q -u root $UPDATEVM 'chown user:user /var/lib/qubes/dom0-updates/' || exit 1 qvm-run --nogui -q $UPDATEVM 'rm -rf /var/lib/qubes/dom0-updates/etc' || exit 1 tar c /var/lib/rpm /etc/yum.repos.d /etc/yum.conf 2>/dev/null | \ qvm-run --nogui --pass-io "$UPDATEVM" 'LC_MESSAGES=C tar x -C /var/lib/qubes/dom0-updates 2>&1 | grep -v -E "s in the future"' From 31548737c6abe21043b8f427b362d05fbe621dcc Mon Sep 17 00:00:00 2001 From: donoban Date: Sun, 25 Feb 2018 12:14:39 +0100 Subject: [PATCH 2/3] Add -p to mkdir to skip error if dir already exists --- dom0-updates/qubes-dom0-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom0-updates/qubes-dom0-update b/dom0-updates/qubes-dom0-update index 617344e..8986cb8 100755 --- a/dom0-updates/qubes-dom0-update +++ b/dom0-updates/qubes-dom0-update @@ -166,7 +166,7 @@ rm -f /var/lib/qubes/updates/errors echo "Using $UPDATEVM as UpdateVM to download updates for Dom0; this may take some time..." >&2 # qvm-run by default auto-starts the VM if not running -qvm-run --nogui -q -u root $UPDATEVM 'mkdir -m 775 /var/lib/qubes/dom0-updates/' || exit 1 +qvm-run --nogui -q -u root $UPDATEVM 'mkdir -m 775 -p /var/lib/qubes/dom0-updates/' || exit 1 qvm-run --nogui -q -u root $UPDATEVM 'chown user:user /var/lib/qubes/dom0-updates/' || exit 1 qvm-run --nogui -q $UPDATEVM 'rm -rf /var/lib/qubes/dom0-updates/etc' || exit 1 tar c /var/lib/rpm /etc/yum.repos.d /etc/yum.conf 2>/dev/null | \ From dbb22f63354132fe1f3902ce3e33f7ddc9971435 Mon Sep 17 00:00:00 2001 From: donoban Date: Sun, 25 Feb 2018 12:17:48 +0100 Subject: [PATCH 3/3] Bad spaces --- dom0-updates/qubes-dom0-update | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dom0-updates/qubes-dom0-update b/dom0-updates/qubes-dom0-update index 8986cb8..4f5aafa 100755 --- a/dom0-updates/qubes-dom0-update +++ b/dom0-updates/qubes-dom0-update @@ -166,8 +166,8 @@ rm -f /var/lib/qubes/updates/errors echo "Using $UPDATEVM as UpdateVM to download updates for Dom0; this may take some time..." >&2 # qvm-run by default auto-starts the VM if not running -qvm-run --nogui -q -u root $UPDATEVM 'mkdir -m 775 -p /var/lib/qubes/dom0-updates/' || exit 1 -qvm-run --nogui -q -u root $UPDATEVM 'chown user:user /var/lib/qubes/dom0-updates/' || exit 1 +qvm-run --nogui -q -u root $UPDATEVM 'mkdir -m 775 -p /var/lib/qubes/dom0-updates/' || exit 1 +qvm-run --nogui -q -u root $UPDATEVM 'chown user:user /var/lib/qubes/dom0-updates/' || exit 1 qvm-run --nogui -q $UPDATEVM 'rm -rf /var/lib/qubes/dom0-updates/etc' || exit 1 tar c /var/lib/rpm /etc/yum.repos.d /etc/yum.conf 2>/dev/null | \ qvm-run --nogui --pass-io "$UPDATEVM" 'LC_MESSAGES=C tar x -C /var/lib/qubes/dom0-updates 2>&1 | grep -v -E "s in the future"'