diff --git a/.gitignore b/.gitignore index ed0b8c4..84c9dba 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/tuned-2.4.1.tar.bz2 +SOURCES/tuned-2.5.1.tar.bz2 diff --git a/.tuned.metadata b/.tuned.metadata index 60b85a9..66a418a 100644 --- a/.tuned.metadata +++ b/.tuned.metadata @@ -1 +1 @@ -fe8c50ef57407de6f8c4637e3548c0eb86ea174f SOURCES/tuned-2.4.1.tar.bz2 +998b7d8420493053f2bb9d579ec5985bfae4ee85 SOURCES/tuned-2.5.1.tar.bz2 diff --git a/SOURCES/tuned-2.4.0-gtk-3.8.patch b/SOURCES/tuned-2.4.0-gtk-3.8.patch deleted file mode 100644 index fc73fd8..0000000 --- a/SOURCES/tuned-2.4.0-gtk-3.8.patch +++ /dev/null @@ -1,100 +0,0 @@ -diff --git a/tuned-gui.glade b/tuned-gui.glade -index 36e173a..30dd51a 100644 ---- a/tuned-gui.glade -+++ b/tuned-gui.glade -@@ -1,7 +1,6 @@ - - - -- - - False - dialog -@@ -729,12 +728,6 @@ - - True - False -- -- -- True -- False -- -- - - - False -diff --git a/tuned-gui.py b/tuned-gui.py -index 1483f4e..5fd25b5 100755 ---- a/tuned-gui.py -+++ b/tuned-gui.py -@@ -299,8 +299,6 @@ class Base(object): - - self.label_actual_profile.set_text(self.controller.active_profile()) - self.label_recommended_profile.set_text(self.controller.recommend_profile()) -- self.listbox_summary_of_active_profile = \ -- self.builder.get_object('listboxSummaryOfActiveProfile') - - self.data_for_listbox_summary_of_active_profile() - self.comboboxtext_fast_change_profile.set_model(self.treestore_profiles) -@@ -425,9 +423,6 @@ class Base(object): - This method is emited after change profile and on startup of app. - """ - -- for row in self.listbox_summary_of_active_profile: -- self.listbox_summary_of_active_profile.remove(row) -- - if self.is_tuned_connection_ok(): - self.active_profile = \ - self.manager.get_profile(self.controller.active_profile()) -@@ -443,51 +438,6 @@ class Base(object): - - self.label_summary_included_profile.set_text('None') - -- row = Gtk.ListBoxRow() -- box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=0) -- plugin_name = Gtk.Label() -- plugin_name.set_markup('Plugin Name') -- plugin_option = Gtk.Label() -- plugin_option.set_markup('Plugin Options') -- box.pack_start(plugin_name, True, True, 0) -- box.pack_start(plugin_option, True, True, 0) -- row.add(box) -- -- self.listbox_summary_of_active_profile.add(row) -- -- sep = Gtk.Separator.new(Gtk.Orientation.HORIZONTAL) -- self.listbox_summary_of_active_profile.add(sep) -- sep.show() -- -- for u in self.active_profile.units: -- row = Gtk.ListBoxRow() -- hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, -- spacing=0) -- hbox.set_homogeneous(True) -- row.add(hbox) -- label = Gtk.Label() -- label.set_markup(u) -- label.set_justify(Gtk.Justification.LEFT) -- hbox.pack_start(label, False, True, 1) -- -- grid = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, -- spacing=0) -- grid.set_homogeneous(True) -- for o in self.active_profile.units[u].options: -- label_option = Gtk.Label() -- label_option.set_markup(o + ' = ' + '' -- + self.active_profile.units[u].options[o] -- + '') -- grid.pack_start(label_option, False, True, 0) -- -- hbox.pack_start(grid, False, True, 0) -- self.listbox_summary_of_active_profile.add(row) -- separator = Gtk.Separator.new(Gtk.Orientation.HORIZONTAL) -- self.listbox_summary_of_active_profile.add(separator) -- separator.show() -- -- self.listbox_summary_of_active_profile.show_all() -- - # def on_treeview_button_press_event(self, treeview, event): - # popup = Gtk.Menu() - # popup.append(Gtk.MenuItem('add')) diff --git a/SOURCES/tuned-2.5.1-gtk-3.8.patch b/SOURCES/tuned-2.5.1-gtk-3.8.patch new file mode 100644 index 0000000..d06f60d --- /dev/null +++ b/SOURCES/tuned-2.5.1-gtk-3.8.patch @@ -0,0 +1,100 @@ +diff --git a/tuned-gui.glade b/tuned-gui.glade +index 36e173a..30dd51a 100644 +--- a/tuned-gui.glade ++++ b/tuned-gui.glade +@@ -1,7 +1,6 @@ + + + +- + + False + dialog +@@ -729,12 +728,6 @@ + + True + False +- +- +- True +- False +- +- + + + False +diff --git a/tuned-gui.py b/tuned-gui.py +index b525e8d..871857a 100755 +--- a/tuned-gui.py ++++ b/tuned-gui.py +@@ -302,8 +302,6 @@ class Base(object): + self.label_actual_profile.set_text(self.controller.active_profile()) + if self.config.get(consts.CFG_RECOMMEND_COMMAND): + self.label_recommended_profile.set_text(self.controller.recommend_profile()) +- self.listbox_summary_of_active_profile = \ +- self.builder.get_object('listboxSummaryOfActiveProfile') + + self.data_for_listbox_summary_of_active_profile() + self.comboboxtext_fast_change_profile.set_model(self.treestore_profiles) +@@ -428,9 +426,6 @@ class Base(object): + This method is emited after change profile and on startup of app. + """ + +- for row in self.listbox_summary_of_active_profile: +- self.listbox_summary_of_active_profile.remove(row) +- + if self.is_tuned_connection_ok(): + self.active_profile = \ + self.manager.get_profile(self.controller.active_profile()) +@@ -446,51 +441,6 @@ class Base(object): + + self.label_summary_included_profile.set_text('None') + +- row = Gtk.ListBoxRow() +- box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=0) +- plugin_name = Gtk.Label() +- plugin_name.set_markup('Plugin Name') +- plugin_option = Gtk.Label() +- plugin_option.set_markup('Plugin Options') +- box.pack_start(plugin_name, True, True, 0) +- box.pack_start(plugin_option, True, True, 0) +- row.add(box) +- +- self.listbox_summary_of_active_profile.add(row) +- +- sep = Gtk.Separator.new(Gtk.Orientation.HORIZONTAL) +- self.listbox_summary_of_active_profile.add(sep) +- sep.show() +- +- for u in self.active_profile.units: +- row = Gtk.ListBoxRow() +- hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, +- spacing=0) +- hbox.set_homogeneous(True) +- row.add(hbox) +- label = Gtk.Label() +- label.set_markup(u) +- label.set_justify(Gtk.Justification.LEFT) +- hbox.pack_start(label, False, True, 1) +- +- grid = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, +- spacing=0) +- grid.set_homogeneous(True) +- for o in self.active_profile.units[u].options: +- label_option = Gtk.Label() +- label_option.set_markup(o + ' = ' + '' +- + self.active_profile.units[u].options[o] +- + '') +- grid.pack_start(label_option, False, True, 0) +- +- hbox.pack_start(grid, False, True, 0) +- self.listbox_summary_of_active_profile.add(row) +- separator = Gtk.Separator.new(Gtk.Orientation.HORIZONTAL) +- self.listbox_summary_of_active_profile.add(separator) +- separator.show() +- +- self.listbox_summary_of_active_profile.show_all() +- + # def on_treeview_button_press_event(self, treeview, event): + # popup = Gtk.Menu() + # popup.append(Gtk.MenuItem('add')) diff --git a/SOURCES/tuned-2.5.1-unquoting-sysctl-values.patch b/SOURCES/tuned-2.5.1-unquoting-sysctl-values.patch new file mode 100644 index 0000000..07f2f86 --- /dev/null +++ b/SOURCES/tuned-2.5.1-unquoting-sysctl-values.patch @@ -0,0 +1,111 @@ +From efac9c470b2a74da94c92703e87da603bf87296f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= +Date: Wed, 19 Aug 2015 14:09:56 +0200 +Subject: [PATCH] plugin_sysctl: unquoting sysctl values +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Unquoting first and last quotation mark in value, i.e. converting: +OPTION="VALUE" to OPTION=VALUE + +Also added unquoting to profile verification, unquoting both +(current and requested) values. + +Resolves: rhbz#1254538 + +Signed-off-by: Jaroslav Škarvada +--- + tuned/plugins/base.py | 7 +++++-- + tuned/plugins/plugin_bootloader.py | 5 +---- + tuned/plugins/plugin_sysctl.py | 2 +- + tuned/utils/commands.py | 3 +++ + 4 files changed, 10 insertions(+), 7 deletions(-) + +diff --git a/tuned/plugins/base.py b/tuned/plugins/base.py +index e7ff2d2..3b4652a 100644 +--- a/tuned/plugins/base.py ++++ b/tuned/plugins/base.py +@@ -3,6 +3,7 @@ import tuned.consts as consts + import tuned.profiles.variables + import tuned.logs + import collections ++from tuned.utils.commands import commands + + log = tuned.logs.get() + +@@ -35,6 +36,8 @@ class Plugin(object): + + self._options_used_by_dynamic = self._get_config_options_used_by_dynamic() + ++ self._cmd = commands() ++ + def cleanup(self): + self.destroy_instances() + +@@ -415,10 +418,10 @@ class Plugin(object): + command["set"](new_value, sim = False) + + def _norm_value(self, value): +- v = str(value) ++ v = self._cmd.unquote(str(value)) + if re.match(r'\s*(0+,)+[\da-fA-F]*\s*$', v): + return re.sub(r'^\s*(0+,)+', "", v) +- return value ++ return v + + def _verify_value(self, name, new_value, current_value, device = None): + if new_value is None: +diff --git a/tuned/plugins/plugin_bootloader.py b/tuned/plugins/plugin_bootloader.py +index e0ff646..27b7132 100644 +--- a/tuned/plugins/plugin_bootloader.py ++++ b/tuned/plugins/plugin_bootloader.py +@@ -105,9 +105,6 @@ class BootloaderPlugin(base.Plugin): + self._grub2_default_env_patch() + return True + +- def _unquote(self, v): +- return re.sub("^\"(.*)\"$", r"\1", v) +- + @command_custom("grub2_cfg_file") + def _grub2_cfg_file(self, enabling, value, verify): + # nothing to verify +@@ -118,7 +115,7 @@ class BootloaderPlugin(base.Plugin): + + @command_custom("cmdline", per_device = False, priority = 10) + def _cmdline(self, enabling, value, verify): +- v = self._variables.expand(self._unquote(value)) ++ v = self._variables.expand(self._cmd.unquote(value)) + if verify: + cmdline = self._cmd.read_file("/proc/cmdline") + if len(cmdline) == 0: +diff --git a/tuned/plugins/plugin_sysctl.py b/tuned/plugins/plugin_sysctl.py +index 676fd52..70f27af 100644 +--- a/tuned/plugins/plugin_sysctl.py ++++ b/tuned/plugins/plugin_sysctl.py +@@ -43,7 +43,7 @@ class SysctlPlugin(base.Plugin): + original_value = self._read_sysctl(option) + if original_value != None: + instance._sysctl_original[option] = original_value +- self._write_sysctl(option, self._variables.expand(value)) ++ self._write_sysctl(option, self._variables.expand(self._cmd.unquote(value))) + + self._storage.set("options", instance._sysctl_original) + +diff --git a/tuned/utils/commands.py b/tuned/utils/commands.py +index 4c80783..2392a89 100644 +--- a/tuned/utils/commands.py ++++ b/tuned/utils/commands.py +@@ -30,6 +30,9 @@ class commands: + def remove_ws(self, s): + return re.sub('\s+', ' ', s).strip() + ++ def unquote(self, v): ++ return re.sub("^\"(.*)\"$", r"\1", v) ++ + # convert dictionary 'd' to flat list and return it + # it uses sort on the dictionary items to return consistent results + # for directories with different inserte/delete history +-- +2.4.3 + diff --git a/SPECS/tuned.spec b/SPECS/tuned.spec index 1000ef8..a2d9568 100644 --- a/SPECS/tuned.spec +++ b/SPECS/tuned.spec @@ -1,7 +1,7 @@ Summary: A dynamic adaptive system tuning daemon Name: tuned -Version: 2.4.1 -Release: 1%{?dist} +Version: 2.5.1 +Release: 4%{?dist} License: GPLv2+ Source: https://fedorahosted.org/releases/t/u/tuned/tuned-%{version}.tar.bz2 URL: https://fedorahosted.org/tuned/ @@ -13,8 +13,9 @@ Requires(postun): systemd Requires: python-decorator, dbus-python, pygobject3-base, python-pyudev # kernel-tools, hdparm dependencies are not met on s390 Requires: virt-what, python-configobj, ethtool, gawk -Requires: util-linux -Patch0: tuned-2.4.0-gtk-3.8.patch +Requires: util-linux, python-perf +Patch0: tuned-2.5.1-gtk-3.8.patch +Patch1: tuned-2.5.1-unquoting-sysctl-values.patch %description The tuned package contains a daemon that tunes system settings dynamically. @@ -23,6 +24,14 @@ Based on that information components will then be put into lower or higher power saving modes to adapt to the current usage. Currently only ethernet network and ATA harddisk devices are implemented. +%if 0%{?rhel} <= 7 && 0%{!?fedora:1} +# RHEL <= 7 +%global docdir %{_docdir}/%{name}-%{version} +%else +# RHEL > 7 || fedora +%global docdir %{_docdir}/%{name} +%endif + %package gtk Summary: GTK GUI for tuned Requires: %{name} = %{version}-%{release} @@ -59,6 +68,13 @@ Requires: %{name} = %{version}-%{release} %description profiles-sap Additional tuned profile(s) targeted to SAP NetWeaver loads. +%package profiles-oracle +Summary: Additional tuned profile(s) targeted to Oracle loads +Requires: %{name} = %{version}-%{release} + +%description profiles-oracle +Additional tuned profile(s) targeted to Oracle loads. + %package profiles-sap-hana Summary: Additional tuned profile(s) targeted to SAP HANA loads Requires: %{name} = %{version}-%{release} @@ -67,11 +83,27 @@ Requires: %{name} = %{version}-%{release} Additional tuned profile(s) targeted to SAP HANA loads. %package profiles-atomic -Summary: Additional tuned profiles targeted to Atomic +Summary: Additional tuned profile(s) targeted to Atomic Requires: %{name} = %{version}-%{release} %description profiles-atomic -Additional tuned profiles targeted to Atomic host and guest. +Additional tuned profile(s) targeted to Atomic host and guest. + +%package profiles-realtime +Summary: Additional tuned profile(s) targeted to realtime +Requires: %{name} = %{version}-%{release} +Requires: tuna + +%description profiles-realtime +Additional tuned profile(s) targeted to realtime. + +%package profiles-nfv +Summary: Additional tuned profile(s) targeted to Network Function Virtualization (NFV) +Requires: %{name} = %{version}-%{release}, %{name}-profiles-realtime = %{version}-%{release} +Requires: tuna, qemu-kvm-tools-rhev + +%description profiles-nfv +Additional tuned profile(s) targeted to Network Function Virtualization (NFV). %package profiles-compat Summary: Additional tuned profiles mainly for backward compatibility with tuned 1.0 @@ -84,13 +116,14 @@ It can be also used to fine tune your system for specific scenarios. %prep %setup -q %patch0 -p1 +%patch1 -p1 %build %install -make install DESTDIR=%{buildroot} DOCDIR=%{_docdir}/%{name}-%{version} +make install DESTDIR=%{buildroot} DOCDIR=%{docdir} %if 0%{?rhel} sed -i 's/\(dynamic_tuning[ \t]*=[ \t]*\).*/\10/' %{buildroot}%{_sysconfdir}/tuned/tuned-main.conf %endif @@ -107,6 +140,12 @@ rmdir %{buildroot}%{_sysconfdir}/grub.d # convert active_profile from full path to name (if needed) sed -i 's|.*/\([^/]\+\)/[^\.]\+\.conf|\1|' /etc/tuned/active_profile +# convert GRUB_CMDLINE_LINUX to GRUB_CMDLINE_LINUX_DEFAULT +if [ -r "%{_sysconfdir}/default/grub" ]; then + sed -i 's/GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX \\$tuned_params"/GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT \\$tuned_params"/' \ + %{_sysconfdir}/default/grub +fi + %preun %systemd_preun tuned.service @@ -119,6 +158,10 @@ sed -i 's|.*/\([^/]\+\)/[^\.]\+\.conf|\1|' /etc/tuned/active_profile # and tuned is noarch package, thus the following hack is needed if [ "$1" == 0 ]; then rm -f %{_sysconfdir}/grub.d/00_tuned || : +# unpatch /etc/default/grub + if [ -r "%{_sysconfdir}/default/grub" ]; then + sed -i '/GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT \\$tuned_params"/d' %{_sysconfdir}/default/grub + fi fi @@ -142,11 +185,12 @@ fi %doc COPYING %doc README %doc doc/TIPS.txt -%{_datadir}/bash-completion/completions/tuned +%{_datadir}/bash-completion/completions/tuned-adm %exclude %{python_sitelib}/tuned/gtk %{python_sitelib}/tuned %{_sbindir}/tuned %{_sbindir}/tuned-adm +%exclude %{_sysconfdir}/tuned/realtime-variables.conf %exclude %{_prefix}/lib/tuned/default %exclude %{_prefix}/lib/tuned/desktop-powersave %exclude %{_prefix}/lib/tuned/laptop-ac-powersave @@ -157,10 +201,15 @@ fi %exclude %{_prefix}/lib/tuned/sap-netweaver %exclude %{_prefix}/lib/tuned/sap-hana %exclude %{_prefix}/lib/tuned/sap-hana-vmware +%exclude %{_prefix}/lib/tuned/oracle %exclude %{_prefix}/lib/tuned/atomic-host %exclude %{_prefix}/lib/tuned/atomic-guest +%exclude %{_prefix}/lib/tuned/realtime +%exclude %{_prefix}/lib/tuned/realtime-virtual-guest +%exclude %{_prefix}/lib/tuned/realtime-virtual-host %{_prefix}/lib/tuned %dir %{_sysconfdir}/tuned +%dir %{_libexecdir}/tuned %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/tuned/active_profile %config(noreplace) %{_sysconfdir}/tuned/tuned-main.conf %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/tuned/bootcmdline @@ -212,12 +261,32 @@ fi %{_prefix}/lib/tuned/sap-hana-vmware %{_mandir}/man7/tuned-profiles-sap-hana.7* +%files profiles-oracle +%defattr(-,root,root,-) +%{_prefix}/lib/tuned/oracle +%{_mandir}/man7/tuned-profiles-oracle.7* + %files profiles-atomic %defattr(-,root,root,-) %{_prefix}/lib/tuned/atomic-host %{_prefix}/lib/tuned/atomic-guest %{_mandir}/man7/tuned-profiles-atomic.7* +%files profiles-realtime +%defattr(-,root,root,-) +%config(noreplace) %{_sysconfdir}/tuned/realtime-variables.conf +%{_prefix}/lib/tuned/realtime +%{_mandir}/man7/tuned-profiles-realtime.7* + +%files profiles-nfv +%defattr(-,root,root,-) +%config(noreplace) %{_sysconfdir}/tuned/realtime-virtual-guest-variables.conf +%config(noreplace) %{_sysconfdir}/tuned/realtime-virtual-host-variables.conf +%{_prefix}/lib/tuned/realtime-virtual-guest +%{_prefix}/lib/tuned/realtime-virtual-host +%{_libexecdir}/tuned/defirqaffinity* +%{_mandir}/man7/tuned-profiles-nfv.7* + %files profiles-compat %defattr(-,root,root,-) %{_prefix}/lib/tuned/default @@ -230,6 +299,76 @@ fi %{_mandir}/man7/tuned-profiles-compat.7* %changelog +* Wed Sep 23 2015 Jaroslav Škarvada - 2.5.1-4 +- grub support in post scriptlet made conditional not to break s390(x) + resolves: rhbz#1265654 + +* Fri Aug 28 2015 Jaroslav Škarvada - 2.5.1-3 +- patched files are not backed up + related: rhbz#1254538 + +* Fri Aug 28 2015 Jaroslav Škarvada - 2.5.1-2 +- unquoted sysctl values + resolves: rhbz#1254538 + +* Tue Aug 4 2015 Jaroslav Škarvada - 2.5.1-1 +- new-release + related: rhbz#1155052 + - plugin_scheduler: work with nohz_full + resolves: rhbz#1247184 + - fixed realtime-virtual-guest/host profiles packaged twice + resolves: rhbz#1249028 + - fixed requirements of realtime and nfv profiles + - fixed tuned-gui not starting + - various other minor fixes + - defuzzified gtk-3.8 patch + +* Sun Jul 5 2015 Jaroslav Škarvada - 2.5.0-1 +- new-release + resolves: rhbz#1155052 + - add support for ethtool -C to tuned network plugin + resolves: rhbz#1152539 + - add support for ethtool -K to tuned network plugin + resolves: rhbz#1152541 + - add support for calculation of values for the kernel command line + resolves: rhbz#1191595 + - no error output if there is no hdparm installed + resolves: rhbz#1191775 + - do not run hdparm on hotplug events if there is no hdparm tuning + resolves: rhbz#1193682 + - add oracle tuned profile + resolves: rhbz#1196298 + - fix bash completions for tuned-adm + resolves: rhbz#1207668 + - add glob support to tuned sysfs plugin + resolves: rhbz#1212831 + - add tuned-adm verify subcommand + resolves: rhbz#1212836 + - do not install tuned kernel command line to rescue kernels + resolves: rhbz#1223864 + - add variables support + resolves: rhbz#1225124 + - add built-in support for unit conversion into tuned + resolves: rhbz#1225135 + - fixed vm.max_map_count setting in sap-netweaver profile + resolves: rhbz#1228562 + - create tuned profile for RHEL-RT + resolves: rhbz#1228801 + - plugin_scheduler: added support for runtime tuning of processes + resolves: rhbz#1148546 + - add support for changing elevators on xvd* devices (Amazon EC2) + resolves: rhbz#1170152 + - add workaround to be run after systemd-sysctl + resolves: rhbz#1189263 + - do not change settings of transparent hugepages if set in kernel cmdline + resolves: rhbz#1189868 + - add tuned profiles for RHEL-NFV + resolves: rhbz#1228803 + - plugin_bootloader: apply $tuned_params to existing kernels + resolves: rhbz#1233004 + - add support for no daemon mode + resolves: rhbz#1068663 + * Thu Oct 16 2014 Jaroslav Škarvada - 2.4.1-1 - new-release resolves: rhbz#1093883