Skip to content

Commit

Permalink
[experimental] new option --ashmem-memfd #36
Browse files Browse the repository at this point in the history
  • Loading branch information
AnninoDr4 committed Mar 22, 2023
1 parent e8bac1c commit bf57008
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions udroid/src/help_udroid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
9 changes: 9 additions & 0 deletions udroid/src/udroid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
;;
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit bf57008

Please sign in to comment.