From 415f0ba73c645c9b53ba701931d9ba041b967f75 Mon Sep 17 00:00:00 2001
From: Nick Kralevich <nnk@google.com>
Date: Wed, 6 May 2015 16:33:56 -0700
Subject: [PATCH] Label /oem files

Files on the /oem partition are weird. The /oem partition is an ext4
partition, built in the Android tree using the "oem_image" build target
added in build/ commit b8888432f0bc0706d5e00e971dde3ac2e986f2af. Since
it's an ext4 image, it requires SELinux labels to be defined at build
time. However, the partition is mounted using context=u:object_r:oemfs:s0,
which ignores the labels on the filesystem.

Assign all the files on the /oem image to be oemfs, which is consistent
with how they'll be mounted when /oem is mounted.

Other options would be to use an "unlabeled" label, or try to fix the
build system to not require SELinux labels for /oem images.

(cherrypicked from commit 2025fd1476879c0e0f13f88bb91e93c32766f7c2)

Bug: 20816563
Change-Id: Ibe8d9ff626eace8a2d5d02c3f06290105baa59fe
---
 file_contexts | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/file_contexts b/file_contexts
index 9575fb0ed..1c6b56cf2 100644
--- a/file_contexts
+++ b/file_contexts
@@ -187,9 +187,11 @@
 /vendor/bin/gpsd	u:object_r:gpsd_exec:s0
 
 #############################
-# ODM files
+# OEM and ODM files
 #
-/odm(/.*)?		u:object_r:system_file:s0
+/odm(/.*)?              u:object_r:system_file:s0
+/oem(/.*)?              u:object_r:oemfs:s0
+
 
 #############################
 # Data files
-- 
GitLab