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

Unified Diff: utils.h

Issue 2868105: Disable automatic update checks if booting from a removable device. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: Created 10 years, 4 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 | « main.cc ('k') | utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils.h
diff --git a/utils.h b/utils.h
index f7f734ed322bf38ae2a1fd088e8661b170999b5b..6ce4cf36ad20ed219ddc8d681af902af63b58024 100644
--- a/utils.h
+++ b/utils.h
@@ -84,13 +84,24 @@ bool MakeTempDirectory(const std::string& dirname_template,
bool RecursiveUnlinkDir(const std::string& path);
// Returns the root device for a partition. For example,
-// RootDevice("/dev/sda3") returns "/dev/sda".
+// RootDevice("/dev/sda3") returns "/dev/sda". Returns an empty string
+// if the input device is not of the "/dev/xyz" form.
std::string RootDevice(const std::string& partition_device);
// Returns the partition number, as a string, of partition_device. For example,
-// PartitionNumber("/dev/sda3") return "3".
+// PartitionNumber("/dev/sda3") returns "3".
std::string PartitionNumber(const std::string& partition_device);
+// Returns the sysfs block device for a root block device. For
+// example, SysfsBlockDevice("/dev/sda") returns
+// "/sys/block/sda". Returns an empty string if the input device is
+// not of the "/dev/xyz" form.
+std::string SysfsBlockDevice(const std::string& device);
+
+// Returns true if the root |device| (e.g., "/dev/sdb") is known to be
+// removable, false otherwise.
+bool IsRemovableDevice(const std::string& device);
+
// Synchronously mount or unmount a filesystem. Return true on success.
// Mounts as ext3 with default options.
bool MountFilesystem(const std::string& device, const std::string& mountpoint,
« no previous file with comments | « main.cc ('k') | utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698