SHARE
TWEET

XPERIA Z (SO-02E) init.rc (10.1.D.0.317)

huhka_com Feb 10th, 2013 291 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Copyright (C) 2012 The Android Open Source Project
  2. # Copyright (C) 2011 Sony Ericsson Mobile Communications AB.
  3. # Copyright (C) 2012 Sony Mobile Communications AB.
  4. #
  5. # IMPORTANT: Do not create world writable files or directories.
  6. # This is a common source of Android security bugs.
  7. #
  8.  
  9. import /init.${ro.hardware}.rc
  10. import /init.usb.rc
  11. import /init.trace.rc
  12.  
  13. on early-init
  14.     # Set init and its forked children's oom_adj.
  15.     write /proc/1/oom_adj -16
  16.  
  17.     start ueventd
  18.  
  19. # create mountpoints
  20.     mkdir /mnt 0775 root system
  21.  
  22. on init
  23.  
  24. sysclktz 0
  25.  
  26. loglevel 3
  27.  
  28. # setup the global environment
  29.     export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
  30.     export LD_LIBRARY_PATH /vendor/lib:/system/lib
  31.     export ANDROID_BOOTLOGO 1
  32.     export ANDROID_ROOT /system
  33.     export ANDROID_ASSETS /system/app
  34.     export ANDROID_DATA /data
  35.     export ASEC_MOUNTPOINT /mnt/asec
  36.     export LOOP_MOUNTPOINT /mnt/obb
  37.     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/framework_ext.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar
  38.  
  39. # Backward compatibility
  40.     symlink /system/etc /etc
  41.     symlink /sys/kernel/debug /d
  42.  
  43. # Right now vendor lives on the same filesystem as system,
  44. # but someday that may change.
  45.     symlink /system/vendor /vendor
  46.  
  47. # Create cgroup mount point for cpu accounting
  48.     mkdir /acct
  49.     mount cgroup none /acct cpuacct
  50.     mkdir /acct/uid
  51.  
  52.     mkdir /system
  53.     mkdir /data 0771 system system
  54.     mkdir /cache 0770 system cache
  55.     mkdir /config 0500 root root
  56.  
  57.     # See storage config details at http://source.android.com/tech/storage/
  58.     mkdir /storage 0050 root sdcard_r
  59.  
  60.     # Directory for putting things only root should see.
  61.     mkdir /mnt/secure 0700 root root
  62.  
  63.     # Directory for staging bindmounts
  64.     mkdir /mnt/secure/staging 0700 root root
  65.  
  66.     # Directory-target for where the secure container
  67.     # imagefile directory will be bind-mounted
  68.     mkdir /mnt/secure/asec  0700 root root
  69.  
  70.     # Secure container public mount points.
  71.     mkdir /mnt/asec  0700 root system
  72.     mount tmpfs tmpfs /mnt/asec mode=0755,gid=1000
  73.  
  74.     # Filesystem image public mount points.
  75.     mkdir /mnt/obb 0700 root system
  76.     mount tmpfs tmpfs /mnt/obb mode=0755,gid=1000
  77.  
  78.     write /proc/sys/kernel/panic_on_oops 1
  79.     write /proc/sys/kernel/hung_task_timeout_secs 0
  80.     write /proc/cpu/alignment 4
  81.     write /proc/sys/kernel/sched_latency_ns 10000000
  82.     write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
  83.     write /proc/sys/kernel/sched_compat_yield 1
  84.     write /proc/sys/kernel/sched_child_runs_first 0
  85.     write /proc/sys/kernel/randomize_va_space 2
  86.     write /proc/sys/kernel/kptr_restrict 2
  87.     write /proc/sys/kernel/dmesg_restrict 1
  88.     write /proc/sys/vm/mmap_min_addr 32768
  89.     write /proc/sys/kernel/sched_rt_runtime_us 950000
  90.     write /proc/sys/kernel/sched_rt_period_us 1000000
  91.  
  92. # Create cgroup mount points for process groups
  93.     mkdir /dev/cpuctl
  94.     mount cgroup none /dev/cpuctl cpu
  95.     chown system system /dev/cpuctl
  96.     chown system system /dev/cpuctl/tasks
  97.     chmod 0660 /dev/cpuctl/tasks
  98.     write /dev/cpuctl/cpu.shares 1024
  99.     write /dev/cpuctl/cpu.rt_runtime_us 950000
  100.     write /dev/cpuctl/cpu.rt_period_us 1000000
  101.  
  102.     mkdir /dev/cpuctl/apps
  103.     chown system system /dev/cpuctl/apps/tasks
  104.     chmod 0666 /dev/cpuctl/apps/tasks
  105.     write /dev/cpuctl/apps/cpu.shares 1024
  106.     write /dev/cpuctl/apps/cpu.rt_runtime_us 800000
  107.     write /dev/cpuctl/apps/cpu.rt_period_us 1000000
  108.  
  109.     mkdir /dev/cpuctl/apps/bg_non_interactive
  110.     chown system system /dev/cpuctl/apps/bg_non_interactive/tasks
  111.     chmod 0666 /dev/cpuctl/apps/bg_non_interactive/tasks
  112.     # 5.0 %
  113.     write /dev/cpuctl/apps/bg_non_interactive/cpu.shares 52
  114.     write /dev/cpuctl/apps/bg_non_interactive/cpu.rt_runtime_us 700000
  115.     write /dev/cpuctl/apps/bg_non_interactive/cpu.rt_period_us 1000000
  116.  
  117. # Allow everybody to read the xt_qtaguid resource tracking misc dev.
  118. # This is needed by any process that uses socket tagging.
  119.     chmod 0644 /dev/xt_qtaguid
  120.  
  121. on fs
  122. # mount mtd partitions
  123.     # Mount /system rw first to give the filesystem a chance to save a checkpoint
  124.     mount yaffs2 mtd@system /system
  125.     mount yaffs2 mtd@system /system ro remount
  126.     mount yaffs2 mtd@userdata /data nosuid nodev
  127.     mount yaffs2 mtd@cache /cache nosuid nodev
  128.  
  129. on post-fs
  130.     # once everything is setup, no need to modify /
  131.     mount rootfs rootfs / ro remount
  132.  
  133.     # We chown/chmod /cache again so because mount is run as root + defaults
  134.     chown system cache /cache
  135.     chmod 0770 /cache
  136.  
  137.     # This may have been created by the recovery system with odd permissions
  138.     mkdir /cache/recovery
  139.     chown system cache /cache/recovery
  140.     chmod 0770 /cache/recovery
  141.  
  142.     #change permissions on vmallocinfo so we can grab it from bugreports
  143.     chown root log /proc/vmallocinfo
  144.     chmod 0440 /proc/vmallocinfo
  145.  
  146.     #change permissions on kmsg & sysrq-trigger so bugreports can grab kthread stacks
  147.     chown root system /proc/kmsg
  148.     chmod 0440 /proc/kmsg
  149.     chown root system /proc/sysrq-trigger
  150.     chmod 0220 /proc/sysrq-trigger
  151.  
  152.     # create the lost+found directories, so as to enforce our permissions
  153.     mkdir /cache/lost+found 0770 root root
  154.  
  155. on post-fs-data
  156.     # We chown/chmod /data again so because mount is run as root + defaults
  157.     chown system system /data
  158.     chmod 0771 /data
  159.  
  160.     # Create dump dir and collect dumps.
  161.     # Do this before we mount cache so eventually we can use cache for
  162.     # storing dumps on platforms which do not have a dedicated dump partition.
  163.     mkdir /data/dontpanic 0750 root log
  164.  
  165.     # Collect apanic data, free resources and re-arm trigger
  166.     copy /proc/apanic_console /data/dontpanic/apanic_console
  167.     chown root log /data/dontpanic/apanic_console
  168.     chmod 0640 /data/dontpanic/apanic_console
  169.  
  170.     copy /proc/apanic_threads /data/dontpanic/apanic_threads
  171.     chown root log /data/dontpanic/apanic_threads
  172.     chmod 0640 /data/dontpanic/apanic_threads
  173.  
  174.     write /proc/apanic_console 1
  175.  
  176.     # create basic filesystem structure
  177.     mkdir /data/misc 01771 system misc
  178.     mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth
  179.     mkdir /data/misc/bluetooth 0770 system system
  180.     mkdir /data/misc/keystore 0700 keystore keystore
  181.     mkdir /data/misc/keychain 0771 system system
  182.     mkdir /data/misc/vpn 0770 system vpn
  183.     mkdir /data/misc/systemkeys 0700 system system
  184.     # give system access to wpa_supplicant.conf for backup and restore
  185.     mkdir /data/misc/wifi 0770 wifi wifi
  186.     chmod 0660 /data/misc/wifi/wpa_supplicant.conf
  187.     mkdir /data/local 0751 root root
  188.     chmod 2770 /data/radio
  189.  
  190.     # For security reasons, /data/local/tmp should always be empty.
  191.     # Do not place files or directories in /data/local/tmp
  192.     mkdir /data/local/tmp 0771 shell shell
  193.     mkdir /data/data 0771 system system
  194.     mkdir /data/app-private 0771 system system
  195.     mkdir /data/app-asec 0700 root root
  196.     mkdir /data/app 0771 system system
  197.     mkdir /data/property 0700 root root
  198.     mkdir /data/ssh 0750 root shell
  199.     mkdir /data/ssh/empty 0700 root root
  200.  
  201.     # create dalvik-cache, so as to enforce our permissions
  202.     mkdir /data/dalvik-cache 0771 system system
  203.  
  204.     # create resource-cache and double-check the perms
  205.     mkdir /data/resource-cache 0771 system system
  206.     chown system system /data/resource-cache
  207.     chmod 0771 /data/resource-cache
  208.  
  209.     # create the lost+found directories, so as to enforce our permissions
  210.     mkdir /data/lost+found 0770 root root
  211.  
  212.     # create directory for DRM plug-ins - give drm the read/write access to
  213.     # the following directory.
  214.     mkdir /data/drm 0770 drm drm
  215.  
  216.     # If there is no fs-post-data action in the init.<device>.rc file, you
  217.     # must uncomment this line, otherwise encrypted filesystems
  218.     # won't work.
  219.     # Set indication (checked by vold) that we have finished this action
  220.     #setprop vold.post_fs_data_done 1
  221.  
  222. on boot
  223. # basic network init
  224.     ifup lo
  225.     hostname localhost
  226.     domainname localdomain
  227.  
  228. # set RLIMIT_NICE to allow priorities from 19 to -20
  229.     setrlimit 13 40 40
  230.  
  231. # Memory management.  Basic kernel parameters, and allow the high
  232. # level system server to be able to adjust the kernel OOM driver
  233. # parameters to match how it is managing things.
  234.     write /proc/sys/vm/overcommit_memory 1
  235.     write /proc/sys/vm/min_free_order_shift 4
  236.     chown root system /sys/module/lowmemorykiller/parameters/adj
  237.     chmod 0664 /sys/module/lowmemorykiller/parameters/adj
  238.     chown root system /sys/module/lowmemorykiller/parameters/minfree
  239.     chmod 0664 /sys/module/lowmemorykiller/parameters/minfree
  240.  
  241.     # Tweak background writeout
  242.     write /proc/sys/vm/dirty_expire_centisecs 200
  243.     write /proc/sys/vm/dirty_background_ratio  5
  244.  
  245.     # Permissions for System Server and daemons.
  246.     chown radio system /sys/android_power/state
  247.     chown radio system /sys/android_power/request_state
  248.     chown radio system /sys/android_power/acquire_full_wake_lock
  249.     chown radio system /sys/android_power/acquire_partial_wake_lock
  250.     chown radio system /sys/android_power/release_wake_lock
  251.     chown system system /sys/power/state
  252.     chown system system /sys/power/autosleep
  253.     chown system system /sys/power/wakeup_count
  254.     chown radio system /sys/power/wake_lock
  255.     chown radio system /sys/power/wake_unlock
  256.     chmod 0660 /sys/power/state
  257.     chmod 0660 /sys/power/wake_lock
  258.     chmod 0660 /sys/power/wake_unlock
  259.  
  260.     chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
  261.     chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
  262.     chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
  263.     chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
  264.     chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
  265.     chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
  266.     chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
  267.     chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
  268.     chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
  269.     chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
  270.     chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
  271.     chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boost
  272.     chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
  273.     chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
  274.     chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/input_boost
  275.  
  276.     # Assume SMP uses shared cpufreq policy for all CPUs
  277.     chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
  278.     chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
  279.  
  280.     chown system system /sys/class/timed_output/vibrator/enable
  281.     chown system system /sys/class/leds/keyboard-backlight/brightness
  282.     chown system system /sys/class/leds/lcd-backlight/brightness
  283.     chown system system /sys/class/leds/button-backlight/brightness
  284.     chown system system /sys/class/leds/jogball-backlight/brightness
  285.     chown system system /sys/class/leds/red/brightness
  286.     chown system system /sys/class/leds/green/brightness
  287.     chown system system /sys/class/leds/blue/brightness
  288.     chown system system /sys/class/leds/red/device/grpfreq
  289.     chown system system /sys/class/leds/red/device/grppwm
  290.     chown system system /sys/class/leds/red/device/blink
  291.     chown system system /sys/class/leds/red/brightness
  292.     chown system system /sys/class/leds/green/brightness
  293.     chown system system /sys/class/leds/blue/brightness
  294.     chown system system /sys/class/leds/red/device/grpfreq
  295.     chown system system /sys/class/leds/red/device/grppwm
  296.     chown system system /sys/class/leds/red/device/blink
  297.     chown system system /sys/class/timed_output/vibrator/enable
  298.     chown system system /sys/module/sco/parameters/disable_esco
  299.     chown system system /sys/kernel/ipv4/tcp_wmem_min
  300.     chown system system /sys/kernel/ipv4/tcp_wmem_def
  301.     chown system system /sys/kernel/ipv4/tcp_wmem_max
  302.     chown system system /sys/kernel/ipv4/tcp_rmem_min
  303.     chown system system /sys/kernel/ipv4/tcp_rmem_def
  304.     chown system system /sys/kernel/ipv4/tcp_rmem_max
  305.     chown root radio /proc/cmdline
  306.  
  307. # Define TCP buffer sizes for various networks
  308. #   ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
  309.     setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
  310.     setprop net.tcp.buffersize.wifi    524288,1048576,2097152,262144,524288,1048576
  311.     setprop net.tcp.buffersize.lte     4094,87380,1220608,4096,16384,1220608
  312.     setprop net.tcp.buffersize.umts    4094,87380,110208,4096,16384,110208
  313.     setprop net.tcp.buffersize.hspa    4094,87380,1220608,4096,16384,1220608
  314.     setprop net.tcp.buffersize.hsupa   4094,87380,1220608,4096,16384,1220608
  315.     setprop net.tcp.buffersize.hsdpa   4094,87380,1220608,4096,16384,1220608
  316.     setprop net.tcp.buffersize.edge    4093,26280,35040,4096,16384,35040
  317.     setprop net.tcp.buffersize.gprs    4092,8760,11680,4096,8760,11680
  318.     setprop net.tcp.buffersize.evdo_b  4094,87380,262144,4096,16384,262144
  319.  
  320. # Assign TCP buffer thresholds to be ceiling value of technology maximums
  321. # Increased technology maximums should be reflected here.
  322.     write /proc/sys/net/core/rmem_max  2097152
  323.     write /proc/sys/net/core/wmem_max  1220608
  324.  
  325. # Set this property so surfaceflinger is not started by system_init
  326.     setprop system_init.startsurfaceflinger 0
  327.  
  328.     class_start core
  329.     class_start main
  330.  
  331. on nonencrypted
  332.     class_start late_start
  333.  
  334. on charger
  335.     class_start charger
  336.  
  337. on property:vold.decrypt=trigger_reset_main
  338.     class_reset main
  339.  
  340. on property:vold.decrypt=trigger_load_persist_props
  341.     load_persist_props
  342.  
  343. on property:vold.decrypt=trigger_post_fs_data
  344.     trigger post-fs-data
  345.  
  346. on property:vold.decrypt=trigger_restart_min_framework
  347.     class_start main
  348.  
  349. on property:vold.decrypt=trigger_restart_framework
  350.     class_start main
  351.     class_start late_start
  352.  
  353. on property:vold.decrypt=trigger_shutdown_framework
  354.     class_reset late_start
  355.     class_reset main
  356.  
  357. ## Daemon processes to be run by init.
  358. ##
  359. service ueventd /sbin/ueventd
  360.     class core
  361.     critical
  362.  
  363. service console /system/bin/sh
  364.     class core
  365.     console
  366.     disabled
  367.     user shell
  368.     group log
  369.  
  370. on property:ro.debuggable=1
  371.     start console
  372.  
  373. # adbd is controlled via property triggers in init.<platform>.usb.rc
  374. service adbd /sbin/adbd
  375.     class core
  376.     disabled
  377.  
  378. # adbd on at boot in emulator
  379. on property:ro.kernel.qemu=1
  380.     start adbd
  381.  
  382. service servicemanager /system/bin/servicemanager
  383.     class core
  384.     user system
  385.     group system
  386.     critical
  387.     onrestart exec /system/bin/sync
  388.     onrestart write /proc/sysrq-trigger c
  389.  
  390. service vold /system/bin/vold
  391.     class core
  392.     socket vold stream 0660 root mount
  393.     ioprio be 2
  394.  
  395. service netd /system/bin/netd
  396.     class main
  397.     socket netd stream 0660 root system
  398.     socket dnsproxyd stream 0660 root inet
  399.     socket mdns stream 0660 root system
  400.  
  401. service debuggerd /system/bin/debuggerd
  402.     class main
  403.  
  404. service ril-daemon /system/bin/rild
  405.     class main
  406.     socket rild stream 660 root radio
  407.     socket rild-debug stream 660 radio system
  408.     user root
  409.     group radio cache inet misc audio sdcard_r sdcard_rw qcom_oncrpc diag qcom_diag log
  410.  
  411. service surfaceflinger /system/bin/surfaceflinger
  412.     class main
  413.     user system
  414.     group graphics
  415.     onrestart exec /system/bin/sync
  416.     onrestart write /proc/sysrq-trigger c
  417.  
  418. service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
  419.     class main
  420.     socket zygote stream 660 root system
  421.     onrestart exec /system/bin/sync
  422.     onrestart write /proc/sysrq-trigger c
  423.  
  424. service drm /system/bin/drmserver
  425.     class main
  426.     user drm
  427.     group drm system inet drmrpc sdcard_r media_rw
  428.  
  429. service media /system/bin/mediaserver
  430.     class main
  431.     user media
  432.     group system audio camera inet net_bt net_bt_admin net_bw_acct drmrpc input qcom_diag
  433.     ioprio rt 4
  434.  
  435. service bootanim /system/bin/bootanimation
  436.     class main
  437.     user graphics
  438.     group graphics
  439.     disabled
  440.     oneshot
  441.  
  442. service dbus /system/bin/dbus-daemon --system --nofork
  443.     class main
  444.     socket dbus stream 660 bluetooth bluetooth
  445.     user bluetooth
  446.     group bluetooth net_bt_admin
  447.  
  448. service bluetoothd /system/bin/logwrapper /system/bin/bluetoothd -n
  449.     class main
  450.     socket bluetooth stream 660 bluetooth bluetooth
  451.     socket dbus_bluetooth stream 660 bluetooth bluetooth
  452.     # init.rc does not yet support applying capabilities, so run as root and
  453.     # let bluetoothd drop uid to bluetooth with the right linux capabilities
  454.     group bluetooth net_bt_admin misc
  455.     disabled
  456.  
  457. service installd /system/bin/installd
  458.     class main
  459.     socket installd stream 600 system system
  460.  
  461. service flash_recovery /system/etc/install-recovery.sh
  462.     class main
  463.     oneshot
  464.  
  465. service racoon /system/bin/racoon
  466.     class main
  467.     socket racoon stream 600 system system
  468.     # IKE uses UDP port 500. Racoon will setuid to vpn after binding the port.
  469.     group vpn net_admin inet
  470.     disabled
  471.     oneshot
  472.  
  473. service mtpd /system/bin/mtpd
  474.     class main
  475.     socket mtpd stream 600 system system
  476.     user vpn
  477.     group vpn net_admin inet net_raw
  478.     disabled
  479.     oneshot
  480.  
  481. service keystore /system/bin/keystore /data/misc/keystore
  482.     class main
  483.     user keystore
  484.     group keystore drmrpc
  485.     socket keystore stream 666
  486.  
  487. service dumpstate /system/bin/dumpstate -s
  488.     class main
  489.     socket dumpstate stream 0660 shell log
  490.     disabled
  491.     oneshot
  492.  
  493. service sshd /system/bin/start-ssh
  494.     class main
  495.     disabled
  496.  
  497. service mdnsd /system/bin/mdnsd
  498.     class main
  499.     user mdnsr
  500.     group inet net_raw
  501.     socket mdnsd stream 0660 mdnsr inet
  502.     disabled
  503.     oneshot
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top