From 00a21e3d543e062006576ea50a1b998cbe7d45c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Sat, 25 Jan 2020 00:34:33 -0800 Subject: [PATCH] symlink /dev/net/tun -> ../tun MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is the expected location on Linux and this makes 'ip tuntap' work. Before: vsoc_x86_64:/ # ip tuntap add dev tun0 mode tun open: No such file or directory vsoc_x86_64:/ # ip tuntap add dev tap0 mode tap open: No such file or directory vsoc_x86_64:/ # ip tuntap list After: vsoc_x86_64:/ # ip tuntap add dev tun0 mode tun vsoc_x86_64:/ # ip tuntap add dev tap0 mode tap vsoc_x86_64:/ # ip tuntap list tap0: tap UNKNOWN_FLAGS:800 tun0: tun UNKNOWN_FLAGS:800 $ adbz shell ls -ldZ / /dev /dev/tun /dev/net /dev/net/tun drwxr-xr-x 25 root root u:object_r:rootfs:s0 4096 2020-01-25 09:48 / drwxr-xr-x 21 root root u:object_r:device:s0 1240 2020-01-25 09:48 /dev drwxr-xr-x 2 root root u:object_r:device:s0 60 2020-01-25 09:48 /dev/net lrwxrwxrwx 1 root root u:object_r:device:s0 6 2020-01-25 09:48 /dev/net/tun -> ../tun crw-rw---- 1 system vpn u:object_r:tun_device:s0 10, 200 2020-01-25 09:48 /dev/tun Test: see above Signed-off-by: Maciej Żenczykowski Change-Id: I2aa215711454ce4f8a0ef1f34c17621629060fa1 --- rootdir/init.rc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rootdir/init.rc b/rootdir/init.rc index e57580814..c3a53dcaa 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -32,6 +32,10 @@ on early-init # cgroup for system_server and surfaceflinger mkdir /dev/memcg/system 0550 system system + # symlink the Android specific /dev/tun to Linux expected /dev/net/tun + mkdir /dev/net 0755 root root + symlink ../tun /dev/net/tun + # set RLIMIT_NICE to allow priorities from 19 to -20 setrlimit nice 40 40