option to specify usb_mass_storage device in device overlay

This commit is contained in:
jt1134 2011-02-27 18:54:09 -06:00 committed by Koushik Dutta
parent 7161f35736
commit 47d86a35bc
2 changed files with 8 additions and 5 deletions

View File

@ -31,7 +31,7 @@ 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_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)), \

View File

@ -340,12 +340,15 @@ void show_nandroid_restore_menu()
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("/sys/devices/platform/usb_mass_storage/lun0/file",
O_WRONLY)) < 0) {
if ((fd = open(BOARD_UMS_LUNFILE, O_WRONLY)) < 0) {
LOGE("Unable to open ums lunfile (%s)", strerror(errno));
return -1;
}
@ -371,7 +374,7 @@ void show_mount_usb_storage_menu()
break;
}
if ((fd = open("/sys/devices/platform/usb_mass_storage/lun0/file", O_WRONLY)) < 0) {
if ((fd = open(BOARD_UMS_LUNFILE, O_WRONLY)) < 0) {
LOGE("Unable to open ums lunfile (%s)", strerror(errno));
return -1;
}
@ -1130,4 +1133,4 @@ void handle_chargemode() {
if (strstr(file_data, "androidboot.mode=offmode_charging") != NULL)
reboot(RB_POWER_OFF);
}
}