Permalink
Browse files

Renamed example files..

Added tests to configuration..

Configuration rewrite...
  • Loading branch information...
1 parent 43b0e36 commit ac035d9e12a574dd3a547f48f0f31a85e3698e75 @MrMEEE committed Aug 20, 2011
Showing with 174 additions and 62 deletions.
  1. +10 −3 conf/ironhide.script
  2. 0 examples/{bumblebee-disablecard.alienware.M11XR2 → ironhide-disablecard.alienware.M11XR2}
  3. 0 examples/{bumblebee-disablecard.asus.1015PN → ironhide-disablecard.asus.1015PN}
  4. 0 examples/{bumblebee-disablecard.asus.1215N → ironhide-disablecard.asus.1215N}
  5. 0 ...disablecard.asus.K42Jc.K52Jc.N53Jf.N53Jg.N71Jv.N73Jf.P52Jc.PL80Jt.U30Jc.U33Jc.U35Jc.U36Jc.UL80Jt}
  6. 0 examples/{bumblebee-disablecard.asus.N53Sn.U41Sv → ironhide-disablecard.asus.N53Sn.U41Sv}
  7. 0 examples/{bumblebee-disablecard.asus.N53Sv → ironhide-disablecard.asus.N53Sv}
  8. 0 examples/{bumblebee-disablecard.asus.N61Jv.N73Sv → ironhide-disablecard.asus.N61Jv.N73Sv}
  9. 0 examples/{bumblebee-disablecard.asus.P31Jg → ironhide-disablecard.asus.P31Jg}
  10. 0 examples/{bumblebee-disablecard.asus.U43Jc → ironhide-disablecard.asus.U43Jc}
  11. 0 examples/{bumblebee-disablecard.asus.UL30Vt → ironhide-disablecard.asus.UL30Vt}
  12. 0 examples/{bumblebee-disablecard.dell.E6420 → ironhide-disablecard.dell.E6420}
  13. 0 ...lebee-disablecard.dell.InspironN5110.XPSL702X → ironhide-disablecard.dell.InspironN5110.XPSL702X}
  14. 0 ...mblebee-disablecard.dell.Vostro3300.Vostro3500 → ironhide-disablecard.dell.Vostro3300.Vostro3500}
  15. 0 examples/{bumblebee-disablecard.dell.XPS15 → ironhide-disablecard.dell.XPS15}
  16. 0 examples/{bumblebee-disablecard.lenovo.ThinkPadT410 → ironhide-disablecard.lenovo.ThinkPadT410}
  17. 0 examples/{bumblebee-disablecard.lenovo.ThinkPadT420 → ironhide-disablecard.lenovo.ThinkPadT420}
  18. 0 examples/{bumblebee-disablecard.template → ironhide-disablecard.template}
  19. 0 examples/{bumblebee-enablecard.alienware.M11XR2 → ironhide-enablecard.alienware.M11XR2}
  20. 0 examples/{bumblebee-enablecard.asus.1015PN → ironhide-enablecard.asus.1015PN}
  21. 0 examples/{bumblebee-enablecard.asus.1215N → ironhide-enablecard.asus.1215N}
  22. 0 ...-enablecard.asus.K42Jc.K52Jc.N53Jf.N53Jg.N71Jv.N73Jf.P52Jc.PL80Jt.U30Jc.U33Jc.U35Jc.U36Jc.UL80Jt}
  23. 0 examples/{bumblebee-enablecard.asus.N53Sn.U41Sv → ironhide-enablecard.asus.N53Sn.U41Sv}
  24. 0 examples/{bumblebee-enablecard.asus.N53Sv → ironhide-enablecard.asus.N53Sv}
  25. 0 examples/{bumblebee-enablecard.asus.N61Jv.N73Sv → ironhide-enablecard.asus.N61Jv.N73Sv}
  26. 0 examples/{bumblebee-enablecard.asus.P31Jg → ironhide-enablecard.asus.P31Jg}
  27. 0 examples/{bumblebee-enablecard.asus.U43Jc → ironhide-enablecard.asus.U43Jc}
  28. 0 examples/{bumblebee-enablecard.asus.UL30Vt → ironhide-enablecard.asus.UL30Vt}
  29. 0 examples/{bumblebee-enablecard.dell.E6420 → ironhide-enablecard.dell.E6420}
  30. 0 ...mblebee-enablecard.dell.InspironN5110.XPSL702X → ironhide-enablecard.dell.InspironN5110.XPSL702X}
  31. 0 ...bumblebee-enablecard.dell.Vostro3300.Vostro3500 → ironhide-enablecard.dell.Vostro3300.Vostro3500}
  32. 0 examples/{bumblebee-enablecard.dell.XPS15 → ironhide-enablecard.dell.XPS15}
  33. 0 examples/{bumblebee-enablecard.lenovo.ThinkPadT410 → ironhide-enablecard.lenovo.ThinkPadT410}
  34. 0 examples/{bumblebee-enablecard.lenovo.ThinkPadT420 → ironhide-enablecard.lenovo.ThinkPadT420}
  35. 0 examples/{bumblebee-enablecard.template → ironhide-enablecard.template}
  36. +158 −58 files/ironhide-configuration
  37. +6 −1 files/test
View
@@ -97,8 +97,11 @@ do_start()
log_daemon_msg "Unsafe pidfile '$PIDFILE' - cannot check the availability of display $VGL_DISPLAY"
return 2
fi
-
- $ENABLECARD
+ if [ -f $ENABLECARD ]; then
+ $ENABLECARD
+ else
+ echo "Ironhide hasn't been configured for power management, please run ironhide-configuration."
+ fi
# XXX: should there be a check if the card has become ready?
# 1: the X server
@@ -152,7 +155,11 @@ do_stop()
fi
# RETVAL 2 = still running
[ $RETVAL = 2 ] && return 2
- $DISABLECARD
+ if [ -f $DISABLECARD ]; then
+ $DISABLECARD
+ else
+ echo "Ironhide hasn't been configured for power management, please run ironhide-configuration."
+ fi
return $RETVAL
}
@@ -44,6 +44,7 @@ LSPCI=`which lspci`
MODPROBE=`which modprobe`
WHOAMI=`which whoami`
WGET=`which wget`
+GLXGEARS=`which glxgears`
# INCLUDES
source easybashgui
@@ -138,10 +139,12 @@ sudo ldconfig
x="progress -w 600"
-if [[ ! -p $PIPE ]]; then
- mkfifo $PIPE
+if [[ -p $PIPE ]]; then
+ rm $PIPE
fi
+mkfifo $PIPE
+
tail -f $PIPE | ${x} "Setting up and Downloading Configuration... Please wait" &
echo 0 >> $PIPE
@@ -156,11 +159,13 @@ fi
echo 33 >> $PIPE
i=1
unset profiles
-while read line
-do
- profiles[$i]="$i: `echo $line | cut -f1 -d\|``echo $line |cut -f2 -d\|` by`echo $line | cut -f5 -d\|`, Confirmed by`echo $line |cut -f6 -d\|` users."
- ((i+=1))
-done < /usr/share/ironhide/data/machineinfo
+if [ -f $DATAFOLDER/machineinfo ]; then
+ while read line
+ do
+ profiles[$i]="$i: `echo $line | cut -f1 -d\|``echo $line |cut -f2 -d\|` by`echo $line | cut -f5 -d\|`, Confirmed by`echo $line |cut -f6 -d\|` users."
+ ((i+=1))
+ done < /usr/share/ironhide/data/machineinfo
+fi
profiles[i]="9997: Enter Manual Configuration"
((i+=1))
@@ -310,6 +315,7 @@ else
${x} "The BusID of the nVidia card can't be determined.\n"\
"You must correct this manually in /etc/X11/xorg.conf.nvidia\n"\
"Please report this problem..\n"
+ exit 1
fi
sudo sed -i "s/\([ \t]*BusID[ \t]*\)\".*\"/\1\"$NVIDIABUSID\"/g" /etc/X11/xorg.conf.nvidia
@@ -341,7 +347,6 @@ if [ `$LSPCI -v -s $NVIDIABUSIDCUT |grep ! |wc -l` = 0 ]; then
fi
fi
-echo "test"
if [ "$CONNECTEDMONITOR" != "CRT-0" ] && [ "$CONNECTEDMONITOR" != "DFP-0" ];then
x="message --width $WIDTH --height $HEIGHT"
${x} "The device for the nVidia monitor could not be detected, please\n"\
@@ -363,7 +368,6 @@ if [ "$CONNECTEDMONITOR" != "CRT-0" ] && [ "$CONNECTEDMONITOR" != "DFP-0" ];then
;;
esac
fi
-echo "test1"
sed -i "s/\([ \t]*Option[ \t]*\"ConnectedMonitor\"[ \t]*\)".*"/\1\"$CONNECTEDMONITOR\"/g" /etc/X11/xorg.conf.nvidia
@@ -379,55 +383,6 @@ if [ `$LSPCI -v -s $NVIDIABUSIDCUT |grep ! |wc -l` = 1 ]; then
fi
fi
-if [ ! "$POWERON" == "UNAVAILABLE" ] ; then
- echo $POWERON | xxd -r -p > /usr/local/bin/ironhide-enablecard
- echo $POWEROFF | xxd -r -p > /usr/local/bin/ironhide-disablecard
-else
- x="message --width $WIDTH --height $HEIGHT"
- ${x} "No power-on/off configuration has been reported for your machine,\n"\
- "please manually enter configuration in:\n\n"\
- "/usr/local/bin/ironhide-enablecard and /usr/local/bin/ironhide-disablecard\n\n"\
- "Some examples are available in /usr/share/doc/ironhide/."
-
- if [ ! -f /usr/local/bin/ironhide-enablecard ] ; then
- # Not installed
- cp /usr/share/doc/ironhide/examples/ironhide-enablecard.template /usr/local/bin/ironhide-enablecard
- else
- # Already Exists
- x="message --width $WIDTH --height $HEIGHT"
- ${x} "nVidia card enable-script: /usr/local/bin/ironhide-enablecard exists.\n"\
- "Moving old script to /usr/local/bin/ironhide-enablecard.old."
- mv /usr/local/bin/ironhide-enablecard /usr/local/bin/ironhide-enablecard.old
- cp /usr/share/doc/ironhide/examples/ironhide-enablecard.template /usr/local/bin/ironhide-enablecard
- chmod +x /usr/local/bin/ironhide-enablecard
- fi
- if [ ! -f /usr/local/bin/ironhide-disablecard ]; then
- # Not installed
- cp /usr/share/doc/ironhide/examples/ironhide-disablecard.template /usr/local/bin/ironhide-disablecard
- else
- # Already Exists
- x="message --width $WIDTH --height $HEIGHT"
- ${x} "nVidia card enable-script: /usr/local/bin/ironhide-disablecard exists.\n"\
- "Moving old script to /usr/local/bin/ironhide-disablecard.old."
- mv /usr/local/bin/ironhide-disablecard /usr/local/bin/ironhide-disablecard.old
- cp /usr/share/doc/ironhide/examples/ironhide-disablecard.template /usr/local/bin/ironhide-disablecard
- chmod +x /usr/local/bin/ironhide-disablecard
- fi
-fi
-
-chmod +x /usr/local/bin/ironhide*
-
-if [ `$LSPCI -v -s $NVIDIABUSIDCUT |grep ! |wc -l` = 0 ]; then
- if [ -f /usr/local/bin/ironhide-disablecard ]; then
- /usr/local/bin/ironhide-disablecard
- fi
- if [ -f /usr/bin/ironhide-disablecard ]; then
- /usr/bin/ironhide-disablecard
- fi
-fi
-
-update-rc.d ironhide defaults
-
x="message --width $WIDTH --height $HEIGHT"
${x} "The Image Transport is how the images are transferred from the\n"\
"nVidia card to the Intel card, people has different experiences of\n"\
@@ -462,6 +417,151 @@ esac
sed -i 's/VGL_COMPRESS.*/VGL_COMPRESS='$IMAGETRANSPORT'/' $CONFIGURATIONFILE
+if [ -f /usr/local/bin/ironhide-enablecard ] ; then
+ mv /usr/local/bin/ironhide-enablecard /usr/local/bin/ironhide-enablecard.old
+ x="message --width $WIDTH --height $HEIGHT"
+ ${x} "nVidia card enable-script: /usr/local/bin/ironhide-enablecard exists.\n"\
+ "Moved old script to /usr/local/bin/ironhide-enablecard.old."
+fi
+if [ -f /usr/local/bin/ironhide-disablecard ]; then
+ mv /usr/local/bin/ironhide-disablecard /usr/local/bin/ironhide-disablecard.old
+ x="message --width $WIDTH --height $HEIGHT"
+ ${x} "nVidia card enable-script: /usr/local/bin/ironhide-disablecard exists.\n"\
+ "Moving old script to /usr/local/bin/ironhide-disablecard.old."
+fi
+
+# Test basic functionality
+
+/etc/init.d/ironhide enable
+
+ERRORS=`cat /var/log/Xorg.\`echo $VGL_DISPLAY |cut -f2 -d:\`.log |grep EE |grep -v kbd |grep -v MIT-SCREEN-SAVER |grep -v "not implemented" | wc -l`
+
+/etc/init.d/ironhide disable
+
+if [[ $ERRORS == 0 ]]; then
+ x="message --width $WIDTH --height $HEIGHT"
+ ${x} "Initial Testing seems ok..\n\n"\
+ "We're now going to test the basic functionality of Ironhide.\n"\
+ "After pressing OK, some gears should start rotating on your screen.\n"\
+ "They will run for five seconds, and will then prompt for the result."
+
+ if [ -f $GLXGEARS ]; then
+ optirun $GLXGEARS &
+ x=wait_seconds
+ ${x} 5
+ killall glxgears
+ x="question --width $WIDTH --height $HEIGHT"
+ ${x} "Did some running gears show up??..\n\n"\
+ "If not, please do NOT continue and try another profile, or report this problem...:\n\n"\
+ "https://github.com/MrMEEE/ironhide/issues"
+
+ answer="${?}"
+ if [ ${answer} -eq 1 ]; then
+ exit 1
+ fi
+
+
+ else
+ x="question --width $WIDTH --height $HEIGHT"
+ ${x} "We could't find glxgears on the system. Please install the mesa-utils package..\n\n"\
+ "Do you want to continue without completing the simple tests?? (not recommended)."
+
+ answer="${?}"
+ if [ ${answer} -eq 1 ]; then
+ exit 1
+ fi
+ fi
+else
+ # Add some more Error handling
+ x="message --width $WIDTH --height $HEIGHT"
+ ${x} "Initial tests failed..\n\n"\
+ "Please do report this problem..:\n"\
+ "https://github.com/MrMEEE/ironhide/issues"
+fi
+
+
+if [[ $POWERSTATUS != "UNAVAILABLE" ]] ; then
+ echo $POWERON | xxd -r -p > /usr/local/bin/ironhide-enablecard
+ echo $POWEROFF | xxd -r -p > /usr/local/bin/ironhide-disablecard
+else
+ x="message --width $WIDTH --height $HEIGHT"
+ ${x} "No power-on/off configuration has been reported for your machine,\n"\
+ "please manually enter configuration in:\n\n"\
+ "/usr/local/bin/ironhide-enablecard and /usr/local/bin/ironhide-disablecard\n\n"\
+ "Some examples are available in /usr/share/doc/ironhide/."
+
+ cp /usr/share/doc/ironhide/examples/ironhide-enablecard.template /usr/local/bin/ironhide-enablecard
+ cp /usr/share/doc/ironhide/examples/ironhide-disablecard.template /usr/local/bin/ironhide-disablecard
+
+fi
+
+chmod +x /usr/local/bin/ironhide*
+
+if [ `$LSPCI -v -s $NVIDIABUSIDCUT |grep ! |wc -l` = 0 ]; then
+ if [ -f /usr/local/bin/ironhide-disablecard ]; then
+ /usr/local/bin/ironhide-disablecard
+ fi
+ if [ -f /usr/bin/ironhide-disablecard ]; then
+ /usr/bin/ironhide-disablecard
+ fi
+fi
+
+/etc/init.d/ironhide enable
+
+ERRORS=`cat /var/log/Xorg.\`echo $VGL_DISPLAY |cut -f2 -d:\`.log |grep EE |grep -v kbd |grep -v MIT-SCREEN-SAVER |grep -v "not implemented" | wc -l`
+
+/etc/init.d/ironhide disable
+
+if [[ $ERRORS == 0 ]];then
+ if [[ $POWERSTATUS != "UNAVAILABLE" ]]; then
+ x="message --width $WIDTH --height $HEIGHT"
+ ${x} "Quick Testing of Ironhide with power management seems ok..\n\n"\
+ "After pressing OK, gears should again start rotating on your screen.\n"\
+ "They will run for five seconds, and will then prompt for the result."
+
+ if [ -f $GLXGEARS ]; then
+ optirun $GLXGEARS &
+ x=wait_seconds
+ ${x} 5
+ killall glxgears
+ x="question --width $WIDTH --height $HEIGHT"
+ ${x} "Did some running gears show up??..\n\n"\
+ "If not, please do NOT continue and try another profile, or report this problem...:\n\n"\
+ "https://github.com/MrMEEE/ironhide/issues"
+
+ answer="${?}"
+ if [ ${answer} -eq 1 ]; then
+ exit 1
+ fi
+
+
+ else
+ x="question --width $WIDTH --height $HEIGHT"
+ ${x} "We could't find glxgears on the system. Please install the mesa-utils package..\n\n"\
+ "Do you want to continue without completing the power configuration tests?? (not recommended)."
+
+ answer="${?}"
+ if [ ${answer} -eq 1 ]; then
+ /usr/local/bin/ironhide-enablecard
+ cp /usr/share/doc/ironhide/examples/ironhide-enablecard.template /usr/local/bin/ironhide-enablecard
+ cp /usr/share/doc/ironhide/examples/ironhide-disablecard.template /usr/local/bin/ironhide-disablecard
+ #"We have replaced the"
+ exit 1
+ fi
+ fi
+ fi
+else
+ # Add some more Error handling
+ x="message --width $WIDTH --height $HEIGHT"
+ ${x} "Power configuration tests failed..\n\n"\
+ "Please do report this problem..:\n"\
+ "https://github.com/MrMEEE/ironhide/issues"
+fi
+
+
+update-rc.d ironhide defaults
+
+
#
# Set userrights
#
View
@@ -3,4 +3,9 @@ HEIGHT=500
WIDTH=700
source easybashgui
-echo $HOME
+ERRORS=0
+POWERON="UNAVAILABLE"
+
+if [[ $ERRORS == 0 ]] && [[ ! $POWERON == "UNAVAILABLE" ]]; then
+ echo "Test"
+fi

0 comments on commit ac035d9

Please sign in to comment.