Skip to content

Commit

Permalink
apt-mark spice-vdagent for removal on VirtualBox
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Schleizer committed Nov 16, 2018
1 parent 92080b8 commit 51bcf78
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions debian/whonix-legacy.preinst
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,26 @@ whonix_repository_component_extension() {
touch "/var/lib/whonix/do_once/${FUNCNAME}_version_1"
}

virtualbox_spice_vda_agent_removal() {
if [ -f "/var/lib/whonix/do_once/${FUNCNAME}_version_1" ]; then
return 0
fi

[ -n "$virt_detection_tool" ] || virt_detection_tool="systemd-detect-virt"
[ -n "$virtualizer_detected" ] || virtualizer_detected="$("$virt_detection_tool" 2>&1)" || true

if [ ! "$whonixcheck_virtualizer_detected" = "oracle" ]; then
return 0
fi

## man apt-mark excerpt:
## auto is used to mark a package as being automatically installed, which will cause the package to be removed when no more manually installed packages depend on this package.
apt-mark auto spice-vdagent || true

mkdir --parents "/var/lib/whonix/do_once"
touch "/var/lib/whonix/do_once/${FUNCNAME}_version_1"
}

true "1: $1"
true "2: $2"

Expand Down Expand Up @@ -491,6 +511,7 @@ fi

tor_control_panel_migration
whonix_repository_component_extension
virtualbox_spice_vda_agent_removal

true "INFO: End configuring $DPKG_MAINTSCRIPT_PACKAGE."

Expand Down

0 comments on commit 51bcf78

Please sign in to comment.