diff options
author | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2011-11-17 00:42:30 +0059 |
---|---|---|
committer | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2011-12-17 12:01:44 +0059 |
commit | c539b7816cce0d90aa9baca84205ddc3aa0a0653 (patch) | |
tree | 766d2f5e7b43e5eb7a21b9dc7feb7999cc06f492 | |
parent | 31b2f4414b291d87adddf13ad62d317d3ba382fa (diff) | |
download | core-c539b7816cce0d90aa9baca84205ddc3aa0a0653.tar.gz |
init.rc: Merge changes from Linaro init.rc
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
-rw-r--r-- | rootdir/init.rc | 132 |
1 files changed, 121 insertions, 11 deletions
diff --git a/rootdir/init.rc b/rootdir/init.rc index 145f642fd..dea3eb164 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -6,6 +6,7 @@ on early-init # create mountpoints mkdir /mnt 0775 root system + mkdir /mnt/sdcard 0000 system system on init @@ -20,6 +21,7 @@ loglevel 3 export ANDROID_ROOT /system export ANDROID_ASSETS /system/app export ANDROID_DATA /data + export EXTERNAL_STORAGE /mnt/sdcard export ASEC_MOUNTPOINT /mnt/asec export LOOP_MOUNTPOINT /mnt/obb 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 @@ -37,6 +39,9 @@ loglevel 3 mount cgroup none /acct cpuacct mkdir /acct/uid +# Backwards Compat (no longer there in stock ICS) + symlink /mnt/sdcard /sdcard + mkdir /system mkdir /data 0771 system system mkdir /cache 0770 system cache @@ -93,16 +98,18 @@ loglevel 3 chmod 0644 /dev/xt_qtaguid on fs -# 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 - mount yaffs2 mtd@userdata /data nosuid nodev - mount yaffs2 mtd@cache /cache nosuid nodev +# mount mmc partitions +# mmcblk0p1: /boot + mount ext4 /dev/block/mmcblk0p2 /system ro + mount ext4 /dev/block/mmcblk0p3 /cache +# mmcblk0p4: extended partition container + mount ext4 /dev/block/mmcblk0p5 /data +# mmcblk0p6: /sdcard on post-fs # once everything is setup, no need to modify / - mount rootfs rootfs / ro remount + # (stock ICS uses ro remount, let's not do that while debugging) + mount rootfs rootfs / rw remount # We chown/chmod /cache again so because mount is run as root + defaults chown system cache /cache @@ -130,9 +137,13 @@ on post-fs-data chown system system /data chmod 0771 /data + # Set access for camera + chmod 0666 /dev/video0 + # 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 0750 root log # Collect apanic data, free resources and re-arm trigger @@ -154,6 +165,7 @@ on post-fs-data 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 0660 /data/misc/wifi/wpa_supplicant.conf @@ -164,8 +176,14 @@ on post-fs-data mkdir /data/app 0771 system system mkdir /data/property 0700 root root - # create dalvik-cache, so as to enforce our permissions + # Setup paths used for socket communication with the dhcp daemon(dhcpd) + mkdir /data/misc/dhcp 0770 dhcp dhcp + chown dhcp dhcp /data/misc/dhcp + + # 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 resource-cache and double-check the perms mkdir /data/resource-cache 0771 system system @@ -174,10 +192,17 @@ on post-fs-data # create the lost+found directories, so as to enforce our permissions mkdir /data/lost+found 0770 root root + mkdir /cache/lost+found 0770 root root # create directory for DRM plug-ins mkdir /data/drm 0774 drm drm + # 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 + # If there is no fs-post-data action in the init.<device>.rc file, you # must uncomment this line, otherwise encrypted filesystems # won't work. @@ -198,16 +223,57 @@ on boot # 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.PERCEPTIBLE_APP_ADJ 2 + setprop ro.HEAVY_WEIGHT_APP_ADJ 3 + setprop ro.SECONDARY_SERVER_ADJ 4 + setprop ro.BACKUP_APP_ADJ 5 + setprop ro.HOME_APP_ADJ 6 + setprop ro.HIDDEN_APP_MIN_ADJ 7 + 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 2048 + setprop ro.VISIBLE_APP_MEM 3072 + setprop ro.PERCEPTIBLE_APP_MEM 4096 + setprop ro.HEAVY_WEIGHT_APP_MEM 4096 + setprop ro.SECONDARY_SERVER_MEM 6144 + setprop ro.BACKUP_APP_MEM 6144 + setprop ro.HOME_APP_MEM 6144 + setprop ro.HIDDEN_APP_MEM 7168 + setprop ro.EMPTY_APP_MEM 8192 + +# Write value must be consistent with the above properties. +# Note that the driver only supports 6 slots, so we have combined some of +# the classes into the same memory level; the associated processes of higher +# classes will still be killed first. + write /sys/module/lowmemorykiller/parameters/adj 0,1,2,4,7,15 + # Memory management. Basic kernel parameters, and allow the high # level system server to be able to adjust the kernel OOM driver # paramters to match how it is managing things. write /proc/sys/vm/overcommit_memory 1 write /proc/sys/vm/min_free_order_shift 4 + write /sys/module/lowmemorykiller/parameters/minfree 2048,3072,4096,6144,7168,8192 + chown root system /sys/module/lowmemorykiller/parameters/adj chmod 0664 /sys/module/lowmemorykiller/parameters/adj chown root system /sys/module/lowmemorykiller/parameters/minfree chmod 0664 /sys/module/lowmemorykiller/parameters/minfree + #userspace configuration for adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/functions adb,acm + write /sys/class/android_usb/android0/f_acm/instances 2 + write /sys/class/android_usb/android0/enable 1 + + # Set init its forked children's oom_adj. + write /proc/1/oom_score_adj -16 + # Tweak background writeout write /proc/sys/vm/dirty_expire_centisecs 200 write /proc/sys/vm/dirty_background_ratio 5 @@ -336,6 +402,7 @@ on property:sys.usb.config=accessory,adb 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,14 +412,17 @@ service ueventd /sbin/ueventd service console /system/bin/sh class core console - disabled - user shell + #disabled + #user shell group log on property:ro.debuggable=1 start console -# adbd is controlled via property triggers in init.<platform>.usb.rc +#on property:ro.secure=0 +# start console + +# adbd is controlled by the persist.service.adb.enable system property service adbd /sbin/adbd class core disabled @@ -361,6 +431,18 @@ 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 + +service dhcpcd_eth0 /system/bin/dhcpcd -dABKL + class main + group dhcp + disabled + oneshot + # 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 @@ -450,6 +532,34 @@ service bluetoothd /system/bin/bluetoothd -n group bluetooth net_bt_admin misc disabled +service hfag /system/bin/sdptool add --channel=10 HFAG + class main + user bluetooth + group bluetooth net_bt_admin + disabled + oneshot + +service hsag /system/bin/sdptool add --channel=11 HSAG + class main + user bluetooth + group bluetooth net_bt_admin + disabled + oneshot + +service opush /system/bin/sdptool add --channel=12 OPUSH + class main + user bluetooth + group bluetooth net_bt_admin + disabled + oneshot + +service pbap /system/bin/sdptool add --channel=19 PBAP + class main + user bluetooth + group bluetooth net_bt_admin + disabled + oneshot + service installd /system/bin/installd class main socket installd stream 600 system system |