diff options
4 files changed, 224 insertions, 0 deletions
diff --git a/org.handhelds.familiar/packages/apmd/apmd-3.2.2/h6300_suspend_fix.patch b/org.handhelds.familiar/packages/apmd/apmd-3.2.2/h6300_suspend_fix.patch new file mode 100644 index 0000000..ffada3b --- /dev/null +++ b/org.handhelds.familiar/packages/apmd/apmd-3.2.2/h6300_suspend_fix.patch @@ -0,0 +1,107 @@ +diff -Naur apmd-3.2.2.old/apmd.c apmd-3.2.2.orig/apmd.c +--- apmd-3.2.2.old/apmd.c 2006-11-05 01:09:14.000000000 +0200 ++++ apmd-3.2.2.orig/apmd.c 2006-11-05 01:52:32.000000000 +0200 +@@ -537,7 +537,7 @@ + /* Do it fast */ + last_marked_time = time(0); + last_marked_content = apmi->battery_percentage; +- ioctl(apmd_fd, APM_IOC_SUSPEND, NULL); ++ apm_suspend(apmd_fd); + break; + case APMD_START: + /* Initialise */ +diff -Naur apmd-3.2.2.old/apmlib.c apmd-3.2.2.orig/apmlib.c +--- apmd-3.2.2.old/apmlib.c 2006-11-05 01:09:14.000000000 +0200 ++++ apmd-3.2.2.orig/apmlib.c 2006-11-05 01:50:58.000000000 +0200 +@@ -35,6 +35,66 @@ + + #define BACKWARD_COMPAT 1 + ++#define SUSPEND_METHOD__NOT_DEFINED -1 ++#define SUSPEND_METHOD__APM_IOCTL 0 ++#define SUSPEND_METHOD__ECHO_SYS_POWER_STATE 1 ++ ++static int suspend_method_to_use = SUSPEND_METHOD__NOT_DEFINED; ++ ++/* ++ * Check from the some of the search strings is available in ++ * /proc/cpuinfo (harware type for example) ++ * ++ * Return 1 if available, 0 if not found ++ */ ++int is_key_in_proc_cpuinfo(char *devlist[]) ++{ ++ FILE* curFd; ++ char curBuffer[2048]; ++ size_t curBCount; ++ char* curFound; ++ int retVal; ++ ++ // let's assume by default that string does not found ++ retVal = 0; ++ /* read to /proc/cpuinfo to buffer */ ++ curFd = fopen("/proc/cpuinfo", "r"); ++ curBCount = fread(curBuffer, 1, sizeof(curBuffer), curFd); ++ fclose(curFd); ++ if (curBCount > 0) { ++ /* make sure text in buffer is terminated */ ++ curBuffer[curBCount] = '\0'; ++ while((*devlist != NULL)) { ++ curFound = strstr(curBuffer, *devlist); ++ if (curFound != NULL) { ++ // matched to one of the search keywords ++ retVal = 1; ++ break; ++ } ++ *devlist++; ++ } ++ } ++ return retVal; ++} ++ ++int check_suspend_method(void) ++{ ++ if (suspend_method_to_use == SUSPEND_METHOD__NOT_DEFINED) ++ { ++ char *curDevArr[] = {"HP iPAQ h6300", 0}; ++ ++ // not checked yet, check now ++ if (is_key_in_proc_cpuinfo(curDevArr)) { ++ suspend_method_to_use = SUSPEND_METHOD__ECHO_SYS_POWER_STATE; ++ printf("Using 'echo mem > sys/power/state' to suspend.\n"); ++ } ++ else { ++ suspend_method_to_use = SUSPEND_METHOD__APM_IOCTL; ++ printf("Using apm ioctl to suspend\n"); ++ } ++ } ++ return suspend_method_to_use; ++} + + /* + * Return a string describing an APM event. From p. 16 of the Intel/Microsoft +@@ -388,7 +448,11 @@ + int apm_suspend(int fd) + { + sync(); +- return ioctl(fd, APM_IOC_SUSPEND, NULL) < 0 ? -errno : 0; ++ if (check_suspend_method() == SUSPEND_METHOD__ECHO_SYS_POWER_STATE) ++ return system("echo mem > /sys/power/state"); ++ else ++ return ioctl(fd, APM_IOC_SUSPEND, NULL) < 0 ? -errno : 0; ++ + } + + +@@ -398,7 +462,10 @@ + int apm_standby(int fd) + { + sync(); +- return ioctl(fd, APM_IOC_STANDBY, NULL); ++ if (check_suspend_method() == SUSPEND_METHOD__ECHO_SYS_POWER_STATE) ++ return system("echo mem > /sys/power/state"); ++ else ++ return ioctl(fd, APM_IOC_STANDBY, NULL); + } + + diff --git a/org.handhelds.familiar/packages/apmd/apmd_3.2.2.bb b/org.handhelds.familiar/packages/apmd/apmd_3.2.2.bb index 6aa91b0..090db98 100644 --- a/org.handhelds.familiar/packages/apmd/apmd_3.2.2.bb +++ b/org.handhelds.familiar/packages/apmd/apmd_3.2.2.bb @@ -8,6 +8,7 @@ PR = "r10" SRC_URI = "${DEBIAN_MIRROR}/main/a/apmd/apmd_${PV}.orig.tar.gz; \ file://debian.patch;patch=1 \ file://workaround.patch;patch=1 \ + file://h6300_suspend_fix.patch;patch=1 \ file://init \ file://default \ file://apmd_proxy \ diff --git a/org.handhelds.familiar/packages/ppp-gprs/files/ppp-gprs.patch b/org.handhelds.familiar/packages/ppp-gprs/files/ppp-gprs.patch new file mode 100644 index 0000000..bbdf4f7 --- /dev/null +++ b/org.handhelds.familiar/packages/ppp-gprs/files/ppp-gprs.patch @@ -0,0 +1,97 @@ +diff -Naur ppp_gprs_old/etc/ppp/chap-secrets ppp_gprs/etc/ppp/chap-secrets +--- ppp_gprs_old/etc/ppp/chap-secrets 1970-01-01 02:00:00.000000000 +0200 ++++ ppp_gprs/etc/ppp/chap-secrets 2006-10-20 15:08:59.000000000 +0300 +@@ -0,0 +1,2 @@ ++# Secrets for authentication using CHAP ++# client server secret IP addresses +diff -Naur ppp_gprs_old/etc/ppp/chatscripts/gprs-connect-chat ppp_gprs/etc/ppp/chatscripts/gprs-connect-chat +--- ppp_gprs_old/etc/ppp/chatscripts/gprs-connect-chat 1970-01-01 02:00:00.000000000 +0200 ++++ ppp_gprs/etc/ppp/chatscripts/gprs-connect-chat 2006-10-20 15:08:22.000000000 +0300 +@@ -0,0 +1,37 @@ ++# Boilerplate ++# ++ ABORT 'BUSY' ++ ABORT 'NO ANSWER' ++ ABORT 'NO CARRIER' ++ ABORT 'NO DIALTONE' ++ ABORT '\nRINGING\r\n\r\nRINGING\r' ++ SAY "GPRS modem init: press <ctrl>-C to disconnect" ++ ++# Wake up the modem ++# ++ TIMEOUT 5 ++ '' 'AT' ++ OK-ATQ0V1&C1-OK 'ATE1' ++ ABORT 'ERROR' ++ TIMEOUT 12 ++ ++# Reset to the factory defaults ++# Also, use '+CME ERROR' codes for ME errors, 'ERROR' for syntax errors ++# ++ OK 'AT&F' ++ OK 'AT+CGDCONT=1,"IP","Your-GPRS-APN","0.0.0.0",0,0' ++ SAY "\n + defining PDP context" ++ ++# Attach to the GPRS service. Strictly, we don't need this step, ++# as AT+CGDATA will do it for us, but doing it explicitly makes it ++# a little easier to debug. ++# ++ TIMEOUT 45 ++ OK 'AT+CGATT=1' ++ SAY "\n + attaching to GPRS" ++ ++# Enter data state ++ OK 'ATD*99#' ++ SAY "\n + requesting data connection" ++ CONNECT '' ++ SAY "\n + connected" +diff -Naur ppp_gprs_old/etc/ppp/chatscripts/gprs-disconnect-chat ppp_gprs/etc/ppp/chatscripts/gprs-disconnect-chat +--- ppp_gprs_old/etc/ppp/chatscripts/gprs-disconnect-chat 1970-01-01 02:00:00.000000000 +0200 ++++ ppp_gprs/etc/ppp/chatscripts/gprs-disconnect-chat 2006-10-20 15:08:22.000000000 +0300 +@@ -0,0 +1,10 @@ ++# Boilerplate ++# ++ ABORT BUSY ++ ABORT ERROR ++ ABORT 'NO DIALTONE' ++ TIMEOUT 30 ++ ++# Get some attention ++ '' '+++\c' ++ SAY " + sending break" +diff -Naur ppp_gprs_old/etc/ppp/gprs-options ppp_gprs/etc/ppp/gprs-options +--- ppp_gprs_old/etc/ppp/gprs-options 1970-01-01 02:00:00.000000000 +0200 ++++ ppp_gprs/etc/ppp/gprs-options 2006-10-24 02:18:51.000000000 +0300 +@@ -0,0 +1,13 @@ ++defaultroute ++nodetach # Comment out to run in the background ++mtu 1400 ++crtscts ++noipdefault ++ipcp-accept-local ++ipcp-accept-remote ++novj ++novjccomp ++debug # Comment out for no debugging info ++lock ++replacedefaultroute # update routing table information ++usepeerdns # find out and update the nameservers +diff -Naur ppp_gprs_old/etc/ppp/peers/gprs ppp_gprs/etc/ppp/peers/gprs +--- ppp_gprs_old/etc/ppp/peers/gprs 1970-01-01 02:00:00.000000000 +0200 ++++ ppp_gprs/etc/ppp/peers/gprs 2006-10-20 15:07:31.000000000 +0300 +@@ -0,0 +1,15 @@ ++#name Your-GPRS-Username # If you dont have a username and password, comment this out ++noauth # If you commented out the line above, uncomment this ++/dev/ttyS1 ++ ++115200 # Serial port line speed and options ++ ++asyncmap 20A0000 ++escape FF ++ ++# Generic GPRS options ++file /etc/ppp/gprs-options ++ ++# Chat scripts ++connect "/usr/sbin/chat -f /etc/ppp/chatscripts/gprs-connect-chat" ++disconnect "/usr/sbin/chat -f /etc/ppp/chatscripts/gprs-disconnect-chat" diff --git a/org.handhelds.familiar/packages/ppp-gprs/ppp-gprs_0.5.bb b/org.handhelds.familiar/packages/ppp-gprs/ppp-gprs_0.5.bb new file mode 100644 index 0000000..b542f5e --- /dev/null +++ b/org.handhelds.familiar/packages/ppp-gprs/ppp-gprs_0.5.bb @@ -0,0 +1,19 @@ +SECTION = "console/network" +DESCRIPTION = "ppp scripts for establishing gprs connection" +MAINTAINER = "Mika Laitio <lamikr@cc.jyu.fi>" +DEPENDS = "ppp" +RDEPENDS = "ppp" +LICENSE = "GPL" +PR = "r5" + +SRC_URI += "file://ppp-gprs.patch;patch=2" + +do_install() { + install -d ${D}${sysconfdir}/ppp/peers + install -m 0644 ${S}/etc/ppp/peers/gprs ${D}${sysconfdir}/ppp/peers/gprs + install -m 0644 ${S}/etc/ppp/chap-secrets ${D}${sysconfdir}/ppp/chap-secrets + install -m 0644 ${S}/etc/ppp/gprs-options ${D}${sysconfdir}/ppp/gprs-options + install -d ${D}${sysconfdir}/ppp/chatscripts + install -m 0644 ${S}/etc/ppp/chatscripts/gprs-connect-chat ${D}${sysconfdir}/ppp/chatscripts/gprs-connect-chat + install -m 0644 ${S}/etc/ppp/chatscripts/gprs-disconnect-chat ${D}${sysconfdir}/ppp/chatscripts/gprs-disconnect-chat +} |