이 페이지에서는 Android 8.0 이상을 지원하는 기기의 디렉터리 레이아웃, VNDK 규칙 및 관련 sepolicy를 설명합니다.
디렉터리 레이아웃
퇴행된 디렉터리 레이아웃은 다음과 같은 디렉터리로 구성됩니다.
/system/lib[64]에는 LL-NDK, VNDK 및 프레임워크 전용 라이브러리(LL-NDK-Private 및 VNDK-SP의 라이브러리와 이름이 같은 일부 라이브러리 포함)를 비롯한 모든 프레임워크 공유 라이브러리가 포함됩니다.
/system/lib[64]/vndk-sp에는 동일 프로세스 HAL의 VNDK-SP 라이브러리가 포함됩니다.
/vendor/lib[64]에는 공급업체에서 확장한 VNDK 라이브러리(DXUA 또는 DXUX VNDK 라이브러리), 동일 프로세스 HAL 구현 및 기타 공급업체 공유 라이브러리가 포함됩니다.
/vendor/lib[64]/vndk-sp에는 공급업체에서 확장한 VNDK-SP 라이브러리가 포함될 수 있습니다.
공급업체 모듈은 /system/lib[64]에서 VNDK 라이브러리를 로드합니다.
VNDK 규칙
이 섹션에는 VNDK 규칙이 포괄적으로 나열되어 있습니다.
프레임워크 프로세스는 공급업체 파티션에서 비 SP-HAL 공유 라이브러리를 로드하면 안 됩니다(Android 8.1부터 엄격하게 적용됨).
공급업체 프로세스는 시스템 파티션에서 비 LL-NDK, 비 VNDK-SP 및 비 VNDK 라이브러리를 로드하면 안 됩니다(Android O에서는 엄격하게 적용되지 않지만 향후 버전에서는 엄격하게 적용될 예정).
설치된 VNDK 라이브러리는 Google에서 정의한 사용 가능한 VNDK 라이브러리의 하위 집합이어야 합니다.
SP-HAL 및 SP-HAL-Dep의 외부 종속 항목은 LL-NDK 또는 Google에서 정의한 VNDK-SP 라이브러리로 제한되어야 합니다.
SP-HAL 공유 라이브러리의 종속 항목은 LL-NDK 라이브러리, Google에서 정의한 VNDK-SP 라이브러리, 기타 SP-HAL 라이브러리 또는 SP-HAL-Dep 라이브러리로 라벨이 지정될 수 있는 다른 공급업체 공유 라이브러리로 제한되어야 합니다.
공급업체 공유 라이브러리는 AOSP 라이브러리가 아니고 종속 항목이 LL-NDK 라이브러리, Google에서 정의한 VNDK-SP 라이브러리, SP-HAL 라이브러리 또는 기타 SP-HAL-Dep 라이브러리로 제한되는 경우에만 SP-HAL-Dep 라이브러리로 라벨이 지정될 수 있습니다.
프레임워크-공급업체 통신이 비 HIDL 인터페이스를 통해 이루어지지 않습니다. 여기에는 바인더, 소켓, 공유 메모리, 파일 등이 포함되며 이에 국한되지 않습니다.
시스템 파티션의 크기는 모든 사용 가능한 VNDK 라이브러리의 사본 두 개와 사용할 수 없는 프레임워크 공유 라이브러리의 사본 하나를 포함할 수 있을 정도로 커야 합니다.
sepolicy
이 섹션에서 설명한 프레임워크 프로세스는 sepolicy의 coredomain에 상응하는 반면 공급업체 프로세스는 non-coredomain에 상응합니다. 예를 들어 /dev/binder는 coredomain에서만 액세스할 수 있고 /dev/vndbinder는 비 coredomain에서만 액세스할 수 있습니다.
유사한 정책이 시스템 및 공급업체 파티션의 공유 라이브러리에 액세스를 제한합니다. 다음 표는 여러 카테고리의 공유 라이브러리 액세스 권한을 보여줍니다.
카테고리
파티션
coredomain에서 액세스 가능
비 coredomain에서 액세스 가능
LL-NDK
시스템
예
예
LL-NDK-Private
시스템
예
예
VNDK-SP/VNDK-SP-Private
시스템
예
예
VNDK-SP-Ext
공급업체
예
예
VNDK
시스템
예
예
VNDK-Ext
공급업체
아니요
예
FWK-ONLY
시스템
예
아니요
FWK-ONLY-RS
시스템
예
아니요
SP-HAL
공급업체
예
예
SP-HAL-Dep
공급업체
예
예
VND-ONLY
공급업체
아니요
예
LL-NDK-Private 및 VNDK-SP-Private은 두 도메인에서 모두 액세스 가능해야 합니다. 비 coredomain에서 간접적으로 액세스하기 때문입니다. 마찬가지로 SP-HAL-Dep는 SP-HAL이 의존하므로 coredomain에서 액세스 가능해야 합니다.
same_process_hal_file 라벨
다음 라이브러리는 공급업체 파티션에 존재합니다. 이러한 라이브러리를 coredomain 및 비 coredomain에서 모두 액세스 가능하게 합니다.
/vendor/lib[64]/vndk-sp의 VNDK-SP-Ext
/vendor/lib[64] 또는 /vendor/lib[64]/hw의 SP-HAL
/vendor/lib[64] 또는 /vendor/lib[64]/hw의 SP-HAL-Dep
명시적으로 이러한 파일의 라벨을 same_process_hal_file로 지정합니다. vendor 파티션의 모든 항목이 기본적으로 coredomain에 액세스할 수 없기 때문입니다. 다음과 유사한 행을 공급업체 관련 file_contexts 파일에 추가하세요.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-27(UTC)"],[],[],null,["# Directories, rules, and sepolicy\n\nThis page describes the directory layout for devices running Android 8.0 and\nhigher, VNDK rules, and associated sepolicy.\n\nDirectory layout\n----------------\n\nThe *Degenerated Directory Layout* consists of the following\ndirectories:\n\n- `/system/lib[64]` contains all framework shared libraries, including LL-NDK, VNDK, and framework-only libraries (including LL-NDK-Private and some libraries with the same names as the ones in VNDK-SP).\n- `/system/lib[64]/vndk-sp` contains VNDK-SP libraries for same-process HALs.\n- `/vendor/lib[64]` contains the VNDK libraries extended by the vendor (either DXUA or DXUX VNDK libraries), same-process HAL implementations, and other vendor shared libraries.\n- `/vendor/lib[64]/vndk-sp` may contain the VNDK-SP libraries extended by the vendor.\n\nVendor modules load the VNDK libraries from `/system/lib[64]`.\n\nVNDK rules\n----------\n\nThis section provides a comprehensive list of VNDK rules:\n\n- Framework processes must not load non-SP-HAL shared libraries from vendor partitions (strictly enforced starting from Android 8.1).\n- Vendor processes must not load non-LL-NDK, non-VNDK-SP, and non-VNDK libraries from the system partition. (not strictly enforced in Android O but will be in a future release).\n| **Note**: To benefit from the framework-only OTA beyond Android 8.0, this rule must not be violated in devices launched with Android 8.0.\n- Installed VNDK libraries must be a subset of Google-defined eligible VNDK libraries.\n- The outer dependencies of SP-HAL and SP-HAL-Dep must be restricted to LL-NDK or Google-defined VNDK-SP libraries.\n - The dependencies of an SP-HAL shared library must be restricted to LL-NDK libraries, Google-defined VNDK-SP libraries, other SP-HAL libraries, and/or other vendor shared libraries that can be labeled as SP-HAL-Dep libraries.\n - A vendor shared library can be labeled as a SP-HAL-Dep library only if it is not an AOSP library and its dependencies are restricted to LL-NDK libraries, Google-defined VNDK-SP libraries, SP-HAL libraries, and/or other SP-HAL-Dep libraries.\n- VNDK-SP must be self-contained. `libRS_internal.so` gets special treatment in Android 8.0, but will be revisited in a future release.\n- No framework-vendor communication through non-HIDL interfaces, including (but not limited to) binder, sockets, shared memories, files, etc.\n- The size of the system partition must be large enough to contain two copies of all eligible VNDK libraries and a copy of ineligible framework shared libraries.\n\nsepolicy\n--------\n\nFramework processes described in this section correspond to\n`coredomain` in sepolicies while vendor processes correspond to\n`non-coredomain`. For example, `/dev/binder` can be\naccessed only in `coredomain` and `/dev/vndbinder` can be\naccessed only in non-`coredomain`.\n\nSimilar policies restrict the access to the shared libraries on system and\nvendor partitions. The following table shows the rights to access shared\nlibraries of different categories:\n\n| Category | Partition | Accessible from coredomain | Accessible from non-coredomain |\n|-------------------------|-----------|----------------------------|--------------------------------|\n| LL-NDK | System | Y | Y |\n| LL-NDK-Private | System | Y | Y |\n| VNDK-SP/VNDK-SP-Private | System | Y | Y |\n| VNDK-SP-Ext | Vendor | Y | Y |\n| VNDK | System | Y | Y |\n| VNDK-Ext | Vendor | N | Y |\n| FWK-ONLY | System | Y | N |\n| FWK-ONLY-RS | System | Y | N |\n| SP-HAL | Vendor | Y | Y |\n| SP-HAL-Dep | Vendor | Y | Y |\n| VND-ONLY | Vendor | N | Y |\n\nLL-NDK-Private and VNDK-SP-Private must be\naccessible from both domains because non-`coredomain` will\nindirectly access them. Similarly, SP-HAL-Dep must be accessible from\n`coredomain` because SP-HAL relies on it.\n\nsame_process_hal_file label\n---------------------------\n\nThe following libraries exist in the vendor partition. Make these libraries accessible from both\n`coredomain` and non-`coredomain`.\n\n- VNDK-SP-Ext in `/vendor/lib[64]/vndk-sp`\n- SP-HAL in `/vendor/lib[64]` or `/vendor/lib[64]/hw`\n- SP-HAL-Dep in `/vendor/lib[64]` or `/vendor/lib[64]/hw`\n\nExplicitly label these files as `same_process_hal_file`, because anything\nin `vendor` partition is by default not accessible to `coredomain`. Add lines similar to\nthe following to the vendor-specific `file_contexts` file. \n\n```scdoc\n/vendor/lib(64)?/hw/libMySpHal\\.so u:object_r:same_process_hal_file:s0\n/vendor/lib(64)?/vndk-sp/libBase\\.so u:object_r:same_process_hal_file:s0\n/vendor/lib(64)?/libBaseInternal\\.so u:object_r:same_process_hal_file:s0\n```"]]