Added function to provide the short board name of the device
To be used in Chrome OS when separating functionality based on board.
Fixed the bad usage of GetLsbReleaseBoard().
BUG=653814,663857
Review-Url: https://codereview.chromium.org/2489853002
Cr-Commit-Position: refs/heads/master@{#435679}
CrOS-Libchrome-Original-Commit: 1a5a3f57210bc089a74d37ef6cc50f034d281c41
diff --git a/base/sys_info.h b/base/sys_info.h
index b107477..e35feff 100644
--- a/base/sys_info.h
+++ b/base/sys_info.h
@@ -107,9 +107,19 @@
static bool GetLsbReleaseValue(const std::string& key, std::string* value);
// Convenience function for GetLsbReleaseValue("CHROMEOS_RELEASE_BOARD",...).
- // Returns "unknown" if CHROMEOS_RELEASE_BOARD is not set.
+ // Returns "unknown" if CHROMEOS_RELEASE_BOARD is not set. Otherwise returns
+ // the full name of the board. WARNING: the returned value often differs in
+ // developer built system compared to devices that use the official version.
+ // E.g. for developer built version, the function could return 'glimmer' while
+ // for officially used versions it would be like 'glimmer-signed-mp-v4keys'.
+ // Use GetStrippedReleaseBoard() function if you need only the short name of
+ // the board (would be 'glimmer' in the case described above).
static std::string GetLsbReleaseBoard();
+ // Convenience function for GetLsbReleaseBoard() removing trailing "-signed-*"
+ // if present. Returns "unknown" if CHROMEOS_RELEASE_BOARD is not set.
+ static std::string GetStrippedReleaseBoard();
+
// Returns the creation time of /etc/lsb-release. (Used to get the date and
// time of the Chrome OS build).
static Time GetLsbReleaseTime();