forked from CyanogenMod/android_bootable_recovery
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for boot and recovery partitions backup
EMMC of MTK6589 is a large continuous block covering all partitions. Recovery and boot partitions definitions are somewhat hidden from MBR and /proc/emmc disabling CWM to determine correct sizes of these partitions automatically. This results in CWM using standard fseek/ftell method which returns the size of the whole EMMC which can be several Gigabytes. This commit enables to define sizes for boot and recovery partitions explicitly using BoardConfig flags - so the correct number of bytes can be copied from these devices during backup. Two pairs of config flags are available: CWM_EMMC_BOOT_DEVICE_NAME: defines the name of boot partition device (typically /dev/bootimg) CWM_EMMC_BOOT_DEVICE_SIZE: defines size of boot partition in bytes CWM_EMMC_RECOVERY_DEVICE_NAME: defines the name of recovery partition device (typically /dev/recovery) CWM_EMMC_RECOVERY_DEVICE_SIZE: defines size of recovery partition in bytes During backup, the name of partition being processed is checked against defined *DEVICE_NAME flag. If matches then size is set from the corresponding *DEVICE_SIZE flag. Change-Id: Ia5b8fbd50ff234301ce812e39a648c5cce87e284
- Loading branch information
Showing
2 changed files
with
53 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
226e86a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for you , my device is mt6589 , but i can't mount the usb SD card on the cwm recovery6031
226e86a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mounting works fine here. Maybe your local driver issue? Note, that only external SD can be mounted as USB storage.
226e86a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
USE_CAMERA_STUB := true
inherit from the proprietary version
-include vendor/mogu/m2/BoardConfigVendor.mk
TARGET_ARCH= arm
TARGET_NO_BOOTLOADER := true
TARGET_BOARD_PLATFORM := mt657x
TARGET_ARCH_VARIANT_CPU := cortex-a9
TARGET_CPU_ABI := armeabi
TARGET_ARCH_VARIANT := armv7-a-neon
ARCH_ARM_HAVE_TLS_REGISTER := true
TARGET_PREBUILT_KERNEL := device/mogu/m2/kernel
BOARD_KERNEL_CMDLINE :=
BOARD_KERNEL_BASE := 0x10000000
BOARD_KERNEL_PAGESIZE := 2048
TARGET_BOOTLOADER_BOARD_NAME := m2
BOARD_HAS_NO_SELECT_BUTTON := true
Recovery
TARGET_RECOVERY_FSTAB := device/mogu/m2/recovery/recovery.fstab
TARGET_RECOVERY_INITRC := device/mogu/m2/recovery/recovery.rc
BOARD_CUSTOM_RECOVERY_KEYMAPPING := ../../device/mogu/m2/recovery/recovery_keys.c
CWM_EMMC_BOOT_DEVICE_NAME := /dev/bootimg
CWM_EMMC_BOOT_DEVICE_SIZE := 0x105c0000
CWM_EMMC_RECOVERY_DEVICE_NAME := /dev/recovery
CWM_EMMC_RECOVERY_DEVICE_SIZE := 0x105c0000
BOARD_BOOTIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_FLASH_BLOCK_SIZE := 131072
BOARD_UMS_LUNFILE := /sys/devices/platform/mt_usb/gadget/lun%d/file
226e86a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is my BoardConfig.mk .Maybe your local driver issue? how to know driver issue ,usb connection can't mount the external storage
226e86a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use my device config from here:
https://github.com/C3C0/android_device_thl_w8 (compatible with android 4.1.2)
and
https://github.com/C3C0/android_device_thl_w8/tree/cwm-4.2 (compatible with android 4.2.1)
You could also wait for the newer version (6.0.3.2) which will include further improvements.
226e86a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a line:
BOARD_UMS_LUNFILE := /sys/devices/platform/mt_usb/gadget/lun%d/file
init.rc add:
write /sys/device/platform/mt_usb/cmode 1
but usb cannot be mounted too.
226e86a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you very much!!