diff --git a/SConstruct b/SConstruct
index df29f86..c3960bd 100644
--- a/SConstruct
+++ b/SConstruct
@@ -210,7 +210,7 @@
                    marshal.glibmarshal.c
                    omaha_hash_calculator.cc
                    omaha_request_action.cc
-                   omaha_request_prep_action.cc
+                   omaha_request_params.cc
                    omaha_response_handler_action.cc
                    postinstall_runner_action.cc
                    set_bootable_flag_action.cc
@@ -243,7 +243,7 @@
                             mock_http_fetcher.cc
                             omaha_hash_calculator_unittest.cc
                             omaha_request_action_unittest.cc
-                            omaha_request_prep_action_unittest.cc
+                            omaha_request_params_unittest.cc
                             omaha_response_handler_action_unittest.cc
                             postinstall_runner_action_unittest.cc
                             set_bootable_flag_action_unittest.cc
diff --git a/main.cc b/main.cc
index ed2fcf5..52ace9a 100644
--- a/main.cc
+++ b/main.cc
@@ -37,7 +37,7 @@
 
 gboolean PeriodicallyUpdate(void* arg) {
   PeriodicallyUpdateArgs* args = reinterpret_cast<PeriodicallyUpdateArgs*>(arg);
-  args->update_attempter->Update(false);
+  args->update_attempter->Update();
   return args->should_repeat;
 }
 
@@ -98,7 +98,7 @@
     PLOG_IF(FATAL, daemon(0, 0) == 1) << "daemon() failed";
 
   LOG(INFO) << "Chrome OS Update Engine starting";
-  
+
   // Create the single GMainLoop
   GMainLoop* loop = g_main_loop_new(g_main_context_default(), FALSE);
 
diff --git a/omaha_request_action.cc b/omaha_request_action.cc
index 9d14a6d..927c7d3 100644
--- a/omaha_request_action.cc
+++ b/omaha_request_action.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
@@ -13,6 +13,7 @@
 #include "base/string_util.h"
 #include "chromeos/obsolete_logging.h"
 #include "update_engine/action_pipe.h"
+#include "update_engine/omaha_request_params.h"
 #include "update_engine/utils.h"
 
 using std::string;
@@ -109,16 +110,16 @@
   return string(reinterpret_cast<const char *>(str.get()));
 }
 
