From f8b21c2b4d44680a4d7e013d6459e0ad8ee987df Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Mon, 14 Jun 2010 12:49:47 -0700 Subject: [PATCH] hacking away --- Android.mk | 16 +++++++++++++++- mkfstab.sh | 10 ++++++++-- recovery.c | 5 +++++ roots.c | 36 ++++++++++++++++++++++++++++++------ 4 files changed, 58 insertions(+), 9 deletions(-) diff --git a/Android.mk b/Android.mk index b05476a..cab7032 100644 --- a/Android.mk +++ b/Android.mk @@ -26,7 +26,7 @@ LOCAL_MODULE := recovery LOCAL_FORCE_STATIC_EXECUTABLE := true -RECOVERY_VERSION := ClockworkMod Recovery v1.8.1.9 +RECOVERY_VERSION := ClockworkMod Recovery v1.8.2.5 LOCAL_CFLAGS := -DRECOVERY_VERSION="$(RECOVERY_VERSION)" RECOVERY_API_VERSION := 2 LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION) @@ -35,10 +35,24 @@ ifeq ($(BOARD_HAS_NO_SELECT_BUTTON),true) LOCAL_CFLAGS += -DKEY_POWER_IS_SELECT_ITEM endif +# This file system specific stuff is in need of some serious cleaning up... + +ifeq ($BOARD_SDCARD_MMCBLK1,true) + LOCAL_CFLAGS += -DSDCARD_MMCBLK1 +endif + ifeq ($(BOARD_SD_EXT3),true) LOCAL_CFLAGS += -DSD_EXT3 endif +ifeq ($(BOARD_USERDATA_EXT3),true) + LOCAL_CFLAGS += -DUSERDATA_EXT3 +endif + +ifeq ($(BOARD_CACHE_EXT3),true) + LOCAL_CFLAGS += -DCACHE_EXT3 +endif + # This binary is in the recovery ramdisk, which is otherwise a copy of root. # It gets copied there in config/Makefile. LOCAL_MODULE_TAGS suppresses # a (redundant) copy of the binary in /system/bin for user builds. diff --git a/mkfstab.sh b/mkfstab.sh index a1ab0dd..80505dc 100755 --- a/mkfstab.sh +++ b/mkfstab.sh @@ -31,5 +31,11 @@ do echo "/dev/block/mtdblock$mtd /$mount $type rw" >> /etc/fstab done -echo "/dev/block/mmcblk0p1" /sdcard vfat rw >> /etc/fstab -echo "/dev/block/mmcblk0p2" /sd-ext auto rw >> /etc/fstab +if [ ! -z $SDCARD_MMCBLK1 ] +then + echo "/dev/block/mmcblk1p1" /sdcard vfat rw >> /etc/fstab + echo "/dev/block/mmcblk1p2" /sd-ext auto rw >> /etc/fstab +else + echo "/dev/block/mmcblk0p1" /sdcard vfat rw >> /etc/fstab + echo "/dev/block/mmcblk0p2" /sd-ext auto rw >> /etc/fstab +fi \ No newline at end of file diff --git a/recovery.c b/recovery.c index 9be9758..4195726 100644 --- a/recovery.c +++ b/recovery.c @@ -491,7 +491,12 @@ main(int argc, char **argv) return amend_main(argc, argv); return busybox_driver(argc, argv); } +#ifdef SDCARD_MMCBLK1 + __system("SDCARD_MMCBLK1=true /sbin/mkfstab.sh"); +#else __system("/sbin/mkfstab.sh"); +#endif + __system("/sbin/postrecoveryboot.sh"); int is_user_initiated_recovery = 0; time_t start = time(NULL); diff --git a/roots.c b/roots.c index a63e6e4..32ecc5c 100644 --- a/roots.c +++ b/roots.c @@ -45,6 +45,34 @@ 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"; +#ifdef SDCARD_MMCBLK1 +#define SDCARD_MMCBLK_SECONDARY "/dev/block/mmcblk1" +#define SDCARD_MMCBLK_PRIMARY "/dev/block/mmcblk1p1" +#define SDEXT "/dev/block/mmcblk1p2" +#else +#define SDCARD_MMCBLK_SECONDARY "/dev/block/mmcblk0" +#define SDCARD_MMCBLK_PRIMARY "/dev/block/mmcblk0p1" +#define SDEXT "/dev/block/mmcblk0p2" +#endif + +#ifdef SD_EXT3 +#define SD_EXT_FILE_SYSTEM "ext3" +#else +#define SD_EXT_FILE_SYSTEM "ext4" +#endif + +#ifdef USERDATA_EXT3 +#define SD_EXT_FILE_SYSTEM "ext3" +#else +#define SD_EXT_FILE_SYSTEM "ext4" +#endif + +#ifdef CACHE_EXT3 +#define SD_EXT_FILE_SYSTEM "ext3" +#else +#define SD_EXT_FILE_SYSTEM "ext4" +#endif + static RootInfo g_roots[] = { { "BOOT:", g_mtd_device, NULL, "boot", NULL, g_raw }, { "CACHE:", g_mtd_device, NULL, "cache", "/cache", "yaffs2" }, @@ -52,12 +80,8 @@ static RootInfo g_roots[] = { { "MISC:", g_mtd_device, NULL, "misc", NULL, g_raw }, { "PACKAGE:", NULL, NULL, NULL, NULL, g_package_file }, { "RECOVERY:", g_mtd_device, NULL, "recovery", "/", g_raw }, - { "SDCARD:", "/dev/block/mmcblk0p1", "/dev/block/mmcblk0", NULL, "/sdcard", "vfat" }, -#ifndef SD_EXT3 - { "SDEXT:", "/dev/block/mmcblk0p2", NULL, NULL, "/sd-ext", "ext4" }, -#else - { "SDEXT:", "/dev/block/mmcblk0p2", NULL, NULL, "/sd-ext", "ext3" }, -#endif + { "SDCARD:", SDCARD_MMCBLK_PRIMARY, SDCARD_MMCBLK_SECONDARY, NULL, "/sdcard", "vfat" }, + { "SDEXT:", SDEXT, NULL, NULL, "/sd-ext", SD_EXT_FILE_SYSTEM }, { "SYSTEM:", g_mtd_device, NULL, "system", "/system", "yaffs2" }, { "MBM:", g_mtd_device, NULL, "mbm", NULL, g_raw }, { "TMP:", NULL, NULL, NULL, "/tmp", NULL },