File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change 1
1
#! /system/bin/sh
2
2
# Minimal proot run script
3
3
4
+ if [ -z " $1 " ] || [ -z " $2 " ]; then
5
+ echo " Usage: <user> <command>"
6
+ exit 1
7
+ fi
8
+
4
9
BASE_DIR=" $PWD "
5
10
6
11
export PROOT_TMP_DIR=" $BASE_DIR /tmp"
@@ -9,12 +14,22 @@ export PROOT_L2S_DIR="$BASE_DIR/bootstrap/.proot.meta"
9
14
mkdir -p " $PROOT_TMP_DIR "
10
15
mkdir -p " $PROOT_L2S_DIR "
11
16
12
- PATH=' /sbin:/usr/sbin:/bin:/usr/bin'
13
- USER=' root'
14
- HOME=' /root'
17
+ if [ " $1 " = " root" ]; then
18
+ PATH=' /sbin:/usr/sbin:/bin:/usr/bin'
19
+ USER=' root'
20
+ HOME=' /root'
21
+ OP=" -0"
22
+ else
23
+ OP=" "
24
+ USER=" $1 "
25
+ PATH=' /sbin:/usr/sbin:/bin:/usr/bin'
26
+ HOME=" /home/$USER "
27
+ fi
28
+
29
+
15
30
unset TMPDIR
16
31
unset LD_LIBRARY_PATH
17
32
export PATH
18
33
export USER
19
34
export HOME
20
- ./root/bin/proot -r bootstrap -b /dev -b /proc -b /sys -b /system -b /vendor -b /storage --link2symlink -p -L -w /root /bin/sh -l
35
+ ./root/bin/proot -r bootstrap $OP -b /dev -b /proc -b /sys -b /system -b /vendor -b /storage $EXTRA_BIND --link2symlink -p -L -w $HOME $2
You can’t perform that action at this time.
0 commit comments