diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 19:32:55 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 19:32:55 -0800 |
commit | dd7bc3319deb2b77c5d07a51b7d6cd7e11b5beb0 (patch) | |
tree | 2ba8d1a0846d69b18f623515e8d9b5d9fe38b590 /rootdir | |
parent | e54eebbf1a908d65ee8cf80bab62821c05666d70 (diff) | |
download | core-dd7bc3319deb2b77c5d07a51b7d6cd7e11b5beb0.tar.gz core-dd7bc3319deb2b77c5d07a51b7d6cd7e11b5beb0.tar.bz2 core-dd7bc3319deb2b77c5d07a51b7d6cd7e11b5beb0.zip |
auto import from //depot/cupcake/@135843
Diffstat (limited to 'rootdir')
-rw-r--r-- | rootdir/Android.mk | 58 | ||||
-rw-r--r-- | rootdir/etc/dbus.conf | 27 | ||||
-rw-r--r-- | rootdir/etc/hosts | 1 | ||||
-rw-r--r-- | rootdir/etc/init.goldfish.rc | 54 | ||||
-rwxr-xr-x | rootdir/etc/init.goldfish.sh | 39 | ||||
-rwxr-xr-x | rootdir/etc/init.gprs-pppd | 23 | ||||
-rwxr-xr-x | rootdir/etc/init.testmenu | 322 | ||||
-rw-r--r-- | rootdir/etc/mountd.conf | 19 | ||||
-rw-r--r-- | rootdir/etc/ppp/chap-secrets | 2 | ||||
-rwxr-xr-x | rootdir/etc/ppp/ip-down | 14 | ||||
-rwxr-xr-x | rootdir/etc/ppp/ip-up | 24 | ||||
-rw-r--r-- | rootdir/init.rc | 245 |
12 files changed, 828 insertions, 0 deletions
diff --git a/rootdir/Android.mk b/rootdir/Android.mk new file mode 100644 index 000000000..b2fe8cf15 --- /dev/null +++ b/rootdir/Android.mk @@ -0,0 +1,58 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +# files that live under /system/etc/... + +copy_from := \ + etc/dbus.conf \ + etc/init.goldfish.sh \ + etc/hosts + +dont_copy := \ + etc/init.gprs-pppd \ + etc/ppp/chap-secrets \ + etc/ppp/ip-down \ + etc/ppp/ip-up + +copy_to := $(addprefix $(TARGET_OUT)/,$(copy_from)) +copy_from := $(addprefix $(LOCAL_PATH)/,$(copy_from)) + +$(copy_to) : PRIVATE_MODULE := system_etcdir +$(copy_to) : $(TARGET_OUT)/% : $(LOCAL_PATH)/% | $(ACP) + $(transform-prebuilt-to-target) + +ALL_PREBUILT += $(copy_to) + + +# files that live under /... + +# Only copy init.rc if the target doesn't have its own. +ifneq ($(TARGET_PROVIDES_INIT_RC),true) +file := $(TARGET_ROOT_OUT)/init.rc +$(file) : $(LOCAL_PATH)/init.rc | $(ACP) + $(transform-prebuilt-to-target) +ALL_PREBUILT += $(file) +endif + +file := $(TARGET_ROOT_OUT)/init.goldfish.rc +$(file) : $(LOCAL_PATH)/etc/init.goldfish.rc | $(ACP) + $(transform-prebuilt-to-target) +ALL_PREBUILT += $(file) + + +# create some directories (some are mount points) +DIRS := $(addprefix $(TARGET_ROOT_OUT)/, \ + sbin \ + dev \ + proc \ + sys \ + system \ + data \ + ) \ + $(TARGET_OUT_DATA) + +$(DIRS): + @echo Directory: $@ + @mkdir -p $@ + +ALL_PREBUILT += $(DIRS) diff --git a/rootdir/etc/dbus.conf b/rootdir/etc/dbus.conf new file mode 100644 index 000000000..75586b92d --- /dev/null +++ b/rootdir/etc/dbus.conf @@ -0,0 +1,27 @@ +<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN" + "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> +<busconfig> + + <!-- Our well-known bus type, do not change this --> + <type>system</type> + + <!-- Only allow socket-credentials-based authentication --> + <auth>EXTERNAL</auth> + + <!-- Only listen on a local socket. (abstract=/path/to/socket + means use abstract namespace, don't really create filesystem + file; only Linux supports this. Use path=/whatever on other + systems.) --> + <listen>unix:path=/dev/socket/dbus</listen> + + <!-- Allow everything, D-Bus socket is protected by unix filesystem + permissions --> + <policy context="default"> + <allow send_interface="*"/> + <allow receive_interface="*"/> + <allow own="*"/> + <allow user="*"/> + <allow send_requested_reply="true"/> + <allow receive_requested_reply="true"/> + </policy> +</busconfig> diff --git a/rootdir/etc/hosts b/rootdir/etc/hosts new file mode 100644 index 000000000..99848f643 --- /dev/null +++ b/rootdir/etc/hosts @@ -0,0 +1 @@ +127.0.0.1 localhost diff --git a/rootdir/etc/init.goldfish.rc b/rootdir/etc/init.goldfish.rc new file mode 100644 index 000000000..96480f3e8 --- /dev/null +++ b/rootdir/etc/init.goldfish.rc @@ -0,0 +1,54 @@ +on boot + setprop ARGH ARGH + setprop net.eth0.dns1 10.0.2.3 + setprop net.gprs.local-ip 10.0.2.15 + setprop ro.radio.use-ppp no + setprop ro.build.product generic + setprop ro.product.device generic + +# fake some battery state + setprop status.battery.state Slow + setprop status.battery.level 5 + setprop status.battery.level_raw 50 + setprop status.battery.level_scale 9 + +# disable some daemons the emulator doesn't want + stop dund + stop akmd + + setprop ro.setupwizard.mode EMULATOR + +# enable Google-specific location features, +# like NetworkLocationProvider and LocationCollector + setprop ro.com.google.locationfeatures 1 + +# For the emulator, which bypasses Setup Wizard, you can specify +# account info for the device via these two properties. Google +# Login Service will insert these accounts into the database when +# it is created (ie, after a data wipe). +# +# setprop ro.config.hosted_account username@hosteddomain.org:password +# setprop ro.config.google_account username@gmail.com:password +# +# You MUST have a Google account on the device, and you MAY +# additionally have a hosted account. No other configuration is +# supported, and arbitrary breakage may result if you specify +# something else. + +service goldfish-setup /system/etc/init.goldfish.sh + oneshot + +service qemud /system/bin/qemud + socket qemud_gsm stream 666 + socket qemud_gps stream 666 + socket qemud_control stream 666 + oneshot + +# -Q is a special logcat option that forces the +# program to check wether it runs on the emulator +# if it does, it redirects its output to the device +# named by the androidboot.console kernel option +# if not, is simply exit immediately + +service goldfish-logcat /system/bin/logcat -Q + oneshot diff --git a/rootdir/etc/init.goldfish.sh b/rootdir/etc/init.goldfish.sh new file mode 100755 index 000000000..0eb0154bf --- /dev/null +++ b/rootdir/etc/init.goldfish.sh @@ -0,0 +1,39 @@ +#!/system/bin/sh + +ifconfig eth0 10.0.2.15 netmask 255.255.255.0 up +route add default gw 10.0.2.2 dev eth0 + +qemud=`getprop.ro.kernel.android.qemud` +if test -z "$qemud"; then + radio_ril=`getprop ro.kernel.android.ril` + if test -z "$radio_ril"; then + # no need for the radio interface daemon + # telephony is entirely emulated in Java + setprop ro.radio.noril yes + stop ril-daemon + fi +fi + +num_dns=`getprop ro.kernel.android.ndns` +case "$num_dns" in + 2) setprop net.eth0.dns2 10.0.2.4 + ;; + 3) setprop net.eth0.dns2 10.0.2.4 + setprop net.eth0.dns3 10.0.2.5 + ;; + 4) setprop net.eth0.dns2 10.0.2.4 + setprop net.eth0.dns3 10.0.2.5 + setprop net.eth0.dns4 10.0.2.6 + ;; +esac + +# disable boot animation for a faster boot sequence when needed +boot_anim=`getprop ro.kernel.android.bootanim` +case "$boot_anim" in + 0) setprop debug.sf.nobootanimation 1 + ;; +esac + +# this line doesn't really do anything useful. however without it the +# previous setprop doesn't seem to apply for some really odd reason +setprop ro.qemu.init.completed 1 diff --git a/rootdir/etc/init.gprs-pppd b/rootdir/etc/init.gprs-pppd new file mode 100755 index 000000000..521eec988 --- /dev/null +++ b/rootdir/etc/init.gprs-pppd @@ -0,0 +1,23 @@ +#!/system/bin/sh +# An unforunate wrapper script +# so that the exit code of pppd may be retrieved + + +# this is a workaround for issue #651747 +#trap "/system/bin/sleep 1;exit 0" TERM + + +PPPD_PID= + +/system/bin/setprop "net.gprs.ppp-exit" "" + +/system/bin/log -t pppd "Starting pppd" + +/system/bin/pppd $* + +PPPD_EXIT=$? +PPPD_PID=$! + +/system/bin/log -t pppd "pppd exited with $PPPD_EXIT" + +/system/bin/setprop "net.gprs.ppp-exit" "$PPPD_EXIT" diff --git a/rootdir/etc/init.testmenu b/rootdir/etc/init.testmenu new file mode 100755 index 000000000..7ae16d501 --- /dev/null +++ b/rootdir/etc/init.testmenu @@ -0,0 +1,322 @@ +#!/system/bin/sh + +atdev=/dev/omap_csmi_tty0 +pppdev=/dev/omap_csmi_tty1 + +n1=`cat /data/phoneentry1 2>/dev/null` +n2=`cat /data/phoneentry2 2>/dev/null` +n3=`cat /data/phoneentry3 2>/dev/null` +n1=${n1:-"*#06#"} +n2=${n2:-"*#06#"} +n3=${n3:-"*#06#"} +phoneoutputpid= +eventoutputpid= +notifypid= +notifytoggle=false +pppdpid= +powerdidletime=120 + +# map phone specific keys +setkey -k 0xe4 -v 0x23 # map # +setkey -k 0xe3 -v 0x2a # map * +setkey -k 231 -v 513 # map send to newline +#setkey -k 0x67 -v 0x20b # map up to scroll back +#setkey -k 0x6c -v 0x20a # map down to scroll forward +setkey -k 0x73 -v 0x20b # map volume up to scroll back +setkey -k 0x72 -v 0x20a # map volume down to scroll forward +setkey -k 0x60 -v 0x211 # map PoC to next console + +# tuttle keys +setkey -k 0x38 -v 0x703 # map leftalt to alt +setkey -k 0x9b -v 0x703 # map mail to alt +setkey -t 8 -k 0x9b -v 0x703 # map alt-mail to alt +setkey -t 8 -k 0x10 -v 0x21 # map alt-q to ! +setkey -t 8 -k 0x11 -v 0x31 # map alt-w to 1 +setkey -t 8 -k 0x12 -v 0x32 # map alt-e to 2 +setkey -t 8 -k 0x13 -v 0x33 # map alt-r to 3 +setkey -t 8 -k 0x14 -v 0x2b # map alt-t to + +setkey -t 8 -k 0x15 -v 0x28 # map alt-y to ( +setkey -t 8 -k 0x16 -v 0x29 # map alt-u to ) +setkey -t 8 -k 0x17 -v 0x2d # map alt-i to - +setkey -t 8 -k 0x18 -v 0x5f # map alt-o to _ +setkey -t 8 -k 0x19 -v 0x22 # map alt-p to " +setkey -t 8 -k 0x1e -v 0x23 # map alt-a to # +setkey -t 8 -k 0x1f -v 0x34 # map alt-s to 4 +setkey -t 8 -k 0x20 -v 0x35 # map alt-d to 5 +setkey -t 8 -k 0x21 -v 0x36 # map alt-f to 6 +setkey -t 8 -k 0x22 -v 0x2f # map alt-g to / +setkey -t 8 -k 0x23 -v 0x3f # map alt-h to ? +setkey -t 8 -k 0x24 -v 0xa3 # map alt-j to pound +setkey -t 8 -k 0x25 -v 0x24 # map alt-k to $ +setkey -t 8 -k 0x2c -v 0x2a # map alt-z to * +setkey -t 8 -k 0x2d -v 0x37 # map alt-x to 7 +setkey -t 8 -k 0x2e -v 0x38 # map alt-c to 8 +setkey -t 8 -k 0x2f -v 0x39 # map alt-v to 9 +setkey -t 8 -k 0x30 -v 0x7c # map alt-b to | +setkey -t 8 -k 0x31 -v 0x40 # map alt-n to @ +setkey -t 8 -k 0x32 -v 0x3d # map alt-m to = +setkey -t 8 -k 0x33 -v 0x3b # map alt-, to ; +setkey -t 8 -k 0x34 -v 0x3a # map alt-. to : +setkey -t 8 -k 0x0f -v 0x30 # map alt-tab to 0 +setkey -t 8 -k 0x67 -v 0x20b # map alt-up to scroll back +setkey -t 8 -k 0x6c -v 0x20a # map alt-down to scroll forward + +while true +do + echo + echo "------------------------------" + echo " 1: init commands" + echo " 2: call commands" + echo " 3: misc phone" + echo " 4: phone debug output" + echo " 5: test data connection" + echo " 6: start runtime" + echo " 7: start runtime w/output" + echo " 8: stop runtime" + echo " 9: misc" + echo -n ": " + while true + do + c=`readtty -t 50 -f -a 1234567890#` + case "$c" in + "" ) ;; + * ) break; + esac + done + echo Got key -$c- + case $c in + "1" ) + while true; do + echo + echo "------------------------------" + echo " 1: Print phone output" + echo " 2: ATQ0V1E1+CMEE=2;+CREG=0" + echo " 3: AT+CFUN=1" + echo " 4: AT+COPS=0" + echo " 5: AT+CREG?" + echo " 6: Stop phone output" + echo " 0: back" + echo -n ": " + c=`readtty -f -a 1234560#` + echo Got key -$c- + case "$c" in + "1" ) kill $phoneoutputpid; cat $atdev & phoneoutputpid=$! ;; + "2" ) echo -e "ATQ0V1E1+CMEE=2;+CREG=0\r" >$atdev;; + "3" ) echo -e "AT+CFUN=1\r" >$atdev;; + "4" ) echo -e "AT+COPS=0\r" >$atdev;; + "5" ) echo -e "AT+CREG?\r" >$atdev;; + "6" ) kill $phoneoutputpid; phoneoutputpid= ;; + "0" ) break;; + esac + done + ;; + "2" ) + while true; do + echo + echo "------------------------------" + echo " 1: Dial: ATD $n1;" + echo " 2: Dial: ATD $n2;" + echo " 3: Dial: ATD $n3;" + echo " 4: Set number for 1" + echo " 5: Set number for 2" + echo " 6: Set number for 3" + echo " 7: Dial: ATD ...;" + echo " 8: Hang up: ATH" + echo " 9: Answer: ATA" + echo " 0: back" + echo -n ": " + c=`readtty -f -a 1234567890#` + echo Got key -$c- + case "$c" in + "1" ) echo "Dialing $n1"; echo -e "ATD $n1;\r" >$atdev;; + "2" ) echo "Dialing $n2"; echo -e "ATD $n2;\r" >$atdev;; + "3" ) echo "Dialing $n3"; echo -e "ATD $n3;\r" >$atdev;; + "4" ) echo -n "Number: "; read n1; echo $n1 >/data/phoneentry1;; + "5" ) echo -n "Number: "; read n2; echo $n2 >/data/phoneentry2;; + "6" ) echo -n "Number: "; read n3; echo $n3 >/data/phoneentry3;; + "7" ) echo -n "Number: "; read n; echo "Dialing $n"; echo -e "ATD $n;\r" >$atdev;; + "8" ) echo -e "ATH\r" >$atdev;; + "9" ) echo -e "ATA\r" >$atdev;; + "0" ) break;; + esac + done + ;; + "3" ) + while true; do + echo + echo "------------------------------" + echo " 1: Save FFS data" + echo " 2: Load user FFS data" + echo " 3: Load system FFS data" + echo " 4: Reset FFS data" + echo " 5: Set uplink gain" + echo " 6: Set echo" + echo " 7: cat /dev/omap_csmi_battery_t" + echo " 8: cat /dev/omap_csmi_htc" + echo " 0: back" + echo -n ": " + c=`readtty -f -a 123456780#` + echo Got key -$c- + case "$c" in + "1" ) cat /dev/omap_csmi_ffs >/data/ffsdata;; + "2" ) cat /data/ffsdata >/dev/omap_csmi_ffs;; + "3" ) cat /system/ffsdata >/dev/omap_csmi_ffs;; + "4" ) echo - >/dev/omap_csmi_ffs;; + "5" ) + echo -n "Gain: "; read g; + echo gu$g >/tmp/gain; + cat /tmp/gain 2>/dev/null >/dev/omap_csmi_audio_tes + ;; + "6" ) + echo -n "Echo param (hex): "; read e; + echo "e0x$e" >/tmp/echo; + cat /tmp/echo 2>/dev/null >/dev/omap_csmi_audio_tes + ;; + "7" ) cat /dev/omap_csmi_battery_t;; + "8" ) cat /dev/omap_csmi_htc;; + "0" ) break;; + esac + done + ;; + "4" ) + while true; do + echo + echo "------------------------------" + echo " 1: Toggle debug I/O" + echo " 2: Toggle debug Flow" + echo " 3: Toggle debug Interrupt" + echo " 4: Toggle debug Info" + echo " 5: Toggle GSM run state" + echo " 6: Clear GSM data area" + echo " 0: back" + echo -n ": " + c=`readtty -f -a 1234560#` + echo Got key -$c- + case "$c" in + "1" ) echo -n "i" >/sys/devices/system/omap_csmi/debug;; + "2" ) echo -n "f" >/sys/devices/system/omap_csmi/debug;; + "3" ) echo -n "I" >/sys/devices/system/omap_csmi/debug;; + "4" ) echo -n "F" >/sys/devices/system/omap_csmi/debug;; + "5" ) echo -n "s" >/sys/devices/system/omap_csmi/debug;; + "6" ) echo -n "c" >/sys/devices/system/omap_csmi/debug;; + "0" ) break;; + esac + done + ;; + "5" ) + while true; do + echo + echo "------------------------------" + echo " 1: Start pppd - userspace" + echo " 2: Start pppd - kernel" + echo " 3: Start pppd - kernel <at1" + echo " 4: Configure ppp data to at2" + echo " 5: Test with HTTP GET" + echo " 6: Kill pppd" + echo " 0: back" + echo -n ": " + c=`readtty -f -a 1234560#` + echo Got key -$c- + case "$c" in + "1" ) kill $pppdpid; pppd notty < $pppdev > $pppdev & pppdpid=$!;; + "2" ) kill $pppdpid; pppd nodetach $pppdev & pppdpid=$!;; + "3" ) kill &pppdpid; pppd nodetach $pppdev connect "sh -c \"chat -v -f /etc/ppp/connect-data <$atdev >$atdev\"" & pppdpid=$!;; + "4" ) echo -e 'AT%DATA=2,"UART",1,,"SER","UART",0\r' >$atdev;; + "5" ) test-data-connection;; + "6" ) kill $pppdpid; pppdpid=;; + "0" ) break;; + esac + done + ;; + "6" ) + echo + echo ------------------------ + echo Starting android runtime + echo ------------------------ + start + ;; + "7" ) + echo + echo ------------------------ + echo Starting android runtime + echo ------------------------ + if exists /data/singleproc + then + single_process="-s" + else + single_process="" + fi + start runtime $single_process + ;; + "8" ) + stop + ;; + "9" ) + while true; do + echo + echo "------------------------------" + echo " 1: Print events" + echo " 2: Stop event output" + if $notifytoggle + then + echo " 3: stop notify" + else + echo " 3: notify /sys/android_power" + fi + echo " 4: start powerd" + echo " 5: start powerd verbose" + echo " 6: stop powerd" + echo " 7: set powerd idletime ($powerdidletime)" + echo " 8: start multitap shell" + if exists /data/singleproc + then + echo " 9: enable multiprocess" + else + echo " 9: disable multiprocess" + fi + echo " c: start shell" + echo " 0: back" + echo -n ": " + c=`readtty -f -a 1234567890c#` + echo Got key -$c- + case "$c" in + "1" ) kill $eventoutputpid; getevent & eventoutputpid=$! ;; + "2" ) kill $eventoutputpid; eventoutputpid= ;; + "3" ) + if $notifytoggle + then + kill $notifypid + notifypid= + notifytoggle=false + else + kill $notifypid + notify -m 0x00000002 -c 0 -p -v 0 -w 30 /sys/android_power & + notifypid=$! + notifytoggle=true + fi + ;; + "4" ) start powerd -i $powerdidletime ;; + "5" ) start powerd -i $powerdidletime -v ;; + "6" ) stop powerd ;; + "7" ) echo -n "Idle time (seconds): "; read powerdidletime ;; + "8" ) + readtty -f -p -t 10 -e "[ ~" | sh -i + ;; + "9" ) + if exists /data/singleproc + then + echo "Enabling multiprocess environment." + rm /data/singleproc + else + echo "Disabling multiprocess environment." + echo >/data/singleproc "true" + fi + ;; + "c" ) sh -i <>/dev/tty0 1>&0 2>&1 ;; + "0" ) break;; + esac + done + ;; + esac +done + diff --git a/rootdir/etc/mountd.conf b/rootdir/etc/mountd.conf new file mode 100644 index 000000000..094a2c7af --- /dev/null +++ b/rootdir/etc/mountd.conf @@ -0,0 +1,19 @@ +## mountd configuration file + +## add a mount entry for each mount point to be managed by mountd +mount { + ## root block device with partition map or raw FAT file system + block_device /dev/block/mmcblk0 + + ## mount point for block device + mount_point /sdcard + + ## true if this mount point can be shared via USB mass storage + enable_ums true + + ## path to the UMS driver file for specifying the block device path + ## use this for the mass_storage function driver + driver_store_path /sys/devices/platform/usb_mass_storage/lun0/file + ## use this for android_usb composite gadget driver + ##driver_store_path /sys/devices/platform/msm_hsusb/gadget/lun0/file +} diff --git a/rootdir/etc/ppp/chap-secrets b/rootdir/etc/ppp/chap-secrets new file mode 100644 index 000000000..6546b0f1c --- /dev/null +++ b/rootdir/etc/ppp/chap-secrets @@ -0,0 +1,2 @@ +* * bogus + diff --git a/rootdir/etc/ppp/ip-down b/rootdir/etc/ppp/ip-down new file mode 100755 index 000000000..672fa1e74 --- /dev/null +++ b/rootdir/etc/ppp/ip-down @@ -0,0 +1,14 @@ +#!/system/bin/sh +case $1 in + ppp1) + echo 0 > /proc/sys/net/ipv4/ip_forward; + ;; +esac + +# Use interface name if linkname is not available +NAME=${LINKNAME:-"$1"} + +/system/bin/setprop "net.$NAME.dns1" "$DNS1" +/system/bin/setprop "net.$NAME.dns2" "$DNS2" +/system/bin/setprop "net.$NAME.local-ip" "$IPLOCAL" +/system/bin/setprop "net.$NAME.remote-ip" "$IPREMOTE" diff --git a/rootdir/etc/ppp/ip-up b/rootdir/etc/ppp/ip-up new file mode 100755 index 000000000..cb2d57785 --- /dev/null +++ b/rootdir/etc/ppp/ip-up @@ -0,0 +1,24 @@ +#!/system/bin/sh +case $1 in + ppp1) + /android/bin/iptables --flush; + /android/bin/iptables --table nat --flush; + /android/bin/iptables --delete-chain; + /android/bin/iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE; + /android/bin/iptables --append FORWARD --in-interface ppp1 -j ACCEPT; + echo 0 > /proc/sys/net/ipv4/ip_forward; + echo 1 > /proc/sys/net/ipv4/ip_forward; + ;; + ppp0) + /system/bin/setprop "net.interfaces.defaultroute" "gprs" + ;; +esac + +# Use interface name if linkname is not available +NAME=${LINKNAME:-"$1"} + +/system/bin/setprop "net.$NAME.dns1" "$DNS1" +/system/bin/setprop "net.$NAME.dns2" "$DNS2" +/system/bin/setprop "net.$NAME.local-ip" "$IPLOCAL" +/system/bin/setprop "net.$NAME.remote-ip" "$IPREMOTE" + diff --git a/rootdir/init.rc b/rootdir/init.rc new file mode 100644 index 000000000..3f8c6a01b --- /dev/null +++ b/rootdir/init.rc @@ -0,0 +1,245 @@ + +on init + +sysclktz 0 + +loglevel 3 + +# setup the global environment + export PATH /sbin:/system/sbin:/system/bin:/system/xbin + export LD_LIBRARY_PATH /system/lib + export ANDROID_BOOTLOGO 1 + export ANDROID_ROOT /system + export ANDROID_ASSETS /system/app + export ANDROID_DATA /data + export EXTERNAL_STORAGE /sdcard + export BOOTCLASSPATH /system/framework/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar + +# Backward compatibility + symlink /system/etc /etc + +# create mountpoints and mount tmpfs on sqlite_stmt_journals + mkdir /sdcard 0000 system system + mkdir /system + mkdir /data 0771 system system + mkdir /cache 0770 system cache + mkdir /sqlite_stmt_journals 01777 root root + mount tmpfs tmpfs /sqlite_stmt_journals size=4m + + mount rootfs rootfs / ro remount + + write /proc/sys/kernel/panic_on_oops 1 + write /proc/sys/kernel/hung_task_timeout_secs 0 + write /proc/cpu/alignment 4 + write /proc/sys/kernel/sched_latency_ns 10000000 + write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000 + +# mount mtd partitions + # Mount /system rw first to give the filesystem a chance to save a checkpoint + mount yaffs2 mtd@system /system + mount yaffs2 mtd@system /system ro remount + + # We chown/chmod /data again so because mount is run as root + defaults + mount yaffs2 mtd@userdata /data nosuid nodev + chown system system /data + chmod 0771 /data + + # Same reason as /data above + mount yaffs2 mtd@cache /cache nosuid nodev + chown system cache /cache + chmod 0770 /cache + + # This may have been created by the recovery system with odd permissions + chown system system /cache/recovery + chmod 0770 /cache/recovery + +# create basic filesystem structure + mkdir /data/misc 01771 system misc + mkdir /data/misc/hcid 0770 bluetooth bluetooth + mkdir /data/local 0771 shell shell + mkdir /data/local/tmp 0771 shell shell + mkdir /data/data 0771 system system + mkdir /data/app-private 0771 system system + mkdir /data/app 0771 system system + mkdir /data/property 0700 root root + + # create dalvik-cache and double-check the perms + mkdir /data/dalvik-cache 0771 system system + chown system system /data/dalvik-cache + chmod 0771 /data/dalvik-cache + + # create the lost+found directories, so as to enforce our permissions + mkdir /data/lost+found 0770 + mkdir /cache/lost+found 0770 + + # double check the perms, in case lost+found already exists, and set owner + chown root root /data/lost+found + chmod 0770 /data/lost+found + chown root root /cache/lost+found + chmod 0770 /cache/lost+found + +on boot +# basic network init + ifup lo + hostname localhost + domainname localdomain + +# set RLIMIT_NICE to allow priorities from 19 to -20 + setrlimit 13 40 40 + +# Define the oom_adj values for the classes of processes that can be +# killed by the kernel. These are used in ActivityManagerService. + setprop ro.FOREGROUND_APP_ADJ 0 + setprop ro.VISIBLE_APP_ADJ 1 + setprop ro.SECONDARY_SERVER_ADJ 2 + setprop ro.HIDDEN_APP_MIN_ADJ 7 + setprop ro.CONTENT_PROVIDER_ADJ 14 + setprop ro.EMPTY_APP_ADJ 15 + +# Define the memory thresholds at which the above process classes will +# be killed. These numbers are in pages (4k). + setprop ro.FOREGROUND_APP_MEM 1536 + setprop ro.VISIBLE_APP_MEM 2048 + setprop ro.SECONDARY_SERVER_MEM 4096 + setprop ro.HIDDEN_APP_MEM 5120 + setprop ro.CONTENT_PROVIDER_MEM 5632 + setprop ro.EMPTY_APP_MEM 6144 + +# Write value must be consistent with the above properties. + write /sys/module/lowmemorykiller/parameters/adj 0,1,2,7,14,15 + + write /proc/sys/vm/overcommit_memory 1 + write /sys/module/lowmemorykiller/parameters/minfree 1536,2048,4096,5120,5632,6144 + + # Set init its forked children's oom_adj. + write /proc/1/oom_adj -16 + + # Permissions for System Server and daemons. + chown radio system /sys/android_power/state + chown radio system /sys/android_power/request_state + chown radio system /sys/android_power/acquire_full_wake_lock + chown radio system /sys/android_power/acquire_partial_wake_lock + chown radio system /sys/android_power/release_wake_lock + chown radio system /sys/power/state + chown radio system /sys/power/wake_lock + chown radio system /sys/power/wake_unlock + chmod 0660 /sys/power/state + chmod 0660 /sys/power/wake_lock + chmod 0660 /sys/power/wake_unlock + chown system system /sys/class/timed_output/vibrator/enable + chown system system /sys/class/leds/keyboard-backlight/brightness + chown system system /sys/class/leds/lcd-backlight/brightness + chown system system /sys/class/leds/button-backlight/brightness + chown system system /sys/class/leds/red/brightness + chown system system /sys/class/leds/green/brightness + chown system system /sys/class/leds/blue/brightness + chown system system /sys/class/leds/red/device/grpfreq + chown system system /sys/class/leds/red/device/grppwm + chown system system /sys/class/leds/red/device/blink + chown system system /sys/class/leds/red/brightness + chown system system /sys/class/leds/green/brightness + chown system system /sys/class/leds/blue/brightness + chown system system /sys/class/leds/red/device/grpfreq + chown system system /sys/class/leds/red/device/grppwm + chown system system /sys/class/leds/red/device/blink + chown system system /sys/class/timed_output/vibrator/enable + chown system system /sys/module/sco/parameters/disable_esco + chown system system /sys/kernel/ipv4/tcp_wmem_min + chown system system /sys/kernel/ipv4/tcp_wmem_def + chown system system /sys/kernel/ipv4/tcp_wmem_max + chown system system /sys/kernel/ipv4/tcp_rmem_min + chown system system /sys/kernel/ipv4/tcp_rmem_def + chown system system /sys/kernel/ipv4/tcp_rmem_max + chown root radio /proc/cmdline + +# Define TCP buffer sizes for various networks +# ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax, + setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208 + setprop net.tcp.buffersize.wifi 4095,87380,110208,4096,16384,110208 + setprop net.tcp.buffersize.umts 4094,87380,110208,4096,16384,110208 + setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040 + setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680 + + class_start default + +## Daemon processes to be run by init. +## +service console /system/bin/sh + console + +# adbd is controlled by the persist.service.adb.enable system property +service adbd /sbin/adbd + disabled + +# adbd on at boot in emulator +on property:ro.kernel.qemu=1 + start adbd + +on property:persist.service.adb.enable=1 + start adbd + +on property:persist.service.adb.enable=0 + stop adbd + +service servicemanager /system/bin/servicemanager + user system + critical + onrestart restart zygote + onrestart restart media + +service mountd /system/bin/mountd + socket mountd stream 0660 root mount + +service debuggerd /system/bin/debuggerd + +service ril-daemon /system/bin/rild + socket rild stream 660 root radio + socket rild-debug stream 660 radio system + user root + group radio cache inet misc + +service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server + socket zygote stream 666 + onrestart write /sys/android_power/request_state wake + onrestart write /sys/power/state on + +service media /system/bin/mediaserver + user media + group system audio camera graphics inet net_bt net_bt_admin + +service bootsound /system/bin/playmp3 + user media + group audio + oneshot + +service dbus /system/bin/dbus-daemon --system --nofork + socket dbus stream 660 bluetooth bluetooth + user bluetooth + group bluetooth net_bt_admin + +#STOPSHIP: disable the verbose logging +service hcid /system/bin/logwrapper /system/bin/hcid -d -s -n -f /etc/bluez/hcid.conf + socket bluetooth stream 660 bluetooth bluetooth + socket dbus_bluetooth stream 660 bluetooth bluetooth + # init.rc does not yet support applying capabilities, so run as root and + # let hcid drop uid to bluetooth with the right linux capabilities + group bluetooth net_bt_admin misc + disabled + +service hfag /system/bin/sdptool add --channel=10 HFAG + user bluetooth + group bluetooth net_bt_admin + disabled + oneshot + +service hsag /system/bin/sdptool add --channel=11 HSAG + user bluetooth + group bluetooth net_bt_admin + disabled + oneshot + +service installd /system/bin/installd + socket installd stream 600 system system + +service flash_recovery /system/bin/flash_image recovery /system/recovery.img + oneshot |