User:Morlac

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(Linklist: added new images for openmoko-panel-plugin)
m (hardware-switches for bash)
Line 93: Line 93:
 
   
 
   
 
  exit 0
 
  exit 0
 +
 +
=== wifi_hardware ===
  
 
== workaround for apm with debian@FR ==
 
== workaround for apm with debian@FR ==

Revision as of 21:22, 3 September 2008

Contents

hardware-switches for bash

bt_hardware

#!/bin/sh
BT_HW="/sys/bus/platform/devices/neo1973-pm-bt.0/power_on"
BT_RST="/sys/bus/platform/devices/neo1973-pm-bt.0/reset"

[ -e "${BT_HW}" ] || exit 0

case "${1}" in
(start)
       echo 1 > ${BT_HW}
       echo 0 > ${BT_RST}
       echo "BlueTooth-Hardware is now on"
       ;;
(stop)
       echo 0 > ${BT_HW}
       echo "BlueTooth-Hardware is now off"
       ;;
(status)
       BT_STATUS=`cat ${BT_HW}`
       case "${BT_STATUS}" in
       ("1")
               echo "BlueTooth-Hardware is on"
               ;;
       ("0")
               echo "BlueTooth-Hardware is off"
               ;;
       esac
       ;;
esac

exit 0

gps_hardware

#!/bin/sh
GPS_HW="/sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-gps.0/pwron"
[ -e "${GPS_HW}" ] || exit 0

case "${1}" in
(start)
       echo 1 > ${GPS_HW}
       echo "GPS-Hardware is now on"
       ;;
(stop)
       echo 0 > ${GPS_HW}
       echo "GPS-Hardware is now off"
       ;;
(status)
       GPSSTATUS=`cat ${GPS_HW}`
       case "${GPSSTATUS}" in
       ("1")
               echo "GPS-Hardware is on"
               ;;
       ("0")
               echo "GPS-Hardware is off"
               ;;
       esac
       ;;
esac

exit 0

gsm_hardware

#!/bin/sh
GSM_HW="/sys/bus/platform/devices/neo1973-pm-gsm.0/power_on"

[ -e "${GSM_HW}" ] || exit 0

case "${1}" in
(start)
       echo 1 > ${GSM_HW}
       echo "GSM-Hardware is now on"
       ;;
(stop)
       echo 0 > ${GSM_HW}
       echo "GSM-Hardware is now off"
       ;;
(status)
       GSM_STATUS=`cat ${GSM_HW}`
       case "${GSM_STATUS}" in
       ("1")
               echo "GSM-Hardware is on"
               ;;
       ("0")
               echo "GSM-Hardware is off"
               ;;
       esac
       ;;
esac

exit 0

wifi_hardware

workaround for apm with debian@FR

first: turn off apmd
what's actually running for me is:
mv /usr/bin/apm /usr/bin/apm.o and create new /usr/bin/apm as follows:

/usr/bin/apm

#!/bin/sh
echo 1 > /sys/module/glamo_mci/parameters/sd_idleclk
apm.o ${*}
echo 0 > /sys/module/glamo_mci/parameters/sd_idleclk

