From c7da08282bb7c1cbc21a3f0b223091dde486f3b4 Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Fri, 11 Mar 2016 22:46:26 +0300 Subject: [PATCH] vmguest: learn to disable useless services under VMs This has long been a TODO item but an elegant solution just didn't come until the night before starterkits... some services (mostly those operating on real hardware) do not fit virtual environments at all, won't even start. --- .../image-scripts.d/50-vmguest-noservices | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 features.in/vmguest/install2/image-scripts.d/50-vmguest-noservices diff --git a/features.in/vmguest/install2/image-scripts.d/50-vmguest-noservices b/features.in/vmguest/install2/image-scripts.d/50-vmguest-noservices new file mode 100755 index 00000000..28945269 --- /dev/null +++ b/features.in/vmguest/install2/image-scripts.d/50-vmguest-noservices @@ -0,0 +1,16 @@ +#!/bin/sh +# disable services that are known to be useless under VMs +# TODO: un-hardwire the list? + +NOVM_SERVICES="cpufreq-simple powertop smartd" + +cat >> /usr/share/install2/postinstall.d/50-vmguest-noservices.sh << EOF +#!/bin/sh +if grep -qE '(101300b8)|(80eebeef)|(14ad0405)' /proc/bus/pci/devices; then + for i in $NOVM_SERVICES; do + echo "\$i" >> /usr/share/install2/services-off + done +fi +EOF + +chmod +x /usr/share/install2/postinstall.d/50-vmguest-noservices.sh