Explorar el Código

Update twrp build for oreo

ivanmeler hace 7 años
padre
commit
9316157bf2
Se han modificado 40 ficheros con 1783 adiciones y 2312 borrados
  1. 14 46
      BoardConfig.mk
  2. BIN
      Image
  3. 1 2
      README.md
  4. 0 17
      bootimg.mk
  5. BIN
      dtb.img
  6. 69 0
      dtbhtool/Android.mk
  7. 102 0
      dtbhtool/bootimg.h
  8. 297 0
      dtbhtool/dtbimg.c
  9. 136 0
      dtbhtool/dtbtool.txt
  10. 30 0
      dtbhtool/libdtbimg/dtbimg.h
  11. 338 0
      dtbhtool/mkbootimg.c
  12. 126 0
      dtbhtool/mkdtbimg.c
  13. 37 0
      dtbhtool/samsung_dtbh.h
  14. 222 0
      dtbhtool/unpackbootimg.c
  15. 185 0
      dtbhtool/unpackdtbhimg.c
  16. 0 9
      init/Android.mk
  17. 0 60
      init/init_hero2lte.cpp
  18. 79 0
      mkbootimg.mk
  19. 6 0
      omni.dependencies
  20. 0 7
      omni_hero2lte.mk
  21. 14 11
      recovery.fstab
  22. 1 1
      recovery/root/fstab.samsungexynos8890
  23. 0 15
      recovery/root/init.recovery.samsungexynos8890.rc
  24. 18 37
      recovery/root/init.recovery.usb.rc
  25. 0 2005
      recovery/root/prebuilt_file_contexts
  26. BIN
      recovery/root/sbin/keystore
  27. BIN
      recovery/root/sbin/libbinder.so
  28. BIN
      recovery/root/sbin/libcc_manager.so
  29. BIN
      recovery/root/sbin/libkeymaster1.so
  30. BIN
      recovery/root/sbin/libkeymaster_helper.so
  31. BIN
      recovery/root/sbin/libkeymaster_mdfpp.so
  32. BIN
      recovery/root/sbin/libkeymaster_messages.so
  33. BIN
      recovery/root/sbin/libkeystore_binder.so
  34. BIN
      recovery/root/sbin/libsec_km.so
  35. BIN
      recovery/root/sbin/libskmm.so
  36. BIN
      recovery/root/sbin/libsoftkeymasterdevice.so
  37. 108 88
      recovery/root/ueventd.samsungexynos8890.rc
  38. BIN
      recovery/root/vendor/lib64/hw/keystore.exynos8890.so
  39. BIN
      recovery/root/vendor/lib64/hw/keystore.mdfpp.so
  40. 0 14
      system.prop

+ 14 - 46
BoardConfig.mk

@@ -1,17 +1,12 @@
 DEVICE_TREE := device/samsung/hero2lte
 
 # Bootloader
-TARGET_NO_BOOTLOADER := true
-TARGET_BOOTLOADER_BOARD_NAME := universal8890
-
-# Platform
+BOARD_VENDOR := samsung
 TARGET_BOARD_PLATFORM := exynos5
-TARGET_BOARD_PLATFORM_GPU := mali-t880mp12
-
-# Flags
-#TARGET_GLOBAL_CFLAGS +=
-#TARGET_GLOBAL_CPPFLAGS +=
-#COMMON_GLOBAL_CFLAGS +=
+TARGET_SOC := exynos8890
+TARGET_BOOTLOADER_BOARD_NAME := universal8890
+TARGET_NO_BOOTLOADER := true
+TARGET_NO_RADIOIMAGE := true
 
 # Architecture
 TARGET_ARCH := arm64
@@ -28,35 +23,20 @@ TARGET_2ND_CPU_ABI2 := armeabi
 TARGET_2ND_CPU_VARIANT := cortex-a53
 
 # Kernel
-TARGET_USES_UNCOMPRESSED_KERNEL := true
-#TARGET_KERNEL_SOURCE := kernel/samsung/universal8890
 TARGET_KERNEL_ARCH := arm64
 TARGET_KERNEL_HEADER_ARCH := arm64
-TARGET_KERNEL_CONFIG := twrp_defconfig
-TARGET_KERNEL_DEVICE_DEFCONFIG := device_hero2lte_xx
+TARGET_KERNEL_CONFIG := exynos8890-hero2lte_defconfig
+TARGET_KERNEL_SOURCE := kernel/samsung/universal8890
 
-TARGET_PREBUILT_KERNEL := $(DEVICE_TREE)/Image
-TARGET_PREBUILT_DTB := $(DEVICE_TREE)/dtb.img
-
-# DTB
-TARGET_DTBH_PLATFORM_CODE := 0x000050a6
-TARGET_DTBH_SUBTYPE_CODE  := 0x217584da
-
-# Boot image
-BOARD_KERNEL_CMDLINE := # Exynos doesn't take cmdline arguments from boot image
+# Image
 BOARD_KERNEL_BASE := 0x10000000
 BOARD_KERNEL_PAGESIZE := 2048
+BOARD_CUSTOM_BOOTIMG_MK :=  $(DEVICE_TREE)/mkbootimg.mk
+BOARD_KERNEL_IMAGE_NAME := Image
+BOARD_KERNEL_SEPARATED_DT := true
 # 000RU = recovery kernel, 000KU = system kernel
 BOARD_MKBOOTIMG_ARGS := --kernel_offset 0x00008000 --ramdisk_offset 0x01000000 --tags_offset 0x00000100 --board SRPOI30A000RU
-BOARD_CUSTOM_BOOTIMG_MK :=  $(DEVICE_TREE)/bootimg.mk
-
-# Partitions
-BOARD_BOOTIMAGE_PARTITION_SIZE     := 0x002800000
-BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x002E00000
-BOARD_SYSTEMIMAGE_PARTITION_SIZE   := 0x16A800000
-BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x64BFFB000 # 0x64C000000 - 20480 (footer)
-BOARD_CACHEIMAGE_PARTITION_SIZE    := 0x00FA00000
-BOARD_FLASH_BLOCK_SIZE := 131072
+TARGET_CUSTOM_DTBTOOL := dtbhtoolExynos
 
 # File systems
 BOARD_HAS_LARGE_FILESYSTEM := true
@@ -64,6 +44,7 @@ TARGET_USERIMAGES_USE_EXT4 := true
 TARGET_USERIMAGES_USE_F2FS := true
 
 # TWRP specific build flags
+RECOVERY_VARIANT := twrp
 TW_THEME := portrait_hdpi
 RECOVERY_SDCARD_ON_DATA := true
 TARGET_RECOVERY_PIXEL_FORMAT := "ABGR_8888"
@@ -74,25 +55,12 @@ TW_DEFAULT_BRIGHTNESS := 162
 TW_NO_REBOOT_BOOTLOADER := true
 TW_HAS_DOWNLOAD_MODE := true
 TW_INCLUDE_NTFS_3G := true
+
 # exFAT drivers included in the kernel
 TW_NO_EXFAT_FUSE := true
-# No love for the wicked (device ships with M)
-TW_EXCLUDE_SUPERSU := true
 
 # Encryption support
 TW_INCLUDE_CRYPTO := true
-# Samsung's encryption is currently unsupported
-#TW_INCLUDE_CRYPTO_SAMSUNG := true
-#TARGET_HW_DISK_ENCRYPTION := true
 
 # Asian region languages
 TW_EXTRA_LANGUAGES := true
-
-# Debug flags
-#TWRP_INCLUDE_LOGCAT := true
-
-# Init properties from bootloader version, ex. model info
-TARGET_UNIFIED_DEVICE := true
-TARGET_INIT_VENDOR_LIB := libinit_hero2lte
-TARGET_RECOVERY_DEVICE_MODULES := libinit_hero2lte
-TARGET_LIBINIT_DEFINES_FILE := $(DEVICE_TREE)/init/init_hero2lte.cpp

BIN
Image


+ 1 - 2
README.md

@@ -5,7 +5,7 @@ Add to `.repo/local_manifests/hero2lte.xml`:
 ```xml
 <?xml version="1.0" encoding="UTF-8"?>
 <manifest>
-	<project path="device/samsung/hero2lte" name="android_device_samsung_hero2lte" remote="TeamWin" revision="android-6.0" />
+	<project path="device/samsung/hero2lte" name="android_device_samsung_hero2lte" remote="TeamWin" revision="android-8.1" />
 </manifest>
 ```
 
