Project

General

Profile

Packaging Request #1603

[tlp-openrc] Add package to PCR

ToffeeYogurtPots - over 6 years ago - . Updated about 6 years ago.

Status:
open
Priority:
feature
Assignee:
% Done:

0%


Description

This has always confused me, why is there no tlp init script for OpenRC? It's included in Gentoo and Atrix and should be pretty easy to add. Hyperbola devs probably need this too.

Steps to create:

  1. cd into /etc/init.d/
  2. Create a blank file called "tlp" (e.g. "nano tlp").
  3. Paste the following script:
    #!/usr/bin/openrc-run
    # Copyright 1999-2015 Gentoo Foundation
    # Distributed under the terms of the GNU General Public License v2
    # $Header: $
    
    description="TLP start/stop actions" 
    
    depend() {
        after modules
    
        # sysfs is required (bat thresholds); localmount:/usr
        need sysfs localmount
    
        # thinkpad-radiosw (USE=deprecated)
        use acpid
    
        after NetworkManager dbus bluetooth
    
        # run after xdm to avoid bluetooth/wwan/... race-condition with gdm
        after xdm
    }
    
    start()   { /usr/bin/tlp init start; }
    stop()    { /usr/bin/tlp init stop; }
    restart() { /usr/bin/tlp init restart; }
    
  4. Correct the permissions of the new init script with "chmod 755 tlp"
  5. Run this sed command "sed -i -e 's/\r//g' /etc/init.d/tlp" (for some reason OpenRC gives me a permissions error if I don't do this ¯\_(ツ)_/¯).
  6. Now test with "rc-service tlp restart".

History

#1

Updated by Megver83 about 6 years ago

  • Assignee set to Megver83

I'll look at this later, this week maybe

Also available in: Atom PDF