Advertisement
neochapay

Untitled

Oct 7th, 2016
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 24.60 KB | None | 0 0
  1. diff -Naur -X ignore droid/system/core/debuggerd/tombstone.cpp droid_cm12/system/core/debuggerd/tombstone.cpp
  2. --- droid/system/core/debuggerd/tombstone.cpp   2016-08-24 10:01:33.000000000 +0300
  3. +++ droid_cm12/system/core/debuggerd/tombstone.cpp  2016-08-22 13:13:09.000000000 +0300
  4. @@ -744,26 +744,7 @@
  5.    log.crashed_tid = tid;
  6.    int fd = -1;
  7.  
  8. -  if ((mkdir(TOMBSTONE_DIR, 0755) == -1) && (errno != EEXIST)) {
  9. -    _LOG(&log, logtype::ERROR, "failed to create %s: %s\n", TOMBSTONE_DIR, strerror(errno));
  10. -  }
  11. -  if(((fd = open(TOMBSTONE_DIR, O_NOFOLLOW|O_RDONLY)) != -1) ||((fd = open(TOMBSTONE_DIR, O_NOFOLLOW|O_WRONLY)) != -1)){
  12. -    if (fchown(fd, AID_SYSTEM, AID_SYSTEM) < 0){
  13. -       _LOG(&log, logtype::ERROR, "failed to change ownership of %s: %s\n", TOMBSTONE_DIR, strerror(errno));
  14. -       close(fd);
  15. -       return NULL;
  16. -    }
  17. -    close(fd);
  18. -  } else {
  19. -    _LOG(&log, logtype::ERROR, "failed to open %s: %s\n", TOMBSTONE_DIR, strerror(errno));
  20. -    return NULL;
  21. -  }
  22. -  char* path = NULL;
  23. -  if (selinux_android_restorecon(TOMBSTONE_DIR, 0) == 0) {
  24. -    path = find_and_open_tombstone(&fd);
  25. -  } else {
  26. -    _LOG(&log, logtype::ERROR, "Failed to restore security context, not writing tombstone.\n");
  27. -  }
  28. +  char* path = find_and_open_tombstone(&fd);
  29.  
  30.    if (fd < 0) {
  31.      _LOG(&log, logtype::ERROR, "Skipping tombstone write, nothing to do.\n");
  32. diff -Naur -X ignore droid/system/core/healthd/healthd_mode_charger.cpp droid_cm12/system/core/healthd/healthd_mode_charger.cpp
  33. --- droid/system/core/healthd/healthd_mode_charger.cpp  2016-08-24 10:01:33.000000000 +0300
  34. +++ droid_cm12/system/core/healthd/healthd_mode_charger.cpp 2016-08-22 13:13:09.000000000 +0300
  35. @@ -733,6 +733,8 @@
  36.                     accordingly. */
  37.                  if (property_get_bool("ro.enable_boot_charger_mode", false)) {
  38.                      LOGW("[%" PRId64 "] booting from charger mode\n", now);
  39. +                    set_backlight(false);
  40. +                    gr_fb_blank(true);
  41.                      property_set("sys.boot_from_charger_mode", "1");
  42.                  } else {
  43.                      LOGW("[%" PRId64 "] rebooting\n", now);
  44. diff -Naur -X ignore droid/system/core/init/bootchart.c droid_cm12/system/core/init/bootchart.c
  45. --- droid/system/core/init/bootchart.c  2016-08-24 10:01:33.000000000 +0300
  46. +++ droid_cm12/system/core/init/bootchart.c 2016-08-22 13:13:09.000000000 +0300
  47. @@ -32,6 +32,7 @@
  48.  #include <errno.h>
  49.  #include <stdlib.h>
  50.  #include <sys/stat.h>
  51. +#include <selinux/android.h>
  52.  #include "bootchart.h"
  53.  
  54.  #define VERSION         "0.8"
  55. @@ -332,6 +333,7 @@
  56.      count = (timeout*1000 + BOOTCHART_POLLING_MS-1)/BOOTCHART_POLLING_MS;
  57.  
  58.      do {ret=mkdir(LOG_ROOT,0755);}while (ret < 0 && errno == EINTR);
  59. +    selinux_android_restorecon(LOG_ROOT, 0);
  60.  
  61.      file_buff_open(log_stat,  LOG_STAT);
  62.      file_buff_open(log_procs, LOG_PROCS);
  63. diff -Naur -X ignore droid/system/core/init/bootchart.h droid_cm12/system/core/init/bootchart.h
  64. --- droid/system/core/init/bootchart.h  2016-08-24 10:01:33.000000000 +0300
  65. +++ droid_cm12/system/core/init/bootchart.h 2016-08-22 13:13:09.000000000 +0300
  66. @@ -26,6 +26,7 @@
  67.  extern int   bootchart_init(void);
  68.  extern int   bootchart_step(void);
  69.  extern void  bootchart_finish(void);
  70. +extern int   bootchart_init_action(int nargs, char **args);
  71.  
  72.  # define BOOTCHART_POLLING_MS   200   /* polling period in ms */
  73.  # define BOOTCHART_DEFAULT_TIME_SEC    (2*60)  /* default polling time in seconds */
  74. diff -Naur -X ignore droid/system/core/init/builtins.c droid_cm12/system/core/init/builtins.c
  75. --- droid/system/core/init/builtins.c   2016-08-24 10:01:33.000000000 +0300
  76. +++ droid_cm12/system/core/init/builtins.c  2016-08-22 13:13:09.000000000 +0300
  77. @@ -49,6 +49,10 @@
  78.  
  79.  #include <private/android_filesystem_config.h>
  80.  
  81. +#if BOOTCHART
  82. +#include "bootchart.h"
  83. +#endif
  84. +
  85.  int add_environment(const char *name, const char *value);
  86.  
  87.  extern int init_module(void *, unsigned long, const char *);
  88. @@ -622,8 +626,12 @@
  89.           * not booting into ffbm then trigger that action.
  90.           */
  91.          property_get("ro.bootmode", boot_mode);
  92. -        if (strncmp(boot_mode, "ffbm", 4))
  93. +        if (strncmp(boot_mode, "ffbm", 4)) {
  94. +#if BOOTCHART
  95. +            queue_builtin_action(bootchart_init_action, "bootchart_init");
  96. +#endif
  97.              action_for_each_trigger("nonencrypted", action_add_queue_tail);
  98. +        }
  99.      } else if (ret == FS_MGR_MNTALL_DEV_NEEDS_RECOVERY) {
  100.          /* Setup a wipe via recovery, and reboot into recovery */
  101.          ERROR("fs_mgr_mount_all suggested recovery, so wiping data via recovery.\n");
  102. diff -Naur -X ignore droid/system/core/init/devices.c droid_cm12/system/core/init/devices.c
  103. --- droid/system/core/init/devices.c    2016-08-24 10:01:33.000000000 +0300
  104. +++ droid_cm12/system/core/init/devices.c   2016-08-22 13:13:09.000000000 +0300
  105. @@ -892,7 +892,7 @@
  106.       } else if(!strncmp(uevent->subsystem, "misc", 4) &&
  107.                   !strncmp(name, "log_", 4)) {
  108.           kernel_logger();
  109. -         base = "/dev/alog/";
  110. +         base = "/dev/log/";
  111.           make_dir(base, 0755);
  112.           name += 4;
  113.       } else if (!strncmp(uevent->subsystem, "dvb", 3)) {
  114. diff -Naur -X ignore droid/system/core/init/init.c droid_cm12/system/core/init/init.c
  115. --- droid/system/core/init/init.c   2016-08-24 10:01:33.000000000 +0300
  116. +++ droid_cm12/system/core/init/init.c  2016-08-22 13:13:09.000000000 +0300
  117. @@ -57,6 +57,7 @@
  118.  #include "util.h"
  119.  #include "ueventd.h"
  120.  #include "watchdogd.h"
  121. +#include "vendor_init.h"
  122.  
  123.  struct selabel_handle *sehandle;
  124.  struct selabel_handle *sehandle_prop;
  125. @@ -514,6 +515,9 @@
  126.  
  127.  void handle_control_message(const char *msg, const char *arg)
  128.  {
  129. +    if (!vendor_handle_control_message(msg, arg))
  130. +        return;
  131. +
  132.      if (!strcmp(msg,"start")) {
  133.          msg_start(arg);
  134.      } else if (!strcmp(msg,"stop")) {
  135. @@ -857,7 +861,7 @@
  136.  }
  137.  
  138.  #if BOOTCHART
  139. -static int bootchart_init_action(int nargs, char **args)
  140. +int bootchart_init_action(int nargs, char **args)
  141.  {
  142.      bootchart_count = bootchart_init();
  143.      if (bootchart_count < 0) {
  144. @@ -1056,16 +1060,18 @@
  145.           * together in the initramdisk on / and then we'll
  146.           * let the rc file figure out the rest.
  147.           */
  148. -   /* In a hybris system the fs is managed for us
  149.      mkdir("/dev", 0755);
  150.      mkdir("/proc", 0755);
  151.      mkdir("/sys", 0755);
  152.  
  153.      mount("tmpfs", "/dev", "tmpfs", MS_NOSUID, "mode=0755");
  154.      mkdir("/dev/pts", 0755);
  155. -    */
  156.      mkdir("/dev/socket", 0755);
  157. -    /* indicate that booting is in progress to background fw loaders, etc */
  158. +    mount("devpts", "/dev/pts", "devpts", 0, NULL);
  159. +    mount("proc", "/proc", "proc", 0, NULL);
  160. +    mount("sysfs", "/sys", "sysfs", 0, NULL);
  161. +
  162. +        /* indicate that booting is in progress to background fw loaders, etc */
  163.      close(open("/dev/.booting", O_WRONLY | O_CREAT, 0000));
  164.  
  165.          /* We must have some place other than / to create the
  166. @@ -1103,9 +1109,6 @@
  167.      if (!is_ffbm)
  168.          is_charger = !strcmp(bootmode, "charger") || charging_mode_booting();
  169.  
  170. -   /* FIXME: Mer will assume we're not on charger for now */
  171. -    // is_charger = 0;
  172. -
  173.      INFO("property init\n");
  174.      property_load_boot_defaults();
  175.  
  176. @@ -1147,17 +1150,6 @@
  177.      /* run all property triggers based on current state of the properties */
  178.      queue_builtin_action(queue_property_triggers_action, "queue_property_triggers");
  179.  
  180. -    /* run all device triggers based on current state of device nodes in /dev */
  181. -    //    queue_builtin_action(queue_device_triggers_action, "queue_device_triggers");
  182. -
  183. -   /* Run actions when all boot up is done and init is ready */
  184. -   action_for_each_trigger("ready", action_add_queue_tail);
  185. -
  186. -
  187. -#if BOOTCHART
  188. -    queue_builtin_action(bootchart_init_action, "bootchart_init");
  189. -#endif
  190. -
  191.      for(;;) {
  192.          int nr, i, timeout = -1;
  193.  
  194. diff -Naur -X ignore droid/system/core/init/property_service.c droid_cm12/system/core/init/property_service.c
  195. --- droid/system/core/init/property_service.c   2016-08-24 10:01:33.000000000 +0300
  196. +++ droid_cm12/system/core/init/property_service.c  2016-08-22 13:13:09.000000000 +0300
  197. @@ -322,11 +322,9 @@
  198.  void handle_property_set_fd()
  199.  {
  200.      prop_msg msg;
  201. -    int n;
  202.      int s;
  203.      int r;
  204.      int res;
  205. -    int ret;
  206.      struct ucred cr;
  207.      struct sockaddr_un addr;
  208.      socklen_t addr_size = sizeof(addr);
  209. @@ -335,8 +333,6 @@
  210.      struct pollfd ufds[1];
  211.      const int timeout_ms = 2 * 1000;  /* Default 2 sec timeout for caller to send property. */
  212.      int nr;
  213. -    char rproperty[PROP_VALUE_MAX];
  214. -    const prop_info *pi;
  215.  
  216.      if ((s = accept(property_set_fd, (struct sockaddr *) &addr, &addr_size)) < 0) {
  217.          return;
  218. @@ -409,30 +405,7 @@
  219.          }
  220.          freecon(source_ctx);
  221.          break;
  222. -    case PROP_MSG_GETPROP:
  223. -        msg.name[PROP_NAME_MAX-1] = 0;
  224. -        msg.value[0] = 0;
  225.  
  226. -        if (msg.name) {
  227. -            /* If we have a value, copy it over, otherwise returns the default */
  228. -            ret = property_get(msg.name, rproperty);
  229. -            if (ret) {
  230. -                strlcpy(msg.value, rproperty, sizeof(msg.value));
  231. -            }
  232. -        }
  233. -
  234. -        /* Send the property value back */
  235. -        r = TEMP_FAILURE_RETRY(send(s, &msg, sizeof(msg), 0));
  236. -        close(s);
  237. -        break;
  238. -    case PROP_MSG_LISTPROP:
  239. -        for(n = 0; (pi = __system_property_find_nth(n)); n++) {
  240. -            msg.name[0] = msg.value[0] = 0;
  241. -            __system_property_read(pi, msg.name, msg.value);
  242. -            TEMP_FAILURE_RETRY(send(s, &msg, sizeof(msg), 0));
  243. -        }
  244. -        close(s);
  245. -        break;
  246.      default:
  247.          close(s);
  248.          break;
  249. diff -Naur -X ignore droid/system/core/init/vendor_init.c droid_cm12/system/core/init/vendor_init.c
  250. --- droid/system/core/init/vendor_init.c    2016-08-24 10:01:33.000000000 +0300
  251. +++ droid_cm12/system/core/init/vendor_init.c   2016-08-22 13:13:09.000000000 +0300
  252. @@ -28,6 +28,7 @@
  253.   */
  254.  
  255.  #include "vendor_init.h"
  256. +#include <errno.h>
  257.  
  258.  /* init vendor override stubs */
  259.  
  260. @@ -35,3 +36,9 @@
  261.  void vendor_load_properties()
  262.  {
  263.  }
  264. +
  265. +__attribute__ ((weak))
  266. +int vendor_handle_control_message(const char *msg, const char *arg)
  267. +{
  268. +    return -ENOSYS;
  269. +}
  270. diff -Naur -X ignore droid/system/core/init/vendor_init.h droid_cm12/system/core/init/vendor_init.h
  271. --- droid/system/core/init/vendor_init.h    2016-08-24 10:01:33.000000000 +0300
  272. +++ droid_cm12/system/core/init/vendor_init.h   2016-08-22 13:13:09.000000000 +0300
  273. @@ -30,4 +30,5 @@
  274.  #ifndef __INIT_VENDOR__H__
  275.  #define __INIT_VENDOR__H__
  276.  extern void vendor_load_properties(void);
  277. +extern int vendor_handle_control_message(const char *msg, const char *arg);
  278.  #endif /* __INIT_VENDOR__H__ */
  279. diff -Naur -X ignore droid/system/core/libbacktrace/BacktraceImpl.cpp droid_cm12/system/core/libbacktrace/BacktraceImpl.cpp
  280. --- droid/system/core/libbacktrace/BacktraceImpl.cpp    2016-08-24 10:01:33.000000000 +0300
  281. +++ droid_cm12/system/core/libbacktrace/BacktraceImpl.cpp   2016-08-22 13:13:09.000000000 +0300
  282. @@ -60,24 +60,8 @@
  283.    return impl_->Unwind(num_ignore_frames, ucontext);
  284.  }
  285.  
  286. -extern "C" char* __cxa_demangle(const char* mangled, char* buf, size_t* len,
  287. -                                int* status);
  288. -
  289.  std::string Backtrace::GetFunctionName(uintptr_t pc, uintptr_t* offset) {
  290.    std::string func_name = impl_->GetFunctionNameRaw(pc, offset);
  291. -  if (!func_name.empty()) {
  292. -#if defined(__APPLE__)
  293. -    // Mac OS' __cxa_demangle demangles "f" as "float"; last tested on 10.7.
  294. -    if (func_name[0] != '_') {
  295. -      return func_name;
  296. -    }
  297. -#endif
  298. -    char* name = __cxa_demangle(func_name.c_str(), 0, 0, 0);
  299. -    if (name) {
  300. -      func_name = name;
  301. -      free(name);
  302. -    }
  303. -  }
  304.    return func_name;
  305.  }
  306.  
  307. diff -Naur -X ignore droid/system/core/liblog/Android.mk droid_cm12/system/core/liblog/Android.mk
  308. --- droid/system/core/liblog/Android.mk 2016-08-24 10:01:33.000000000 +0300
  309. +++ droid_cm12/system/core/liblog/Android.mk    2016-08-22 13:13:09.000000000 +0300
  310. @@ -17,11 +17,13 @@
  311.  include $(CLEAR_VARS)
  312.  
  313.  ifneq ($(TARGET_USES_LOGD),false)
  314. -liblog_sources := logd_write.c log_event_write.c
  315. +liblog_sources := logd_write.c
  316.  else
  317.  liblog_sources := logd_write_kern.c
  318.  endif
  319.  
  320. +liblog_sources += log_event_write.c
  321. +
  322.  # some files must not be compiled when building against Mingw
  323.  # they correspond to features not used by our host development tools
  324.  # which are also hard or even impossible to port to native Win32
  325. diff -Naur -X ignore droid/system/core/liblog/log_event_write.c droid_cm12/system/core/liblog/log_event_write.c
  326. --- droid/system/core/liblog/log_event_write.c  2016-10-03 16:35:28.235415891 +0300
  327. +++ droid_cm12/system/core/liblog/log_event_write.c 2016-08-22 13:13:09.000000000 +0300
  328. @@ -86,9 +86,3 @@
  329.  
  330.      return __android_log_bwrite(tag, buf, pos);
  331.  }
  332. -
  333. -void __android_logPower_print(void) {}
  334. -
  335. -int isLogEnabled(void) {
  336. -    return 0;
  337. -}
  338. \ В конце файла нет новой строки
  339. diff -Naur -X ignore droid/system/core/rootdir/init.environ.rc.in droid_cm12/system/core/rootdir/init.environ.rc.in
  340. --- droid/system/core/rootdir/init.environ.rc.in    2016-08-24 10:01:33.000000000 +0300
  341. +++ droid_cm12/system/core/rootdir/init.environ.rc.in   2016-08-22 13:13:09.000000000 +0300
  342. @@ -1,8 +1,6 @@
  343.  # set up the global environment
  344.  on init
  345.      export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
  346. -    # This is not 64-bit safe -stskeeps
  347. -    export LD_LIBRARY_PATH /usr/libexec/droid-hybris/lib-dev-alog:/vendor/lib:/system/lib
  348.      export ANDROID_BOOTLOGO 1
  349.      export ANDROID_ROOT /system
  350.      export ANDROID_ASSETS /system/app
  351. diff -Naur -X ignore droid/system/core/rootdir/init.rc droid_cm12/system/core/rootdir/init.rc
  352. --- droid/system/core/rootdir/init.rc   2016-08-24 10:01:33.000000000 +0300
  353. +++ droid_cm12/system/core/rootdir/init.rc  2016-08-22 13:13:09.000000000 +0300
  354. @@ -5,8 +5,7 @@
  355.  #
  356.  
  357.  import /init.environ.rc
  358. -# Mer handles usb stuff
  359. -#import /init.usb.rc
  360. +import /init.usb.rc
  361.  import /init.${ro.hardware}.rc
  362.  import /init.${ro.zygote}.rc
  363.  import /init.trace.rc
  364. @@ -15,6 +14,9 @@
  365.  
  366.  
  367.  on early-init
  368. +    # Set init and its forked children's oom_adj.
  369. +    write /proc/1/oom_score_adj -1000
  370. +
  371.      # Apply strict SELinux checking of PROT_EXEC on mmap/mprotect calls.
  372.      write /sys/fs/selinux/checkreqprot 0
  373.  
  374. @@ -25,13 +27,18 @@
  375.      # Set the security context of /adb_keys if present.
  376.      restorecon /adb_keys
  377.  
  378. +    start ueventd
  379. +
  380. +    # create mountpoints
  381.      mkdir /mnt 0775 root system
  382.  
  383.  on init
  384.      sysclktz 0
  385.  
  386. -    loglevel 64
  387. +    loglevel 3
  388.  
  389. +    # Backward compatibility
  390. +    symlink /system/etc /etc
  391.      symlink /sys/kernel/debug /d
  392.  
  393.      # Right now vendor lives on the same filesystem as system,
  394. @@ -40,6 +47,7 @@
  395.  
  396.      # Create cgroup mount point for cpu accounting
  397.      mkdir /acct
  398. +    mount cgroup none /acct cpuacct
  399.      mkdir /acct/uid
  400.  
  401.      # Create cgroup mount point for memory
  402. @@ -84,8 +92,13 @@
  403.      mkdir /mnt/obb 0700 root system
  404.      mount tmpfs tmpfs /mnt/obb mode=0755,gid=1000
  405.  
  406. +    # memory control cgroup
  407. +    mkdir /dev/memcg 0700 root system
  408. +    mount cgroup none /dev/memcg memory
  409. +
  410.      write /proc/sys/kernel/panic_on_oops 1
  411.      write /proc/sys/kernel/hung_task_timeout_secs 0
  412. +    write /proc/cpu/alignment 4
  413.      write /proc/sys/kernel/sched_latency_ns 10000000
  414.      write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
  415.      write /proc/sys/kernel/sched_compat_yield 1
  416. @@ -105,6 +118,24 @@
  417.      # set fwmark on accepted sockets
  418.      write /proc/sys/net/ipv4/tcp_fwmark_accept 1
  419.  
  420. +    # Create cgroup mount points for process groups
  421. +    mkdir /dev/cpuctl
  422. +    mount cgroup none /dev/cpuctl cpu
  423. +    chown system system /dev/cpuctl
  424. +    chown system system /dev/cpuctl/tasks
  425. +    chmod 0666 /dev/cpuctl/tasks
  426. +    write /dev/cpuctl/cpu.shares 1024
  427. +    write /dev/cpuctl/cpu.rt_runtime_us 800000
  428. +    write /dev/cpuctl/cpu.rt_period_us 1000000
  429. +
  430. +    mkdir /dev/cpuctl/bg_non_interactive
  431. +    chown system system /dev/cpuctl/bg_non_interactive/tasks
  432. +    chmod 0666 /dev/cpuctl/bg_non_interactive/tasks
  433. +    # 5.0 %
  434. +    write /dev/cpuctl/bg_non_interactive/cpu.shares 52
  435. +    write /dev/cpuctl/bg_non_interactive/cpu.rt_runtime_us 700000
  436. +    write /dev/cpuctl/bg_non_interactive/cpu.rt_period_us 1000000
  437. +
  438.      # qtaguid will limit access to specific data based on group memberships.
  439.      #   net_bw_acct grants impersonation of socket owners.
  440.      #   net_bw_stats grants access to other apps' detailed tagged-socket stats.
  441. @@ -159,9 +190,9 @@
  442.  
  443.  on post-fs
  444.      # once everything is setup, no need to modify /
  445. -    # mount rootfs rootfs / ro remount
  446. +    mount rootfs rootfs / ro remount
  447.      # mount shared so changes propagate into child namespaces
  448. -    # mount rootfs rootfs / shared rec
  449. +    mount rootfs rootfs / shared rec
  450.  
  451.      # We chown/chmod /cache again so because mount is run as root + defaults
  452.      chown system cache /cache
  453. @@ -255,6 +286,7 @@
  454.      mkdir /data/app-lib 0771 system system
  455.      mkdir /data/app 0771 system system
  456.      mkdir /data/property 0700 root root
  457. +    mkdir /data/tombstones 0771 system system
  458.  
  459.      # create dalvik-cache, so as to enforce our permissions
  460.      mkdir /data/dalvik-cache 0771 root root
  461. @@ -302,9 +334,8 @@
  462.  on boot
  463.      # basic network init
  464.      ifup lo
  465. -# Conflicts with Mer
  466. -    #hostname localhost
  467. -    #domainname localdomain
  468. +    hostname localhost
  469. +    domainname localdomain
  470.  
  471.      # set RLIMIT_NICE to allow priorities from 19 to -20
  472.      setrlimit 13 40 40
  473. @@ -391,12 +422,8 @@
  474.      # Define default initial receive window size in segments.
  475.      setprop net.tcp.default_init_rwnd 60
  476.  
  477. -    # Allow system group to trigger vibrator
  478. -    chmod 0664 /sys/class/timed_output/vibrator/enable
  479.      class_start core
  480. -    class_start main
  481.  
  482. -# Never gets called, since Mer does its own 'mount_all'
  483.  on nonencrypted
  484.      class_start main
  485.      class_start late_start
  486. @@ -411,10 +438,6 @@
  487.  on property:sys.init_log_level=*
  488.      loglevel ${sys.init_log_level}
  489.  
  490. -# Mer needs to set this property when fs units are mounted
  491. -on property:droid.late_start=trigger_late_start
  492. -    class_start late_start
  493. -
  494.  on charger
  495.      class_start charger
  496.  
  497. @@ -458,8 +481,6 @@
  498.      class core
  499.      critical
  500.      seclabel u:r:ueventd:s0
  501. -# Not used by Mer
  502. -    disabled
  503.  
  504.  service logd /system/bin/logd
  505.      class core
  506. @@ -472,8 +493,6 @@
  507.      class core
  508.      critical
  509.      seclabel u:r:healthd:s0
  510. -# Not used by Mer - spams logs and small battery drain
  511. -    disabled
  512.  
  513.  service console /system/bin/sh
  514.      class core
  515. @@ -483,11 +502,9 @@
  516.      group shell log
  517.      seclabel u:r:shell:s0
  518.  
  519. -# Disabled in Mer - together with CONFIG_AUDIT=n in mer-kernel-check
  520.  service auditd /system/bin/auditd -k
  521.      seclabel u:r:logd:s0
  522.      class main
  523. -    disabled
  524.  
  525.  on property:ro.debuggable=1
  526.      start console
  527. @@ -505,8 +522,8 @@
  528.  
  529.  service lmkd /system/bin/lmkd
  530.      class core
  531. +    critical
  532.      socket lmkd seqpacket 0660 system system
  533. -    disabled
  534.  
  535.  service servicemanager /system/bin/servicemanager
  536.      class core
  537. @@ -514,47 +531,22 @@
  538.      group system
  539.      critical
  540.      onrestart restart healthd
  541. -    onrestart restart minimedia
  542. -    onrestart restart minisf
  543. -    onrestart restart miniaf
  544. -#    onrestart restart zygote
  545. -#    onrestart restart media
  546. -#    onrestart restart surfaceflinger
  547. -#    onrestart restart drm
  548. -
  549. -service minimedia /usr/libexec/droid-hybris/system/bin/minimediaservice
  550. -    class main
  551. -    user media
  552. -    group audio camera
  553. -    ioprio rt 4
  554. -
  555. -service minisf /usr/libexec/droid-hybris/system/bin/minisfservice
  556. -    class main
  557. -    user system
  558. -    group graphics
  559. -
  560. -service miniaf /usr/libexec/droid-hybris/system/bin/miniafservice
  561. -    class main
  562. -    user system
  563. -    group audio
  564. +    onrestart restart zygote
  565. +    onrestart restart media
  566. +    onrestart restart surfaceflinger
  567. +    onrestart restart drm
  568.  
  569.  service vold /system/bin/vold
  570.      class core
  571.      socket vold stream 0660 root mount
  572.      ioprio be 2
  573. -    # Not used in Mer
  574. -    disabled
  575.  
  576. -# Disabled in Mer: conflicts with connman beyond usability
  577. -# This will no longer work for mako: `ndc softap fwreload wlan0 AP` to reload mako firmware
  578. -# mako (and similar fwreload) porters need to seek for alternative solution, see NEMO#793
  579.  service netd /system/bin/netd
  580.      class main
  581.      socket netd stream 0660 root system
  582.      socket dnsproxyd stream 0660 root inet
  583.      socket mdns stream 0660 root system
  584.      socket fwmarkd stream 0660 root inet
  585. -    disabled
  586.  
  587.  service debuggerd /system/bin/debuggerd
  588.      class main
  589. @@ -569,26 +561,22 @@
  590.      user root
  591.      group radio cache inet misc audio sdcard_rw qcom_diag log
  592.  
  593. -# Disabled in Mer - used only during porting atm
  594.  service surfaceflinger /system/bin/surfaceflinger
  595.      class core
  596.      user system
  597.      group graphics drmrpc
  598.      onrestart restart zygote
  599. -    disabled
  600.  
  601.  service drm /system/bin/drmserver
  602.      class main
  603.      user drm
  604.      group drm system inet drmrpc
  605.  
  606. -# Disabled in Mer
  607.  service media /system/bin/mediaserver
  608.      class main
  609.      user media
  610.      group audio camera inet net_bt net_bt_admin net_bw_acct drmrpc mediadrm qcom_diag
  611.      ioprio rt 4
  612. -    disabled
  613.  
  614.  # One shot invocation to deal with encrypted volume.
  615.  service defaultcrypto /system/bin/vdc --wait cryptfs mountdefaultencrypted
  616. @@ -641,13 +629,10 @@
  617.      disabled
  618.      oneshot
  619.  
  620. -# disabled in Mer
  621.  service keystore /system/bin/keystore /data/misc/keystore
  622.      class main
  623.      user keystore
  624.      group keystore drmrpc
  625. -    # Not used in Mer
  626. -    disabled
  627.  
  628.  service dumpstate /system/bin/dumpstate -s
  629.      class main
  630. @@ -655,16 +640,15 @@
  631.      disabled
  632.      oneshot
  633.  
  634. -service pre-recovery /system/bin/uncrypt
  635. +service mdnsd /system/bin/mdnsd
  636.      class main
  637. +    user mdnsr
  638. +    group inet net_raw
  639. +    socket mdnsd stream 0660 mdnsr inet
  640.      disabled
  641. +    oneshot
  642.  
  643. -# This trigger is run by our modified init after boot has finished
  644. -on ready
  645. -   class_start mer
  646. -
  647. -# Notify Mer's systemd that we're done
  648. -# This is started at the end of boot after both core and main classes
  649. -service droid_init_done /bin/sh /usr/bin/droid/droid-init-done.sh
  650. -    class mer
  651. +service pre-recovery /system/bin/uncrypt
  652. +    class main
  653. +    disabled
  654.      oneshot
  655. diff -Naur -X ignore droid/system/core/rootdir/init.zygote32.rc droid_cm12/system/core/rootdir/init.zygote32.rc
  656. --- droid/system/core/rootdir/init.zygote32.rc  2016-08-24 10:01:33.000000000 +0300
  657. +++ droid_cm12/system/core/rootdir/init.zygote32.rc 2016-08-22 13:13:09.000000000 +0300
  658. @@ -5,4 +5,4 @@
  659.      onrestart write /sys/power/state on
  660.      onrestart restart media
  661.      onrestart restart netd
  662. -    disabled
  663. \ В конце файла нет новой строки
  664. +
  665. diff -Naur -X ignore droid/system/core/rootdir/init.zygote64.rc droid_cm12/system/core/rootdir/init.zygote64.rc
  666. --- droid/system/core/rootdir/init.zygote64.rc  2016-08-24 10:01:33.000000000 +0300
  667. +++ droid_cm12/system/core/rootdir/init.zygote64.rc 2016-08-22 13:13:09.000000000 +0300
  668. @@ -5,4 +5,4 @@
  669.      onrestart write /sys/power/state on
  670.      onrestart restart media
  671.      onrestart restart netd
  672. -    disabled
  673. \ В конце файла нет новой строки
  674. +
  675. diff -Naur -X ignore droid/system/core/sdcard/sdcard.c droid_cm12/system/core/sdcard/sdcard.c
  676. --- droid/system/core/sdcard/sdcard.c   2016-08-24 10:01:33.000000000 +0300
  677. +++ droid_cm12/system/core/sdcard/sdcard.c  2016-08-22 13:13:09.000000000 +0300
  678. @@ -356,7 +356,7 @@
  679.  
  680.      ssize_t pathlen = 0;
  681.      if (node->parent && node->graft_path == NULL) {
  682. -        pathlen = get_node_path_locked(node->parent, buf, bufsize - namelen - 2);
  683. +        pathlen = get_node_path_locked(node->parent, buf, bufsize - namelen - 1);
  684.          if (pathlen < 0) {
  685.              return -1;
  686.          }
  687. diff -Naur -X ignore droid/system/core/toolbox/lsof.c droid_cm12/system/core/toolbox/lsof.c
  688. --- droid/system/core/toolbox/lsof.c    2016-08-24 10:01:33.000000000 +0300
  689. +++ droid_cm12/system/core/toolbox/lsof.c   2016-08-22 13:13:09.000000000 +0300
  690. @@ -99,10 +99,11 @@
  691.  static void print_maps(struct pid_info_t* info)
  692.  {
  693.      FILE *maps;
  694. +
  695.      size_t offset;
  696.      char device[10];
  697.      long int inode;
  698. -    char file[PATH_MAX];
  699. +    char file[1024];
  700.  
  701.      strlcat(info->path, "maps", sizeof(info->path));
  702.  
  703. @@ -110,8 +111,8 @@
  704.      if (!maps)
  705.          goto out;
  706.  
  707. -    while (fscanf(maps, "%*x-%*x %*s %zx %s %ld %s\n", &offset, device, &inode,
  708. -            file) == 4) {
  709. +    while (fscanf(maps, "%*x-%*x %*s %zx %5s %ld %1023s\n",
  710. +                  &offset, device, &inode, file) == 4) {
  711.          // We don't care about non-file maps
  712.          if (inode == 0 || !strcmp(device, "00:00"))
  713.              continue;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement