1 From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2 Date: Sun, 17 Apr 2016 17:53:46 +0200
3 Subject: [PATCH] target Ubuntu: Blacklist rtc-efi if not supported.
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.
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.
12 update-initramfs is already invoked from i2c_piix4 snippet, so ommit
13 explicitly calling it in rtc_efi fragment.
15 deployment/puppet/cobbler/manifests/snippets.pp | 1 +
16 deployment/puppet/cobbler/templates/preseed/ubuntu-1404.preseed.erb | 1 +
17 .../puppet/cobbler/templates/snippets/ubuntu_blacklist_rtc_efi.erb | 1 +
18 3 files changed, 3 insertions(+)
19 create mode 100644 deployment/puppet/cobbler/templates/snippets/ubuntu_blacklist_rtc_efi.erb
21 diff --git a/deployment/puppet/cobbler/manifests/snippets.pp b/deployment/puppet/cobbler/manifests/snippets.pp
22 index 46c76d0..5ab9a17 100644
23 --- a/deployment/puppet/cobbler/manifests/snippets.pp
24 +++ b/deployment/puppet/cobbler/manifests/snippets.pp
25 @@ -58,6 +58,7 @@ class cobbler::snippets {
26 cobbler_snippet {"centos_static_net":}
27 cobbler_snippet {"ofed_install_with_sriov":}
28 cobbler_snippet {"ubuntu_authorized_keys":}
29 + cobbler_snippet {"ubuntu_blacklist_rtc_efi":}
30 cobbler_snippet {"ubuntu_blacklist_i2c_piix4":}
31 cobbler_snippet {"ubuntu_disable_pxe":}
32 cobbler_snippet {"ubuntu_puppet_config":}
33 diff --git a/deployment/puppet/cobbler/templates/preseed/ubuntu-1404.preseed.erb b/deployment/puppet/cobbler/templates/preseed/ubuntu-1404.preseed.erb
34 index 65c6c69..8e17a0e 100644
35 --- a/deployment/puppet/cobbler/templates/preseed/ubuntu-1404.preseed.erb
36 +++ b/deployment/puppet/cobbler/templates/preseed/ubuntu-1404.preseed.erb
37 @@ -177,6 +177,7 @@ echo target > /target/etc/nailgun_systemtype && \
38 $SNIPPET('ubuntu_authorized_keys')
39 sed -i -e "/^\s*GSSAPICleanupCredentials yes/d" -e "/^\s*GSSAPIAuthentication yes/d" -e "s/.*PasswordAuthentication\ .*/PasswordAuthentication\ no/g" -e "/UseDNS/d" /target/etc/ssh/sshd_config && \
40 echo "UseDNS no" >> /target/etc/ssh/sshd_config && \
41 +$SNIPPET('ubuntu_blacklist_rtc_efi')
42 $SNIPPET('ubuntu_blacklist_i2c_piix4')
43 $SNIPPET('ubuntu_static_net')
44 $SNIPPET('ofed_install_with_sriov')
45 diff --git a/deployment/puppet/cobbler/templates/snippets/ubuntu_blacklist_rtc_efi.erb b/deployment/puppet/cobbler/templates/snippets/ubuntu_blacklist_rtc_efi.erb
47 index 0000000..902f142
49 +++ b/deployment/puppet/cobbler/templates/snippets/ubuntu_blacklist_rtc_efi.erb
51 +( /bin/cat /sys/class/rtc/rtc0/time > /dev/null 2>&1 || echo "blacklist rtc_efi" >> /target/etc/modprobe.d/blacklist-rtc_efi.conf ) && \