optimus add repository

This commit is contained in:
burakerturk
2016-04-10 19:45:21 +03:00
parent 4d67565be8
commit 18ef7661e2
12 changed files with 79348 additions and 79071 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
from grp import getgrnam
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
if not os.path.isdir("/run/bumblebee"): os.makedirs("/run/bumblebee", int("0775", 8))
try:
os.chown("/run/bumblebee", -1, getgrnam("bumblebee").gr_gid)
except KeyError:
os.system("groupadd -r bumblebee")
os.chown("/run/bumblebee", -1, getgrnam("bumblebee").gr_gid)
for u in getgrnam("users").gr_mem:
os.system("gpasswd -a %s bumblebee" % u)
+36
View File
@@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
from comar.service import *
import os
serviceType = "local"
serviceDesc = _({"en": "FIXME",
"tr": "FIXME"})
serviceDefault = "on"
PIDFILE = "/run/bumblebeed.pid"
DAEMON = "/usr/sbin/bumblebeed"
@synchronized
def start():
os.system("modprobe bbswitch load_state=0 unload_state=1")
startService(command=DAEMON,
args="--daemon",
detach=True)
os.system("pidof -o %PPID " + "%s > %s" % (DAEMON, PIDFILE))
@synchronized
def stop():
stopService(pidfile=PIDFILE,
donotify=True)
try:
os.unlink(PIDFILE)
except:
pass
def status():
return isServiceRunning(pidfile=PIDFILE)