summaryrefslogtreecommitdiffstats
path: root/rootdir
diff options
context:
space:
mode:
Diffstat (limited to 'rootdir')
-rw-r--r--rootdir/init.rc81
-rw-r--r--rootdir/ueventd.rc2
2 files changed, 51 insertions, 32 deletions
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 54f4be2..0d476d4 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -19,7 +19,7 @@ loglevel 3
export ANDROID_DATA /data
export ASEC_MOUNTPOINT /mnt/asec
export LOOP_MOUNTPOINT /mnt/obb
- export BOOTCLASSPATH /system/framework/core.jar:/system/framework/apache-xml.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar
+ export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/filterfw.jar
# Backward compatibility
symlink /system/etc /etc
@@ -115,11 +115,7 @@ on post-fs
chmod 0220 /proc/sysrq-trigger
# create the lost+found directories, so as to enforce our permissions
- mkdir /cache/lost+found 0770
-
- # double check the perms, in case lost+found already exists, and set owner
- chown root root /cache/lost+found
- chmod 0770 /cache/lost+found
+ mkdir /cache/lost+found 0770 root root
on post-fs-data
# We chown/chmod /data again so because mount is run as root + defaults
@@ -129,10 +125,7 @@ on post-fs-data
# Create dump dir and collect dumps.
# Do this before we mount cache so eventually we can use cache for
# storing dumps on platforms which do not have a dedicated dump partition.
-
- mkdir /data/dontpanic
- chown root log /data/dontpanic
- chmod 0750 /data/dontpanic
+ mkdir /data/dontpanic 0750 root log
# Collect apanic data, free resources and re-arm trigger
copy /proc/apanic_console /data/dontpanic/apanic_console
@@ -150,12 +143,11 @@ on post-fs-data
mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth
mkdir /data/misc/bluetooth 0770 system system
mkdir /data/misc/keystore 0700 keystore keystore
- mkdir /data/misc/vpn 0770 system system
+ mkdir /data/misc/keychain 0771 system system
+ mkdir /data/misc/vpn 0770 system vpn
mkdir /data/misc/systemkeys 0700 system system
- mkdir /data/misc/vpn/profiles 0770 system system
# give system access to wpa_supplicant.conf for backup and restore
mkdir /data/misc/wifi 0770 wifi wifi
- chmod 0770 /data/misc/wifi
chmod 0660 /data/misc/wifi/wpa_supplicant.conf
mkdir /data/local 0771 shell shell
mkdir /data/local/tmp 0771 shell shell
@@ -164,10 +156,8 @@ on post-fs-data
mkdir /data/app 0771 system system
mkdir /data/property 0700 root root
- # create dalvik-cache and double-check the perms
+ # create dalvik-cache, so as to enforce our permissions
mkdir /data/dalvik-cache 0771 system system
- chown system system /data/dalvik-cache
- chmod 0771 /data/dalvik-cache
# create resource-cache and double-check the perms
mkdir /data/resource-cache 0771 system system
@@ -175,11 +165,7 @@ on post-fs-data
chmod 0771 /data/resource-cache
# create the lost+found directories, so as to enforce our permissions
- mkdir /data/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
+ mkdir /data/lost+found 0770 root root
# create directory for DRM plug-ins
mkdir /data/drm 0774 drm drm
@@ -190,6 +176,11 @@ on post-fs-data
# Set indication (checked by vold) that we have finished this action
#setprop vold.post_fs_data_done 1
+ chown system system /sys/class/android_usb/android0/f_mass_storage/lun/file
+ chmod 0660 /sys/class/android_usb/android0/f_mass_storage/lun/file
+ chown system system /sys/class/android_usb/android0/f_rndis/ethaddr
+ chmod 0660 /sys/class/android_usb/android0/f_rndis/ethaddr
+
on boot
# basic network init
ifup lo
@@ -329,6 +320,28 @@ on property:vold.decrypt=trigger_shutdown_framework
class_reset late_start
class_reset main
+# USB accessory configuration
+on property:sys.usb.config=accessory
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 18d1
+ write /sys/class/android_usb/android0/idProduct 2d00
+ write /sys/class/android_usb/android0/functions $sys.usb.config
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state $sys.usb.config
+
+# USB accessory configuration, with adb
+on property:sys.usb.config=accessory,adb
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 18d1
+ write /sys/class/android_usb/android0/idProduct 2d01
+ write /sys/class/android_usb/android0/functions $sys.usb.config
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state $sys.usb.config
+
+on property:persist.sys.usb.config=*
+ setprop sys.usb.config $persist.sys.usb.config
+
## Daemon processes to be run by init.
##
service ueventd /sbin/ueventd
@@ -345,7 +358,7 @@ service console /system/bin/sh
on property:ro.debuggable=1
start console
-# adbd is controlled by the persist.service.adb.enable system property
+# adbd is controlled via property triggers in init.<platform>.usb.rc
service adbd /sbin/adbd
class core
disabled
@@ -354,11 +367,17 @@ service adbd /sbin/adbd
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
+# This property trigger has added to imitiate the previous behavior of "adb root".
+# The adb gadget driver used to reset the USB bus when the adbd daemon exited,
+# and the host side adb relied on this behavior to force it to reconnect with the
+# new adbd instance after init relaunches it. So now we force the USB bus to reset
+# here when adbd sets the service.adb.root property to 1. We also restart adbd here
+# rather than waiting for init to notice its death and restarting it so the timing
+# of USB resetting and adb restarting more closely matches the previous behavior.
+on property:service.adb.root=1
+ write /sys/class/android_usb/android0/enable 0
+ restart adbd
+ write /sys/class/android_usb/android0/enable 1
service servicemanager /system/bin/servicemanager
class core
@@ -399,7 +418,6 @@ service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-sys
socket zygote stream 666
onrestart write /sys/android_power/request_state wake
onrestart write /sys/power/state on
- onrestart restart surfaceflinger
onrestart restart media
onrestart restart netd
@@ -411,7 +429,8 @@ service drm /system/bin/drmserver
service media /system/bin/mediaserver
class main
user media
- group audio camera inet net_bt net_bt_admin
+ # STOPSHIP: remove system from mediaserver groups
+ group audio camera inet net_bt net_bt_admin system
ioprio rt 4
service bootanim /system/bin/bootanimation
@@ -447,8 +466,8 @@ service flash_recovery /system/etc/install-recovery.sh
service racoon /system/bin/racoon
class main
socket racoon stream 600 system system
- # racoon will setuid to vpn after getting necessary resources.
- group net_admin
+ # IKE uses UDP port 500. Racoon will setuid to vpn after binding the port.
+ group vpn net_admin
disabled
oneshot
diff --git a/rootdir/ueventd.rc b/rootdir/ueventd.rc
index 51a4337..438cf0a 100644
--- a/rootdir/ueventd.rc
+++ b/rootdir/ueventd.rc
@@ -70,11 +70,11 @@
/dev/bus/usb/* 0660 root usb
/dev/mtp_usb 0660 root mtp
/dev/usb_accessory 0660 root usb
+/dev/tun 0660 system vpn
# CDMA radio interface MUX
/dev/ts0710mux* 0640 radio radio
/dev/ppp 0660 radio vpn
-/dev/tun 0640 vpn vpn
# sysfs properties
/sys/devices/virtual/input/input* enable 0660 root input