From 6afbcdc6516957f88e01a1e748e2554b37c60051 Mon Sep 17 00:00:00 2001 From: Kolja Dummann Date: Sun, 24 Jul 2011 21:40:16 +0200 Subject: [PATCH] handle mounts in recovery if the have only one argument controlled by BOARD_RECOVERY_HANDLES_MOUNT if it is not set the recovery will behave like before. this allows the recovery to handle commands like 'mount system' it is needed for devices with two different filesystem in recovery.fstab like RFS and EXT4 cause the regular recovery behaviour will only generate a fstab for mounts of fstype2 and ignore the other fstype. This will also enable things like run_program("/sbin/busybox", "mount", "/system"); on those system. Change-Id: Ib10ffc7735a2edb8dd32be230ba885d5d2744f73 --- Android.mk | 2 +- recovery.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Android.mk b/Android.mk index 336f75f..c660ae0 100644 --- a/Android.mk +++ b/Android.mk @@ -38,7 +38,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_UMS_LUNFILE BOARD_RECOVERY_ALWAYS_WIPES +BOARD_RECOVERY_DEFINES := BOARD_HAS_NO_SELECT_BUTTON BOARD_HAS_SMALL_RECOVERY BOARD_LDPI_RECOVERY BOARD_UMS_LUNFILE BOARD_RECOVERY_ALWAYS_WIPES BOARD_RECOVERY_HANDLES_MOUNT $(foreach board_define,$(BOARD_RECOVERY_DEFINES), \ $(if $($(board_define)), \ diff --git a/recovery.c b/recovery.c index 89fb214..d0dee32 100644 --- a/recovery.c +++ b/recovery.c @@ -787,6 +787,13 @@ main(int argc, char **argv) { return nandroid_main(argc, argv); if (strstr(argv[0], "reboot")) return reboot_main(argc, argv); +#ifdef BOARD_RECOVERY_HANDLES_MOUNT + if (strstr(argv[0], "mount") && argc == 2 && !strstr(argv[0], "umount")) + { + load_volume_table(); + return ensure_path_mounted(argv[1]); + } +#endif if (strstr(argv[0], "poweroff")){ return reboot_main(argc, argv); }