Blacklist didn't work if running VirtualBox

This commit fixes blacklist procedure if running VirtualBox because with
version 5.0 of VirtualBox the 'virt-what' reports several hypervisors,
such as "virtualbox" and "kvm".

Change-Id: Ifba124c4c89fe08f573a56cdf71165309bfd5709
Partial-Bug: #1523526
This commit is contained in:
Maksim Malchuk 2015-12-17 14:22:35 +03:00 committed by Alexander Gordeev
parent 91ef29eea9
commit 08b149a2fb
6 changed files with 6 additions and 6 deletions

View File

@ -42,7 +42,7 @@ cloud-init-per instance resolv_conf_nameserver /bin/sh -c 'echo nameserver {{ co
# configure black module lists # configure black module lists
# virt-what should be installed # virt-what should be installed
if [ ! -f /etc/modprobe.d/blacklist-i2c_piix4.conf ]; then if [ ! -f /etc/modprobe.d/blacklist-i2c_piix4.conf ]; then
([[ $(virt-what) = "virtualbox" ]] && echo "blacklist i2c_piix4" >> /etc/modprobe.d/blacklist-i2c_piix4.conf || :) ( (virt-what | fgrep -q "virtualbox") && echo "blacklist i2c_piix4" >> /etc/modprobe.d/blacklist-i2c_piix4.conf || :)
modprobe -r i2c_piix4 modprobe -r i2c_piix4
fi fi

View File

@ -42,7 +42,7 @@ cloud-init-per instance resolv_conf_nameserver /bin/sh -c 'echo nameserver {{ co
# configure black module lists # configure black module lists
# virt-what should be installed # virt-what should be installed
if [ ! -f /etc/modprobe.d/blacklist-i2c_piix4.conf ]; then if [ ! -f /etc/modprobe.d/blacklist-i2c_piix4.conf ]; then
([[ $(virt-what) = "virtualbox" ]] && echo "blacklist i2c_piix4" >> /etc/modprobe.d/blacklist-i2c_piix4.conf || :) ( (virt-what | fgrep -q "virtualbox") && echo "blacklist i2c_piix4" >> /etc/modprobe.d/blacklist-i2c_piix4.conf || :)
modprobe -r i2c_piix4 modprobe -r i2c_piix4
fi fi

View File

@ -49,7 +49,7 @@ cloud-init-per instance resolv_conf_head_nameserver /bin/sh -c 'echo nameserver
# configure black module lists # configure black module lists
# virt-what should be installed # virt-what should be installed
if [ ! -f /etc/modprobe.d/blacklist-i2c_piix4.conf ]; then if [ ! -f /etc/modprobe.d/blacklist-i2c_piix4.conf ]; then
([[ $(virt-what) = "virtualbox" ]] && echo "blacklist i2c_piix4" >> /etc/modprobe.d/blacklist-i2c_piix4.conf || :) && update-initramfs -u -k all ( (virt-what | fgrep -q "virtualbox") && echo "blacklist i2c_piix4" >> /etc/modprobe.d/blacklist-i2c_piix4.conf || :) && update-initramfs -u -k all
modprobe -r i2c_piix4 modprobe -r i2c_piix4
fi fi

View File

@ -42,7 +42,7 @@ cloud-init-per instance resolv_conf_nameserver /bin/sh -c 'echo nameserver {{ co
# configure black module lists # configure black module lists
# virt-what should be installed # virt-what should be installed
if [ ! -f /etc/modprobe.d/blacklist-i2c_piix4.conf ]; then if [ ! -f /etc/modprobe.d/blacklist-i2c_piix4.conf ]; then
([[ $(virt-what) = "virtualbox" ]] && echo "blacklist i2c_piix4" >> /etc/modprobe.d/blacklist-i2c_piix4.conf || :) ( (virt-what | fgrep -q "virtualbox") && echo "blacklist i2c_piix4" >> /etc/modprobe.d/blacklist-i2c_piix4.conf || :)
modprobe -r i2c_piix4 modprobe -r i2c_piix4
fi fi

View File

@ -49,7 +49,7 @@ cloud-init-per instance resolv_conf_head_nameserver /bin/sh -c 'echo nameserver
# configure black module lists # configure black module lists
# virt-what should be installed # virt-what should be installed
if [ ! -f /etc/modprobe.d/blacklist-i2c_piix4.conf ]; then if [ ! -f /etc/modprobe.d/blacklist-i2c_piix4.conf ]; then
([[ $(virt-what) = "virtualbox" ]] && echo "blacklist i2c_piix4" >> /etc/modprobe.d/blacklist-i2c_piix4.conf || :) && update-initramfs -u -k all ( (virt-what | fgrep -q "virtualbox") && echo "blacklist i2c_piix4" >> /etc/modprobe.d/blacklist-i2c_piix4.conf || :) && update-initramfs -u -k all
modprobe -r i2c_piix4 modprobe -r i2c_piix4
fi fi

View File

@ -49,7 +49,7 @@ cloud-init-per instance resolv_conf_head_nameserver /bin/sh -c 'echo nameserver
# configure black module lists # configure black module lists
# virt-what should be installed # virt-what should be installed
if [ ! -f /etc/modprobe.d/blacklist-i2c_piix4.conf ]; then if [ ! -f /etc/modprobe.d/blacklist-i2c_piix4.conf ]; then
([[ $(virt-what) = "virtualbox" ]] && echo "blacklist i2c_piix4" >> /etc/modprobe.d/blacklist-i2c_piix4.conf || :) && update-initramfs -u -k all ( (virt-what | fgrep -q "virtualbox") && echo "blacklist i2c_piix4" >> /etc/modprobe.d/blacklist-i2c_piix4.conf || :) && update-initramfs -u -k all
modprobe -r i2c_piix4 modprobe -r i2c_piix4
fi fi