daily pastebin goal
19%
SHARE
TWEET

ubuntu.sh

a guest Jan 29th, 2012 458 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ##########################################
  2. #Ubuntu boot script V5 for Android       #
  3. #Built by Zachary Powell (zacthespack)   #
  4. #Thanks to everyone at XDA!              #
  5. ##########################################
  6. perm=$(id|cut -b 5)
  7. if [ "$perm" != "0" ];then echo "This script requires root! Type: su"; exit; fi
  8. mount -o remount,rw /dev/block/mmcblk0p5 /system
  9. export kit=/sdcard/ubuntu
  10. export bin=/system/bin
  11. export mnt=/data/local/mnt
  12. export USER=root
  13. mkdir $mnt
  14. export PATH=$bin:/usr/bin:/usr/local/bin:/usr/sbin:/bin:/usr/local/sbin:/usr/games:$PATH
  15. export TERM=linux
  16. export HOME=/root
  17. if [ -b /dev/block/loop255 ]; then
  18.         echo "Loop device exists"
  19. else
  20.         busybox mknod /dev/block/loop255 b 7 255
  21. fi
  22. #mount -o loop,noatime -t ext2 $kit/ubuntu.img $mnt
  23. losetup /dev/block/loop255 $kit/ubuntu.img
  24. mount -t ext2 /dev/block/loop255 $mnt
  25. mount -t devpts devpts $mnt/dev/pts
  26. mount -t proc proc $mnt/proc
  27. mount -t sysfs sysfs $mnt/sys
  28. busybox mount -o bind /sdcard $mnt/sdcard
  29. busybox mount -o bind /sdcard/external_sd $mnt/external_sd
  30. busybox sysctl -w net.ipv4.ip_forward=1
  31. echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
  32. echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
  33. echo "127.0.0.1 localhost" > $mnt/etc/hosts
  34. echo "Ubuntu is configured with SSH and VNC servers that can be accessed from the IP:"
  35. ifconfig eth0
  36. echo " "
  37. busybox chroot $mnt /root/init.sh
  38.  
  39. echo "Shutting down Ubuntu ARM"
  40. umount $mnt/sdcard
  41. umount $mnt/external_sd
  42. umount $mnt/dev/pts
  43. umount $mnt/proc
  44. umount $mnt/sys
  45. umount $mnt
  46. losetup -d /dev/block/loop255
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top