blob: 600a0129d5a2e89c51941f5bb81b2849442a2c81 [file] [log] [blame]
Chris Masonef8d037f2014-02-19 01:53:00 +00001// Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "update_engine/hwid_override.h"
6
7#include <map>
8#include <string>
9
10#include <base/basictypes.h>
Alex Vakulenko75039d72014-03-25 12:36:28 -070011#include <base/files/file_path.h>
Chris Masonef8d037f2014-02-19 01:53:00 +000012#include <base/file_util.h>
13
14#include "update_engine/simple_key_value_store.h"
15
16using std::map;
17using std::string;
18
19namespace chromeos_update_engine {
20
21const char HwidOverride::kHwidOverrideKey[] = "HWID_OVERRIDE";
22
23HwidOverride::HwidOverride() {}
24
25HwidOverride::~HwidOverride() {}
26
27std::string HwidOverride::Read(const base::FilePath& root) {
Alex Deymoa7658442014-04-17 15:49:37 -070028 KeyValueStore lsb_release;
29 lsb_release.Load(root.value() + "/etc/lsb-release");
30 string result;
31 if (lsb_release.GetString(kHwidOverrideKey, &result))
32 return result;
33 return "";
Chris Masonef8d037f2014-02-19 01:53:00 +000034}
35
36} // namespace chromeos_update_engine