blob: 95b5ec9ad785d8dbbb1b0a17ad8131cc3b73a065 [file] [log] [blame]
Darin Petkov296889c2010-07-23 16:20:54 -07001// Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
adlr@google.com3defe6a2009-12-04 20:57:17 +00002// 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/utils.h"
Darin Petkovf74eb652010-08-04 12:08:38 -07006
adlr@google.com3defe6a2009-12-04 20:57:17 +00007#include <sys/mount.h>
Darin Petkovc6c135c2010-08-11 13:36:18 -07008#include <sys/resource.h>
adlr@google.com3defe6a2009-12-04 20:57:17 +00009#include <sys/stat.h>
10#include <sys/types.h>
Andrew de los Reyes712b3ac2011-01-07 13:47:52 -080011#include <sys/wait.h>
adlr@google.com3defe6a2009-12-04 20:57:17 +000012#include <dirent.h>
13#include <errno.h>
Andrew de los Reyes970bb282009-12-09 16:34:04 -080014#include <fcntl.h>
adlr@google.com3defe6a2009-12-04 20:57:17 +000015#include <stdio.h>
16#include <stdlib.h>
17#include <string.h>
18#include <unistd.h>
Darin Petkovf74eb652010-08-04 12:08:38 -070019
adlr@google.com3defe6a2009-12-04 20:57:17 +000020#include <algorithm>
Darin Petkovf74eb652010-08-04 12:08:38 -070021
Darin Petkovd3f8c892010-10-12 21:38:45 -070022#include <base/eintr_wrapper.h>
Will Drewry8f71da82010-08-30 14:07:11 -050023#include <base/file_path.h>
24#include <base/file_util.h>
25#include <base/rand_util.h>
26#include <base/string_util.h>
27#include <base/logging.h>
28#include <rootdev/rootdev.h>
29
Andrew de los Reyes970bb282009-12-09 16:34:04 -080030#include "update_engine/file_writer.h"
Darin Petkov33d30642010-08-04 10:18:57 -070031#include "update_engine/omaha_request_params.h"
Darin Petkov296889c2010-07-23 16:20:54 -070032#include "update_engine/subprocess.h"
adlr@google.com3defe6a2009-12-04 20:57:17 +000033
34using std::min;
35using std::string;
36using std::vector;
37
38namespace chromeos_update_engine {
39
40namespace utils {
41
Darin Petkov2a0e6332010-09-24 14:43:41 -070042static const char kOOBECompletedMarker[] = "/home/chronos/.oobe_completed";
Darin Petkova07586b2010-10-20 13:41:15 -070043static const char kDevImageMarker[] = "/root/.dev_mode";
Darin Petkov2a0e6332010-09-24 14:43:41 -070044
Darin Petkov33d30642010-08-04 10:18:57 -070045bool IsOfficialBuild() {
Darin Petkova07586b2010-10-20 13:41:15 -070046 return !file_util::PathExists(FilePath(kDevImageMarker));
Darin Petkov33d30642010-08-04 10:18:57 -070047}
48
Darin Petkov2a0e6332010-09-24 14:43:41 -070049bool IsOOBEComplete() {
50 return file_util::PathExists(FilePath(kOOBECompletedMarker));
51}
52
Andrew de los Reyes970bb282009-12-09 16:34:04 -080053bool WriteFile(const char* path, const char* data, int data_len) {
54 DirectFileWriter writer;
55 TEST_AND_RETURN_FALSE_ERRNO(0 == writer.Open(path,
56 O_WRONLY | O_CREAT | O_TRUNC,
Chris Masone4dc2ada2010-09-23 12:43:03 -070057 0600));
Andrew de los Reyes970bb282009-12-09 16:34:04 -080058 ScopedFileWriterCloser closer(&writer);
59 TEST_AND_RETURN_FALSE_ERRNO(data_len == writer.Write(data, data_len));
60 return true;
61}
62
Andrew de los Reyes09e56d62010-04-23 13:45:53 -070063bool WriteAll(int fd, const void* buf, size_t count) {
Andrew de los Reyesb10320d2010-03-31 16:44:44 -070064 const char* c_buf = static_cast<const char*>(buf);
65 ssize_t bytes_written = 0;
66 while (bytes_written < static_cast<ssize_t>(count)) {
67 ssize_t rc = write(fd, c_buf + bytes_written, count - bytes_written);
68 TEST_AND_RETURN_FALSE_ERRNO(rc >= 0);
69 bytes_written += rc;
70 }
71 return true;
72}
73
Andrew de los Reyes09e56d62010-04-23 13:45:53 -070074bool PWriteAll(int fd, const void* buf, size_t count, off_t offset) {
75 const char* c_buf = static_cast<const char*>(buf);
76 ssize_t bytes_written = 0;
77 while (bytes_written < static_cast<ssize_t>(count)) {
78 ssize_t rc = pwrite(fd, c_buf + bytes_written, count - bytes_written,
79 offset + bytes_written);
80 TEST_AND_RETURN_FALSE_ERRNO(rc >= 0);
81 bytes_written += rc;
82 }
83 return true;
84}
85
86bool PReadAll(int fd, void* buf, size_t count, off_t offset,
87 ssize_t* out_bytes_read) {
88 char* c_buf = static_cast<char*>(buf);
89 ssize_t bytes_read = 0;
90 while (bytes_read < static_cast<ssize_t>(count)) {
91 ssize_t rc = pread(fd, c_buf + bytes_read, count - bytes_read,
92 offset + bytes_read);
93 TEST_AND_RETURN_FALSE_ERRNO(rc >= 0);
94 if (rc == 0) {
95 break;
96 }
97 bytes_read += rc;
98 }
99 *out_bytes_read = bytes_read;
100 return true;
Darin Petkov296889c2010-07-23 16:20:54 -0700101
Andrew de los Reyes09e56d62010-04-23 13:45:53 -0700102}
103
adlr@google.com3defe6a2009-12-04 20:57:17 +0000104bool ReadFile(const std::string& path, std::vector<char>* out) {
105 CHECK(out);
106 FILE* fp = fopen(path.c_str(), "r");
107 if (!fp)
108 return false;
109 const size_t kChunkSize = 1024;
110 size_t read_size;
111 do {
112 char buf[kChunkSize];
113 read_size = fread(buf, 1, kChunkSize, fp);
114 if (read_size == 0)
115 break;
116 out->insert(out->end(), buf, buf + read_size);
117 } while (read_size == kChunkSize);
118 bool success = !ferror(fp);
119 TEST_AND_RETURN_FALSE_ERRNO(fclose(fp) == 0);
120 return success;
121}
122
123bool ReadFileToString(const std::string& path, std::string* out) {
124 vector<char> data;
125 bool success = ReadFile(path, &data);
126 if (!success) {
127 return false;
128 }
129 (*out) = string(&data[0], data.size());
130 return true;
131}
132
Andrew de los Reyesf4c7ef12010-04-30 10:37:00 -0700133off_t FileSize(const string& path) {
134 struct stat stbuf;
135 int rc = stat(path.c_str(), &stbuf);
136 CHECK_EQ(rc, 0);
137 if (rc < 0)
138 return rc;
139 return stbuf.st_size;
140}
141
adlr@google.com3defe6a2009-12-04 20:57:17 +0000142void HexDumpArray(const unsigned char* const arr, const size_t length) {
143 const unsigned char* const char_arr =
144 reinterpret_cast<const unsigned char* const>(arr);
145 LOG(INFO) << "Logging array of length: " << length;
146 const unsigned int bytes_per_line = 16;
Andrew de los Reyes08c4e272010-04-15 14:02:17 -0700147 for (uint32_t i = 0; i < length; i += bytes_per_line) {
adlr@google.com3defe6a2009-12-04 20:57:17 +0000148 const unsigned int bytes_remaining = length - i;
149 const unsigned int bytes_per_this_line = min(bytes_per_line,
150 bytes_remaining);
151 char header[100];
152 int r = snprintf(header, sizeof(header), "0x%08x : ", i);
153 TEST_AND_RETURN(r == 13);
154 string line = header;
155 for (unsigned int j = 0; j < bytes_per_this_line; j++) {
156 char buf[20];
157 unsigned char c = char_arr[i + j];
158 r = snprintf(buf, sizeof(buf), "%02x ", static_cast<unsigned int>(c));
159 TEST_AND_RETURN(r == 3);
160 line += buf;
161 }
162 LOG(INFO) << line;
163 }
164}
165
166namespace {
167class ScopedDirCloser {
168 public:
169 explicit ScopedDirCloser(DIR** dir) : dir_(dir) {}
170 ~ScopedDirCloser() {
171 if (dir_ && *dir_) {
172 int r = closedir(*dir_);
173 TEST_AND_RETURN_ERRNO(r == 0);
174 *dir_ = NULL;
175 dir_ = NULL;
176 }
177 }
178 private:
179 DIR** dir_;
180};
181} // namespace {}
182
183bool RecursiveUnlinkDir(const std::string& path) {
184 struct stat stbuf;
185 int r = lstat(path.c_str(), &stbuf);
186 TEST_AND_RETURN_FALSE_ERRNO((r == 0) || (errno == ENOENT));
187 if ((r < 0) && (errno == ENOENT))
188 // path request is missing. that's fine.
189 return true;
190 if (!S_ISDIR(stbuf.st_mode)) {
191 TEST_AND_RETURN_FALSE_ERRNO((unlink(path.c_str()) == 0) ||
Andrew de los Reyesb10320d2010-03-31 16:44:44 -0700192 (errno == ENOENT));
adlr@google.com3defe6a2009-12-04 20:57:17 +0000193 // success or path disappeared before we could unlink.
194 return true;
195 }
196 {
197 // We have a dir, unlink all children, then delete dir
198 DIR *dir = opendir(path.c_str());
199 TEST_AND_RETURN_FALSE_ERRNO(dir);
200 ScopedDirCloser dir_closer(&dir);
201 struct dirent dir_entry;
202 struct dirent *dir_entry_p;
203 int err = 0;
204 while ((err = readdir_r(dir, &dir_entry, &dir_entry_p)) == 0) {
205 if (dir_entry_p == NULL) {
206 // end of stream reached
207 break;
208 }
209 // Skip . and ..
210 if (!strcmp(dir_entry_p->d_name, ".") ||
211 !strcmp(dir_entry_p->d_name, ".."))
212 continue;
213 TEST_AND_RETURN_FALSE(RecursiveUnlinkDir(path + "/" +
Andrew de los Reyesb10320d2010-03-31 16:44:44 -0700214 dir_entry_p->d_name));
adlr@google.com3defe6a2009-12-04 20:57:17 +0000215 }
216 TEST_AND_RETURN_FALSE(err == 0);
217 }
218 // unlink dir
219 TEST_AND_RETURN_FALSE_ERRNO((rmdir(path.c_str()) == 0) || (errno == ENOENT));
220 return true;
221}
222
Andrew de los Reyesf9714432010-05-04 10:21:23 -0700223string RootDevice(const string& partition_device) {
Darin Petkovf74eb652010-08-04 12:08:38 -0700224 FilePath device_path(partition_device);
225 if (device_path.DirName().value() != "/dev") {
226 return "";
227 }
Andrew de los Reyesf9714432010-05-04 10:21:23 -0700228 string::const_iterator it = --partition_device.end();
229 for (; it >= partition_device.begin(); --it) {
230 if (!isdigit(*it))
231 break;
232 }
233 // Some devices contain a p before the partitions. For example:
234 // /dev/mmc0p4 should be shortened to /dev/mmc0.
235 if (*it == 'p')
236 --it;
237 return string(partition_device.begin(), it + 1);
238}
239
240string PartitionNumber(const string& partition_device) {
241 CHECK(!partition_device.empty());
242 string::const_iterator it = --partition_device.end();
243 for (; it >= partition_device.begin(); --it) {
244 if (!isdigit(*it))
245 break;
246 }
247 return string(it + 1, partition_device.end());
248}
249
Darin Petkovf74eb652010-08-04 12:08:38 -0700250string SysfsBlockDevice(const string& device) {
251 FilePath device_path(device);
252 if (device_path.DirName().value() != "/dev") {
253 return "";
254 }
255 return FilePath("/sys/block").Append(device_path.BaseName()).value();
256}
257
258bool IsRemovableDevice(const std::string& device) {
259 string sysfs_block = SysfsBlockDevice(device);
260 string removable;
261 if (sysfs_block.empty() ||
262 !file_util::ReadFileToString(FilePath(sysfs_block).Append("removable"),
263 &removable)) {
264 return false;
265 }
266 TrimWhitespaceASCII(removable, TRIM_ALL, &removable);
267 return removable == "1";
268}
269
adlr@google.com3defe6a2009-12-04 20:57:17 +0000270std::string ErrnoNumberAsString(int err) {
271 char buf[100];
272 buf[0] = '\0';
273 return strerror_r(err, buf, sizeof(buf));
274}
275
276std::string NormalizePath(const std::string& path, bool strip_trailing_slash) {
277 string ret;
278 bool last_insert_was_slash = false;
279 for (string::const_iterator it = path.begin(); it != path.end(); ++it) {
280 if (*it == '/') {
281 if (last_insert_was_slash)
282 continue;
283 last_insert_was_slash = true;
284 } else {
285 last_insert_was_slash = false;
286 }
287 ret.push_back(*it);
288 }
289 if (strip_trailing_slash && last_insert_was_slash) {
290 string::size_type last_non_slash = ret.find_last_not_of('/');
291 if (last_non_slash != string::npos) {
292 ret.resize(last_non_slash + 1);
293 } else {
294 ret = "";
295 }
296 }
297 return ret;
298}
299
300bool FileExists(const char* path) {
301 struct stat stbuf;
302 return 0 == lstat(path, &stbuf);
303}
304
Darin Petkov30291ed2010-11-12 10:23:06 -0800305bool IsSymlink(const char* path) {
306 struct stat stbuf;
307 return lstat(path, &stbuf) == 0 && S_ISLNK(stbuf.st_mode) != 0;
308}
309
adlr@google.com3defe6a2009-12-04 20:57:17 +0000310std::string TempFilename(string path) {
311 static const string suffix("XXXXXX");
312 CHECK(StringHasSuffix(path, suffix));
313 do {
314 string new_suffix;
315 for (unsigned int i = 0; i < suffix.size(); i++) {
316 int r = rand() % (26 * 2 + 10); // [a-zA-Z0-9]
317 if (r < 26)
318 new_suffix.append(1, 'a' + r);
319 else if (r < (26 * 2))
320 new_suffix.append(1, 'A' + r - 26);
321 else
322 new_suffix.append(1, '0' + r - (26 * 2));
323 }
324 CHECK_EQ(new_suffix.size(), suffix.size());
325 path.resize(path.size() - new_suffix.size());
326 path.append(new_suffix);
327 } while (FileExists(path.c_str()));
328 return path;
329}
330
Andrew de los Reyesb10320d2010-03-31 16:44:44 -0700331bool MakeTempFile(const std::string& filename_template,
332 std::string* filename,
333 int* fd) {
334 DCHECK(filename || fd);
335 vector<char> buf(filename_template.size() + 1);
336 memcpy(&buf[0], filename_template.data(), filename_template.size());
337 buf[filename_template.size()] = '\0';
Darin Petkov296889c2010-07-23 16:20:54 -0700338
Andrew de los Reyesb10320d2010-03-31 16:44:44 -0700339 int mkstemp_fd = mkstemp(&buf[0]);
340 TEST_AND_RETURN_FALSE_ERRNO(mkstemp_fd >= 0);
341 if (filename) {
342 *filename = &buf[0];
343 }
344 if (fd) {
345 *fd = mkstemp_fd;
346 } else {
347 close(mkstemp_fd);
348 }
349 return true;
350}
351
Andrew de los Reyes09e56d62010-04-23 13:45:53 -0700352bool MakeTempDirectory(const std::string& dirname_template,
353 std::string* dirname) {
354 DCHECK(dirname);
355 vector<char> buf(dirname_template.size() + 1);
356 memcpy(&buf[0], dirname_template.data(), dirname_template.size());
357 buf[dirname_template.size()] = '\0';
Darin Petkov296889c2010-07-23 16:20:54 -0700358
Andrew de los Reyes09e56d62010-04-23 13:45:53 -0700359 char* return_code = mkdtemp(&buf[0]);
360 TEST_AND_RETURN_FALSE_ERRNO(return_code != NULL);
361 *dirname = &buf[0];
362 return true;
363}
364
adlr@google.com3defe6a2009-12-04 20:57:17 +0000365bool StringHasSuffix(const std::string& str, const std::string& suffix) {
366 if (suffix.size() > str.size())
367 return false;
368 return 0 == str.compare(str.size() - suffix.size(), suffix.size(), suffix);
369}
370
371bool StringHasPrefix(const std::string& str, const std::string& prefix) {
372 if (prefix.size() > str.size())
373 return false;
374 return 0 == str.compare(0, prefix.size(), prefix);
375}
376
Will Drewry8f71da82010-08-30 14:07:11 -0500377const std::string BootDevice() {
378 char boot_path[PATH_MAX];
379 // Resolve the boot device path fully, including dereferencing
380 // through dm-verity.
381 int ret = rootdev(boot_path, sizeof(boot_path), true, false);
382
383 if (ret < 0) {
384 LOG(ERROR) << "rootdev failed to find the root device";
adlr@google.com3defe6a2009-12-04 20:57:17 +0000385 return "";
386 }
Will Drewry8f71da82010-08-30 14:07:11 -0500387 LOG_IF(WARNING, ret > 0) << "rootdev found a device name with no device node";
388
389 // This local variable is used to construct the return string and is not
390 // passed around after use.
391 return boot_path;
adlr@google.com3defe6a2009-12-04 20:57:17 +0000392}
393
Andrew de los Reyesf9185172010-05-03 11:07:05 -0700394const string BootKernelDevice(const std::string& boot_device) {
395 // Currntly this assumes the last digit of the boot device is
396 // 3, 5, or 7, and changes it to 2, 4, or 6, respectively, to
397 // get the kernel device.
398 string ret = boot_device;
399 if (ret.empty())
400 return ret;
401 char last_char = ret[ret.size() - 1];
402 if (last_char == '3' || last_char == '5' || last_char == '7') {
403 ret[ret.size() - 1] = last_char - 1;
404 return ret;
405 }
406 return "";
407}
408
adlr@google.com3defe6a2009-12-04 20:57:17 +0000409bool MountFilesystem(const string& device,
Andrew de los Reyes09e56d62010-04-23 13:45:53 -0700410 const string& mountpoint,
411 unsigned long mountflags) {
412 int rc = mount(device.c_str(), mountpoint.c_str(), "ext3", mountflags, NULL);
adlr@google.com3defe6a2009-12-04 20:57:17 +0000413 if (rc < 0) {
414 string msg = ErrnoNumberAsString(errno);
415 LOG(ERROR) << "Unable to mount destination device: " << msg << ". "
416 << device << " on " << mountpoint;
417 return false;
418 }
419 return true;
420}
421
422bool UnmountFilesystem(const string& mountpoint) {
423 TEST_AND_RETURN_FALSE_ERRNO(umount(mountpoint.c_str()) == 0);
424 return true;
425}
426
Darin Petkovd3f8c892010-10-12 21:38:45 -0700427bool GetFilesystemSize(const std::string& device,
428 int* out_block_count,
429 int* out_block_size) {
430 int fd = HANDLE_EINTR(open(device.c_str(), O_RDONLY));
431 TEST_AND_RETURN_FALSE(fd >= 0);
432 ScopedFdCloser fd_closer(&fd);
433 return GetFilesystemSizeFromFD(fd, out_block_count, out_block_size);
434}
435
436bool GetFilesystemSizeFromFD(int fd,
437 int* out_block_count,
438 int* out_block_size) {
439 TEST_AND_RETURN_FALSE(fd >= 0);
440
441 // Determine the ext3 filesystem size by directly reading the block count and
442 // block size information from the superblock. See include/linux/ext3_fs.h for
443 // more details on the structure.
444 ssize_t kBufferSize = 16 * sizeof(uint32_t);
445 char buffer[kBufferSize];
446 const int kSuperblockOffset = 1024;
447 if (HANDLE_EINTR(pread(fd, buffer, kBufferSize, kSuperblockOffset)) !=
448 kBufferSize) {
449 PLOG(ERROR) << "Unable to determine file system size:";
450 return false;
451 }
452 uint32_t block_count; // ext3_fs.h: ext3_super_block.s_blocks_count
453 uint32_t log_block_size; // ext3_fs.h: ext3_super_block.s_log_block_size
454 uint16_t magic; // ext3_fs.h: ext3_super_block.s_magic
455 memcpy(&block_count, &buffer[1 * sizeof(int32_t)], sizeof(block_count));
456 memcpy(&log_block_size, &buffer[6 * sizeof(int32_t)], sizeof(log_block_size));
457 memcpy(&magic, &buffer[14 * sizeof(int32_t)], sizeof(magic));
458 block_count = le32toh(block_count);
459 const int kExt3MinBlockLogSize = 10; // ext3_fs.h: EXT3_MIN_BLOCK_LOG_SIZE
460 log_block_size = le32toh(log_block_size) + kExt3MinBlockLogSize;
461 magic = le16toh(magic);
462
463 // Sanity check the parameters.
464 const uint16_t kExt3SuperMagic = 0xef53; // ext3_fs.h: EXT3_SUPER_MAGIC
465 TEST_AND_RETURN_FALSE(magic == kExt3SuperMagic);
466 const int kExt3MinBlockSize = 1024; // ext3_fs.h: EXT3_MIN_BLOCK_SIZE
467 const int kExt3MaxBlockSize = 4096; // ext3_fs.h: EXT3_MAX_BLOCK_SIZE
468 int block_size = 1 << log_block_size;
469 TEST_AND_RETURN_FALSE(block_size >= kExt3MinBlockSize &&
470 block_size <= kExt3MaxBlockSize);
471 TEST_AND_RETURN_FALSE(block_count > 0);
472
473 if (out_block_count) {
474 *out_block_count = block_count;
475 }
476 if (out_block_size) {
477 *out_block_size = block_size;
478 }
479 return true;
480}
481
Andrew de los Reyesf9714432010-05-04 10:21:23 -0700482bool GetBootloader(BootLoader* out_bootloader) {
483 // For now, hardcode to syslinux.
484 *out_bootloader = BootLoader_SYSLINUX;
485 return true;
486}
487
Andrew de los Reyesc7020782010-04-28 10:46:04 -0700488const char* GetGErrorMessage(const GError* error) {
489 if (!error)
490 return "Unknown error.";
491 return error->message;
492}
493
Darin Petkov296889c2010-07-23 16:20:54 -0700494bool Reboot() {
495 vector<string> command;
496 command.push_back("/sbin/shutdown");
497 command.push_back("-r");
498 command.push_back("now");
499 int rc = 0;
500 Subprocess::SynchronousExec(command, &rc);
501 TEST_AND_RETURN_FALSE(rc == 0);
502 return true;
503}
504
Andrew de los Reyes712b3ac2011-01-07 13:47:52 -0800505namespace {
506// Do the actual trigger. We do it as a main-loop callback to (try to) get a
507// consistent stack trace.
508gboolean TriggerCrashReporterUpload(void* unused) {
509 pid_t pid = fork();
510 CHECK(pid >= 0) << "fork failed"; // fork() failed. Something is very wrong.
511 if (pid == 0) {
512 // We are the child. Crash.
513 abort(); // never returns
514 }
515 // We are the parent. Wait for child to terminate.
516 pid_t result = waitpid(pid, NULL, 0);
517 LOG_IF(ERROR, result < 0) << "waitpid() failed";
518 return FALSE; // Don't call this callback again
519}
520} // namespace {}
521
522void ScheduleCrashReporterUpload() {
523 g_idle_add(&TriggerCrashReporterUpload, NULL);
524}
525
Darin Petkovc6c135c2010-08-11 13:36:18 -0700526bool SetProcessPriority(ProcessPriority priority) {
527 int prio = static_cast<int>(priority);
528 LOG(INFO) << "Setting process priority to " << prio;
529 TEST_AND_RETURN_FALSE(setpriority(PRIO_PROCESS, 0, prio) == 0);
530 return true;
531}
532
533int ComparePriorities(ProcessPriority priority_lhs,
534 ProcessPriority priority_rhs) {
535 return static_cast<int>(priority_rhs) - static_cast<int>(priority_lhs);
536}
537
Darin Petkov5c0a8af2010-08-24 13:39:13 -0700538int FuzzInt(int value, unsigned int range) {
539 int min = value - range / 2;
540 int max = value + range - range / 2;
541 return base::RandInt(min, max);
542}
543
Andrew de los Reyes4fe15d02009-12-10 19:01:36 -0800544const char* const kStatefulPartition = "/mnt/stateful_partition";
adlr@google.com3defe6a2009-12-04 20:57:17 +0000545
546} // namespace utils
547
548} // namespace chromeos_update_engine