Advertisement
Guest User

Untitled

a guest
Sep 1st, 2012
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. From 2dfa8db0a4983871684b92d37ad09e2f8074ee8e Mon Sep 17 00:00:00 2001
  2. From: Ajay Ramaswamy <ajay@ramaswamy.net>
  3. Date: Sun, 26 Aug 2012 09:12:44 +0530
  4. Subject: [PATCH] Nook-Tablet hacks
  5.  
  6. Change-Id: I5c657e5768b4b6bdd8c88fb28d4f874b0e7be448
  7. ---
  8. default_recovery_ui.c | 1 +
  9. etc/init.rc | 6 ++++++
  10. recovery.c | 15 +++++++++++++++
  11. 3 files changed, 22 insertions(+)
  12.  
  13. diff --git a/default_recovery_ui.c b/default_recovery_ui.c
  14. index be8b7e8..0e3f9c0 100644
  15. --- a/default_recovery_ui.c
  16. +++ b/default_recovery_ui.c
  17. @@ -29,6 +29,7 @@ char* MENU_ITEMS[] = { "reboot system now",
  18. "backup and restore",
  19. "mounts and storage",
  20. "advanced",
  21. + "power off",
  22. NULL };
  23.  
  24. void device_ui_init(UIParameters* ui_parameters) {
  25. diff --git a/etc/init.rc b/etc/init.rc
  26. index 832b864..54268b8 100644
  27. --- a/etc/init.rc
  28. +++ b/etc/init.rc
  29. @@ -25,6 +25,12 @@ on boot
  30. hostname localhost
  31. domainname localdomain
  32.  
  33. + # reduce backlight usage in recovery
  34. + write /sys/class/leds/lcd-backlight/brightness 50
  35. +
  36. + # compatibility w/ 2.6 kernels
  37. + symlink /dev/block/platform/omap/omap_hsmmc.1 /dev/block/platform/mmci-omap-hs.1
  38. +
  39. class_start default
  40.  
  41. service ueventd /sbin/ueventd
  42. diff --git a/recovery.c b/recovery.c
  43. index ac140e9..9f1180f 100644
  44. --- a/recovery.c
  45. +++ b/recovery.c
  46. @@ -629,6 +629,10 @@ update_directory(const char* path, const char* unmount_when_done) {
  47.  
  48. static void
  49. wipe_data(int confirm) {
  50. + struct stat info;
  51. + if (0 == stat("/sdcard/clockworkmod/.no_confirm", &info))
  52. + return 1;
  53. +
  54. if (confirm) {
  55. static char** title_headers = NULL;
  56.  
  57. @@ -639,7 +643,17 @@ wipe_data(int confirm) {
  58. NULL };
  59. title_headers = prepend_title((const char**)headers);
  60. }
  61. + if (0 == stat("/sdcard/clockworkmod/.one_confirm", &info)) {
  62. + char* items[] = { " No",
  63. + " Yes -- delete all user data", // [1]
  64. + NULL };
  65.  
  66. + int chosen_item = get_menu_selection(title_headers, items, 1, 0);
  67. + if (chosen_item != 1) {
  68. + return;
  69. + }
  70. + }
  71. + else {
  72. char* items[] = { " No",
  73. " No",
  74. " No",
  75. @@ -657,6 +671,7 @@ wipe_data(int confirm) {
  76. if (chosen_item != 7) {
  77. return;
  78. }
  79. + }
  80. }
  81.  
  82. ui_print("\n-- Wiping data...\n");
  83. --
  84. 1.7.11.4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement