阴茎勃起贴着肚皮图片:How to cross-compile BASH for Android

来源:百度文库 编辑:九乡新闻网 时间:2024/07/14 09:50:52

How to cross-compile BASH for Android

Follow these steps to compile the BASH shell for ARM (Android devices).

If you’re looking for a copy of the BASH binary you can download it HERE

Download the ARM Toolkit (http://www.codesourcery.com/gnu_toolchains/arm/download.html)

Download the Bash Source code (http://ftp.gnu.org/gnu/bash/), I used v 4.1

# export CC=arm-none-linux-gnueabi-gcc
# ./configure –host=arm-linux –enable-static-link –without-bash-malloc

Edit Makefile and add “-static” to CFLAGS

vi Makefile
CFLAGS = -g -O2 -static

Build the source

# make

# file bash
bash: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.16, not stripped

Push the binary to the phone:

# adb push bash /sdcard/
1728 KB/s (2967642 bytes in 1.676s)
# adb shell
$ su
# cp /sdcard/bash /system/xbin/
# rm /sdcard/bash
# bash
bash-4.1#

Then I added bash to the shells file since I’m planning on making it the default shell for SSH.

bash-4.1# echo “/system/xbin/bash” >>/system/etc/shells