add recovery.log reporting

This commit is contained in:
Koushik Dutta 2010-06-20 13:16:06 -07:00
parent 598cfc7e9d
commit a6522b3584
5 changed files with 53 additions and 46 deletions

View File

@ -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)

View File

@ -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.");
}

View File

@ -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;

40
roots.c
View File

@ -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 },

40
roots.h
View File

@ -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".
*/