OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/login/hwid_checker.h" | 5 #include "chrome/browser/chromeos/login/hwid_checker.h" |
6 | 6 |
7 #include <cstdio> | 7 #include <cstdio> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 LOG(ERROR) << "Couldn't get machine statistic 'hardware_class'."; | 126 LOG(ERROR) << "Couldn't get machine statistic 'hardware_class'."; |
127 return false; | 127 return false; |
128 } | 128 } |
129 if (!chromeos::IsHWIDCorrect(hwid)) { | 129 if (!chromeos::IsHWIDCorrect(hwid)) { |
130 // Log the system vendor info to see what the system vendor is on the GCE | 130 // Log the system vendor info to see what the system vendor is on the GCE |
131 // VMs. This info will be used to filter out error messages on VMs. See | 131 // VMs. This info will be used to filter out error messages on VMs. See |
132 // http://crbug.com/585514 and http://crbug.com/585515 for more info. | 132 // http://crbug.com/585514 and http://crbug.com/585515 for more info. |
133 std::string system_vendor; | 133 std::string system_vendor; |
134 stats->GetMachineStatistic(chromeos::system::kSystemVendorKey, | 134 stats->GetMachineStatistic(chromeos::system::kSystemVendorKey, |
135 &system_vendor); | 135 &system_vendor); |
136 LOG(ERROR) << "Machine has malformed HWID '" << hwid << "'. " | 136 std::string firmware_type; |
137 << "The system vendor is '" << system_vendor << "'."; | 137 const bool non_chrome_firmware = |
138 return false; | 138 stats->GetMachineStatistic(chromeos::system::kFirmwareTypeKey, |
| 139 &firmware_type) && |
| 140 firmware_type == system::kFirmwareTypeValueNonchrome; |
| 141 if (non_chrome_firmware) { |
| 142 LOG(WARNING) << "Detected non-Chrome firmware with malformed HWID '" |
| 143 << hwid << "', assuming VM environment. " |
| 144 << "The system vendor is '" << system_vendor << "'."; |
| 145 } else { |
| 146 LOG(ERROR) << "Machine has malformed HWID '" << hwid << "'. " |
| 147 << "The system vendor is '" << system_vendor << "'."; |
| 148 return false; |
| 149 } |
139 } | 150 } |
140 return true; | 151 return true; |
141 } | 152 } |
142 | 153 |
143 } // namespace chromeos | 154 } // namespace chromeos |
OLD | NEW |