-OmahaRequestAction::OmahaRequestAction(OmahaEvent* event,
+OmahaRequestAction::OmahaRequestAction(const OmahaRequestParams& params,
+                                       OmahaEvent* event,
                                        HttpFetcher* http_fetcher)
-    : event_(event),
+    : params_(params),
+      event_(event),
       http_fetcher_(http_fetcher) {}
 
 OmahaRequestAction::~OmahaRequestAction() {}
 
 void OmahaRequestAction::PerformAction() {
-  CHECK(HasInputObject());
-  params_ = GetInputObject();
   http_fetcher_->set_delegate(this);
   string request_post(FormatRequest(event_.get(), params_));
   http_fetcher_->SetPostData(request_post.data(), request_post.size());
diff --git a/omaha_request_action.h b/omaha_request_action.h
index 582fe5f..0f066e3 100644
--- a/omaha_request_action.h
+++ b/omaha_request_action.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
@@ -26,54 +26,6 @@
 // UTF-8 formatted. Output will be UTF-8 formatted.
 std::string XmlEncode(const std::string& input);
 
-// This struct encapsulates the data Omaha gets for the request.
-// These strings in this struct should not be XML escaped.
-struct OmahaRequestParams {
-  OmahaRequestParams()
-      : os_platform(kOsPlatform), os_version(kOsVersion), app_id(kAppId) {}
-  OmahaRequestParams(const std::string& in_machine_id,
-                     const std::string& in_user_id,
-                     const std::string& in_os_platform,
-                     const std::string& in_os_version,
-                     const std::string& in_os_sp,
-                     const std::string& in_os_board,
-                     const std::string& in_app_id,
-                     const std::string& in_app_version,
-                     const std::string& in_app_lang,
-                     const std::string& in_app_track,
-                     const std::string& in_update_url)
-      : machine_id(in_machine_id),
-        user_id(in_user_id),
-        os_platform(in_os_platform),
-        os_version(in_os_version),
-        os_sp(in_os_sp),
-        os_board(in_os_board),
-        app_id(in_app_id),
-        app_version(in_app_version),
-        app_lang(in_app_lang),
-        app_track(in_app_track),
-        update_url(in_update_url) {}
-
-  std::string machine_id;
-  std::string user_id;
-  std::string os_platform;
-  std::string os_version;
-  std::string os_sp;
-  std::string os_board;
-  std::string app_id;
-  std::string app_version;
-  std::string app_lang;
-  std::string app_track;
-
-  std::string update_url;
-
-  // Suggested defaults
-  static const char* const kAppId;
-  static const char* const kOsPlatform;
-  static const char* const kOsVersion;
-  static const char* const kUpdateUrl;
-};
-
 // This struct encapsulates the data Omaha's response for the request.
 // These strings in this struct are not XML escaped.
 struct OmahaResponse {
@@ -123,14 +75,15 @@
   int error_code;
 };
 
-class OmahaRequestAction;
 class NoneType;
+class OmahaRequestAction;
+struct OmahaRequestParams;
 
 template<>
 class ActionTraits<OmahaRequestAction> {
  public:
   // Takes parameters on the input pipe.
-  typedef OmahaRequestParams InputObjectType;
+  typedef NoneType InputObjectType;
   // On UpdateCheck success, puts the Omaha response on output. Event
   // requests do not have an output pipe.
   typedef OmahaResponse OutputObjectType;
@@ -150,10 +103,11 @@
   // Event requests always succeed.
   //
   // A good calling pattern is:
-  // OmahaRequestAction(new OmahaEvent(...), new WhateverHttpFetcher);
+  // OmahaRequestAction(..., new OmahaEvent(...), new WhateverHttpFetcher);
   // or
-  // OmahaRequestAction(NULL, new WhateverHttpFetcher);
-  OmahaRequestAction(OmahaEvent* event,
+  // OmahaRequestAction(..., NULL, new WhateverHttpFetcher);
+  OmahaRequestAction(const OmahaRequestParams& params,
+                     OmahaEvent* event,
                      HttpFetcher* http_fetcher);
   virtual ~OmahaRequestAction();
   typedef ActionTraits<OmahaRequestAction>::InputObjectType InputObjectType;
@@ -174,8 +128,8 @@
   bool IsEvent() const { return event_.get() != NULL; }
 
  private:
-  // These are data that are passed in the request to the Omaha server
-  OmahaRequestParams params_;
+  // These are data that are passed in the request to the Omaha server.
+  const OmahaRequestParams& params_;
 
   // Pointer to the OmahaEvent info. This is an UpdateCheck request if NULL.
   scoped_ptr<OmahaEvent> event_;
diff --git a/omaha_request_action_unittest.cc b/omaha_request_action_unittest.cc
index 0e06439..cd91f68 100644
--- a/omaha_request_action_unittest.cc
+++ b/omaha_request_action_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
@@ -13,6 +13,7 @@
 #include "update_engine/mock_http_fetcher.h"
 #include "update_engine/omaha_hash_calculator.h"
 #include "update_engine/omaha_request_action.h"
+#include "update_engine/omaha_request_params.h"
 #include "update_engine/test_utils.h"
 
 using std::string;
@@ -129,20 +130,16 @@
   GMainLoop* loop = g_main_loop_new(g_main_context_default(), FALSE);
   MockHttpFetcher* fetcher = new MockHttpFetcher(http_response.data(),
                                                  http_response.size());
-  ObjectFeederAction<OmahaRequestParams> feeder_action;
-  OmahaRequestAction action(NULL, fetcher);  // takes ownership of fetcher
+  OmahaRequestAction action(params, NULL, fetcher);
   OmahaRequestActionTestProcessorDelegate delegate;
   delegate.loop_ = loop;
   delegate.expected_success_ = expected_success;
+
   ActionProcessor processor;
-  feeder_action.set_obj(params);
   processor.set_delegate(&delegate);
-  processor.EnqueueAction(&feeder_action);
   processor.EnqueueAction(&action);
 
   OutputObjectCollectorAction collector_action;
-
-  BondActions(&feeder_action, &action);
   BondActions(&action, &collector_action);
   processor.EnqueueAction(&collector_action);
 
@@ -166,18 +163,13 @@
   GMainLoop* loop = g_main_loop_new(g_main_context_default(), FALSE);
   MockHttpFetcher* fetcher = new MockHttpFetcher(http_response.data(),
                                                  http_response.size());
-  ObjectFeederAction<OmahaRequestParams> feeder_action;
-  OmahaRequestAction action(event, fetcher);  // takes ownership of fetcher
+  OmahaRequestAction action(params, event, fetcher);
   OmahaRequestActionTestProcessorDelegate delegate;
   delegate.loop_ = loop;
   ActionProcessor processor;
-  feeder_action.set_obj(params);
   processor.set_delegate(&delegate);
-  processor.EnqueueAction(&feeder_action);
   processor.EnqueueAction(&action);
 
-  BondActions(&feeder_action, &action);
-
   g_timeout_add(0, &StartProcessorInRunLoop, &processor);
   g_main_loop_run(loop);
   g_main_loop_unref(loop);
@@ -259,18 +251,14 @@
 
   GMainLoop *loop = g_main_loop_new(g_main_context_default(), FALSE);
 
-  ObjectFeederAction<OmahaRequestParams> feeder_action;
-  feeder_action.set_obj(params);
-  OmahaRequestAction action(NULL,
+  OmahaRequestAction action(params, NULL,
                             new MockHttpFetcher(http_response.data(),
                                                 http_response.size()));
   OmahaRequestActionTestProcessorDelegate delegate;
   delegate.loop_ = loop;
   ActionProcessor processor;
   processor.set_delegate(&delegate);
-  processor.EnqueueAction(&feeder_action);
   processor.EnqueueAction(&action);
-  BondActions(&feeder_action, &action);
 
   g_timeout_add(0, &StartProcessorInRunLoop, &processor);
   g_main_loop_run(loop);
@@ -450,18 +438,14 @@
   string http_response("doesn't matter");
   GMainLoop *loop = g_main_loop_new(g_main_context_default(), FALSE);
 
-  ObjectFeederAction<OmahaRequestParams> feeder_action;
-  feeder_action.set_obj(params);
-  OmahaRequestAction action(NULL,
+  OmahaRequestAction action(params, NULL,
                             new MockHttpFetcher(http_response.data(),
                                                 http_response.size()));
   TerminateEarlyTestProcessorDelegate delegate;
   delegate.loop_ = loop;
   ActionProcessor processor;
   processor.set_delegate(&delegate);
-  processor.EnqueueAction(&feeder_action);
   processor.EnqueueAction(&action);
-  BondActions(&feeder_action, &action);
 
   g_timeout_add(0, &TerminateTransferTestStarter, &processor);
   g_main_loop_run(loop);
@@ -629,14 +613,27 @@
 
 TEST(OmahaRequestActionTest, IsEventTest) {
   string http_response("doesn't matter");
+  OmahaRequestParams params("machine_id",
+                            "user_id",
+                            OmahaRequestParams::kOsPlatform,
+                            OmahaRequestParams::kOsVersion,
+                            "service_pack",
+                            "x86-generic",
+                            OmahaRequestParams::kAppId,
+                            "0.1.0.0",
+                            "en-US",
+                            "unittest_track",
+                            "http://url");
 
   OmahaRequestAction update_check_action(
+      params,
       NULL,
       new MockHttpFetcher(http_response.data(),
                           http_response.size()));
   EXPECT_FALSE(update_check_action.IsEvent());
 
   OmahaRequestAction event_action(
+      params,
       new OmahaEvent(OmahaEvent::kTypeInstallComplete,
                      OmahaEvent::kResultError,
                      0),
diff --git a/omaha_request_params.cc b/omaha_request_params.cc
new file mode 100644
index 0000000..502f7b0
--- /dev/null
+++ b/omaha_request_params.cc
@@ -0,0 +1,115 @@
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "update_engine/omaha_request_params.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/utsname.h>
+
+#include <map>
+#include <string>
+
+#include "base/string_util.h"
+#include "update_engine/simple_key_value_store.h"
+#include "update_engine/utils.h"
+
+using std::map;
+using std::string;
+
+namespace {
+const string OmahaIdPath() {
+  return string(chromeos_update_engine::utils::kStatefulPartition) +
+      "/etc/omaha_id";
+}
+}  // namespace {}
+
+namespace chromeos_update_engine {
+
+bool OmahaRequestDeviceParams::Init() {
+  TEST_AND_RETURN_FALSE(GetMachineId(&machine_id));
+  user_id = machine_id;
+  os_platform = OmahaRequestParams::kOsPlatform;
+  os_version = OmahaRequestParams::kOsVersion;
+  app_version = GetLsbValue("CHROMEOS_RELEASE_VERSION", "");
+  os_sp = app_version + "_" + GetMachineType();
+  os_board = GetLsbValue("CHROMEOS_RELEASE_BOARD", "");
+  app_id = OmahaRequestParams::kAppId;
+  app_lang = "en-US";
+  app_track = GetLsbValue("CHROMEOS_RELEASE_TRACK", "");
+  update_url = GetLsbValue("CHROMEOS_AUSERVER",
+                           OmahaRequestParams::kUpdateUrl);
+  return true;
+}
+
+namespace {
+const size_t kGuidDataByteLength = 128 / 8;
+const string::size_type kGuidStringLength = 38;
+// Formats 16 bytes (128 bits) of data as a GUID:
+// "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}" where X is a hex digit
+string GuidFromData(const unsigned char data[kGuidDataByteLength]) {
+  return StringPrintf(
+      "{%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
+      data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7],
+      data[8], data[9], data[10], data[11], data[12], data[13], data[14],
+      data[15]);
+}
+}
+
+// Returns true on success.
+bool OmahaRequestDeviceParams::GetMachineId(std::string* out_id) const {
+  // Checks if we have an existing Machine ID.
+  const string omaha_id_path = root_ + OmahaIdPath();
+
+  if (utils::ReadFileToString(omaha_id_path, out_id) &&
+      out_id->size() == kGuidStringLength) {
+    return true;
+  }
+
+  // Creates a new ID.
+  int rand_fd = open("/dev/urandom", O_RDONLY, 0);
+  TEST_AND_RETURN_FALSE_ERRNO(rand_fd >= 0);
+  ScopedFdCloser rand_fd_closer(&rand_fd);
+  unsigned char buf[kGuidDataByteLength];
+  size_t bytes_read = 0;
+  while (bytes_read < sizeof(buf)) {
+    ssize_t rc = read(rand_fd, buf + bytes_read, sizeof(buf) - bytes_read);
+    TEST_AND_RETURN_FALSE_ERRNO(rc > 0);
+    bytes_read += rc;
+  }
+  string guid = GuidFromData(buf);
+  TEST_AND_RETURN_FALSE(
+      utils::WriteFile(omaha_id_path.c_str(), guid.data(), guid.size()));
+  *out_id = guid;
+  return true;
+}
+
+string OmahaRequestDeviceParams::GetLsbValue(
+    const string& key, const string& default_value) const {
+  string files[] = {string(utils::kStatefulPartition) + "/etc/lsb-release",
+                    "/etc/lsb-release"};
+  for (unsigned int i = 0; i < arraysize(files); ++i) {
+    // TODO(adlr): make sure files checked are owned as root (and all
+    // their parents are recursively, too).
+    string file_data;
+    if (!utils::ReadFileToString(root_ + files[i], &file_data))
+      continue;
+
+    map<string, string> data = simple_key_value_store::ParseString(file_data);
+    if (utils::MapContainsKey(data, key))
+      return data[key];
+  }
+  // not found
+  return default_value;
+}
+
+string OmahaRequestDeviceParams::GetMachineType() const {
+  struct utsname buf;
+  string ret;
+  if (uname(&buf) == 0)
+    ret = buf.machine;
+  return ret;
+}
+
+}  // namespace chromeos_update_engine
diff --git a/omaha_request_params.h b/omaha_request_params.h
new file mode 100644
index 0000000..136c60a
--- /dev/null
+++ b/omaha_request_params.h
@@ -0,0 +1,97 @@
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_REQUEST_PARAMS_H__
+#define CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_REQUEST_PARAMS_H__
+
+#include <string>
+
+#include "base/basictypes.h"
+
+// This gathers local system information and prepares info used by the
+// Omaha request action.
+
+namespace chromeos_update_engine {
+
+// This struct encapsulates the data Omaha gets for the request.
+// These strings in this struct should not be XML escaped.
+struct OmahaRequestParams {
+  OmahaRequestParams()
+      : os_platform(kOsPlatform), os_version(kOsVersion), app_id(kAppId) {}
+  OmahaRequestParams(const std::string& in_machine_id,
+                     const std::string& in_user_id,
+                     const std::string& in_os_platform,
+                     const std::string& in_os_version,
+                     const std::string& in_os_sp,
+                     const std::string& in_os_board,
+                     const std::string& in_app_id,
+                     const std::string& in_app_version,
+                     const std::string& in_app_lang,
+                     const std::string& in_app_track,
+                     const std::string& in_update_url)
+      : machine_id(in_machine_id),
+        user_id(in_user_id),
+        os_platform(in_os_platform),
+        os_version(in_os_version),
+        os_sp(in_os_sp),
+        os_board(in_os_board),
+        app_id(in_app_id),
+        app_version(in_app_version),
+        app_lang(in_app_lang),
+        app_track(in_app_track),
+        update_url(in_update_url) {}
+
+  std::string machine_id;
+  std::string user_id;
+  std::string os_platform;
+  std::string os_version;
+  std::string os_sp;
+  std::string os_board;
+  std::string app_id;
+  std::string app_version;
+  std::string app_lang;
+  std::string app_track;
+
+  std::string update_url;
+
+  // Suggested defaults
+  static const char* const kAppId;
+  static const char* const kOsPlatform;
+  static const char* const kOsVersion;
+  static const char* const kUpdateUrl;
+};
+
+class OmahaRequestDeviceParams : public OmahaRequestParams {
+ public:
+  explicit OmahaRequestDeviceParams() {}
+
+  // Initializes all the data in the object. Returns true on success,
+  // false otherwise.
+  bool Init();
+
+  // For unit-tests.
+  void set_root(const std::string& root) { root_ = root; }
+
+ private:
+  // Gets a machine-local ID (for now, first MAC address we find).
+  bool GetMachineId(std::string* out_id) const;
+
+  // Fetches the value for a given key from
+  // /mnt/stateful_partition/etc/lsb-release if possible. Failing that,
+  // it looks for the key in /etc/lsb-release.
+  std::string GetLsbValue(const std::string& key,
+                          const std::string& default_value) const;
+
+  // Gets the machine type (e.g. "i686").
+  std::string GetMachineType() const;
+
+  // When reading files, prepend root_ to the paths. Useful for testing.
+  std::string root_;
+
+  DISALLOW_COPY_AND_ASSIGN(OmahaRequestDeviceParams);
+};
+
+}  // namespace chromeos_update_engine
+
+#endif  // CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_REQUEST_PARAMS_H__
diff --git a/omaha_request_prep_action_unittest.cc b/omaha_request_params_unittest.cc
similarity index 70%
rename from omaha_request_prep_action_unittest.cc
rename to omaha_request_params_unittest.cc
index 0813964..54d8dbd 100644
--- a/omaha_request_prep_action_unittest.cc
+++ b/omaha_request_params_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
@@ -6,7 +6,7 @@
 #include <string>
 #include <gtest/gtest.h>
 #include "update_engine/install_plan.h"
-#include "update_engine/omaha_request_prep_action.h"
+#include "update_engine/omaha_request_params.h"
 #include "update_engine/test_utils.h"
 #include "update_engine/utils.h"
 
@@ -14,53 +14,24 @@
 
 namespace chromeos_update_engine {
 
-class OmahaRequestPrepActionTest : public ::testing::Test {
+class OmahaRequestDeviceParamsTest : public ::testing::Test {
  public:
-  // Return true iff the OmahaResponseHandlerAction succeeded.
-  // if out is non-NULL, it's set w/ the response from the action.
-  bool DoTest(bool force_full_update, OmahaRequestParams* out);
+  // Return true iff the OmahaRequestDeviceParams::Init succeeded. If
+  // out is non-NULL, it's set w/ the generated data.
+  bool DoTest(OmahaRequestParams* out);
   static const string kTestDir;
 };
 
-const string OmahaRequestPrepActionTest::kTestDir = "request_prep_action-test";
+const string OmahaRequestDeviceParamsTest::kTestDir =
+    "omaha_request_device_params-test";
 
-class OmahaRequestPrepActionProcessorDelegate
-    : public ActionProcessorDelegate {
- public:
-  OmahaRequestPrepActionProcessorDelegate()
-      : success_(false),
-        success_set_(false) {}
-  void ActionCompleted(ActionProcessor* processor,
-                       AbstractAction* action,
-                       bool success) {
-    if (action->Type() == OmahaRequestPrepAction::StaticType()) {
-      success_ = success;
-      success_set_ = true;
-    }
-  }
-  bool success_;
-  bool success_set_;
-};
-
-bool OmahaRequestPrepActionTest::DoTest(bool force_full_update,
-                                        OmahaRequestParams* out) {
-  ActionProcessor processor;
-  OmahaRequestPrepActionProcessorDelegate delegate;
-  processor.set_delegate(&delegate);
-
-  OmahaRequestPrepAction request_prep_action(force_full_update);
-  request_prep_action.set_root(string("./") + kTestDir);
-  ObjectCollectorAction<OmahaRequestParams> collector_action;
-  BondActions(&request_prep_action, &collector_action);
-  processor.EnqueueAction(&request_prep_action);
-  processor.EnqueueAction(&collector_action);
-  processor.StartProcessing();
-  EXPECT_TRUE(!processor.IsRunning())
-      << "Update test to handle non-asynch actions";
+bool OmahaRequestDeviceParamsTest::DoTest(OmahaRequestParams* out) {
+  OmahaRequestDeviceParams params;
+  params.set_root(string("./") + kTestDir);
+  bool success = params.Init();
   if (out)
-    *out = collector_action.object();
-  EXPECT_TRUE(delegate.success_set_);
-  return delegate.success_;
+    *out = params;
+  return success;
 }
 
 namespace {
@@ -84,6 +55,7 @@
   }
   return true;
 }
+
 string GetMachineType() {
   FILE* fp = popen("uname -m", "r");
   if (!fp)
@@ -104,7 +76,7 @@
 }
 }  // namespace {}
 
-TEST_F(OmahaRequestPrepActionTest, SimpleTest) {
+TEST_F(OmahaRequestDeviceParamsTest, SimpleTest) {
   ASSERT_EQ(0, System(string("mkdir -p ") + kTestDir + "/etc"));
   ASSERT_EQ(0, System(string("mkdir -p ") + kTestDir +
                       utils::kStatefulPartition + "/etc"));
@@ -116,7 +88,7 @@
         "CHROMEOS_RELEASE_VERSION=0.2.2.3\n"
         "CHROMEOS_RELEASE_TRACK=footrack"));
     OmahaRequestParams out;
-    EXPECT_TRUE(DoTest(false, &out));
+    EXPECT_TRUE(DoTest(&out));
     EXPECT_TRUE(IsValidGuid(out.machine_id)) << "id: " << out.machine_id;
     // for now we're just using the machine id here
     EXPECT_TRUE(IsValidGuid(out.user_id)) << "id: " << out.user_id;
@@ -131,7 +103,7 @@
   EXPECT_EQ(0, System(string("rm -rf ") + kTestDir));
 }
 
-TEST_F(OmahaRequestPrepActionTest, MissingTrackTest) {
+TEST_F(OmahaRequestDeviceParamsTest, MissingTrackTest) {
   ASSERT_EQ(0, System(string("mkdir -p ") + kTestDir + "/etc"));
   ASSERT_EQ(0, System(string("mkdir -p ") + kTestDir +
                       utils::kStatefulPartition + "/etc"));
@@ -142,7 +114,7 @@
         "CHROMEOS_RELEASE_VERSION=0.2.2.3\n"
         "CHROMEOS_RELEASE_TRXCK=footrack"));
     OmahaRequestParams out;
-    EXPECT_TRUE(DoTest(false, &out));
+    EXPECT_TRUE(DoTest(&out));
     EXPECT_TRUE(IsValidGuid(out.machine_id));
     // for now we're just using the machine id here
     EXPECT_TRUE(IsValidGuid(out.user_id));
@@ -156,7 +128,7 @@
   EXPECT_EQ(0, System(string("rm -rf ") + kTestDir));
 }
 
-TEST_F(OmahaRequestPrepActionTest, ConfusingReleaseTest) {
+TEST_F(OmahaRequestDeviceParamsTest, ConfusingReleaseTest) {
   ASSERT_EQ(0, System(string("mkdir -p ") + kTestDir + "/etc"));
   ASSERT_EQ(0, System(string("mkdir -p ") + kTestDir +
                       utils::kStatefulPartition + "/etc"));
@@ -167,7 +139,7 @@
         "CHROMEOS_RELEASE_VERSION=0.2.2.3\n"
         "CHROMEOS_RELEASE_TRXCK=footrack"));
     OmahaRequestParams out;
-    EXPECT_TRUE(DoTest(false, &out));
+    EXPECT_TRUE(DoTest(&out));
     EXPECT_TRUE(IsValidGuid(out.machine_id)) << out.machine_id;
     // for now we're just using the machine id here
     EXPECT_TRUE(IsValidGuid(out.user_id));
@@ -181,7 +153,7 @@
   EXPECT_EQ(0, System(string("rm -rf ") + kTestDir));
 }
 
-TEST_F(OmahaRequestPrepActionTest, MachineIdPersistsTest) {
+TEST_F(OmahaRequestDeviceParamsTest, MachineIdPersistsTest) {
   ASSERT_EQ(0, System(string("mkdir -p ") + kTestDir + "/etc"));
   ASSERT_EQ(0, System(string("mkdir -p ") + kTestDir +
                       utils::kStatefulPartition + "/etc"));
@@ -191,7 +163,7 @@
       "CHROMEOS_RELEASE_VERSION=0.2.2.3\n"
       "CHROMEOS_RELEASE_TRXCK=footrack"));
   OmahaRequestParams out1;
-  EXPECT_TRUE(DoTest(false, &out1));
+  EXPECT_TRUE(DoTest(&out1));
   string machine_id;
   EXPECT_TRUE(utils::ReadFileToString(
       kTestDir +
@@ -199,7 +171,7 @@
       &machine_id));
   EXPECT_EQ(machine_id, out1.machine_id);
   OmahaRequestParams out2;
-  EXPECT_TRUE(DoTest(false, &out2));
+  EXPECT_TRUE(DoTest(&out2));
   EXPECT_EQ(machine_id, out2.machine_id);
   EXPECT_EQ(0, System(string("rm -rf ") + kTestDir));
 }
diff --git a/omaha_request_prep_action.cc b/omaha_request_prep_action.cc
deleted file mode 100644
index 09ae3bd..0000000
--- a/omaha_request_prep_action.cc
+++ /dev/null
@@ -1,127 +0,0 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "update_engine/omaha_request_prep_action.h"
-#include <sys/utsname.h>
-#include <errno.h>
-#include <map>
-#include <string>
-#include "base/string_util.h"
-#include "update_engine/simple_key_value_store.h"
-#include "update_engine/utils.h"
-
-using std::map;
-using std::string;
-
-// This gathers local system information and prepares info used by the
-// update check action.
-
-namespace {
-const string OmahaIdPath() {
-  return string(chromeos_update_engine::utils::kStatefulPartition) +
-      "/etc/omaha_id";
-}
-}  // namespace {}
-
-namespace chromeos_update_engine {
-
-void OmahaRequestPrepAction::PerformAction() {
-  // TODO(adlr): honor force_full_update_
-  ScopedActionCompleter completer(processor_, this);
-  string machine_id;
-  TEST_AND_RETURN(GetMachineId(&machine_id));
-  const string version(GetLsbValue("CHROMEOS_RELEASE_VERSION", ""));
-  const string sp(version + "_" + GetMachineType());
-  const string track(GetLsbValue("CHROMEOS_RELEASE_TRACK", ""));
-  const string update_url(GetLsbValue("CHROMEOS_AUSERVER",
-                                      OmahaRequestParams::kUpdateUrl));
-  const string board(GetLsbValue("CHROMEOS_RELEASE_BOARD", ""));
-
-  OmahaRequestParams out(machine_id,  // machine_id
-                         machine_id,  // user_id (use machine_id)
-                         OmahaRequestParams::kOsPlatform,
-                         OmahaRequestParams::kOsVersion,
-                         sp,  // e.g. 0.2.3.3_i686
-                         board,  // e.g. x86-generic
-                         OmahaRequestParams::kAppId,
-                         version,  // app version (from lsb-release)
-                         "en-US",  // lang
-                         track,  // track
-                         update_url);
-
-  CHECK(HasOutputPipe());
-  SetOutputObject(out);
-  completer.set_success(true);
-}
-
-namespace {
-const size_t kGuidDataByteLength = 128 / 8;
-const string::size_type kGuidStringLength = 38;
-// Formats 16 bytes (128 bits) of data as a GUID:
-// "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}" where X is a hex digit
-string GuidFromData(const unsigned char data[kGuidDataByteLength]) {
-  return StringPrintf(
-      "{%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
-      data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7],
-      data[8], data[9], data[10], data[11], data[12], data[13], data[14],
-      data[15]);
-}
-}
-
-// Returns true on success.
-bool OmahaRequestPrepAction::GetMachineId(std::string* out_id) const {
-  // See if we have an existing Machine ID
-  const string omaha_id_path = root_ + OmahaIdPath();
-
-  if (utils::ReadFileToString(omaha_id_path, out_id) &&
-      out_id->size() == kGuidStringLength) {
-    return true;
-  }
-
-  // Create a new ID
-  int rand_fd = open("/dev/urandom", O_RDONLY, 0);
-  TEST_AND_RETURN_FALSE_ERRNO(rand_fd >= 0);
-  ScopedFdCloser rand_fd_closer(&rand_fd);
-  unsigned char buf[kGuidDataByteLength];
-  size_t bytes_read = 0;
-  while (bytes_read < sizeof(buf)) {
-    ssize_t rc = read(rand_fd, buf + bytes_read, sizeof(buf) - bytes_read);
-    TEST_AND_RETURN_FALSE_ERRNO(rc > 0);
-    bytes_read += rc;
-  }
-  string guid = GuidFromData(buf);
-  TEST_AND_RETURN_FALSE(
-      utils::WriteFile(omaha_id_path.c_str(), guid.data(), guid.size()));
-  *out_id = guid;
-  return true;
-}
-
-string OmahaRequestPrepAction::GetLsbValue(
-    const string& key, const string& default_value) const {
-  string files[] = {string(utils::kStatefulPartition) + "/etc/lsb-release",
-                    "/etc/lsb-release"};
-  for (unsigned int i = 0; i < arraysize(files); i++) {
-    // TODO(adlr): make sure files checked are owned as root (and all
-    // their parents are recursively, too).
-    string file_data;
-    if (!utils::ReadFileToString(root_ + files[i], &file_data))
-      continue;
-
-    map<string, string> data = simple_key_value_store::ParseString(file_data);
-    if (utils::MapContainsKey(data, key))
-      return data[key];
-  }
-  // not found
-  return default_value;
-}
-
-string OmahaRequestPrepAction::GetMachineType() const {
-  struct utsname buf;
-  string ret;
-  if (uname(&buf) == 0)
-    ret = buf.machine;
-  return ret;
-}
-
-}  // namespace chromeos_update_engine
diff --git a/omaha_request_prep_action.h b/omaha_request_prep_action.h
deleted file mode 100644
index 794cfb7..0000000
--- a/omaha_request_prep_action.h
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_RESQUEST_PREP_ACTION_H__
-#define CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_RESQUEST_PREP_ACTION_H__
-
-#include <string>
-#include "update_engine/action.h"
-#include "update_engine/omaha_request_action.h"
-
-// This gathers local system information and prepares info used by the
-// update check action.
-
-namespace chromeos_update_engine {
-
-class OmahaRequestPrepAction;
-class NoneType;
-
-template<>
-class ActionTraits<OmahaRequestPrepAction> {
- public:
-  typedef NoneType InputObjectType;
-  typedef OmahaRequestParams OutputObjectType;
-};
-
-class OmahaRequestPrepAction : public Action<OmahaRequestPrepAction> {
- public:
-  explicit OmahaRequestPrepAction(bool force_full_update)
-      : force_full_update_(force_full_update) {}
-  typedef ActionTraits<OmahaRequestPrepAction>::InputObjectType
-      InputObjectType;
-  typedef ActionTraits<OmahaRequestPrepAction>::OutputObjectType
-      OutputObjectType;
-  void PerformAction();
-
-  // This is a synchronous action, and thus TerminateProcessing() should
-  // never be called
-  void TerminateProcessing() { CHECK(false); }
-
-  // Debugging/logging
-  static std::string StaticType() { return "OmahaRequestPrepAction"; }
-  std::string Type() const { return StaticType(); }
-
-  // For unit-tests.
-  void set_root(const std::string& root) {
-    root_ = root;
-  }
-
- private:
-  // Gets a machine-local ID (for now, first MAC address we find)
-  bool GetMachineId(std::string* out_id) const;
-
-  // Fetches the value for a given key from
-  // /mnt/stateful_partition/etc/lsb-release if possible. Failing that,
-  // it looks for the key in /etc/lsb-release .
-  std::string GetLsbValue(const std::string& key,
-                          const std::string& default_value) const;
-
-  // Gets the machine type (e.g. "i686")
-  std::string GetMachineType() const;
-
-  // Set to true if this should set up the Update Check Action to do
-  // a full update
-  bool force_full_update_;
-
-  // When reading files, prepend root_ to the paths. Useful for testing.
-  std::string root_;
-
-  DISALLOW_COPY_AND_ASSIGN(OmahaRequestPrepAction);
-};
-
-}  // namespace chromeos_update_engine
-
-#endif  // CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_RESQUEST_PREP_ACTION_H__
diff --git a/update_attempter.cc b/update_attempter.cc
index f034b0b..1c32ff4 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -19,7 +19,7 @@
 #include "update_engine/filesystem_copier_action.h"
 #include "update_engine/libcurl_http_fetcher.h"
 #include "update_engine/omaha_request_action.h"
-#include "update_engine/omaha_request_prep_action.h"
+#include "update_engine/omaha_request_params.h"
 #include "update_engine/omaha_response_handler_action.h"
 #include "update_engine/postinstall_runner_action.h"
 #include "update_engine/set_bootable_flag_action.h"
@@ -85,7 +85,7 @@
   }
 }
 
-void UpdateAttempter::Update(bool force_full_update) {
+void UpdateAttempter::Update() {
   if (status_ == UPDATE_STATUS_UPDATED_NEED_REBOOT) {
     LOG(INFO) << "Not updating b/c we already updated and we're waiting for "
               << "reboot";
@@ -95,15 +95,18 @@
     // Update in progress. Do nothing
     return;
   }
-  full_update_ = force_full_update;
+  if (!omaha_request_params_.Init()) {
+    LOG(ERROR) << "Unable to initialize Omaha request device params.";
+    return;
+  }
   CHECK(!processor_.IsRunning());
   processor_.set_delegate(this);
 
   // Actions:
-  shared_ptr<OmahaRequestPrepAction> update_check_prep_action(
-      new OmahaRequestPrepAction(force_full_update));
   shared_ptr<OmahaRequestAction> update_check_action(
-      new OmahaRequestAction(NULL, new LibcurlHttpFetcher));
+      new OmahaRequestAction(omaha_request_params_,
+                             NULL,
+                             new LibcurlHttpFetcher));
   shared_ptr<OmahaResponseHandlerAction> response_handler_action(
       new OmahaResponseHandlerAction);
   shared_ptr<FilesystemCopierAction> filesystem_copier_action(
@@ -118,10 +121,9 @@
       new SetBootableFlagAction);
   shared_ptr<PostinstallRunnerAction> postinstall_runner_action_postcommit(
       new PostinstallRunnerAction(false));
-  shared_ptr<OmahaRequestPrepAction> install_success_prep_action(
-      new OmahaRequestPrepAction(false));
   shared_ptr<OmahaRequestAction> install_success_action(
-      new OmahaRequestAction(new OmahaEvent(OmahaEvent::kTypeInstallComplete,
+      new OmahaRequestAction(omaha_request_params_,
+                             new OmahaEvent(OmahaEvent::kTypeInstallComplete,
                                             OmahaEvent::kResultSuccess,
                                             0),
                              new LibcurlHttpFetcher));
@@ -129,7 +131,6 @@
   download_action->set_delegate(this);
   response_handler_action_ = response_handler_action;
 
-  actions_.push_back(shared_ptr<AbstractAction>(update_check_prep_action));
   actions_.push_back(shared_ptr<AbstractAction>(update_check_action));
   actions_.push_back(shared_ptr<AbstractAction>(response_handler_action));
   actions_.push_back(shared_ptr<AbstractAction>(filesystem_copier_action));
@@ -141,7 +142,6 @@
   actions_.push_back(shared_ptr<AbstractAction>(set_bootable_flag_action));
   actions_.push_back(shared_ptr<AbstractAction>(
       postinstall_runner_action_postcommit));
-  actions_.push_back(shared_ptr<AbstractAction>(install_success_prep_action));
   actions_.push_back(shared_ptr<AbstractAction>(install_success_action));
 
   // Enqueue the actions
@@ -152,8 +152,6 @@
 
   // Bond them together. We have to use the leaf-types when calling
   // BondActions().
-  BondActions(update_check_prep_action.get(),
-              update_check_action.get());
   BondActions(update_check_action.get(),
               response_handler_action.get());
   BondActions(response_handler_action.get(),
@@ -168,8 +166,6 @@
               set_bootable_flag_action.get());
   BondActions(set_bootable_flag_action.get(),
               postinstall_runner_action_postcommit.get());
-  BondActions(install_success_prep_action.get(),
-              install_success_action.get());
 
   SetStatusAndNotify(UPDATE_STATUS_CHECKING_FOR_UPDATE);
   processor_.StartProcessing();
@@ -181,7 +177,7 @@
               << UpdateStatusToString(status_) << ", so not checking.";
     return;
   }
-  Update(false);
+  Update();
 }
 
 // Delegate methods:
diff --git a/update_attempter.h b/update_attempter.h
index 9d69403..753b409 100644
--- a/update_attempter.h
+++ b/update_attempter.h
@@ -12,6 +12,7 @@
 #include <glib.h>
 #include "update_engine/action_processor.h"
 #include "update_engine/download_action.h"
+#include "update_engine/omaha_request_params.h"
 #include "update_engine/omaha_response_handler_action.h"
 
 struct UpdateEngineService;
@@ -35,8 +36,7 @@
 class UpdateAttempter : public ActionProcessorDelegate,
                         public DownloadActionDelegate {
  public:
-  UpdateAttempter() : full_update_(false),
-                      dbus_service_(NULL),
+  UpdateAttempter() : dbus_service_(NULL),
                       status_(UPDATE_STATUS_IDLE),
                       download_progress_(0.0),
                       last_checked_time_(0),
@@ -47,22 +47,22 @@
     if (utils::FileExists(kUpdateCompletedMarker))
       status_ = UPDATE_STATUS_UPDATED_NEED_REBOOT;
   }
-  void Update(bool force_full_update);
-  
+  void Update();
+
   // ActionProcessorDelegate methods:
   void ProcessingDone(const ActionProcessor* processor, bool success);
   void ProcessingStopped(const ActionProcessor* processor);
   void ActionCompleted(ActionProcessor* processor,
                        AbstractAction* action,
                        bool success);
-  
+
   // Stop updating. An attempt will be made to record status to the disk
   // so that updates can be resumed later.
   void Terminate();
-  
+
   // Try to resume from a previously Terminate()d update.
   void ResumeUpdating();
-  
+
   // Returns the current status in the out params. Returns true on success.
   bool GetStatus(int64_t* last_checked_time,
                  double* progress,
@@ -83,13 +83,12 @@
   // Sets the status to the given status and notifies a status update
   // over dbus.
   void SetStatusAndNotify(UpdateStatus status);
-  
+
   struct timespec last_notify_time_;
 
-  bool full_update_;
   std::vector<std::tr1::shared_ptr<AbstractAction> > actions_;
   ActionProcessor processor_;
-  
+
   // If non-null, this UpdateAttempter will send status updates over this
   // dbus service.
   UpdateEngineService* dbus_service_;
@@ -104,6 +103,9 @@
   std::string new_version_;
   int64_t new_size_;
 
+  // Device paramaters common to all Omaha requests.
+  OmahaRequestDeviceParams omaha_request_params_;
+
   DISALLOW_COPY_AND_ASSIGN(UpdateAttempter);
 };
 
