release-request-64fc473b-7e45-48f5-b2f7-3c916e338608-for-git_pi-release-4249735 snap-temp-L34700000089732387

Change-Id: I48933c77b5301109f3c9bcf06be248a6495bc84c
diff --git a/BoardConfig.mk b/BoardConfig.mk
index b6eb431..807b290 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -20,3 +20,6 @@
 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_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