-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
openpandora-scripts-wifi: converted from old firmware recipe
- Loading branch information
Showing
9 changed files
with
511 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
recipes-openpandora/openpandora-system/openpandora-scripts-wifi.bb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
DESCRIPTION = "Scripts to support system options on the OpenPandora." | ||
LICENSE = "GPLV2" | ||
LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263" | ||
|
||
COMPATIBLE_MACHINE = "openpandora" | ||
|
||
RDEPENDS = "openpandora-scripts" | ||
|
||
PR = "r2" | ||
|
||
SRC_URI = " \ | ||
file://LICENSE \ | ||
file://op_wifi.sh \ | ||
file://op_wifi.pnd \ | ||
file://nettool.pnd \ | ||
file://op_bluetooth.sh \ | ||
file://op_bluetooth_work.sh \ | ||
file://op_bluetooth-check.desktop \ | ||
file://op_bluetooth.desktop \ | ||
" | ||
|
||
do_install() { | ||
install -d ${D}${prefix}/pandora/scripts/ | ||
install -m 0755 ${WORKDIR}/op_wifi.sh ${D}${prefix}/pandora/scripts/ | ||
install -m 0755 ${WORKDIR}/op_bluetooth.sh ${D}${prefix}/pandora/scripts/ | ||
install -m 0755 ${WORKDIR}/op_bluetooth_work.sh ${D}${prefix}/pandora/scripts/ | ||
|
||
install -d ${D}${prefix}/pandora/apps/ | ||
install -m 0755 ${WORKDIR}/op_wifi.pnd ${D}${prefix}/pandora/apps/ | ||
|
||
install -d ${D}${prefix}/pandora/mmenu/ | ||
install -m 0755 ${WORKDIR}/nettool.pnd ${D}${prefix}/pandora/mmenu/ | ||
|
||
install -d ${D}${datadir}/applications/ | ||
install -m 0644 ${WORKDIR}/op_bluetooth.desktop ${D}${datadir}/applications/ | ||
|
||
install -d ${D}${sysconfdir}/xdg/autostart/ | ||
install -m 0644 ${WORKDIR}/op_bluetooth-check.desktop ${D}${sysconfdir}/xdg/autostart/op_bluetooth-check.desktop | ||
|
||
} | ||
|
||
PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
|
||
FILES_${PN} += "${prefix} ${datadir}" |
339 changes: 339 additions & 0 deletions
339
recipes-openpandora/openpandora-system/openpandora-scripts-wifi/LICENSE
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+386 KB
recipes-openpandora/openpandora-system/openpandora-scripts-wifi/nettool.pnd
Binary file not shown.
9 changes: 9 additions & 0 deletions
9
recipes-openpandora/openpandora-system/openpandora-scripts-wifi/op_bluetooth-check.desktop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Desktop Entry] | ||
Name=Check Bluetooth Status | ||
Comment=Check the status of your Bluetooth device and enable if desired. | ||
StartupNotify=false | ||
Exec=/usr/pandora/scripts/op_bluetooth.sh startup | ||
Icon=bluetooth | ||
Terminal=false | ||
Type=Application | ||
Categories=System; |
9 changes: 9 additions & 0 deletions
9
recipes-openpandora/openpandora-system/openpandora-scripts-wifi/op_bluetooth.desktop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Desktop Entry] | ||
Name=Toggle Bluetooth Status | ||
Comment=Toggle the status of your Bluetooth device. | ||
StartupNotify=false | ||
Exec=/usr/pandora/scripts/op_bluetooth.sh | ||
Icon=bluetooth | ||
Terminal=false | ||
Type=Application | ||
Categories=System; |
42 changes: 42 additions & 0 deletions
42
recipes-openpandora/openpandora-system/openpandora-scripts-wifi/op_bluetooth.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/sh | ||
# | ||
# Released under the GPL | ||
|
||
INTERFACE="`hciconfig | grep "^hci" | cut -d ':' -f 1`" | ||
LOCK=".op_btenabled" | ||
cd "$HOME" | ||
|
||
if [ "$1" = "startup" ]; then | ||
if [ -f "$LOCK" ]; then | ||
sudo /usr/pandora/scripts/op_bluetooth_work.sh 1 | ||
INTERFACE="`hciconfig | grep "^hci" | cut -d ':' -f 1`" | ||
sudo /usr/sbin/hciconfig "$INTERFACE" up pscan 1>/dev/null && sudo /usr/sbin/bluetoothd | ||
else | ||
echo "Bluetooth: User has not enabled Bluetooth." | ||
fi | ||
else | ||
# Figure out if Bluetooth is running or not | ||
|
||
if hciconfig "$INTERFACE" | grep UP &>/dev/null | ||
then | ||
notify-send -u normal "Bluetooth" "Bluetooth is being disabled..." -i blueman -t 5000 | ||
sudo /usr/sbin/hciconfig ${INTERFACE} down 1>/dev/null | ||
sudo /usr/pandora/scripts/op_bluetooth_work.sh 0 | ||
rm -f "$LOCK" | ||
else | ||
if ! sudo /usr/pandora/scripts/op_bluetooth_work.sh 1; then | ||
notify-send -u normal "Bluetooth" "Bluetooth error" -i blueman -t 3000 | ||
exit 1 | ||
fi | ||
|
||
pgrep bluetoothd | ||
echo $INTERFACE | ||
if [ $? -ne 1 ]; then | ||
notify-send -u normal "Bluetooth" "Bluetooth is being enabled..." -i blueman -t 5000 | ||
sudo /usr/sbin/hciconfig ${INTERFACE} down 1>/dev/null | ||
sudo /usr/sbin/hciconfig ${INTERFACE} up pscan 1>/dev/null | ||
sudo /usr/sbin/bluetoothd 1>/dev/null | ||
touch "$LOCK" | ||
fi | ||
fi | ||
fi |
53 changes: 53 additions & 0 deletions
53
recipes-openpandora/openpandora-system/openpandora-scripts-wifi/op_bluetooth_work.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/sh | ||
|
||
kernel_major=`uname -r | cut -c 1` | ||
if [ "$kernel_major" = "2" ]; then | ||
# new kernel only (for now) | ||
exit 0 | ||
fi | ||
|
||
if [ "$1" = "1" ]; then | ||
if [ ! -e /sys/class/gpio/gpio15/value ]; then | ||
echo 15 > /sys/class/gpio/export | ||
sleep 0.2 | ||
echo out > /sys/class/gpio/gpio15/direction | ||
fi | ||
echo 0 > /sys/devices/platform/omap_uart.0/sleep_timeout | ||
echo 1 > /sys/class/gpio/gpio15/value | ||
hciattach /dev/ttyO0 texasalt 3000000 | ||
INTERFACE="`hciconfig | grep "^hci" | cut -d ':' -f 1`" | ||
if [ -z "$INTERFACE" ]; then | ||
killall hciattach | ||
echo 0 > /sys/class/gpio/gpio15/value | ||
exit 1 | ||
fi | ||
if [ -e /sys/class/leds/ ] ; then | ||
for led in /sys/class/leds/* ; do | ||
trigger=$(grep "$(basename $led)" /etc/default/leds | grep bluetooth | \ | ||
awk '{print $2}' ) | ||
if [ "$trigger" = "bluetooth" ] ; then | ||
echo default-on > "$led/trigger" | ||
echo 255 > "$led/brightness" | ||
fi | ||
done | ||
fi | ||
exit 0 | ||
elif [ "$1" = "0" ]; then | ||
killall hciattach | ||
echo 0 > /sys/class/gpio/gpio15/value | ||
if [ -e /sys/class/leds/ ] ; then | ||
for led in /sys/class/leds/* ; do | ||
trigger=$(grep "$(basename $led)" /etc/default/leds | grep bluetooth | \ | ||
awk '{print $2}' ) | ||
if [ "$trigger" = "bluetooth" ] ; then | ||
echo 0 > "$led/brightness" | ||
fi | ||
done | ||
fi | ||
echo 10 > /sys/devices/platform/omap_uart.0/sleep_timeout | ||
exit 0 | ||
else | ||
echo "invalid argument" | ||
exit 1 | ||
fi | ||
|
Binary file added
BIN
+12.2 KB
recipes-openpandora/openpandora-system/openpandora-scripts-wifi/op_wifi.pnd
Binary file not shown.
15 changes: 15 additions & 0 deletions
15
recipes-openpandora/openpandora-system/openpandora-scripts-wifi/op_wifi.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
# | ||
# Released under the GPL | ||
|
||
# This script simply toggles internal WiFi on or off. | ||
cd / | ||
if [ "`lsmod | grep wl1251`" ] | ||
then | ||
notify-send -u normal "WLAN" "WLAN is being disabled..." -i /usr/share/icons/hicolor/32x32/apps/nm-no-connection.png | ||
ifconfig wlan0 down | ||
rmmod board_omap3pandora_wifi wl1251_sdio wl1251 | ||
else | ||
notify-send -u normal "WLAN" "WLAN is being enabled..." -i /usr/share/icons/hicolor/32x32/apps/nm-device-wired.png | ||
/etc/init.d/wl1251-init start | ||
fi |