Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(611)

Unified Diff: src/platform/update_engine/utils.cc

Issue 1881001: AU: Many minor cleanup changes (Closed) Base URL: ssh://git@chromiumos-git/chromeos
Patch Set: fixes for review Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform/update_engine/utils.h ('k') | src/platform/update_engine/utils_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/update_engine/utils.cc
diff --git a/src/platform/update_engine/utils.cc b/src/platform/update_engine/utils.cc
index 83096d28378698df786e0b3aebdb54223ffad27b..b19e6fc112ea29b2b74397970fd6da3e87965720 100644
--- a/src/platform/update_engine/utils.cc
+++ b/src/platform/update_engine/utils.cc
@@ -195,6 +195,30 @@ bool RecursiveUnlinkDir(const std::string& path) {
return true;
}
+string RootDevice(const string& partition_device) {
+ CHECK(!partition_device.empty());
+ string::const_iterator it = --partition_device.end();
+ for (; it >= partition_device.begin(); --it) {
+ if (!isdigit(*it))
+ break;
+ }
+ // Some devices contain a p before the partitions. For example:
+ // /dev/mmc0p4 should be shortened to /dev/mmc0.
+ if (*it == 'p')
+ --it;
+ return string(partition_device.begin(), it + 1);
+}
+
+string PartitionNumber(const string& partition_device) {
+ CHECK(!partition_device.empty());
+ string::const_iterator it = --partition_device.end();
+ for (; it >= partition_device.begin(); --it) {
+ if (!isdigit(*it))
+ break;
+ }
+ return string(it + 1, partition_device.end());
+}
+
std::string ErrnoNumberAsString(int err) {
char buf[100];
buf[0] = '\0';
@@ -357,6 +381,12 @@ bool UnmountFilesystem(const string& mountpoint) {
return true;
}
+bool GetBootloader(BootLoader* out_bootloader) {
+ // For now, hardcode to syslinux.
+ *out_bootloader = BootLoader_SYSLINUX;
+ return true;
+}
+
const char* GetGErrorMessage(const GError* error) {
if (!error)
return "Unknown error.";
« no previous file with comments | « src/platform/update_engine/utils.h ('k') | src/platform/update_engine/utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698