[Miscellaneous Android Development] Serkenar:
This how-to describes how to bootstrap and configure Optware-ng. Optware-ng is my Optware firmware-independent fork. This allows to install numerous pre-compiled packages.

Lists of available packages can be found here:

ARMv7 hardfloat

Intel

ARMv7 softfloat

And the project home is currently here:

https://github.com/alllexx88/Optware-ng

Some packages may not work, since not all of them are compatible with android, but most will. There're some pre-requisites you must satisfy before you can proceed:

1. You must be rooted

2. Optware-ng relies on some standard linux commands, the easiest way to make sure you have them is to install Busybox with all the links

3. We'll create Optware-ng initialization script in /system/etc/init.d, so init.d support is needed. If you don't have it, you can either add it (google for how-tos on doing this) or edit your init.rc android startup script to include Optware-ng initialization lines (though adding init.d support is still a better idea)

The following commands should be issued from terminal as root. I suggest you use some SSH server available on the Play Store, and connect via SSH from you PC.

1. This prepares needed environment:

- Optware-ng will be installed to /data/Optware-ng with /opt symlinked to it

- Optware-ng scripts rely on /bin/sh, so we symlink it to /system/bin/sh

- Optware-ng needs /tmp temp dir: we create 64Mb RAM disk there (you may adjust the size if you like)

mkdir -p /data/Optware-ng
mount -o remount,rw /
ln -s /data/Optware-ng /opt
mkdir /bin
ln -s /system/bin/sh /bin/sh
mkdir /tmp
chmod 777 /tmp
mount -t tmpfs -o size=64M tmpfs /tmp
mount -o remount,ro /
export PATH=$PATH:/opt/bin:/opt/sbin

2. This bootstraps the feed:

2.a) for ARMv7 hardfloat (most modern android devices):

cd /tmp
wget http://optware-ng.zyxmon.org/buildroot-armeabihf/buildroot-armeabihf-bootstrap.sh
sh buildroot-armeabihf-bootstrap.sh

2.b) for Intel:

cd /tmp
wget http://optware-ng.zyxmon.org/buildroot-i686/buildroot-i686-bootstrap.sh
sh buildroot-i686-bootstrap.sh

2.c) for the unlikely case where your device is ARMv7, but lacks FPU (softfloat feed):

cd /tmp
wget http://optware-ng.zyxmon.org/buildroot-armeabi-ng/buildroot-armeabi-ng-bootstrap.sh
sh buildroot-armeabi-ng-bootstrap.sh

Unless you're using ARMv7 softfloat feed, bootstrapping process may appear to be "stuck" on this:

Don't be frightened: if your device isn't too powerful, it indeed takes a lot of time, but you have to do this just once, so please be patient.

3. Make sure environment needed for Optware-ng is restored after reboots, and also run Optware-ng startup scripts on boot:

Create init.d startup script and make it executable

mount -o remount,rw /system
echo '#!/system/bin/sh
mount -o remount,rw /
ln -s /data/Optware-ng /opt
mkdir /bin
ln -s /system/bin/sh /bin/sh
mkdir /tmp
chmod 777 /tmp
mount -t tmpfs -o size=64M tmpfs /tmp
mount -o remount,ro /

sleep 2

export PATH=$PATH:/bin:/opt/bin:/opt/sbin

for script in `ls /opt/etc/init.d/S*`; do
$script start
done' > /system/etc/init.d/S99Optware-ng
chmod 755 /system/etc/init.d/S99Optware-ng
mount -o remount,ro /system

Once again, you may adjust this line

mount -t tmpfs -o size=64M tmpfs /tmp

if you want greater/lesser RAM disk on /tmp

(4.) You're basically done, but I suggest you now install Optware-ng's dropbear-android package to act as an SSH server:

ipkg update
ipkg install dropbear-android

dropbear configs are stored in /opt/etc/default/dropbear and by default are:

DROPBEAR_ENABLE=no
DROPBEAR_PORT=2222
DROPBEAR_PASSWORD=password

Run these commands to adjust configs, enable dropbear and start it:

(replace <*> strings with actual desired values)

sed -i -e '/^DROPBEAR_PORT=/s/=.*/=<YOUR_PORT>/' -e '/^DROPBEAR_PASSWORD=/s/=.*/=<YOUR_PASSWORD>/' -e '/^DROPBEAR_ENABLE=/s/=.*/=yes/' /opt/etc/default/dropbear
/opt/etc/init.d/S51dropbear start

Now you are advised to use dropbear as SSH server to play with Optware-ng: use 'root' user, '<YOUR_PASSWORD>' password and '<YOUR_PORT>' port:cowboy:

For better security you may use public key authorization only: set password to blank and add your public keys to /opt/etc/dropbear/authorized_keys (don't forget to `chmod 600 /opt/etc/dropbear/authorized_keys` after you create it!) and restart dropbear or just reboot.

P.S. I'm not exactly sure that this is the right place to post this, please move it if needed.