Merge "Colorado: Rebase git submodules on stable/mitaka."
[armband.git] / patches / fuel-agent / 0011-target-Ubuntu-Blacklist-rtc-efi-if-not-supported.patch
1 From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2 Date: Mon, 9 May 2016 21:46:51 +0200
3 Subject: [PATCH] target Ubuntu: Blacklist rtc-efi if not supported.
4
5 Older ThunderX and possibly other UEFI-enabled targets do not support
6 rtc-efi properly, so they end up filling dmesg with useless
7 complaints about not being able to read system time.
8
9 Target OS (Ubuntu) deployment already has a snippet that blacklists
10 i2c_piix4 in certain scenarios, so provide a similar test for rtc_efi.
11 ---
12  cloud-init-templates/boothook_fuel_7.0_ubuntu.jinja2 | 10 ++++++++--
13  1 file changed, 8 insertions(+), 2 deletions(-)
14
15 diff --git a/cloud-init-templates/boothook_fuel_7.0_ubuntu.jinja2 b/cloud-init-templates/boothook_fuel_7.0_ubuntu.jinja2
16 index 253be2d..9758376 100644
17 --- a/cloud-init-templates/boothook_fuel_7.0_ubuntu.jinja2
18 +++ b/cloud-init-templates/boothook_fuel_7.0_ubuntu.jinja2
19 @@ -49,8 +49,14 @@ cloud-init-per instance resolv_conf_head_nameserver /bin/sh -c 'echo nameserver
20  # configure black module lists
21  # virt-what should be installed
22  if [ ! -f /etc/modprobe.d/blacklist-i2c_piix4.conf ]; then
23 -    ( (virt-what | fgrep -q "virtualbox") && echo "blacklist i2c_piix4" >> /etc/modprobe.d/blacklist-i2c_piix4.conf || :) && update-initramfs -u -k all
24 -    modprobe -r i2c_piix4
25 +    ( (virt-what | fgrep -q "virtualbox") && \
26 +        ( echo "blacklist i2c_piix4" >> /etc/modprobe.d/blacklist-i2c_piix4.conf && \
27 +        update-initramfs -u -k all && modprobe -r i2c_piix4 ) || :)
28 +fi
29 +if [ ! -f /etc/modprobe.d/blacklist-rtc_efi.conf ]; then
30 +    ( /bin/cat /sys/class/rtc/rtc0/time > /dev/null 2>&1 ) || \
31 +        ( echo "blacklist rtc_efi" >> /target/etc/modprobe.d/blacklist-rtc_efi.conf && \
32 +        update-initramfs -u -k all && modprobe -r rtc_efi )
33  fi
34  
35  cloud-init-per instance conntrack_ipv4 /bin/sh -c 'echo nf_conntrack_ipv4 | tee -a /etc/modules'