mirror of
https://github.com/xiaolu/mkbootimg_tools.git
synced 2026-02-13 21:49:29 +01:00
- This project will work on linux. Confirmed working on Ubuntu 15.04. I have added a wrapper script which manipulates the limited usage of a shebang that allows the real mkboot script to be executed by the bash binary from within the project directory. This eliminates the previous requirement of having to place bash at /system/xbin.
17 lines
648 B
Plaintext
Executable File
17 lines
648 B
Plaintext
Executable File
# This is a wrapper script which basically manipulates the boundaries of an already limited shebang.
|
|
# This allows the execution of the real mkboot (aka wrapper) script using bash from the project directory whether it be on Linux or an ARM device.
|
|
|
|
target=$(pwd)
|
|
script="${target}/wrapper"
|
|
shebang=$(head -1 "$script")
|
|
buildit="$@"
|
|
|
|
# Use an array in case a argument is there too
|
|
interp=( ${shebang#\#!} )
|
|
|
|
# Now run it, passing in the remaining command line arguments
|
|
# EXAMPLE 1: Unpacking: ./mkboot recovery.img recoveryfolder
|
|
# EXAMPLE 2: Packing: ./mkboot recoveryfolder recovery.img
|
|
shift 1
|
|
exec "${target}/${interp[@]}" "$script" ${buildit}
|