recovery: Mount firmware image for MDTP
MDTP requires existence of /firmware for the mdtpsecapp TA binary.
This change mounts the modem image under /firmware. This change also
makes sure that /firmware directory is created by the recovery init.rc.
Change-Id: Icdf8bddcd593e14edaed8f82d937f3adc654ed0a
CRs-Fixed: 1074574
diff --git a/install.cpp b/install.cpp
index 0860d85..a8d10e5 100644
--- a/install.cpp
+++ b/install.cpp
@@ -291,7 +291,6 @@
ui->Print("Running MDTP integrity verification and update...\n");
/* Make sure system partition is mounted, so MDTP can process its content. */
- mkdir("/system", 0755);
status = mount("/dev/block/bootdevice/by-name/system", "/system", "ext4",
MS_NOATIME | MS_NODEV | MS_NODIRATIME |
MS_RDONLY, "");
@@ -302,6 +301,16 @@
return 0;
}
+ status = mount("/dev/block/bootdevice/by-name/modem", "/firmware", "vfat",
+ MS_NOATIME | MS_NODEV | MS_NODIRATIME |
+ MS_RDONLY, "");
+
+ if (status) {
+ LOGE("Failed to mount the modem (firmware) partition, error=%s.\n", strerror(errno));
+ free(args);
+ return 0;
+ }
+
status = 0;
pid_t pid = fork();
@@ -318,6 +327,7 @@
/* Leave the system partition unmounted before we finish. */
umount("/system");
+ umount("/firmware");
free(args);