fixed README again and added openrc service
This commit is contained in:
parent
855a355041
commit
f6a794363f
4
Makefile
4
Makefile
|
@ -15,5 +15,9 @@ debug:
|
||||||
install:
|
install:
|
||||||
cp $(BINDIR)/$(BIN) /usr/bin/$(BIN)
|
cp $(BINDIR)/$(BIN) /usr/bin/$(BIN)
|
||||||
|
|
||||||
|
install-openrc:
|
||||||
|
cp init.d/$(BIN) /etc/init.d/$(BIN)
|
||||||
|
cp conf.d/$(BIN) /etc/conf.d/$(BIN)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) -r $(BINDIR)/*
|
$(RM) -r $(BINDIR)/*
|
||||||
|
|
12
README.md
12
README.md
|
@ -41,18 +41,18 @@ You must provide the temperature at which you wish to step down the maximum freq
|
||||||
|
|
||||||
Using OpenRC this would be done by adding the following in a `/etc/init.d/homemade_speedstep` file:
|
Using OpenRC this would be done by adding the following in a `/etc/init.d/homemade_speedstep` file:
|
||||||
```
|
```
|
||||||
#/sbin/openrc-run
|
#!/sbin/openrc-run
|
||||||
name="homemade_speedstep"
|
name="homemade_speedstep"
|
||||||
description="crude imitation of intel's speedstep"
|
description="crude imitation of intel's speedstep"
|
||||||
command="/usr/bin/homemade_speedstep"
|
command=/usr/bin/homemade_speedstep
|
||||||
command_args="${HSMAXTEMP} ${HSMINTEMP}"
|
command_args="${HSMAXTEMP} ${HSMINTEMP}"
|
||||||
command_background=true
|
command_background=true
|
||||||
|
pidfile="/run/${RC_SVCNAME}.pid"
|
||||||
|
|
||||||
checkconfig() {
|
checkconfig() {
|
||||||
if [ ${HSMAXTEMP} -lt 100000 ] && [ ${HSMINTEMP} -lt ${HSMAXTEMP} ]
|
if [ ${HSMAXTEMP} -lt 100000 ] && [ ${HSMINTEMP} -lt ${HSMAXTEMP} ] ; then
|
||||||
then return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
return 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start_pre() {
|
start_pre() {
|
||||||
|
@ -77,4 +77,4 @@ HSMAXTEMP=82000
|
||||||
# Lower temperature threshold
|
# Lower temperature threshold
|
||||||
HSMINTEMP=70000
|
HSMINTEMP=70000
|
||||||
```
|
```
|
||||||
and finally running `rc-update add homemade_speedstep default`
|
and finally running `rc-update add homemade_speedstep default`
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
# /etc/conf.d/homemade_speedstep: config gile for /etc/init.d/homemade_speedstep
|
||||||
|
|
||||||
|
# Change these to your liking
|
||||||
|
# Upper temperature threshold
|
||||||
|
HSMAXTEMP=82000
|
||||||
|
# Lower temperature threshold
|
||||||
|
HSMINTEMP=70000
|
|
@ -0,0 +1,26 @@
|
||||||
|
#!/sbin/openrc-run
|
||||||
|
name="homemade_speedstep"
|
||||||
|
description="crude imitation of intel's speedstep"
|
||||||
|
command=/usr/bin/homemade_speedstep
|
||||||
|
command_args="${HSMAXTEMP} ${HSMINTEMP}"
|
||||||
|
command_background=true
|
||||||
|
pidfile="/run/${RC_SVCNAME}.pid"
|
||||||
|
|
||||||
|
checkconfig() {
|
||||||
|
if [ ${HSMAXTEMP} -lt 100000 ] && [ ${HSMINTEMP} -lt ${HSMAXTEMP} ] ; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
start_pre() {
|
||||||
|
# Prevent of double check
|
||||||
|
if [ "${RC_CMD}" != "restart" ] ; then
|
||||||
|
checkconfig || return $?
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
stop_pre() {
|
||||||
|
if [ "${RC_CMD}" = "restart" ] ; then
|
||||||
|
checkconfig || return $?
|
||||||
|
fi
|
||||||
|
}
|
Loading…
Reference in New Issue