强大的 Bash 有人编译 Armel 版本了,那不就可以在G1上使用了?那是必需的!下面来安装吧。
首先下载 sftp://sftp:[email protected]:heiher/android/bash_for_G1.tar.gz,解压缩后将 bash 和 bash_profile 两个文件存放在 /sdcard 中,开始安装。
su # 需要 Allow
rwsystem
cp /sdcard/bash /system/bin/bash
chmod 755 /system/bin/bash
chown root.shell /system/bin/bash
cd /system/bin
mv sh sh.bk && mv bash sh
rosystem
bash_profile 就放在 /sdcard 中,相信你也明白它是做什么的了。
Over!
放在sd卡有一个坏处
频繁读写SD卡会比较费电
我说的是把bin放在SD卡执行,A1200E的flash比较小,我就是利用mount把一些原本只读的文件mount到了SD卡上
最新版的busybox貌似已经集成bash了,只是不是默认Shell,放在/system/xbin目录下。在默认的sh Shell中输入bash就可以启动,而且能够自动读取/etc/bashrc。
我曾经使用和博主类似的办法在/system/bin下做一个软链,可是这种方法的启动的Bash无法读取系统默认的bashrc,后来查了一下Bash的手册,有这么一段话:
if bash is invoked with the name sh, it tries to mimic the startup behavior of historical versions of sh as closely as possible,while conforming to the POSIX standards as well.