All in one branch. snail.configure will create init.d scripts.
This commit is contained in:
parent
36ab1428d3
commit
2ffa70d92c
11
Makefile
11
Makefile
|
@ -15,12 +15,12 @@ install:
|
||||||
install -d ${DESTDIR}/${PREFIX}/lib64
|
install -d ${DESTDIR}/${PREFIX}/lib64
|
||||||
install lib64/*.so ${DESTDIR}/${PREFIX}/lib64
|
install lib64/*.so ${DESTDIR}/${PREFIX}/lib64
|
||||||
install -d ${DESTDIR}/${PREFIX}/lib64/snail
|
install -d ${DESTDIR}/${PREFIX}/lib64/snail
|
||||||
ln -sf /usr/lib64/opengl/nvidia/extensions ${DESTDIR}/${PREFIX}/lib64/snail
|
install -d ${DESTDIR}/${PREFIX}/share
|
||||||
|
install -d ${DESTDIR}/${PREFIX}/share/snail
|
||||||
|
install -d ${DESTDIR}/${PREFIX}/share/snail/init.d
|
||||||
|
install share/init.d/* ${DESTDIR}/${PREFIX}/share/snail/init.d
|
||||||
install -d ${DESTDIR}/${PREFIX}/lib64/snail/modules
|
install -d ${DESTDIR}/${PREFIX}/lib64/snail/modules
|
||||||
ln -sf /usr/lib64/xorg/modules/drivers ${DESTDIR}/${PREFIX}/lib64/snail/modules
|
install -d ${DESTDIR}/${PREFIX}/lib64/snail/extensions
|
||||||
ln -sf /usr/lib64/xorg/modules/extensions ${DESTDIR}/${PREFIX}/lib64/snail/modules
|
|
||||||
ln -sf /usr/lib64/xorg/modules/libfb.so ${DESTDIR}/${PREFIX}/lib64/snail/modules
|
|
||||||
ln -sf /usr/lib64/xorg/modules/libwfb.so ${DESTDIR}/${PREFIX}/lib64/snail/modules
|
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f ${DESTDIR}/etc/X11/xorg.conf.*.snail
|
rm -f ${DESTDIR}/etc/X11/xorg.conf.*.snail
|
||||||
|
@ -29,6 +29,7 @@ uninstall:
|
||||||
rm -f ${DESTDIR}/${PREFIX}/lib64/libgefaker.so
|
rm -f ${DESTDIR}/${PREFIX}/lib64/libgefaker.so
|
||||||
rm -f ${DESTDIR}/${PREFIX}/lib64/librrfaker.so
|
rm -f ${DESTDIR}/${PREFIX}/lib64/librrfaker.so
|
||||||
rm -rf ${DESTDIR}/${PREFIX}/lib64/snail
|
rm -rf ${DESTDIR}/${PREFIX}/lib64/snail
|
||||||
|
rm -rf ${DESTDIR}/${PREFIX}/share/snail
|
||||||
rm -f ${DESTDIR}/${PREFIX}/bin/nvrun
|
rm -f ${DESTDIR}/${PREFIX}/bin/nvrun
|
||||||
rm -f ${DESTDIR}/${PREFIX}/bin/snail.vglrun
|
rm -f ${DESTDIR}/${PREFIX}/bin/snail.vglrun
|
||||||
rm -f ${DESTDIR}/${PREFIX}/sbin/snail.nv_pwr_off
|
rm -f ${DESTDIR}/${PREFIX}/sbin/snail.nv_pwr_off
|
||||||
|
|
|
@ -11,9 +11,11 @@ depend() {
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
ebegin "Starting ${SVCNAME}"
|
ebegin "Starting ${SVCNAME}"
|
||||||
start-stop-daemon --make-pidfile \
|
start-stop-daemon \
|
||||||
--background \
|
|
||||||
--start \
|
--start \
|
||||||
|
--quiet \
|
||||||
|
--background \
|
||||||
|
--make-pidfile \
|
||||||
--pidfile $PIDFILE \
|
--pidfile $PIDFILE \
|
||||||
--exec $DAEMON \
|
--exec $DAEMON \
|
||||||
-- $DAEMON_ARGS
|
-- $DAEMON_ARGS
|
|
@ -0,0 +1,50 @@
|
||||||
|
#!/bin/sh
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
# Provides: snail-watcher
|
||||||
|
# Required-Start: $local_fs
|
||||||
|
# Required-Stop: $local_fs
|
||||||
|
# Should-Start:
|
||||||
|
# Should-Stop:
|
||||||
|
# Default-Start: 2 3 4 5
|
||||||
|
# Default-Stop: 0 1 6
|
||||||
|
# Short-Description: Snail watcher.
|
||||||
|
# Description: Starts the snail-watcher daemon
|
||||||
|
# /etc/default/snail-watcher.
|
||||||
|
### END INIT INFO
|
||||||
|
|
||||||
|
# Get lsb functions
|
||||||
|
. /lib/lsb/init-functions
|
||||||
|
|
||||||
|
PATH=$PATH:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
|
||||||
|
DAEMON="snail-watcher.sh"
|
||||||
|
DAEMON_ARGS=""
|
||||||
|
PIDFILE=/var/run/snail-watcher.pid
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
log_begin_msg "Starting snail-watcher"
|
||||||
|
pid=`cat $PIDFILE 2>/dev/null`
|
||||||
|
[ -z $pid ] || ! pgrep -s $pid -f snail-watcher.sh &>/dev/null && \
|
||||||
|
start-stop-daemon --make-pidfile \
|
||||||
|
--background \
|
||||||
|
--start \
|
||||||
|
--pidfile $PIDFILE \
|
||||||
|
--exec $DAEMON \
|
||||||
|
-- $DAEMON_ARGS \
|
||||||
|
|| log_msg "Already running..."
|
||||||
|
log_end_msg $?
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
log_begin_msg "Stopping snail-watcher"
|
||||||
|
start-stop-daemon --stop \
|
||||||
|
--pidfile $PIDFILE
|
||||||
|
log_end_msg $?
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
$0 stop
|
||||||
|
$0 start
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
log_success_msg "Usage: /etc/init.d/snail-watcher {start|stop|restart}"
|
||||||
|
exit 1
|
||||||
|
esac
|
|
@ -5,10 +5,6 @@ DAEMON=/usr/bin/X
|
||||||
DAEMON_ARGS="-ac -config /etc/X11/xorg.conf.nvidia -sharevts -modulepath /usr/lib/snail -nolisten tcp -noreset :1 vt9"
|
DAEMON_ARGS="-ac -config /etc/X11/xorg.conf.nvidia -sharevts -modulepath /usr/lib/snail -nolisten tcp -noreset :1 vt9"
|
||||||
PIDFILE=/var/run/snail-xserver.pid
|
PIDFILE=/var/run/snail-xserver.pid
|
||||||
|
|
||||||
depend() {
|
|
||||||
need xdm
|
|
||||||
}
|
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
ebegin "Starting Snail nVidia Optimus"
|
ebegin "Starting Snail nVidia Optimus"
|
||||||
snail.nv_pwr_on || eend -1
|
snail.nv_pwr_on || eend -1
|
|
@ -0,0 +1,61 @@
|
||||||
|
#!/bin/sh
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
# Provides: snail-xserver
|
||||||
|
# Required-Start: $snail-watcher
|
||||||
|
# Required-Stop:
|
||||||
|
# Should-Start:
|
||||||
|
# Should-Stop:
|
||||||
|
# Default-Start:
|
||||||
|
# Default-Stop: 0 1 6
|
||||||
|
# Short-Description: Snail xserver.
|
||||||
|
# Description: Starts the snail-xserver daemon
|
||||||
|
# /etc/default/snail-xserver.
|
||||||
|
### END INIT INFO
|
||||||
|
|
||||||
|
# Get lsb functions
|
||||||
|
. /lib/lsb/init-functions
|
||||||
|
|
||||||
|
PATH=$PATH:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
|
||||||
|
DAEMON=/usr/bin/X
|
||||||
|
DAEMON_ARGS="-ac -config /etc/X11/xorg.conf.nvidia -sharevts -modulepath /usr/lib/snail -nolisten tcp -noreset :1 vt9"
|
||||||
|
PIDFILE=/var/run/snail-xserver.pid
|
||||||
|
|
||||||
|
# Get lsb functions
|
||||||
|
. /lib/lsb/init-functions
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
log_begin_msg "Starting Snail nVidia Optimus"
|
||||||
|
snail.nv_pwr_on || log_end_msg 1
|
||||||
|
export LD_LIBRARY_PATH=/usr/lib/snail
|
||||||
|
export LD_PRELOAD=/usr/lib/snail/libGL.so
|
||||||
|
pid=`cat $PIDFILE 2>/dev/null`
|
||||||
|
rm -f $PIDFILE
|
||||||
|
[ -z $pid ] || ! pgrep -s $pid X &>/dev/null && \
|
||||||
|
echo "No Snail found running. Starting it..." && \
|
||||||
|
start-stop-daemon \
|
||||||
|
--start \
|
||||||
|
--quiet \
|
||||||
|
--background \
|
||||||
|
--make-pidfile \
|
||||||
|
--pidfile $PIDFILE \
|
||||||
|
--exec $DAEMON \
|
||||||
|
-- $DAEMON_ARGS
|
||||||
|
status=$?
|
||||||
|
[ ! -z $pid ] && pgrep -s $pid X &>/dev/null && echo "Already running..."
|
||||||
|
log_end_msg $?
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
log_begin_msg "Stopping Snail nVidia Optimus"
|
||||||
|
start-stop-daemon --stop --pidfile $PIDFILE
|
||||||
|
snail.nv_pwr_off
|
||||||
|
log_end_msg $?
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
$0 stop
|
||||||
|
$0 start
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
log_success_msg "Usage: /etc/init.d/snail-xserver {start|stop|restart}"
|
||||||
|
exit 1
|
||||||
|
esac
|
Loading…
Reference in New Issue