# with this script you can use a linux distrib under android in example raspbian if arm device on a sdcard or USB key # after running this script you will be able to # run a apache web server , a ssh server ,perform apt-get upgrade etc ... # done on meteorit , H6 , LENOVO A10 netbooks, MK802 mini PC ,on galaxy GIO & on geeksphone revolution ( X86 archi) # final target use microxwin (xserver replacement) any help will be appreciated # bugs known semaphore handle nok export PATH=/system/bin date montage() { while read a do mount -t ext4 $a /u if [ -f /u/bin/bash ] then return fi done } set -x # line can be removed umask 0 mount -o rw,remount / # / writable mount -o rw,remount /system # put writable usefull but not necessary mkdir /u # my directory # try to mount the devices untill /bin found on one of them ls /dev/block/mmcblk[0-9]p[0-9] /dev/block/sda[1-9] /dev/block/sdb[1-9] | montage cd / ln -s /u/bin /bin ln -s /u/usr /usr ln -s /u/var /var ln -s /u/run /run mv /lib /slib # save android /lib ... can have effect on some application ln -s /u/lib /lib mv /root /sroot # move /root if exists ln -s /u/root /root mkdir /tmp rm /etc mkdir /etc cd /etc # some files needs to be copied not linked just do it once for i in passwd shadow group gshadow subuid subgid do if [ ! -f $i ] then cp /u/etc/$i . fi done # links files maybe you will have to add more PATH=/bin:/usr/bin/:/u/sbin:/usr/sbin:/system/bin export PATH=/bin:/usr/bin:/sbin:/u/sbin:/usr/sbin:/system/bin export HOME=/root export SHELL=/bin/bash export DISPLAY=localhost:0 # if you use an Xserver android application, you can also use an external machine export LD_LIBRARY_PATH=/lib:/usr/lib:$LD_LIBRATY_PATH # not mandatory but to simplify library search cd /etc ln -s /u/etc/* /etc/. ln -sf /system/etc/* /etc/. # reset comment color in jed */ mkdir /tmp ln -s /proc/mounts /etc/mtab # for df linux mkdir /home # i prefer a separated home #mount -t ext4 /dev/block/vold/179:3 /home # "change or comment" # /**** update your /etc/ssh/sshd_config # put usePam no **/ /usr/sbin/sshd -p 23 # perso apache2ctl start # perso mknod /dev/fb0 c 29 0 # needed for Xserver on some machines PS1='->' TZ=MET export TZ PS1 set -x if [ `ps |grep 'recovery.sh'` ] then exit 0 fi cd df /u pwd mv /sbin /sbin2 ln -s /u/sbin /sbin stty erase ^H echo $DISPLAY echo "do you want to set DISPLAY (y/n) ?" read a if [ "$a" = "y" ] then echo "IP of your remote display" read b export DISPLAY="$b:0" fi exec /bin/bash --rcfile .bashrc # ' ' contact me on jean.michel.78@gmail.com if needed i don't bite # add users handling on android for sshd # if this script is not successfull => no access to linux distribution # but no effect on android