avatar
Rosa has added 2a4fe037b2
Automatic import for version 1.0
... ... --- /dev/null
... ... +++ b/cpufreq.init
... ... @@ -0,0 +1,65 @@
1
#!/bin/bash
2
#
3
### BEGIN INIT INFO
4
# Provides: cpufreq
5
# Default-Start: 2 3 4 5
6
# Short-Description: Set CPU frequency settings
7
# Description: Set CPU frequency settings
8
### END INIT INFO
9
10
# Source function library.
11
. /etc/rc.d/init.d/functions
12
13
RETVAL=0
14
15
start() {
16
	gprintf "Setting CPU frequency settings: "
17
	touch /var/lock/subsys/cpufreq
18
	test -f /etc/sysconfig/cpufreq && . /etc/sysconfig/cpufreq
19
	for cpu in /sys/devices/system/cpu/* ; do
20
		[ "x$GOVERNOR" != "x" ] && [ -f  $cpu/cpufreq/scaling_governor ] && echo $GOVERNOR > $cpu/cpufreq/scaling_governor
21
		[ "x$MAX_FREQ" != "x" ] && [ -f  $cpu/cpufreq/scaling_max_freq ] && echo $MAX_FREQ > $cpu/cpufreq/scaling_max_freq
22
		[ "x$MIN_FREQ" != "x" ] && [ -f  $cpu/cpufreq/scaling_min_freq ] && echo $MIN_FREQ > $cpu/cpufreq/scaling_min_freq
23
	done
24
	success
25
	echo
26
}
27
28
real_stop() {
29
	gprintf "Resetting CPU frequency settings: "
30
	# make sure no governor module is in use first
31
	# by switching to userspace governor (because it's built-in and won't modify frequency)
32
	for cpu in /sys/devices/system/cpu/* ; do
33
	    [ -f  $cpu/cpufreq/scaling_governor ] && echo userspace > $cpu/cpufreq/scaling_governor
34
	done
35
	rm -f /var/lock/subsys/cpufreq
36
	success
37
	echo
38
}
39
40
case "$1" in
41
	start)
42
		start
43
		;;
44
	stop)
45
		;;
46
	restart|reload)
47
		real_stop
48
		start
49
		;;
50
	condrestart)
51
		if [ -f /var/log/subsys/cpufreq ]; then
52
			restart
53
		fi
54
		;;
55
	status)
56
		[ -f /var/log/subsys/cpufreq ]
57
		RETVAL=$?
58
		;;
59
	*)
60
		gprintf "Usage: %s {start|stop|restart|condrestart|status}\n" `basename $0`
61
		RETVAL=1
62
		;;
63
esac
64
65
exit $RETVAL
... ... --- /dev/null
... ... +++ b/cpufreq.spec
... ... @@ -0,0 +1,187 @@
1
%define name cpufreq
2
%define version 1.0
3
%define release %mkrel 35
4
5
Summary: An initscript to set CPU frequency settings
6
Name: %{name}
7
Version: %{version}
8
Release: %{release}
9
Source0: cpufreq.init
10
Source1: cpufreq.sysconfig
11
License: GPL
12
Group: System/Servers
13
BuildRoot: %{_tmppath}/%{name}-buildroot
14
Requires(pre): rpm-helper
15
Requires(postun): rpm-helper
16
BuildArch: noarch
17
Url:       http://cvs.mandriva.com/cgi-bin/cvsweb.cgi/SPECS/cpufreq/
18
Requires:  pciutils, sed, gawk, grep, coreutils
19
20
%description
21
cpufreq is a simple initscript to set CPU frequency settings.
22
23
%prep
24
25
%build
26
27
%install
28
rm -rf %{buildroot}
29
mkdir -p  %{buildroot}%_initrddir %{buildroot}%_sysconfdir/sysconfig
30
install -D -m755 %{SOURCE0} %{buildroot}%_initrddir/%{name}
31
install -D -m644 %{SOURCE1} %{buildroot}%_sysconfdir/sysconfig/%{name}
32
33
%clean
34
rm -rf %{buildroot}
35
36
%post
37
%_post_service %{name}
38
39
%preun
40
%_preun_service  %{name}
41
42
%files
43
%defattr(-,root,root)
44
%attr(755,root,root) %_initrddir/%{name}
45
%config(noreplace) %_sysconfdir/sysconfig/%{name}
46
47
48
%changelog
49
* Tue May 03 2011 Oden Eriksson <oeriksson@mandriva.com> 1.0-35mdv2011.0
50
+ Revision: 663414
51
- mass rebuild
52
53
* Tue Nov 30 2010 Oden Eriksson <oeriksson@mandriva.com> 1.0-34mdv2011.0
54
+ Revision: 603853
55
- rebuild
56
57
* Mon Mar 15 2010 Oden Eriksson <oeriksson@mandriva.com> 1.0-33mdv2010.1
58
+ Revision: 520038
59
- rebuilt for 2010.1
60
61
* Sun Aug 09 2009 Oden Eriksson <oeriksson@mandriva.com> 1.0-32mdv2010.0
62
+ Revision: 413270
63
- rebuild
64
65
* Mon Dec 29 2008 Oden Eriksson <oeriksson@mandriva.com> 1.0-31mdv2009.1
66
+ Revision: 321089
67
- rebuild
68
69
* Mon Sep 29 2008 Olivier Blin <oblin@mandriva.com> 1.0-30mdv2009.0
70
+ Revision: 289167
71
- implement service status (to be fastinit compatible)
72
73
* Tue Aug 05 2008 Olivier Blin <oblin@mandriva.com> 1.0-29mdv2009.0
74
+ Revision: 264028
75
- use ondemand governor by default (#42310)
76
77
* Mon Jun 16 2008 Thierry Vignaud <tv@mandriva.org> 1.0-28mdv2009.0
78
+ Revision: 220512
79
- rebuild
80
81
* Tue Feb 12 2008 Olivier Blin <oblin@mandriva.com> 1.0-27mdv2008.1
82
+ Revision: 166314
83
- do not require obsolete acpi service in initscript
84
85
* Fri Jan 11 2008 Thierry Vignaud <tv@mandriva.org> 1.0-26mdv2008.1
86
+ Revision: 149131
87
- rebuild
88
- kill re-definition of %%buildroot on Pixel's request
89
90
  + Olivier Blin <oblin@mandriva.com>
91
    - restore BuildRoot
92
93
* Fri Jun 22 2007 Adam Williamson <awilliamson@mandriva.org> 1.0-25mdv2008.0
94
+ Revision: 42542
95
- rebuild for 2008
96
- Import cpufreq
97
98
99
100
101
* Mon Jul 10 2006 Olivier Blin <oblin@mandriva.com> 1.0-24mdv2007.0
102
- drop modules probing, this is done by harddrake now
103
- drop chkconfig comments in initscript
104
105
* Mon Jan  9 2006 Olivier Blin <oblin@mandriva.com> 1.0-23mdk
106
- from Andrey Borzenkov (#20523): fix startup order and add comments
107
108
* Mon Jan  9 2006 Olivier Blin <oblin@mandriva.com> 1.0-22mdk
109
- convert parallel init to LSB
110
- acpi-cpufreq support (Andrey Borzenkov, #20519)
111
112
* Mon Jan  2 2006 Olivier Blin <oblin@mandriva.com> 1.0-21mdk
113
- parallel init support
114
115
* Tue Dec 20 2005 Olivier Blin <oblin@mandriva.com> 1.0-20mdk
116
- adapt to new "lspci -n" format  (Michael Reinsch, #20275)
117
118
* Mon Oct  3 2005 Olivier Blin <oblin@mandriva.com> 1.0-19mdk
119
- fix typo in service description (#18961)
120
121
* Mon Sep 19 2005 Olivier Blin <oblin@mandriva.com> 1.0-18mdk
122
- don't unload module on stop, but try to reload it on restart (#18460)
123
124
* Mon Aug 29 2005 Austin Acton <austin@mandriva.org> 1.0-17mdk
125
- add conservative governor module
126
127
* Mon Aug 08 2005 Frederic Crozat <fcrozat@mandriva.com> 1.0-16mdk 
128
- Update source0 and add source1 : add support for setting
129
  governor, max and min frequencies after loading modules
130
- Fix url
131
132
* Mon Jun 13 2005 Erwan Velu <velu@seanodes.com> 1.0-15mdk
133
- Fixing rights
134
135
* Thu Mar 17 2005 Olivier Blin <oblin@mandrakesoft.com> 1.0-14mdk
136
- AMD 64 support (#14687)
137
138
* Mon Mar 14 2005 Olivier Blin <oblin@mandrakesoft.com> 1.0-13mdk
139
- do not look for cpufreq entry in /proc (obsolete)
140
  or in /sysfs (dynamically created by cpufreq modules) (#13289)
141
142
* Sat Feb 12 2005 Olivier Blin <oblin@mandrakesoft.com> 1.0-12mdk
143
- probe speedstep-smi module (#13015)
144
145
* Wed Feb  2 2005 Olivier Blin <oblin@mandrakesoft.com> 1.0-11mdk
146
- PPC support and misc fixes (from Danny Tholen)
147
148
* Tue Feb  1 2005 Olivier Blin <blino@mandrake.org> 1.0-10mdk
149
- load all cpufreq governors (#13290)
150
  (performance, ondemand, userspace, powersave)
151
152
* Wed Jan  5 2005 Olivier Blin <blino@mandrake.org> 1.0-9mdk
153
- handle one more centrino CPU (Dothan, model 13)
154
- merge patch0
155
156
* Fri Oct 22 2004 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 1.0-8.1mdk
157
- handle powernow-k8
158
159
* Wed Sep  8 2004 Frederic Lepied <flepied@mandrakesoft.com> 1.0-8mdk
160
- applied patch from Jan Ciger (bug #11309)
161
162
* Sat Sep  4 2004 Erwan Velu <erwan@mandrakesoft.com> 1.0-7mdk
163
- Oups, fixing stupid friday syntax
164
165
* Fri Sep  3 2004 Erwan Velu <erwan@mandrakesoft.com> 1.0-6mdk
166
- Probing the chipset drivers first
167
- 2.4 kernel support was missing
168
- Adding requires
169
170
* Fri Sep  3 2004 Juan Quintela <quintela@n5.mandrakesoft.com> 1.0-5mdk
171
- we need to ask for ich before P4, otherwise, P4 wins always.
172
173
* Sat Aug 28 2004 Michael Scherer <misc@mandrake.org> 1.0-4mdk 
174
- add a Requires on pci-utils ( fix #11049 )
175
- add Url
176
177
* Thu Aug 26 2004 Erwan Velu <erwan@mandrakesoft.com> 1.0-3mdk
178
- Fixing stupid parsing in /proc : ht & smp systems were buggy #10976
179
180
* Wed Aug 25 2004 Robert Vojta <robert.vojta@mandrake.org> 1.0-2mdk
181
- next ICH added (8086:244c) (#10940)
182
- probe_P4() function fixed (#10940)
183
- it's a simple script -> i586 moved to noarch
184
185
* Mon Aug 23 2004 Erwan Velu <erwan@mandrakesoft.com> 1.0-1mdk
186
- Initial release
187
# end of file
view file @ 2a4fe037b2
... ... --- /dev/null
... ... +++ b/cpufreq.sysconfig
... ... @@ -0,0 +1,12 @@
1
# set cpufreq governor if defined
2
# possible choices are: ondemand powersave userspace performance
3
GOVERNOR=ondemand
4
5
# minimum frequency
6
#MIN_FREQ=
7
8
# maximum frequency
9
#MAX_FREQ=
10
11
# Uncomment to use acpi-cpufreq as fallback 
12
#USE_ACPI_CPUFREQ=yes

Comments