From a6522b3584d792a1c3e6ddab7c8f9d0eb03e9f15 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Sun, 20 Jun 2010 13:16:06 -0700 Subject: [PATCH] add recovery.log reporting --- Android.mk | 2 +- extendedcommands.c | 15 +++++++++++---- recovery.c | 2 +- roots.c | 40 ---------------------------------------- roots.h | 40 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 53 insertions(+), 46 deletions(-) diff --git a/Android.mk b/Android.mk index 6903494..42b36b4 100644 --- a/Android.mk +++ b/Android.mk @@ -26,7 +26,7 @@ LOCAL_MODULE := recovery LOCAL_FORCE_STATIC_EXECUTABLE := true -RECOVERY_VERSION := ClockworkMod Recovery v2.0.0.6 +RECOVERY_VERSION := ClockworkMod Recovery v2.0.0.7 LOCAL_CFLAGS := -DRECOVERY_VERSION="$(RECOVERY_VERSION)" RECOVERY_API_VERSION := 2 LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION) diff --git a/extendedcommands.c b/extendedcommands.c index ff6bb88..3bd5721 100644 --- a/extendedcommands.c +++ b/extendedcommands.c @@ -797,8 +797,10 @@ void show_advanced_menu() void write_fstab_root(char *root_path, FILE *file) { RootInfo *info = get_root_info_for_path(root_path); - if (info == NULL) + if (info == NULL) { + LOGW("Unable to get root info for %s during fstab generation!", root_path); return; + } MtdPartition *mtd = get_root_mtd_partition(root_path); if (mtd != NULL) { @@ -816,10 +818,15 @@ void write_fstab_root(char *root_path, FILE *file) void create_fstab() { FILE *file = fopen("/etc/fstab", "w"); - if (file == NULL) + if (file == NULL) { + LOGW("Unable to create /etc/fstab!"); return; + } write_fstab_root("CACHE:", file); write_fstab_root("DATA:", file); +#ifdef HAS_DATADATA + write_fstab_root("DATADATA:", file); +#endif write_fstab_root("SYSTEM:", file); write_fstab_root("SDCARD:", file); write_fstab_root("SDEXT:", file); @@ -832,7 +839,7 @@ void handle_failure(int ret) return; if (0 != ensure_root_path_mounted("SDCARD:")) return; - mkdir("/sdcard/clockworkmod"); - copyfile("/tmp/recovery.log", "/sdcard/clockworkmod/recovery.log"); + mkdir("/sdcard/clockworkmod", S_IRWXU); + __system("cp /tmp/recovery.log /sdcard/clockworkmod/recovery.log"); ui_print("/tmp/recovery.log was copied to /sdcard/clockworkmod/recovery.log. Please open ROM Manager to report the issue."); } \ No newline at end of file diff --git a/recovery.c b/recovery.c index cf8560d..31d41f1 100644 --- a/recovery.c +++ b/recovery.c @@ -494,7 +494,7 @@ main(int argc, char **argv) return amend_main(argc, argv); return busybox_driver(argc, argv); } - //create_fstab(); + create_fstab(); __system("/sbin/postrecoveryboot.sh"); int is_user_initiated_recovery = 0; diff --git a/roots.c b/roots.c index 4450c1e..535a1a7 100644 --- a/roots.c +++ b/roots.c @@ -36,46 +36,6 @@ static const char g_mtd_device[] = "@\0g_mtd_device"; static const char g_raw[] = "@\0g_raw"; static const char g_package_file[] = "@\0g_package_file"; -#ifndef SDCARD_DEVICE_PRIMARY -#define SDCARD_DEVICE_PRIMARY "/dev/block/mmcblk0" -#endif - -#ifndef SDCARD_DEVICE_SECONDARY -#define SDCARD_DEVICE_SECONDARY "/dev/block/mmcblk0p1" -#endif - -#ifndef SDEXT_DEVICE -#define SDEXT_DEVICE "/dev/block/mmcblk0p2" -#endif - -#ifndef SDEXT_FILESYSTEM -#define SDEXT_FILESYSTEM "ext4" -#endif - -#ifndef DATA_DEVICE -#define DATA_DEVICE g_mtd_device -#endif - -#ifndef DATA_FILESYSTEM -#define DATA_FILESYSTEM "yaffs2" -#endif - -#ifndef DATADATA_DEVICE -#define DATADATA_DEVICE g_mtd_device -#endif - -#ifndef DATADATA_FILESYSTEM -#define DATADATA_FILESYSTEM "yaffs2" -#endif - -#ifndef CACHE_DEVICE -#define CACHE_DEVICE g_mtd_device -#endif - -#ifndef CACHE_FILESYSTEM -#define CACHE_FILESYSTEM "yaffs2" -#endif - static RootInfo g_roots[] = { { "BOOT:", g_mtd_device, NULL, "boot", NULL, g_raw }, { "CACHE:", CACHE_DEVICE, NULL, "cache", "/cache", CACHE_FILESYSTEM }, diff --git a/roots.h b/roots.h index 7b15ed1..40aef87 100644 --- a/roots.h +++ b/roots.h @@ -20,6 +20,46 @@ #include "minzip/Zip.h" #include "mtdutils/mtdutils.h" +#ifndef SDCARD_DEVICE_PRIMARY +#define SDCARD_DEVICE_PRIMARY "/dev/block/mmcblk0" +#endif + +#ifndef SDCARD_DEVICE_SECONDARY +#define SDCARD_DEVICE_SECONDARY "/dev/block/mmcblk0p1" +#endif + +#ifndef SDEXT_DEVICE +#define SDEXT_DEVICE "/dev/block/mmcblk0p2" +#endif + +#ifndef SDEXT_FILESYSTEM +#define SDEXT_FILESYSTEM "ext4" +#endif + +#ifndef DATA_DEVICE +#define DATA_DEVICE g_mtd_device +#endif + +#ifndef DATA_FILESYSTEM +#define DATA_FILESYSTEM "yaffs2" +#endif + +#ifndef DATADATA_DEVICE +#define DATADATA_DEVICE g_mtd_device +#endif + +#ifndef DATADATA_FILESYSTEM +#define DATADATA_FILESYSTEM "yaffs2" +#endif + +#ifndef CACHE_DEVICE +#define CACHE_DEVICE g_mtd_device +#endif + +#ifndef CACHE_FILESYSTEM +#define CACHE_FILESYSTEM "yaffs2" +#endif + /* Any of the "root_path" arguments can be paths with relative * components, like "SYSTEM:a/b/c". */