From a9795ae4a6b3da6697902c1ff1fb3181b7ec4864 Mon Sep 17 00:00:00 2001 From: Joanna Rutkowska Date: Mon, 4 Apr 2011 20:02:52 +0200 Subject: [PATCH] Disable unnecessary services in qubes.postAction() --- anaconda/installclasses/qubes.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/anaconda/installclasses/qubes.py b/anaconda/installclasses/qubes.py index f9a5799..18ee662 100644 --- a/anaconda/installclasses/qubes.py +++ b/anaconda/installclasses/qubes.py @@ -23,6 +23,7 @@ from product import * from meh.filer import * from flags import flags import os +import subprocess import types import iutil @@ -85,6 +86,17 @@ class InstallClass(BaseInstallClass): anaconda.dispatch.skipStep("tasksel") anaconda.dispatch.skipStep("group-selection") + def postAction(self, anaconda): + # First disable all the useless services... + whitelisted = ['functions', 'killall', 'halt', 'single', + 'rsyslog', 'haldaemon', 'messagebus', 'xenstored', 'xend', 'xenconsoled', 'firstboot', + 'qubes_core', 'qubes_netvm'] + + for file in os.listdir(anaconda.rootPath + '/etc/init.d'): + if not file in whitelisted: + subprocess.check_call(['/usr/sbin/chroot', anaconda.rootPath, + '/sbin/chkconfig', '--level', '5', file, 'off']) + def getBackend(self): if flags.livecdInstall: import livecd