Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 28th, 2012  |  syntax: None  |  size: 31.06 KB  |  views: 3,731  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. From ccf081893274c25f108091c71624e96d914dfe0b Mon Sep 17 00:00:00 2001
  2. From: Marcus Stojcevich <mstojcevich@gmail.com>
  3. Date: Thu, 28 Jun 2012 16:36:44 -0400
  4. Subject: [PATCH] Jelly bean
  5.  
  6. ---
  7.  default.prop     |    2 +-
  8.  fstab.tuna       |   11 ++++
  9.  init.rc          |  156 +++++++++++++++++++++++++++--------------------------
  10.  init.trace.rc    |   31 +++++++++++
  11.  init.tuna.rc     |   61 ++++++++++++---------
  12.  init.tuna.usb.rc |   38 +++++++-------
  13.  init.usb.rc      |   91 +++++++++++++++++++++++++++++++
  14.  sbin/adbd        |  Bin 142656 -> 141208 bytes
  15.  ueventd.rc       |    5 +-
  16.  ueventd.tuna.rc  |    2 +-
  17.  12 files changed, 270 insertions(+), 127 deletions(-)
  18.  create mode 100644 fstab.tuna
  19.  create mode 100755 init.trace.rc
  20.  create mode 100755 init.usb.rc
  21.  
  22. diff --git a/default.prop b/default.prop
  23. index 6850326..e6cc9b4 100644
  24. --- a/default.prop
  25. +++ b/default.prop
  26. @@ -1,7 +1,7 @@
  27.  #
  28.  # ADDITIONAL_DEFAULT_PROPERTIES
  29.  #
  30. -ro.secure=0
  31. +ro.secure=1
  32.  ro.allow.mock.location=0
  33.  ro.debuggable=0
  34.  persist.sys.usb.config=mtp
  35. diff --git a/fstab.tuna b/fstab.tuna
  36. new file mode 100644
  37. index 0000000..d9b7503
  38. --- /dev/null
  39. +++ b/fstab.tuna
  40. @@ -0,0 +1,11 @@
  41. +# Android fstab file.
  42. +#<src>                                                  <mnt_point>         <type>    <mnt_flags and options>                               <fs_mgr_flags>
  43. +# The filesystem that contains the filesystem checker binary (typically /system) cannot
  44. +# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
  45. +
  46. +
  47. +/dev/block/platform/omap/omap_hsmmc.0/by-name/system    /system             ext4      ro                                                    wait
  48. +/dev/block/platform/omap/omap_hsmmc.0/by-name/efs       /factory            ext4      ro                                                    wait
  49. +/dev/block/platform/omap/omap_hsmmc.0/by-name/cache     /cache              ext4      noatime,nosuid,nodev,nomblk_io_submit,errors=panic    wait,check
  50. +/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata  /data               ext4      noatime,nosuid,nodev,nomblk_io_submit,errors=panic    wait,check,encryptable=/dev/block/platform/omap/omap_hsmmc.0/by-name/metadata
  51. +
  52. diff --git a/init.rc b/init.rc
  53. index 0510696..bb7e4ea 100755
  54. --- a/init.rc
  55. +++ b/init.rc
  56. @@ -1,3 +1,13 @@
  57. +# Copyright (C) 2012 The Android Open Source Project
  58. +#
  59. +# IMPORTANT: Do not create world writable files or directories.
  60. +# This is a common source of Android security bugs.
  61. +#
  62. +
  63. +import /init.${ro.hardware}.rc
  64. +import /init.usb.rc
  65. +import /init.trace.rc
  66. +
  67.  on early-init
  68.      # Set init and its forked children's oom_adj.
  69.      write /proc/1/oom_adj -16
  70. @@ -22,7 +32,7 @@ loglevel 3
  71.      export ANDROID_DATA /data
  72.      export ASEC_MOUNTPOINT /mnt/asec
  73.      export LOOP_MOUNTPOINT /mnt/obb
  74. -    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
  75. +    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
  76.  
  77.  # Backward compatibility
  78.      symlink /system/etc /etc
  79. @@ -68,25 +78,36 @@ loglevel 3
  80.      write /proc/sys/kernel/sched_compat_yield 1
  81.      write /proc/sys/kernel/sched_child_runs_first 0
  82.      write /proc/sys/kernel/randomize_va_space 2
  83. +    write /proc/sys/kernel/kptr_restrict 2
  84. +    write /proc/sys/kernel/dmesg_restrict 1
  85. +    write /proc/sys/vm/mmap_min_addr 32768
  86. +    write /proc/sys/kernel/sched_rt_runtime_us 950000
  87. +    write /proc/sys/kernel/sched_rt_period_us 1000000
  88.  
  89.  # Create cgroup mount points for process groups
  90.      mkdir /dev/cpuctl
  91.      mount cgroup none /dev/cpuctl cpu
  92.      chown system system /dev/cpuctl
  93.      chown system system /dev/cpuctl/tasks
  94. -    chmod 0777 /dev/cpuctl/tasks
  95. +    chmod 0660 /dev/cpuctl/tasks
  96.      write /dev/cpuctl/cpu.shares 1024
  97. -
  98. -    mkdir /dev/cpuctl/fg_boost
  99. -    chown system system /dev/cpuctl/fg_boost/tasks
  100. -    chmod 0777 /dev/cpuctl/fg_boost/tasks
  101. -    write /dev/cpuctl/fg_boost/cpu.shares 1024
  102. -
  103. -    mkdir /dev/cpuctl/bg_non_interactive
  104. -    chown system system /dev/cpuctl/bg_non_interactive/tasks
  105. -    chmod 0777 /dev/cpuctl/bg_non_interactive/tasks
  106. +    write /dev/cpuctl/cpu.rt_runtime_us 950000
  107. +    write /dev/cpuctl/cpu.rt_period_us 1000000
  108. +
  109. +    mkdir /dev/cpuctl/apps
  110. +    chown system system /dev/cpuctl/apps/tasks
  111. +    chmod 0666 /dev/cpuctl/apps/tasks
  112. +    write /dev/cpuctl/apps/cpu.shares 1024
  113. +    write /dev/cpuctl/apps/cpu.rt_runtime_us 800000
  114. +    write /dev/cpuctl/apps/cpu.rt_period_us 1000000
  115. +
  116. +    mkdir /dev/cpuctl/apps/bg_non_interactive
  117. +    chown system system /dev/cpuctl/apps/bg_non_interactive/tasks
  118. +    chmod 0666 /dev/cpuctl/apps/bg_non_interactive/tasks
  119.      # 5.0 %
  120. -    write /dev/cpuctl/bg_non_interactive/cpu.shares 52
  121. +    write /dev/cpuctl/apps/bg_non_interactive/cpu.shares 52
  122. +    write /dev/cpuctl/apps/bg_non_interactive/cpu.rt_runtime_us 700000
  123. +    write /dev/cpuctl/apps/bg_non_interactive/cpu.rt_period_us 1000000
  124.  
  125.  # Allow everybody to read the xt_qtaguid resource tracking misc dev.
  126.  # This is needed by any process that uses socket tagging.
  127. @@ -158,11 +179,17 @@ on post-fs-data
  128.      mkdir /data/misc/wifi 0770 wifi wifi
  129.      chmod 0660 /data/misc/wifi/wpa_supplicant.conf
  130.      mkdir /data/local 0751 root root
  131. +
  132. +    # For security reasons, /data/local/tmp should always be empty.
  133. +    # Do not place files or directories in /data/local/tmp
  134.      mkdir /data/local/tmp 0771 shell shell
  135.      mkdir /data/data 0771 system system
  136.      mkdir /data/app-private 0771 system system
  137. +    mkdir /data/app-asec 0700 root root
  138.      mkdir /data/app 0771 system system
  139.      mkdir /data/property 0700 root root
  140. +    mkdir /data/ssh 0750 root shell
  141. +    mkdir /data/ssh/empty 0700 root root
  142.  
  143.      # create dalvik-cache, so as to enforce our permissions
  144.      mkdir /data/dalvik-cache 0771 system system
  145. @@ -185,11 +212,6 @@ on post-fs-data
  146.      # Set indication (checked by vold) that we have finished this action
  147.      #setprop vold.post_fs_data_done 1
  148.  
  149. -    chown system system /sys/class/android_usb/android0/f_mass_storage/lun/file
  150. -    chmod 0660 /sys/class/android_usb/android0/f_mass_storage/lun/file
  151. -    chown system system /sys/class/android_usb/android0/f_rndis/ethaddr
  152. -    chmod 0660 /sys/class/android_usb/android0/f_rndis/ethaddr
  153. -
  154.  on boot
  155.  # basic network init
  156.      ifup lo
  157. @@ -201,7 +223,7 @@ on boot
  158.  
  159.  # Memory management.  Basic kernel parameters, and allow the high
  160.  # level system server to be able to adjust the kernel OOM driver
  161. -# paramters to match how it is managing things.
  162. +# parameters to match how it is managing things.
  163.      write /proc/sys/vm/overcommit_memory 1
  164.      write /proc/sys/vm/min_free_order_shift 4
  165.      chown root system /sys/module/lowmemorykiller/parameters/adj
  166. @@ -219,12 +241,34 @@ on boot
  167.      chown radio system /sys/android_power/acquire_full_wake_lock
  168.      chown radio system /sys/android_power/acquire_partial_wake_lock
  169.      chown radio system /sys/android_power/release_wake_lock
  170. -    chown radio system /sys/power/state
  171. +    chown system system /sys/power/state
  172. +    chown system system /sys/power/wakeup_count
  173.      chown radio system /sys/power/wake_lock
  174.      chown radio system /sys/power/wake_unlock
  175.      chmod 0660 /sys/power/state
  176.      chmod 0660 /sys/power/wake_lock
  177.      chmod 0660 /sys/power/wake_unlock
  178. +
  179. +    chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
  180. +    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
  181. +    chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
  182. +    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
  183. +    chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
  184. +    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
  185. +    chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
  186. +    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
  187. +    chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
  188. +    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
  189. +    chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
  190. +    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boost
  191. +    chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
  192. +    chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
  193. +    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/input_boost
  194. +
  195. +    # Assume SMP uses shared cpufreq policy for all CPUs
  196. +    chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
  197. +    chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
  198. +
  199.      chown system system /sys/class/timed_output/vibrator/enable
  200.      chown system system /sys/class/leds/keyboard-backlight/brightness
  201.      chown system system /sys/class/leds/lcd-backlight/brightness
  202. @@ -294,49 +338,6 @@ on property:vold.decrypt=trigger_shutdown_framework
  203.      class_reset late_start
  204.      class_reset main
  205.  
  206. -# Used to disable USB when switching states
  207. -on property:sys.usb.config=none
  208. -    stop adbd
  209. -    write /sys/class/android_usb/android0/enable 0
  210. -    write /sys/class/android_usb/android0/bDeviceClass 0
  211. -    setprop sys.usb.state $sys.usb.config
  212. -
  213. -# adb only USB configuration
  214. -# This should only be used during device bringup
  215. -# and as a fallback if the USB manager fails to set a standard configuration
  216. -on property:sys.usb.config=adb
  217. -    write /sys/class/android_usb/android0/enable 0
  218. -    write /sys/class/android_usb/android0/idVendor 18d1
  219. -    write /sys/class/android_usb/android0/idProduct D002
  220. -    write /sys/class/android_usb/android0/functions $sys.usb.config
  221. -    write /sys/class/android_usb/android0/enable 1
  222. -    start adbd
  223. -    setprop sys.usb.state $sys.usb.config
  224. -
  225. -# USB accessory configuration
  226. -on property:sys.usb.config=accessory
  227. -    write /sys/class/android_usb/android0/enable 0
  228. -    write /sys/class/android_usb/android0/idVendor 18d1
  229. -    write /sys/class/android_usb/android0/idProduct 2d00
  230. -    write /sys/class/android_usb/android0/functions $sys.usb.config
  231. -    write /sys/class/android_usb/android0/enable 1
  232. -    setprop sys.usb.state $sys.usb.config
  233. -
  234. -# USB accessory configuration, with adb
  235. -on property:sys.usb.config=accessory,adb
  236. -    write /sys/class/android_usb/android0/enable 0
  237. -    write /sys/class/android_usb/android0/idVendor 18d1
  238. -    write /sys/class/android_usb/android0/idProduct 2d01
  239. -    write /sys/class/android_usb/android0/functions $sys.usb.config
  240. -    write /sys/class/android_usb/android0/enable 1
  241. -    start adbd
  242. -    setprop sys.usb.state $sys.usb.config
  243. -
  244. -# Used to set USB configuration at boot and to switch the configuration
  245. -# when changing the default configuration
  246. -on property:persist.sys.usb.config=*
  247. -    setprop sys.usb.config $persist.sys.usb.config
  248. -
  249.  ## Daemon processes to be run by init.
  250.  ##
  251.  service ueventd /sbin/ueventd
  252. @@ -362,18 +363,6 @@ service adbd /sbin/adbd
  253.  on property:ro.kernel.qemu=1
  254.      start adbd
  255.  
  256. -# This property trigger has added to imitiate the previous behavior of "adb root".
  257. -# The adb gadget driver used to reset the USB bus when the adbd daemon exited,
  258. -# and the host side adb relied on this behavior to force it to reconnect with the
  259. -# new adbd instance after init relaunches it. So now we force the USB bus to reset
  260. -# here when adbd sets the service.adb.root property to 1.  We also restart adbd here
  261. -# rather than waiting for init to notice its death and restarting it so the timing
  262. -# of USB resetting and adb restarting more closely matches the previous behavior.
  263. -on property:service.adb.root=1
  264. -    write /sys/class/android_usb/android0/enable 0
  265. -    restart adbd
  266. -    write /sys/class/android_usb/android0/enable 1
  267. -
  268.  service servicemanager /system/bin/servicemanager
  269.      class core
  270.      user system
  271. @@ -393,6 +382,7 @@ service netd /system/bin/netd
  272.      class main
  273.      socket netd stream 0660 root system
  274.      socket dnsproxyd stream 0660 root inet
  275. +    socket mdns stream 0660 root system
  276.  
  277.  service debuggerd /system/bin/debuggerd
  278.      class main
  279. @@ -412,7 +402,7 @@ service surfaceflinger /system/bin/surfaceflinger
  280.  
  281.  service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
  282.      class main
  283. -    socket zygote stream 666
  284. +    socket zygote stream 660 root system
  285.      onrestart write /sys/android_power/request_state wake
  286.      onrestart write /sys/power/state on
  287.      onrestart restart media
  288. @@ -421,7 +411,7 @@ service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-sys
  289.  service drm /system/bin/drmserver
  290.      class main
  291.      user drm
  292. -    group system inet drmrpc
  293. +    group drm system inet drmrpc sdcard_r
  294.  
  295.  service media /system/bin/mediaserver
  296.      class main
  297. @@ -478,7 +468,7 @@ service mtpd /system/bin/mtpd
  298.  service keystore /system/bin/keystore /data/misc/keystore
  299.      class main
  300.      user keystore
  301. -    group keystore
  302. +    group keystore drmrpc
  303.      socket keystore stream 666
  304.  
  305.  service dumpstate /system/bin/dumpstate -s
  306. @@ -486,3 +476,15 @@ service dumpstate /system/bin/dumpstate -s
  307.      socket dumpstate stream 0660 shell log
  308.      disabled
  309.      oneshot
  310. +
  311. +service sshd /system/bin/start-ssh
  312. +    class main
  313. +    disabled
  314. +
  315. +service mdnsd /system/bin/mdnsd
  316. +    class main
  317. +    user mdnsr
  318. +    group inet net_raw
  319. +    socket mdnsd stream 0660 mdnsr inet
  320. +    disabled
  321. +    oneshot
  322. diff --git a/init.trace.rc b/init.trace.rc
  323. new file mode 100755
  324. index 0000000..1d114f5
  325. --- /dev/null
  326. +++ b/init.trace.rc
  327. @@ -0,0 +1,31 @@
  328. +## Permissions to allow system-wide tracing to the kernel trace buffer.
  329. +##
  330. +on boot
  331. +
  332. +# Allow writing to the kernel trace log.
  333. +    chmod 0222 /sys/kernel/debug/tracing/trace_marker
  334. +
  335. +# Allow the shell group to enable (some) kernel tracing.
  336. +    chown root shell /sys/kernel/debug/tracing/trace_clock
  337. +    chown root shell /sys/kernel/debug/tracing/buffer_size_kb
  338. +    chown root shell /sys/kernel/debug/tracing/options/overwrite
  339. +    chown root shell /sys/kernel/debug/tracing/events/sched/sched_switch/enable
  340. +    chown root shell /sys/kernel/debug/tracing/events/sched/sched_wakeup/enable
  341. +    chown root shell /sys/kernel/debug/tracing/events/power/cpu_frequency/enable
  342. +    chown root shell /sys/kernel/debug/tracing/events/power/cpu_idle/enable
  343. +    chown root shell /sys/kernel/debug/tracing/events/cpufreq_interactive/enable
  344. +    chown root shell /sys/kernel/debug/tracing/tracing_on
  345. +
  346. +    chmod 0664 /sys/kernel/debug/tracing/trace_clock
  347. +    chmod 0664 /sys/kernel/debug/tracing/buffer_size_kb
  348. +    chmod 0664 /sys/kernel/debug/tracing/options/overwrite
  349. +    chmod 0664 /sys/kernel/debug/tracing/events/sched/sched_switch/enable
  350. +    chmod 0664 /sys/kernel/debug/tracing/events/sched/sched_wakeup/enable
  351. +    chmod 0664 /sys/kernel/debug/tracing/events/power/cpu_frequency/enable
  352. +    chmod 0664 /sys/kernel/debug/tracing/events/power/cpu_idle/enable
  353. +    chmod 0664 /sys/kernel/debug/tracing/events/cpufreq_interactive/enable
  354. +    chmod 0664 /sys/kernel/debug/tracing/tracing_on
  355. +
  356. +# Allow only the shell group to read and truncate the kernel trace.
  357. +    chown root shell /sys/kernel/debug/tracing/trace
  358. +    chmod 0660 /sys/kernel/debug/tracing/trace
  359. diff --git a/init.tuna.rc b/init.tuna.rc
  360. index 70f1cbe..070ab1d 100755
  361. --- a/init.tuna.rc
  362. +++ b/init.tuna.rc
  363. @@ -1,14 +1,16 @@
  364.  import init.tuna.usb.rc
  365.  
  366.  on early-init
  367. -       export EXTERNAL_STORAGE /mnt/sdcard
  368. -       mkdir /mnt/sdcard 0000 system system
  369. +       export EXTERNAL_STORAGE /storage/sdcard0
  370. +       mkdir /storage 0050 system sdcard_r
  371. +       mkdir /storage/sdcard0 0000 system system
  372.         # for backwards compatibility
  373. -       symlink /mnt/sdcard /sdcard
  374. +       symlink /storage/sdcard0 /sdcard
  375. +       symlink /storage/sdcard0 /mnt/sdcard
  376.  
  377.  on post-fs-data
  378. -       # we will remap this as /mnt/sdcard with the sdcard fuse tool
  379. -       mkdir /data/media 0775 media_rw media_rw
  380. +       # we will remap this as /storage/sdcard0 with the sdcard fuse tool
  381. +       mkdir /data/media 0770 media_rw media_rw
  382.         chown media_rw media_rw /data/media
  383.         mkdir /data/misc/wifi 0770 wifi wifi
  384.         mkdir /data/misc/wifi/sockets 0770 wifi wifi
  385. @@ -23,6 +25,9 @@ on post-fs-data
  386.         mkdir /data/misc/camera 0770 media media
  387.         mkdir /data/misc/camera/R5_MVEN003_LD2_ND0_IR0_SH0_FL1_SVEN003_DCCID1044 0770 media media
  388.  
  389. +       mkdir /data/radio 0775 radio radio
  390. +       mkdir /data/radio/log 0775 radio radio
  391. +
  392.         setprop vold.post_fs_data_done 1
  393.  
  394.  # LTE
  395. @@ -36,15 +41,6 @@ on post-fs-data
  396.  on boot
  397.         mount debugfs /sys/kernel/debug /sys/kernel/debug
  398.         chmod 0666 /dev/pvrsrvkm
  399. -       setprop ro.crypto.keyfile.userdata /dev/block/platform/omap/omap_hsmmc.0/by-name/metadata
  400. -
  401. -# Lower maximum frequency when screen is off
  402. -       write /sys/devices/system/cpu/cpu0/cpufreq/screen_off_max_freq 700000
  403. -
  404. -# cpufreq interactive governor: timer 20ms, min sample 20ms, hispeed 700MHz
  405. -       write /sys/devices/system/cpu/cpufreq/interactive/timer_rate 20000
  406. -       write /sys/devices/system/cpu/cpufreq/interactive/min_sample_time 20000
  407. -       write /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq 700000
  408.  
  409.  # autosuspend root hubs immediatly after attached devices
  410.         write /sys/bus/usb/devices/usb1/power/autosuspend_delay_ms 0
  411. @@ -52,11 +48,7 @@ on boot
  412.  
  413.  on fs
  414.         mkdir /factory 0775 radio radio
  415. -       mount ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/system /system wait ro
  416. -       setprop ro.crypto.tmpfs_options size=128m,mode=0771,uid=1000,gid=1000
  417. -       mount ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/userdata /data wait noatime nosuid nodev nomblk_io_submit,errors=panic
  418. -       mount ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/cache /cache wait noatime nosuid nodev nomblk_io_submit,errors=panic
  419. -       mount ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/efs /factory wait ro
  420. +       mount_all /fstab.tuna
  421.         setprop ro.crypto.fuse_sdcard true
  422.  
  423.  # change permissions for mtd device
  424. @@ -77,8 +69,6 @@ on fs
  425.  # We chown/chmod /factory because mount is run as root + defaults
  426.         chown radio radio /factory
  427.         chmod 0775 /factory
  428. -       mkdir /data/radio 0775 radio radio
  429. -       mkdir /data/radio/log 0775 radio radio
  430.  
  431.  # add symlink for HDCP key
  432.          symlink /factory/hdcp.keys /system/vendor/firmware/hdcp.keys
  433. @@ -116,10 +106,10 @@ on fs
  434.         chown radio radio /sys/bus/usb/devices/usb1/power/control
  435.  
  436.  on property:persist.sys.tuna.off_mode=*
  437. -       write /d/pm_debug/enable_off_mode $persist.sys.tuna.off_mode
  438. +       write /d/pm_debug/enable_off_mode ${persist.sys.tuna.off_mode}
  439.  
  440.  on property:ril.modem.lte.powercontrol=*
  441. -       write /sys/bus/usb/devices/1-1/power/control $ril.modem.lte.powercontrol
  442. +       write /sys/bus/usb/devices/1-1/power/control ${ril.modem.lte.powercontrol}
  443.  
  444.  service fRom /system/bin/fRom \
  445.         -x /data/misc/camera/R5_MVEN003_LD2_ND0_IR0_SH0_FL1_SVEN003_DCCID1044 \
  446. @@ -138,7 +128,7 @@ service hciattach /system/bin/brcm_patchram_plus --enable_hci --no2bytes --enabl
  447.         disabled
  448.         oneshot
  449.  
  450. -service pvrsrvinit /vendor/bin/pvrsrvinit
  451. +service pvrsrvctl /vendor/bin/pvrsrvctl --start --no-module
  452.         class core
  453.         user root
  454.         group root
  455. @@ -167,14 +157,26 @@ service smc_pa_wvdrm /system/bin/smc_pa_ctrl \
  456.          group drmrpc
  457.          oneshot
  458.  
  459. -# create virtual SD card at /mnt/sdcard, based on the /data/media directory
  460. +# create virtual SD card at /storage/sdcard0, based on the /data/media directory
  461.  # daemon will drop to user/group system/media_rw after initializing
  462.  # underlying files in /data/media will be created with user and group media_rw (1023)
  463.  service sdcard /system/bin/sdcard /data/media 1023 1023
  464.         class late_start
  465.  
  466. +service p2p_supplicant /system/bin/wpa_supplicant \
  467. +       -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -N \
  468. +       -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf -e/data/misc/wifi/entropy.bin -puse_p2p_group_interface=1
  469. +       #   we will start as root and wpa_supplicant will switch to user wifi
  470. +       #   after setting up the capabilities required for WEXT
  471. +       #   user wifi
  472. +       #   group wifi inet keystore
  473. +       class main
  474. +       socket wpa_wlan0 dgram 660 wifi wifi
  475. +       disabled
  476. +       oneshot
  477. +
  478.  service wpa_supplicant /system/bin/wpa_supplicant \
  479. -       -Dnl80211 -iwlan0 -puse_p2p_group_interface=1 -e/data/misc/wifi/entropy.bin
  480. +       -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -e/data/misc/wifi/entropy.bin
  481.         #   we will start as root and wpa_supplicant will switch to user wifi
  482.         #   after setting up the capabilities required for WEXT
  483.         #   user wifi
  484. @@ -184,7 +186,7 @@ service wpa_supplicant /system/bin/wpa_supplicant \
  485.         disabled
  486.         oneshot
  487.  
  488. -service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL
  489. +service dhcpcd_wlan0 /system/bin/dhcpcd -aABKL
  490.         class main
  491.         disabled
  492.         oneshot
  493. @@ -199,6 +201,11 @@ service dhcpcd_bnep0 /system/bin/dhcpcd -ABKL
  494.         disabled
  495.         oneshot
  496.  
  497. +service dhcpcd_eth0 /system/bin/dhcpcd -ABKL
  498. +       class main
  499. +       disabled
  500. +       oneshot
  501. +
  502.  service iprenew_wlan0 /system/bin/dhcpcd -n
  503.         class main
  504.         disabled
  505. diff --git a/init.tuna.usb.rc b/init.tuna.usb.rc
  506. index 20bf090..e86a7bd 100755
  507. --- a/init.tuna.usb.rc
  508. +++ b/init.tuna.usb.rc
  509. @@ -1,79 +1,79 @@
  510.  on init
  511. -    write /sys/class/android_usb/android0/iSerial $ro.serialno
  512. +    write /sys/class/android_usb/android0/iSerial ${ro.serialno}
  513.      write /sys/class/android_usb/android0/f_rndis/manufacturer Samsung
  514.      write /sys/class/android_usb/android0/f_rndis/vendorID 04e8
  515.      write /sys/class/android_usb/android0/f_rndis/wceis 1
  516.  
  517.  on boot
  518. -    write /sys/class/android_usb/android0/iManufacturer $ro.product.manufacturer
  519. -    write /sys/class/android_usb/android0/iProduct $ro.product.model
  520. +    write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
  521. +    write /sys/class/android_usb/android0/iProduct ${ro.product.model}
  522.  
  523.  on property:sys.usb.config=mtp
  524.      write /sys/class/android_usb/android0/enable 0
  525.      write /sys/class/android_usb/android0/idVendor 04e8
  526.      write /sys/class/android_usb/android0/idProduct 685c
  527. -    write /sys/class/android_usb/android0/functions $sys.usb.config
  528. +    write /sys/class/android_usb/android0/functions ${sys.usb.config}
  529.      write /sys/class/android_usb/android0/enable 1
  530. -    setprop sys.usb.state $sys.usb.config
  531. +    setprop sys.usb.state ${sys.usb.config}
  532.  
  533.  on property:sys.usb.config=mtp,adb
  534.      write /sys/class/android_usb/android0/enable 0
  535.      write /sys/class/android_usb/android0/idVendor 04e8
  536.      write /sys/class/android_usb/android0/idProduct 6860
  537. -    write /sys/class/android_usb/android0/functions $sys.usb.config
  538. +    write /sys/class/android_usb/android0/functions ${sys.usb.config}
  539.      write /sys/class/android_usb/android0/enable 1
  540.      start adbd
  541. -    setprop sys.usb.state $sys.usb.config
  542. +    setprop sys.usb.state ${sys.usb.config}
  543.  
  544.  on property:sys.usb.config=rndis
  545.      write /sys/class/android_usb/android0/enable 0
  546.      write /sys/class/android_usb/android0/idVendor 04e8
  547.      write /sys/class/android_usb/android0/idProduct 6863
  548. -    write /sys/class/android_usb/android0/functions $sys.usb.config
  549. +    write /sys/class/android_usb/android0/functions ${sys.usb.config}
  550.      write /sys/class/android_usb/android0/bDeviceClass 224
  551.      write /sys/class/android_usb/android0/enable 1
  552. -    setprop sys.usb.state $sys.usb.config
  553. +    setprop sys.usb.state ${sys.usb.config}
  554.  
  555.  on property:sys.usb.config=rndis,adb
  556.      write /sys/class/android_usb/android0/enable 0
  557.      write /sys/class/android_usb/android0/idVendor 04e8
  558.      write /sys/class/android_usb/android0/idProduct 6864
  559. -    write /sys/class/android_usb/android0/functions $sys.usb.config
  560. +    write /sys/class/android_usb/android0/functions ${sys.usb.config}
  561.      write /sys/class/android_usb/android0/bDeviceClass 224
  562.      write /sys/class/android_usb/android0/enable 1
  563.      start adbd
  564. -    setprop sys.usb.state $sys.usb.config
  565. +    setprop sys.usb.state ${sys.usb.config}
  566.  
  567.  on property:sys.usb.config=ptp
  568.      write /sys/class/android_usb/android0/enable 0
  569.      write /sys/class/android_usb/android0/idVendor 04e8
  570.      write /sys/class/android_usb/android0/idProduct 6865
  571. -    write /sys/class/android_usb/android0/functions $sys.usb.config
  572. +    write /sys/class/android_usb/android0/functions ${sys.usb.config}
  573.      write /sys/class/android_usb/android0/enable 1
  574. -    setprop sys.usb.state $sys.usb.config
  575. +    setprop sys.usb.state ${sys.usb.config}
  576.  
  577.  on property:sys.usb.config=ptp,adb
  578.      write /sys/class/android_usb/android0/enable 0
  579.      write /sys/class/android_usb/android0/idVendor 04e8
  580.      write /sys/class/android_usb/android0/idProduct 6866
  581. -    write /sys/class/android_usb/android0/functions $sys.usb.config
  582. +    write /sys/class/android_usb/android0/functions ${sys.usb.config}
  583.      write /sys/class/android_usb/android0/enable 1
  584.      start adbd
  585. -    setprop sys.usb.state $sys.usb.config
  586. +    setprop sys.usb.state ${sys.usb.config}
  587.  
  588.  on property:sys.usb.config=rndis,dm
  589.      write /sys/class/android_usb/android0/enable 0
  590.      write /sys/class/android_usb/android0/idVendor 04e8
  591.      write /sys/class/android_usb/android0/idProduct 6864
  592. -    write /sys/class/android_usb/android0/functions $sys.usb.config
  593. +    write /sys/class/android_usb/android0/functions ${sys.usb.config}
  594.      write /sys/class/android_usb/android0/enable 1
  595. -    setprop sys.usb.state $sys.usb.config
  596. +    setprop sys.usb.state ${sys.usb.config}
  597.  
  598.  on property:sys.usb.config=rndis,acm,dm
  599.      write /sys/class/android_usb/android0/enable 0
  600.      write /sys/class/android_usb/android0/idVendor 04e8
  601.      write /sys/class/android_usb/android0/idProduct 6864
  602. -    write /sys/class/android_usb/android0/functions $sys.usb.config
  603. +    write /sys/class/android_usb/android0/functions ${sys.usb.config}
  604.      write /sys/class/android_usb/android0/f_acm/instances 1
  605.      write /sys/class/android_usb/android0/enable 1
  606. -    setprop sys.usb.state $sys.usb.config
  607. +    setprop sys.usb.state ${sys.usb.config}
  608. diff --git a/init.usb.rc b/init.usb.rc
  609. new file mode 100755
  610. index 0000000..15467cc
  611. --- /dev/null
  612. +++ b/init.usb.rc
  613. @@ -0,0 +1,91 @@
  614. +# Copyright (C) 2012 The Android Open Source Project
  615. +#
  616. +# USB configuration common for all android devices
  617. +#
  618. +
  619. +on post-fs-data
  620. +    chown system system /sys/class/android_usb/android0/f_mass_storage/lun/file
  621. +    chmod 0660 /sys/class/android_usb/android0/f_mass_storage/lun/file
  622. +    chown system system /sys/class/android_usb/android0/f_rndis/ethaddr
  623. +    chmod 0660 /sys/class/android_usb/android0/f_rndis/ethaddr
  624. +
  625. +# Used to disable USB when switching states
  626. +on property:sys.usb.config=none
  627. +    stop adbd
  628. +    write /sys/class/android_usb/android0/enable 0
  629. +    write /sys/class/android_usb/android0/bDeviceClass 0
  630. +    setprop sys.usb.state ${sys.usb.config}
  631. +
  632. +# adb only USB configuration
  633. +# This should only be used during device bringup
  634. +# and as a fallback if the USB manager fails to set a standard configuration
  635. +on property:sys.usb.config=adb
  636. +    write /sys/class/android_usb/android0/enable 0
  637. +    write /sys/class/android_usb/android0/idVendor 18d1
  638. +    write /sys/class/android_usb/android0/idProduct D002
  639. +    write /sys/class/android_usb/android0/functions ${sys.usb.config}
  640. +    write /sys/class/android_usb/android0/enable 1
  641. +    start adbd
  642. +    setprop sys.usb.state ${sys.usb.config}
  643. +
  644. +# USB accessory configuration
  645. +on property:sys.usb.config=accessory
  646. +    write /sys/class/android_usb/android0/enable 0
  647. +    write /sys/class/android_usb/android0/idVendor 18d1
  648. +    write /sys/class/android_usb/android0/idProduct 2d00
  649. +    write /sys/class/android_usb/android0/functions ${sys.usb.config}
  650. +    write /sys/class/android_usb/android0/enable 1
  651. +    setprop sys.usb.state ${sys.usb.config}
  652. +
  653. +# USB accessory configuration, with adb
  654. +on property:sys.usb.config=accessory,adb
  655. +    write /sys/class/android_usb/android0/enable 0
  656. +    write /sys/class/android_usb/android0/idVendor 18d1
  657. +    write /sys/class/android_usb/android0/idProduct 2d01
  658. +    write /sys/class/android_usb/android0/functions ${sys.usb.config}
  659. +    write /sys/class/android_usb/android0/enable 1
  660. +    start adbd
  661. +    setprop sys.usb.state ${sys.usb.config}
  662. +
  663. +# audio accessory configuration
  664. +on property:sys.usb.config=audio_source
  665. +    write /sys/class/android_usb/android0/enable 0
  666. +    write /sys/class/android_usb/android0/idVendor 18d1
  667. +    write /sys/class/android_usb/android0/idProduct 2d02
  668. +    write /sys/class/android_usb/android0/functions ${sys.usb.config}
  669. +    write /sys/class/android_usb/android0/enable 1
  670. +    setprop sys.usb.state ${sys.usb.config}
  671. +
  672. +# audio accessory configuration, with adb
  673. +on property:sys.usb.config=audio_source,adb
  674. +    write /sys/class/android_usb/android0/enable 0
  675. +    write /sys/class/android_usb/android0/idVendor 18d1
  676. +    write /sys/class/android_usb/android0/idProduct 2d03
  677. +    write /sys/class/android_usb/android0/functions ${sys.usb.config}
  678. +    write /sys/class/android_usb/android0/enable 1
  679. +    start adbd
  680. +    setprop sys.usb.state ${sys.usb.config}
  681. +
  682. +# USB and audio accessory configuration
  683. +on property:sys.usb.config=accessory,audio_source
  684. +    write /sys/class/android_usb/android0/enable 0
  685. +    write /sys/class/android_usb/android0/idVendor 18d1
  686. +    write /sys/class/android_usb/android0/idProduct 2d04
  687. +    write /sys/class/android_usb/android0/functions ${sys.usb.config}
  688. +    write /sys/class/android_usb/android0/enable 1
  689. +    setprop sys.usb.state ${sys.usb.config}
  690. +
  691. +# USB and audio accessory configuration, with adb
  692. +on property:sys.usb.config=accessory,audio_source,adb
  693. +    write /sys/class/android_usb/android0/enable 0
  694. +    write /sys/class/android_usb/android0/idVendor 18d1
  695. +    write /sys/class/android_usb/android0/idProduct 2d05
  696. +    write /sys/class/android_usb/android0/functions ${sys.usb.config}
  697. +    write /sys/class/android_usb/android0/enable 1
  698. +    start adbd
  699. +    setprop sys.usb.state ${sys.usb.config}
  700. +
  701. +# Used to set USB configuration at boot and to switch the configuration
  702. +# when changing the default configuration
  703. +on property:persist.sys.usb.config=*
  704. +    setprop sys.usb.config ${persist.sys.usb.config}
  705.  
  706. diff --git a/ueventd.rc b/ueventd.rc
  707. index 438cf0a..07624c4 100644
  708. --- a/ueventd.rc
  709. +++ b/ueventd.rc
  710. @@ -8,8 +8,9 @@
  711.  /dev/ashmem               0666   root       root
  712.  /dev/binder               0666   root       root
  713.  
  714. -# logger should be world writable (for logging) but not readable
  715. -/dev/log/*                0662   root       log
  716. +# Anyone can read the logs, but if they're not in the "logs"
  717. +# group, then they'll only see log entries for their UID.
  718. +/dev/log/*                0666   root       log
  719.  
  720.  # the msm hw3d client device node is world writable/readable.
  721.  /dev/msm_hw3dc            0666   root       root
  722. diff --git a/ueventd.tuna.rc b/ueventd.tuna.rc
  723. index d1a8b47..23cd5ab 100644
  724. --- a/ueventd.tuna.rc
  725. +++ b/ueventd.tuna.rc
  726. @@ -1,5 +1,5 @@
  727.  #for DSSCOMP
  728. -/dev/dsscomp              0666   system     system
  729. +/dev/dsscomp              0660   system     system
  730.  /dev/tiler                0666   system     system
  731.  
  732.  #for SYSLINK
  733. --
  734. 1.7.9.1
clone this paste RAW Paste Data