Another script:
add link /etc/apm/event.d (don't forget to chmod +x /etc/apm/scripts.d/sd_idleclk)

/etc/apm/scripts.d/sd_idleclk

#!/bin/sh
SD_IDLECLK="/sys/module/glamo_mci/parameters/sd_idleclk"
[ -x "${SD_IDLECLK}" ] || exit 0

case "${1},${2}" in
(suspend,*)
    echo 1 > ${SD_IDLECLK}
    touch /etc
    ;;
(resume,suspend)
    echo 0 > ${SD_IDLECLK}
    ;;
esac

# for debugging:
echo "${1}, ${2} - `date`" >> /tmp/apm.log
sleep 1
sync

exit 0

Linklist

http://wiki.openmoko.org/wiki/Switching_Keyboards
http://wiki.openmoko.org/wiki/Boot_from_sd_card
http://wiki.openmoko.org/wiki/Lint-wifi
http://hdr.meetr.de/neo/openmoko/battery
http://www.ohli.de/download/openmoko-panel-plugin_0.1-1_all.deb
New Images for panel-plugin:
Panel-plugin 48x48 off.png Panel-plugin bt 0.png Panel-plugin bt 1.png Panel-plugin gps 0.png Panel-plugin gsm 0.png Panel-plugin matchbox-keyboard 0.png Panel-plugin matchbox-keyboard 1.png Panel-plugin wifi 0.png

http://www.ohli.de/download/xserver-xorg-input-tslib_0.0.5-1+fso1_armel.deb

Option          "EmulateRightButton"    "1"

Location

Trier, Germany

Contact

-----BEGIN CONTACT BLOCK-----
 eMail:	morlac@morlac.de
 Jabber:morlac@skavaer.homelinux.org
------END CONTACT BLOCK------

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS$/IT;d-;s:;a?;C++(+++)>++++;UL++++;P++(+++)>++++;
L++(+++);E---;W++;N(+);o?;K?;!w;!O;!M+>;!V;PS(+);PE;
Y+;PGP++;t+(++);5(+)>++;X(+);R*;tv->+;b++(+++);DI++;
D++(+++)>++++;G(+)>++;e+>+++;h-()>++;r++;y++;
------END GEEK CODE BLOCK------

Key-ID: 2949CB31
http://pgpkeys.pca.dfn.de/pks/lookup?search=0x2949CB31&fingerprint=on&op=vindex
Personal tools

hardware-switches for bash

bt_hardware

#!/bin/sh
BT_HW="/sys/bus/platform/devices/neo1973-pm-bt.0/power_on"
BT_RST="/sys/bus/platform/devices/neo1973-pm-bt.0/reset"

[ -e "${BT_HW}" ] || exit 0

case "${1}" in
(start)
       echo 1 > ${BT_HW}
       echo 0 > ${BT_RST}
       echo "BlueTooth-Hardware is now on"
       ;;
(stop)
       echo 0 > ${BT_HW}
       echo "BlueTooth-Hardware is now off"
       ;;
(status)
       BT_STATUS=`cat ${BT_HW}`
       case "${BT_STATUS}" in
       ("1")
               echo "BlueTooth-Hardware is on"
               ;;
       ("0")
               echo "BlueTooth-Hardware is off"
               ;;
       esac
       ;;
esac

exit 0

gps_hardware

#!/bin/sh
GPS_HW="/sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-gps.0/pwron"
[ -e "${GPS_HW}" ] || exit 0

case "${1}" in
(start)
       echo 1 > ${GPS_HW}
       echo "GPS-Hardware is now on"
       ;;
(stop)
       echo 0 > ${GPS_HW}
       echo "GPS-Hardware is now off"
       ;;
(status)
       GPSSTATUS=`cat ${GPS_HW}`
       case "${GPSSTATUS}" in
       ("1")
               echo "GPS-Hardware is on"
               ;;
       ("0")
               echo "GPS-Hardware is off"
               ;;
       esac
       ;;
esac

exit 0

gsm_hardware

#!/bin/sh
GSM_HW="/sys/bus/platform/devices/neo1973-pm-gsm.0/power_on"

[ -e "${GSM_HW}" ] || exit 0

case "${1}" in
(start)
       echo 1 > ${GSM_HW}
       echo "GSM-Hardware is now on"
       ;;
(stop)
       echo 0 > ${GSM_HW}
       echo "GSM-Hardware is now off"
       ;;
(status)
       GSM_STATUS=`cat ${GSM_HW}`
       case "${GSM_STATUS}" in
       ("1")
               echo "GSM-Hardware is on"
               ;;
       ("0")
               echo "GSM-Hardware is off"
               ;;
       esac
       ;;
esac

exit 0

workaround for apm with debian@FR

first: turn off apmd
what's actually running for me is:
mv /usr/bin/apm /usr/bin/apm.o and create new /usr/bin/apm as follows:

/usr/bin/apm

#!/bin/sh
echo 1 > /sys/module/glamo_mci/parameters/sd_idleclk
apm.o ${*}
echo 0 > /sys/module/glamo_mci/parameters/sd_idleclk

Another script:
add link /etc/apm/event.d (don't forget to chmod +x /etc/apm/scripts.d/sd_idleclk)

/etc/apm/scripts.d/sd_idleclk

#!/bin/sh
SD_IDLECLK="/sys/module/glamo_mci/parameters/sd_idleclk"
[ -x "${SD_IDLECLK}" ] || exit 0

case "${1},${2}" in
(suspend,*)
    echo 1 > ${SD_IDLECLK}
    touch /etc
    ;;
(resume,suspend)
    echo 0 > ${SD_IDLECLK}
    ;;
esac

# for debugging:
echo "${1}, ${2} - `date`" >> /tmp/apm.log
sleep 1
sync

exit 0

Linklist

http://wiki.openmoko.org/wiki/Switching_Keyboards
http://wiki.openmoko.org/wiki/Boot_from_sd_card
http://wiki.openmoko.org/wiki/Lint-wifi
http://hdr.meetr.de/neo/openmoko/battery
http://www.ohli.de/download/openmoko-panel-plugin_0.1-1_all.deb
New Images for panel-plugin:
Panel-plugin 48x48 off.png Panel-plugin bt 0.png Panel-plugin bt 1.png Panel-plugin gps 0.png Panel-plugin gsm 0.png Panel-plugin matchbox-keyboard 0.png Panel-plugin matchbox-keyboard 1.png Panel-plugin wifi 0.png

http://www.ohli.de/download/xserver-xorg-input-tslib_0.0.5-1+fso1_armel.deb

Option          "EmulateRightButton"    "1"

Location

Trier, Germany

Contact

-----BEGIN CONTACT BLOCK-----
 eMail:	morlac@morlac.de
 Jabber:morlac@skavaer.homelinux.org
------END CONTACT BLOCK------

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS$/IT;d-;s:;a?;C++(+++)>++++;UL++++;P++(+++)>++++;
L++(+++);E---;W++;N(+);o?;K?;!w;!O;!M+>;!V;PS(+);PE;
Y+;PGP++;t+(++);5(+)>++;X(+);R*;tv->+;b++(+++);DI++;
D++(+++)>++++;G(+)>++;e+>+++;h-()>++;r++;y++;
------END GEEK CODE BLOCK------

Key-ID: 2949CB31
http://pgpkeys.pca.dfn.de/pks/lookup?search=0x2949CB31&fingerprint=on&op=vindex