mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-24 18:47:38 +00:00
parent
d3e4b29e62
commit
b51b884fc7
@ -116,14 +116,23 @@ ensure_bb() {
|
||||
fi
|
||||
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
|
||||
# Run in busybox environment to ensure consistent results
|
||||
# /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
|
||||
if [ -z \"\$cmds\" ]; then
|
||||
# Skip the first argument as we want to change the interpreter
|
||||
cmds=\"sh -o standalone\"
|
||||
cmds=\"sh\"
|
||||
else
|
||||
cmds=\"\$cmds '\$arg'\"
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user