SHARE
TWEET

linux on android startup script

Madmouse Jun 19th, 2015 (edited) 15 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. LINUXROOT=/sd-ext
  2. BUSY=/system/xbin/busybox
  3. CHR=/system/xbin/chroot
  4.  
  5. export PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
  6.  
  7. mount -o remount,rw /
  8. mkdir $LINUXROOT
  9.  
  10. # mount devices and such
  11. losetup /dev/block/loop0 /sdcard/debian.raw
  12. mount -t ext2 /dev/block/loop0 $LINUXROOT
  13.  
  14. mount -o bind /proc $LINUXROOT/proc
  15. mount -o bind /sys $LINUXROOT/sys
  16. mount -o bind /dev $LINUXROOT/dev
  17. mount -o bind /dev/pts $LINUXROOT/dev/pts
  18.  
  19.  
  20. export TMPDIR=/tmp
  21. export USER=root
  22. export HOME=/root
  23. export SHELL=/bin/bash
  24.  
  25. export TERM=linux
  26. export LC_ALL=C
  27. export LANGUAGE=C
  28. export LANG=C
  29. export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin
  30.  
  31. # startup crap
  32. #$BUSY $CHR $LINUXROOT rm /tmp/.X*-lock
  33. #$BUSY $CHR $LINUXROOT rm -rf /tmp/.X11-unix/
  34. # vnc server
  35. #$BUSY $CHR $LINUXROOT su - user -c "tightvncserver :1"
  36.  
  37. # start DBus
  38. $BUSY $CHR $LINUXROOT service dbus start
  39.  
  40. # ssh server
  41. $BUSY $CHR $LINUXROOT /usr/sbin/sshd
RAW Paste Data
Top