Commit b51b884f authored by topjohnwu's avatar topjohnwu

Fix module installs in recovery

Close #3494
parent d3e4b29e
...@@ -116,14 +116,23 @@ ensure_bb() { ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment