Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.42 KB | None | 0 0
  1. #!/system/bin/sh
  2. busybox mount -o remount,rw /system
  3.  
  4. devicecheck=$(grep ro.product.device= /system/build.prop | cut -d \= -f 2)
  5. processorcheck=$(grep ro.board.platform= /system/build.prop | cut -d \= -f 2)
  6. kernelcheck=$(uname -r)
  7.  
  8.  
  9. processorcheck ()
  10. { case $processorcheck in
  11. qsd8k)
  12. echo "First Gen Snapdragon"
  13. ;;
  14. msm7k)
  15. echo "Second Gen Snapdragon"
  16. ;;
  17. s5pc110)
  18. echo "Hummingbird"
  19. ;;
  20. esac
  21. }
  22.  
  23. 1stgensnapdragon ()
  24. { if [ -e /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels_havs ]
  25. then
  26. while [ 1 ]; do
  27. vdd_levels=/sys/devices/system/cpu/cpu0/cpufreq/vdd_levels_havs
  28. echo " -This is a HAVS kernel-"
  29. echo
  30. echo
  31. echo "1) Read current voltages"
  32. echo "2) Lower voltages"
  33. echo "3) Raise voltages"
  34. echo "4) Stablize OC frequencies"
  35. echo "5) Reset voltages to kernel default (Requires reboot)"
  36. echo "6) Read init.d voltage file"
  37. echo "7) Current bugs"
  38. echo "8) Help"
  39. echo "9) Save changes"
  40. echo
  41. echo -n "Please choose an option, Enter to exit: "
  42. read option
  43. case $option in
  44. 1) cat $vdd_levels
  45. ;;
  46. 2) echo
  47. echo "1) Lower all voltages by 25mv"
  48. echo "2) Lower all voltages by 50mv"
  49. echo "3) Lower all voltages by 75mv"
  50. echo "4) Lower all voltages by 100mv"
  51. echo
  52. echo "5) Flash ExtremeMod"
  53. echo "6) Flash InsaneMod"
  54. echo "7) Set MIN voltages"
  55. echo "8) Lower MAX voltages by 25mv"
  56. echo
  57. echo "9) Custom voltages"
  58. echo
  59. echo -n "Please choose an option: "
  60. read option
  61. case $option in
  62. 1) echo "-25" "-25" > $vdd_levels
  63. echo "Voltages lowered by 25mv!"
  64. ;;
  65. 2) echo "-50" "-50" > $vdd_levels
  66. echo "Voltages lowered by 50mv!"
  67. ;;
  68. 3) echo "-75" "-75" > $vdd_levels
  69. echo "Voltages lowered by 75mv!"
  70. ;;
  71. 4) echo "-100" "-100" > $vdd_levels
  72. echo "Voltages lowered by 100mv!"
  73. ;;
  74. 5) echo "-100" "-100" > $vdd_levels
  75. echo "128000 825 875" > $vdd_levels
  76. echo "245000 825 875" > $vdd_levels
  77. echo "384000 825 875" > $vdd_levels
  78. echo "422400 825 875" > $vdd_levels
  79. echo "460800 825 875" > $vdd_levels
  80. echo "499200 825 900" > $vdd_levels
  81. echo "537600 825 925" > $vdd_levels
  82. echo "576000 825 975" > $vdd_levels
  83. echo "614400 825 975" > $vdd_levels
  84. echo "ExtremeMod applied!"
  85. ;;
  86. 6) echo "-100" "-100" > $vdd_levels
  87. echo "128000 800 850" > $vdd_levels
  88. echo "245000 800 850" > $vdd_levels
  89. echo "384000 800 850" > $vdd_levels
  90. echo "422400 800 850" > $vdd_levels
  91. echo "460800 800 875" > $vdd_levels
  92. echo "499200 800 875" > $vdd_levels
  93. echo "537600 800 900" > $vdd_levels
  94. echo "576000 800 950" > $vdd_levels
  95. echo "614400 800 950" > $vdd_levels
  96. echo "InsaneMod applied!"
  97. ;;
  98. 7) echo "Choices: 1) 800 2) 825 3) 850"
  99. echo -n "Please choose 1, 2, or 3: "
  100. read option
  101. case $option in
  102. 1) echo "-700" "-0" > $vdd_levels
  103. echo "800mv voltage floor set!"
  104. ;;
  105. 2) echo "-700" "-0" > $vdd_levels
  106. echo "+25" "-0" > $vdd_levels
  107. echo "825mv voltage floor set!"
  108. ;;
  109. 3) echo "-700" "-0" > $vdd_levels
  110. echo "+50" "-0" > $vdd_levels
  111. echo "850mv voltage floor set!"
  112. esac
  113. ;;
  114. 8) echo "-0" "-25" > $vdd_levels
  115. echo "MAX voltages lowered by 25mv!"
  116. echo
  117. echo "Issue this command again to lower MAX"
  118. echo "voltages another 25mv"
  119. ;;
  120. 9) echo "Coming soon!"
  121. ;;
  122. esac
  123. ;;
  124. 3) echo
  125. echo "1) Raise all voltages by 25mv"
  126. echo "2) Raise all voltages by 50mv"
  127. echo "3) Raise all voltages by 75mv"
  128. echo
  129. echo "4) Raise MAX voltages by 25mv"
  130. echo
  131. echo -n "Please choose an option: "
  132. read option
  133. case $option in
  134. 1) echo "+25" "+25" > $vdd_levels
  135. echo "Voltages raised by 25mv!"
  136. ;;
  137. 2) echo "+50" "+50" > $vdd_levels
  138. echo "Voltages raised by 50mv!"
  139. ;;
  140. 3) echo "+75" "+75" > $vdd_levels
  141. echo "Voltages raised by 75mv!"
  142. ;;
  143. 4) echo "-0" "+25" > $vdd_levels
  144. echo "MAX voltages raised by 25mv!"
  145. echo
  146. echo "Issue this command again to raise MAX"
  147. echo "voltages another 25mv"
  148. ;;
  149. esac
  150. ;;
  151. 4) echo "1036800 1350 1350" > $vdd_levels
  152. echo "1075200 1350 1350" > $vdd_levels
  153. echo "1113600 1350 1350" > $vdd_levels
  154. echo "1152000 1350 1350" > $vdd_levels
  155. echo "1190400 1350 1350" > $vdd_levels
  156. echo "1228800 1350 1350" > $vdd_levels
  157. echo "1267200 1350 1350" > $vdd_levels
  158. echo "Overclocked voltages stablized!"
  159. ;;
  160. 5) rm /system/etc/init.d/74havsvoltages
  161. echo "Voltages reset to kernel default!"
  162. echo "You must reboot to see changes!"
  163. echo
  164. echo "Choices: 1) Yes 2) No"
  165. echo -n "Do you want to reboot? "
  166. read option
  167. case $option in
  168. 1) reboot
  169. ;;
  170. 2) echo
  171. esac
  172. ;;
  173. 6) if [ -e /system/etc/init.d/74havsvoltages ]; then
  174. echo
  175. cat /system/etc/init.d/74havsvoltages
  176. echo
  177. else
  178. echo "no init.d file detected"
  179. echo "viperMOD is not activated"
  180. fi
  181. ;;
  182. 7) echo
  183. echo " Current Bugs"
  184. echo
  185. echo "-Custom voltages not yet supported"
  186. echo
  187. echo "-Did you find a bug? Please post in the respective"
  188. echo " XDA thread or email me at viperboy@tiamat-aosp.com"
  189. ;;
  190. 8) echo
  191. echo "This is a pretty self-explainatory script. Please"
  192. echo "just remember this is in BETA. There will be"
  193. echo "multiple RCs before a final release. Stay up to"
  194. echo "date by checking bit.ly/viperboy"
  195. ;;
  196. 9) if [ -e /system/etc/init.d/74havsvoltages ]; then
  197. rm -f /system/etc/init.d/74havsvoltages
  198. fi
  199. awk 'BEGIN {print "#!/system/bin/sh\n#created by -viperboy-\n"} { split ($1,first,":"); print "echo","\"" first[1],$2,$3"\"","> /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels_havs"}' /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels_havs >> /system/etc/init.d/74havsvoltages
  200. chmod 0777 /system/etc/init.d/74havsvoltages
  201. echo
  202. echo "init.d file created!"
  203. ;;
  204. *) busybox mount -o remount,ro /system
  205. echo "-----------------------"
  206. echo "Done!"
  207. echo
  208. echo "Any problem/suggestions/comments, please email me at"
  209. echo " viperboy@tiamat-aosp.com"
  210. exit
  211. ;;
  212. esac
  213.  
  214. echo
  215. echo "Press Enter to go back to the main menu..."
  216. read key
  217. done
  218. elif [ -e /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels ]
  219. then
  220. while [ 1 ]; do
  221. vdd_levels=/sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
  222. echo " -This is an SVS kernel-"
  223. echo
  224. echo
  225. echo "1) Read current voltages"
  226. echo "2) Lower voltages"
  227. echo "3) Raise voltages"
  228. echo "4) Reset voltages to kernel default (Requires reboot)"
  229. echo "5) Read init.d voltage file"
  230. echo "6) Current bugs"
  231. echo "7) Help"
  232. echo "8) Save changes"
  233. echo
  234. echo -n "Please choose an option, Enter to exit: "
  235. read option
  236. case $option in
  237. 1) cat $vdd_levels
  238. ;;
  239. 2) echo
  240. echo "1) Lower voltages by 25mv"
  241. echo "2) Lower voltages by 50mv"
  242. echo "3) Lower voltages by 75mv"
  243. echo "4) Lower voltages by 100mv"
  244. echo
  245. echo "5) Custom voltages"
  246. echo
  247. echo -n "Please choose an option: "
  248. read option
  249. case $option in
  250. 1) echo "-25" > $vdd_levels
  251. echo "Voltages lowered by 25mv!"
  252. ;;
  253. 2) echo "-50" > $vdd_levels
  254. echo "Voltages lowered by 50mv!"
  255. ;;
  256. 3) echo "-75" > $vdd_levels
  257. echo "Voltages lowered by 75mv!"
  258. ;;
  259. 4) echo "-100" > $vdd_levels
  260. echo "Voltages lowered by 100mv!"
  261. ;;
  262. 5) echo "Coming soon!"
  263. ;;
  264. esac
  265. ;;
  266. 3) echo
  267. echo "1) Raise voltages by 25mv"
  268. echo "2) Raise voltages by 50mv"
  269. echo "3) Raise voltages by 75mv"
  270. echo
  271. echo -n "Please choose an option: "
  272. read option
  273. case $option in
  274. 1) echo "+25" > $vdd_levels
  275. echo "Voltages raised by 25mv!"
  276. ;;
  277. 2) echo "+50" > $vdd_levels
  278. echo "Voltages raised by 50mv!"
  279. ;;
  280. 3) echo "+75" > $vdd_levels
  281. echo "Voltages raised by 75mv!"
  282. ;;
  283. esac
  284. ;;
  285. 4) rm /system/etc/init.d/74havsvoltages
  286. echo "Voltages reset to kernel default!"
  287. echo "You must reboot to see changes!"
  288. echo
  289. echo "Choices: 1) Yes 2) No"
  290. echo -n "Do you want to reboot? "
  291. read option
  292. case $option in
  293. 1) reboot
  294. ;;
  295. 2) echo
  296. esac
  297. ;;
  298. 5) if [ -e /system/etc/init.d/74havsvoltages ]; then
  299. echo
  300. cat /system/etc/init.d/74havsvoltages
  301. echo
  302. else
  303. echo "no init.d file detected"
  304. echo "viperMOD is not activated"
  305. fi
  306. ;;
  307. 6) echo
  308. echo " Current Bugs"
  309. echo
  310. echo "-Custom voltages not yet supported"
  311. echo
  312. echo "-Did you find a bug? Please post in the respective"
  313. echo " XDA thread or email me at viperboy@tiamat-aosp.com"
  314. ;;
  315. 7) echo
  316. echo "This is a pretty self-explainatory script. Please"
  317. echo "just remember this is in BETA. There will be"
  318. echo "multiple RCs before a final release. Stay up to"
  319. echo "date by checking bit.ly/viperboy"
  320. ;;
  321. 8) if [ -e /system/etc/init.d/74havsvoltages ]; then
  322. rm -f /system/etc/init.d/74havsvoltages
  323. fi
  324. awk 'BEGIN {print "#!/system/bin/sh\n#created by -viperboy-\n"} { split ($1,first,":"); print "echo","\"" first[1],$2"\"","> /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels"}' /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels >> /system/etc/init.d/74havsvoltages
  325. chmod 0777 /system/etc/init.d/74havsvoltages
  326. echo
  327. echo "init.d file created!"
  328. ;;
  329. *) busybox mount -o remount,ro /system
  330. echo "-----------------------"
  331. echo "Done!"
  332. echo
  333. echo "Any problem/suggestions/comments, please email me at"
  334. echo " viperboy@tiamat-aosp.com"
  335. exit
  336. ;;
  337. esac
  338.  
  339. echo
  340. echo "Press Enter to go back to the main menu..."
  341. read key
  342. done
  343. else
  344. echo "This is an incompatible kernel!"
  345. echo
  346. echo "Please flash a compatible kernel that supports the"
  347. echo "sysfs interface. See bit.ly/viperboy for more info."
  348. exit
  349. fi
  350. }
  351.  
  352. 2ndgensnapdragon ()
  353. { if [ -e /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels_havs ]
  354. then
  355. while [ 1 ]; do
  356. vdd_levels=/sys/devices/system/cpu/cpu0/cpufreq/vdd_levels_havs
  357. echo " -This is a HAVS kernel-"
  358. echo
  359. echo
  360. echo "1) Read current voltages"
  361. echo "2) Lower voltages"
  362. echo "3) Raise voltages"
  363. echo "4) Reset voltages to kernel default (Requires reboot)"
  364. echo "5) Read init.d voltage file"
  365. echo "6) Current bugs"
  366. echo "7) Help"
  367. echo "8) Save changes"
  368. echo
  369. echo -n "Please choose an option, Enter to exit: "
  370. read option
  371. case $option in
  372. 1) cat $vdd_levels
  373. ;;
  374. 2) echo
  375. echo "1) Lower all voltages by 25mv"
  376. echo "2) Lower all voltages by 50mv"
  377. echo "3) Lower all voltages by 75mv"
  378. echo "4) Lower all voltages by 100mv"
  379. echo
  380. echo "5) Set MIN voltages"
  381. echo "6) Lower MAX voltages by 25mv"
  382. echo
  383. echo "7) Custom voltages"
  384. echo
  385. echo -n "Please choose an option: "
  386. read option
  387. case $option in
  388. 1) echo "-25" "-25" > $vdd_levels
  389. echo "Voltages lowered by 25mv!"
  390. ;;
  391. 2) echo "-50" "-50" > $vdd_levels
  392. echo "Voltages lowered by 50mv!"
  393. ;;
  394. 3) echo "-75" "-75" > $vdd_levels
  395. echo "Voltages lowered by 75mv!"
  396. ;;
  397. 4) echo "-100" "-100" > $vdd_levels
  398. echo "Voltages lowered by 100mv!"
  399. ;;
  400. 5) echo "Choices: 1) 800 2) 825 3) 850"
  401. echo -n "Please choose 1, 2, or 3: "
  402. read option
  403. case $option in
  404. 1) echo "-1000" "-0" > $vdd_levels
  405. echo "800mv voltage floor set!"
  406. ;;
  407. 2) echo "-1000" "-0" > $vdd_levels
  408. echo "+25" "-0" > $vdd_levels
  409. echo "825mv voltage floor set!"
  410. ;;
  411. 3) echo "-1000" "-0" > $vdd_levels
  412. echo "+50" "-0" > $vdd_levels
  413. echo "850mv voltage floor set!"
  414. esac
  415. ;;
  416. 6) echo "-0" "-25" > $vdd_levels
  417. echo "MAX voltages lowered by 25mv!"
  418. echo
  419. echo "Issue this command again to lower MAX"
  420. echo "voltages another 25mv"
  421. ;;
  422. 7) echo "Coming soon!"
  423. ;;
  424. esac
  425. ;;
  426. 3) echo
  427. echo "1) Raise all voltages by 25mv"
  428. echo "2) Raise all voltages by 50mv"
  429. echo "3) Raise all voltages by 75mv"
  430. echo
  431. echo "4) Raise MAX voltages by 25mv"
  432. echo
  433. echo -n "Please choose an option: "
  434. read option
  435. case $option in
  436. 1) echo "+25" "+25" > $vdd_levels
  437. echo "Voltages raised by 25mv!"
  438. ;;
  439. 2) echo "+50" "+50" > $vdd_levels
  440. echo "Voltages raised by 50mv!"
  441. ;;
  442. 3) echo "+75" "+75" > $vdd_levels
  443. echo "Voltages raised by 75mv!"
  444. ;;
  445. 4) echo "-0" "+25" > $vdd_levels
  446. echo "MAX voltages raised by 25mv!"
  447. echo
  448. echo "Issue this command again to raise MAX"
  449. echo "voltages another 25mv"
  450. ;;
  451. esac
  452. ;;
  453. 4) rm /system/etc/init.d/74havsvoltages
  454. echo "Voltages reset to kernel default!"
  455. echo "You must reboot to see changes!"
  456. echo
  457. echo "Choices: 1) Yes 2) No"
  458. echo -n "Do you want to reboot? "
  459. read option
  460. case $option in
  461. 1) reboot
  462. ;;
  463. 2) echo
  464. esac
  465. ;;
  466. 5) if [ -e /system/etc/init.d/74havsvoltages ]; then
  467. echo
  468. cat /system/etc/init.d/74havsvoltages
  469. echo
  470. else
  471. echo "no init.d file detected"
  472. echo "viperMOD is not activated"
  473. fi
  474. ;;
  475. 6) echo
  476. echo " Current Bugs"
  477. echo
  478. echo "-Custom voltages not yet supported"
  479. echo
  480. echo "-Did you find a bug? Please post in the respective"
  481. echo " XDA thread or email me at viperboy@tiamat-aosp.com"
  482. ;;
  483. 7) echo
  484. echo "This is a pretty self-explainatory script. Please"
  485. echo "just remember this is in BETA. There will be"
  486. echo "multiple RCs before a final release. Stay up to"
  487. echo "date by checking bit.ly/viperboy"
  488. ;;
  489. 8) if [ -e /system/etc/init.d/74havsvoltages ]; then
  490. rm -f /system/etc/init.d/74havsvoltages
  491. fi
  492. awk 'BEGIN {print "#!/system/bin/sh\n#created by -viperboy-\n"} { split ($1,first,":"); print "echo","\"" first[1],$2,$3"\"","> /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels_havs"}' /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels_havs >> /system/etc/init.d/74havsvoltages
  493. chmod 0777 /system/etc/init.d/74havsvoltages
  494. echo
  495. echo "init.d file created!"
  496. ;;
  497. *) busybox mount -o remount,ro /system
  498. echo "-----------------------"
  499. echo "Done!"
  500. echo
  501. echo "Any problem/suggestions/comments, please email me at"
  502. echo " viperboy@tiamat-aosp.com"
  503. exit
  504. ;;
  505. esac
  506.  
  507. echo
  508. echo "Press Enter to go back to the main menu..."
  509. read key
  510. done
  511. elif [ -e /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels ]
  512. then
  513. while [ 1 ]; do
  514. vdd_levels=/sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
  515. echo " -This is an SVS kernel-"
  516. echo
  517. echo
  518. echo "1) Read current voltages"
  519. echo "2) Lower voltages"
  520. echo "3) Raise voltages"
  521. echo "4) Reset voltages to kernel default (Requires reboot)"
  522. echo "5) Read init.d voltage file"
  523. echo "6) Current bugs"
  524. echo "7) Help"
  525. echo "8) Save changes"
  526. echo
  527. echo -n "Please choose an option, Enter to exit: "
  528. read option
  529. case $option in
  530. 1) cat $vdd_levels
  531. ;;
  532. 2) echo
  533. echo "1) Lower voltages by 25mv"
  534. echo "2) Lower voltages by 50mv"
  535. echo "3) Lower voltages by 75mv"
  536. echo "4) Lower voltages by 100mv"
  537. echo
  538. echo "5) Custom voltages"
  539. echo
  540. echo -n "Please choose an option: "
  541. read option
  542. case $option in
  543. 1) echo "-25" > $vdd_levels
  544. echo "Voltages lowered by 25mv!"
  545. ;;
  546. 2) echo "-50" > $vdd_levels
  547. echo "Voltages lowered by 50mv!"
  548. ;;
  549. 3) echo "-75" > $vdd_levels
  550. echo "Voltages lowered by 75mv!"
  551. ;;
  552. 4) echo "-100" > $vdd_levels
  553. echo "Voltages lowered by 100mv!"
  554. ;;
  555. 5) echo "Coming soon!"
  556. ;;
  557. esac
  558. ;;
  559. 3) echo
  560. echo "1) Raise voltages by 25mv"
  561. echo "2) Raise voltages by 50mv"
  562. echo "3) Raise voltages by 75mv"
  563. echo
  564. echo -n "Please choose an option: "
  565. read option
  566. case $option in
  567. 1) echo "+25" > $vdd_levels
  568. echo "Voltages raised by 25mv!"
  569. ;;
  570. 2) echo "+50" > $vdd_levels
  571. echo "Voltages raised by 50mv!"
  572. ;;
  573. 3) echo "+75" > $vdd_levels
  574. echo "Voltages raised by 75mv!"
  575. ;;
  576. esac
  577. ;;
  578. 4) rm /system/etc/init.d/74havsvoltages
  579. echo "Voltages reset to kernel default!"
  580. echo "You must reboot to see changes!"
  581. echo
  582. echo "Choices: 1) Yes 2) No"
  583. echo -n "Do you want to reboot? "
  584. read option
  585. case $option in
  586. 1) reboot
  587. ;;
  588. 2) echo
  589. esac
  590. ;;
  591. 5) if [ -e /system/etc/init.d/74havsvoltages ]; then
  592. echo
  593. cat /system/etc/init.d/74havsvoltages
  594. echo
  595. else
  596. echo "no init.d file detected"
  597. echo "viperMOD is not activated"
  598. fi
  599. ;;
  600. 6) echo
  601. echo " Current Bugs"
  602. echo
  603. echo "-Custom voltages not yet supported"
  604. echo
  605. echo "-Did you find a bug? Please post in the respective"
  606. echo " XDA thread or email me at viperboy@tiamat-aosp.com"
  607. ;;
  608. 7) echo
  609. echo "This is a pretty self-explainatory script. Please"
  610. echo "just remember this is in BETA. There will be"
  611. echo "multiple RCs before a final release. Stay up to"
  612. echo "date by checking bit.ly/viperboy"
  613. ;;
  614. 8) if [ -e /system/etc/init.d/74havsvoltages ]; then
  615. rm -f /system/etc/init.d/74havsvoltages
  616. fi
  617. awk 'BEGIN {print "#!/system/bin/sh\n#created by -viperboy-\n"} { split ($1,first,":"); print "echo","\"" first[1],$2"\"","> /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels"}' /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels >> /system/etc/init.d/74havsvoltages
  618. chmod 0777 /system/etc/init.d/74havsvoltages
  619. echo
  620. echo "init.d file created!"
  621. ;;
  622. *) busybox mount -o remount,ro /system
  623. echo "-----------------------"
  624. echo "Done!"
  625. echo
  626. echo "Any problem/suggestions/comments, please email me at"
  627. echo " viperboy@tiamat-aosp.com"
  628. exit
  629. ;;
  630. esac
  631.  
  632. echo
  633. echo "Press Enter to go back to the main menu..."
  634. read key
  635. done
  636. else
  637. echo "This is an incompatible kernel!"
  638. echo
  639. echo "Please flash a compatible kernel that supports the"
  640. echo "sysfs interface. See bit.ly/viperboy for more info."
  641. exit
  642. fi
  643. }
  644.  
  645. hummingbird ()
  646. { if [ -e /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table ]
  647. then
  648. while [ 1 ]; do
  649. vdd_levels=/sys/devices/system/cpu/cpu0/cpufreq/vdd_levels_havs
  650. echo " -This is a Netarchy kernel-"
  651. echo
  652. echo
  653. echo "1) Read current voltages"
  654. echo "2) Lower voltages"
  655. echo "3) Current bugs"
  656. echo "4) Help"
  657. echo
  658. echo -n "Please choose an option, Enter to exit: "
  659. read option
  660. case $option in
  661. 1) cat $vdd_levels
  662. ;;
  663. 2) echo
  664. echo "1) Lower all voltages by 5mv"
  665. echo "2) Lower all voltages by 10mv"
  666. echo "3) Lower all voltages by 15mv"
  667. echo "4) Lower all voltages by 20mv"
  668. echo "5) Lower all voltages by 25mv"
  669. echo "6) Lower all voltages by 30mv"
  670. echo "7) Lower all voltages by 35mv"
  671. echo "8) Lower all voltages by 40mv"
  672. echo "9) Lower all voltages by 45mv"
  673. echo "10) Lower all voltages by 50mv"
  674. echo
  675. echo -n "Please choose an option: "
  676. read option
  677. case $option in
  678. 1) if [ -e /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table ]; then
  679. echo "1445 1395 1345 1245 1195 1045 945 945" > $vdd_levels
  680. echo
  681. echo "Voltages lowered by 5mv!"
  682. else
  683. echo "Only for Netarchy Nexus kernels!"
  684. fi
  685. ;;
  686. 2) if [ -e /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table ]; then
  687. echo "1440 1390 1340 1240 1190 1040 940 940" > $vdd_levels
  688. echo
  689. echo "Voltages lowered by 10mv!"
  690. else
  691. echo "Only for Netarchy Nexus kernels!"
  692. fi
  693. ;;
  694. 3) if [ -e /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table ]; then
  695. echo "1435 1385 1335 1235 1185 1035 935 935" > $vdd_levels
  696. echo
  697. echo "Voltages lowered by 15mv!"
  698. else
  699. echo "Only for Netarchy Nexus kernels!"
  700. fi
  701. ;;
  702. 4) if [ -e /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table ]; then
  703. echo "1430 1380 1330 1230 1180 1030 930 930" > $vdd_levels
  704. echo
  705. echo "Voltages lowered by 20mv!"
  706. else
  707. echo "Only for Netarchy Nexus kernels!"
  708. fi
  709. ;;
  710. 5) if [ -e /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table ]; then
  711. echo "1425 1375 1325 1225 1175 1025 925 925" > $vdd_levels
  712. echo
  713. echo "Voltages lowered by 25mv!"
  714. else
  715. echo "Only for Netarchy Nexus kernels!"
  716. fi
  717. ;;
  718. 6) if [ -e /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table ]; then
  719. echo "1420 1370 1320 1220 1170 1020 920 920" > $vdd_levels
  720. echo
  721. echo "Voltages lowered by 30mv!"
  722. else
  723. echo "Only for Netarchy Nexus kernels!"
  724. fi
  725. ;;
  726. 7) if [ -e /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table ]; then
  727. echo "1415 1365 1315 1215 1165 1015 915 915" > $vdd_levels
  728. echo
  729. echo "Voltages lowered by 35mv!"
  730. else
  731. echo "Only for Netarchy Nexus kernels!"
  732. fi
  733. ;;
  734. 8) if [ -e /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table ]; then
  735. echo "1410 1360 1310 1210 1160 1010 910 910" > $vdd_levels
  736. echo
  737. echo "Voltages lowered by 40mv!"
  738. else
  739. echo "Only for Netarchy Nexus kernels!"
  740. fi
  741. ;;
  742. 9) if [ -e /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table ]; then
  743. echo "1405 1355 1305 1205 1155 1005 905 905" > $vdd_levels
  744. echo
  745. echo "Voltages lowered by 45mv!"
  746. else
  747. echo "Only for Netarchy Nexus kernels!"
  748. fi
  749. ;;
  750. 10) if [ -e /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table ]; then
  751. echo "1400 1350 1300 1250 1150 1000 900 900" > $vdd_levels
  752. echo
  753. echo "Voltages lowered by 50mv!"
  754. else
  755. echo "Only for Netarchy Nexus kernels!"
  756. fi
  757. ;;
  758. esac
  759. ;;
  760. 3) echo
  761. echo " Current Bugs"
  762. echo
  763. echo "-Custom voltages not yet supported"
  764. echo
  765. echo "-Cannot save Netarchy voltages"
  766. echo " I need to still code this in. If you reboot"
  767. echo " your phone, you will need to reapply the"
  768. echo " undervolt. This will be fixed shortly"
  769. echo
  770. echo "-Did you find a bug? Please post in the respective"
  771. echo " XDA thread or email me at viperboy@tiamat-aosp.com"
  772. ;;
  773. 4) echo
  774. echo "This is a pretty self-explainatory script. Please"
  775. echo "just remember this is in BETA. There will be"
  776. echo "multiple RCs before a final release. Stay up to"
  777. echo "date by checking bit.ly/viperboy"
  778. ;;
  779. *) busybox mount -o remount,ro /system
  780. echo "-----------------------"
  781. echo "Done!"
  782. echo
  783. echo "Any problem/suggestions/comments, please email me at"
  784. echo " viperboy@tiamat-aosp.com"
  785. exit
  786. ;;
  787. esac
  788.  
  789. echo
  790. echo "Press Enter to go back to the main menu..."
  791. read key
  792. done
  793. else
  794. echo "This is an incompatible kernel!"
  795. echo
  796. echo "Please flash a compatible kernel that supports the"
  797. echo "sysfs interface. See bit.ly/viperboy for more info."
  798. exit
  799. fi
  800. }
  801.  
  802. echo " _ __ __ ___ ____ "
  803. echo " __ __(_)_ __ ___ _ __| \/ |/ _ \| _ \ "
  804. echo " \ \ / /| | '_ \ / _ \ '__| |\/| | | | | | | |"
  805. echo " \ \ / | | |_) | __/ | | | | | |_| | |_| |"
  806. echo " \_/ |_| .__/ \___|_| |_| |_|\___/|____/ "
  807. echo " |_| "
  808. echo " v3 beta RC2"
  809. echo "-----------------------------------------------------"
  810. case $devicecheck in
  811. supersonic)
  812. echo "Device: HTC EVO"
  813. echo -n "Processor: "; processorcheck
  814. echo "Current Kernel: "$kernelcheck
  815. 1stgensnapdragon
  816. ;;
  817. inc)
  818. echo "Device: HTC Incredible"
  819. echo -n "Processor: "; processorcheck
  820. echo "Current Kernel: "$kernelcheck
  821. 1stgensnapdragon
  822. ;;
  823. passion)
  824. echo "Device: Nexus One"
  825. echo -n "Processor: "; processorcheck
  826. echo "Current Kernel: "$kernelcheck
  827. 1stgensnapdragon
  828. ;;
  829. bravo)
  830. echo "Device: HTC Desire GSM"
  831. echo -n "Processor: "; processorcheck
  832. echo "Current Kernel: "$kernelcheck
  833. 1stgensnapdragon
  834. ;;
  835. mecha)
  836. echo "Device: HTC Thunderbolt"
  837. echo -n "Processor: "; processorcheck
  838. echo "Current Kernel: "$kernelcheck
  839. 2ndgensnapdragon
  840. ;;
  841. crespo)
  842. echo "Device: Samsung Nexus S"
  843. echo -n "Processor: "; processorcheck
  844. echo "Current Kernel: "$kernelcheck
  845. hummingbird
  846. ;;
  847. crespo4g)
  848. echo "Device: Samsung Nexus S 4G"
  849. echo -n "Processor: "; processorcheck
  850. echo "Current Kernel: "$kernelcheck
  851. hummingbird
  852. ;;
  853. *)
  854. echo $devicecheck
  855. echo "Not an officially supported device. Be aware"
  856. ;;
  857. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement