summaryrefslogtreecommitdiff
path: root/sepolicy/init_eth0.te
diff options
context:
space:
mode:
authorQuang Luong <qal@google.com>2017-07-31 17:09:42 -0700
committerQuang Luong <qal@google.com>2017-08-03 13:31:35 -0700
commitb04b7944381228cd1c661438cd5ffd174fe80c89 (patch)
tree8168eef7bc443350a2c510da94bd1cd393cbbb61 /sepolicy/init_eth0.te
parent4f11280e3d70728fba24e572428e559b7b6f8093 (diff)
downloaduml-b04b7944381228cd1c661438cd5ffd174fe80c89.tar.gz
uml: add adb support, add eth0 script sepolicies
After running UML, it is now possible to connect with adb using $ adb connect 192.168.0.253 Added init.eth0.sh script to configure tuntap connection to host. Modified init.uml.rc to run init.eth0.sh on boot. Added SELinux rules for init.eth0.sh to run during init. === To run === Install UML utilities $ sudo apt-get install uml-utilities $ sudo mv /usr/lib/uml/uml_net /usr/bin/uml_net $ sudo chmod +x /usr/bin/uml_net Compile UML userspace $ . build/envsetup.sh $ lunch uml-userdebug $ make -j40 Compile UML Kernel on Android-4.9 branch $ ARCH=um SUBARCH=x86_64 scripts/kconfig/merge_config.sh arch/um/configs/x86_64_defconfig kernel/configs/android-base.config kernel/configs/android-recommended.config $ make ARCH=um SUBARCH=x86_64 CROSS_COMPILE= -j40 Run UML: $ ./vmlinux initrd=ramdisk.img ubda=system.img ubdb=userdata.img \ androidboot.hardware=uml mem=256M umid=uml eth0=tuntap,,,192.168.0.254 Connect with adb: $ adb connect 192.168.0.253 Test: manual Bug: 32523022 Change-Id: Iaafc0aa701ff7d777226168a078c0a3712a3e6b8 Signed-off-by: Quang Luong <qal@google.com>
Diffstat (limited to 'sepolicy/init_eth0.te')
-rw-r--r--sepolicy/init_eth0.te10
1 files changed, 10 insertions, 0 deletions
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 };