From 1a7ee5384de65fcb642f6c04616d822f06bd06da Mon Sep 17 00:00:00 2001 From: "Koushik K. Dutta" Date: Sun, 21 Feb 2010 17:52:30 -0800 Subject: [PATCH] add mkfstab.sh script to create an fstab on any device. clean up dump_image to use libmtdutils --- Android.mk | 2 +- legacy.c | 9 --------- mtdutils/Android.mk | 8 +++++--- nandroid/Android.mk | 10 ++++++++++ nandroid/nandroid-mobile.sh | 2 +- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/Android.mk b/Android.mk index 2afb46f..688acb9 100644 --- a/Android.mk +++ b/Android.mk @@ -41,10 +41,10 @@ ifeq ($(TARGET_RECOVERY_UI_LIB),) else LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UI_LIB) endif +LOCAL_STATIC_LIBRARIES += libamend LOCAL_STATIC_LIBRARIES += libminzip libunz libmtdutils libmincrypt LOCAL_STATIC_LIBRARIES += libminui libpixelflinger_static libpng libcutils LOCAL_STATIC_LIBRARIES += libstdc++ libc -LOCAL_STATIC_LIBRARIES += libamend include $(BUILD_EXECUTABLE) diff --git a/legacy.c b/legacy.c index cf903ce..88c620e 100644 --- a/legacy.c +++ b/legacy.c @@ -75,15 +75,6 @@ static int read_data(ZipArchive *zip, const ZipEntry *entry, int handle_update_script(ZipArchive *zip, const ZipEntry *update_script_entry) { - // This is bizarre. The build fails with "undefined reference" - // unless the following two functions are referenced from somewhere to - // force them to be linked. This seems to be a problem with yacc/lex. - if (zip == 1) - { - fwrite(NULL, 0, 0, NULL); - fileno(NULL); - } - /* Read the entire script into a buffer. */ int script_len; diff --git a/mtdutils/Android.mk b/mtdutils/Android.mk index 09d0fb8..e0cc524 100644 --- a/mtdutils/Android.mk +++ b/mtdutils/Android.mk @@ -21,9 +21,11 @@ LOCAL_SHARED_LIBRARIES := libcutils libc include $(BUILD_EXECUTABLE) include $(CLEAR_VARS) -LOCAL_SRC_FILES := dump_image.c mtdutils.c mounts.c +LOCAL_SRC_FILES := dump_image.c LOCAL_MODULE := dump_image LOCAL_MODULE_TAGS := eng +LOCAL_STATIC_LIBRARIES := libmtdutils +LOCAL_SHARED_LIBRARIES := libcutils libc include $(BUILD_EXECUTABLE) include $(CLEAR_VARS) @@ -39,11 +41,11 @@ ADDITIONAL_RECOVERY_EXECUTABLES += recovery_flash_image include $(BUILD_EXECUTABLE) include $(CLEAR_VARS) -LOCAL_SRC_FILES := dump_image.c mtdutils.c mounts.c +LOCAL_SRC_FILES := dump_image.c LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES LOCAL_MODULE := recovery_dump_image LOCAL_MODULE_TAGS := eng -LOCAL_STATIC_LIBRARIES := libcutils libc +LOCAL_STATIC_LIBRARIES := libmtdutils libcutils libc LOCAL_MODULE_STEM := dump_image LOCAL_FORCE_STATIC_EXECUTABLE := true LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin diff --git a/nandroid/Android.mk b/nandroid/Android.mk index 993daba..4b22437 100644 --- a/nandroid/Android.mk +++ b/nandroid/Android.mk @@ -10,3 +10,13 @@ ADDITIONAL_RECOVERY_EXECUTABLES += recovery_nandroid include $(BUILD_PREBUILT) include $(CLEAR_VARS) +LOCAL_MODULE := recovery_mkfstab +LOCAL_MODULE_TAGS := eng +LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES +LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin +LOCAL_SRC_FILES := mkfstab.sh +LOCAL_MODULE_STEM := mkfstab.sh +ADDITIONAL_RECOVERY_EXECUTABLES += recovery_mkfstab +include $(BUILD_PREBUILT) + +include $(CLEAR_VARS) diff --git a/nandroid/nandroid-mobile.sh b/nandroid/nandroid-mobile.sh index 9a9a824..4929074 100755 --- a/nandroid/nandroid-mobile.sh +++ b/nandroid/nandroid-mobile.sh @@ -56,7 +56,7 @@ DEVICEID=foo RECOVERY=foo echo "nandroid-mobile v2.1" - +mkfstab.sh > /etc/fstab if [ "$1" == "" ]; then echo "Usage: $0 {backup|restore} [/path/to/nandroid/backup/]"