Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- techmik@michaels-laptop:~$ diff -wrp ~/android/system/bootable/recovery/ ~/cm-main/android_bootable_recovery
- diff -wrp /home/techmik/android/system/bootable/recovery//Android.mk /home/techmik/cm-main/android_bootable_recovery/Android.mk
- *** /home/techmik/android/system/bootable/recovery//Android.mk 2011-04-01 04:16:02.000000000 -0400
- --- /home/techmik/cm-main/android_bootable_recovery/Android.mk 2011-04-22 19:44:57.000000000 -0400
- *************** LOCAL_MODULE := recovery
- *** 26,37 ****
- LOCAL_FORCE_STATIC_EXECUTABLE := true
- ! RECOVERY_VERSION := ClockworkMod Recovery v3.0.0.5
- LOCAL_CFLAGS += -DRECOVERY_VERSION="$(RECOVERY_VERSION)"
- RECOVERY_API_VERSION := 2
- LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
- ! BOARD_RECOVERY_DEFINES := BOARD_HAS_NO_SELECT_BUTTON BOARD_HAS_MTD_CACHE BOARD_HAS_SMALL_RECOVERY BOARD_LDPI_RECOVERY BOARD_RECOVERY_IGNORE_BOOTABLES
- $(foreach board_define,$(BOARD_RECOVERY_DEFINES), \
- $(if $($(board_define)), \
- --- 26,37 ----
- LOCAL_FORCE_STATIC_EXECUTABLE := true
- ! RECOVERY_VERSION := ClockworkMod Recovery v3.0.2.4
- LOCAL_CFLAGS += -DRECOVERY_VERSION="$(RECOVERY_VERSION)"
- RECOVERY_API_VERSION := 2
- LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
- ! BOARD_RECOVERY_DEFINES := BOARD_HAS_NO_SELECT_BUTTON BOARD_HAS_SMALL_RECOVERY BOARD_LDPI_RECOVERY BOARD_UMS_LUNFILE
- $(foreach board_define,$(BOARD_RECOVERY_DEFINES), \
- $(if $($(board_define)), \
- *************** LOCAL_STATIC_LIBRARIES += libext4_utils
- *** 57,63 ****
- LOCAL_STATIC_LIBRARIES += libminzip libunz libmincrypt
- LOCAL_STATIC_LIBRARIES += libedify libbusybox libclearsilverregex libmkyaffs2image libunyaffs liberase_image libdump_image libflash_image
- ! LOCAL_STATIC_LIBRARIES += libflashutils libmtdutils libmmcutils libbmlutils libbml_over_mtd
- LOCAL_STATIC_LIBRARIES += libminui libpixelflinger_static libpng libcutils
- LOCAL_STATIC_LIBRARIES += libstdc++ libc
- --- 57,63 ----
- LOCAL_STATIC_LIBRARIES += libminzip libunz libmincrypt
- LOCAL_STATIC_LIBRARIES += libedify libbusybox libclearsilverregex libmkyaffs2image libunyaffs liberase_image libdump_image libflash_image
- ! LOCAL_STATIC_LIBRARIES += libflashutils libmtdutils libmmcutils libbmlutils
- LOCAL_STATIC_LIBRARIES += libminui libpixelflinger_static libpng libcutils
- LOCAL_STATIC_LIBRARIES += libstdc++ libc
- *************** LOCAL_C_INCLUDES += system/extras/ext4_u
- *** 66,72 ****
- include $(BUILD_EXECUTABLE)
- ! RECOVERY_LINKS := edify busybox flash_image dump_image mkyaffs2image unyaffs erase_image nandroid reboot volume bml_over_mtd
- # nc is provided by external/netcat
- RECOVERY_SYMLINKS := $(addprefix $(TARGET_RECOVERY_ROOT_OUT)/sbin/,$(RECOVERY_LINKS))
- --- 66,72 ----
- include $(BUILD_EXECUTABLE)
- ! RECOVERY_LINKS := edify busybox flash_image dump_image mkyaffs2image unyaffs erase_image nandroid reboot volume
- # nc is provided by external/netcat
- RECOVERY_SYMLINKS := $(addprefix $(TARGET_RECOVERY_ROOT_OUT)/sbin/,$(RECOVERY_LINKS))
- diff -wrp /home/techmik/android/system/bootable/recovery//common.h /home/techmik/cm-main/android_bootable_recovery/common.h
- *** /home/techmik/android/system/bootable/recovery//common.h 2011-04-01 04:16:02.000000000 -0400
- --- /home/techmik/cm-main/android_bootable_recovery/common.h 2011-04-22 19:44:57.000000000 -0400
- *************** typedef struct {
- *** 112,118 ****
- const char* device2; // alternative device to try if fs_type
- // == "ext4" or "vfat" and mounting
- // 'device' fails
- ! const char* fallback_fs_type;
- } Volume;
- #endif // RECOVERY_COMMON_H
- --- 112,122 ----
- const char* device2; // alternative device to try if fs_type
- // == "ext4" or "vfat" and mounting
- // 'device' fails
- ! const char* fs_type2;
- !
- ! const char* fs_options;
- !
- ! const char* fs_options2;
- } Volume;
- #endif // RECOVERY_COMMON_H
- diff -wrp /home/techmik/android/system/bootable/recovery//default_recovery_ui.c /home/techmik/cm-main/android_bootable_recovery/default_recovery_ui.c
- *** /home/techmik/android/system/bootable/recovery//default_recovery_ui.c 2011-04-01 04:16:02.000000000 -0400
- --- /home/techmik/cm-main/android_bootable_recovery/default_recovery_ui.c 2011-04-22 19:44:57.000000000 -0400
- *************** char* MENU_ITEMS[] = { "reboot system no
- *** 30,35 ****
- --- 30,36 ----
- "backup and restore",
- "mounts and storage",
- "advanced",
- + "power off",
- NULL };
- int device_recovery_start() {
- *************** int device_toggle_display(volatile char*
- *** 42,48 ****
- return 1;
- // allow toggling of the display if the correct key is pressed, and the display toggle is allowed or the display is currently off
- if (ui_get_showing_back_button()) {
- ! return get_allow_toggle_display() && (key_code == KEY_HOME || key_code == KEY_MENU || key_code == KEY_END);
- }
- return get_allow_toggle_display() && (key_code == KEY_HOME || key_code == KEY_MENU || key_code == KEY_POWER || key_code == KEY_END);
- }
- --- 43,50 ----
- return 1;
- // allow toggling of the display if the correct key is pressed, and the display toggle is allowed or the display is currently off
- if (ui_get_showing_back_button()) {
- ! return 0;
- ! //return get_allow_toggle_display() && (key_code == KEY_HOME || key_code == KEY_MENU || key_code == KEY_END);
- }
- return get_allow_toggle_display() && (key_code == KEY_HOME || key_code == KEY_MENU || key_code == KEY_POWER || key_code == KEY_END);
- }
- *************** int device_handle_key(int key_code, int
- *** 57,67 ****
- --- 59,71 ----
- case KEY_CAPSLOCK:
- case KEY_DOWN:
- case KEY_VOLUMEDOWN:
- + case KEY_MENU:
- return HIGHLIGHT_DOWN;
- case KEY_LEFTSHIFT:
- case KEY_UP:
- case KEY_VOLUMEUP:
- + case KEY_HOME:
- return HIGHLIGHT_UP;
- case KEY_POWER:
- *************** int device_handle_key(int key_code, int
- *** 82,90 ****
- case KEY_END:
- case KEY_BACKSPACE:
- ! case KEY_BACK:
- if (!get_allow_toggle_display())
- return GO_BACK;
- }
- }
- --- 86,99 ----
- case KEY_END:
- case KEY_BACKSPACE:
- ! case KEY_SEARCH:
- ! if (ui_get_showing_back_button()) {
- ! return SELECT_ITEM;
- ! }
- if (!get_allow_toggle_display())
- return GO_BACK;
- + case KEY_BACK:
- + return GO_BACK;
- }
- }
- diff -wrp /home/techmik/android/system/bootable/recovery//edifyscripting.c /home/techmik/cm-main/android_bootable_recovery/edifyscripting.c
- *** /home/techmik/android/system/bootable/recovery//edifyscripting.c 2011-04-01 04:16:02.000000000 -0400
- --- /home/techmik/cm-main/android_bootable_recovery/edifyscripting.c 2011-04-22 19:44:57.000000000 -0400
- *************** Value* FormatFn(const char* name, State*
- *** 135,140 ****
- --- 135,148 ----
- return StringValue(strdup(""));
- }
- + if (strcmp(path, "/data") == 0 && has_datadata()) {
- + ui_print("Formatting /datadata...\n", path);
- + if (0 != format_volume("/datadata")) {
- + free(path);
- + return StringValue(strdup(""));
- + }
- + }
- +
- done:
- return StringValue(strdup(path));
- }
- Only in /home/techmik/cm-main/android_bootable_recovery/etc: init.htc.rc
- diff -wrp /home/techmik/android/system/bootable/recovery//extendedcommands.c /home/techmik/cm-main/android_bootable_recovery/extendedcommands.c
- *** /home/techmik/android/system/bootable/recovery//extendedcommands.c 2011-04-01 04:16:02.000000000 -0400
- --- /home/techmik/cm-main/android_bootable_recovery/extendedcommands.c 2011-04-22 19:44:57.000000000 -0400
- *************** void show_nandroid_restore_menu()
- *** 340,351 ****
- nandroid_restore(file, 1, 1, 1, 1, 1, 0);
- }
- void show_mount_usb_storage_menu()
- {
- int fd;
- Volume *vol = volume_for_path("/sdcard");
- ! if ((fd = open("/sys/devices/platform/usb_mass_storage/lun0/file",
- ! O_WRONLY)) < 0) {
- LOGE("Unable to open ums lunfile (%s)", strerror(errno));
- return -1;
- }
- --- 340,354 ----
- nandroid_restore(file, 1, 1, 1, 1, 1, 0);
- }
- + #ifndef BOARD_UMS_LUNFILE
- + #define BOARD_UMS_LUNFILE "/sys/devices/platform/usb_mass_storage/lun0/file"
- + #endif
- +
- void show_mount_usb_storage_menu()
- {
- int fd;
- Volume *vol = volume_for_path("/sdcard");
- ! if ((fd = open(BOARD_UMS_LUNFILE, O_WRONLY)) < 0) {
- LOGE("Unable to open ums lunfile (%s)", strerror(errno));
- return -1;
- }
- *************** void show_mount_usb_storage_menu()
- *** 371,377 ****
- break;
- }
- ! if ((fd = open("/sys/devices/platform/usb_mass_storage/lun0/file", O_WRONLY)) < 0) {
- LOGE("Unable to open ums lunfile (%s)", strerror(errno));
- return -1;
- }
- --- 374,380 ----
- break;
- }
- ! if ((fd = open(BOARD_UMS_LUNFILE, O_WRONLY)) < 0) {
- LOGE("Unable to open ums lunfile (%s)", strerror(errno));
- return -1;
- }
- *************** typedef struct {
- *** 484,489 ****
- --- 487,498 ----
- Volume* v;
- } FormatMenuEntry;
- + int is_safe_to_format(char* name)
- + {
- + return !(strcmp(name, "/misc") == 0 || strcmp(name, "/radio") == 0
- + || strcmp(name, "/bootloader") == 0 || strcmp(name, "/recovery") == 0);
- + }
- +
- void show_partition_menu()
- {
- static char* headers[] = { "Mounts and Storage Menu",
- *************** void show_partition_menu()
- *** 516,532 ****
- for (i = 0; i < num_volumes; ++i) {
- Volume* v = &device_volumes[i];
- ! if(strcmp("ramdisk", v->fs_type) != 0 && strcmp("mtd", v->fs_type) != 0)
- {
- sprintf(&mount_menue[mountable_volumes].mount, "mount %s", v->mount_point);
- sprintf(&mount_menue[mountable_volumes].unmount, "unmount %s", v->mount_point);
- mount_menue[mountable_volumes].v = &device_volumes[i];
- ++mountable_volumes;
- sprintf(&format_menue[formatable_volumes].txt, "format %s", v->mount_point);
- format_menue[formatable_volumes].v = &device_volumes[i];
- ++formatable_volumes;
- }
- ! else if (strcmp("ramdisk", v->fs_type) != 0 && strcmp("mtd", v->fs_type) == 0)
- {
- sprintf(&format_menue[formatable_volumes].txt, "format %s", v->mount_point);
- format_menue[formatable_volumes].v = &device_volumes[i];
- --- 525,543 ----
- for (i = 0; i < num_volumes; ++i) {
- Volume* v = &device_volumes[i];
- ! if(strcmp("ramdisk", v->fs_type) != 0 && strcmp("mtd", v->fs_type) != 0 && strcmp("emmc", v->fs_type) != 0 && strcmp("bml", v->fs_type) != 0)
- {
- sprintf(&mount_menue[mountable_volumes].mount, "mount %s", v->mount_point);
- sprintf(&mount_menue[mountable_volumes].unmount, "unmount %s", v->mount_point);
- mount_menue[mountable_volumes].v = &device_volumes[i];
- ++mountable_volumes;
- + if (is_safe_to_format(v->mount_point)) {
- sprintf(&format_menue[formatable_volumes].txt, "format %s", v->mount_point);
- format_menue[formatable_volumes].v = &device_volumes[i];
- ++formatable_volumes;
- }
- ! }
- ! else if (strcmp("ramdisk", v->fs_type) != 0 && strcmp("mtd", v->fs_type) == 0 && is_safe_to_format(v->mount_point))
- {
- sprintf(&format_menue[formatable_volumes].txt, "format %s", v->mount_point);
- format_menue[formatable_volumes].v = &device_volumes[i];
- *************** void write_fstab_root(char *path, FILE *
- *** 1016,1022 ****
- fprintf(file, "%s ", device);
- fprintf(file, "%s ", path);
- ! fprintf(file, "%s rw\n", vol->fs_type);
- }
- void create_fstab()
- --- 1027,1034 ----
- fprintf(file, "%s ", device);
- fprintf(file, "%s ", path);
- ! // special case rfs cause auto will mount it as vfat on samsung.
- ! fprintf(file, "%s rw\n", vol->fs_type2 != NULL && strcmp(vol->fs_type, "rfs") != 0 ? "auto" : vol->fs_type);
- }
- void create_fstab()
- *************** void create_fstab()
- *** 1029,1035 ****
- return;
- }
- Volume *vol = volume_for_path("/boot");
- ! if (NULL != vol && strcmp(vol->fs_type, "mtd") != 0)
- write_fstab_root("/boot", file);
- write_fstab_root("/cache", file);
- write_fstab_root("/data", file);
- --- 1041,1047 ----
- return;
- }
- Volume *vol = volume_for_path("/boot");
- ! if (NULL != vol && strcmp(vol->fs_type, "mtd") != 0 && strcmp(vol->fs_type, "emmc") != 0 && strcmp(vol->fs_type, "bml") != 0)
- write_fstab_root("/boot", file);
- write_fstab_root("/cache", file);
- write_fstab_root("/data", file);
- *************** int bml_check_volume(const char *path) {
- *** 1068,1073 ****
- --- 1080,1088 ----
- void process_volumes() {
- create_fstab();
- + return;
- +
- + // dead code.
- if (device_flash_type() != BML)
- return;
- *************** int volume_main(int argc, char **argv) {
- *** 1150,1172 ****
- load_volume_table();
- return 0;
- }
- -
- - void handle_chargemode() {
- - const char* filename = "/proc/cmdline";
- - struct stat file_info;
- - if (0 != stat(filename, &file_info))
- - return;
- -
- - int file_len = file_info.st_size;
- - char* file_data = (char*)malloc(file_len + 1);
- - FILE *file = fopen(filename, "rb");
- - if (file == NULL)
- - return;
- - fread(file_data, file_len, 1, file);
- - // supposedly not necessary, but let's be safe.
- - file_data[file_len] = '\0';
- - fclose(file);
- -
- - if (strstr(file_data, "androidboot.mode=offmode_charging") != NULL)
- - reboot(RB_POWER_OFF);
- - }
- --- 1165,1167 ----
- diff -wrp /home/techmik/android/system/bootable/recovery//flashutils/Android.mk /home/techmik/cm-main/android_bootable_recovery/flashutils/Android.mk
- *** /home/techmik/android/system/bootable/recovery//flashutils/Android.mk 2011-04-01 04:16:02.000000000 -0400
- --- /home/techmik/cm-main/android_bootable_recovery/flashutils/Android.mk 2011-04-22 19:44:57.000000000 -0400
- *************** LOCAL_MODULE_TAGS := eng
- *** 57,70 ****
- LOCAL_CFLAGS += -Dmain=erase_image_main
- include $(BUILD_STATIC_LIBRARY)
- - include $(CLEAR_VARS)
- - LOCAL_SRC_FILES := bml_over_mtd.c
- - LOCAL_C_INCLUDES += bootable/recovery/mtdutils
- - LOCAL_MODULE := libbml_over_mtd
- - LOCAL_MODULE_TAGS := eng
- - LOCAL_CFLAGS += -Dmain=bml_over_mtd_main
- - include $(BUILD_STATIC_LIBRARY)
- -
- include $(CLEAR_VARS)
- LOCAL_SRC_FILES := dump_image.c
- --- 57,62 ----
- *************** LOCAL_STATIC_LIBRARIES := libflashutils
- *** 102,119 ****
- LOCAL_FORCE_STATIC_EXECUTABLE := true
- include $(BUILD_EXECUTABLE)
- - include $(CLEAR_VARS)
- - LOCAL_SRC_FILES := bml_over_mtd.c
- - LOCAL_MODULE := bml_over_mtd
- - LOCAL_MODULE_TAGS := eng
- - LOCAL_MODULE_CLASS := UTILITY_EXECUTABLES
- - LOCAL_MODULE_PATH := $(PRODUCT_OUT)/utilities
- - LOCAL_UNSTRIPPED_PATH := $(PRODUCT_OUT)/symbols/utilities
- - LOCAL_MODULE_STEM := bml_over_mtd
- - LOCAL_C_INCLUDES += bootable/recovery/mtdutils
- - LOCAL_STATIC_LIBRARIES := libmtdutils libcutils libc
- - LOCAL_FORCE_STATIC_EXECUTABLE := true
- - include $(BUILD_EXECUTABLE)
- -
- endif # TARGET_ARCH == arm
- endif # !TARGET_SIMULATOR
- --- 94,98 ----
- Only in /home/techmik/android/system/bootable/recovery//flashutils: bml_over_mtd.c
- diff -wrp /home/techmik/android/system/bootable/recovery//flashutils/flashutils.c /home/techmik/cm-main/android_bootable_recovery/flashutils/flashutils.c
- *** /home/techmik/android/system/bootable/recovery//flashutils/flashutils.c 2011-04-01 04:16:02.000000000 -0400
- --- /home/techmik/cm-main/android_bootable_recovery/flashutils/flashutils.c 2011-04-22 19:44:57.000000000 -0400
- *************** __system(const char *command)
- *** 69,77 ****
- return (pid == -1 ? -1 : pstat);
- }
- ! int restore_raw_partition(const char *partition, const char *filename)
- {
- int type = device_flash_type();
- switch (type) {
- case MTD:
- return cmd_mtd_restore_raw_partition(partition, filename);
- --- 69,89 ----
- return (pid == -1 ? -1 : pstat);
- }
- ! static int detect_partition(const char *partition)
- {
- int type = device_flash_type();
- + if (strstr(partition, "/dev/block/mtd") != NULL)
- + type = MTD;
- + else if (strstr(partition, "/dev/block/mmc") != NULL)
- + type = MMC;
- + else if (strstr(partition, "/dev/block/bml") != NULL)
- + type = BML;
- +
- + return type;
- + }
- + int restore_raw_partition(const char *partition, const char *filename)
- + {
- + int type = detect_partition(partition);
- switch (type) {
- case MTD:
- return cmd_mtd_restore_raw_partition(partition, filename);
- *************** int restore_raw_partition(const char *pa
- *** 86,92 ****
- int backup_raw_partition(const char *partition, const char *filename)
- {
- ! int type = device_flash_type();
- switch (type) {
- case MTD:
- return cmd_mtd_backup_raw_partition(partition, filename);
- --- 98,104 ----
- int backup_raw_partition(const char *partition, const char *filename)
- {
- ! int type = detect_partition(partition);
- switch (type) {
- case MTD:
- return cmd_mtd_backup_raw_partition(partition, filename);
- *************** int backup_raw_partition(const char *par
- *** 101,107 ****
- int erase_raw_partition(const char *partition)
- {
- ! int type = device_flash_type();
- switch (type) {
- case MTD:
- return cmd_mtd_erase_raw_partition(partition);
- --- 113,119 ----
- int erase_raw_partition(const char *partition)
- {
- ! int type = detect_partition(partition);
- switch (type) {
- case MTD:
- return cmd_mtd_erase_raw_partition(partition);
- *************** int erase_raw_partition(const char *part
- *** 116,122 ****
- int erase_partition(const char *partition, const char *filesystem)
- {
- ! int type = device_flash_type();
- switch (type) {
- case MTD:
- return cmd_mtd_erase_partition(partition, filesystem);
- --- 128,134 ----
- int erase_partition(const char *partition, const char *filesystem)
- {
- ! int type = detect_partition(partition);
- switch (type) {
- case MTD:
- return cmd_mtd_erase_partition(partition, filesystem);
- *************** int erase_partition(const char *partitio
- *** 131,137 ****
- int mount_partition(const char *partition, const char *mount_point, const char *filesystem, int read_only)
- {
- ! int type = device_flash_type();
- switch (type) {
- case MTD:
- return cmd_mtd_mount_partition(partition, mount_point, filesystem, read_only);
- --- 143,149 ----
- int mount_partition(const char *partition, const char *mount_point, const char *filesystem, int read_only)
- {
- ! int type = detect_partition(partition);
- switch (type) {
- case MTD:
- return cmd_mtd_mount_partition(partition, mount_point, filesystem, read_only);
- Only in /home/techmik/cm-main/android_bootable_recovery/.git: branches
- diff -wrp /home/techmik/android/system/bootable/recovery//.git/config /home/techmik/cm-main/android_bootable_recovery/.git/config
- *** /home/techmik/android/system/bootable/recovery//.git/config 2011-04-08 23:15:45.000000000 -0400
- --- /home/techmik/cm-main/android_bootable_recovery/.git/config 2011-04-22 19:44:57.000000000 -0400
- ***************
- *** 1,13 ****
- [core]
- repositoryformatversion = 0
- filemode = true
- ! [user]
- ! email = techmik67@gmail.com
- ! [remote "github"]
- ! url = git://github.com/teamhacksung/android_bootable_recovery.git
- ! review = review.cyanogenmod.com
- ! projectname = teamhacksung/android_bootable_recovery
- ! fetch = +refs/heads/*:refs/remotes/github/*
- [branch "gingerbread"]
- ! remote = github
- ! merge = gingerbread
- --- 1,11 ----
- [core]
- repositoryformatversion = 0
- filemode = true
- ! bare = false
- ! logallrefupdates = true
- ! [remote "origin"]
- ! fetch = +refs/heads/*:refs/remotes/origin/*
- ! url = git://github.com/CyanogenMod/android_bootable_recovery.git
- [branch "gingerbread"]
- ! remote = origin
- ! merge = refs/heads/gingerbread
- Only in /home/techmik/cm-main/android_bootable_recovery/.git/hooks: applypatch-msg.sample
- Only in /home/techmik/android/system/bootable/recovery//.git/hooks: commit-msg
- Only in /home/techmik/cm-main/android_bootable_recovery/.git/hooks: commit-msg.sample
- Only in /home/techmik/cm-main/android_bootable_recovery/.git/hooks: post-commit.sample
- Only in /home/techmik/cm-main/android_bootable_recovery/.git/hooks: post-receive.sample
- Only in /home/techmik/cm-main/android_bootable_recovery/.git/hooks: post-update.sample
- Only in /home/techmik/cm-main/android_bootable_recovery/.git/hooks: pre-applypatch.sample
- Only in /home/techmik/android/system/bootable/recovery//.git/hooks: pre-auto-gc
- Only in /home/techmik/cm-main/android_bootable_recovery/.git/hooks: pre-commit.sample
- Only in /home/techmik/cm-main/android_bootable_recovery/.git/hooks: prepare-commit-msg.sample
- Only in /home/techmik/cm-main/android_bootable_recovery/.git/hooks: pre-rebase.sample
- Only in /home/techmik/cm-main/android_bootable_recovery/.git/hooks: update.sample
- Binary files /home/techmik/android/system/bootable/recovery//.git/index and /home/techmik/cm-main/android_bootable_recovery/.git/index differ
- diff -wrp /home/techmik/android/system/bootable/recovery//.git/logs/HEAD /home/techmik/cm-main/android_bootable_recovery/.git/logs/HEAD
- *** /home/techmik/android/system/bootable/recovery//.git/logs/HEAD 2011-04-08 23:15:45.000000000 -0400
- --- /home/techmik/cm-main/android_bootable_recovery/.git/logs/HEAD 2011-04-22 19:44:57.000000000 -0400
- ***************
- *** 1,4 ****
- ! e63320aa120f2262dce36e8bfcdd72a13649e859 e63320aa120f2262dce36e8bfcdd72a13649e859 Michael <techmik67@gmail.com> 1302313448 -0400 checkout: moving from e63320aa120f2262dce36e8bfcdd72a13649e859 to gingerbread
- ! e63320aa120f2262dce36e8bfcdd72a13649e859 e63320aa120f2262dce36e8bfcdd72a13649e859 Michael <techmik67@gmail.com> 1302313518 -0400 checkout: moving from gingerbread to usb
- ! e63320aa120f2262dce36e8bfcdd72a13649e859 e63320aa120f2262dce36e8bfcdd72a13649e859 Michael <techmik67@gmail.com> 1302318668 -0400 checkout: moving from usb to gingerbread
- ! e63320aa120f2262dce36e8bfcdd72a13649e859 413156f46a8a1a9ea14ce5785fb09f5df6629798 Michael <techmik67@gmail.com> 1302318945 -0400 merge 413156f46a8a1a9ea14ce5785fb09f5df6629798: Fast-forward
- --- 1 ----
- ! 0000000000000000000000000000000000000000 f1bde365724b63b0f2b97304167fe60da9fd44cd techmik <techmik67@gmail.com> 1303515897 -0400 clone: from git://github.com/CyanogenMod/android_bootable_recovery.git
- diff -wrp /home/techmik/android/system/bootable/recovery//.git/logs/refs/heads/gingerbread /home/techmik/cm-main/android_bootable_recovery/.git/logs/refs/heads/gingerbread
- *** /home/techmik/android/system/bootable/recovery//.git/logs/refs/heads/gingerbread 2011-04-08 23:15:45.000000000 -0400
- --- /home/techmik/cm-main/android_bootable_recovery/.git/logs/refs/heads/gingerbread 2011-04-22 19:44:57.000000000 -0400
- ***************
- *** 1,2 ****
- ! 0000000000000000000000000000000000000000 e63320aa120f2262dce36e8bfcdd72a13649e859 Michael <techmik67@gmail.com> 1302313434 -0400 branch: Created from github/gingerbread
- ! e63320aa120f2262dce36e8bfcdd72a13649e859 413156f46a8a1a9ea14ce5785fb09f5df6629798 Michael <techmik67@gmail.com> 1302318945 -0400 merge 413156f46a8a1a9ea14ce5785fb09f5df6629798: Fast-forward
- --- 1 ----
- ! 0000000000000000000000000000000000000000 f1bde365724b63b0f2b97304167fe60da9fd44cd techmik <techmik67@gmail.com> 1303515897 -0400 clone: from git://github.com/CyanogenMod/android_bootable_recovery.git
- Only in /home/techmik/android/system/bootable/recovery//.git/logs/refs: remotes
- Only in /home/techmik/android/system/bootable/recovery//.git/objects: 41
- Only in /home/techmik/android/system/bootable/recovery//.git/objects: 4c
- Only in /home/techmik/android/system/bootable/recovery//.git/objects: d4
- Only in /home/techmik/cm-main/android_bootable_recovery/.git/objects/pack: pack-d333eb5c1f4fbcdce971d9e00ea7ee95c55ea70c.idx
- Only in /home/techmik/cm-main/android_bootable_recovery/.git/objects/pack: pack-d333eb5c1f4fbcdce971d9e00ea7ee95c55ea70c.pack
- Only in /home/techmik/android/system/bootable/recovery//.git/objects/pack: pack-f8b3bd47c78e25c2140880b60c6a669a6e00bd0d.idx
- Only in /home/techmik/android/system/bootable/recovery//.git/objects/pack: pack-f8b3bd47c78e25c2140880b60c6a669a6e00bd0d.pack
- Only in /home/techmik/android/system/bootable/recovery//.git: ORIG_HEAD
- diff -wrp /home/techmik/android/system/bootable/recovery//.git/packed-refs /home/techmik/cm-main/android_bootable_recovery/.git/packed-refs
- *** /home/techmik/android/system/bootable/recovery//.git/packed-refs 2011-04-01 03:01:19.000000000 -0400
- --- /home/techmik/cm-main/android_bootable_recovery/.git/packed-refs 2011-04-22 19:44:57.000000000 -0400
- ***************
- *** 1,7 ****
- # pack-refs with: peeled
- ! d105f8f84f25db7861775e07a808855334207d95 refs/remotes/github/cupcake
- ! adf906d034480fdffbfca51f56176d0e0d603437 refs/remotes/github/eclair
- ! 0b7bbf29d5864fc2939ab9b954c0e1d18a24bffd refs/remotes/github/froyo
- ! 8df69c0660927cd1c10a11b40f0c28641405adc2 refs/remotes/github/froyo-stable
- ! e63320aa120f2262dce36e8bfcdd72a13649e859 refs/remotes/github/gingerbread
- ! 789d4d969027c745837f437298ab42957b5576ac refs/remotes/github/streak
- --- 1,7 ----
- # pack-refs with: peeled
- ! 789d4d969027c745837f437298ab42957b5576ac refs/remotes/origin/streak
- ! f1bde365724b63b0f2b97304167fe60da9fd44cd refs/remotes/origin/gingerbread
- ! 8df69c0660927cd1c10a11b40f0c28641405adc2 refs/remotes/origin/froyo-stable
- ! 3d6a2111e40a30424117b6e7d4623d71ee0df96a refs/remotes/origin/froyo
- ! adf906d034480fdffbfca51f56176d0e0d603437 refs/remotes/origin/eclair
- ! d105f8f84f25db7861775e07a808855334207d95 refs/remotes/origin/cupcake
- diff -wrp /home/techmik/android/system/bootable/recovery//.git/refs/heads/gingerbread /home/techmik/cm-main/android_bootable_recovery/.git/refs/heads/gingerbread
- *** /home/techmik/android/system/bootable/recovery//.git/refs/heads/gingerbread2011-04-08 23:15:45.000000000 -0400
- --- /home/techmik/cm-main/android_bootable_recovery/.git/refs/heads/gingerbread2011-04-22 19:44:57.000000000 -0400
- ***************
- *** 1 ****
- ! 413156f46a8a1a9ea14ce5785fb09f5df6629798
- --- 1 ----
- ! f1bde365724b63b0f2b97304167fe60da9fd44cd
- Only in /home/techmik/android/system/bootable/recovery//.git/refs/remotes: github
- Only in /home/techmik/android/system/bootable/recovery//.git/refs/remotes: m
- Only in /home/techmik/cm-main/android_bootable_recovery/.git/refs/remotes: origin
- Only in /home/techmik/android/system/bootable/recovery//.git: rr-cache
- Only in /home/techmik/android/system/bootable/recovery//.git: svn
- Only in /home/techmik/cm-main/android_bootable_recovery: htc
- diff -wrp /home/techmik/android/system/bootable/recovery//mmcutils/Android.mk /home/techmik/cm-main/android_bootable_recovery/mmcutils/Android.mk
- *** /home/techmik/android/system/bootable/recovery//mmcutils/Android.mk 2011-04-01 04:16:02.000000000 -0400
- --- /home/techmik/cm-main/android_bootable_recovery/mmcutils/Android.mk 2011-04-22 19:44:57.000000000 -0400
- *************** ifeq ($(TARGET_ARCH),arm)
- *** 4,9 ****
- --- 4,13 ----
- LOCAL_PATH := $(call my-dir)
- include $(CLEAR_VARS)
- + ifeq ($(BOARD_HAS_LARGE_FILESYSTEM),true)
- + LOCAL_CFLAGS += -DBOARD_HAS_LARGE_FILESYSTEM
- + endif
- +
- LOCAL_SRC_FILES := \
- mmcutils.c
- diff -wrp /home/techmik/android/system/bootable/recovery//mmcutils/mmcutils.c /home/techmik/cm-main/android_bootable_recovery/mmcutils/mmcutils.c
- *** /home/techmik/android/system/bootable/recovery//mmcutils/mmcutils.c 2011-04-01 04:16:02.000000000 -0400
- --- /home/techmik/cm-main/android_bootable_recovery/mmcutils/mmcutils.c 2011-04-22 19:44:57.000000000 -0400
- *************** run_exec_process ( char **argv) {
- *** 340,352 ****
- int
- format_ext3_device (const char *device) {
- ! // Run mke2fs
- char *const mke2fs[] = {MKE2FS_BIN, "-j", device, NULL};
- if(run_exec_process(mke2fs))
- return -1;
- // Run tune2fs
- - char *const tune2fs[] = {TUNE2FS_BIN, "-j", "-C", "1", device, NULL};
- if(run_exec_process(tune2fs))
- return -1;
- --- 340,357 ----
- int
- format_ext3_device (const char *device) {
- ! #ifdef BOARD_HAS_LARGE_FILESYSTEM
- ! char *const mke2fs[] = {MKE2FS_BIN, "-j", "-q", device, NULL};
- ! char *const tune2fs[] = {TUNE2FS_BIN, "-C", "1", device, NULL};
- ! #else
- char *const mke2fs[] = {MKE2FS_BIN, "-j", device, NULL};
- + char *const tune2fs[] = {TUNE2FS_BIN, "-j", "-C", "1", device, NULL};
- + #endif
- + // Run mke2fs
- if(run_exec_process(mke2fs))
- return -1;
- // Run tune2fs
- if(run_exec_process(tune2fs))
- return -1;
- *************** ERROR3:
- *** 464,472 ****
- }
- - // TODO: refactor this to not be a giant copy paste mess
- int
- ! mmc_raw_dump (const MmcPartition *partition, char *out_file) {
- int ch;
- FILE *in;
- FILE *out;
- --- 469,476 ----
- }
- int
- ! mmc_raw_dump_internal (const char* in_file, const char *out_file) {
- int ch;
- FILE *in;
- FILE *out;
- *************** mmc_raw_dump (const MmcPartition *partit
- *** 475,481 ****
- unsigned sz = 0;
- unsigned i;
- int ret = -1;
- - char *in_file = partition->device_index;
- in = fopen ( in_file, "r" );
- if (in == NULL)
- --- 479,484 ----
- *************** ERROR3:
- *** 516,521 ****
- --- 519,530 ----
- }
- + // TODO: refactor this to not be a giant copy paste mess
- + int
- + mmc_raw_dump (const MmcPartition *partition, char *out_file) {
- + return mmc_raw_dump_internal(partition->device_index, out_file);
- + }
- +
- int
- mmc_raw_read (const MmcPartition *partition, char *data, int data_size) {
- *************** ERROR3:
- *** 575,580 ****
- --- 584,590 ----
- int cmd_mmc_restore_raw_partition(const char *partition, const char *filename)
- {
- + if (partition[0] != '/') {
- mmc_scan_partitions();
- const MmcPartition *p;
- p = mmc_find_partition_by_name(partition);
- *************** int cmd_mmc_restore_raw_partition(const
- *** 582,590 ****
- --- 592,605 ----
- return -1;
- return mmc_raw_copy(p, filename);
- }
- + else {
- + return mmc_raw_dump_internal(filename, partition);
- + }
- + }
- int cmd_mmc_backup_raw_partition(const char *partition, const char *filename)
- {
- + if (partition[0] != '/') {
- mmc_scan_partitions();
- const MmcPartition *p;
- p = mmc_find_partition_by_name(partition);
- *************** int cmd_mmc_backup_raw_partition(const c
- *** 592,607 ****
- return -1;
- return mmc_raw_dump(p, filename);
- }
- int cmd_mmc_erase_raw_partition(const char *partition)
- {
- - mmc_scan_partitions();
- - const MmcPartition *p;
- - p = mmc_find_partition_by_name(partition);
- - if (p == NULL)
- - return -1;
- -
- - // TODO: implement raw wipe
- return 0;
- }
- --- 607,619 ----
- return -1;
- return mmc_raw_dump(p, filename);
- }
- + else {
- + return mmc_raw_dump_internal(partition, filename);
- + }
- + }
- int cmd_mmc_erase_raw_partition(const char *partition)
- {
- return 0;
- }
- diff -wrp /home/techmik/android/system/bootable/recovery//nandroid.c /home/techmik/cm-main/android_bootable_recovery/nandroid.c
- *** /home/techmik/android/system/bootable/recovery//nandroid.c 2011-04-01 04:16:02.000000000 -0400
- --- /home/techmik/cm-main/android_bootable_recovery/nandroid.c 2011-04-22 19:44:57.000000000 -0400
- *************** int nandroid_backup_partition(const char
- *** 110,115 ****
- --- 110,116 ----
- char tmp[PATH_MAX];
- int ret;
- if (strcmp(vol->fs_type, "mtd") == 0 ||
- + strcmp(vol->fs_type, "bml") == 0 ||
- strcmp(vol->fs_type, "emmc") == 0) {
- const char* name = basename(root);
- sprintf(tmp, "%s/%s.img", backup_path, name);
- *************** int nandroid_backup(const char* backup_p
- *** 153,166 ****
- if (0 != (ret = nandroid_backup_partition(backup_path, "/recovery")))
- return ret;
- ! if (0 == (ret = get_partition_device("wimax", tmp)))
- {
- char serialno[PROPERTY_VALUE_MAX];
- ui_print("Backing up WiMAX...\n");
- serialno[0] = 0;
- property_get("ro.serialno", serialno, "");
- sprintf(tmp, "%s/wimax.%s.img", backup_path, serialno);
- ! ret = backup_raw_partition("wimax", tmp);
- if (0 != ret)
- return print_and_error("Error while dumping WiMAX image!\n");
- }
- --- 154,168 ----
- if (0 != (ret = nandroid_backup_partition(backup_path, "/recovery")))
- return ret;
- ! Volume *vol = volume_for_path("/wimax");
- ! if (vol != NULL && 0 == stat(vol->device, &s))
- {
- char serialno[PROPERTY_VALUE_MAX];
- ui_print("Backing up WiMAX...\n");
- serialno[0] = 0;
- property_get("ro.serialno", serialno, "");
- sprintf(tmp, "%s/wimax.%s.img", backup_path, serialno);
- ! ret = backup_raw_partition(vol->device, tmp);
- if (0 != ret)
- return print_and_error("Error while dumping WiMAX image!\n");
- }
- *************** int nandroid_backup(const char* backup_p
- *** 176,183 ****
- return ret;
- }
- ! struct stat st;
- ! if (0 != stat("/sdcard/.android_secure", &st))
- {
- ui_print("No /sdcard/.android_secure found. Skipping backup of applications on external storage.\n");
- }
- --- 178,184 ----
- return ret;
- }
- ! if (0 != stat("/sdcard/.android_secure", &s))
- {
- ui_print("No /sdcard/.android_secure found. Skipping backup of applications on external storage.\n");
- }
- *************** int nandroid_backup(const char* backup_p
- *** 190,197 ****
- if (0 != (ret = nandroid_backup_partition_extended(backup_path, "/cache", 0)))
- return ret;
- ! Volume *vol = volume_for_path("/sd-ext");
- ! if (vol == NULL || 0 != stat(vol->device, &st))
- {
- ui_print("No sd-ext found. Skipping backup of sd-ext.\n");
- }
- --- 191,198 ----
- if (0 != (ret = nandroid_backup_partition_extended(backup_path, "/cache", 0)))
- return ret;
- ! vol = volume_for_path("/sd-ext");
- ! if (vol == NULL || 0 != stat(vol->device, &s))
- {
- ui_print("No sd-ext found. Skipping backup of sd-ext.\n");
- }
- *************** int nandroid_restore_partition(const cha
- *** 282,287 ****
- --- 283,289 ----
- // see if we need a raw restore (mtd)
- char tmp[PATH_MAX];
- if (strcmp(vol->fs_type, "mtd") == 0 ||
- + strcmp(vol->fs_type, "bml") == 0 ||
- strcmp(vol->fs_type, "emmc") == 0) {
- int ret;
- const char* name = basename(root);
- *************** int nandroid_restore(const char* backup_
- *** 322,328 ****
- if (restore_boot && NULL != volume_for_path("/boot") && 0 != (ret = nandroid_restore_partition(backup_path, "/boot")))
- return ret;
- ! if (restore_wimax && 0 == (ret = get_partition_device("wimax", tmp)))
- {
- char serialno[PROPERTY_VALUE_MAX];
- --- 324,332 ----
- if (restore_boot && NULL != volume_for_path("/boot") && 0 != (ret = nandroid_restore_partition(backup_path, "/boot")))
- return ret;
- ! struct stat s;
- ! Volume *vol = volume_for_path("/wimax");
- ! if (restore_wimax && vol != NULL && 0 == stat(vol->device, &s))
- {
- char serialno[PROPERTY_VALUE_MAX];
- *************** int nandroid_restore(const char* backup_
- *** 344,350 ****
- if (0 != (ret = format_volume("/wimax")))
- return print_and_error("Error while formatting wimax!\n");
- ui_print("Restoring WiMAX image...\n");
- ! if (0 != (ret = restore_raw_partition("wimax", tmp)))
- return ret;
- }
- }
- --- 348,354 ----
- if (0 != (ret = format_volume("/wimax")))
- return print_and_error("Error while formatting wimax!\n");
- ui_print("Restoring WiMAX image...\n");
- ! if (0 != (ret = restore_raw_partition(vol->device, tmp)))
- return ret;
- }
- }
- diff -wrp /home/techmik/android/system/bootable/recovery//recovery.c /home/techmik/cm-main/android_bootable_recovery/recovery.c
- *** /home/techmik/android/system/bootable/recovery//recovery.c 2011-04-01 04:16:02.000000000 -0400
- --- /home/techmik/cm-main/android_bootable_recovery/recovery.c 2011-04-22 19:44:57.000000000 -0400
- *************** static const char *LOG_FILE = "/cache/re
- *** 61,66 ****
- --- 61,67 ----
- static const char *LAST_LOG_FILE = "/cache/recovery/last_log";
- static const char *SDCARD_ROOT = "/sdcard";
- static int allow_display_toggle = 1;
- + static int poweroff = 0;
- static const char *SDCARD_PACKAGE_FILE = "/sdcard/update.zip";
- static const char *TEMPORARY_LOG_FILE = "/tmp/recovery.log";
- static const char *SIDELOAD_TEMP_DIR = "/tmp/sideload";
- *************** prompt_and_wait() {
- *** 707,712 ****
- --- 708,714 ----
- switch (chosen_item) {
- case ITEM_REBOOT:
- + poweroff=0;
- return;
- case ITEM_WIPE_DATA:
- *************** prompt_and_wait() {
- *** 751,756 ****
- --- 753,761 ----
- case ITEM_ADVANCED:
- show_advanced_menu();
- break;
- + case ITEM_POWEROFF:
- + poweroff=1;
- + return;
- }
- }
- }
- *************** main(int argc, char **argv) {
- *** 782,794 ****
- return nandroid_main(argc, argv);
- if (strstr(argv[0], "reboot"))
- return reboot_main(argc, argv);
- if (strstr(argv[0], "setprop"))
- return setprop_main(argc, argv);
- - if (strstr(argv[0], "bml_over_mtd"))
- - return bml_over_mtd_main(argc, argv);
- return busybox_driver(argc, argv);
- }
- - handle_chargemode();
- __system("/sbin/postrecoveryboot.sh");
- int is_user_initiated_recovery = 0;
- --- 787,799 ----
- return nandroid_main(argc, argv);
- if (strstr(argv[0], "reboot"))
- return reboot_main(argc, argv);
- + if (strstr(argv[0], "poweroff")){
- + return reboot_main(argc, argv);
- + }
- if (strstr(argv[0], "setprop"))
- return setprop_main(argc, argv);
- return busybox_driver(argc, argv);
- }
- __system("/sbin/postrecoveryboot.sh");
- int is_user_initiated_recovery = 0;
- *************** main(int argc, char **argv) {
- *** 941,949 ****
- // Otherwise, get ready to boot the main system...
- finish_recovery(send_intent);
- ui_print("Rebooting...\n");
- sync();
- ! reboot(RB_AUTOBOOT);
- return EXIT_SUCCESS;
- }
- --- 946,957 ----
- // Otherwise, get ready to boot the main system...
- finish_recovery(send_intent);
- + if(!poweroff)
- ui_print("Rebooting...\n");
- + else
- + ui_print("Shutting down...\n");
- sync();
- ! reboot((!poweroff) ? RB_AUTOBOOT : RB_POWER_OFF);
- return EXIT_SUCCESS;
- }
- diff -wrp /home/techmik/android/system/bootable/recovery//recovery_ui.h /home/techmik/cm-main/android_bootable_recovery/recovery_ui.h
- *** /home/techmik/android/system/bootable/recovery//recovery_ui.h 2011-04-01 04:16:02.000000000 -0400
- --- /home/techmik/cm-main/android_bootable_recovery/recovery_ui.h 2011-04-22 19:44:57.000000000 -0400
- *************** int device_wipe_data();
- *** 74,79 ****
- --- 74,80 ----
- #define ITEM_NANDROID 5
- #define ITEM_PARTITION 6
- #define ITEM_ADVANCED 7
- + #define ITEM_POWEROFF 8
- // Header text to display above the main menu.
- extern char* MENU_HEADERS[];
- diff -wrp /home/techmik/android/system/bootable/recovery//roots.c /home/techmik/cm-main/android_bootable_recovery/roots.c
- *** /home/techmik/android/system/bootable/recovery//roots.c 2011-04-01 04:16:02.000000000 -0400
- --- /home/techmik/cm-main/android_bootable_recovery/roots.c 2011-04-22 19:44:57.000000000 -0400
- *************** Volume* get_device_volumes() {
- *** 39,44 ****
- --- 39,58 ----
- return device_volumes;
- }
- + static int is_null(const char* sz) {
- + if (sz == NULL)
- + return 1;
- + if (strcmp("NULL", sz) == 0)
- + return 1;
- + return 0;
- + }
- +
- + static char* dupe_string(const char* sz) {
- + if (is_null(sz))
- + return NULL;
- + return strdup(sz);
- + }
- +
- void load_volume_table() {
- int alloc = 2;
- device_volumes = malloc(alloc * sizeof(Volume));
- *************** void load_volume_table() {
- *** 48,53 ****
- --- 62,69 ----
- device_volumes[0].fs_type = "ramdisk";
- device_volumes[0].device = NULL;
- device_volumes[0].device2 = NULL;
- + device_volumes[0].fs_options = NULL;
- + device_volumes[0].fs_options2 = NULL;
- num_volumes = 1;
- FILE* fstab = fopen("/etc/recovery.fstab", "r");
- *************** void load_volume_table() {
- *** 70,75 ****
- --- 86,94 ----
- // lines may optionally have a second device, to use if
- // mounting the first one fails.
- char* device2 = strtok(NULL, " \t\n");
- + char* fs_type2 = strtok(NULL, " \t\n");
- + char* fs_options = strtok(NULL, " \t\n");
- + char* fs_options2 = strtok(NULL, " \t\n");
- if (mount_point && fs_type && device) {
- while (num_volumes >= alloc) {
- *************** void load_volume_table() {
- *** 77,86 ****
- device_volumes = realloc(device_volumes, alloc*sizeof(Volume));
- }
- device_volumes[num_volumes].mount_point = strdup(mount_point);
- ! device_volumes[num_volumes].fs_type = strdup(fs_type);
- device_volumes[num_volumes].device = strdup(device);
- device_volumes[num_volumes].device2 =
- ! device2 ? strdup(device2) : NULL;
- ++num_volumes;
- } else {
- LOGE("skipping malformed recovery.fstab line: %s\n", original);
- --- 96,115 ----
- device_volumes = realloc(device_volumes, alloc*sizeof(Volume));
- }
- device_volumes[num_volumes].mount_point = strdup(mount_point);
- ! device_volumes[num_volumes].fs_type = !is_null(fs_type2) ? strdup(fs_type2) : strdup(fs_type);
- device_volumes[num_volumes].device = strdup(device);
- device_volumes[num_volumes].device2 =
- ! !is_null(device2) ? strdup(device2) : NULL;
- ! device_volumes[num_volumes].fs_type2 = !is_null(fs_type2) ? strdup(fs_type) : NULL;
- !
- ! if (!is_null(fs_type2)) {
- ! device_volumes[num_volumes].fs_options2 = dupe_string(fs_options);
- ! device_volumes[num_volumes].fs_options = dupe_string(fs_options2);
- ! }
- ! else {
- ! device_volumes[num_volumes].fs_options2 = NULL;
- ! device_volumes[num_volumes].fs_options = dupe_string(fs_options);
- ! }
- ++num_volumes;
- } else {
- LOGE("skipping malformed recovery.fstab line: %s\n", original);
- *************** Volume* volume_for_path(const char* path
- *** 113,118 ****
- --- 142,167 ----
- return NULL;
- }
- + int try_mount(const char* device, const char* mount_point, const char* fs_type, const char* fs_options) {
- + if (device == NULL || mount_point == NULL || fs_type == NULL)
- + return -1;
- + int ret = 0;
- + if (fs_options == NULL) {
- + ret = mount(device, mount_point, fs_type,
- + MS_NOATIME | MS_NODEV | MS_NODIRATIME, "");
- + }
- + else {
- + char mount_cmd[PATH_MAX];
- + sprintf(mount_cmd, "mount -t %s -o%s %s %s", fs_type, fs_options, device, mount_point);
- + LOGE("%s\n", mount_cmd);
- + ret = __system(mount_cmd);
- + }
- + if (ret == 0)
- + return 0;
- + LOGW("failed to mount %s (%s)\n", device, strerror(errno));
- + return ret;
- + }
- +
- int ensure_path_mounted(const char* path) {
- Volume* v = volume_for_path(path);
- if (v == NULL) {
- *************** int ensure_path_mounted(const char* path
- *** 152,172 ****
- }
- return mtd_mount_partition(partition, v->mount_point, v->fs_type, 0);
- } else if (strcmp(v->fs_type, "ext4") == 0 ||
- strcmp(v->fs_type, "vfat") == 0) {
- ! result = mount(v->device, v->mount_point, v->fs_type,
- ! MS_NOATIME | MS_NODEV | MS_NODIRATIME, "");
- ! if (result == 0) return 0;
- !
- ! if (v->device2) {
- ! LOGW("failed to mount %s (%s); trying %s\n",
- ! v->device, strerror(errno), v->device2);
- ! result = mount(v->device2, v->mount_point, v->fs_type,
- ! MS_NOATIME | MS_NODEV | MS_NODIRATIME, "");
- ! if (result == 0) return 0;
- ! }
- !
- ! LOGE("failed to mount %s (%s)\n", v->mount_point, strerror(errno));
- ! return -1;
- } else {
- // let's try mounting with the mount binary and hope for the best.
- char mount_cmd[PATH_MAX];
- --- 201,218 ----
- }
- return mtd_mount_partition(partition, v->mount_point, v->fs_type, 0);
- } else if (strcmp(v->fs_type, "ext4") == 0 ||
- + strcmp(v->fs_type, "ext3") == 0 ||
- + strcmp(v->fs_type, "rfs") == 0 ||
- strcmp(v->fs_type, "vfat") == 0) {
- ! if ((result = try_mount(v->device, v->mount_point, v->fs_type, v->fs_options)) == 0)
- ! return 0;
- ! if ((result = try_mount(v->device2, v->mount_point, v->fs_type, v->fs_options)) == 0)
- ! return 0;
- ! if ((result = try_mount(v->device, v->mount_point, v->fs_type2, v->fs_options2)) == 0)
- ! return 0;
- ! if ((result = try_mount(v->device2, v->mount_point, v->fs_type2, v->fs_options2)) == 0)
- ! return 0;
- ! return result;
- } else {
- // let's try mounting with the mount binary and hope for the best.
- char mount_cmd[PATH_MAX];
- diff -wrp /home/techmik/android/system/bootable/recovery//utilities/Android.mk /home/techmik/cm-main/android_bootable_recovery/utilities/Android.mk
- *** /home/techmik/android/system/bootable/recovery//utilities/Android.mk 2011-04-01 04:16:02.000000000 -0400
- --- /home/techmik/cm-main/android_bootable_recovery/utilities/Android.mk 2011-04-22 19:44:57.000000000 -0400
- *************** LOCAL_MODULE_PATH := $(TARGET_RECOVERY_R
- *** 42,45 ****
- --- 42,89 ----
- LOCAL_SRC_FILES := $(LOCAL_MODULE)
- include $(BUILD_PREBUILT)
- + ifeq ($(BOARD_HAS_LARGE_FILESYSTEM),true)
- + include $(CLEAR_VARS)
- + LOCAL_MODULE := mke2fs
- + LOCAL_MODULE_TAGS := eng
- + LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
- + LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
- + LOCAL_SRC_FILES := $(LOCAL_MODULE)
- + include $(BUILD_PREBUILT)
- + endif
- +
- + ifeq ($(BOARD_USES_RECOVERY_CHARGEMODE),true)
- + include $(CLEAR_VARS)
- + LOCAL_MODULE := choice_fn
- + LOCAL_MODULE_TAGS := eng
- + LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
- + LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
- + LOCAL_SRC_FILES := $(LOCAL_MODULE)
- + include $(BUILD_PREBUILT)
- +
- + include $(CLEAR_VARS)
- + LOCAL_MODULE := power_test
- + LOCAL_MODULE_TAGS := eng
- + LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
- + LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
- + LOCAL_SRC_FILES := $(LOCAL_MODULE)
- + include $(BUILD_PREBUILT)
- +
- + include $(CLEAR_VARS)
- + LOCAL_MODULE := offmode_charging
- + LOCAL_MODULE_TAGS := eng
- + LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
- + LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
- + LOCAL_SRC_FILES := $(LOCAL_MODULE)
- + include $(BUILD_PREBUILT)
- +
- + include $(CLEAR_VARS)
- + LOCAL_MODULE := detect_key
- + LOCAL_MODULE_TAGS := eng
- + LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
- + LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
- + LOCAL_SRC_FILES := $(LOCAL_MODULE)
- + include $(BUILD_PREBUILT)
- + endif
- +
- endif
- Only in /home/techmik/cm-main/android_bootable_recovery/utilities: choice_fn
- Only in /home/techmik/cm-main/android_bootable_recovery/utilities: detect_key
- Only in /home/techmik/cm-main/android_bootable_recovery/utilities: mke2fs
- Only in /home/techmik/cm-main/android_bootable_recovery/utilities: offmode_charging
- Only in /home/techmik/cm-main/android_bootable_recovery/utilities: power_test
- diff -wrp /home/techmik/android/system/bootable/recovery//utilities/sdparted /home/techmik/cm-main/android_bootable_recovery/utilities/sdparted
- *** /home/techmik/android/system/bootable/recovery//utilities/sdparted 2011-04-01 04:16:02.000000000 -0400
- --- /home/techmik/cm-main/android_bootable_recovery/utilities/sdparted 2011-04-22 19:44:57.000000000 -0400
- *************** TTISMSDOS=
- *** 546,557 ****
- SDSIZE=
- SDSIZEMB=
- ! if [ -z "$SDPATH" ]
- then
- ! SDPATH="/dev/block/mmcblk0"
- else
- ! echo Found SDPATH=$SDPATH
- fi
- FATSIZE=
- FATTYPE="fat32"
- --- 546,574 ----
- SDSIZE=
- SDSIZEMB=
- ! SDINFO=$(cat /etc/fstab | grep /sdcard | awk '{print $1}')
- ! if [ -L "$SDINFO" ]
- then
- ! SDPATH=$(ls -l $SDINFO | awk '{print $11}')
- else
- ! SDPATH=$SDINFO
- fi
- + # we may now have an SDPATH, let's make sure its on mmcblkX or mmcblkXp1
- + CHECK_SDPATH1=$(echo $SDPATH | grep mmcblk.$)
- + CHECK_SDPATH2=$(echo $SDPATH | grep mmcblk.p1$)
- + if [ -z "$CHECK_SDPATH1" ]
- + then
- + if [ -z "$CHECK_SDPATH2" ]
- + then
- + echo fail1
- + unset SDPATH
- + else
- + LEN=${#SDPATH}
- + BLKLEN=$(expr $LEN - 2)
- + SDPATH=${SDPATH:0:$BLKLEN}
- + fi
- + fi
- +
- FATSIZE=
- FATTYPE="fat32"
- techmik@michaels-laptop:~$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement