Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 2dfa8db0a4983871684b92d37ad09e2f8074ee8e Mon Sep 17 00:00:00 2001
- From: Ajay Ramaswamy <ajay@ramaswamy.net>
- Date: Sun, 26 Aug 2012 09:12:44 +0530
- Subject: [PATCH] Nook-Tablet hacks
- Change-Id: I5c657e5768b4b6bdd8c88fb28d4f874b0e7be448
- ---
- default_recovery_ui.c | 1 +
- etc/init.rc | 6 ++++++
- recovery.c | 15 +++++++++++++++
- 3 files changed, 22 insertions(+)
- diff --git a/default_recovery_ui.c b/default_recovery_ui.c
- index be8b7e8..0e3f9c0 100644
- --- a/default_recovery_ui.c
- +++ b/default_recovery_ui.c
- @@ -29,6 +29,7 @@ char* MENU_ITEMS[] = { "reboot system now",
- "backup and restore",
- "mounts and storage",
- "advanced",
- + "power off",
- NULL };
- void device_ui_init(UIParameters* ui_parameters) {
- diff --git a/etc/init.rc b/etc/init.rc
- index 832b864..54268b8 100644
- --- a/etc/init.rc
- +++ b/etc/init.rc
- @@ -25,6 +25,12 @@ on boot
- hostname localhost
- domainname localdomain
- + # reduce backlight usage in recovery
- + write /sys/class/leds/lcd-backlight/brightness 50
- +
- + # compatibility w/ 2.6 kernels
- + symlink /dev/block/platform/omap/omap_hsmmc.1 /dev/block/platform/mmci-omap-hs.1
- +
- class_start default
- service ueventd /sbin/ueventd
- diff --git a/recovery.c b/recovery.c
- index ac140e9..9f1180f 100644
- --- a/recovery.c
- +++ b/recovery.c
- @@ -629,6 +629,10 @@ update_directory(const char* path, const char* unmount_when_done) {
- static void
- wipe_data(int confirm) {
- + struct stat info;
- + if (0 == stat("/sdcard/clockworkmod/.no_confirm", &info))
- + return 1;
- +
- if (confirm) {
- static char** title_headers = NULL;
- @@ -639,7 +643,17 @@ wipe_data(int confirm) {
- NULL };
- title_headers = prepend_title((const char**)headers);
- }
- + if (0 == stat("/sdcard/clockworkmod/.one_confirm", &info)) {
- + char* items[] = { " No",
- + " Yes -- delete all user data", // [1]
- + NULL };
- + int chosen_item = get_menu_selection(title_headers, items, 1, 0);
- + if (chosen_item != 1) {
- + return;
- + }
- + }
- + else {
- char* items[] = { " No",
- " No",
- " No",
- @@ -657,6 +671,7 @@ wipe_data(int confirm) {
- if (chosen_item != 7) {
- return;
- }
- + }
- }
- ui_print("\n-- Wiping data...\n");
- --
- 1.7.11.4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement