author | kergoth <kergoth> | 2002-09-05 17:13:00 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-09-05 17:13:00 (UTC) |
commit | deaef1d44dfc99be6301bfb20e5b35346c005641 (patch) (unidiff) | |
tree | 1b3323dc1a72539d9ca299801f736aa03da6cae5 /root | |
parent | 5234cdf47b57d31665a0a8746178879f6912c83d (diff) | |
download | opie-deaef1d44dfc99be6301bfb20e5b35346c005641.zip opie-deaef1d44dfc99be6301bfb20e5b35346c005641.tar.gz opie-deaef1d44dfc99be6301bfb20e5b35346c005641.tar.bz2 |
Sane fallback for rotation if /proc/hal/model doesnt exist (i.e. zaurus).
-rwxr-xr-x | root/etc/init.d/opie | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/root/etc/init.d/opie b/root/etc/init.d/opie index 01704f2..ada0431 100755 --- a/root/etc/init.d/opie +++ b/root/etc/init.d/opie | |||
@@ -1,86 +1,87 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # | 2 | # |
3 | 3 | ||
4 | export LOGNAME=root | 4 | export LOGNAME=root |
5 | export HOME=/$LOGNAME | 5 | export HOME=/$LOGNAME |
6 | #export QWS_DISPLAY=Transformed:Rot270:0 | ||
7 | export QTDIR=/opt/QtPalmtop | 6 | export QTDIR=/opt/QtPalmtop |
8 | export OPIEDIR=/opt/QtPalmtop | 7 | export OPIEDIR=/opt/QtPalmtop |
9 | export QPEDIR=/opt/QtPalmtop | 8 | export QPEDIR=/opt/QtPalmtop |
10 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OPIEDIR/lib | 9 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OPIEDIR/lib |
11 | export PATH=$PATH:$OPIEDIR/bin | 10 | export PATH=$PATH:$OPIEDIR/bin |
12 | 11 | ||
13 | #this sets the iPaqs powerbutton to mapable | 12 | #this sets the iPaqs powerbutton to mapable |
14 | if [ -e /proc/sys/ts/suspend_button_mode ] ; then | 13 | if [ -e /proc/sys/ts/suspend_button_mode ] ; then |
15 | echo 1 > /proc/sys/ts/suspend_button_mode | 14 | echo 1 > /proc/sys/ts/suspend_button_mode |
16 | fi | 15 | fi |
17 | 16 | ||
18 | if [ ! -x $OPIEDIR/bin/qpe ] ; then | 17 | if [ ! -x $OPIEDIR/bin/qpe ] ; then |
19 | echo Opie not installed | 18 | echo Opie not installed |
20 | exit 0 | 19 | exit 0 |
21 | fi | 20 | fi |
22 | 21 | ||
23 | $OPIEDIR/bin/opie-reorgfiles | 22 | $OPIEDIR/bin/opie-reorgfiles |
24 | 23 | ||
25 | . /etc/profile | 24 | . /etc/profile |
26 | 25 | ||
27 | killproc() { | 26 | killproc() { |
28 | pid=`/bin/ps -e | /bin/sed -n -e '/\<'$1'\>/ s/^ *\([0-9][0-9]*\).*/\1/p'` | 27 | pid=`/bin/ps -e | /bin/sed -n -e '/\<'$1'\>/ s/^ *\([0-9][0-9]*\).*/\1/p'` |
29 | [ "$pid" != "" ] && kill $pid | 28 | [ "$pid" != "" ] && kill $pid |
30 | } | 29 | } |
31 | 30 | ||
32 | case $1 in | 31 | case $1 in |
33 | 'start') | 32 | 'start') |
34 | 33 | ||
35 | cd $HOME | 34 | cd $HOME |
36 | rm -f /etc/rc2.d/S99x # Can't have both running! | 35 | rm -f /etc/rc2.d/S99x # Can't have both running! |
37 | 36 | ||
38 | if [ -e /proc/hal/model ] ; then | 37 | if [ -e /proc/hal/model ] ; then |
39 | 38 | ||
40 | IPAQ=`cat /proc/hal/model` | 39 | IPAQ=`cat /proc/hal/model` |
41 | 40 | ||
42 | echo iPAQ type $IPAQ | 41 | echo iPAQ type $IPAQ |
43 | case $IPAQ in | 42 | case $IPAQ in |
44 | "3100" ) export QWS_DISPLAY=Transformed:Rot90:0 ;; | 43 | "3100" ) export QWS_DISPLAY=Transformed:Rot90:0 ;; |
45 | "3600" ) export QWS_DISPLAY=Transformed:Rot270:0 ;; | 44 | "3600" ) export QWS_DISPLAY=Transformed:Rot270:0 ;; |
46 | "3700" ) export QWS_DISPLAY=Transformed:Rot270:0 ;; | 45 | "3700" ) export QWS_DISPLAY=Transformed:Rot270:0 ;; |
47 | "3800" ) export QWS_DISPLAY=Transformed:Rot90:0 ;; | 46 | "3800" ) export QWS_DISPLAY=Transformed:Rot90:0 ;; |
48 | *) echo "Unknown processor type -`module_id`-!" ;; | 47 | *) echo "Unknown processor type -`module_id`-!" ;; |
49 | esac | 48 | esac |
49 | else | ||
50 | export QWS_DISPLAY=Transformed:Rot270:0 | ||
50 | fi | 51 | fi |
51 | 52 | ||
52 | 53 | ||
53 | if [ -x $OPIEDIR/bin/opie-login ]; then | 54 | if [ -x $OPIEDIR/bin/opie-login ]; then |
54 | if ! killall -0 syslogd 2>/dev/null >/dev/null; then | 55 | if ! killall -0 syslogd 2>/dev/null >/dev/null; then |
55 | echo Starting Opie-login.... | 56 | echo Starting Opie-login.... |
56 | $OPIEDIR/bin/opie-login 2>/dev/null >/dev/null & | 57 | $OPIEDIR/bin/opie-login 2>/dev/null >/dev/null & |
57 | else | 58 | else |
58 | echo Starting Opie-login with syslog logging..... | 59 | echo Starting Opie-login with syslog logging..... |
59 | ($OPIEDIR/bin/opie-login 2>&1 | logger ) & | 60 | ($OPIEDIR/bin/opie-login 2>&1 | logger ) & |
60 | fi | 61 | fi |
61 | else | 62 | else |
62 | if ! killall -0 syslogd 2>/dev/null >/dev/null; then | 63 | if ! killall -0 syslogd 2>/dev/null >/dev/null; then |
63 | echo Starting Opie.... | 64 | echo Starting Opie.... |
64 | $OPIEDIR/bin/qpe 2>/dev/null >/dev/null & | 65 | $OPIEDIR/bin/qpe 2>/dev/null >/dev/null & |
65 | else | 66 | else |
66 | echo Starting Opie with syslog logging..... | 67 | echo Starting Opie with syslog logging..... |
67 | ($OPIEDIR/bin/qpe 2>&1 | logger ) & | 68 | ($OPIEDIR/bin/qpe 2>&1 | logger ) & |
68 | fi | 69 | fi |
69 | fi | 70 | fi |
70 | 71 | ||
71 | ;; | 72 | ;; |
72 | 'stop') | 73 | 'stop') |
73 | echo "Killing Opie..." | 74 | echo "Killing Opie..." |
74 | if [ -f /var/run/opie.pid ]; then | 75 | if [ -f /var/run/opie.pid ]; then |
75 | kill -TERM `cat /var/run/opie.pid` | 76 | kill -TERM `cat /var/run/opie.pid` |
76 | else | 77 | else |
77 | killproc qpe | 78 | killproc qpe |
78 | fi | 79 | fi |
79 | 80 | ||
80 | killproc opie-login | 81 | killproc opie-login |
81 | ;; | 82 | ;; |
82 | *) | 83 | *) |
83 | echo "usage: $0 { start | stop }" | 84 | echo "usage: $0 { start | stop }" |
84 | ;; | 85 | ;; |
85 | esac | 86 | esac |
86 | 87 | ||