device/common
リビジョン | a6f58edc9e641b1dadf6df8a1f6827cc7e78bb30 (tree) |
---|---|
日時 | 2012-04-30 02:56:12 |
作者 | Chih-Wei Huang <cwhuang@linu...> |
コミッター | Chih-Wei Huang |
generic_x86: add ppp scripts
@@ -33,6 +33,9 @@ PRODUCT_COPY_FILES := \ | ||
33 | 33 | $(if $(wildcard $(PRODUCT_DIR)excluded-input-devices.xml),$(PRODUCT_DIR),$(LOCAL_PATH)/)excluded-input-devices.xml:system/etc/excluded-input-devices.xml \ |
34 | 34 | |
35 | 35 | PRODUCT_COPY_FILES += \ |
36 | + $(LOCAL_PATH)/ppp/ip-up:system/etc/ppp/ip-up \ | |
37 | + $(LOCAL_PATH)/ppp/ip-down:system/etc/ppp/ip-down \ | |
38 | + $(LOCAL_PATH)/ppp/peers/gprs:system/etc/ppp/peers/gprs \ | |
36 | 39 | $(LOCAL_PATH)/GenericTouch.idc:system/usr/idc/GenericTouch.idc \ |
37 | 40 | frameworks/base/data/etc/tablet_core_hardware.xml:system/etc/permissions/tablet_core_hardware.xml \ |
38 | 41 | frameworks/base/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \ |
@@ -530,13 +530,6 @@ service faketsd /system/bin/faketsd | ||
530 | 530 | disabled |
531 | 531 | oneshot |
532 | 532 | |
533 | -service ppp /system/bin/pppd call gprs | |
534 | - class main | |
535 | - user root | |
536 | - group system radio | |
537 | - disabled | |
538 | - oneshot | |
539 | - | |
540 | 533 | service userinit /system/bin/sh /system/etc/init.sh |
541 | 534 | oneshot |
542 | 535 | disabled |
@@ -556,12 +549,6 @@ on property:system_init.startsurfaceflinger=0 | ||
556 | 549 | on property:dev.bootcomplete=1 |
557 | 550 | start userinit |
558 | 551 | |
559 | -on property:gsm.sim.state=READY | |
560 | - start ppp | |
561 | - | |
562 | -on property:gsm.sim.state=UNKNOWN | |
563 | - stop ppp | |
564 | - | |
565 | 552 | on property:debug.logcat=1 |
566 | 553 | start logcat |
567 | 554 |
@@ -46,10 +46,12 @@ PRODUCT_PACKAGES := \ | ||
46 | 46 | chat \ |
47 | 47 | com.android.future.usb.accessory \ |
48 | 48 | drmserver \ |
49 | + eject \ | |
49 | 50 | gps.default \ |
50 | 51 | hwcomposer.default \ |
51 | 52 | icu.dat \ |
52 | 53 | libdrmframework_jni \ |
54 | + libhuaweigeneric-ril \ | |
53 | 55 | lights.default \ |
54 | 56 | make_ext4fs \ |
55 | 57 | powerbtnd \ |
@@ -0,0 +1,16 @@ | ||
1 | +#!/system/bin/sh | |
2 | +export PATH=/system/bin | |
3 | + | |
4 | +case $1 in | |
5 | + ppp1) | |
6 | + echo 0 > /proc/sys/net/ipv4/ip_forward | |
7 | + ;; | |
8 | +esac | |
9 | + | |
10 | +# Use interface name if linkname is not available | |
11 | +NAME=${LINKNAME:-"$1"} | |
12 | + | |
13 | +setprop "net.dns1" "" | |
14 | +setprop "net.dns2" "" | |
15 | +setprop "net.$NAME.local-ip" "" | |
16 | +setprop "net.$NAME.remote-ip" "" |
@@ -0,0 +1,24 @@ | ||
1 | +#!/system/bin/sh | |
2 | +export PATH=/system/bin | |
3 | + | |
4 | +case $1 in | |
5 | + ppp1) | |
6 | + iptables --flush | |
7 | + iptables --table nat --flush | |
8 | + iptables --delete-chain | |
9 | + iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE | |
10 | + iptables --append FORWARD --in-interface ppp1 -j ACCEPT | |
11 | + echo 1 > /proc/sys/net/ipv4/ip_forward | |
12 | + ;; | |
13 | + ppp0) | |
14 | + setprop "net.interfaces.defaultroute" "gprs" | |
15 | + ;; | |
16 | +esac | |
17 | + | |
18 | +# Use interface name if linkname is not available | |
19 | +NAME=${LINKNAME:-"$1"} | |
20 | + | |
21 | +setprop "net.dns1" "$DNS1" | |
22 | +setprop "net.dns2" "$DNS2" | |
23 | +setprop "net.$NAME.local-ip" "$IPLOCAL" | |
24 | +setprop "net.$NAME.gw" "$IPREMOTE" |
@@ -0,0 +1,11 @@ | ||
1 | +#/etc/ppp/peers/gprs | |
2 | +# This is pppd script for China Mobile, used Huawei GTM900-B GPRS Module | |
3 | +# Usage: root>pppd call gprs | |
4 | + | |
5 | +460800 | |
6 | +nocrtscts | |
7 | +usepeerdns | |
8 | +debug | |
9 | +ipcp-accept-local | |
10 | +ipcp-accept-remote | |
11 | +defaultroute |