From c4877a7af5c71830bcfe07ebcc5d39bf45bcb28f Mon Sep 17 00:00:00 2001 From: 2moe <25324935+2moe@users.noreply.github.com> Date: Mon, 17 May 2021 16:44:32 +0800 Subject: [PATCH] MOUNT_CAP_LAST_CAP --- share/old-version/share/app/manager | 2 +- .../old-version/share/container/proot/startup | 57 +++++++++++-------- share/old-version/tools/app/tool | 2 +- 3 files changed, 34 insertions(+), 27 deletions(-) diff --git a/share/old-version/share/app/manager b/share/old-version/share/app/manager index 951755115..46f485132 100755 --- a/share/old-version/share/app/manager +++ b/share/old-version/share/app/manager @@ -49,7 +49,7 @@ check_tmoe_command() { else TMOE_TIPS_01="tmoe" fi - TMOE_TIPS_00="Welcome to tmoe linux manager v1.4728,type ${TMOE_TIPS_01} to start it." + TMOE_TIPS_00="Welcome to tmoe linux manager v1.4729,type ${TMOE_TIPS_01} to start it." } ######################### tmoe_manager_env() { diff --git a/share/old-version/share/container/proot/startup b/share/old-version/share/container/proot/startup index 2ad2b50a8..0f7e80aa7 100755 --- a/share/old-version/share/container/proot/startup +++ b/share/old-version/share/container/proot/startup @@ -160,6 +160,33 @@ cat >${TMOE_STARTUP_SCRIPT} <<-ENDOFPROOT TMP_SOURCE_DIR="${TMPDIR}" TMP_MOUNT_POINT="/tmp" + MOUNT_SYSTEM=true + SYSTEM_DIR="/system" + + MOUNT_APEX=true + APEX_DIR="/apex" + + MOUNT_SYS=false + SYS_DIR="/sys" + + MOUNT_DEV=true + DEV_DIR="/dev" + MOUNT_SHM_TO_TMP=true + MOUNT_URANDOM_TO_RANDOM=true + MOUNT_DEV_FD=true + MOUNT_DEV_STDIN=true + MOUNT_DEV_STDOUT=true + MOUNT_DEV_STDERR=true + MOUNT_DEV_TTY=true + + MOUNT_PROC=true + PROC_DIR="/proc" + FAKE_PROOT_PROC=true + # Default is true. + + MOUNT_CAP_LAST_CAP=true + # /dev/null:/proc/sys/kernel/cap_last_cap + #--- NUM_OF_MOUNTS=12 # uint8 @@ -206,30 +233,6 @@ cat >${TMOE_STARTUP_SCRIPT} <<-ENDOFPROOT MOUNT_SOURCE_12="" MOUNT_POINT_12="" #--- - - MOUNT_SYSTEM=true - SYSTEM_DIR="/system" - - MOUNT_APEX=true - APEX_DIR="/apex" - - MOUNT_SYS=false - SYS_DIR="/sys" - - MOUNT_DEV=true - DEV_DIR="/dev" - MOUNT_SHM_TO_TMP=true - MOUNT_URANDOM_TO_RANDOM=true - MOUNT_DEV_FD=true - MOUNT_DEV_STDIN=true - MOUNT_DEV_STDOUT=true - MOUNT_DEV_STDERR=true - MOUNT_DEV_TTY=true - - MOUNT_PROC=true - PROC_DIR="/proc" - FAKE_PROOT_PROC=true - # Default is true. ################ TMOE_LOCALE_FILE="${CONFIG_FOLDER}/locale.txt" DEFAULT_SHELL_CONF="${CONFIG_FOLDER}/default_shell.conf" @@ -414,6 +417,10 @@ cat >${TMOE_STARTUP_SCRIPT} <<-ENDOFPROOT set -- "\${@}" "--mount=\${GITSTATUS_DIR}:\${GITSTATUS_MOUNT_POINT}" fi fi + + if [[ \${MOUNT_CAP_LAST_CAP} = true ]]; then + set -- "\${@}" "--mount=/dev/null:/proc/sys/kernel/cap_last_cap" + fi ############# unset QEMU_BIN case \${SKIP_QEMU_DETECTION} in @@ -598,7 +605,7 @@ cat >${TMOE_STARTUP_SCRIPT} <<-ENDOFPROOT set -- "env" "PROOT_LOADER=\${PROOT_LOADER}" "\${@}" elif [[ -z \${PROOT_LOADER} && -n \${LD_LIBRARY_PATH} ]]; then set -- "env" "LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}" "\${@}" - else + elif [[ -n \${PROOT_LOADER} && -n \${LD_LIBRARY_PATH} ]]; then set -- "PROOT_LOADER=\${PROOT_LOADER}" "\${@}" set -- "env" "LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}" "\${@}" fi diff --git a/share/old-version/tools/app/tool b/share/old-version/tools/app/tool index 1315eae98..18250386d 100755 --- a/share/old-version/tools/app/tool +++ b/share/old-version/tools/app/tool @@ -92,7 +92,7 @@ check_tmoe_command() { else TMOE_TIPS_01="tmoe t" fi - TMOE_TIPS_00="Welcome to tmoe linux tool v1.4728,type ${TMOE_TIPS_01} to start this tool." + TMOE_TIPS_00="Welcome to tmoe linux tool v1.4729,type ${TMOE_TIPS_01} to start this tool." #勿改00变量 } #########