mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-27 12:05:30 +00:00
parent
d3e4b29e62
commit
b51b884fc7
@ -116,14 +116,23 @@ ensure_bb() {
|
|||||||
fi
|
fi
|
||||||
chmod 755 $bb
|
chmod 755 $bb
|
||||||
|
|
||||||
|
# Busybox could be a script, make sure /system/bin/sh exists
|
||||||
|
if [ ! -f /system/bin/sh ]; then
|
||||||
|
umount -l /system 2>/dev/null
|
||||||
|
mkdir -p /system/bin
|
||||||
|
ln -s $(command -v sh) /system/bin/sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
export ASH_STANDALONE=1
|
||||||
|
|
||||||
# Find our current arguments
|
# Find our current arguments
|
||||||
# Run in busybox environment to ensure consistent results
|
# Run in busybox environment to ensure consistent results
|
||||||
# /proc/<pid>/cmdline shall be <interpreter> <script> <arguments...>
|
# /proc/<pid>/cmdline shall be <interpreter> <script> <arguments...>
|
||||||
local cmds="$($bb sh -o standalone -c "
|
local cmds="$($bb sh -c "
|
||||||
for arg in \$(tr '\0' '\n' < /proc/$$/cmdline); do
|
for arg in \$(tr '\0' '\n' < /proc/$$/cmdline); do
|
||||||
if [ -z \"\$cmds\" ]; then
|
if [ -z \"\$cmds\" ]; then
|
||||||
# Skip the first argument as we want to change the interpreter
|
# Skip the first argument as we want to change the interpreter
|
||||||
cmds=\"sh -o standalone\"
|
cmds=\"sh\"
|
||||||
else
|
else
|
||||||
cmds=\"\$cmds '\$arg'\"
|
cmds=\"\$cmds '\$arg'\"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user