Fedora 16 x86_64 (64bit) support is done
This commit is contained in:
parent
18fd2cd102
commit
c2c54aabd4
@ -8,14 +8,13 @@ let INTEL_IF_FAIL=1 # run on Intel if nVidia fails
|
|||||||
LOCK_FILE=/tmp/.snail.lock
|
LOCK_FILE=/tmp/.snail.lock
|
||||||
FIFO_FILE=/tmp/.snail.fifo
|
FIFO_FILE=/tmp/.snail.fifo
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
echo -n > $FIFO_FILE &
|
echo -n > $FIFO_FILE &
|
||||||
flock -w $TIMEOUT -s 9
|
flock -w $TIMEOUT -s 9
|
||||||
|
|
||||||
if [ 0 -eq $? ]; then
|
if [ 0 -eq $? ]; then
|
||||||
echo "Running $@ on nVidia"
|
echo "Running $@ on nVidia"
|
||||||
export LD_LIBRARY_PATH=/usr/lib/snail:/usr/lib/snail/lib
|
export LD_LIBRARY_PATH=/usr/lib/snail
|
||||||
snail.vglrun -d :1 "$@"
|
snail.vglrun -d :1 "$@"
|
||||||
echo "Application $@ was performed on nVidia"
|
echo "Application $@ was performed on nVidia"
|
||||||
|
|
||||||
|
@ -2,12 +2,23 @@
|
|||||||
|
|
||||||
PATH=/usr/local/sbin:/usr/local/bin:$PATH
|
PATH=/usr/local/sbin:/usr/local/bin:$PATH
|
||||||
|
|
||||||
SERVICE=/etc/init.d/snail-xserver
|
XSERVER_START_CMD=
|
||||||
|
XSERVER_STOP_CMD=
|
||||||
|
if [ -f /etc/init.d/snail-xserver ]; then
|
||||||
|
XSERVER_START_CMD="/etc/init.d/snail-xserver start"
|
||||||
|
XSERVER_STOP_CMD="/etc/init.d/snail-xserver stop"
|
||||||
|
elif [ -f /etc/systemd/system/snail-xserver.service ]; then
|
||||||
|
XSERVER_START_CMD="systemctl start snail-xserver.service"
|
||||||
|
XSERVER_STOP_CMD="systemctl stop snail-xserver.service"
|
||||||
|
else
|
||||||
|
echo "Error: snail-xservice not found ;-("
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
LOCK_FILE=/tmp/.snail.lock
|
LOCK_FILE=/tmp/.snail.lock
|
||||||
FIFO_FILE=/tmp/.snail.fifo
|
FIFO_FILE=/tmp/.snail.fifo
|
||||||
|
|
||||||
$SERVICE stop && snail.nv_pwr_off # stop X service
|
$XSERVER_STOP_CMD && snail.nv_pwr_off # stop X service
|
||||||
|
|
||||||
touch $LOCK_FILE && chown root:video $LOCK_FILE && chmod 660 $LOCK_FILE # create lock file
|
touch $LOCK_FILE && chown root:video $LOCK_FILE && chmod 660 $LOCK_FILE # create lock file
|
||||||
rm -f $FIFO_FILE && mkfifo --mode 660 $FIFO_FILE && chgrp video $FIFO_FILE # create fifo
|
rm -f $FIFO_FILE && mkfifo --mode 660 $FIFO_FILE && chgrp video $FIFO_FILE # create fifo
|
||||||
@ -18,10 +29,10 @@ rm -f $FIFO_FILE && mkfifo --mode 660 $FIFO_FILE && chgrp video $FIFO_FILE # cre
|
|||||||
|
|
||||||
while [ 1 ]; do
|
while [ 1 ]; do
|
||||||
read <$FIFO_FILE
|
read <$FIFO_FILE
|
||||||
snail.nv_pwr_on && $SERVICE start # starting X server
|
snail.nv_pwr_on && $XSERVER_START_CMD # starting X server
|
||||||
flock -u 9
|
flock -u 9
|
||||||
flock 9
|
flock 9
|
||||||
echo >$FIFO_FILE | cat $FIFO_FILE >/dev/null # flush fifo
|
echo >$FIFO_FILE | cat $FIFO_FILE >/dev/null # flush fifo
|
||||||
$SERVICE stop && snail.nv_pwr_off # stopping X server
|
$XSERVER_STOP_CMD && snail.nv_pwr_off # stopping X server
|
||||||
done
|
done
|
||||||
} 9>$LOCK_FILE
|
} 9>$LOCK_FILE
|
||||||
|
@ -3,6 +3,6 @@ Description=Daemon to auto start/stop power up/down nVidia graphics.
|
|||||||
After=syslog.target
|
After=syslog.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/bin/bash -c '(/usr/sbin/snail.nv_pwr_on && nohup /usr/bin/X -ac -config /etc/X11/xorg.conf.nvidia -sharevts -modulepath /usr/lib/snail -nolisten tcp -noreset :1 vt9 &>/dev/null)&'
|
ExecStart=/bin/bash -c '(nohup /usr/bin/X -ac -config /etc/X11/xorg.conf.nvidia -sharevts -modulepath /usr/lib/snail -nolisten tcp -noreset :1 vt9 &>/dev/null)&'
|
||||||
ExecStop=/usr/sbin/snail.nv_pwr_off
|
ExecStop=/usr/sbin/snail.nv_pwr_off
|
||||||
Type=forking
|
Type=forking
|
||||||
|
Loading…
x
Reference in New Issue
Block a user