How to set bash as default shell? When I adb into a device with Cyanogenmod, I'm presented with a nice bash shell, color prompt, and bashrc.  I don't see a symlink from /system/xbin/bash to /system/bin/sh.  How do they set the default shell to bash instead of sh?  I looked through rc files, but didn't find anything.  I'd like to do the same on my Android build, which isn't Cyanogenmod.

Update

After re-installing from scratch with CM7, I'm taken to sh instead of bash.  Now the question is how to set bash as default.
When adb shell is executed, the Android side also launches adb which then executes /system/bin/sh -. This path is hard-coded in system/core/adb/services.c:

347 #if ADB_HOST
348 #define SHELL_COMMAND "/bin/sh"
349 #define ALTERNATE_SHELL_COMMAND ""
350 #else
351 #define SHELL_COMMAND "/system/bin/sh"
352 #define ALTERNATE_SHELL_COMMAND "/sbin/sh"
353 #endif


If you want to change this to bash, you will have to recompile it.

It is possible to execute some commands from file when running the interactive shell. As written in system/core/sh/main.c, sh - (note the - for interactive mode) reads from the following files (in this order):


/etc/profile
.profile (relative to current directory, this is /.profile for adb shell
$ENV (environment variable ENV should point to a file)


As /etc/ and / are read-only, the only way to get something loaded was by setting ENV. You can probably create a symlink from /etc/profile to /data/profile by mounting / read-write (exercise for the reader).