From e1472df9dd8d32517b428be05ba7858ea1c0064b Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Thu, 14 Mar 2013 14:24:12 +0100 Subject: [PATCH] Remove obsolete files --- dom0/aux-tools/check_and_remove_appmenu.sh | 14 ---- dom0/aux-tools/remove_dom0_appmenus.sh | 6 -- dom0/aux-tools/unbind_all_network_devices | 74 ---------------------- rpm_spec/core-dom0.spec | 2 - 4 files changed, 96 deletions(-) delete mode 100755 dom0/aux-tools/check_and_remove_appmenu.sh delete mode 100755 dom0/aux-tools/remove_dom0_appmenus.sh delete mode 100755 dom0/aux-tools/unbind_all_network_devices diff --git a/dom0/aux-tools/check_and_remove_appmenu.sh b/dom0/aux-tools/check_and_remove_appmenu.sh deleted file mode 100755 index b93b14a6..00000000 --- a/dom0/aux-tools/check_and_remove_appmenu.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -if grep -q X-Qubes-VmName $1 ; then - exit 0 -fi - -if grep -q "Categories=.*\(System\|Settings\)" $1 ; then - #echo "Leaving file: $1" - exit 0 -fi -BACKUP_DIR="/var/lib/qubes/backup/removed-apps/" -mkdir -p $BACKUP_DIR -#echo "Moving file: $1 to $BACKUP_DIR -mv $1 $BACKUP_DIR - diff --git a/dom0/aux-tools/remove_dom0_appmenus.sh b/dom0/aux-tools/remove_dom0_appmenus.sh deleted file mode 100755 index 49811f11..00000000 --- a/dom0/aux-tools/remove_dom0_appmenus.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -echo "--> Removing unnecessary Dom0 Appmenus..." -find /usr/share/applications -name *.desktop -exec /usr/lib/qubes/check_and_remove_appmenu.sh {} \; - -xdg-desktop-menu forceupdate diff --git a/dom0/aux-tools/unbind_all_network_devices b/dom0/aux-tools/unbind_all_network_devices deleted file mode 100755 index 9497feb8..00000000 --- a/dom0/aux-tools/unbind_all_network_devices +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/python2 -# -# The Qubes OS Project, http://www.qubes-os.org -# -# Copyright (C) 2010 Joanna Rutkowska -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# - -from optparse import OptionParser -import subprocess -import shutil -import re - - -def find_net_devices(): - p = subprocess.Popen (["lspci", "-mm", "-n"], stdout=subprocess.PIPE) - result = p.communicate() - retcode = p.returncode - if (retcode != 0): - print "ERROR when executing lspci!" - raise IOError - - net_devices = set() - rx_netdev = re.compile (r"^([0-9a-f][0-9a-f]:[0-9a-f][0-9a-f].[0-9]) \"02") - for dev in str(result[0]).splitlines(): - match = rx_netdev.match (dev) - if match is not None: - dev_bdf = match.group(1) - assert dev_bdf is not None - net_devices.add (dev_bdf) - - return net_devices - -def main(): - usage = "usage: %prog [options] " - parser = OptionParser (usage) - parser.add_option ("-v", "--verbose", dest="verbose", action="store_true", default=False) - (options, args) = parser.parse_args () - - if options.verbose: - print "Loading Xen PCI Backend..." - retcode = subprocess.call (["/sbin/modprobe", "pciback"]) - if retcode != 0: - print "ERROR: Cannot load the pciback module!" - exit(1) - - if options.verbose: - print "Unbinding the following net devices:" - - net_devices = find_net_devices() - - for dev in net_devices: - if options.verbose: - print "--> {0}".format(dev) - retcode = subprocess.call (["/usr/lib/qubes/unbind_pci_device.sh", dev]) - if (retcode != 0): - print "WARNING: Could not unbind device {0}".format(dev) - - -main() diff --git a/rpm_spec/core-dom0.spec b/rpm_spec/core-dom0.spec index 345132e4..b5bacefd 100644 --- a/rpm_spec/core-dom0.spec +++ b/rpm_spec/core-dom0.spec @@ -124,7 +124,6 @@ cp qmemman/qmemman.conf $RPM_BUILD_ROOT%{_sysconfdir}/qubes/ mkdir -p $RPM_BUILD_ROOT/usr/lib/qubes cp aux-tools/unbind_pci_device.sh $RPM_BUILD_ROOT/usr/lib/qubes -cp aux-tools/unbind_all_network_devices $RPM_BUILD_ROOT/usr/lib/qubes cp aux-tools/convert_apptemplate2vm.sh $RPM_BUILD_ROOT/usr/lib/qubes cp aux-tools/convert_dirtemplate2vm.sh $RPM_BUILD_ROOT/usr/lib/qubes cp aux-tools/create_apps_for_appvm.sh $RPM_BUILD_ROOT/usr/lib/qubes @@ -364,7 +363,6 @@ fi %{python_sitearch}/qubes/__init__.pyo %{python_sitearch}/qubes/qmemman*.py* /usr/lib/qubes/unbind_pci_device.sh -/usr/lib/qubes/unbind_all_network_devices /usr/lib/qubes/cleanup_dispvms /usr/lib/qubes/convert_apptemplate2vm.sh /usr/lib/qubes/convert_dirtemplate2vm.sh