@@ -19,4 +19,3 @@ lunch omni_hero2lte-eng
 make -j5 recoveryimage
 ```
 
-Kernel sources are available at: https://github.com/jcadduono/android_kernel_samsung_universal8890/tree/twrp-6.0

+ 0 - 17
bootimg.mk

@@ -1,17 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-FLASH_IMAGE_TARGET ?= $(PRODUCT_OUT)/recovery.tar
-
-ifdef TARGET_PREBUILT_DTB
-	BOARD_MKBOOTIMG_ARGS += --dt $(TARGET_PREBUILT_DTB)
-endif
-
-$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) $(INSTALLED_DTIMAGE_TARGET) $(recovery_kernel) $(recovery_ramdisk)
-	@echo -e ${CL_GRN}"----- Making recovery image ------"${CL_RST}
-	$(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@ --ramdisk $(recovery_ramdisk)
-	@echo -e ${CL_CYN}"Made recovery image: $@"${CL_RST}
-	@echo -e ${CL_GRN}"----- Lying about SEAndroid state to Samsung bootloader ------"${CL_RST}
-	$(hide) echo -n "SEANDROIDENFORCE" >> $(INSTALLED_RECOVERYIMAGE_TARGET)
-	$(hide) $(call assert-max-image-size,$@,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw)
-	$(hide) tar -C $(PRODUCT_OUT) -H ustar -c recovery.img > $(FLASH_IMAGE_TARGET)
-	@echo -e ${CL_CYN}"Made Odin flashable recovery tar: ${FLASH_IMAGE_TARGET}"${CL_RST}

BIN
dtb.img


+ 69 - 0
dtbhtool/Android.mk

@@ -0,0 +1,69 @@
+LOCAL_PATH:= $(call my-dir)
+
+# Host static library
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := dtbimg.c
+LOCAL_STATIC_LIBRARIES := libfdt
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/libdtbimg
+LOCAL_MODULE := libdtbimg
+include $(BUILD_HOST_STATIC_LIBRARY)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := mkbootimg.c
+LOCAL_STATIC_LIBRARIES := libdtbimg libfdt libcrypto_static
+
+LOCAL_MODULE := mkdtbhbootimg
+
+include $(BUILD_HOST_EXECUTABLE)
+
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := unpackbootimg.c
+LOCAL_MODULE := unpackdtbhbootimg
+include $(BUILD_HOST_EXECUTABLE)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := mkdtbimg.c
+LOCAL_STATIC_LIBRARIES := libdtbimg libfdt
+
+LOCAL_MODULE := dtbhtoolExynos
+
+include $(BUILD_HOST_EXECUTABLE)
+
+# Target static library
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := dtbimg.c
+LOCAL_STATIC_LIBRARIES := libfdt
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/libdtbimg
+LOCAL_MODULE := libdtbimg
+include $(BUILD_STATIC_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := mkbootimg.c
+LOCAL_STATIC_LIBRARIES := libdtbimg libfdt libcrypto_static libcutils libc
+LOCAL_MODULE := utility_mkdtbhbootimg
+LOCAL_MODULE_STEM := mkdtbhbootimg
+LOCAL_MODULE_CLASS := EXECUTABLES
+LOCAL_UNSTRIPPED_PATH := $(PRODUCT_OUT)/symbols/utilities
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/utilities
+LOCAL_FORCE_STATIC_EXECUTABLE := true
+include $(BUILD_EXECUTABLE)
+
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := unpackbootimg.c
+LOCAL_STATIC_LIBRARIES := libcutils libc
+LOCAL_MODULE := utility_unpackdtbhbootimg
+LOCAL_MODULE_STEM := unpackdtbhbootimg
+LOCAL_MODULE_CLASS := EXECUTABLES
+LOCAL_UNSTRIPPED_PATH := $(PRODUCT_OUT)/symbols/utilities
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/utilities
+LOCAL_FORCE_STATIC_EXECUTABLE := true
+include $(BUILD_EXECUTABLE)
+
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := unpackdtbhimg.c
+LOCAL_MODULE := unpackdtbhimg
+include $(BUILD_HOST_EXECUTABLE)
+
+$(call dist-for-goals,dist_files,$(LOCAL_BUILT_MODULE))

+ 102 - 0
dtbhtool/bootimg.h

@@ -0,0 +1,102 @@
+/* tools/mkbootimg/bootimg.h
+**
+** Copyright 2007, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+
+#ifndef _BOOT_IMAGE_H_
+#define _BOOT_IMAGE_H_
+
+typedef struct boot_img_hdr boot_img_hdr;
+
+#define BOOT_MAGIC "ANDROID!"
+#define BOOT_MAGIC_SIZE 8
+#define BOOT_NAME_SIZE 16
+#define BOOT_ARGS_SIZE 512
+
+struct boot_img_hdr
+{
+    unsigned char magic[BOOT_MAGIC_SIZE];
+
+    unsigned kernel_size;  /* size in bytes */
+    unsigned kernel_addr;  /* physical load addr */
+
+    unsigned ramdisk_size; /* size in bytes */
+    unsigned ramdisk_addr; /* physical load addr */
+
+    unsigned second_size;  /* size in bytes */
+    unsigned second_addr;  /* physical load addr */
+
+    unsigned tags_addr;    /* physical addr for kernel tags */
+    unsigned page_size;    /* flash page size we assume */
+    unsigned dt_size;      /* device tree in bytes */
+    unsigned unused;       /* future expansion: should be 0 */
+    unsigned char name[BOOT_NAME_SIZE]; /* asciiz product name */
+    
+    unsigned char cmdline[BOOT_ARGS_SIZE];
+
+    unsigned id[8]; /* timestamp / checksum / sha1 / etc */
+};
+
+/*
+** +-----------------+ 
+** | boot header     | 1 page
+** +-----------------+
+** | kernel          | n pages  
+** +-----------------+
+** | ramdisk         | m pages  
+** +-----------------+
+** | second stage    | o pages
+** +-----------------+
+** | device tree     | p pages
+** +-----------------+
+** | signature       | 256 bytes
+** +-----------------+
+**
+** n = (kernel_size + page_size - 1) / page_size
+** m = (ramdisk_size + page_size - 1) / page_size
+** o = (second_size + page_size - 1) / page_size
+** p = (dt_size + page_size - 1) / page_size
+**
+** 0. all entities are page_size aligned in flash
+** 1. kernel and ramdisk are required (size != 0)
+** 2. second is optional (second_size == 0 -> no second)
+** 3. load each element (kernel, ramdisk, second) at
+**    the specified physical address (kernel_addr, etc)
+** 4. prepare tags at tag_addr.  kernel_args[] is
+**    appended to the kernel commandline in the tags.
+** 5. r0 = 0, r1 = MACHINE_TYPE, r2 = tags_addr
+** 6. if second_size != 0: jump to second_addr
+**    else: jump to kernel_addr
+*/
+
+#if 0
+typedef struct ptentry ptentry;
+
+struct ptentry {
+    char name[16];      /* asciiz partition name    */
+    unsigned start;     /* starting block number    */
+    unsigned length;    /* length in blocks         */
+    unsigned flags;     /* set to zero              */
+};
+
+/* MSM Partition Table ATAG
+**
+** length: 2 + 7 * n
+** atag:   0x4d534d70
+**         <ptentry> x n
+*/
+#endif
+
+#endif

+ 297 - 0
dtbhtool/dtbimg.c

@@ -0,0 +1,297 @@
+/* tools/mkbootimg/dtbimg.c
+**
+** Copyright 2007, The Android Open Source Project
+** Copyright 2013, Sony Mobile Communications
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+**
+** December 2016, Christopher N. Hesse
+** Separate dt creation from mkbootimg program.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <limits.h>
+
+#include <sys/types.h>
+#include <arpa/inet.h>
+#include <assert.h>
+#include <dirent.h>
+#include <err.h>
+#include <stdint.h>
+
+/* must be provided by the device tree */
+#include <samsung_dtbh.h>
+
+#include "libfdt.h"
+
+struct dt_blob;
+
+struct dt_entry {
+    uint32_t chip;
+    uint32_t platform;
+    uint32_t subtype;
+    uint32_t hw_rev;
+    uint32_t hw_rev_end;
+    uint32_t offset;
+    uint32_t size; /* including padding */
+    uint32_t space;
+
+    struct dt_blob *blob;
+};
+
+/*
+ * Comparator for sorting dt_entries
+ */
+static int dt_entry_cmp(const void *ap, const void *bp)
+{
+    struct dt_entry *a = (struct dt_entry*)ap;
+    struct dt_entry *b = (struct dt_entry*)bp;
+
+    if (a->chip != b->chip)
+        return a->chip - b->chip;
+    return a->hw_rev - b->hw_rev;
+}
+
+/*
+ * In memory representation of a dtb blob
+ */
+struct dt_blob {
+    uint32_t size;
+    uint32_t offset;
+
+    void *payload;
+    struct dt_blob *next;
+};
+
+static void *load_file(const char *fn, unsigned *_sz)
+{
+    char *data;
+    int sz;
+    int fd;
+
+    data = 0;
+    fd = open(fn, O_RDONLY);
+    if(fd < 0) return 0;
+
+    sz = lseek(fd, 0, SEEK_END);
+    if(sz < 0) goto oops;
+
+    if(lseek(fd, 0, SEEK_SET) != 0) goto oops;
+
+    data = (char*) malloc(sz);
+    if(data == 0) goto oops;
+
+    if(read(fd, data, sz) != sz) goto oops;
+    close(fd);
+
+    if(_sz) *_sz = sz;
+    return data;
+
+oops:
+    close(fd);
+    if(data != 0) free(data);
+    return 0;
+}
+
+void *load_dtbh_block(const char *dtb_path, unsigned pagesize, unsigned *_sz)
+{
+    const unsigned pagemask = pagesize - 1;
+    struct dt_entry *new_entries;
+    struct dt_entry *entries = NULL;
+    struct dt_entry *entry;
+    struct dt_blob *blob;
+    struct dt_blob *blob_list = NULL;
+    struct dt_blob *last_blob = NULL;
+    struct dirent *de;
+    unsigned new_count;
+    unsigned entry_count = 0;
+    unsigned offset;
+    unsigned dtb_sz;
+    unsigned hdr_sz = DT_HEADER_PHYS_SIZE;
+    uint32_t version = DTBH_VERSION;
+    unsigned blob_sz = 0;
+    char fname[PATH_MAX];
+    const unsigned *prop_chip;
+    const unsigned *prop_platform;
+    const unsigned *prop_subtype;
+    const unsigned *prop_hw_rev;
+    const unsigned *prop_hw_rev_end;
+    int namlen;
+    int len;
+    void *dtb;
+    char *dtbh;
+    DIR *dir;
+    unsigned c;
+
+    dir = opendir(dtb_path);
+
+    if (dir == NULL)
+        err(1, "failed to open '%s'", dtb_path);
+
+    while ((de = readdir(dir)) != NULL) {
+        namlen = strlen(de->d_name);
+        if (namlen < 4 || strcmp(&de->d_name[namlen - 4], ".dtb"))
+            continue;
+
+        snprintf(fname, sizeof(fname), "%s/%s", dtb_path, de->d_name);
+
+        dtb = load_file(fname, &dtb_sz);
+        if (dtb == NULL)
+            err(1, "failed to read dtb '%s'", fname);
+
+        if (fdt_check_header(dtb) != 0) {
+            warnx("'%s' is not a valid dtb, skipping", fname);
+            free(dtb);
+            continue;
+        }
+
+        offset = fdt_path_offset(dtb, "/");
+        prop_chip = fdt_getprop(dtb, offset, "model_info-chip", &len);
+        if (len % (sizeof(uint32_t)) != 0) {
+            warnx("model_info-chip of %s is of invalid size, skipping", fname);
+            free(dtb);
+            continue;
+        }
+
+        prop_platform = fdt_getprop(dtb, offset, "model_info-platform", &len);
+        if (strcmp((char *)&prop_platform[0], DTBH_PLATFORM)) {
+            warnx("model_info-platform of %s is invalid, skipping (expected %s but got %s)",
+                  fname, DTBH_PLATFORM, (char *)&prop_platform[0]);
+            free(dtb);
+            continue;
+        }
+
+        prop_subtype = fdt_getprop(dtb, offset, "model_info-subtype", &len);
+        if (strcmp((char *)&prop_subtype[0], DTBH_SUBTYPE)) {
+            warnx("model_info-subtype of %s is invalid, skipping (expected %s but got %s)",
+                  fname, DTBH_SUBTYPE, (char *)&prop_subtype[0]);
+            free(dtb);
+            continue;
+        }
+
+        prop_hw_rev = fdt_getprop(dtb, offset, "model_info-hw_rev", &len);
+        if (len % (sizeof(uint32_t)) != 0) {
+            warnx("model_info-hw_rev of %s is of invalid size, skipping", fname);
+            free(dtb);
+            continue;
+        }
+
+        prop_hw_rev_end = fdt_getprop(dtb, offset, "model_info-hw_rev_end", &len);
+        if (len % (sizeof(uint32_t)) != 0) {
+            warnx("model_info-hw_rev_end of %s is of invalid size, skipping", fname);
+            free(dtb);
+            continue;
+        }
+
+        blob = calloc(1, sizeof(struct dt_blob));
+        if (blob == NULL)
+            err(1, "failed to allocate memory");
+
+        blob->payload = dtb;
+        blob->size = dtb_sz;
+        if (blob_list == NULL) {
+            blob_list = blob;
+            last_blob = blob;
+        } else {
+            last_blob->next = blob;
+            last_blob = blob;
+        }
+
+        blob_sz += (blob->size + pagemask) & ~pagemask;
+        new_count = entry_count + 1;
+        new_entries = realloc(entries, new_count * sizeof(struct dt_entry));
+        if (new_entries == NULL)
+            err(1, "failed to allocate memory");
+
+        entries = new_entries;
+        entry = &entries[entry_count];
+        memset(entry, 0, sizeof(*entry));
+        entry->chip = ntohl(prop_chip[0]);
+        entry->platform = DTBH_PLATFORM_CODE;
+        entry->subtype = DTBH_SUBTYPE_CODE;
+        entry->hw_rev = ntohl(prop_hw_rev[0]);
+        entry->hw_rev_end = ntohl(prop_hw_rev_end[0]);
+        entry->space = 0x20; /* space delimiter */
+        entry->blob = blob;
+
+        entry_count++;
+
+        hdr_sz += entry_count * DT_ENTRY_PHYS_SIZE;
+    }
+
+    closedir(dir);
+
+    if (entry_count == 0) {
+        warnx("unable to locate any dtbs in the given path");
+        return NULL;
+    }
+
+    hdr_sz += sizeof(uint32_t); /* eot marker */
+    hdr_sz = (hdr_sz + pagemask) & ~pagemask;
+
+    qsort(entries, entry_count, sizeof(struct dt_entry), dt_entry_cmp);
+
+    /* The size of the dt header is now known, calculate the blob offsets... */
+    offset = hdr_sz;
+    for (blob = blob_list; blob; blob = blob->next) {
+        blob->offset = offset;
+        offset += (blob->size + pagemask) & ~pagemask;
+    }
+
+    /* ...and update the entries */
+    for (c = 0; c < entry_count; c++) {
+        entry = &entries[c];
+
+        entry->offset = entry->blob->offset;
+        entry->size = (entry->blob->size + pagemask) & ~pagemask;
+    }
+
+    /*
+     * All parts are now gathered, so build the dt block
+     */
+    dtbh = calloc(hdr_sz + blob_sz, 1);
+    if (dtbh == NULL)
+            err(1, "failed to allocate memory");
+
+    offset = 0;
+
+    memcpy(dtbh, DTBH_MAGIC, sizeof(uint32_t));
+    memcpy(dtbh + sizeof(uint32_t), &version, sizeof(uint32_t));
+    memcpy(dtbh + (sizeof(uint32_t) * 2), &entry_count, sizeof(uint32_t));
+
+    offset += DT_HEADER_PHYS_SIZE;
+
+    /* add dtbh entries */
+    for (c = 0; c < entry_count; c++) {
+        entry = &entries[c];
+        memcpy(dtbh + offset, entry, DT_ENTRY_PHYS_SIZE);
+        offset += DT_ENTRY_PHYS_SIZE;
+    }
+
+    /* add padding after dt header */
+    offset += pagesize - (offset & pagemask);
+
+    for (blob = blob_list; blob; blob = blob->next) {
+        memcpy(dtbh + offset, blob->payload, blob->size);
+        offset += (blob->size + pagemask) & ~pagemask;
+    }
+
+    *_sz = hdr_sz + blob_sz;
+
+    return dtbh;
+}

+ 136 - 0
dtbhtool/dtbtool.txt

@@ -0,0 +1,136 @@
+Copyright (c) 2012, The Linux Foundation. All rights reserved.
+
+Redistribution and use in source form and compiled forms (SGML, HTML,
+PDF, PostScript, RTF and so forth) with or without modification, are
+permitted provided that the following conditions are met:
+
+Redistributions in source form must retain the above copyright
+notice, this list of conditions and the following disclaimer as the
+first lines of this file unmodified.
+
+Redistributions in compiled form (transformed to other DTDs,
+converted to PDF, PostScript, RTF and other formats) must reproduce
+the above copyright notice, this list of conditions and the following
+disclaimer in the documentation and/or other materials provided with
+the distribution.
+
+THIS DOCUMENTATION IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD
+DOCUMENTATION PROJECT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
+
+June 2014, Ketut Putu Kumajaya
+Samsung Exynos DTBH device tree documentation.
+
+
+Android - Table of Device Tree
+==============================
+
+0) Document revision
+   v1.0 - Initial version (dng)
+
+1) Android boot image:
+----------------------
+1.1) Header:
+   1) Magic (8B)
+   2) kernel size (4B)
+   3) kernel addr (4B)
+   4) ramdisk size (4B)
+   5) ramdisk addr (4B)
+   6) 2ndary size (4B)
+   7) 2ndary addr (4B)
+   8) tags addr (4B)
+   9) page size (4B)
+  10) unused #1 (4B) (zero in standard Android)
+  11) unused #2 (4B) (zero in standard Android)
+  12) product name (16B)
+  13) kernel cmdline (512B)
+  14) id (8B)
+
+1.2) Layout:
+   A) header (as above - 1 page)
+   B) kernel (n pages)
+   C) ramdisk (m pages)
+   D) second stage (o pages)
+
+2) Exynos DTBH table of device tree
+--------------------------
+2.1) Changes:
+   i) use "unused #1, #2" members in existing boot image
+      header to point to new table of device tree
+      (#1 - size of Exynos DTBH table of DT)
+  ii) append table of device tree (described later)
+      after "D) second stage"
+
+2.2) Format:
+                                 size
+   x      +------------------+
+   |      | MAGIC ("DTBH")   |   4B
+   |      +------------------+
+ header   | VERSION          |   uint32 (version 2, 0x00000002)
+   |      +------------------+
+   |      | num of DTBs      |   uint32 (number of DTB entries, e.g. 5 entries, 0x00000005)
+   x      +------------------+
+   |      | chip #1          |   uint32 (e.g. ID for 5422, 0x0000152e)
+   |      +------------------+
+   |      | platform #1      |   uint32 (e.g. ID for k3g, 0x00001e92)
+   |      +------------------+
+ device   | subtype #1       |   uint32 (e.g. ID for k3g_eur_open, 0x7d64f612)
+  #1      +------------------+
+ entry    | hw_rev #1        |   uint32 (e.g. k3g rev 2, 0x00000002)
+   |      +------------------+
+   |      | hw_rev_end #1    |   uint32 (e.g. k3g rev_end 2, 0x00000002)
+   |      +------------------+
+   |      | offset #1        |   uint32 (byte offset from start/before MAGIC
+   |      +------------------+           to DTB entry, e.g. 0x00000800)
+   |      | size #1          |   uint32 (size in bytes of DTB blob
+   |      +------------------+           e.g. 110,592 bytes, 0x0001b000)
+   |      | space #1         |   uint32 (0x00000020)
+   x      +------------------+
+   .              .
+   .              .  (repeat)
+   .              .
+
+   x      +------------------+
+   |      | chip #Z          |   uint32 (e.g. ID for 5422, 0x0000152e)
+   |      +------------------+
+   |      | platform #Z      |   uint32 (e.g. ID for k3g, 0x00001e92)
+   |      +------------------+
+ device   | subtype #Z       |   uint32 (e.g. ID for k3g_eur_open, 0x7d64f612)
+  #1      +------------------+
+ entry    | hw_rev #Z        |   uint32 (e.g. k3g rev 10, 0x0000000A)
+   |      +------------------+
+   |      | hw_rev_end #Z    |   uint32 (e.g. k3g rev_end 255, 0x000000FF)
+   |      +------------------+
+   |      | offset #Z        |   uint32 (byte offset from start/before MAGIC
+   |      +------------------+           to DTB entry, e.g. 0x0006c800)
+   |      | size #Z          |   uint32 (size in bytes of DTB blob
+   |      +------------------+           e.g. 110,592 bytes, 0x0001b000)
+   |      | space #Z         |   uint32 (0x00000020)
+   x      +------------------+
+          | padding          |   variable length for next DTB to start on
+          +------------------+           page boundary
+          | DTB #1           |   variable (start is page aligned)
+          |                  |
+          |                  |
+          +------------------+
+          | padding          |   variable length for next DTB to start on
+          +------------------+           page boundary
+                  .
+                  .
+                  .
+
+          +------------------+
+          | DTB #Z (last)    |   variable (start is page aligned)
+          |                  |
+          |                  |
+          +------------------+
+

+ 30 - 0
dtbhtool/libdtbimg/dtbimg.h

@@ -0,0 +1,30 @@
+/* tools/libdtbimg/dtbimg.h
+**
+** Copyright 2017, The LineageOS Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+
+#ifndef _DTBIMG_H_
+#define _DTBIMG_H_
+
+/*
+ * Returns dt image data.
+ *
+ * dtb_path: path to the compiled device tree blobs
+ * pagesize: board pagesize
+ * _sz: size of the resulting dt image
+ */
+void *load_dtbh_block(const char *dtb_path, unsigned pagesize, unsigned *_sz);
+
+#endif // _DTBIMG_H_

+ 338 - 0
dtbhtool/mkbootimg.c

@@ -0,0 +1,338 @@
+/* tools/mkbootimg/mkbootimg.c
+**
+** Copyright 2007, The Android Open Source Project
+** Copyright 2013, Sony Mobile Communications
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+**
+** June 2014, Ketut Putu Kumajaya
+** Modified for Samsung Exynos DTBH, based on mkqcdtbootimg from Sony
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <limits.h>
+
+#include <sys/types.h>
+#include <arpa/inet.h>
+#include <assert.h>
+#include <dirent.h>
+#include <err.h>
+#include <stdint.h>
+
+#include <dtbimg.h>
+
+#include <openssl/sha.h>
+#include "bootimg.h"
+
+static void *load_file(const char *fn, unsigned *_sz)
+{
+    char *data;
+    int sz;
+    int fd;
+
+    data = 0;
+    fd = open(fn, O_RDONLY);
+    if(fd < 0) return 0;
+
+    sz = lseek(fd, 0, SEEK_END);
+    if(sz < 0) goto oops;
+
+    if(lseek(fd, 0, SEEK_SET) != 0) goto oops;
+
+    data = (char*) malloc(sz);
+    if(data == 0) goto oops;
+
+    if(read(fd, data, sz) != sz) goto oops;
+    close(fd);
+
+    if(_sz) *_sz = sz;
+    return data;
+
+oops:
+    close(fd);
+    if(data != 0) free(data);
+    return 0;
+}
+
+int usage(void)
+{
+    fprintf(stderr,"usage: mkbootimg\n"
+            "       --kernel <filename>\n"
+            "       --ramdisk <filename>\n"
+            "       [ --second <2ndbootloader-filename> ]\n"
+            "       [ --cmdline <kernel-commandline> ]\n"
+            "       [ --board <boardname> ]\n"
+            "       [ --base <address> ]\n"
+            "       [ --pagesize <pagesize> ]\n"
+            "       [ --ramdisk_offset <address> ]\n"
+            "       [ --dt_dir <dtb path> ]\n"
+            "       [ --dt <filename> ]\n"
+            "       [ --signature <filename> ]\n"
+            "       -o|--output <filename>\n"
+            );
+    return 1;
+}
+
+
+
+static unsigned char padding[131072] = { 0, };
+
+int write_padding(int fd, unsigned pagesize, unsigned itemsize)
+{
+    unsigned pagemask = pagesize - 1;
+    unsigned count;
+
+    if((itemsize & pagemask) == 0) {
+        return 0;
+    }
+
+    count = pagesize - (itemsize & pagemask);
+
+    if(write(fd, padding, count) != count) {
+        return -1;
+    } else {
+        return 0;
+    }
+}
+
+int main(int argc, char **argv)
+{
+    boot_img_hdr hdr;
+
+    char *kernel_fn = 0;
+    void *kernel_data = 0;
+    char *ramdisk_fn = 0;
+    void *ramdisk_data = 0;
+    char *second_fn = 0;
+    void *second_data = 0;
+    char *cmdline = "";
+    char *bootimg = 0;
+    char *board = "";
+    char *dt_dir = 0;
+    char *dt_fn = 0;
+    void *dt_data = 0;
+    char *sig_fn = 0;
+    void *sig_data = 0;
+    unsigned pagesize = 2048;
+    int fd;
+    SHA_CTX ctx;
+    uint8_t sha[SHA_DIGEST_LENGTH];
+    unsigned base           = 0x10000000;
+    unsigned kernel_offset  = 0x00008000;
+    unsigned ramdisk_offset = 0x01000000;
+    unsigned second_offset  = 0x00f00000;
+    unsigned tags_offset    = 0x00000100;
+
+    argc--;
+    argv++;
+
+    memset(&hdr, 0, sizeof(hdr));
+
+    while(argc > 0){
+        char *arg = argv[0];
+        char *val = argv[1];
+        if(argc < 2) {
+            return usage();
+        }
+        argc -= 2;
+        argv += 2;
+        if(!strcmp(arg, "--output") || !strcmp(arg, "-o")) {
+            bootimg = val;
+        } else if(!strcmp(arg, "--kernel")) {
+            kernel_fn = val;
+        } else if(!strcmp(arg, "--ramdisk")) {
+            ramdisk_fn = val;
+        } else if(!strcmp(arg, "--second")) {
+            second_fn = val;
+        } else if(!strcmp(arg, "--cmdline")) {
+            cmdline = val;
+        } else if(!strcmp(arg, "--base")) {
+            base = strtoul(val, 0, 16);
+        } else if(!strcmp(arg, "--kernel_offset")) {
+            kernel_offset = strtoul(val, 0, 16);
+        } else if(!strcmp(arg, "--ramdisk_offset")) {
+            ramdisk_offset = strtoul(val, 0, 16);
+        } else if(!strcmp(arg, "--second_offset")) {
+            second_offset = strtoul(val, 0, 16);
+        } else if(!strcmp(arg, "--tags_offset")) {
+            tags_offset = strtoul(val, 0, 16);
+        } else if(!strcmp(arg, "--board")) {
+            board = val;
+        } else if(!strcmp(arg,"--pagesize")) {
+            pagesize = strtoul(val, 0, 10);
+            if ((pagesize != 2048) && (pagesize != 4096) && (pagesize != 8192) && (pagesize != 16384) && (pagesize != 32768) && (pagesize != 65536) && (pagesize != 131072)) {
+                fprintf(stderr,"error: unsupported page size %d\n", pagesize);
+                return -1;
+            }
+        } else if (!strcmp(arg, "--dt_dir")) {
+            dt_dir = val;
+        } else if(!strcmp(arg, "--dt")) {
+            dt_fn = val;
+        } else if(!strcmp(arg, "--signature")) {
+            sig_fn = val;
+        } else {
+            return usage();
+        }
+    }
+    hdr.page_size = pagesize;
+
+    hdr.kernel_addr =  base + kernel_offset;
+    hdr.ramdisk_addr = base + ramdisk_offset;
+    hdr.second_addr =  base + second_offset;
+    hdr.tags_addr =    base + tags_offset;
+
+    if (dt_dir && dt_fn) {
+        fprintf(stderr,"error: don't use both --dt_dir and --dt option\n");
+        return usage();
+    }
+
+    if(bootimg == 0) {
+        fprintf(stderr,"error: no output filename specified\n");
+        return usage();
+    }
+
+    if(kernel_fn == 0) {
+        fprintf(stderr,"error: no kernel image specified\n");
+        return usage();
+    }
+
+    if(ramdisk_fn == 0) {
+        fprintf(stderr,"error: no ramdisk image specified\n");
+        return usage();
+    }
+
+    if(strlen(board) >= BOOT_NAME_SIZE) {
+        fprintf(stderr,"error: board name too large\n");
+        return usage();
+    }
+
+    strcpy(hdr.name, board);
+
+    memcpy(hdr.magic, BOOT_MAGIC, BOOT_MAGIC_SIZE);
+
+    if(strlen(cmdline) > (BOOT_ARGS_SIZE - 1)) {
+        fprintf(stderr,"error: kernel commandline too large\n");
+        return 1;
+    }
+    strcpy((char*)hdr.cmdline, cmdline);
+
+    kernel_data = load_file(kernel_fn, &hdr.kernel_size);
+    if(kernel_data == 0) {
+        fprintf(stderr,"error: could not load kernel '%s'\n", kernel_fn);
+        return 1;
+    }
+
+    if(!strcmp(ramdisk_fn,"NONE")) {
+        ramdisk_data = 0;
+        hdr.ramdisk_size = 0;
+    } else {
+        ramdisk_data = load_file(ramdisk_fn, &hdr.ramdisk_size);
+        if(ramdisk_data == 0) {
+            fprintf(stderr,"error: could not load ramdisk '%s'\n", ramdisk_fn);
+            return 1;
+        }
+    }
+
+    if(second_fn) {
+        second_data = load_file(second_fn, &hdr.second_size);
+        if(second_data == 0) {
+            fprintf(stderr,"error: could not load secondstage '%s'\n", second_fn);
+            return 1;
+        }
+    }
+
+    if (dt_dir) {
+        dt_data = load_dtbh_block(dt_dir, pagesize, &hdr.dt_size);
+        if (dt_data == 0) {
+            fprintf(stderr, "error: could not load device tree blobs '%s'\n", dt_dir);
+            return 1;
+        }
+    }
+
+    if(dt_fn) {
+        dt_data = load_file(dt_fn, &hdr.dt_size);
+        if (dt_data == 0) {
+            fprintf(stderr,"error: could not load device tree image '%s'\n", dt_fn);
+            return 1;
+        }
+    }
+
+    if(sig_fn) {
+        sig_data = load_file(sig_fn, 0);
+        if (sig_data == 0) {
+            fprintf(stderr,"error: could not load signature '%s'\n", sig_fn);
+            return 1;
+        }
+    }
+
+    /* put a hash of the contents in the header so boot images can be
+     * differentiated based on their first 2k.
+     */
+    SHA1_Init(&ctx);
+    SHA1_Update(&ctx, kernel_data, hdr.kernel_size);
+    SHA1_Update(&ctx, &hdr.kernel_size, sizeof(hdr.kernel_size));
+    SHA1_Update(&ctx, ramdisk_data, hdr.ramdisk_size);
+    SHA1_Update(&ctx, &hdr.ramdisk_size, sizeof(hdr.ramdisk_size));
+    SHA1_Update(&ctx, second_data, hdr.second_size);
+    SHA1_Update(&ctx, &hdr.second_size, sizeof(hdr.second_size));
+    if(dt_data) {
+        SHA1_Update(&ctx, dt_data, hdr.dt_size);
+        SHA1_Update(&ctx, &hdr.dt_size, sizeof(hdr.dt_size));
+    }
+    SHA1_Final(sha, &ctx);
+    memcpy(hdr.id, sha,
+           SHA_DIGEST_LENGTH > sizeof(hdr.id) ? sizeof(hdr.id) : SHA_DIGEST_LENGTH);
+
+    fd = open(bootimg, O_CREAT | O_TRUNC | O_WRONLY, 0644);
+    if(fd < 0) {
+        fprintf(stderr,"error: could not create '%s'\n", bootimg);
+        return 1;
+    }
+
+    if(write(fd, &hdr, sizeof(hdr)) != sizeof(hdr)) goto fail;
+    if(write_padding(fd, pagesize, sizeof(hdr))) goto fail;
+
+    if(write(fd, kernel_data, hdr.kernel_size) != hdr.kernel_size) goto fail;
+    if(write_padding(fd, pagesize, hdr.kernel_size)) goto fail;
+
+    if(write(fd, ramdisk_data, hdr.ramdisk_size) != hdr.ramdisk_size) goto fail;
+    if(write_padding(fd, pagesize, hdr.ramdisk_size)) goto fail;
+
+    if(second_data) {
+        if(write(fd, second_data, hdr.second_size) != hdr.second_size) goto fail;
+        if(write_padding(fd, pagesize, hdr.ramdisk_size)) goto fail;
+    }
+
+    if(dt_data) {
+        if(write(fd, dt_data, hdr.dt_size) != hdr.dt_size) goto fail;
+        if(write_padding(fd, pagesize, hdr.dt_size)) goto fail;
+    }
+
+    if(sig_data) {
+        if(write(fd, sig_data, 256) != 256) goto fail;
+    }
+
+    return 0;
+
+fail:
+    unlink(bootimg);
+    close(fd);
+    fprintf(stderr,"error: failed writing '%s': %s\n", bootimg,
+            strerror(errno));
+    return 1;
+}

+ 126 - 0
dtbhtool/mkdtbimg.c

@@ -0,0 +1,126 @@
+/* tools/mkbootimg/mkdtbimg.c
+**
+** Copyright 2016-2017, The LineageOS Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+**
+** December 2016, Christopher N. Hesse
+** Separate dt creation from mkbootimg program.
+**
+** January 2017, Christopher N. Hesse
+** Adjust to dtbToolCM call syntax.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <limits.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <arpa/inet.h>
+#include <assert.h>
+#include <dirent.h>
+#include <err.h>
+#include <stdint.h>
+
+#include <dtbimg.h>
+
+int usage(void)
+{
+    fprintf(stderr,"usage: mkdtimg\n"
+            "       --dt_dir <dtb path>\n"
+            "       -o|--output <filename>\n"
+            );
+    return 1;
+}
+
+
+
+int main(int argc, char **argv)
+{
+    char *dtimg = 0;
+    char *dt_dir = 0;
+    void *dt_data = 0;
+    unsigned pagesize = 0;
+    unsigned default_pagesize = 2048;
+    uint32_t dt_size;
+    int fd;
+    struct stat sbuf;
+
+    argc--;
+    argv++;
+
+    while(argc > 0){
+        char *arg = argv[0];
+        char *val = argv[1];
+        if(argc < 1) {
+            return usage();
+        }
+        argc -= 2;
+        argv += 2;
+        if(!strcmp(arg, "--output") || !strcmp(arg, "-o")) {
+            dtimg = val;
+        } else if (!strcmp(arg, "--dt_dir")) {
+            dt_dir = val;
+        } else if (!strcmp(arg, "-p")) {
+            // Ignore this parameter
+        } else if (!strcmp(arg, "-s")) {
+            pagesize = strtol(val, NULL, 10);
+            if (pagesize == 0)
+                pagesize = default_pagesize;
+        } else {
+            // Check if this is the dtb path
+            int err = stat(arg, &sbuf);
+            if (err != 0 || !S_ISDIR(sbuf.st_mode))
+                return usage();
+            dt_dir = arg;
+        }
+    }
+
+    if(dtimg == 0) {
+        fprintf(stderr,"error: no output filename specified\n");
+        return usage();
+    }
+
+    if(dt_dir == 0) {
+        fprintf(stderr,"error: no dtb path specified\n");
+        return usage();
+    }
+
+    dt_data = load_dtbh_block(dt_dir, pagesize, &dt_size);
+    if (dt_data == 0) {
+        fprintf(stderr, "error: could not load device tree blobs '%s'\n", dt_dir);
+        return 1;
+    }
+
+    fd = open(dtimg, O_CREAT | O_TRUNC | O_WRONLY, 0644);
+    if(fd < 0) {
+        fprintf(stderr,"error: could not create '%s'\n", dtimg);
+        return 1;
+    }
+
+    if(write(fd, dt_data, dt_size) != dt_size) goto fail;
+
+    return 0;
+
+fail:
+    unlink(dtimg);
+    close(fd);
+    fprintf(stderr,"error: failed writing '%s': %s\n", dtimg,
+            strerror(errno));
+    return 1;
+}

+ 37 - 0
dtbhtool/samsung_dtbh.h

@@ -0,0 +1,37 @@
+/* tools/mkbootimg/samsung_dtbh.h
+**
+** Copyright 2017, The LineageOS Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+
+#ifndef _SAMSUNG_DTBH_H_
+#define _SAMSUNG_DTBH_H_
+
+#define DTBH_MAGIC         "DTBH"
+#define DTBH_VERSION       2
+#define DTBH_PLATFORM      "android"
+#define DTBH_SUBTYPE       "samsung"
+ /* Hardcoded entry */
+#define DTBH_PLATFORM_CODE 0x000050a6
+#define DTBH_SUBTYPE_CODE  0x217584da
+
+/* DTBH_MAGIC + DTBH_VERSION + DTB counts */
+#define DT_HEADER_PHYS_SIZE 12
+
+/*
+ * keep the eight uint32_t entries first in this struct so we can memcpy them to the file
+ */
+#define DT_ENTRY_PHYS_SIZE (sizeof(uint32_t) * 8)
+
+#endif // _SAMSUNG_DTBH_H_

+ 222 - 0
dtbhtool/unpackbootimg.c

@@ -0,0 +1,222 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <limits.h>
+#include <libgen.h>
+
+#include "bootimg.h"
+
+typedef unsigned char byte;
+
+int read_padding(FILE* f, unsigned itemsize, int pagesize)
+{
+    byte* buf = (byte*)malloc(sizeof(byte) * pagesize);
+    unsigned pagemask = pagesize - 1;
+    unsigned count;
+
+    if((itemsize & pagemask) == 0) {
+        free(buf);
+        return 0;
+    }
+
+    count = pagesize - (itemsize & pagemask);
+
+    fread(buf, count, 1, f);
+    free(buf);
+    return count;
+}
+
+void write_string_to_file(char* file, char* string)
+{
+    FILE* f = fopen(file, "w");
+    fwrite(string, strlen(string), 1, f);
+    fwrite("\n", 1, 1, f);
+    fclose(f);
+}
+
+int usage() {
+    printf("usage: unpackbootimg\n");
+    printf("\t-i|--input boot.img\n");
+    printf("\t[ -o|--output output_directory]\n");
+    printf("\t[ -p|--pagesize <size-in-hexadecimal> ]\n");
+    return 0;
+}
+
+int main(int argc, char** argv)
+{
+    char tmp[PATH_MAX];
+    char* directory = "./";
+    char* filename = NULL;
+    int pagesize = 0;
+
+    argc--;
+    argv++;
+    while(argc > 0){
+        char *arg = argv[0];
+        char *val = argv[1];
+        argc -= 2;
+        argv += 2;
+        if(!strcmp(arg, "--input") || !strcmp(arg, "-i")) {
+            filename = val;
+        } else if(!strcmp(arg, "--output") || !strcmp(arg, "-o")) {
+            directory = val;
+        } else if(!strcmp(arg, "--pagesize") || !strcmp(arg, "-p")) {
+            pagesize = strtoul(val, 0, 16);
+        } else {
+            return usage();
+        }
+    }
+    
+    if (filename == NULL) {
+        return usage();
+    }
+    
+    int total_read = 0;
+    FILE* f = fopen(filename, "rb");
+    boot_img_hdr header;
+
+    //printf("Reading header...\n");
+    int i;
+    for (i = 0; i <= 512; i++) {
+        fseek(f, i, SEEK_SET);
+        fread(tmp, BOOT_MAGIC_SIZE, 1, f);
+        if (memcmp(tmp, BOOT_MAGIC, BOOT_MAGIC_SIZE) == 0)
+            break;
+    }
+    total_read = i;
+    if (i > 512) {
+        printf("Android boot magic not found.\n");
+        return 1;
+    }
+    fseek(f, i, SEEK_SET);
+    printf("Android magic found at: %d\n", i);
+
+    fread(&header, sizeof(header), 1, f);
+    printf("BOARD_KERNEL_CMDLINE %s\n", header.cmdline);
+    printf("BOARD_KERNEL_BASE %08x\n", header.kernel_addr - 0x00008000);
+    printf("BOARD_RAMDISK_OFFSET %08x\n", header.ramdisk_addr - header.kernel_addr + 0x00008000);
+    printf("BOARD_SECOND_OFFSET %08x\n", header.second_addr - header.kernel_addr + 0x00008000);
+    printf("BOARD_TAGS_OFFSET %08x\n",header.tags_addr - header.kernel_addr + 0x00008000);
+    printf("BOARD_PAGE_SIZE %d\n", header.page_size);
+    printf("BOARD_SECOND_SIZE %d\n", header.second_size);
+    printf("BOARD_DT_SIZE %d\n", header.dt_size);
+    
+    if (pagesize == 0) {
+        pagesize = header.page_size;
+    }
+    
+    //printf("cmdline...\n");
+    sprintf(tmp, "%s/%s", directory, basename(filename));
+    strcat(tmp, "-cmdline");
+    write_string_to_file(tmp, header.cmdline);
+    
+    //printf("base...\n");
+    sprintf(tmp, "%s/%s", directory, basename(filename));
+    strcat(tmp, "-base");
+    char basetmp[200];
+    sprintf(basetmp, "%08x", header.kernel_addr - 0x00008000);
+    write_string_to_file(tmp, basetmp);
+
+    //printf("ramdisk_offset...\n");
+    sprintf(tmp, "%s/%s", directory, basename(filename));
+    strcat(tmp, "-ramdisk_offset");
+    char ramdisktmp[200];
+    sprintf(ramdisktmp, "%08x", header.ramdisk_addr - header.kernel_addr + 0x00008000);
+    write_string_to_file(tmp, ramdisktmp);
+
+    //printf("second_offset...\n");
+    sprintf(tmp, "%s/%s", directory, basename(filename));
+    strcat(tmp, "-second_offset");
+    char secondtmp[200];
+    sprintf(secondtmp, "%08x", header.second_addr - header.kernel_addr + 0x00008000);
+    write_string_to_file(tmp, secondtmp);
+
+    //printf("tags_offset...\n");
+    sprintf(tmp, "%s/%s", directory, basename(filename));
+    strcat(tmp, "-tags_offset");
+    char tagstmp[200];
+    sprintf(tagstmp, "%08x", header.tags_addr - header.kernel_addr + 0x00008000);
+    write_string_to_file(tmp, tagstmp);
+
+    //printf("pagesize...\n");
+    sprintf(tmp, "%s/%s", directory, basename(filename));
+    strcat(tmp, "-pagesize");
+    char pagesizetmp[200];
+    sprintf(pagesizetmp, "%d", header.page_size);
+    write_string_to_file(tmp, pagesizetmp);
+    
+    total_read += sizeof(header);
+    //printf("total read: %d\n", total_read);
+    total_read += read_padding(f, sizeof(header), pagesize);
+
+    sprintf(tmp, "%s/%s", directory, basename(filename));
+    strcat(tmp, "-zImage");
+    FILE *k = fopen(tmp, "wb");
+    byte* kernel = (byte*)malloc(header.kernel_size);
+    //printf("Reading kernel...\n");
+    fread(kernel, header.kernel_size, 1, f);
+    total_read += header.kernel_size;
+    fwrite(kernel, header.kernel_size, 1, k);
+    fclose(k);
+
+    //printf("total read: %d\n", header.kernel_size);
+    total_read += read_padding(f, header.kernel_size, pagesize);
+
+
+    byte* ramdisk = (byte*)malloc(header.ramdisk_size);
+    //printf("Reading ramdisk...\n");
+    fread(ramdisk, header.ramdisk_size, 1, f);
+    total_read += header.ramdisk_size;
+    sprintf(tmp, "%s/%s", directory, basename(filename));
+    if(ramdisk[0] == 0x02 && ramdisk[1]== 0x21)
+        strcat(tmp, "-ramdisk.lz4");
+    else
+        strcat(tmp, "-ramdisk.gz");
+    FILE *r = fopen(tmp, "wb");
+    fwrite(ramdisk, header.ramdisk_size, 1, r);
+    fclose(r);
+
+    total_read += read_padding(f, header.ramdisk_size, pagesize);
+
+    sprintf(tmp, "%s/%s", directory, basename(filename));
+    strcat(tmp, "-second");
+    FILE *s = fopen(tmp, "wb");
+    byte* second = (byte*)malloc(header.second_size);
+    //printf("Reading second...\n");
+    fread(second, header.second_size, 1, f);
+    total_read += header.second_size;
+    fwrite(second, header.second_size, 1, r);
+    fclose(s);
+
+    total_read += read_padding(f, header.second_size, pagesize);
+
+    sprintf(tmp, "%s/%s", directory, basename(filename));
+    strcat(tmp, "-dt");
+    FILE *d = fopen(tmp, "wb");
+    byte* dt = (byte*)malloc(header.dt_size);
+    //printf("Reading dt...\n");
+    fread(dt, header.dt_size, 1, f);
+    total_read += header.dt_size;
+    fwrite(dt, header.dt_size, 1, r);
+    fclose(d);
+
+    total_read += read_padding(f, header.dt_size, pagesize);
+
+    sprintf(tmp, "%s/%s", directory, basename(filename));
+    strcat(tmp, "-signature");
+    FILE *fsig = fopen(tmp, "wb");
+    byte* bsig = (byte*)malloc(256);
+    //printf("Reading signature...\n");
+    fread(bsig, 256, 1, f);
+    total_read += 256;
+    fwrite(bsig, 256, 1, r);
+    fclose(fsig);
+
+    fclose(f);
+    
+    //printf("Total Read: %d\n", total_read);
+    return 0;
+}

+ 185 - 0
dtbhtool/unpackdtbhimg.c

@@ -0,0 +1,185 @@
+/*
+ * Copyright 2018, The LineageOS Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#define DEFAULT_PAGE_SIZE 2048
+#define DT_NAME_LEN 64
+
+struct dt_entry {
+    uint32_t chip;
+    uint32_t platform;
+    uint32_t subtype;
+    uint32_t hw_rev;
+    uint32_t hw_rev_end;
+    uint32_t offset;
+    uint32_t size; /* including padding */
+    uint32_t space;
+};
+
+struct dtbh_header {
+    uint32_t magic;
+    uint32_t version;
+    uint32_t entry_count;
+
+    struct dt_entry entries[];
+};
+
+static void show_dt_entry(struct dt_entry *ent) {
+    printf("chip: %u, platform: 0x%x, subtype: 0x%x, hw_rev: %u, hw_rev_end: %u, offset: %u, "
+            "size: %u, space: %u\n", ent->chip, ent->platform, ent->subtype, ent->hw_rev,
+            ent->hw_rev_end, ent->offset, ent->size, ent->space);
+}
+
+static void dump_dtb(void *buffer, uint32_t size, char *dest)
+{
+    FILE *output;
+    ssize_t len;
+
+    output = fopen(dest, "wb");
+    if (output == NULL) {
+        fprintf(stderr, "error: could not open %s\n", dest);
+        return;
+    }
+
+    len = fwrite(buffer, size, 1, output);
+    fclose(output);
+
+    if (len < 0) {
+        printf("error: failed to write %s (%s)\n", dest, strerror(errno));
+        return;
+    }
+
+    printf("Successfully dumped %s (size=%zu)\n", dest, size);
+}
+
+int usage(void)
+{
+    fprintf(stderr,"usage: unpackdtbhimg\n"
+            "       -i|--input <dtbh image path>\n"
+            "       -o|--output <directory>\n"
+            "       -p|--pagesize <pagesize>\n"
+            );
+    return 1;
+}
+
+int main(int argc, char *argv[]) {
+    char *dtbhimg = 0;
+    char *output_dir = 0;
+    FILE *dtbhimg_fp;
+    ssize_t len;
+    int page_size = DEFAULT_PAGE_SIZE;
+    struct dtbh_header *header;
+    void *dt_blob;
+
+    argc--;
+    argv++;
+
+    while (argc > 0){
+        char *arg = argv[0];
+        char *val = argv[1];
+        if (argc < 1) {
+            return usage();
+        }
+        argc -= 2;
+        argv += 2;
+        if (!strcmp(arg, "--input") || !strcmp(arg, "-i")) {
+            dtbhimg = val;
+        } else if (!strcmp(arg, "--output") || !strcmp(arg, "-o")) {
+            output_dir = val;
+        } else if (!strcmp(arg, "--pagesize") || !strcmp(arg, "-p")) {
+            page_size = atoi(val);
+        }
+    }
+
+    if (dtbhimg == 0) {
+        fprintf(stderr,"error: no input filename specified\n");
+        return usage();
+    }
+
+    if (output_dir == 0) {
+        fprintf(stderr,"error: no output path specified\n");
+        return usage();
+    }
+
+    printf("using page_size: %d\n", page_size);
+
+    dtbhimg_fp = fopen(dtbhimg, "r");
+    if (dtbhimg_fp == NULL) {
+        fprintf(stderr, "error: could not open %s\n", dtbhimg);
+        goto err_open;
+    }
+
+    header = calloc(page_size, 1);
+    if (header == NULL) {
+        goto err_calloc;
+    }
+
+    len = fread(header, page_size, 1, dtbhimg_fp);
+    if (len != 1) {
+        fprintf(stderr, "Failed to read DTBH header: %s\n", strerror(errno));
+        goto err_read;
+    }
+
+    printf("DTBH_MAGIC = '%.4s'\n", &header->magic);
+    printf("DTBH_VERSION = %u\n", header->version);
+    printf("Number of entries: %u\n", header->entry_count);
+
+    for (uint32_t i = 0; i < header->entry_count; i++) {
+        printf("DTB %d: ", i);
+        show_dt_entry(&header->entries[i]);
+        dt_blob = malloc(header->entries[i].size);
+        if (fseek(dtbhimg_fp, header->entries[i].offset, SEEK_SET) != 0) {
+            fprintf(stderr, "failed to set offset to 0x%x: %s\n", header->entries[i].offset,
+                    strerror(errno));
+            goto err_loop;
+        }
+        len = fread(dt_blob, header->entries[i].size, 1, dtbhimg_fp);
+        if (len != 1) {
+            fprintf(stderr, "Failed to read DTB: %s\n", strerror(errno));
+        }
+
+        size_t dest_file_len = DT_NAME_LEN + strlen(output_dir);
+        char dest_file[dest_file_len];
+        snprintf(dest_file, dest_file_len, "%s/chip%u-0x%x-0x%x_rev%u-%u.dtb", output_dir,
+                 header->entries[i].chip, header->entries[i].platform, header->entries[i].subtype,
+                 header->entries[i].hw_rev, header->entries[i].hw_rev_end);
+        dump_dtb(dt_blob, header->entries[i].size, dest_file);
+        free(dt_blob);
+    }
+
+    free(header);
+    fclose(dtbhimg_fp);
+
+    return 0;
+
+err_loop:
+    free(dt_blob);
+err_read:
+    free(header);
+err_calloc:
+    fclose(dtbhimg_fp);
+err_open:
+    return 1;
+}

+ 0 - 9
init/Android.mk

@@ -1,9 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE_TAGS := optional
-LOCAL_C_INCLUDES := system/core/init
-LOCAL_CFLAGS := -Wall
-LOCAL_SRC_FILES := init_hero2lte.cpp
-LOCAL_MODULE := libinit_hero2lte
-include $(BUILD_STATIC_LIBRARY)

+ 0 - 60
init/init_hero2lte.cpp

@@ -1,60 +0,0 @@
-/*
-   Copyright (c) 2013, The Linux Foundation. All rights reserved.
-
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions are
-   met:
-    * Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above
-      copyright notice, this list of conditions and the following
-      disclaimer in the documentation and/or other materials provided
-      with the distribution.
-    * Neither the name of The Linux Foundation nor the names of its
-      contributors may be used to endorse or promote products derived
-      from this software without specific prior written permission.
-
-   THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
-   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-   ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
-   BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-   BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-   OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-   IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdlib.h>
-
-#include "vendor_init.h"
-#include "property_service.h"
-#include "util.h"
-
-void vendor_load_properties()
-{
-	char bootloader[PROP_VALUE_MAX];
-
-	property_get("ro.bootloader", bootloader);
-
-	if (strstr(bootloader, "G935W8")) {
-		/* Canada */
-		property_set("ro.product.model", "SM-G935W8");
-		property_set("ro.product.name", "hero2ltebmc");
-	} else if (strstr(bootloader, "G935X")) {
-		/* store model / prerelease */
-		property_set("ro.product.model", "SM-G935X");
-		property_set("ro.product.name", "hero2ltexx");
-	} else if (strstr(bootloader, "G935FD")) {
-		/* international duos */
-		property_set("ro.product.model", "SM-G935FD");
-		property_set("ro.product.name", "hero2ltexx");
-	} else {
-		/* all other variants become international */
-		property_set("ro.product.model", "SM-G935F");
-		property_set("ro.product.name", "hero2ltexx");
-	}
-	property_set("ro.product.device", "hero2lte");
-}

+ 79 - 0
mkbootimg.mk

@@ -0,0 +1,79 @@
+# Copyright (C) 2017 The LineageOS Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH := $(call my-dir)
+
+ifeq ($(strip $(BOARD_KERNEL_SEPARATED_DT)),true)
+ifneq ($(strip $(BOARD_KERNEL_PREBUILT_DT)),true)
+ifeq ($(strip $(BUILD_TINY_ANDROID)),true)
+include device/qcom/common/dtbtool/Android.mk
+endif
+
+ifeq ($(strip $(TARGET_CUSTOM_DTBTOOL)),)
+DTBTOOL_NAME := dtbToolLineage
+else
+DTBTOOL_NAME := $(TARGET_CUSTOM_DTBTOOL)
+endif
+
+DTBTOOL := $(HOST_OUT_EXECUTABLES)/$(DTBTOOL_NAME)$(HOST_EXECUTABLE_SUFFIX)
+
+INSTALLED_DTIMAGE_TARGET := $(PRODUCT_OUT)/dt.img
+
+ifeq ($(strip $(TARGET_CUSTOM_DTBTOOL)),)
+# dtbToolCM will search subdirectories
+possible_dtb_dirs = $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/
+else
+# Most specific paths must come first in possible_dtb_dirs
+possible_dtb_dirs = $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/dts/exynos/ $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/dts/ $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/
+endif
+
+define build-dtimage-target
+    $(call pretty,"Target dt image: $@")
+    $(hide) for dir in $(possible_dtb_dirs); do \
+        if [ -d "$$dir" ]; then \
+            dtb_dir="$$dir"; \
+            break; \
+        fi; \
+    done; \
+    $(DTBTOOL) $(BOARD_DTBTOOL_ARGS) -o $@ -s $(BOARD_KERNEL_PAGESIZE) -p $(KERNEL_OUT)/scripts/dtc/ "$$dtb_dir";
+    $(hide) chmod a+r $@
+endef
+
+$(INSTALLED_DTIMAGE_TARGET): $(DTBTOOL) $(INSTALLED_KERNEL_TARGET)
+	$(build-dtimage-target)
+	@echo "Made DT image: $@"
+
+.PHONY: dtimage
+dtimage: $(INSTALLED_DTIMAGE_TARGET)
+
+endif
+endif
+
+$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(BOOTIMAGE_EXTRA_DEPS)
+	$(call pretty,"Target boot image: $@")
+	$(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@
+	$(hide) echo -n "SEANDROIDENFORCE" >> $@
+	$(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE),raw)
+	@echo "Made boot image: $@"
+
+FLASH_IMAGE_TARGET ?= $(PRODUCT_OUT)/recovery.tar
+
+$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) $(recovery_ramdisk) $(recovery_kernel) $(RECOVERYIMAGE_EXTRA_DEPS)
+	@echo "----- Making recovery image ------"
+	$(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@ --id > $(RECOVERYIMAGE_ID_FILE)
+	$(hide) echo -n "SEANDROIDENFORCE" >> $@
+	$(hide) $(call assert-max-image-size,$@,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw)
+	@echo "Made recovery image: $@"
+	$(hide) tar -C $(PRODUCT_OUT) -H ustar -c recovery.img > $(FLASH_IMAGE_TARGET)
+	@echo "Made Odin flashable recovery tar: ${FLASH_IMAGE_TARGET}"

+ 6 - 0
omni.dependencies

@@ -1,2 +1,8 @@
 [
+	{
+		"remote":"github",
+		"repository":"not7100/android_kernel_samsung_universal8890",
+		"target_path":"kernel/samsung/universal8890",
+		"revision":"android-8.1"
+	}
 ]

+ 0 - 7
omni_hero2lte.mk

@@ -1,16 +1,9 @@
-# Release name
-PRODUCT_RELEASE_NAME := hero2lte
-
 # Inherit from the common Open Source product configuration
 $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
 
 # Inherit from our custom product configuration
 $(call inherit-product, vendor/omni/config/common.mk)
 
-PRODUCT_PACKAGES += \
-	charger_res_images \
-	charger
-
 ## Device identifier. This must come after all inclusions
 PRODUCT_DEVICE := hero2lte
 PRODUCT_NAME := omni_hero2lte

+ 14 - 11
recovery.fstab

@@ -1,11 +1,14 @@
-/boot		emmc	/dev/block/bootdevice/by-name/BOOT
-/recovery	emmc	/dev/block/bootdevice/by-name/RECOVERY	flags=backup=1
-/system		ext4	/dev/block/bootdevice/by-name/SYSTEM
-/data		ext4	/dev/block/bootdevice/by-name/USERDATA	flags=encryptable=footer;length=-20480
-/cache		ext4	/dev/block/bootdevice/by-name/CACHE
-/modem		emmc	/dev/block/bootdevice/by-name/RADIO	flags=backup=1;display="Baseband"
-/modem_debug	emmc	/dev/block/bootdevice/by-name/CP_DEBUG	flags=backup=1;display="Baseband (Debug)";subpartitionof=/modem
-/efs		ext4	/dev/block/bootdevice/by-name/EFS	flags=backup=1;display="EFS"
-/external_sd	vfat	/dev/block/mmcblk0p1 /dev/block/mmcblk0	flags=display="Micro SDcard";storage;wipeingui;removable
-/usb-otg	vfat	/dev/block/sde1 /dev/block/sde		flags=display="USB-OTG";storage;wipeingui;removable
-/misc		emmc	/dev/block/bootdevice/by-name/OTA
+/boot			emmc	/dev/block/platform/155a0000.ufs/by-name/BOOT
+/recovery		emmc	/dev/block/platform/155a0000.ufs/by-name/RECOVERY	flags=backup=1
+
+/system			ext4	/dev/block/platform/155a0000.ufs/by-name/SYSTEM
+/data			ext4	/dev/block/platform/155a0000.ufs/by-name/USERDATA	flags=encryptable=footer;length=-20480
+/cache			ext4	/dev/block/platform/155a0000.ufs/by-name/CACHE
+/misc			emmc    /dev/block/platform/155a0000.ufs/by-name/OTA
+
+/modem			emmc	/dev/block/platform/155a0000.ufs/by-name/RADIO		flags=backup=1;display="Baseband"
+/modem_debug		emmc	/dev/block/platform/155a0000.ufs/by-name/CP_DEBUG	flags=backup=1;display="Baseband (Debug)";subpartitionof=/modem
+/efs			ext4	/dev/block/platform/155a0000.ufs/by-name/EFS		flags=backup=1;display="EFS"
+
+/external_sd		vfat	/dev/block/mmcblk0p1 /dev/block/mmcblk0			flags=display="Micro SDcard";storage;wipeingui;removable
+/usb-otg		vfat	/dev/block/sde1 /dev/block/sde				flags=display="USB-OTG";storage;wipeingui;removable

+ 1 - 1
recovery/root/fstab.samsungexynos8890

@@ -5,7 +5,7 @@
 #<src>                                                  <mnt_point> <type>  <mnt_flags and options>                                                                        <fs_mgr_flags>
 /dev/block/platform/155a0000.ufs/by-name/SYSTEM         /system     ext4    ro,errors=panic                                                                                wait
 /dev/block/platform/155a0000.ufs/by-name/CACHE          /cache      ext4    noatime,nosuid,nodev,noauto_da_alloc,discard,journal_async_commit,data=ordered,errors=panic    wait,check
-/dev/block/platform/155a0000.ufs/by-name/USERDATA       /data       ext4    noatime,nosuid,nodev,noauto_da_alloc,discard,journal_async_commit,data=ordered,errors=panic    wait,check,forceencrypt=footer
+/dev/block/platform/155a0000.ufs/by-name/USERDATA       /data       ext4    noatime,nosuid,nodev,noauto_da_alloc,discard,journal_async_commit,data=ordered,errors=panic    wait,check,quota,forceencrypt=footer
 /dev/block/platform/155a0000.ufs/by-name/EFS            /efs        ext4    noatime,nosuid,nodev,noauto_da_alloc,discard,journal_async_commit,data=ordered,errors=panic    wait,check
 
 # VOLD

+ 0 - 15
recovery/root/init.recovery.samsungexynos8890.rc

@@ -1,15 +0,0 @@
-# Encryption support
-
-on init
-    chown system system /dev/ion
-    chmod 0664 /dev/ion
-
-service keystore /sbin/keystore /data/misc/keystore
-    class core
-    disabled
-    user root
-    group root keystore drmrpc system
-    seclabel u:r:recovery:s0
-
-#on property:ro.crypto.state=encrypted
-#    start keystore

+ 18 - 37
recovery/root/init.recovery.usb.rc

@@ -1,66 +1,47 @@
 on init
-    chown system system /sys/class/android_usb/android0/terminal_version
-    chmod 0660 /sys/class/android_usb/android0/terminal_version
-    chown system system /sys/devices/15400000.usb/15400000.dwc3/gadget/lun0/file
-    chmod 0660 /sys/devices/15400000.usb/15400000.dwc3/gadget/lun0/file
-
-    write /sys/class/android_usb/android0/iSerial ${ro.serialno}
+    write /sys/class/android_usb/android0/iSerial $ro.serialno
     write /sys/class/android_usb/android0/f_rndis/manufacturer Samsung
-    write /sys/class/android_usb/android0/f_rndis/vendorID 04E8
+    write /sys/class/android_usb/android0/f_rndis/vendorID 18d1
     write /sys/class/android_usb/android0/f_rndis/wceis 1
 
 on boot
-    setprop sys.usb.config none
-
     write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
     write /sys/class/android_usb/android0/iProduct ${ro.product.model}
     write /sys/class/android_usb/android0/iSerial ${ro.serialno}
-    write /sys/class/android_usb/android0/bDeviceClass 0
-    write /sys/class/android_usb/android0/bDeviceSubClass 0
-    write /sys/class/android_usb/android0/bDeviceProtocol 0
-
-    # set up the usb mass storage lun
-    write /sys/class/android_usb/f_mass_storage/inquiry_string "Samsung"
-    write /sys/devices/15400000.usb/15400000.dwc3/gadget/lun0/cdrom 0
-    write /sys/devices/15400000.usb/15400000.dwc3/gadget/lun0/nofua 0
-    write /sys/devices/15400000.usb/15400000.dwc3/gadget/lun0/ro 0
+    write /sys/class/android_usb/android0/f_mass_storage/inquiry_string "Samsung"
 
-    setprop sys.usb.config ${persist.sys.usb.config}
+on post-fs
+    mkdir /dev/usb-ffs 0770 shell shell
+    mkdir /dev/usb-ffs/adb 0770 shell shell
+    mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
+    write /sys/class/android_usb/android0/f_ffs/aliases adb
 
 on property:sys.usb.config=none
-    stop adbd
-    write /sys/class/android_usb/android0/enable 0
-    write /sys/class/android_usb/android0/idVendor 04E8
-    write /sys/class/android_usb/android0/idProduct 685E
-    write /sys/class/android_usb/android0/bDeviceClass 0
     setprop sys.usb.state ${sys.usb.config}
 
-on property:sys.usb.config=adb
-    stop adbd
+on property:sys.usb.config=mtp
     write /sys/class/android_usb/android0/enable 0
-    write /sys/class/android_usb/android0/idVendor 04E8
-    write /sys/class/android_usb/android0/idProduct 685E
+    write /sys/class/android_usb/android0/idVendor 04e8
+    write /sys/class/android_usb/android0/idProduct 6860
     write /sys/class/android_usb/android0/functions ${sys.usb.config}
-    write /sys/class/android_usb/android0/enable ${service.adb.root}
-    start adbd
+    write /sys/class/android_usb/android0/enable 1
     setprop sys.usb.state ${sys.usb.config}
 
-on property:sys.usb.config=mtp,adb
-    stop adbd
+on property:sys.usb.config=adb
     write /sys/class/android_usb/android0/enable 0
-    write /sys/class/android_usb/android0/idVendor 04E8
+    write /sys/class/android_usb/android0/idVendor 04e8
     write /sys/class/android_usb/android0/idProduct 6860
     write /sys/class/android_usb/android0/functions ${sys.usb.config}
     write /sys/class/android_usb/android0/enable 1
     start adbd
     setprop sys.usb.state ${sys.usb.config}
 
-on property:sys.usb.config=mass_storage,adb
-    stop adbd
+on property:sys.usb.config=mtp,adb
     write /sys/class/android_usb/android0/enable 0
-    write /sys/class/android_usb/android0/idVendor 04E8
-    write /sys/class/android_usb/android0/idProduct 685E
+    write /sys/class/android_usb/android0/idVendor 04e8
+    write /sys/class/android_usb/android0/idProduct 6860
     write /sys/class/android_usb/android0/functions ${sys.usb.config}
     write /sys/class/android_usb/android0/enable 1
     start adbd
     setprop sys.usb.state ${sys.usb.config}
+

+ 0 - 2005
recovery/root/prebuilt_file_contexts

@@ -1,2005 +0,0 @@
-#line 1 "external/sepolicy/file_contexts"
-###########################################
-# Root
-/			u:object_r:rootfs:s0
-
-# Data files
-/adb_keys		u:object_r:adb_keys_file:s0
-/default\.prop		u:object_r:rootfs:s0
-/fstab\..*		u:object_r:rootfs:s0
-/init\..*		u:object_r:rootfs:s0
-/res(/.*)?		u:object_r:rootfs:s0
-/ueventd\..*		u:object_r:rootfs:s0
-
-# Executables
-/charger		u:object_r:rootfs:s0
-/init			u:object_r:init_exec:s0
-/sbin(/.*)?		u:object_r:rootfs:s0
-
-# Empty directories
-/lost\+found		u:object_r:rootfs:s0
-/proc			u:object_r:rootfs:s0
-
-# SELinux policy files
-/file_contexts		u:object_r:rootfs:s0
-/property_contexts	u:object_r:rootfs:s0
-/seapp_contexts		u:object_r:rootfs:s0
-/sepolicy		u:object_r:rootfs:s0
-
-##########################
-# Devices
-#
-/dev(/.*)?		u:object_r:device:s0
-/dev/akm8973.*		u:object_r:sensors_device:s0
-/dev/accelerometer	u:object_r:sensors_device:s0
-/dev/adf[0-9]*		u:object_r:graphics_device:s0
-/dev/adf-interface[0-9]*\.[0-9]*	u:object_r:graphics_device:s0
-/dev/adf-overlay-engine[0-9]*\.[0-9]*	u:object_r:graphics_device:s0
-/dev/alarm		u:object_r:alarm_device:s0
-/dev/android_adb.*	u:object_r:adb_device:s0
-/dev/ashmem		u:object_r:ashmem_device:s0
-/dev/audio.*		u:object_r:audio_device:s0
-/dev/binder		u:object_r:binder_device:s0
-/dev/block(/.*)?	u:object_r:block_device:s0
-/dev/block/dm-[0-9]+	u:object_r:dm_device:s0
-/dev/block/loop[0-9]*	u:object_r:loop_device:s0
-/dev/block/vold/.+	u:object_r:vold_device:s0
-/dev/block/ram[0-9]*	u:object_r:ram_device:s0
-/dev/bus/usb(.*)?       u:object_r:usb_device:s0
-/dev/cam		u:object_r:camera_device:s0
-/dev/console		u:object_r:console_device:s0
-/dev/cpuctl(/.*)?	u:object_r:cpuctl_device:s0
-/dev/device-mapper	u:object_r:dm_device:s0
-/dev/eac		u:object_r:audio_device:s0
-/dev/fscklogs(/.*)?	u:object_r:fscklogs:s0
-/dev/full		u:object_r:full_device:s0
-/dev/fuse		u:object_r:fuse_device:s0
-/dev/graphics(/.*)?	u:object_r:graphics_device:s0
-/dev/hw_random		u:object_r:hw_random_device:s0
-/dev/input(/.*)		u:object_r:input_device:s0
-/dev/iio:device[0-9]+   u:object_r:iio_device:s0
-/dev/ion		u:object_r:ion_device:s0
-/dev/kmem		u:object_r:kmem_device:s0
-/dev/log(/.*)?		u:object_r:log_device:s0
-/dev/mem		u:object_r:kmem_device:s0
-/dev/modem.*		u:object_r:radio_device:s0
-/dev/mpu		u:object_r:gps_device:s0
-/dev/mpuirq		u:object_r:gps_device:s0
-/dev/mtd(/.*)?		u:object_r:mtd_device:s0
-/dev/mtp_usb		u:object_r:mtp_device:s0
-/dev/pmsg0		u:object_r:pmsg_device:s0
-/dev/pn544		u:object_r:nfc_device:s0
-/dev/ppp		u:object_r:ppp_device:s0
-/dev/ptmx		u:object_r:ptmx_device:s0
-/dev/pvrsrvkm		u:object_r:gpu_device:s0
-/dev/kmsg		u:object_r:kmsg_device:s0
-/dev/null		u:object_r:null_device:s0
-/dev/nvhdcp1		u:object_r:video_device:s0
-/dev/random		u:object_r:random_device:s0
-/dev/rpmsg-omx[0-9]	u:object_r:rpmsg_device:s0
-/dev/rproc_user	u:object_r:rpmsg_device:s0
-/dev/rtc[0-9]      u:object_r:rtc_device:s0
-/dev/snd(/.*)?		u:object_r:audio_device:s0
-/dev/socket(/.*)?	u:object_r:socket_device:s0
-/dev/socket/adbd	u:object_r:adbd_socket:s0
-/dev/socket/sap_uim_socket[0-9]        u:object_r:sap_uim_socket:s0
-/dev/socket/cryptd	u:object_r:vold_socket:s0
-/dev/socket/dnsproxyd	u:object_r:dnsproxyd_socket:s0
-/dev/socket/dumpstate	u:object_r:dumpstate_socket:s0
-/dev/socket/fwmarkd	u:object_r:fwmarkd_socket:s0
-/dev/socket/gps		u:object_r:gps_socket:s0
-/dev/socket/installd	u:object_r:installd_socket:s0
-/dev/socket/lmkd        u:object_r:lmkd_socket:s0
-/dev/socket/logd	u:object_r:logd_socket:s0
-/dev/socket/logdr	u:object_r:logdr_socket:s0
-/dev/socket/logdw	u:object_r:logdw_socket:s0
-/dev/socket/mdns	u:object_r:mdns_socket:s0
-/dev/socket/mdnsd	u:object_r:mdnsd_socket:s0
-/dev/socket/mtpd	u:object_r:mtpd_socket:s0
-/dev/socket/netd	u:object_r:netd_socket:s0
-/dev/socket/property_service	u:object_r:property_socket:s0
-/dev/socket/racoon	u:object_r:racoon_socket:s0
-/dev/socket/rild	u:object_r:rild_socket:s0
-/dev/socket/rild-debug	u:object_r:rild_debug_socket:s0
-/dev/socket/vold	u:object_r:vold_socket:s0
-/dev/socket/wpa_eth[0-9] u:object_r:wpa_socket:s0
-/dev/socket/wpa_wlan[0-9] u:object_r:wpa_socket:s0
-/dev/socket/zygote	u:object_r:zygote_socket:s0
-/dev/socket/zygote_secondary	u:object_r:zygote_socket:s0
-/dev/spdif_out.*	u:object_r:audio_device:s0
-/dev/tegra.*		u:object_r:video_device:s0
-/dev/tf_driver		u:object_r:tee_device:s0
-/dev/tty		u:object_r:owntty_device:s0
-/dev/tty[0-9]*		u:object_r:tty_device:s0
-/dev/ttyS[0-9]*		u:object_r:serial_device:s0
-/dev/tun		u:object_r:tun_device:s0
-/dev/uhid		u:object_r:uhid_device:s0
-/dev/uinput		u:object_r:uhid_device:s0
-/dev/uio[0-9]*		u:object_r:uio_device:s0
-/dev/urandom		u:object_r:urandom_device:s0
-/dev/usb_accessory	u:object_r:usbaccessory_device:s0
-/dev/vcs[0-9a-z]*	u:object_r:vcs_device:s0
-/dev/video[0-9]*	u:object_r:video_device:s0
-/dev/watchdog		u:object_r:watchdog_device:s0
-/dev/xt_qtaguid	u:object_r:qtaguid_device:s0
-/dev/zero		u:object_r:zero_device:s0
-/dev/__kmsg__		u:object_r:klog_device:s0
-/dev/__properties__ u:object_r:properties_device:s0
-#############################
-# System files
-#
-/system(/.*)?		u:object_r:system_file:s0
-/system/bin/e2fsck	--	u:object_r:fsck_exec:s0
-/system/bin/fsck\.f2fs	--	u:object_r:fsck_exec:s0
-/system/bin/fsck_msdos	--	u:object_r:fsck_exec:s0
-/system/bin/toolbox	--	u:object_r:toolbox_exec:s0
-/system/bin/toybox	--	u:object_r:toolbox_exec:s0
-/system/bin/logcat	--	u:object_r:logcat_exec:s0
-/system/bin/sh		--	u:object_r:shell_exec:s0
-/system/bin/run-as	--	u:object_r:runas_exec:s0
-/system/bin/bootanimation u:object_r:bootanim_exec:s0
-/system/bin/app_process32	u:object_r:zygote_exec:s0
-/system/bin/app_process64	u:object_r:zygote_exec:s0
-/system/bin/servicemanager	u:object_r:servicemanager_exec:s0
-/system/bin/surfaceflinger	u:object_r:surfaceflinger_exec:s0
-/system/bin/drmserver	u:object_r:drmserver_exec:s0
-/system/bin/dumpstate   u:object_r:dumpstate_exec:s0
-/system/bin/vold	u:object_r:vold_exec:s0
-/system/bin/netd	u:object_r:netd_exec:s0
-/system/bin/rild	u:object_r:rild_exec:s0
-/system/bin/mediaserver	u:object_r:mediaserver_exec:s0
-/system/bin/mdnsd	u:object_r:mdnsd_exec:s0
-/system/bin/installd	u:object_r:installd_exec:s0
-/system/bin/keystore	u:object_r:keystore_exec:s0
-/system/bin/fingerprintd u:object_r:fingerprintd_exec:s0
-/system/bin/gatekeeperd u:object_r:gatekeeperd_exec:s0
-/system/bin/debuggerd	u:object_r:debuggerd_exec:s0
-/system/bin/debuggerd64	u:object_r:debuggerd_exec:s0
-/system/bin/wpa_supplicant	u:object_r:wpa_exec:s0
-/system/bin/sdcard      u:object_r:sdcardd_exec:s0
-/system/bin/dhcpcd      u:object_r:dhcp_exec:s0
-/system/bin/mtpd	u:object_r:mtp_exec:s0
-/system/bin/pppd	u:object_r:ppp_exec:s0
-/system/bin/tf_daemon	u:object_r:tee_exec:s0
-/system/bin/racoon	u:object_r:racoon_exec:s0
-/system/xbin/su		u:object_r:su_exec:s0
-/system/xbin/procrank   u:object_r:procrank_exec:s0
-/system/xbin/perfprofd  u:object_r:perfprofd_exec:s0
-/system/xbin/simpleperf u:object_r:system_file:s0
-/system/vendor/bin/gpsd u:object_r:gpsd_exec:s0
-/system/bin/dnsmasq     u:object_r:dnsmasq_exec:s0
-/system/bin/hostapd     u:object_r:hostapd_exec:s0
-/system/bin/clatd	u:object_r:clatd_exec:s0
-/system/bin/lmkd        u:object_r:lmkd_exec:s0
-/system/bin/inputflinger u:object_r:inputflinger_exec:s0
-/system/bin/logd        u:object_r:logd_exec:s0
-/system/bin/uncrypt     u:object_r:uncrypt_exec:s0
-/system/bin/logwrapper  u:object_r:system_file:s0
-/system/bin/vdc         u:object_r:vdc_exec:s0
-/system/bin/install-recovery.sh u:object_r:install_recovery_exec:s0
-/system/bin/dex2oat     u:object_r:dex2oat_exec:s0
-# patchoat executable has (essentially) the same requirements as dex2oat.
-/system/bin/patchoat    u:object_r:dex2oat_exec:s0
-/system/bin/sgdisk      u:object_r:sgdisk_exec:s0
-/system/bin/blkid       u:object_r:blkid_exec:s0
-/system/bin/tzdatacheck u:object_r:tzdatacheck_exec:s0
-
-#############################
-# Vendor files
-#
-/vendor(/.*)?		u:object_r:system_file:s0
-/vendor/bin/gpsd	u:object_r:gpsd_exec:s0
-
-#############################
-# OEM and ODM files
-#
-/odm(/.*)?              u:object_r:system_file:s0
-/oem(/.*)?              u:object_r:oemfs:s0
-
-
-#############################
-# Data files
-#
-# NOTE: When modifying existing label rules, changes may also need to
-# propagate to the "Expanded data files" section.
-#
-/data(/.*)?		u:object_r:system_data_file:s0
-/data/.layout_version		u:object_r:install_data_file:s0
-/data/unencrypted(/.*)?         u:object_r:unencrypted_data_file:s0
-/data/backup(/.*)?		u:object_r:backup_data_file:s0
-/data/secure/backup(/.*)?	u:object_r:backup_data_file:s0
-/data/security(/.*)?	u:object_r:security_file:s0
-/data/system/ndebugsocket	u:object_r:system_ndebug_socket:s0
-/data/drm(/.*)?		u:object_r:drm_data_file:s0
-/data/gps(/.*)?		u:object_r:gps_data_file:s0
-/data/resource-cache(/.*)? u:object_r:resourcecache_data_file:s0
-/data/dalvik-cache(/.*)? u:object_r:dalvikcache_data_file:s0
-/data/dalvik-cache/profiles(/.*)? u:object_r:dalvikcache_profiles_data_file:s0
-/data/adb(/.*)?		u:object_r:adb_data_file:s0
-/data/anr(/.*)?		u:object_r:anr_data_file:s0
-/data/app(/.*)?                       u:object_r:apk_data_file:s0
-/data/app/[^/]+/oat(/.*)?                u:object_r:dalvikcache_data_file:s0
-/data/app/vmdl[^/]+\.tmp(/.*)?           u:object_r:apk_tmp_file:s0
-/data/app/vmdl[^/]+\.tmp/oat(/.*)?           u:object_r:dalvikcache_data_file:s0
-/data/app-private(/.*)?               u:object_r:apk_private_data_file:s0
-/data/app-private/vmdl.*\.tmp(/.*)?   u:object_r:apk_private_tmp_file:s0
-/data/tombstones(/.*)?	u:object_r:tombstone_data_file:s0
-/data/local/tmp(/.*)?	u:object_r:shell_data_file:s0
-/data/media(/.*)?	u:object_r:media_rw_data_file:s0
-/data/mediadrm(/.*)?	u:object_r:media_data_file:s0
-/data/property(/.*)?	u:object_r:property_data_file:s0
-
-# Misc data
-/data/misc/adb(/.*)?            u:object_r:adb_keys_file:s0
-/data/misc/audio(/.*)?          u:object_r:audio_data_file:s0
-/data/misc/bluetooth(/.*)?      u:object_r:bluetooth_data_file:s0
-/data/misc/bluedroid(/.*)?      u:object_r:bluetooth_data_file:s0
-/data/misc/bluedroid/\.a2dp_ctrl u:object_r:bluetooth_socket:s0
-/data/misc/bluedroid/\.a2dp_data u:object_r:bluetooth_socket:s0
-/data/misc/camera(/.*)?         u:object_r:camera_data_file:s0
-/data/misc/dhcp(/.*)?           u:object_r:dhcp_data_file:s0
-/data/misc/gatekeeper(/.*)?     u:object_r:gatekeeper_data_file:s0
-/data/misc/keychain(/.*)?       u:object_r:keychain_data_file:s0
-/data/misc/keystore(/.*)?       u:object_r:keystore_data_file:s0
-/data/misc/logd(/.*)?           u:object_r:misc_logd_file:s0
-/data/misc/media(/.*)?          u:object_r:media_data_file:s0
-/data/misc/net(/.*)?            u:object_r:net_data_file:s0
-/data/misc/shared_relro(/.*)?   u:object_r:shared_relro_file:s0
-/data/misc/sms(/.*)?            u:object_r:radio_data_file:s0
-/data/misc/systemkeys(/.*)?     u:object_r:systemkeys_data_file:s0
-/data/misc/user(/.*)?           u:object_r:misc_user_data_file:s0
-/data/misc/vpn(/.*)?            u:object_r:vpn_data_file:s0
-/data/misc/wifi(/.*)?           u:object_r:wifi_data_file:s0
-/data/misc/wifi/sockets(/.*)?   u:object_r:wpa_socket:s0
-/data/misc/wifi/sockets/wpa_ctrl.*   u:object_r:system_wpa_socket:s0
-/data/misc/wifi/hostapd(/.*)?   u:object_r:wpa_socket:s0
-/data/misc/zoneinfo(/.*)?       u:object_r:zoneinfo_data_file:s0
-/data/misc/vold(/.*)?           u:object_r:vold_data_file:s0
-/data/misc/perfprofd(/.*)?      u:object_r:perfprofd_data_file:s0
-/data/system/heapdump(/.*)?     u:object_r:heapdump_data_file:s0
-
-# Fingerprint data
-/data/system/users/[0-9]+/fpdata(/.*)? u:object_r:fingerprintd_data_file:s0
-
-# Bootchart data
-/data/bootchart(/.*)?		u:object_r:bootchart_data_file:s0
-
-#############################
-# Expanded data files
-#
-/mnt/expand(/.*)?                                   u:object_r:mnt_expand_file:s0
-/mnt/expand/[^/]+(/.*)?                             u:object_r:system_data_file:s0
-/mnt/expand/[^/]+/app(/.*)?                         u:object_r:apk_data_file:s0
-/mnt/expand/[^/]+/app/[^/]+/oat(/.*)?               u:object_r:dalvikcache_data_file:s0
-/mnt/expand/[^/]+/app/vmdl[^/]+\.tmp(/.*)?          u:object_r:apk_tmp_file:s0
-/mnt/expand/[^/]+/app/vmdl[^/]+\.tmp/oat(/.*)?      u:object_r:dalvikcache_data_file:s0
-/mnt/expand/[^/]+/local/tmp(/.*)?                   u:object_r:shell_data_file:s0
-/mnt/expand/[^/]+/media(/.*)?                       u:object_r:media_rw_data_file:s0
-/mnt/expand/[^/]+/misc/vold(/.*)?                   u:object_r:vold_data_file:s0
-
-# coredump directory for userdebug/eng devices
-/cores(/.*)?                    u:object_r:coredump_file:s0
-
-# Wallpaper file for other users
-/data/system/users/[0-9]+/wallpaper		u:object_r:wallpaper_file:s0
-#############################
-# efs files
-#
-/efs(/.*)?		u:object_r:efs_file:s0
-#############################
-# Cache files
-#
-/cache(/.*)?		u:object_r:cache_file:s0
-/cache/.*\.data	u:object_r:cache_backup_file:s0
-/cache/.*\.restore	u:object_r:cache_backup_file:s0
-# LocalTransport (backup) uses this directory
-/cache/backup(/.*)?	u:object_r:cache_backup_file:s0
-#############################
-# sysfs files
-#
-/sys/devices/platform/nfc-power/nfc_power -- u:object_r:sysfs_nfc_power_writable:s0
-/sys/devices/system/cpu(/.*)?    u:object_r:sysfs_devices_system_cpu:s0
-/sys/power/wake_lock -- u:object_r:sysfs_wake_lock:s0
-/sys/power/wake_unlock -- u:object_r:sysfs_wake_lock:s0
-/sys/kernel/uevent_helper --	u:object_r:usermodehelper:s0
-/sys/module/lowmemorykiller(/.*)? -- u:object_r:sysfs_lowmemorykiller:s0
-
-#############################
-# asec containers
-/mnt/asec(/.*)?             u:object_r:asec_apk_file:s0
-/mnt/asec/[^/]+/[^/]+\.zip  u:object_r:asec_public_file:s0
-/mnt/asec/[^/]+/lib(/.*)?   u:object_r:asec_public_file:s0
-/data/app-asec(/.*)?        u:object_r:asec_image_file:s0
-
-#############################
-# external storage
-/mnt/media_rw(/.*)?         u:object_r:mnt_media_rw_file:s0
-/mnt/user(/.*)?             u:object_r:mnt_user_file:s0
-/mnt/runtime(/.*)?          u:object_r:storage_file:s0
-/storage(/.*)?              u:object_r:storage_file:s0
-
-############################# 
-# MISC partition file
-#
-/hidden(/.*)?	u:object_r:hidden_file:s0
-/persdata(/.*)?	u:object_r:persdata_data_file:s0
-/persist(/.*)?   u:object_r:persist_data_file:s0
-/preload(/.*)? u:object_r:hidden_file:s0
-/tombstone(/.*)?   u:object_r:tombstone_data_file:s0
-/tombstones(/.*)?   u:object_r:tombstone_data_file:s0
-
-
-#line 1 "vendor/samsung/common/sepolicy/sec_common/file_contexts"
-#ipm service
-/system/bin/ipm   	u:object_r:ipm_exec:s0                      
-/data/system/ipm(/.*)?  u:object_r:ipm_data_file:s0
-/system/bin/ftt_ctrld   u:object_r:ftt_ctrld_exec:s0
-
-#############################
-# Device node
-#
-/dev/ftt_ctrl                                         u:object_r:ftt_ctrl_device:s0
-
-#line 1 "vendor/samsung/common/sepolicy/BSP/bsp_qcom_v2/bsp/common/file_contexts"
-###################################
-# Dev nodes
-#
-/dev/adsprpc-smd                                u:object_r:qdsp_device:s0
-/dev/cpu_dma_latency                            u:object_r:device_latency:s0
-/dev/diag                                       u:object_r:diag_device:s0
-/dev/hsicctl.*                                  u:object_r:hsic_device:s0
-/dev/kgsl-3d0                                   u:object_r:gpu_device:s0
-/dev/mhi_pipe_.*                                u:object_r:mhi_device:s0
-/dev/bhi                                        u:object_r:bhi_device:s0
-/dev/msm_.*                                     u:object_r:audio_device:s0
-##SEC removed dup context : /dev/usf1                                       u:object_r:usf_device:s0
-/dev/msm_dsps                                   u:object_r:sensors_device:s0
-/dev/msm_thermal_query                          u:object_r:thermal_device:s0
-/dev/nfc-nci                                    u:object_r:nfc_device:s0
-/dev/nq-nci                                     u:object_r:nfc_device:s0
-#SEC use qseecom_device, not tee_device. neverallow Google CTS-android-5.0.2_r1 : 
-/dev/qseecom                                    u:object_r:qseecom_device:s0
-/dev/seemplog                                   u:object_r:seemplog_device:s0
-/dev/radio0                                     u:object_r:fm_radio_device:s0
-##SEC removed dup context : /dev/rtc0                                       u:object_r:rtc_device:s0
-/dev/sensors                                    u:object_r:sensors_device:s0
-/dev/smd.*                                      u:object_r:smd_device:s0
-/dev/smem_log                                   u:object_r:smem_log_device:s0
-/dev/ttyHSL0                                    u:object_r:console_device:s0
-/dev/ttyHS[0-9]*                                u:object_r:serial_device:s0
-/dev/ttyGS0                                     u:object_r:gadget_serial_device:s0
-/dev/usb_ext_chg                                u:object_r:hvdcp_device:s0
-/dev/media([0-9])+                              u:object_r:camera_device:s0
-/dev/jpeg[0-9]*                                 u:object_r:camera_device:s0
-/dev/v4l-subdev.*                               u:object_r:camera_device:s0
-/dev/vm_bms                                     u:object_r:vm_bms_device:s0
-/dev/battery_data                               u:object_r:battery_data_device:s0
-##SEC removed dup context : /dev/block/mmcblk1                              u:object_r:sd_device:s0
-##SEC removed dup context : /dev/block/mmcblk1p1                            u:object_r:sd_device:s0
-/dev/ccid_bridge                                u:object_r:usb_uicc_device:s0
-/dev/subsys_.*                                  u:object_r:ssr_device:s0
-/dev/ramdump_.*                                 u:object_r:ramdump_device:s0
-/dev/esoc.*                                     u:object_r:esoc_device:s0
-/dev/ks_hsic_bridge                             u:object_r:ksbridgehsic_device:s0
-/dev/efs_hsic_bridge                            u:object_r:efsbridgehsic_device:s0
-/dev/ipa                                        u:object_r:ipa_dev:s0
-/dev/wwan_ioctl                                 u:object_r:ipa_dev:s0
-/dev/ipaNatTable                                u:object_r:ipa_dev:s0
-/dev/rmnet_ctrl.*                               u:object_r:rmnet_device:s0
-/dev/dpl_ctrl                                   u:object_r:rmnet_device:s0
-/dev/wcnss_ctrl                                 u:object_r:wcnss_device:s0
-/dev/wcnss_wlan                                 u:object_r:wcnss_device:s0
-##SEC removed dup context : /dev/pta                                        u:object_r:pta_device:s0
-/dev/mdss_rotator                               u:object_r:graphics_device:s0
-/dev/hbtp_input                                 u:object_r:hbtp_device:s0
-/dev/hbtp_vm                                    u:object_r:hbtp_device:s0
-/dev/jdi-bu21150                                u:object_r:bu21150_device:s0
-/dev/voice_svc                                  u:object_r:voice_device:s0
-/dev/avtimer                                    u:object_r:avtimer_device:s0
-##SEC removed dup context : /dev/coresight-stm                              u:object_r:qdss_device:s0
-##SEC removed dup context : /dev/coresight-tmc-etf                          u:object_r:qdss_device:s0
-##SEC removed dup context : /dev/coresight-tmc-etr                          u:object_r:qdss_device:s0
-##SEC removed dup context : /dev/coresight-tmc-etr-stream                   u:object_r:qdss_device:s0
-/dev/system_health_monitor                      u:object_r:system_health_monitor_device:s0
-/dev/qce                                        u:object_r:qce_device:s0
-/dev/msm-rng                                    u:object_r:rng_device:s0
-/dev/qbt1000                                    u:object_r:qbt1000_device:s0
-/dev/at_.*                                      u:object_r:at_device:s0
-/dev/sg.*                                       u:object_r:sg_device:s0
-
-###################################
-# Dev block nodes
-#
-/dev/block/bootdevice/by-name/modemst1          u:object_r:modem_efs_partition_device:s0
-/dev/block/bootdevice/by-name/modemst2          u:object_r:modem_efs_partition_device:s0
-/dev/block/bootdevice/by-name/fsg               u:object_r:modem_efs_partition_device:s0
-/dev/block/bootdevice/by-name/fsc               u:object_r:modem_efs_partition_device:s0
-/dev/block/bootdevice/by-name/ssd               u:object_r:ssd_device:s0
-/dev/block/bootdevice/by-name/misc              u:object_r:misc_partition:s0
-#/dev/block/mmcblk0p13                          u:object_r:bootselect_device:s0
-##SEC removed dup context : /dev/block/zram0                                u:object_r:swap_block_device:s0
-/dev/block/bootdevice/by-name/dip               u:object_r:dip_device:s0
-/dev/block/bootdevice/by-name/mdtp              u:object_r:mdtp_device:s0
-
-###################################
-# Dev socket nodes
-#
-/dev/socket/qmux_audio(/.*)?                    u:object_r:qmuxd_socket:s0
-/dev/socket/qmux_bluetooth(/.*)?                u:object_r:qmuxd_socket:s0
-/dev/socket/qmux_gps(/.*)?                      u:object_r:qmuxd_socket:s0
-/dev/socket/qmux_radio(/.*)?                    u:object_r:qmuxd_socket:s0
-/dev/socket/qmux_nfc(/.*)?                      u:object_r:qmuxd_socket:s0
-/dev/socket/netmgr(/.*)?                        u:object_r:netmgrd_socket:s0
-/dev/socket/sensor_ctl_socket                   u:object_r:sensors_socket:s0
-/dev/socket/cnd                                 u:object_r:cnd_socket:s0
-/dev/socket/nims                                u:object_r:cnd_socket:s0
-/dev/socket/thermal-send-client                 u:object_r:thermal_socket:s0
-/dev/socket/thermal-recv-client                 u:object_r:thermal_socket:s0
-/dev/socket/thermal-recv-passive-client         u:object_r:thermal_socket:s0
-/dev/socket/ims_qmid                            u:object_r:ims_socket:s0
-/dev/socket/ims_datad                           u:object_r:ims_socket:s0
-/dev/socket/ims_rtpd                            u:object_r:ims_socket:s0
-/dev/socket/perfd(/.*)?                         u:object_r:mpctl_socket:s0
-/dev/socket/qlogd                               u:object_r:qlogd_socket:s0
-/dev/socket/ipacm_log_file                      u:object_r:ipacm_socket:s0
-/dev/socket/dpmd                                u:object_r:dpmd_socket:s0
-/dev/socket/dpmwrapper                          u:object_r:dpmwrapper_socket:s0
-/dev/socket/pps                                 u:object_r:pps_socket:s0
-/dev/socket/rild2                               u:object_r:rild_socket:s0
-/dev/socket/rild2-debug                         u:object_r:rild_debug_socket:s0
-/dev/socket/rild-debug2                         u:object_r:rild_debug_socket:s0
-/dev/socket/rild3                               u:object_r:rild_socket:s0
-/dev/socket/rild3-debug                         u:object_r:rild_debug_socket:s0
-/dev/socket/rild-debug3                         u:object_r:rild_debug_socket:s0
-/dev/socket/msm_irqbalance                      u:object_r:msm_irqbalance_socket:s0
-/dev/socket/seempdw                             u:object_r:seempdw_socket:s0
-
-###################################
-# System files
-#
-/system/bin/ATFWD-daemon                        u:object_r:atfwd_exec:s0
-/system/bin/PktRspTest                          u:object_r:diag_exec:s0
-/system/bin/audiod                              u:object_r:audiod_exec:s0
-/system/bin/charger_monitor                     u:object_r:charger_monitor_exec:s0
-/system/bin/hvdcp_opti                          u:object_r:hvdcp_exec:s0
-/system/bin/cnd                                 u:object_r:cnd_exec:s0
-/system/bin/diag_callback_client                u:object_r:diag_exec:s0
-/system/bin/diag_dci_sample                     u:object_r:diag_exec:s0
-/system/bin/diag_klog                           u:object_r:diag_exec:s0
-/system/bin/diag_mdlog                          u:object_r:qlogd_exec:s0
-/system/bin/diag_qshrink4_daemon                u:object_r:diag_exec:s0
-/system/bin/diag_socket_log                     u:object_r:diag_exec:s0
-/system/bin/diag_uart_log                       u:object_r:diag_exec:s0
-/system/bin/diag_buffering_test                 u:object_r:diag_exec:s0
-/system/bin/drmdiagapp                          u:object_r:diag_exec:s0
-/system/bin/irsc_util                           u:object_r:irsc_util_exec:s0
-/system/vendor/bin/mm-pp-daemon                 u:object_r:mm-pp-daemon_exec:s0
-/system/vendor/bin/mm-pp-dpps                   u:object_r:mm-pp-daemon_exec:s0
-/system/bin/mm-pp-daemon                        u:object_r:mm-pp-daemon_exec:s0
-/system/bin/mm-pp-dpps                          u:object_r:mm-pp-daemon_exec:s0
-/system/bin/mmi                                 u:object_r:mmi_exec:s0
-/system/bin/mpdecision                          u:object_r:mpdecision_exec:s0
-/system/vendor/bin/perfd                        u:object_r:perfd_exec:s0
-/system/bin/iop                                 u:object_r:dumpstate_exec:s0
-/system/bin/msm_irqbalance                      u:object_r:msm_irqbalanced_exec:s0
-/system/bin/imsdatadaemon                       u:object_r:ims_exec:s0
-/system/bin/imsqmidaemon                        u:object_r:ims_exec:s0
-/system/bin/ims_rtp_daemon                      u:object_r:ims_exec:s0
-/system/bin/imscmservice                        u:object_r:imscm_exec:s0
-/system/bin/netmgrd                             u:object_r:netmgrd_exec:s0
-/system/bin/qmuxd                               u:object_r:qmuxd_exec:s0
-/system/bin/port-bridge                         u:object_r:port-bridge_exec:s0
-/system/bin/sensors.qcom                        u:object_r:sensors_exec:s0
-##SEC removed ambigious contexts:/system/bin/sns.*                               u:object_r:sensors_test_exec:s0
-/system/bin/test_diag                           u:object_r:diag_exec:s0
-/system/vendor/bin/thermal-engine               u:object_r:thermal-engine_exec:s0
-/system/bin/vm_bms                              u:object_r:vm_bms_exec:s0
-/system/bin/mm-qcamera-daemon                   u:object_r:mm-qcamerad_exec:s0
-/system/bin/qfp-daemon                          u:object_r:qfp-daemon_exec:s0
-/system/rfs.*                                   u:object_r:rfs_system_file:s0
-/system/bin/time_daemon                         u:object_r:time_daemon_exec:s0
-/system/bin/rmt_storage                         u:object_r:rmt_storage_exec:s0
-/system/bin/rfs_access                          u:object_r:rfs_access_exec:s0
-/system/bin/tftp_server                         u:object_r:rfs_access_exec:s0
-/system/bin/hvdcp                               u:object_r:hvdcp_exec:s0
-/system/bin/qseecomd                            u:object_r:tee_exec:s0
-/system/bin/hostapd_cli                         u:object_r:hostapd_exec:s0
-/system/bin/adsprpcd                            u:object_r:adsprpcd_exec:s0
-/system/bin/wpa_cli                             u:object_r:wcnss_service_exec:s0
-/system/bin/cnss-daemon                         u:object_r:wcnss_service_exec:s0
-/system/bin/mdm_helper                          u:object_r:mdm_helper_exec:s0
-/system/bin/mdm_helper_proxy                    u:object_r:mdm_helper_exec:s0
-/system/bin/ks                                  u:object_r:mdm_helper_exec:s0
-/system/bin/pm-service                          u:object_r:per_mgr_exec:s0
-/system/bin/pm-proxy                            u:object_r:per_mgr_exec:s0
-/system/vendor/bin/pd-mapper                    u:object_r:pd_mapper_exec:s0
-/system/vendor/bin/pd-api-test                  u:object_r:pd_mapper_exec:s0
-/system/bin/usb_uicc_client                     u:object_r:usb_uicc_daemon_exec:s0
-/system/bin/qcom-system-daemon                  u:object_r:qcomsysd_exec:s0
-/system/xbin/qlogd                              u:object_r:qlogd_exec:s0
-/system/bin/ipacm                               u:object_r:ipacm_exec:s0
-/system/bin/ipacm-diag                          u:object_r:ipacm-diag_exec:s0
-/system/bin/dpmd                                u:object_r:dpmd_exec:s0
-/system/bin/ssr_setup                           u:object_r:ssr_setup_exec:s0
-/system/bin/subsystem_ramdump                   u:object_r:subsystem_ramdump_exec:s0
-/system/bin/ssr_diag                            u:object_r:ssr_diag_exec:s0
-/system/bin/loc_launcher                        u:object_r:location_exec:s0
-/system/bin/quipc_main                          u:object_r:location_exec:s0
-/system/bin/ipepb                               u:object_r:location_exec:s0
-/system/bin/quipc_igsn                          u:object_r:location_exec:s0
-/system/bin/lowi-server                         u:object_r:location_exec:s0
-/system/bin/location-mq                         u:object_r:location_exec:s0
-/system/bin/xtwifi-inet-agent                   u:object_r:location_exec:s0
-/system/bin/xtwifi-client                       u:object_r:location_exec:s0
-/system/bin/garden_app                          u:object_r:location_exec:s0
-/system/bin/gpsone_daemon                       u:object_r:location_exec:s0
-/system/vendor/bin/slim_daemon                  u:object_r:location_exec:s0
-##SEC removed dup context : /system/bin/energy-awareness                    u:object_r:energyawareness_exec:s0
-/system/vendor/bin/fidodaemon                   u:object_r:fidodaemon_exec:s0
-/system/bin/secotad                             u:object_r:secotad_exec:s0
-/system/vendor/bin/qseeproxydaemon              u:object_r:qseeproxy_exec:s0
-/system/bin/dts_configurator                    u:object_r:dtsconfigurator_exec:s0
-/system/bin/dts_eagle_service                   u:object_r:dtseagleservice_exec:s0
-/system/vendor/bin/qti                          u:object_r:qti_exec:s0
-/system/bin/wcnss_service                       u:object_r:wcnss_service_exec:s0
-/system/vendor/bin/hbtp_daemon                  u:object_r:hbtp_exec:s0
-/system/vendor/bin/touch_fusion                 u:object_r:touchfusion_exec:s0
-/system/vendor/bin/seemp_healthd                u:object_r:seemp_health_daemon_exec:s0
-# SEC added : cld-fwlog-netlink
-/system/bin/cld-fwlog-netlink                       u:object_r:wcnss_service_exec:s0
-/system/bin/seempd                              u:object_r:seempd_exec:s0
-/system/bin/sapd                                u:object_r:sapd_exec:s0
-/system/bin/btnvtool                            u:object_r:btnvtool_exec:s0
-/system/bin/btsnoop                             u:object_r:btsnoop_exec:s0
-/system/bin/dun-server                          u:object_r:dun-server_exec:s0
-/system/bin/wfdservice                          u:object_r:wfdservice_exec:s0
-## SEC changed exec type due to BT error : /system/bin/wcnss_filter                        u:object_r:wcnss_filter_exec:s0
-/system/bin/wcnss_filter                        u:object_r:wcnss_service_exec:s0
-/system/bin/usf_epos                            u:object_r:usf_exec:s0
-/system/bin/usf_gesture                         u:object_r:usf_exec:s0
-/system/bin/usf_hovering                        u:object_r:usf_exec:s0
-/system/bin/usf_p2p                             u:object_r:usf_exec:s0
-/system/bin/usf_proximity                       u:object_r:usf_exec:s0
-/system/bin/usf_sync_gesture                    u:object_r:usf_exec:s0
-/system/bin/usf_sw_calib                        u:object_r:usf_exec:s0
-/system/bin/usf_pairing                         u:object_r:usf_exec:s0
-/system/bin/usf_tester                          u:object_r:usf_exec:s0
-/system/vendor/bin/RIDLClient.exe               u:object_r:RIDL_exec:s0
-/system/bin/tbaseLoader                         u:object_r:tbaseLoader_exec:s0
-/system/bin/mcStarter                           u:object_r:mcStarter_exec:s0
-/system/bin/fstman                              u:object_r:fstman_exec:s0
-/system/vendor/bin/mdtp_service                 u:object_r:mdtpdaemon_exec:s0
-/system/vendor/bin/mdtpd                 u:object_r:mdtpdaemon_exec:s0
-/system/bin/tloc_daemon                         u:object_r:tlocd_exec:s0
-
-###################################
-# sysfs files
-#
-# SEC Remove dup contexts, /sys/class/graphics/fb0/mdp/caps                                    u:object_r:sysfs_graphics:s0
-/sys/class/thermal(/.*)?                                            u:object_r:sysfs_thermal:s0
-#/sys/devices/[^/]+bcl[^/]+(/.*)?                                    u:object_r:sysfs_thermal:s0
-# this code increase the booting time. so SEC changes from [^/]+bcl[^/]+(/.*)? to qcom,bcl.*(/.*)?
-/sys/devices/qcom,bcl.*(/.*)?                                       u:object_r:sysfs_thermal:s0
-# SEC Remove to cover class symlink /sys/devices/f9200000.*/power_supply/usb(/.*)?                      u:object_r:sysfs_usb_supply:s0
-# SEC Remove to cover class symlink /sys/devices/msm_dwc3/power_supply/usb(/.*)?                        u:object_r:sysfs_usb_supply:s0
-# SEC Remove to cover class symlink /sys/devices/msm_otg/power_supply/usb(/.*)?                         u:object_r:sysfs_usb_supply:s0
-/sys/devices/platform/battery_current_limit                         u:object_r:sysfs_thermal:s0
-# SEC Remove to cover class symlink /sys/devices/qpnp-charger.*/power_supply/battery(/.*)?              u:object_r:sysfs_battery_supply:s0
-/sys/devices/system/cpu/cpu0/rq-stats/*                             u:object_r:sysfs_rqstats:s0
-# SEC Remove to cover class symlink /sys/devices/virtual/graphics/fb([0-2])+/idle_time                  u:object_r:sysfs_graphics:s0
-# SEC Remove to cover class symlink /sys/devices/virtual/graphics/fb([0-2])+/dynamic_fps                u:object_r:sysfs_graphics:s0
-# SEC Remove to cover class symlink /sys/devices/virtual/graphics/fb([0-2])+/product_description        u:object_r:sysfs_graphics:s0
-# SEC Remove to cover class symlink /sys/devices/virtual/graphics/fb([0-2])+/vendor_name                u:object_r:sysfs_graphics:s0
-# SEC Remove to cover class symlink /sys/devices/virtual/graphics/fb([0-2])+/hdcp/tp                    u:object_r:sysfs_graphics:s0
-/sys/devices/virtual/hsicctl/hsicctl1[0-9]/modem_wait               u:object_r:sysfs_hsic_modem_wait:s0
-/sys/devices/virtual/hsicctl/hsicctl[0-9]/modem_wait                u:object_r:sysfs_hsic_modem_wait:s0
-/sys/devices/virtual/smdpkt/smdcntl1[0-9]/open_timeout              u:object_r:sysfs_smd_open_timeout:s0
-/sys/devices/virtual/smdpkt/smdcntl[0-9]/open_timeout               u:object_r:sysfs_smd_open_timeout:s0
-# SEC Remove to cover class symlink /sys/devices/virtual/thermal(/.*)?                                  u:object_r:sysfs_thermal:s0
-/sys/module/msm_serial_hs/parameters/debug_mask                     u:object_r:sysfs_msmuart_file:s0
-/sys/module/msm_thermal(/.*)?                                       u:object_r:sysfs_thermal:s0
-/sys/module/msm_thermal/core_control/cpus_offlined                  u:object_r:sysfs_mpdecision:s0
-# SEC Remove to cover class symlink /sys/devices/f9a55000.*/power_supply/usb(/.*)?                      u:object_r:sysfs_usb_supply:s0
-# SEC Remove to cover class symlink /sys/devices/virtual/graphics/fb([0-2])+/hpd                        u:object_r:sysfs_graphics:s0
-# SEC Remove to cover class symlink /sys/devices/virtual/graphics/fb([0-2])+/res_info                   u:object_r:sysfs_graphics:s0
-# SEC Remove to cover class symlink /sys/devices/virtual/graphics/fb([0-2])+/s3d_mode                   u:object_r:sysfs_graphics:s0
-# SEC Remove to cover class symlink /sys/class/graphics/fb([0-2])+/mdp/caps                             u:object_r:sysfs_graphics:s0
-# SEC Remove to cover class symlink /sys/class/graphics/fb([0-2])+/ad                                   u:object_r:sysfs_graphics:s0
-/sys/bus/platform/drivers/xhci_msm_hsic(/.*)?                       u:object_r:sysfs_hsic:s0
-/sys/devices/msm_hsic_host/host_ready                               u:object_r:sysfs_hsic_host_rdy:s0
-/sys/bus/esoc(/.*)?                                                 u:object_r:sysfs_esoc:s0
-/sys/bus/msm_subsys(/.*)?                                           u:object_r:sysfs_ssr:s0
-/sys/module/ccid_bridge(/.*)?                                       u:object_r:sysfs_usb_uicc:s0
-/sys/bus/msm_subsys/devices/subsys0/restart_level                   u:object_r:sysfs_ssr_toggle:s0
-/sys/bus/msm_subsys/devices/subsys1/restart_level                   u:object_r:sysfs_ssr_toggle:s0
-/sys/bus/msm_subsys/devices/subsys2/restart_level                   u:object_r:sysfs_ssr_toggle:s0
-/sys/bus/msm_subsys/devices/subsys3/restart_level                   u:object_r:sysfs_ssr_toggle:s0
-/sys/bus/msm_subsys/devices/subsys4/restart_level                   u:object_r:sysfs_ssr_toggle:s0
-/sys/devices/soc0/.*                                                u:object_r:sysfs_socinfo:s0
-
-###################################
-# data files
-#
-/data/connectivity(/.*)?                                            u:object_r:cnd_data_file:s0
-/data/data_test(/.*)?                                               u:object_r:data_test_data_file:s0
-/data/diag_log(/.*)?                                                u:object_r:diag_data_file:s0
-/data/misc/qvop(/.*)?                                               u:object_r:qvop_data_file:s0
-/data/misc/sensors(/.*)?                                            u:object_r:sensors_data_file:s0
-/data/rfs.*                                                         u:object_r:rfs_data_file:s0
-/data/hlos_rfs(/.*)?                                                u:object_r:rfs_shared_hlos_file:s0
-#SEC keepped camera_data_file, not camera_socket
-/data/camera(/.*)?                                                  u:object_r:camera_data_file:s0
-/data/misc/stargate(/.*)?                                           u:object_r:qfp-daemon_data_file:s0
-/data/system/sensors(/.*)?                                          u:object_r:sensors_data_file:s0
-##SEC removed dup context : /data/time/*                                                        u:object_r:time_data_file:s0
-/data/nfc(/.*)?                                                     u:object_r:nfc_data_file:s0
-/data/system/perfd(/.*)?                                            u:object_r:mpctl_data_file:s0
-/data/misc/perfd(/.*)?                                              u:object_r:mpctl_socket:s0
-/data/misc/iop(/.*)?                                                u:object_r:iop_data_file:s0
-/data/misc/iop/iop                                                  u:object_r:iop_socket:s0
-# SEC added: typealias display_config
-/data/misc/display(/.*)?                                            u:object_r:display_misc_file:s0
-/data/misc/ipa(/.*)?                                                u:object_r:ipacm_data_file:s0
-/data/dpm(/.*)?                                                     u:object_r:dpmd_data_file:s0
-/data/misc/qsee(/.*)?                                               u:object_r:data_qsee_file:s0
-/data/misc/location(/.*)?                                           u:object_r:location_data_file:s0
-/data/misc/location/mq/location-mq-s                                u:object_r:location_socket:s0
-/data/misc/location/mq/alarm_svc                                    u:object_r:location_socket:s0
-/data/FTM_AP(/.*)?                                                  u:object_r:mmi_data_file:s0
-/data/misc/hbtp(/.*)?                                               u:object_r:hbtp_log_file:s0
-/data/misc/qlogd(/.*)?                                              u:object_r:qlogd_data_file:s0
-/data/usf(/.*)?                                                     u:object_r:usf_data_file:s0
-/data/misc/dts(/.*)?                                                u:object_r:dts_data_file:s0
-/data/misc/seemp(/.*)?                                              u:object_r:seemp_file:s0
-/data/misc/SelfHost(/.*)?                                           u:object_r:RIDL_data_file:s0
-##SEC removed dup context : /data/misc/radio(/.*)?                                              u:object_r:radio_data_file:s0
-/data/misc/port_bridge(/.*)?                                        u:object_r:port_bridge_data_file:s0
-/data/misc/fm(/.*)?                                                 u:object_r:fm_data_file:s0
-/data/misc/audio_pp(/.*)?                                           u:object_r:audio_pp_data_file:s0
-/data/ramdump(/.*)?                                                 u:object_r:ssr_ramdump_data_file:s0
-/data/misc/SelfHost/socket(/.*)?                                    u:object_r:RIDL_socket:s0
-/data/misc/tloc(/.*)?                                               u:object_r:tlocd_data_file:s0
-
-###################################
-# persist files
-#
-##SEC removed dup context : /persist(/.*)?                                                      u:object_r:persist_file:s0
-/persist/bluetooth(/.*)?                                            u:object_r:persist_bluetooth_file:s0
-/persist/drm(/.*)?                                                  u:object_r:persist_drm_file:s0
-/persist/sensors(/.*)?                                              u:object_r:sensors_persist_file:s0
-/persist/data(/.*)?                                                 u:object_r:persist_drm_file:s0
-/persist/data/tz(/.*)?                                              u:object_r:persist_drm_file:s0
-/persist/data/sfs(/.*)?                                             u:object_r:persist_drm_file:s0
-/persist/usf(/.*)?                                                  u:object_r:persist_usf_file:s0
-/persist/hlos_rfs(/.*)?                                             u:object_r:rfs_shared_hlos_file:s0
-/persist/display(/.*)?                                              u:object_r:persist_display_file:s0
-/persist/rfs.*                                                      u:object_r:rfs_data_file:s0
-
-###################################
-# etc files
-#
-/etc/firmware/hbtp/*                                                u:object_r:hbtp_cfg_file:s0
-
-###################################
-# adsp files
-#
-/dsp(/.*)?                                                          u:object_r:adsprpcd_file:s0
-
-###################################
-# cache files
-#
-/cache/FTM_AP(/.*)?                                                  u:object_r:mmi_data_file:s0
-#line 1 "vendor/samsung/common/sepolicy/BSP/bsp_qcom_v2/qcom_common/file_contexts"
-
-############################# 
-# addional label of bsp_qcom_v1
-#
-/system/bin/cnss_diag          u:object_r:wcnss_service_exec:s0
-
-/dev/block/platform/msm_sdcc\.1/by-name/modemst[1-2]*	u:object_r:modemstblk_device:s0
-/dev/block/platform/msm_sdcc\.1/by-name/ssd	u:object_r:ssdblk_device:s0
-
-/dev/efs_bridge	u:object_r:efsbridgehsic_device:s0
-/dev/ks_bridge	u:object_r:ksbridgehsic_device:s0
-/dev/rmnet_mux_ctrl	u:object_r:rmnet_device:s0
-
-/dev/ttyHSL[0-9]*	u:object_r:serial_device:s0
-#line 1 "vendor/samsung/common/sepolicy/BSP/bsp_marvell/file_contexts"
-# relabel to debug_device
-
-# nvm
-/NVM(/.*)? 		u:object_r:nvm_data_file:s0
-
-
-/teesst(/.*)? 		u:object_r:teesst_data_file:s0
-
-# dev
-/dev/media[0-9]+	u:object_r:mediaserver_device:s0
-/dev/v4l-subdev[0-9]+	u:object_r:mediaserver_device:s0
-/dev/cpmem		u:object_r:marvelltel_device:s0
-#SEC changed : /dev/alarm-poweroff	u:object_r:system_app_device:s0
-/dev/alarm-poweroff	u:object_r:alarm_device:s0
-/dev/msocket		u:object_r:nvm_device:s0
-/dev/ccidatastub	u:object_r:atcmdsrv_device:s0
-/dev/cctdev[0-9]+	u:object_r:atcmdsrv_device:s0
-/dev/ttydiag[0-9]+	u:object_r:diag_device:s0
-/dev/cmsockdev[0-9]+	u:object_r:diag_device:s0
-/dev/seh		u:object_r:eeh_device:s0
-/dev/citty[0-9]+	u:object_r:pppmodem_device:s0
-/dev/ppprd		u:object_r:pppmodem_device:s0
-#SEC removed : /dev/ttyGS[0-9]+	u:object_r:pppmodem_device:s0
-#SEC removed : /dev/tzdd		u:object_r:teecsstdca_device:s0
-/dev/mbtchar[0-9]+	u:object_r:bluetooth_device:s0
-/dev/mnfcchar[0-9]+	u:object_r:nfc_device:s0
-/dev/i2c-[0-9]+		u:object_r:i2c_device:s0
-/dev/rfkill		u:object_r:wpa_device:s0
-/dev/mfmchar[0-9]+	u:object_r:mwireless_device:s0
-/dev/geu		u:object_r:geu_device:s0
-/dev/mxc400x		u:object_r:memsic_device:s0
-/dev/mmc3524x		u:object_r:memsic_device:s0
-/dev/ptacc_ctrl		u:object_r:memsic_device:s0
-/dev/ecompass_ctrl	u:object_r:memsic_device:s0
-/dev/amipc		u:object_r:ipc_device:s0
-/dev/acipc		u:object_r:ipc_device:s0
-/dev/crmdev[0-9]+	u:object_r:gps_device:s0
-/dev/vpu_devfreq_max	u:object_r:vpu_device:s0
-/dev/vpu_devfreq_min	u:object_r:vpu_device:s0
-/dev/ttymodem[0-9]+	u:object_r:pppmodem_device:s0
-/dev/axi_min		u:object_r:infor_device:s0
-/dev/cci_min		u:object_r:infor_device:s0
-/dev/cctdatadev[0-9]+	u:object_r:infor_device:s0
-/dev/cidatatty[0-9]+	u:object_r:infor_device:s0
-/dev/clst_vl_min	u:object_r:infor_device:s0
-#SEC removed : /dev/cpu_dma_latency	u:object_r:infor_device:s0
-/dev/cpu_freq_b_max     u:object_r:cpuctl_device:s0
-/dev/cpu_freq_b_min	u:object_r:cpuctl_device:s0
-/dev/cpu_freq_l_max	u:object_r:cpuctl_device:s0
-/dev/cpu_freq_l_min	u:object_r:cpuctl_device:s0
-/dev/cpu_freq_max	u:object_r:cpuctl_device:s0
-/dev/cpu_freq_min	u:object_r:cpuctl_device:s0
-/dev/cpu_num_max	u:object_r:cpuctl_device:s0
-/dev/cpu_num_min	u:object_r:cpuctl_device:s0
-/dev/cpuidle_block	u:object_r:cpuctl_device:s0
-/dev/cuse		u:object_r:infor_device:s0
-/dev/ddr_devfreq_max	u:object_r:infor_device:s0
-/dev/ddr_devfreq_min	u:object_r:infor_device:s0
-/dev/diag_dump		u:object_r:diag_device:s0
-/dev/gpu_freq_2d_max	u:object_r:mrvlgpu_device:s0
-/dev/gpu_freq_2d_min	u:object_r:mrvlgpu_device:s0
-/dev/gpu_freq_3d_max	u:object_r:mrvlgpu_device:s0
-/dev/gpu_freq_3d_min	u:object_r:mrvlgpu_device:s0
-/dev/gpu_freq_sh_max	u:object_r:mrvlgpu_device:s0
-/dev/gpu_freq_sh_min	u:object_r:mrvlgpu_device:s0
-/dev/hwmap		u:object_r:infor_device:s0
-/dev/mldev0		u:object_r:infor_device:s0
-#SEC removed :/dev/keychord		u:object_r:infor_device:s0
-/dev/msocket_dump	u:object_r:nvm_device:s0
-/dev/loop-control	u:object_r:infor_device:s0
-#SEC removed :/dev/network_latency	u:object_r:infor_device:s0
-#SEC removed :/dev/network_throughput	u:object_r:infor_device:s0
-#SEC removed :/dev/psaux	 	u:object_r:infor_device:s0
-/dev/ramfile		u:object_r:infor_device:s0
-#SEC removed :/dev/rtc0		u:object_r:infor_device:s0
-#SEC removed :/dev/rtc1		u:object_r:infor_device:s0
-/dev/simple_dip		u:object_r:infor_device:s0
-#SEC removed :/dev/sw_sync		u:object_r:infor_device:s0
-/dev/imldev[0-9]+	u:object_r:infor_device:s0
-
-/dev/umts_boot[0-9]+	u:object_r:ssipc_device:s0
-/dev/umts_ipc[0-9]+	u:object_r:ssipc_device:s0
-/dev/umts_attest[0-9]+	u:object_r:ssipc_device:s0
-/dev/umts_atdun[0-9]+	u:object_r:ssipc_device:s0
-/dev/umts_atprod[0-9]+	u:object_r:ssipc_device:s0
-/dev/umts_atsimal[0-9]+	u:object_r:ssipc_device:s0
-/dev/umts_atsol[0-9]+	u:object_r:ssipc_device:s0
-/dev/umts_atunsol[0-9]+ u:object_r:ssipc_device:s0
-/dev/umts_at[0-9]+	u:object_r:ssipc_device:s0
-/dev/umts_atgps[0-9]+	u:object_r:ssipc_device:s0
-/dev/umts_at[0-9]+_[0-9]+   u:object_r:ssipc_device:s0
-
-
-# define marvell special gpu label
-/dev/galcore		u:object_r:mrvlgpu_device:s0
-/dev/graphics/galcore	u:object_r:mrvlgpu_device:s0
-
-# block dev
-#SEC removed : /dev/block/mmcblk0	u:object_r:cploader_block_device:s0
-#SEC removed : /dev/block/mmcblk0p1	u:object_r:mrd_block_device:s0
-#SEC removed : /dev/block/mmcblk0p2	u:object_r:mrd1_block_device:s0
-#SEC removed : /dev/block/mmcblk0p3	u:object_r:mep2_block_device:s0
-#SEC removed : /dev/block/mmcblk0p4	u:object_r:dtim_block_device:s0
-# pxa1908 and pxa1936 special
-# it seperates the bootloader from one to
-# rbootloader and pbootloader
-#SEC removed : /dev/block/mmcblk0p5	u:object_r:bootloader_block_device:s0
-#SEC removed : /dev/block/mmcblk0p6	u:object_r:recovery_block_device:s0
-#SEC removed : /dev/block/mmcblk0p7	u:object_r:bootloader_block_device:s0
-#SEC removed : /dev/block/mmcblk0p8	u:object_r:boot_block_device:s0
-#SEC removed : /dev/block/mmcblk0p9	u:object_r:system_block_device:s0
-#SEC removed : /dev/block/mmcblk0p10	u:object_r:misc_block_device:s0
-#SEC removed : /dev/block/mmcblk0p11	u:object_r:radio_block_device:s0
-#SEC removed : /dev/block/mmcblk0p12	u:object_r:nvm_block_device:s0
-#SEC removed : /dev/block/mmcblk0p13	u:object_r:security_block_device:s0
-#SEC removed : /dev/block/mmcblk0p14	u:object_r:cache_block_device:s0
-#SEC removed : /dev/block/mmcblk0p15	u:object_r:userdata_block_device:s0
-
-# boot device
-#SEC removed : /dev/block/mmcblk0boot[0-9]+  u:object_r:boot_block_device:s0
-
-# socket
-/dev/socket/rild[0-9]+	u:object_r:rild_socket:s0
-/dev/socket/atcmdni[0-9]+	u:object_r:rild_socket:s0
-/dev/socket/atil[0-9]*	u:object_r:rild_socket:s0
-#SEC removed : /dev/socket/imsd	u:object_r:imsd_socket:s0
-/dev/socket/embmsd	u:object_r:embmsd_socket:s0
-#SEC removed : conflict, /dev/socket/rild-debug[0-9]+ u:object_r:rild_debug_socket:s0
-
-# system/bin
-/system/bin/nvm		u:object_r:nvm_exec:s0
-/system/bin/setup_fs	u:object_r:setup_fs_exec:s0
-/system/bin/pppmodem	u:object_r:pppmodem_exec:s0
-/system/bin/eeh		u:object_r:eeh_exec:s0
-/system/bin/diag	u:object_r:diag_exec:s0
-/system/bin/atcmdsrv	u:object_r:atcmdsrv_exec:s0
-# Attention: these cases have different name between
-# exec file name and process name. the name is from
-# init.pxa1xxx.tel.rc, init.pxa1xxx.rc, init_bsp.pxa1xxx.tel.rc
-/system/bin/tel_launch\.sh	u:object_r:marvelltel_exec:s0
-/system/bin/tel_launch_no_gui\.sh	u:object_r:marvelltel_exec:s0
-/system/bin/FMRadioServer	u:object_r:FMRadiod_exec:s0
-/system/bin/MarvellWirelessDaemon	u:object_r:mwirelessd_exec:s0
-/system/bin/IMLLog	u:object_r:iml_exec:s0
-/system/bin/log_on_boot\.sh	u:object_r:log_on_boot_exec:s0
-#SEC removed : conflict /system/bin/imsd	u:object_r:imsc_exec:s0
-/system/bin/MarvellNfcExtensionsDaemon	u:object_r:mned_exec:s0
-/system/bin/update_touch_fw\.sh	u:object_r:touch_updater_exec:s0
-/system/bin/phservice	u:object_r:phservice_exec:s0
-/system/bin/kmsg\.sh	u:object_r:kmsg_exec:s0
-/system/bin/root_detect u:object_r:root_detect_exec:s0
-/system/bin/load_calibration_data\.sh 	u:object_r:load_g_cali_data_exec:s0
-/system/bin/memsicd	u:object_r:memsicd_exec:s0
-/system/bin/memsicp	u:object_r:memsicp_exec:s0
-/system/bin/codecIPC_server	u:object_r:codecIPC_server_exec:s0
-/system/bin/mrvl_gpsd	u:object_r:mrvl_gpsd_exec:s0
-/system/bin/core-compressor u:object_r:core_compressor_exec:s0
-/system/bin/at_router   u:object_r:at_router_exec:s0
-/system/bin/env\.sh   u:object_r:env_exec:s0
-
-
-# nfc data
-#SEC removed: conflict, /data/nfc(/.*)?		u:object_r:nfc_data_file:s0
-/data/misc/wireless(/.*)?	u:object_r:wireless_data_file:s0
-#SEC removed: conflict, /data/log(/.*)?		u:object_r:dump_log_data_file:s0
-/data/mrvl_tel_diag\.cfg	u:object_r:tel_data_file:s0
-/data/mrvl_tel_iml\.cfg	u:object_r:tel_data_file:s0
-
-# for tz
-/system/bin/teec_sstd_ca	u:object_r:teecsstdca_exec:s0
-
-# for hawk
-/system/bin/run_hawk_on_boot\.sh	u:object_r:run_hawk_on_boot_exec:s0
-/system/bin/hawk		u:object_r:hawk_exec:s0
-#line 1 "vendor/samsung/common/sepolicy/BSP/bsp_sprd/file_contexts"
-#############################
-# productinfo files
-#
-/productinfo(/.*)?      u:object_r:prod_file:s0
-#############################
-# systeminfo files
-#
-/systeminfo(/.*)?       u:object_r:prod_file:s0
-#############################
-# device files
-#
-#SEC remove: /dev/mali0		u:object_r:gpu_device:s0
-/dev/spipe_lte1         u:object_r:spipe_device:s0
-/dev/spipe_w4           u:object_r:audio_device:s0
-/dev/spipe_w6           u:object_r:audio_device:s0
-/dev/spipe_lte8		u:object_r:refnotify_device:s0
-#SEC remove: /dev/rtc0		u:object_r:refnotify_device:s0
-/dev/spipe_w14          u:object_r:audio_device:s0
-/dev/spipe_w8           u:object_r:refnotify_device:s0
-/dev/sprd_gsp           u:object_r:graphics_device:s0
-/dev/lis3dh_acc         u:object_r:sensors_device:s0
-/dev/ltr_558als         u:object_r:sensors_device:s0
-/dev/sprd_sensor        u:object_r:sensors_device:s0
-/dev/sprd_rotation      u:object_r:sensors_device:s0
-/dev/sprd_isp           u:object_r:camera_device:s0
-/dev/sprd_scale         u:object_r:camera_device:s0
-/dev/sprd_image         u:object_r:camera_device:s0
-/dev/ttyV1              u:object_r:gps_device:s0
-/dev/sprd_vsp           u:object_r:video_device:s0
-/dev/sprd_coda7l        u:object_r:video_device:s0
-/dev/sprd_vpp           u:object_r:video_device:s0
-/dev/sprd_jpg           u:object_r:graphics_device:s0
-
-/dev/sdiag_lte          u:object_r:slog_device:s0
-/dev/slog_lte           u:object_r:slog_device:s0
-
-/dev/iq_mem             u:object_r:slog_device:s0
-#SEC remove: /dev/ttyGS[0-9]         u:object_r:serial_device:s0
-/dev/stty_w0            u:object_r:tty_device:s0
-/dev/stty_w[0-9]*       u:object_r:radio_device:s0
-/dev/vser               u:object_r:serial_device:s0
-
-/dev/sttybt0            u:object_r:hci_attach_dev:s0
-/dev/autotst 		u:object_r:autotest_device:s0
-
-
-#SEC remove: /dev/socket/rild2        u:object_r:rild_socket:s0
-#SEC remove: /dev/socket/rild3        u:object_r:rild_socket:s0
-/dev/socket/srtserver    u:object_r:srt_socket:s0
-
-/dev/stty_td[0-9]*       u:object_r:tty_device:s0
-/dev/stty_lte[0-9]*      u:object_r:tty_device:s0
-
-/dev/Trout_FM            u:object_r:audio_device:s0
-#SEC remove: /dev/pipe                u:object_r:audio_device:s0
-#SEC remove: /dev/block/mmcblk0p[0-9]* u:object_r:mmcblk_device:s0
-#SEC remove: /dev/block/mmcblk0boot0  u:object_r:mmcblk_device:s0
-#SEC remove: /dev/block/mmcblk0boot1  u:object_r:mmcblk_device:s0
-#SEC remove: /dev/block/mmcblk0p17    u:object_r:mmcblk_device:s0
-#SEC remove: /dev/block/mmcblk0p18    u:object_r:frp_block_device:s0
-#SEC remove: /dev/block/mmcblk0p19    u:object_r:mmcblk_device:s0
-#SEC remove: /dev/block/mmcblk0p21    u:object_r:mmcblk_device:s0
-#SEC remove: /dev/block/mmcblk0p22    u:object_r:mmcblk_device:s0
-#SEC remove: /dev/block/mmcblk0p23    u:object_r:mmcblk_device:s0
-#SEC remove: /dev/block/mmcblk1p1    u:object_r:mmcblk_device:s0
-/dev/sprd_efuse_otp      u:object_r:efuse_device:s0
-/dev/sprd_bm             u:object_r:bm_device:s0
-/dev/fm                  u:object_r:fm_device:s0
-/dev/spipe_lte[0-9]*     u:object_r:spipe_device:s0
-#SEC duplicated : /dev/power_ctl       u:object_r:wcn_device:s0
-/dev/download        u:object_r:wcn_device:s0
-/dev/block/platform/sdio_emmc/by-name/boot  u:object_r:boot_block_device:s0
-/dev/block/platform/sdio_emmc/by-name/recovery  u:object_r:recovery_block_device:s0
-/dev/block/platform/sdio_emmc/by-name/persist  u:object_r:frp_block_device:s0
-
-/dev/slog_w              u:object_r:slog_device:s0
-/dev/sdiag_w             u:object_r:slog_device:s0
-/dev/slog_wcn 		     u:object_r:slog_device:s0
-
-/dev/gnss_download        u:object_r:wcn_device:s0
-/dev/gnss_dbg        u:object_r:wcn_device:s0
-/dev/slog_gnss           u:object_r:slog_device:s0
-/dev/cgxdrv          u:object_r:gps_device:s0
-/dev/ttyV0           u:object_r:gps_device:s0
-
-#SEC remove: /dev/block/mmcblk0p[3-6] u:object_r:nv_mmcblk_device:s0
-/dev/spipe_w[0-9]*        u:object_r:spipe_device:s0
-/dev/spipe_wcn[0-9]*     u:object_r:spipe_device:s0
-/dev/spipe_lte2          u:object_r:spipe_device:s0
-/dev/spipe_lte9      u:object_r:modemdriver_vpad_device:s0
-/dev/spipe_lte10          u:object_r:spipe_device:s0
-#############################
-# System files
-#
-/system/bin/data_on.sh  u:object_r:data_on_exec:s0
-/system/bin/data_off.sh u:object_r:data_off_exec:s0
-/system/bin/mplayer     u:object_r:mediaserver_exec:s0
-/system/bin/wcnd     	u:object_r:wcnd_exec:s0
-/system/bin/engpc       u:object_r:engpc_exec:s0
-/system/bin/autotest    u:object_r:autotest_exec:s0
-/system/bin/charge u:object_r:charge_exec:s0
-/system/xbin/zram.sh 	u:object_r:zram_exec:s0
-/system/xbin/srtd    	u:object_r:srtd_exec:s0
-/system/bin/refnotify   u:object_r:refnotify_exec:s0
-/system/bin/modemd      u:object_r:rild_exec:s0
-/system/bin/phoneserver u:object_r:rild_exec:s0
-/system/bin/modem_control u:object_r:modem_control_exec:s0
-/system/bin/rild_sp u:object_r:rild_exec:s0
-/system/bin/cp_diskserver u:object_r:cp_diskserver_exec:s0
-#SEC duplicated : /system/bin/download    u:object_r:download_exec:s0
-/system/bin/gnss_download    u:object_r:gnss_download_exec:s0
-/system/bin/slogmodem	u:object_r:slogmodem_exec:s0
-/system/bin/factorytest u:object_r:factorytest_exec:s0
-/system/bin/phasecheckserver u:object_r:phasecheckserver_exec:s0
-/system/bin/tune2fs       u:object_r:fsck_exec:s0
-/system/bin/resize2fs     u:object_r:fsck_exec:s0
-/system/bin/GPSenseEngine       u:object_r:GPSenseEngine_exec:s0
-
-#SEC duplicated : /system/bin/batterysrv u:object_r:batterysrv_exec:s0
-#SEC duplicatd : /system/bin/gpsd        u:object_r:gpsd_exec:s0
-/system/bin/cmd_services       u:object_r:cmd_services_exec:s0
-/system/bin/modemDriver_vpad_main u:object_r:modemdriver_vpad_exec:s0
-/dev/block/zram0 u:object_r:zram_block_device:s0
-
-/system/bin/nvitemd u:object_r:nvitemd_exec:s0
-
-/data/modem_log(/.*)?	u:object_r:slogmodem_data:s0
-/data/local/englog(/.*)?    u:object_r:engpc_data:s0
-#SEC duplicated : /system/bin/thermald        u:object_r:thermald_exec:s0
-
-############################
-#for sharkl64
-#
-#/dev/spipe_lte4         u:object_r:pipe_device:s0
-#/dev/spipe_lte6         u:object_r:pipe_device:s0
-/dev/spipe_lte4         u:object_r:audio_device:s0
-/dev/spipe_lte6         u:object_r:audio_device:s0
-/dev/epl2182_pls        u:object_r:sensors_device:s0
-
-# for core dump
-/data/corefile(/.*)?    u:object_r:coredump_file:s0
-
-# for hprofiles
-#SEC duplicated : /data/misc/hprofs(/.*)?   u:object_r:hprofs_file:s0
-
-# CP time synchronization FIFO
-/data/w_timesyncfifo	u:object_r:ts_fifo:s0
-/data/td_timesyncfifo	u:object_r:ts_fifo:s0
-/data/l_timesyncfifo	u:object_r:ts_fifo:s0
-
-#for factorytest
-/data/cg(/.*)? u:object_r:cg_file:s0
-/data/local/factorytest_log(/.*)?    u:object_r:mmitest_file:s0
-#for slog
-/system/bin/slog u:object_r:slogd_exec:s0
-/data/slog(/.*)? u:object_r:slog_file:s0
-
-#add for data/local/media
-/data/local/media(/.*)? u:object_r:media_data_file:s0
-
-# apr files
-/system/bin/collect_apr u:object_r:aprd_exec:s0
-/data/sprdinfo(/.*)? u:object_r:apr_data_file:s0
-/data/apr.conf u:object_r:apr_data_file:s0
-
-# for mlog
-/data/mlog(/.*)? u:object_r:mlog_file:s0
-
-#charge test file
-/data/.battery_nv		u:object_r:self_system_data_file:s0
-
-#GNSS
-/data/gnss(/.*)? u:object_r:gnss_file:s0
-#line 1 "vendor/samsung/common/sepolicy/model/file_contexts"
-############################# 
-# Device node
-#
-
-############################# 
-# DATA file
-#
-/data/data/\.drm(/.*)?	u:object_r:drm_playready_file:s0
-############################# 
-# efs file
-#
-# com.sec.android.preloadinstaller write currentlyFactoryReset
-# path was changed /efs/recovery/currentlyFactoryReset" by recovery team.
-#/efs/\.currentlyFactoryReset            u:object_r:app_efs_file:s0
-/efs/Battery/fg_full_voltage		 u:object_r:app_efs_file:s0
-# com.sec.imsservice write silent_redial
-/efs/silent_redial                     u:object_r:app_efs_file:s0
-# HDCP and Widevine key. support r/w for radio and system app
-/efs/h2k\.dat                           u:object_r:cpk_efs_file:s0
-/efs/redata\.bin                        u:object_r:cpk_efs_file:s0
-/efs/wv\.keys                           u:object_r:cpk_efs_file:s0
-/efs/total_call_time                   u:object_r:app_efs_file:s0
-
-
-############################# 
-# System files of sec_common
-#
-/system/bin/ftm_ptt             u:object_r:ftm_ptt_exec:s0
-/system/bin/lpm                 u:object_r:lpm_exec:s0
-/system/bin/rtccd3          u:object_r:rtcc_exec:s0
-
-############################# 
-# Device node of sec_common
-#
-/dev/block/mmcblk[0-9].*	   u:object_r:emmcblk_device:s0
-/dev/block/zram[0-9]		u:object_r:ram_device:s0
-
-/sys/class/net/wlan0/queues/rx-[0-9]/rps_cpus             u:object_r:sysfs_ss_writable:s0
-/sys/class/kgsl/kgsl-3d0/dispatch(/.*)?     --            u:object_r:sysfs_ss_writable:s0
-/sys/class/power_supply/battery/camera                    u:object_r:sysfs_app_writable:s0
-
-#line 1 "vendor/samsung/common/sepolicy/slsi_common/file_contexts"
-
-## CP daemon
-/system/bin/rild_exynos         u:object_r:rild_exec:s0
-/system/bin/rild_SIPC           u:object_r:rild_exec:s0
-/system/bin/dmd                 u:object_r:dmd_exec:s0
-
-#line 1 "vendor/samsung/common/sepolicy/marvell_common/file_contexts"
-
-## SEC added ##
-###########################
-# Marvell Device node
-#
-/dev/accelerometer_sensor       u:object_r:sensor_device:s0
-/dev/magnetic_sensor       		u:object_r:sensor_device:s0
-##SEC removed: /dev/block/mmcblk0boot[0-9]     u:object_r:bootblk_device:s0
-/dev/cmsockdev64                u:object_r:gps_device:s0
-/dev/crmdev[0-9]                u:object_r:gps_device:s0
-/dev/proximity_sensor           u:object_r:sensor_device:s0
-/dev/tzdd                       u:object_r:tz_device:s0
-/dev/umts_rfs[0-9]+             u:object_r:ssipc_device:s0
-
-/system/bin/gpslpm_srv          u:object_r:gpslpm_srv_exec:s0
-
-/data/misc/phone(/.*)?	        u:object_r:phone_data_file:s0
-
-#line 1 "vendor/samsung/common/sepolicy/sprd_common/file_contexts"
-#############################
-# System files
-#
-
-/system/bin/batterysrv                 u:object_r:batterysrv_exec:s0
-/system/bin/download                   u:object_r:download_exec:s0
-/system/bin/ext_symlink.sh             u:object_r:ext_symlink_exec:s0
-/system/bin/sprd_res_monitor	u:object_r:sprd_res_monitor_exec:s0
-
-
-/dev/pipe(/.*)?                u:object_r:audio_device:s0
-/dev/rpipe(/.*)?                u:object_r:audio_device:s0
-/dev/power_ctl                 u:object_r:power_ctl_device:s0
-
-/data/misc/hprofs(/.*)?	u:object_r:dumplog_data_file:s0
-
-#line 1 "vendor/samsung/common/sepolicy/3rd/vmware/file_contexts"
-# VMware daemon
-/system/bin/mvpd	u:object_r:vmwared_exec:s0
-
-# Vmware device
-/dev/mvpkm		u:object_r:vmware_device:s0
-
-# VMWare sysfs
-/sys/hypervisor(/.*)	u:object_r:sysfs_vmware_writable:s0
-#line 1 "vendor/samsung/common/sepolicy/3rd/mcafee/file_contexts"
-#
-# Copyright 2015 McAfee, Inc. All rights reserved.
-#
-
-# McAfee scanner daemon
-/dev/socket/mfescand u:object_r:mfescand_socket:s0
-/system/bin/mfescand u:object_r:mfescand_exec:s0
-
-# McAfee directories/files
-/system/etc/mcafee(/.*)? u:object_r:mcafee_conf_file:s0
-/data/misc/mcafee(/.*)? u:object_r:mcafee_data_file:s0
-/data/misc/mcafee/mcs(/.*)? u:object_r:mcafee_mcs_file:s0
-/data/misc/mcafee/mcs/mcs.fs/xm(/.*)? u:object_r:mcafee_mcsfs_xm_file:s0
-/data/misc/mcafee/mfescand/temp(/.*)? u:object_r:mcafee_temp_file:s0
-
-#line 1 "vendor/samsung/common/sepolicy/file_contexts"
-#############################
-# block device for all model
-/dev/block/platform/.+/by-name/(boot|BOOT)?				u:object_r:boot_block_device:s0
-/dev/block/platform/.+/by-name/(cache|CACHE)?			u:object_r:cache_block_device:s0
-/dev/block/platform/.+/by-name/(modem|MODEM)?			u:object_r:modem_device:s0
-/dev/block/platform/.+/by-name/(persistent|PERSISTENT)?	u:object_r:frp_block_device:s0
-/dev/block/platform/.+/by-name/(recovery|RECOVERY)?		u:object_r:recovery_block_device:s0
-/dev/block/platform/.+/by-name/(system|SYSTEM)?			u:object_r:system_block_device:s0
-/dev/block/platform/.+/by-name/(userdata|USERDATA)?		u:object_r:userdata_block_device:s0
-
-/dev/block/platform/.+/by-name/(efs|EFS)?				u:object_r:efsblk_device:s0
-
-/dev/block/mmcblk[0-9a-z]*	   u:object_r:emmcblk_device:s0
-#/dev/block/mmcblk0p[0-9]*    u:object_r:emmcblk_device:s0
-#/dev/block/mmcblk1p.*   u:object_r:emmcblk_device:s0
-#/dev/block/mmcblk1p1    u:object_r:emmcblk_device:s0
-/dev/block/modem(/.*)?	u:object_r:modem_device:s0
-/dev/block/sd[a-z][0-9]*    u:object_r:emmcblk_device:s0
-/dev/block/vnswap0		u:object_r:swap_device:s0
-#/dev/block/platform/msm_sdcc\.1/by-name/cache	u:object_r:cachechr_device:s0
-#/dev/block/platform/msm_sdcc\.1/by-name/fsg	u:object_r:fsg_device:s0
-#/dev/block/platform/msm_sdcc\.1/by-name/m9kefs[0-3]*	u:object_r:emmcblk_device:s0
-#/dev/block/platform/msm_sdcc\.1/by-name/modem	u:object_r:modem_device:s0
-#/dev/block/platform/msm_sdcc\.1/by-name/param		u:object_r:emmcblk_device:s0
-
-############################# 
-# Device node of sec_common
-#
-/dev/\.secure_storage(/.*)?		u:object_r:secure_storage_device:s0
-/dev/__kmsg	u:object_r:klog_device:s0
-/dev/alps_io	u:object_r:input_device:s0
-/dev/android_ssusbcon(/.*)?		u:object_r:usb_device:s0
-/dev/batch_io	u:object_r:io_device:s0
-/dev/bcm2079x	u:object_r:nfc_device:s0
-/dev/bus/usb(/.*)?      u:object_r:usb_bus_device:s0
-/dev/cdma_.*		u:object_r:radio_device:s0
-/dev/context		u:object_r:context_device:s0
-# conflict with Qcom BSP, /dev/diag	u:object_r:diag_device:s0
-/dev/esfp[0-9]          u:object_r:fp_sensor_device:s0
-/dev/gnss_ipc                                         u:object_r:gps_device:s0
-/dev/i2c.*		u:object_r:i2c_device:s0
-/dev/icd                u:object_r:icd_device:s0
-/dev/icdr               u:object_r:icd_device:s0
-/dev/ionfd2phys         u:object_r:ion_device:s0
-/dev/isdbt                      u:object_r:mmb_device:s0
-# conflict with Qcom BSP, /dev/media[0-3]*	u:object_r:camera_device:s0
-/dev/max_hrm	u:object_r:hrm_device:s0
-/dev/mobicore	u:object_r:mobicore_device:s0
-/dev/mobicore-user	u:object_r:mobicore-user_device:s0
-/dev/ovr[0-9]*		u:object_r:ovr_device:s0
-/dev/hidraw[0-9]*	u:object_r:ovr_device:s0
-/dev/peel_ir	u:object_r:ir_device:s0
-/dev/pipes(/.*)?    u:object_r:system_fifo:s0
-/dev/p3		u:object_r:sem_device:s0
-/dev/p61		u:object_r:sem_device:s0
-/dev/pn547		u:object_r:nfc_device:s0
-/dev/power_on_alarm                                   u:object_r:alarm_device:s0
-/dev/scsc_h4_0                                        u:object_r:serial_device:s0
-/dev/sec-nfc		u:object_r:nfc_device:s0
-/dev/sec-nfc-fn		u:object_r:nfc_device:s0
-/dev/shtc1_sensor	u:object_r:sensor_device:s0
-/dev/socket/bluetooth	u:object_r:bluetooth_socket:s0
-/dev/socket/charon		u:object_r:charon_socket:s0
-/dev/socket/cs_socket	u:object_r:cs_socket:s0
-/dev/socket/dir_enc_report	u:object_r:vold_socket:s0
-/dev/socket/epm     u:object_r:epm_socket:s0
-/dev/socket/eris                                      u:object_r:eris_socket:s0
-/dev/socket/frigate		u:object_r:frigate_socket:s0
-/dev/socket/imsd	u:object_r:imsd_socket:s0
-/dev/socket/ipsec_socket        u:object_r:ipsec_socket:s0
-/dev/socket/jack(/.*)?          u:object_r:jack_socket:s0
-/dev/socket/msockets(/.*)?	u:object_r:msockets_socket:s0
-/dev/socket/mtp(/.*)?           u:object_r:mtp_socket:s0
-/dev/socket/ppm     u:object_r:epm_socket:s0
-## TG request(simiso.kim, CP team) by email, 6.0.1, New socket to get iptables and tc command from rild to netd
-/dev/socket/qosd     u:object_r:qosd_socket:s0
-/dev/socket/rild[0-9]*	u:object_r:rild_socket:s0
-/dev/socket/rild-debug[0-9]* u:object_r:rild_debug_socket:s0
-/dev/socket/ss_conn_daemon      u:object_r:ss_conn_daemon_socket:s0
-/dev/socket/taa                  u:object_r:tz_socket:s0
-/dev/socket/tunman	        u:object_r:tunman_socket:s0
-/dev/socket/tz                  u:object_r:tz_socket:s0
-/dev/socket/uibc(/.*)?          u:object_r:uibc_socket:s0
-/dev/socket/vpnclientd          u:object_r:vpnclientd_socket:s0
-/dev/socket/vaultkeeper(/.*)?   u:object_r:vaultkeeper_socket:s0
-/dev/sound_trigger_boost        u:object_r:audio_device:s0
-/dev/ssp_sensorhub	u:object_r:input_device:s0
-/dev/ssp_data_injection	u:object_r:input_device:s0
-/dev/timerirq	u:object_r:timerirq_device:s0
-/dev/ttyGS[0-9]*	u:object_r:usb_serial_device:s0
-/dev/ttyUSB[0-9]*	u:object_r:usb_device:s0
-# SEA_site_M#92; requested by jh21.hwang
-# the B2B client requests some specific path range such as /dev/ttyUSB0 ~ /dev/ttyUSB30, /dev/ttyACM0 ~ /dev/ttyACM30
-/dev/ttyACM[0-9]*	u:object_r:usb_device:s0
-/dev/t-base-tui                    u:object_r:tui_device:s0
-/dev/tuihw	u:object_r:tz_device:s0
-/dev/tzdev	u:object_r:tz_device:s0
-/dev/tzic	u:object_r:tz_device:s0
-/dev/tzirs	u:object_r:tz_device:s0
-/dev/url	u:object_r:url_device:s0
-/dev/usb(/.*)?	u:object_r:usb_device:s0
-/dev/usb.*	u:object_r:usb_device:s0
-/dev/usb/tty.*	u:object_r:usb_device:s0
-/dev/usb_mtp_gadget.*	u:object_r:mtp_device:s0
-/dev/validity(/.*)?	u:object_r:validity_device:s0
-/dev/vfsspi	u:object_r:vfsspi_device:s0
-/dev/video26        u:object_r:video_scaler_device:s0
-/dev/video29        u:object_r:video_scaler_device:s0
-/dev/video4[0-9]        u:object_r:camera_device:s0
-/dev/video5[0-2]        u:object_r:video_scaler_device:s0
-
-############################# 
-# Device node of knox_common
-## Knox Sensitive data protection, DEK engine driver access
-/dev/dek_evt	u:object_r:knox_dar_device:s0
-/dev/dek_kek	u:object_r:knox_dar_device:s0
-/dev/dek_log	u:object_r:knox_dar_device:s0
-/dev/dek_req	u:object_r:knox_dar_shared_device:s0
-/dev/sdp_mm	u:object_r:knox_dar_device:s0
-/dev/knox_kap	u:object_r:knox_kap_device:s0
-
-/dev/sdp_dlp	u:object_r:knox_dar_device:s0
-
-############################# 
-# Device node of mobile_payments
-/dev/mst_ctrl	u:object_r:mst_ctrl_device:s0
-
-############################# 
-# Device node of qcom_common
-#
-/dev/adnc[0-9]*		u:object_r:adnc_device:s0
-/dev/dbmdx-1		u:object_r:audio_device:s0
-/dev/android_rndis_qc	u:object_r:radio_device:s0
-/dev/audience_a2220	u:object_r:audio_device:s0
-/dev/btlock	u:object_r:hci_attach_dev:s0
-#####/dev/btlock			u:object_r:bluetooth_device:s0 
-#ciq_bridge PLM
-/dev/ciq_bridge         u:object_r:ciqbridge_device:s0
-/dev/coresight-.*                                u:object_r:coresight_device:s0
-/dev/dbd[0-9]*		u:object_r:adnc_device:s0
-/dev/dun	u:object_r:dun_device:s0
-/dev/dvb(/.*)?  u:object_r:dvb_device:s0
-# conflict with Qcom BSP, /dev/efs_bridge	u:object_r:radio_device:s0
-# conflict with Qcom BSP, /dev/efs_hsic_bridge u:object_r:radio_device:s0
-# conflict with Qcom BSP, /dev/esoc-[0-9]*       u:object_r:esoc_device:s0
-/dev/gemini0	u:object_r:camera_device:s0
-/dev/genlock	u:object_r:genlock_device:s0
-/dev/gsm_.*	u:object_r:radio_device:s0
-# conflict with Qcom BSP, /dev/hsicctl[0-3]*	u:object_r:qmuxd_device:s0
-# conflict with Qcom BSP, /dev/jpeg[0-2]*		u:object_r:camera_device:s0
-/dev/kgsl-[0-9a-z]*   u:object_r:kgsl_device:s0
-# conflict with Qcom BSP, /dev/ks_bridge	u:object_r:radio_device:s0
-# conflict with Qcom BSP, /dev/ks_hsic_bridge	u:object_r:radio_device:s0
-/dev/mdm	u:object_r:radio_device:s0
-#####/dev/mdm			u:object_r:mdm_device:s0
-/dev/msm_aac	u:object_r:audio_device:s0
-/dev/msm_aac_in	u:object_r:audio_device:s0
-/dev/msm_acdb	u:object_r:audio_device:s0
-/dev/msm_amrnb	u:object_r:audio_device:s0
-/dev/msm_amrnb_in	u:object_r:audio_device:s0
-/dev/msm_amrwb	u:object_r:audio_device:s0
-/dev/msm_amrwb_in	u:object_r:audio_device:s0
-/dev/msm_amrwbplus	u:object_r:audio_device:s0
-/dev/msm_camera(/.*)?	u:object_r:camera_device:s0
-/dev/msm_evrc	u:object_r:audio_device:s0
-/dev/msm_evrc_in	u:object_r:audio_device:s0
-/dev/msm_mp3	u:object_r:audio_device:s0
-/dev/msm_multi_aac	u:object_r:audio_device:s0
-/dev/msm_qcelp	u:object_r:audio_device:s0
-/dev/msm_qcelp_in	u:object_r:audio_device:s0
-/dev/msm_rotator u:object_r:graphics_device:s0
-/dev/msm_rtac	u:object_r:audio_device:s0
-/dev/msm_sps	u:object_r:input_device:s0
-/dev/msm_vidc_.*	u:object_r:audio_device:s0
-/dev/msm_wma	u:object_r:audio_device:s0
-/dev/msm_wmapro	u:object_r:audio_device:s0
-/dev/msm_wma_pro	u:object_r:audio_device:s0
-/dev/network_latency	u:object_r:radio_device:s0
-/dev/network_throughput	u:object_r:radio_device:s0
-/dev/nmea	u:object_r:radio_device:s0
-/dev/pmem_audio u:object_r:audio_device:s0
-/dev/pta                u:object_r:pta_device:s0
-/dev/qmi[0-9]*	u:object_r:radio_device:s0
-# conflict with Qcom BSP, /dev/rmnet_mux_ctrl	u:object_r:radio_device:s0
-/dev/rtc[0-9]*	u:object_r:clock_device:s0
-/dev/sg[0-9]*	        u:object_r:sg_device:s0
-/dev/smd_cxm_qmi	u:object_r:smd_cxm_qmi_device:s0
-/dev/smdcntl[0-9]*	u:object_r:smd_cntl_device:s0
-/dev/socket/audio	u:object_r:audio_socket:s0
-/dev/socket/mpctl	u:object_r:mpctl_socket:s0
-/dev/socket/mpdecision(/.*)?	u:object_r:mpdecision_socket:s0
-# conflict with Qcom BSP, /dev/socket/pps	u:object_r:pps_socket:s0
-/dev/socket/radio	u:object_r:radio_socket:s0
-# conflict with Qcom BSP, /dev/subsys_esoc[0-9]*       u:object_r:esoc_device:s0
-/dev/tspdrv	u:object_r:vibrator_device:s0
-# conflict with Qcom BSP, /dev/ttyHSL[0-9]*	u:object_r:radio_device:s0
-/dev/usf1	u:object_r:usf_device:s0
-/dev/umts_ipc0	u:object_r:radio_device:s0
-/dev/v4l-subdev[0-9]*	u:object_r:camera_device:s0
-#####/dev/v4l-subdev[0-9]*	u:object_r:video_device:s0
-# conflict with Qcom BSP, /dev/wcnss_wlan	u:object_r:wifi_device:s0
-
-############################# 
-# Device node of slsi_common
-#
-/dev/akm8963		u:object_r:akm8963_device:s0
-/dev/b\.L_.*			u:object_r:ap_device:s0
-/dev/bbd_control	u:object_r:bbd_device:s0
-/dev/bbd_packet		u:object_r:bbd_device:s0
-/dev/bbd_patch		u:object_r:bbd_device:s0
-/dev/bbd_reliable	u:object_r:bbd_device:s0
-/dev/bbd_sensor		u:object_r:bbd_device:s0
-/dev/bbd_sio		u:object_r:bbd_device:s0
-/dev/bL.*			u:object_r:ap_device:s0
-/dev/cpu.*			u:object_r:ap_device:s0
-/dev/dir_enc_report	u:object_r:report_device:s0
-/dev/ecryptfs		u:object_r:ecryptfs_device:s0
-/dev/ehci_power         u:object_r:mif_device:s0
-/dev/exynos-mem		u:object_r:graphics_device:s0
-/dev/fimg2d(/.*)?     	u:object_r:fimg2d_video_device:s0
-/dev/gps_geofence_wake			u:object_r:gps_device:s0
-/dev/invensense			u:object_r:sensors_device:s0
-/dev/keychord		u:object_r:keychord_device:s0
-/dev/kfc_freq_min	u:object_r:ap_device:s0
-/dev/link_pm		u:object_r:radio_device:s0
-# exynos5433 libhw1shotjpm1 and libscaler
-/dev/m2m1shot_jpeg	u:object_r:m2m1shot_device:s0
-/dev/m2m1shot_scaler.*	u:object_r:m2m1shot_device:s0
-/dev/mali	u:object_r:gpu_device:s0
-/dev/mali[0-9]	u:object_r:gpu_device:s0
-/dev/mbin[0-9]	u:object_r:mbin_device:s0
-/dev/mdns			u:object_r:mdns_device:s0
-/dev/multipdp			u:object_r:multipdp_device:s0 
-/dev/psaux			u:object_r:psaux_device:s0
-/dev/pts(/.*)?			u:object_r:pts_device:s0
-/dev/pvr_sync	u:object_r:pvrsync_device:s0
-/dev/s5p-smem	u:object_r:s5p_smem_device:s0
-/dev/seiren		u:object_r:seiren_device:s0
-/dev/spi_boot_link              u:object_r:spi_boot_device:s0
-/dev/srp		u:object_r:srp_device:s0
-/dev/sw_sync	u:object_r:sync_device:s0
-/dev/ttyBCM[0-9]*   u:object_r:bbd_device:s0
-/dev/ttySAC[0-9]*	u:object_r:uart_device:s0
-/dev/ump            u:object_r:gpu_device:s0
-/dev/umts.*			u:object_r:mif_device:s0 
-
-
-####################################
-# sysfs files of sec_common
-#
-# no need because of genfscon /sys(/.*)?	u:object_r:sysfs:s0
-/sys/class/camera(/.*)?	--                 u:object_r:sysfs_camera_writable:s0
-/sys/class/devfreq/exynos5-busfreq-mif(/.*)? -- u:object_r:sysfs_exynos_writable:s0
-/sys/class/graphics/fb[0-9](/.*)?	-- u:object_r:sysfs_graphics:s0
-/sys/class/lcd(/.*)?	-- u:object_r:sysfs_lcd_writable:s0
-/sys/class/leds/moodlight/blink                       u:object_r:sysfs_led_writable:s0
-/sys/class/leds/smartglow/blink                       u:object_r:sysfs_led_writable:s0 
-/sys/class/mdnie(/.*)?	--                 u:object_r:sysfs_mdnie_writable:s0
-/sys/class/mst/mst_ftmdrv/transmit         u:object_r:sysfs_mst_writable:s0
-/sys/class/mstldo/mst_drv/transmit         u:object_r:sysfs_mst_writable:s0
-/sys/class/power_supply/battery(/.*)?	-- u:object_r:sysfs_battery_supply:s0
-/sys/class/power_supply/battery/music -- u:object_r:sysfs_music_power_writable:s0
-/sys/class/power_supply/usb(/.*)?	       --     u:object_r:sysfs_usb_supply:s0
-/sys/class/rfkill/rfkill[0-9]*/state -- u:object_r:sysfs_bluetooth_writable:s0
-/sys/class/rfkill/rfkill[0-9]*/type -- u:object_r:sysfs_bluetooth_writable:s0
-/sys/class/sec(/.*)?                --               u:object_r:sysfs_sec:s0
-/sys/class/sensors(/.*)?            --               u:object_r:sysfs_sensor_writable:s0
-/sys/class/tcon(/.*)?	--                 u:object_r:sysfs_tcon_writable:s0
-/sys/devices/virtual/sec/sec_epen(/.*)?		--	u:object_r:sysfs_sec:s0
-# Remove because of restorecon_recursive_symlink /sys/devices/virtual/sec(/.*)?      --               u:object_r:sysfs_sec:s0
-#/sys/qemu_trace(/.*)?	--	u:object_r:sysfs_writable:s0
-/sys/kernel/config(/.*)?                              u:object_r:configfs:s0
-
-
-### start : supporting Factory app.
-/sys/bus/i2c/drivers/fsa9480/7-0025/syssleep          u:object_r:sysfs_ss_writable:s0
-/sys/bus/i2c/drivers/sm5502/7-0025/syssleep           u:object_r:sysfs_ss_writable:s0
-/sys/class/android_usb/android0(/.*)?          --     u:object_r:sysfs_android_usb:s0
-/sys/class/backlight(/.*)?                     --     u:object_r:sysfs_ss_writable:s0 
-/sys/class/dsm/maxdsm_cal(/.*)?                --     u:object_r:sysfs_ss_writable:s0
-/sys/class/earsmart/control/always_stream_fs_on       u:object_r:sysfs_ss_writable:s0
-/sys/class/host_notify(/.*)?                   --     u:object_r:sysfs_ss_writable:s0   
-/sys/class/leds/led_[1-4](/.*)?                --     u:object_r:sysfs_led_writable:s0   
-/sys/class/timed_output/vibrator/enable               u:object_r:sysfs_ss_writable:s0   
-/sys/class/ultrasonic/ultrasonic/data                 u:object_r:sysfs_ss_writable:s0 
-/sys/class/usb/otg/test                               u:object_r:sysfs_ss_writable:s0
-/sys/devices/14ac0000\.mali/power_policy               u:object_r:sysfs_ss_writable:s0
-/sys/devices/platform/omapdss/display1/sec_timing     u:object_r:sysfs_ss_writable:s0
-/sys/devices/virtual/misc/umts_dm0/dm_state             u:object_r:sysfs_ss_writable:s0 
-# Remove because of restorecon_recursive_symlink /sys/devices/virtual/sec_param/sec_param/power_onoff    u:object_r:sysfs_ss_writable:s0
-/sys/class/sec_param/sec_param/power_onoff            u:object_r:sysfs_ss_writable:s0 
-/sys/kernel/usb_atparser/uart_wakelock                  u:object_r:sysfs_ss_writable:s0 
-/sys/module/cpuidle/parameters/allow_coupled_idle       u:object_r:sysfs_ss_writable:s0 
-/sys/module/cpuidle/parameters/enable_mask              u:object_r:sysfs_ss_writable:s0
-/sys/module/cpuidle_exynos4/parameters/enable_mask      u:object_r:sysfs_ss_writable:s0
-/sys/module/cpuidle_exynos4415/parameters/enable_mask   u:object_r:sysfs_ss_writable:s0 
-/sys/module/cpuidle_exynos5433/parameters/enable_mask   u:object_r:sysfs_ss_writable:s0 
-/sys/module/cpuidle_exynos64/parameters/enable_mask     u:object_r:sysfs_ss_writable:s0
-/sys/module/lpm_levels/parameters/secdebug              u:object_r:sysfs_ss_writable:s0
-/sys/module/exynos3470_cpuidle/parameters/enable_mask   u:object_r:sysfs_ss_writable:s0
-/sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled              u:object_r:sysfs_ss_writable:s0
-/sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/idle_enabled   u:object_r:sysfs_ss_writable:s0
-/sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/idle_enabled   u:object_r:sysfs_ss_writable:s0
-/sys/module/qpnp_power_on/parameters/reset_enabled                      u:object_r:sysfs_ss_writable:s0
-/sys/module/qpnp_int/parameters/debug_mask                              u:object_r:sysfs_ss_writable:s0
-/sys/module/qpnp_power_on/parameters/wake_enabled                       u:object_r:sysfs_ss_writable:s0
-/sys/power/ftm_sleep                                                    u:object_r:sysfs_ss_writable:s0
-### end : supporting Factory app.
-
-# VR inflight write
-/sys/power/cpuhotplug/enabled                           u:object_r:sysfs_ss_writable:s0
-
-#secure touch
-/sys/class/input/input[0-9]+/secure_touch_enable        u:object_r:sysfs_ss_writable:s0
-
-
-############################# 
-# System files of sec_common
-# 
-/sbin/dm_verity_signature_checker	u:object_r:dm_verity_signature_checker_exec:s0
-
-/system/bin/reactived	u:object_r:actlmand_exec:s0
-/system/bin/androidshmservice	u:object_r:androidshmservice_exec:s0
-/system/bin/apaservice		u:object_r:apaservice_exec:s0
-#/system/bin/app_process	u:object_r:zygote_exec:s0
-/system/bin/at_distributor      u:object_r:at_distributor_exec:s0
-/system/bin/mksh	u:object_r:shell_exec:s0
-/system/bin/bauthserver	u:object_r:bauthserver_exec:s0
-/system/bin/bintvoutservice     u:object_r:bintvoutservice_exec:s0 
-/system/bin/bootchecker		u:object_r:bootchecker_exec:s0
-/system/bin/bugreport	u:object_r:bugreport_exec:s0
-/system/bin/cellgeofenced	u:object_r:cellgeofenced_exec:s0
-/system/bin/charon	u:object_r:charon_exec:s0
-/system/bin/connfwexe	u:object_r:connfwexe_exec:s0
-/system/bin/corehelper\.sh	u:object_r:corehelper_sh_file:s0
-/system/bin/createsystemfile	u:object_r:createsystemfile_exec:s0
-/system/bin/cs				u:object_r:cs_exec:s0
-/system/bin/ddexe	u:object_r:ddexe_exec:s0
-/system/bin/dmm_v2              u:object_r:DMM-daemon_exec:s0
-# conflict with Qcom BSP, /system/bin/diag_uart_log	u:object_r:diag_uart_log_exec:s0
-/system/bin/dttexe	u:object_r:dttexe_exec:s0
-/system/bin/dumpsys	u:object_r:dumpsys_exec:s0
-/system/bin/eris                                      u:object_r:eris_exec:s0
-/system/bin/factory\.adsp                             u:object_r:factory_adsp_exec:s0
-/system/bin/fsck\.exfat	--	u:object_r:fsck_exec:s0
-/system/bin/icd	u:object_r:icd_exec:s0
-/system/bin/insthk	u:object_r:insthk_exec:s0
-/system/bin/imsd	u:object_r:imsd_exec:s0
-/system/bin/iod	u:object_r:iod_exec:s0
-/system/bin/ipruleset	u:object_r:ipruleset_exec:s0
-/system/bin/IPSecService	u:object_r:IPSecService_exec:s0
-/system/bin/irisd	u:object_r:irisd_exec:s0
-/system/bin/jackservice		u:object_r:jackservice_exec:s0
-/system/bin/kiesexe	u:object_r:kiesexe_exec:s0
-/system/bin/launcher	u:object_r:launcher_exec:s0
-#/system/bin/logwrapper	u:object_r:logwrapper_exec:s0
-/system/bin/lptcpController     u:object_r:lptcpgc_exec:s0
-#/system/bin/mdnsd	u:object_r:mdnsd_exec:s0
-/system/bin/mkfs\.exfat	--	u:object_r:fsck_exec:s0
-/system/bin/mobicore-startup\.sh u:object_r:mobicore_sh_file:s0
-#/system/bin/netmgrd	u:object_r:netmgrd_exec:s0
-/system/bin/npsmobex	u:object_r:mobexdaemon_exec:s0
-/system/bin/nqs	u:object_r:nqs_exec:s0
-/system/bin/olsrd	u:object_r:olsrd_exec:s0
-/system/bin/p2p_supplicant	u:object_r:p2p_supplicant_exec:s0
-/system/bin/pppoewrapper        u:object_r:pppoewrapper_exec:s0
-/system/bin/prepare_param\.sh	u:object_r:prepare_param_sh_file:s0
-/system/bin/rtc_log\.sh          u:object_r:rtc_log_sh_file:s0
-/system/bin/redsocks          u:object_r:redsocks_exec:s0
-/system/bin/samsungpowersoundplay	u:object_r:samsungpowersoundplay_exec:s0
-/system/bin/scs			u:object_r:scs_exec:s0
-/system/bin/sdp_cryptod			u:object_r:sdp_cryptod_exec:s0
-/system/bin/sec-ril	u:object_r:sec-ril_exec:s0
-/system/bin/secure_storage_daemon	u:object_r:secure_storage_exec:s0
-/system/bin/sem_daemon	u:object_r:sem_exec:s0
-/system/bin/sensorhubservice	u:object_r:sensorhubservice_exec:s0
-/system/bin/selinux-network\.sh	u:object_r:selinux_net_exec:s0
-/system/bin/ss_conn_daemon	u:object_r:ss_conn_daemon_exec:s0
-/system/bin/ss_kbservice_daemon	u:object_r:ss_kbservice_daemon_exec:s0
-/system/bin/smdexe	u:object_r:smdexe_exec:s0
-/system/bin/sshd	u:object_r:sshd_exec:s0
-/system/bin/taadaemon           u:object_r:tzdaemon_exec:s0
-/system/bin/tzdaemon            u:object_r:tzdaemon_exec:s0
-/system/bin/sysmon	u:object_r:sysmon_exec:s0
-/system/bin/tima_dump_log	u:object_r:tima_dump_exec:s0
-
-# for DDC(Dynamic Domain Change)
-/system/bin/trustonic_tee_proxy u:object_r:trustonic_tee_proxy_exec:s0
-
-/system/bin/tlc_server	u:object_r:tlc_server_exec:s0
-/system/bin/tunman	u:object_r:tunman_exec:s0
-/system/bin/otp_server	u:object_r:otp_server_exec:s0
-/system/bin/vcsFPService	u:object_r:vcsFPService_exec:s0
-/system/bin/vfmService		u:object_r:vcsFPService_exec:s0
-/system/bin/vpnclientd          u:object_r:vpnclientd_exec:s0
-/system/bin/vaultkeeperd	u:object_r:vaultkeeperd_exec:s0
-# conflict with Qcom BSP, /system/bin/wcnss_service	u:object_r:wcnss_service_exec:s0
-/system/bin/wldu                                u:object_r:wldu_exec:s0
-/system/bin/wpa_supplicant_real u:object_r:wpa_exec:s0
-
-#ISDBT
-/system/bin/broadcastProcessObserver_ltn	u:object_r:oneseg_mw_exec:s0
-/system/bin/OneSegControl	u:object_r:oneseg_mw_exec:s0
-/system/bin/OneSegDsmcc_ltn	u:object_r:oneseg_mw_exec:s0
-/system/bin/OneSegGinga	u:object_r:oneseg_mw_exec:s0
-/system/bin/OneSegTsDemux_ltn	u:object_r:oneseg_mw_exec:s0
-/system/bin/SMPlayer_fullseg	u:object_r:oneseg_mw_exec:s0
-
-/system/etc/event-log-tags	u:object_r:event_log_tags_file:s0
-/system/etc/dhcpcd(/.*)? u:object_r:dhcp_system_file:s0
-/system/etc/init\.sec\.boot\.sh		u:object_r:sec-sh_exec:s0
-/system/etc/install-recovery\.sh	u:object_r:flash_recovery_sh_file:s0
-/system/etc/ppp(/.*)?	u:object_r:ppp_system_file:s0
-
-/system/lib(/.*)?	u:object_r:system_library_file:s0
-
-############################# 
-# System files of knox_common
-# 
-/system/bin/auditd	u:object_r:auditd_exec:s0
-/system/bin/edmaudit	u:object_r:edmaudit_exec:s0
-/system/bin/epmd	u:object_r:epmd_exec:s0
-/system/bin/epmlogd	u:object_r:epmlogd_exec:s0
-
-############################# 
-# System files of qcom_common
-# 
-# conflict with Qcom BSP, /system/bin/adsprpcd	u:object_r:adsprpcd_exec:s0
-# conflict with Qcom BSP, /system/bin/charger_monitor	u:object_r:charger_monitor_exec:s0
-# conflict with Qcom BSP, /system/bin/dpmd	u:object_r:dpmd_exec:s0
-/system/bin/efsks	u:object_r:efsks_exec:s0
-/system/bin/energy-awareness                     u:object_r:energy-awareness_exec:s0
-/system/bin/geomagneticd u:object_r:geomagneticd_exec:s0
-# conflict with Qcom BSP, /system/bin/gpsone_daemon	u:object_r:gpsone_daemon_exec:s0
-/system/bin/gpu_snapshotd	u:object_r:gpu_snapshotd_exec:s0
-# conflict with Qcom BSP, /system/bin/gsiff_daemon	u:object_r:gsiff_daemon_exec:s0
-# conflict with Qcom BSP, /system/bin/imsqmidaemon	u:object_r:imsqmidaemon_exec:s0
-# conflict with Qcom BSP, /system/bin/ks	u:object_r:ks_exec:s0
-# conflict with Qcom BSP, /system/bin/location-mq	u:object_r:location-mq_exec:s0
-# conflict with Qcom BSP, /system/bin/lowi-server		u:object_r:lowi-server_exec:s0
-/system/bin/macloader	u:object_r:macloader_exec:s0
-/system/bin/mcDriverDaemon	u:object_r:mobicoredaemon_exec:s0
-/system/bin/mcDriverDaemonQC	u:object_r:mobicoredaemon_exec:s0
-# conflict with Qcom BSP, /system/bin/mdm_helper	u:object_r:mdm_helper_exec:s0
-# conflict with Qcom BSP, /system/bin/mdm_helper_proxy	u:object_r:mdm_helper_proxy_exec:s0
-/system/bin/mfgloader	u:object_r:mfgloader_exec:s0
-# conflict with Qcom BSP, /system/bin/mm-pp-daemon	u:object_r:mm-pp-daemon_exec:s0
-# conflict with Qcom BSP, /system/bin/mm-qcamera-daemon	u:object_r:mm-qcamera-daemon_exec:s0
-# conflict with Qcom BSP, /system/bin/mpdecision	u:object_r:mpdecision_exec:s0
-/system/bin/ptt_socket_app	u:object_r:ptt_socket_app_exec:s0
-/system/bin/qcks	u:object_r:qcks_exec:s0
-# conflict with Qcom BSP, /system/bin/qcom-system-daemon	u:object_r:qcom-system-daemon_exec:s0
-/system/bin/qmiproxy	u:object_r:qmiproxy_exec:s0
-/system/bin/qosmgr	u:object_r:qosmgr_exec:s0
-/system/bin/qrngd	u:object_r:qrngd_exec:s0
-# conflict with Qcom BSP, /system/bin/qseecomd	u:object_r:qseecomd_exec:s0
-# conflict with Qcom BSP, /system/bin/quipc_igsn		u:object_r:quipc_igsn_exec:s0
-# conflict with Qcom BSP, /system/bin/quipc_main		u:object_r:quipc_main_exec:s0
-# conflict with Qcom BSP, /system/bin/rfs_access	u:object_r:rfs_access_exec:s0
-# conflict with Qcom BSP, /system/bin/rmt_storage	u:object_r:rmt_storage_exec:s0
-/system/bin/scranton_RD	u:object_r:playready_exec:s0
-/system/bin/secstarter	u:object_r:secstarter_exec:s0
-# conflict with Qcom BSP, /system/bin/ssr_diag	u:object_r:ssr_diag_exec:s0
-/system/bin/thermal-engine               u:object_r:thermal-engine_exec:s0
-/system/bin/thermald u:object_r:thermald_exec:s0
-# conflict with Qcom BSP, /system/bin/time_daemon	u:object_r:time_daemon_exec:s0
-/system/bin/wiperiface		u:object_r:wiperiface_exec:s0
-/system/bin/wlandutservice	u:object_r:wlandutservice_exec:s0
-
-############################# 
-# System files of slsi_common
-# 
-/system/bin/argosd      u:object_r:argosd_exec:s0
-/system/bin/brcm_patchram_plus	u:object_r:brcm_patchram_plus_exec:s0
-/system/bin/bridge_relay         u:object_r:debug_interface_proxy_exec:s0
-/system/bin/debug_interface_proxy	u:object_r:debug_interface_proxy_exec:s0
-/system/bin/diagexe     u:object_r:diagexe_exec:s0
-/system/bin/exyrngd     u:object_r:exyrngd_exec:s0
-/system/bin/gpsd        u:object_r:gpsd_exec:s0 
-/system/bin/secgpsd     u:object_r:gpsd_exec:s0
-/system/bin/lhd         u:object_r:lhd_exec:s0 
-/system/bin/mld         u:object_r:debug_interface_proxy_exec:s0
-/system/bin/mlexe    u:object_r:mlexe_exec:s0 
-/system/bin/mmd         u:object_r:debug_interface_proxy_exec:s0
-/system/bin/rpmbd               u:object_r:rpmbd_exec:s0
-/system/etc/security/\.drm	u:object_r:drm_security_system_file:s0
-/system/bin/sced                u:object_r:sced_exec:s0
-/system/etc/ymc/setup	u:object_r:setup_ymc_etc_system_file:s0
-/system/lib/drm			u:object_r:drm_lib_system_file:s0
-/system/bin/vcd                 u:object_r:vcd_exec:s0
-
-
-
-############################# 
-# DATA file of sec_common
-#
-/data/app-lib(/.*)? 	u:object_r:app_library_file:s0
-/data/app/rpmbd                                       u:object_r:rpmbd_socket:s0
-/data/bcmnfc(/.*)?	u:object_r:nfc_data_file:s0
-/data/bio/ir(/.*)?	                              u:object_r:iris_data_file:s0
-/data/biometrics(/.*)?	                              u:object_r:biometrics_data_file:s0
-#changeBySEA : /data/data/.*		u:object_r:app_data_file:s0
-#/data/data/\.drm(/.*)?	u:object_r:drm_data_file:s0
-#/data/data/com\.android\.providers\.downloads/cache u:object_r:download_file:s0
-/data/data/com\.android\.settings/files/wallpaper	u:object_r:wallpaper_file:s0
-/data/data/com\.android\.shell(/.*)?		u:object_r:shell_data_file:s0
-/data/data/imsqmisocket	u:object_r:system_data_file:s0
-/data/data/lptcpSocket u:object_r:lptcp_data_file:s0
-/data/dipconfs(/.*)?                                  u:object_r:debug_interface_data_file:s0
-/data/DownFilters/Lib(/.*)?		u:object_r:downfilters_lib_file:s0
-/data/DownFilters/Lib64(/.*)?		u:object_r:downfilters_lib_file:s0
-/data/DxDrm(/.*)?                                     u:object_r:drm_playready_file:s0
-/data/firmware(/.*)?		u:object_r:mediaserver_data_file:s0
-/data/fota(/.*)?		                      u:object_r:fota_data_file:s0
-/data/fpSnrTest(/.*)?		                      u:object_r:shared_data_file:s0
-/data/KEqvTaYEYkuJr1Mn+t-SwFvbgYo_(/.*)?  u:object_r:tima_keystore_file:s0
-/data/knox_tima(/.*)?				u:object_r:tima_keystore_file:s0
-/data/log(/.*)?	u:object_r:dumplog_data_file:s0
-/data/media\.tmp(/.*)?	u:object_r:media_rw_data_file:s0
-/data/media/obb(/.*)?	u:object_r:obb_apk_file:s0
-#from nsa
-/data/misc/audit(/.*)?		u:object_r:audit_log:s0
-/data/misc/eris(/.*)?                                 u:object_r:eris_data_file:s0
-/data/misc/jack(/.*)?		u:object_r:jack_data_file:s0
-/data/misc/multimedia(/.*)?                           u:object_r:mediaserver_data_file:s0
-/data/misc/radio(/.*)?	u:object_r:radio_data_file:s0
-/data/misc/tima(/.*)?		u:object_r:tima_log:s0
-/data/misc/tima_keystore(/.*)?		u:object_r:tima_keystore_file:s0
-/data/misc/tz_esecomm(/.*)?		u:object_r:tima_keystore_file:s0
-/data/misc/vpnclientd(/.*)?     u:object_r:vpnclientd_data_file:s0
-/data/otp(/.*)?     u:object_r:otp_data_file:s0
-/data/one-seg(/.*)? u:object_r:oneseg_data_file:s0
-# For DCM
-/data/misc/tz_dcm(/.*)?		u:object_r:dcm_data_file:s0
-
-# personalpage path is not used  by (hyojin45.son)
-# /data/personalpage(/.*)?	u:object_r:personal_page_file:s0
-# new path for personalpage is privatemode.K is first model for personalpage.
-/data/privatemode(/.*)?	u:object_r:personal_page_file:s0
-/data/sc(/.*)?		u:object_r:smartcard_data_file:s0
-/data/snd(/.*)?		                              u:object_r:audio_data_file:s0
-/data/ss_kbservice_daemon               u:object_r:ss_kbservice_daemon_socket:s0
-/data/system/gps(/.*)?		                      u:object_r:gps_data_file:s0
-/data/system/hdcp2_1013(/.*)?                     u:object_r:mediaserver_data_file:s0
-/data/system/kb\.bin                                  u:object_r:drm_data_file:s0
-/data/system/secure_storage(/.*)?               u:object_r:secure_storage_data_file:s0
-/data/system/users(/.*)?                u:object_r:users_system_data_file:s0
-# Fingerprint data
-/data/system/users/[0-9]*/fpdata(/.*)?                u:object_r:fingerprintd_data_file:s0
-/data/system/users(/.*)/wallpaper	u:object_r:wallpaper_file:s0
-/data/system/users(/.*)/wallpaper2	u:object_r:wallpaper_file:s0
-/data/validity(/.*)?                                  u:object_r:vcsFPService_data_file:s0
-/data/tee(/.*)?	                        u:object_r:tee_data_file:s0
-
-# DATA file of slsi_common
-/data/local/log(/._*0-9)?       u:object_r:cbd_log_data:s0
-/data/local/slog(/._*0-9)?      u:object_r:dmd_log_data:s0
-/data/data/com\.android\.providers\.telephony/opname\.db        u:object_r:ril_db_file:s0
-#SEContainer clipboard
-/data/clipboard/secontainer/102(/.*)?   u:object_r:good_app_data_file:s0
-
-# request from CP system(leo.nam)
-/data/\.attipv6(/.*)?                                 u:object_r:rild_data_file:s0
-/data/\.data_usage_rx(/.*)?                                 u:object_r:rild_data_file:s0
-/data/\.data_usage_tx(/.*)?                                 u:object_r:rild_data_file:s0
-/data/\.dcmdrm(/.*)?                                  u:object_r:drm_playready_file:s0
-/data/\.fido(/.*)?                                    u:object_r:fido_data_file:s0
-/data/\.sktdrm(/.*)?                                  u:object_r:drm_playready_file:s0
-/data/\.wifiver\.info                                 u:object_r:wifiver_data_file:s0
-/data/\.otp\.info                                 u:object_r:wifiver_data_file:s0
-
-/data/EP_save\.bak                                 u:object_r:mediaserver_data_file:s0
-
-
-############################# 
-# DATA file of knox_common
-#
-/data/\.container_[1-9](/.*)?	u:object_r:container_app_data_backend:s0
-/data/clipboard/knox(/.*)?  u:object_r:knox_clipboard_file:s0
-/data/clipboard1[0-9][0-9](/.*)?  u:object_r:knox_clipboard_file:s0
-/data/container(/.*)?	u:object_r:container_app_data_backend:s0
-/data/container2\.0(/.*)?                              u:object_r:bbccontainer_app_data_backend:s0
-/data/knox_otp(/.*)?     u:object_r:otp_data_file:s0
-/data/knox(/.*)?	u:object_r:container_app_data_backend:s0
-/data/knox/data/19[5-9](/.*)?	        u:object_r:bbccontainer_app_data_backend:s0
-/data/knox/sdcard/19[5-9](/.*)?	        u:object_r:bbccontainer_app_data_backend:s0
-/data/knox/secure_fs/enc_media(/.*)?	        u:object_r:media_rw_data_file:s0
-#/data/knox/secure_fs/enc_user(/.*)?	        u:object_r:media_rw_data_file:s0
-
-/data/security/aasa(/.*)?               u:object_r:security_spota_file:s0
-/data/security/spota(/.*)?              u:object_r:security_spota_file:s0
-/data/system/container(/.*)?	u:object_r:container_system_file:s0
-
-# KNOX package root
-/data/user/1[0-8][0-9](/.*)?        u:object_r:container_app_data_backend:s0
-/data/user/19[0-4](/.*)?            u:object_r:container_app_data_backend:s0
-/data/user/19[5-9](/.*)?            u:object_r:bbccontainer_app_data_backend:s0
-
-# /mnt/runtime/
-/mnt/runtime/(default|read|write)/emulated/[0-9](/.*)?          u:object_r:media_rw_data_file:s0
-
-# /storage/emulated/
-/storage/emulated/[0-9](/.*)?             u:object_r:media_rw_data_file:s0
-
-/storage/(emulated|knox-emulated)/1[0-8][0-9](/.*)?               u:object_r:container_app_data_backend:s0
-/storage/(emulated|knox-emulated)/19[0-4](/.*)?                   u:object_r:container_app_data_backend:s0
-/storage/(emulated|knox-emulated)/19[5-9](/.*)?                   u:object_r:bbccontainer_app_data_backend:s0
-
-# /mnt/knox/
-/mnt/knox/(default|read|write)/(emulated|knox-emulated)/1[0-8][0-9](/.*)?            u:object_r:container_app_data_backend:s0
-/mnt/knox/(default|read|write)/(emulated|knox-emulated)/19[0-4](/.*)?                u:object_r:container_app_data_backend:s0
-/mnt/knox/(default|read|write)/(emulated|knox-emulated)/19[5-9](/.*)?                u:object_r:bbccontainer_app_data_backend:s0
-
-/mnt/shell/emulated/([1-9])?[0-9](/.*)?                    u:object_r:media_rw_data_file:s0
-/mnt/shell/emulated/1[0-8][0-9](/.*)?                      u:object_r:container_app_data_backend:s0
-/mnt/shell/emulated/19[0-4](/.*)?                          u:object_r:container_app_data_backend:s0
-/mnt/shell/emulated/19[5-9](/.*)?                          u:object_r:bbccontainer_app_data_backend:s0
-/mnt/shell/enc_emulated/[0-9](/.*)?                        u:object_r:media_rw_data_file:s0
-/mnt/shell/enc_media/[0-9](/.*)?                           u:object_r:media_rw_data_file:s0
-/mnt/shell/knox-emulated/1[0-8][0-9](/.*)?                 u:object_r:container_app_data_backend:s0
-/mnt/shell/knox-emulated/19[0-4](/.*)?                     u:object_r:container_app_data_backend:s0
-/mnt/shell/knox-emulated/19[5-9](/.*)?                     u:object_r:bbccontainer_app_data_backend:s0
-#/mnt/user/1[0-8][0-9](/.*)?           u:object_r:container_app_data_backend:s0
-#/mnt/user/19[0-4](/.*)?               u:object_r:container_app_data_backend:s0
-#/mnt/user/19[5-9](/.*)?               u:object_r:bbccontainer_app_data_backend:s0
-
-# AfW
-/data/media/[1-9][0-9](/.*)?                                         u:object_r:container_app_data_backend:s0
-/mnt/runtime/(default|read|write)/emulated/[1-9][0-9](/.*)?          u:object_r:container_app_data_backend:s0
-/mnt/shell/enc_emulated/[1-9][0-9](/.*)?                             u:object_r:container_app_data_backend:s0
-/mnt/shell/enc_media/[1-9][0-9](/.*)?                                u:object_r:container_app_data_backend:s0
-/storage/emulated/[1-9][0-9](/.*)?                                   u:object_r:container_app_data_backend:s0
-
-############################# 
-# DATA file of qcom_common
-#
-/data/misc/gpsone_d(/.*)?	u:object_r:gps_data_file:s0
-/data/misc/sshdcpapp(/.*)?                            u:object_r:data_qsee_file:s0
-# conflict with Qcom BSP, /data/misc/location(/.*)?	u:object_r:gps_data_file:s0
-/data/time(/.*)?	u:object_r:time_data_file:s0
-
-############################# 
-# EFS file of sec_common
-#
-/cpefs(/.*)?                                     u:object_r:sec_efs_file:s0
-# Add labelling code for /efs/apn-changes.xml it using only for M upgrade model & first released version is Kitkat. ( From L OS using /efs/sec_efs/apn-changes.xml)
-/efs/apn-changes\.xml                            u:object_r:sec_efs_file:s0
-/efs/bluetooth(/.*)?	u:object_r:bluetooth_efs_file:s0
-/efs/carrier(/.*)?	u:object_r:carrier_efs_file:s0
-/efs/cirrus(/.*)?                                u:object_r:sec_efs_file:s0
-/efs/cpk(/.*)?	                                 u:object_r:cpk_efs_file:s0
-/efs/drx(/.*)?                                   u:object_r:sec_efs_file:s0
-/efs/FactoryApp(/.*)?	u:object_r:app_efs_file:s0
-/efs/imei(/.*)?	u:object_r:imei_efs_file:s0
-/efs/ims_setting(/.*)?                           u:object_r:sec_efs_file:s0
-/efs/iss(/.*)?	                                 u:object_r:iss_efs_file:s0
-/efs/logguard(/.*)?	                         u:object_r:iss_efs_file:s0
-/efs/maxim(/.*)?	                         u:object_r:sec_efs_file:s0
-/efs/mc(/.*)?	                                 u:object_r:prov_efs_file:s0
-/efs/\.nv_core\.bak(.*)                            u:object_r:nv_core_efs_file:s0
-/efs/otadm(/.*)?	                         u:object_r:otadm_efs_file:s0
-/efs/otadm_sw_version                            u:object_r:otadm_efs_file:s0
-/efs/pfw_data(/.*)?	                         u:object_r:pfw_efs_file:s0
-/efs/prov(/.*)?	                                 u:object_r:prov_efs_file:s0
-/efs/prov_data(/.*)?	                         u:object_r:prov_efs_file:s0
-/efs/recovery(/.*)?	                         u:object_r:sec_efs_file:s0
-/efs/root(/.*)?	                                 u:object_r:app_efs_file:s0
-/efs/sec_efs(/.*)?                               u:object_r:sec_efs_file:s0
-/efs/sec_efs/retailmode(/.*)?                    u:object_r:retailmode_efs_file:s0
-/efs/security(/.*)?                              u:object_r:prov_efs_file:s0
-/efs/sktdm_mem(/.*)?                             u:object_r:sec_efs_file:s0
-/efs/SMS(/.*)?                                   u:object_r:sec_efs_file:s0
-/efs/SlideCount                                  u:object_r:app_efs_file:s0
-/efs/TEE(/.*)?                                   u:object_r:prov_efs_file:s0
-/efs/vk(/.*)?                                   u:object_r:vaultkeeper_efs_file:s0
-/efs/wifi(/.*)?	u:object_r:wifi_efs_file:s0
-/efs_gsm(/.*)?            u:object_r:efs_gsm_file:s0
-
-/efs/calibration_data                            u:object_r:sec_efs_file:s0
-/efs/grip_cal_data                               u:object_r:sec_efs_file:s0
-/efs/gyro_cal_data	                         u:object_r:sec_efs_file:s0
-/efs/hw_offset                                   u:object_r:sec_efs_file:s0
-/efs/osc_trim                                    u:object_r:sec_efs_file:s0
-/efs/prox_cal                                    u:object_r:sec_efs_file:s0
-
-############################# 
-# EFS file of qcom_common
-#
-/efs/drm(/.*)?	u:object_r:drm_efs_file:s0
-/efs/\.drm(/.*)?         u:object_r:drm_efs_file:s0
-
-############################# 
-# EFS file of slsi_common
-#
-/efs/nv_data\.bin(.*)	u:object_r:bin_nv_data_efs_file:s0
-/efs/nv_fsm_data\.bin           u:object_r:bin_nv_data_efs_file:s0
-/efs/nv\.log                     u:object_r:cbd_log_data:s0
-
-############################# 
-# MISC partition file of sec_common
-#
-/custom(/.*)?   u:object_r:sbfs_file:s0
-/fw(/.*)?       u:object_r:device_firmware_file:s0
-#/hidden(/.*)?	u:object_r:hidden_file:s0
-#/persdata(/.*)?	u:object_r:persdata_data_file:s0
-/persdata/absolute(/.*)? 	u:object_r:abt_pers_data_file:s0
-# conflict with Qcom BSP, /persist(/.*)?   u:object_r:persist_data_file:s0
-#/preload(/.*)? u:object_r:hidden_file:s0
-/sbfs(/.*)?   u:object_r:sbfs_file:s0
-#/tombstone(/.*)?   u:object_r:tombstone_data_file:s0
-#/tombstones(/.*)?   u:object_r:tombstone_data_file:s0
-
-#############################
-# MNT of sec_common
-#
-/mnt/obb(/.*)?	u:object_r:obb_apk_file:s0
-/mnt/secure/asec(/.*)?	u:object_r:asec_apk_file:s0
-/mnt/secure/staging(/.*)?	u:object_r:asec_image_file:s0
-
-############################# 
-# MNT of bcom_common
-#
-/mnt/modemfsro(/.*)?	u:object_r:modem_firmware:s0
-/mnt/modemfsro_fix(/.*)?	u:object_r:modem_firmware:s0
-/mnt/modemfsrw(/.*)?	u:object_r:modem_firmware:s0
-/mnt/modemfw(/.*)?	u:object_r:modem_firmware:s0
-/mnt/modemlog(/.*)?	u:object_r:modem_firmware:s0
-/mnt/securityro(/.*)?	u:object_r:security_firmware:s0
-/mnt/securityrw(/.*)?	u:object_r:security_firmware:s0
-
-############################# 
-# Carrier file of sec_common
-# carrier folder for Sprint(Qualcomm and SLSI)
-/carrier(/.*)?	u:object_r:carrier_file:s0
-
-# OMC_v3(Open Mobile Customization)
-/omr(/.*)?	u:object_r:omr_file:s0
-
-#############################
-# PROC INFO / LOCK FILE
-# for preventing migration issue, this files were created by type_transition rules.
-#
-/data/local/olsrd\.lock                              u:object_r:proc_info_file:s0
-/data/ss_conn_daemon\.pid                              u:object_r:proc_info_file:s0
-/data/\.cid\.info                                      u:object_r:proc_info_file:s0
-#line 1 "vendor/samsung/common/sepolicy/carrier/carrier_spr/file_contexts"
-#### Kineto for secsprextension/java/com/oem/smartwifisupport
-/dev/socket/cfiat  u:object_r:cfiat_socket:s0
-/dev/socket/kipc   u:object_r:kipc_socket:s0
-
-############################# 
-# ItsOn file
-#
-#/system/vendor/itson(/.*)?  u:object_r:sprintitson_file:s0
-#/vendor/app(/.*)?  u:object_r:sprintitson_file:s0
-/carrier/itson(/.*)?  u:object_r:sprintitson_file:s0
-/dev/socket/itson(/.*)?                    u:object_r:itson_socket:s0
-/data/itson(/.*)?     u:object_r:sprintitson_file:s0
-/system/vendor/itson/itson-bootstrapper\.sh	u:object_r:itsonbs_exec:s0
-
-#line 1 "vendor/samsung/common/sepolicy/carrier/carrier_tfntmo/file_contexts"
-
-/system/bin/tsdaemon            u:object_r:tsdaemon_exec:s0
-
-#line 1 "vendor/samsung/common/sepolicy/carrier/carrier_kor/file_contexts"
-/system/bin/dmbserver   u:object_r:dmb_exec:s0
-/dev/tdmb               u:object_r:tdmb_device:s0
-/data/\.dmbca(/.*)?   u:object_r:dmb_data_file:s0
-/data/playready(/.*)?   u:object_r:playready_file:s0
-
-
-############ LGT #############
-/data/LGTContents(/.*)?  u:object_r:lgt_contents_file:s0
-/system/bin/diag_knight	u:object_r:ss_diagknight_daemon_exec:s0
-/system/bin/mwlan_helper u:object_r:mwlan_helper_exec:s0
-/dev/mwlan_aarp u:object_r:mwlan_aarp_device:s0
-/dev/ipsecdrvtl u:object_r:mwlan_ipsecdrvtl_device:s0
-
-############ SKT #############
-/system/bin/iwland      u:object_r:iwland_exec:s0
-/dev/iwland(/.*)?       u:object_r:skt_socket:s0
-/system/bin/tbased      u:object_r:tbased_exec:s0
-
-#line 1 "vendor/samsung/common/sepolicy/carrier/carrier_jpn/file_contexts"
-#felica start
-# JPN Felica Temporary Workaround
-/dev/ttyHSL2				u:object_r:nfcfelica_device:s0
-#/dev/ttyHSL1				u:object_r:nfcfelica_device:s0
-/dev/snfc_uart				u:object_r:nfc_device:s0
-/dev/snfc_pon				u:object_r:nfc_device:s0
-/dev/snfc_hsel				u:object_r:nfc_device:s0
-/dev/snfc_intu_poll			u:object_r:nfc_device:s0
-/dev/snfc_available_poll	u:object_r:nfc_device:s0
-/dev/snfc_rfs				u:object_r:nfc_device:s0
-/dev/snfc_rfs_poll			u:object_r:nfc_device:s0
-/dev/uartcc					u:object_r:nfc_device:s0
-/dev/felica_cen				u:object_r:nfcfelica_device:s0
-/dev/snfc_cen				u:object_r:nfcfelica_device:s0
-
-/dev/felica					u:object_r:felica_device:s0
-/dev/felica_pon				u:object_r:felica_device:s0
-/dev/felica_rfs				u:object_r:felica_device:s0
-/dev/felica_rws				u:object_r:felica_device:s0
-/dev/felica_ant				u:object_r:felica_device:s0
-/dev/felica_int_poll		u:object_r:felicashell_device:s0
-/dev/felica_uid				u:object_r:felica_device:s0
-/dev/felica_uicc			u:object_r:felica_device:s0
-#felica end
-
-#felica start
-/system/bin/fsslcmnd		u:object_r:fsslcmnd_exec:s0
-/system/bin/mfdp			u:object_r:mfdp_exec:s0
-/system/bin/mfsc			u:object_r:mfsc_exec:s0
-#felica end
-
-#secprov_nexti
-/system/bin/secprov_nexti		u:object_r:secprov_nexti_exec:s0
-/data/dxprdy(/.*)?                      u:object_r:drm_playready_file:s0
-
-#TMM
-/system/bin/MmbCaCasDrmMw	u:object_r:mmb_mw_exec:s0
-/system/bin/MmbFcCtlMw	u:object_r:mmb_mw_exec:s0
-/system/bin/MmbStCtlMwService	u:object_r:mmb_mw_exec:s0
-/system/bin/MmbFcMp4MwServer	u:object_r:mmb_mw_exec:s0
-/system/bin/MmbFcLiceMwServer	u:object_r:mmb_mw_exec:s0
-/system/bin/MmbStRecCmMwService	u:object_r:mmb_mw_exec:s0
-
-/data/mmb(/.*)?		u:object_r:mmb_data_file:s0
-
-# for fullseg
-/system/bin/dtvserver	u:object_r:dtvserver_exec:s0
-
-# for oneseg and mmcblk0p16
-/system/bin/nexprocess            u:object_r:oneseg_mw_exec:s0
-/system/bin/broadcastProcessObserver            u:object_r:oneseg_mw_exec:s0
-/system/bin/BMLEngineServer            u:object_r:oneseg_mw_exec:s0
-/system/bin/OneSegDsmcc            u:object_r:oneseg_mw_exec:s0
-/system/bin/OneSegTsDemux            u:object_r:oneseg_mw_exec:s0
-/system/bin/SDtvService            u:object_r:oneseg_mw_exec:s0

BIN
recovery/root/sbin/keystore


BIN
recovery/root/sbin/libbinder.so


BIN
recovery/root/sbin/libcc_manager.so


BIN
recovery/root/sbin/libkeymaster1.so


BIN
recovery/root/sbin/libkeymaster_helper.so


BIN
recovery/root/sbin/libkeymaster_mdfpp.so


BIN
recovery/root/sbin/libkeymaster_messages.so


BIN
recovery/root/sbin/libkeystore_binder.so


BIN
recovery/root/sbin/libsec_km.so


BIN
recovery/root/sbin/libskmm.so


BIN
recovery/root/sbin/libsoftkeymasterdevice.so


+ 108 - 88
recovery/root/ueventd.samsungexynos8890.rc

@@ -50,9 +50,9 @@
 
 # mscalers
 /dev/video50              0660   media      graphics
-/dev/video51              0660   media      graphics
-/dev/m2m1shot_scaler0     0660   media      graphics
-/dev/m2m1shot_scaler1     0660   media      graphics
+/dev/video51              0660   cameraserver     cameraserver
+/dev/m2m1shot_scaler0     0660   mediacodec      graphics
+/dev/m2m1shot_scaler1     0660   cameraserver     cameraserver
 
 /dev/video55              0666   system     graphics
 /dev/fimg2d               0666   system     graphics
@@ -60,69 +60,76 @@
 /dev/HPD                  0660   system     system
 
 # mfc
-/dev/video6               0660   media      media
-/dev/video7               0660   media      media
-/dev/video8               0660   media      media
-/dev/video9               0660   media      media
+/dev/video6               0660   mediacodec      mediadrm
+/dev/video7               0660   media      mediadrm
+/dev/video8               0660   media      mediadrm
+/dev/video9               0660   media      mediadrm
 
 # camera
-/dev/video101             0660   media      media
-/dev/video102             0660   media      media
-/dev/video103             0660   media      media
-/dev/video104             0660   media      media
-/dev/video105             0660   media      media
-/dev/video106             0660   media      media
-/dev/video109             0660   media      media
-/dev/video110             0660   media      media
-/dev/video111             0660   media      media
-/dev/video112             0660   media      media
-/dev/video120             0660   media      media
-/dev/video121             0660   media      media
-/dev/video122             0660   media      media
-/dev/video130             0660   media      media
-/dev/video131             0660   media      media
-/dev/video132             0660   media      media
-/dev/video140             0660   media      media
-/dev/video141             0660   media      media
-/dev/video142             0660   media      media
-/dev/video150             0660   media      media
-/dev/video151             0660   media      media
-/dev/video152             0660   media      media
-/dev/video160             0660   media      media
-/dev/video161             0660   media      media
-/dev/video170             0660   media      media
-/dev/video171             0660   media      media
-/dev/video172             0660   media      media
-/dev/video173             0660   media      media
-/dev/video174             0660   media      media
-/dev/video180             0660   media      media
-/dev/video210             0660   media      media
-/dev/video211             0660   media      media
-/dev/video212             0660   media      media
-/dev/video213             0660   media      media
-/dev/video214             0660   media      media
-/dev/video215             0660   media      media
-/dev/video216             0660   media      media
-/dev/video217             0660   media      media
-/dev/video218             0660   media      media
-/dev/video219             0660   media      media
-/dev/video220             0660   media      media
-/dev/video221             0660   media      media
-/dev/video222             0660   media      media
-/dev/video223             0660   media      media
-/dev/video224             0660   media      media
-/dev/video225             0660   media      media
-/dev/video227             0660   media      media
-/dev/video231             0660   media      media
-/dev/media2               0660   media      media
+/dev/video101             0660   media      camera
+/dev/video102             0660   media      camera
+/dev/video103             0660   media      camera
+/dev/video104             0660   media      camera
+/dev/video105             0660   media      camera
+/dev/video106             0660   media      camera
+/dev/video109             0660   media      camera
+/dev/video110             0660   media      camera
+/dev/video111             0660   media      camera
+/dev/video112             0660   media      camera
+/dev/video120             0660   media      camera
+/dev/video121             0660   media      camera
+/dev/video122             0660   media      camera
+/dev/video130             0660   media      camera
+/dev/video131             0660   media      camera
+/dev/video132             0660   media      camera
+/dev/video140             0660   media      camera
+/dev/video141             0660   media      camera
+/dev/video142             0660   media      camera
+/dev/video150             0660   media      camera
+/dev/video151             0660   media      camera
+/dev/video152             0660   media      camera
+/dev/video160             0660   media      camera
+/dev/video161             0660   media      camera
+/dev/video170             0660   media      camera
+/dev/video171             0660   media      camera
+/dev/video172             0660   media      camera
+/dev/video173             0660   media      camera
+/dev/video174             0660   media      camera
+/dev/video180             0660   media      camera
+/dev/video210             0660   media      camera
+/dev/video211             0660   media      camera
+/dev/video212             0660   media      camera
+/dev/video213             0660   media      camera
+/dev/video214             0660   media      camera
+/dev/video215             0660   media      camera
+/dev/video216             0660   media      camera
+/dev/video217             0660   media      camera
+/dev/video218             0660   media      camera
+/dev/video219             0660   media      camera
+/dev/video220             0660   media      camera
+/dev/video221             0660   media      camera
+/dev/video222             0660   media      camera
+/dev/video223             0660   media      camera
+/dev/video224             0660   media      camera
+/dev/video225             0660   media      camera
+/dev/video227             0660   media      camera
+/dev/video231             0660   media      camera
+/dev/media2               0660   media      camera
 
 # jpeg
 /dev/m2m1shot_jpeg	  0660   media      media
-/dev/video12              0660   media      media
+/dev/video12              0660   media      camera
 
 # audio
 /dev/seiren               0660   system     audio
 
+# MobiCore
+#/dev/mobicore             0600   drmrpc     drmrpc
+#/dev/mobicore-user        0660   drm        drmrpc
+
+# Secure MEM driver
+#/dev/s5p-smem             0660   drm        drmrpc
+
 #temporary
 /data/modem.bin           0400   radio      system
 
@@ -135,17 +142,34 @@
 /dev/umts_ipc0            0660   radio      radio
 /dev/umts_ipc1            0660   radio      radio
 /dev/umts_rfs0            0660   radio      radio
-/dev/block/platform/155a0000.ufs/by-name/CP_DEBUG	0660	radio	system
 
 # Modem Interface
 /dev/block/platform/155a0000.ufs/by-name/RADIO	0660   system     radio
+/dev/block/platform/155a0000.ufs/by-name/CP_DEBUG	0660	radio	system
 /dev/umts*                0660   system     radio
 /dev/umts_csd             0660   system     loop_radio
 /dev/smd4                 0660   system     radio
 
+# interactive governor parameters
+/sys/devices/system/cpu/cpu*	cpufreq/interactive/timer_rate			0660	system	system
+/sys/devices/system/cpu/cpu*	cpufreq/interactive/timer_slack			0660	system	system
+/sys/devices/system/cpu/cpu*	cpufreq/interactive/min_sample_time		0660	system	system
+/sys/devices/system/cpu/cpu*	cpufreq/interactive/hispeed_freq		0660	system	system
+/sys/devices/system/cpu/cpu*	cpufreq/interactive/target_loads		0660	system	system
+/sys/devices/system/cpu/cpu*	cpufreq/interactive/go_hispeed_load		0660	system	system
+/sys/devices/system/cpu/cpu*	cpufreq/interactive/above_hispeed_delay		0660	system	system
+/sys/devices/system/cpu/cpu*	cpufreq/interactive/boost			0660	system	system
+/sys/devices/system/cpu/cpu*	cpufreq/interactive/boostpulse			0200	system	system
+/sys/devices/system/cpu/cpu*	cpufreq/interactive/input_boost			0660	system	system
+/sys/devices/system/cpu/cpu*	cpufreq/interactive/boostpulse_duration		0660	system	system
+/sys/devices/system/cpu/cpu*	cpufreq/interactive/io_is_busy			0660	system	system
+/sys/devices/system/cpu/cpu*	cpufreq/interactive/param_index			0660	system	system
+/sys/devices/system/cpu/cpu*	cpufreq/interactive/mode				0660	system	system
+
 # sensor sysfs properties
 /sys/devices/virtual/input/input*	poll_delay	0660	system	radio
 /sys/devices/virtual/input/input*	enable		0660	system	radio
+/dev/input/event*	  0660   system		input
 
 # Sensorhub IIO
 /dev/ssp_sensorhub        0660   system		system
@@ -154,6 +178,7 @@
 /sys/devices/14d30000.spi/spi_master/spi1/spi1.0/iio:device*    buffer/enable       0660    system    system
 /sys/devices/14d30000.spi/spi_master/spi1/spi1.0/iio:device*    buffer/length       0660    system    system
 /sys/bus/iio/devices/iio:device*    0664   system     radio
+/sys/bus/iio/devices/iio:device*	poll_delay	0660	system	system
 
 # Broadcom Sensorhub Bridge Driver
 /dev/bbd_sensor           0660   system     system
@@ -170,37 +195,32 @@
 # Reactivation lock
 /dev/block/platform/155a0000.ufs/by-name/STEADY    0660    system    system
 
+# CDMA radio interface MUX
+/dev/ts0710mux*           0640   radio      radio
+/dev/ppp                  0660   radio      vpn
+
+# sysfs properties
+/sys/devices/platform/trusty.*      trusty_version        0440  root   log
+/sys/devices/virtual/input/input*   enable      0660  root   input
+/sys/devices/virtual/input/input*   poll_delay  0660  root   input
+/sys/devices/virtual/usb_composite/*   enable      0664  root   system
+/sys/devices/system/cpu/cpu*   cpufreq/scaling_max_freq   0664  system system
+/sys/devices/system/cpu/cpu*   cpufreq/scaling_min_freq   0664  system system
+
+# DVB API device nodes
+/dev/dvb*                 0660   root       system
+
 # MobiCore
 /dev/mobicore             0700   system     system
-/dev/mobicore-user        0666   radio     	system
+/dev/mobicore-user        0666   radio     system
 
-# RTC Dev
-/dev/rtc0                 0660   system     system
+# Secure MEM driver
+/dev/s5p-smem             0660   system     system
 
-# interactive governor parameters
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/timer_rate			0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/timer_slack			0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/min_sample_time		0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/hispeed_freq		0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/target_loads		0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/go_hispeed_load		0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/above_hispeed_delay		0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/boost			0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/boostpulse			0200	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/input_boost			0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/boostpulse_duration		0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/io_is_busy			0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/cpu_util			0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/enforced_mode		0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/mode				0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/multi_cluster0_min_freq		0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/multi_enter_load	0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/multi_enter_time	0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/multi_exit_load		0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/multi_exit_time		0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/param_index			0200	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/single_cluster0_min_freq	0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/single_enter_load	0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/single_enter_time	0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/single_exit_load	0660	system	system
-/sys/devices/system/cpu/cpu*	cpufreq/interactive/single_exit_time	0660	system	system
+# sensorhub
+/dev/ssp_sensorhub        0660   system     system
+/dev/ssp_data_injection   0660   system     system
+
+# Fingerprint Sensor
+/dev/vfsspi        0660   system     system
+/dev/esfp0        0660   system     system

BIN
recovery/root/vendor/lib64/hw/keystore.exynos8890.so


BIN
recovery/root/vendor/lib64/hw/keystore.mdfpp.so


+ 0 - 14
system.prop

@@ -1,18 +1,4 @@
 # Universal8890
-ro.hardware=samsungexynos8890
 ro.chipname=exynos8890
 ro.arch=exynos8890
-ro.boot.bootdevice=155a0000.ufs
-ro.lcd_min_brightness=0
-ro.lcd_brightness=162
-ro.sf.lcd_density=560
 persist.sys.usb.config=mtp,adb
-
-# Encryption
-ro.sec.fle.encryption=true
-security.mdpp=None
-security.mdpp.mass=skmm
-security.mdpp.result=None
-ro.security.mdpp.ver=2.0
-ro.security.mdpp.release=8
-ro.hardware.keystore=mdfpp