summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuang Luong <qal@google.com>2017-08-03 23:17:58 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-08-03 23:17:58 +0000
commit5ff90bb48866267b91321f1e3b5b205981fbf889 (patch)
tree8168eef7bc443350a2c510da94bd1cd393cbbb61
parent582b0c6c51c98a5261f9fe296238b1a1747ea590 (diff)
parent23e15d7349fea9837c116d74acdeac621d7f6deb (diff)
downloaduml-pie-dr1-release.tar.gz
am: 23e15d7349 Change-Id: Ia2cf64598f6e26b3531820709fa658fce91a4e49
-rw-r--r--BoardConfig.mk3
-rwxr-xr-xinit.eth0.sh2
-rw-r--r--init.uml.rc3
-rw-r--r--sepolicy/file_contexts1
-rw-r--r--sepolicy/init_eth0.te10
-rw-r--r--uml.mk1
6 files changed, 20 insertions, 0 deletions
diff --git a/BoardConfig.mk b/BoardConfig.mk
index b6eb431..807b290 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -20,3 +20,6 @@ TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 786432000
BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800
BOARD_FLASH_BLOCK_SIZE := 512
+
+BOARD_SEPOLICY_DIRS += \
+ device/generic/uml/sepolicy
diff --git a/init.eth0.sh b/init.eth0.sh
new file mode 100755
index 0000000..39fc008
--- /dev/null
+++ b/init.eth0.sh
@@ -0,0 +1,2 @@
+#!/system/bin/sh
+ifconfig eth0 192.168.0.253 up \ No newline at end of file
diff --git a/init.uml.rc b/init.uml.rc
index e5b5d7d..ea12191 100644
--- a/init.uml.rc
+++ b/init.uml.rc
@@ -1,2 +1,5 @@
on fs
mount_all ./fstab.uml
+
+on boot
+ exec -- /system/bin/init.eth0.sh \ No newline at end of file
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
new file mode 100644
index 0000000..3eabb35
--- /dev/null
+++ b/sepolicy/file_contexts
@@ -0,0 +1 @@
+/system/bin/init.eth0.sh u:object_r:init_eth0_exec:s0 \ No newline at end of file
diff --git a/sepolicy/init_eth0.te b/sepolicy/init_eth0.te
new file mode 100644
index 0000000..45fd56d
--- /dev/null
+++ b/sepolicy/init_eth0.te
@@ -0,0 +1,10 @@
+type init_eth0, domain;
+type init_eth0_exec, exec_type, file_type;
+
+init_daemon_domain(init_eth0)
+
+allow init_eth0 self:capability { net_admin net_raw };
+allow init_eth0 self:udp_socket { create ioctl };
+allowxperm init_eth0 self:udp_socket ioctl priv_sock_ioctls;
+allow init_eth0 shell_exec:file { execute getattr read };
+allow init_eth0 toolbox_exec:file { execute execute_no_trans getattr open read };
diff --git a/uml.mk b/uml.mk
index a7fa7f7..32240fa 100644
--- a/uml.mk
+++ b/uml.mk
@@ -27,3 +27,4 @@ PRODUCT_CHARACTERISTICS := nosdcard
PRODUCT_COPY_FILES += $(LOCAL_PATH)/fstab.uml:root/fstab.uml
PRODUCT_COPY_FILES += $(LOCAL_PATH)/init.uml.rc:root/init.uml.rc
PRODUCT_COPY_FILES += $(LOCAL_PATH)/surfaceflinger.rc:system/etc/init/surfaceflinger.rc
+PRODUCT_COPY_FILES += $(LOCAL_PATH)/init.eth0.sh:system/bin/init.eth0.sh