summaryrefslogtreecommitdiffstats
path: root/updater/build_info.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--updater/build_info.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/updater/build_info.cpp b/updater/build_info.cpp
index 3072aab54..f168008ec 100644
--- a/updater/build_info.cpp
+++ b/updater/build_info.cpp
@@ -16,6 +16,8 @@
#include "updater/build_info.h"
+#include <stdio.h>
+
#include <set>
#include <vector>
@@ -55,12 +57,23 @@ bool BuildInfo::ParseTargetFile(const std::string_view target_file_path, bool ex
return false;
}
+ std::string mapped_path = image_file.path;
+ // Rename the images to more readable ones if we want to keep the image.
+ if (keep_images_) {
+ mapped_path = work_dir_ + fstab_info.mount_point + ".img";
+ image_file.release();
+ if (rename(image_file.path, mapped_path.c_str()) != 0) {
+ PLOG(ERROR) << "Failed to rename " << image_file.path << " to " << mapped_path;
+ return false;
+ }
+ }
+
LOG(INFO) << "Mounted " << fstab_info.mount_point << "\nMapping: " << fstab_info.blockdev_name
- << " to " << image_file.path;
+ << " to " << mapped_path;
blockdev_map_.emplace(
fstab_info.blockdev_name,
- FakeBlockDevice(fstab_info.blockdev_name, fstab_info.mount_point, image_file.path));
+ FakeBlockDevice(fstab_info.blockdev_name, fstab_info.mount_point, mapped_path));
break;
}
}