From bf57008f3a5c99eeb9525f80e3c5e18c189514ec Mon Sep 17 00:00:00 2001 From: Sonyu Annino <92148685+AnninoDr4@users.noreply.github.com> Date: Wed, 22 Mar 2023 04:32:31 +0000 Subject: [PATCH] [experimental] new option `--ashmem-memfd` #36 https://github.com/termux/proot/issues/258 --- README.md | 1 + udroid/src/help_udroid.sh | 1 + udroid/src/udroid.sh | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/README.md b/README.md index 73887eb..838dadd 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ options: --name: Allows the user to specify a custom name for the filesystem to install --bind or -b: Allows the user to specify extra mount points for the filesystem. --isolated: Creates an isolated environment for the filesystem. + --fix-low-ports: Fixes low ports for the filesystem. --no-shared-tmp: Disables shared tmp for the filesystem. --no-link2symlink: Disables link2symlink for the filesystem. diff --git a/udroid/src/help_udroid.sh b/udroid/src/help_udroid.sh index 628bc1d..ee90c87 100644 --- a/udroid/src/help_udroid.sh +++ b/udroid/src/help_udroid.sh @@ -17,6 +17,7 @@ help_login() { echo " --name: Allows the user to specify a custom name for the filesystem to install" echo " --bind or -b: Allows the user to specify extra mount points for the filesystem." echo " --isolated: Creates an isolated environment for the filesystem." + echo " --ashmem-memfd | --memfd enable support for memfd emulation through ashmem ( experimental )" echo " --fix-low-ports: Fixes low ports for the filesystem." echo " --no-shared-tmp: Disables shared tmp for the filesystem." echo " --no-link2symlink: Disables link2symlink for the filesystem." diff --git a/udroid/src/udroid.sh b/udroid/src/udroid.sh index 728990f..bfdeddc 100755 --- a/udroid/src/udroid.sh +++ b/udroid/src/udroid.sh @@ -280,6 +280,7 @@ login() { local no_cap_last_cap=false local no_pulseserver=false local no_android_shmem=false + local ashmem_memfd=false local no_fake_root_id=false local fix_low_ports=false local make_host_tmp_shared=true # its better to run with shared tmp @@ -369,6 +370,9 @@ login() { --no-android-shmem) no_android_shmem=true; shift ;; + --ashmem-memfd | --memfd) + ashmem_memfd=true; shift + ;; --no-kill-on-exit) no_kill_on_exit=true; shift ;; @@ -627,6 +631,11 @@ login() { --exit-idle-time=-1 fi + # android shmem memfd + if $ashmem_memfd; then + set -- "--ashmem-memfd" "$@" + fi + exec proot "$@" else ELOG "ERROR: $distro not found or installed"