This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 5th, 2010  |  syntax: Bash  |  size: 3.73 KB  |  views: 203  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. adb pull /data/data/com.android.providers.settings/databases/settings.db settings.db; sqlite3 settings.db
  2.  
  3. insert into system (name, value) values ('wifi_sleep_policy', 2);
  4. update secure set value=1 where name='install_non_market_apps';
  5. .q
  6.  
  7. adb push settings.db /data/data/com.android.providers.settings/databases/settings.db
  8.  
  9. setprop persist.service.mount.umsauto 0
  10.  
  11.  
  12. ####### ON DEVICE
  13.  
  14. sudo remount -o suid /data
  15. mount -o remount,rw rootfs /
  16. mkdir /data/opt
  17. mkdir /data/opt/var
  18. mkdir /data/opt/lib
  19. mkdir /data/opt/bin
  20. mkdir /data/opt/etc
  21. mkdir /data/opt/etc/ipkg
  22. ln -s /data/opt /opt
  23. ln -s /data/opt/var /var
  24. ln -s /system/bin /bin
  25. ln -s /system/lib /lib
  26.  
  27.  
  28. ####### BACK ON THE HOST
  29.  
  30. export PATH=$PATH:/srv/android/tools
  31. doctor=/srv/doctors/unpacked/webosdoctorp100ueu-wr-1.4.5
  32. feed="http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable"
  33.  
  34. # == libs from pre ==
  35. for LIB in ld-linux.so.3 libm.so.6 libc.so.6 librt.so.1 libutil.so.1 libcrypt.so.1 libdl.so.2 libpthread.so.0 libresolv.so.2 libnss_files.so.2 libnsl.so.1 libnss_dns.so.2 libnss_compat.so.2; do
  36. #  cp $doctor/rootfs/lib/$LIB  .
  37.   cp ~/nook-color/$LIB .
  38.   adb push $LIB /data/opt/lib/$LIB
  39. done
  40. # alternatives
  41. adb push $doctor/rootfs/usr/bin/update-alternatives /data/opt/bin/update-alternatives
  42. # resolves stuff
  43. adb push $doctor/rootfs/etc/nsswitch.conf /etc/nsswitch.conf
  44. echo 'nameserver 8.8.8.8' > resolv.conf
  45. adb push resolv.conf /etc/resolv.conf
  46.  
  47. # === busybox ===
  48. wget $feed/busybox-base_1.10.3-1_arm.ipk
  49. tar xvzf busybox-base_1.10.3-1_arm.ipk
  50. tar xvzf data.tar.gz
  51. adb push opt/bin/busybox /data/opt/bin/busybox
  52. # === WGET ===
  53. wget $feed/wget_1.12-2_arm.ipk
  54. tar xvzf wget_1.12-2_arm.ipk
  55. tar xvzf data.tar.gz
  56. adb push opt/bin/wget /data/opt/bin/wget
  57. wget $feed/ipkg-opt_0.99.163-10_arm.ipk
  58. tar xvzf ipkg-opt_0.99.163-10_arm.ipk
  59. tar xvzf data.tar.gz
  60. adb push opt/bin/ipkg-opt /data/opt/bin/ipkg-opt
  61. adb push opt/lib/libipkg.so.0 /data/opt/lib/libipkg.so.0
  62. echo "src cross $feed" > feeds.conf
  63. adb push feeds.conf /data/opt/etc/ipkg/feeds.conf
  64.  
  65.  
  66.  
  67. #####  BACK ON DEVICE  (I'm on a horse)
  68.  
  69. root_crypt_passwd='$1$yExeAJHI$yK0XjQOXqC0udQbChdoWL.'
  70. user_login='tking'
  71. user_crypt_passwd='$1$v.LEJROZ$VSPvfd0wB7wv7iL7yNREf/'
  72. umask 022
  73. export PATH="/data/opt/bin:$PATH"
  74. export TERM=linux
  75. export HOME="/data/opt/home/root"
  76. cd /data/opt/bin
  77. ln -s busybox ln; hash -r
  78. for TOOL in \[ rm seed sort mkdir head dirname sed; do ln -s busybox $TOOL; done
  79. hash -r
  80. ipkg-opt update
  81. ipkg-opt install busybox; hash -r
  82. ipkg-opt install bash
  83. ipkg-opt install procps
  84. ipkg-opt install vim;  rm vi; ln -s vim vi
  85. ipkg-opt install less
  86. ipkg-opt install zlib
  87. ipkg-opt install sudo
  88. ipkg-opt install dropbear
  89. ipkg-opt install screen
  90. # environment
  91. mkdir -p /data/opt/var/log; mkdir /data/opt/var/run
  92. mkdir -p /data/opt/home/root; ln -s /data/opt/home /home
  93. (echo 'umask 022'; echo 'export TERM=linux'; echo 'export PATH=/data/opt/bin:$PATH'; echo "export PS1='\u@\h:\w\\$ '") >  /data/opt/home/root/.bash_profile
  94. (echo '/system/bin/sh'; echo '/data/opt/bin/bash') > /data/opt/etc/shells; ln -s /data/opt/etc/shells /etc/shells
  95. echo "root:$root_crypt_passwd:0:0:root:/data/opt/home/root:/data/opt/bin/bash"  > /data/opt/etc/passwd; ln -s /data/opt/etc/passwd /etc/passwd
  96. echo "$user_login:$user_crypt_passwd:101:50:$user_login:/data/opt/home/$user_login:/data/opt/bin/bash"  >> /data/opt/etc/passwd
  97. (echo 'root:x:0:'; echo 'wheel:x:50:') > /data/opt/etc/group; ln -s /data/opt/etc/group /etc/group
  98. cp -rp /data/opt/home/root /data/opt/home/$user_login
  99. chown -R $user_login:wheel /data/opt/home/$user_login
  100. ln -s /proc/mounts /etc/mtab
  101.  
  102. #  you can get a better env now by running bash and  cd; source .profile
  103. ##### Get ip of device from ifconfig and you can ssh in as root.
clone this paste RAW Paste Data