full_update_generator.h revision 072359ca138504065e1e0c1189eb38c09576d324
1// Copyright (c) 2010 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#ifndef UPDATE_ENGINE_PAYLOAD_GENERATOR_FULL_UPDATE_GENERATOR_H_
6#define UPDATE_ENGINE_PAYLOAD_GENERATOR_FULL_UPDATE_GENERATOR_H_
7
8#include <glib.h>
9
10#include <string>
11#include <vector>
12
13#include "update_engine/payload_generator/graph_types.h"
14
15namespace chromeos_update_engine {
16
17class FullUpdateGenerator {
18 public:
19  // Given a new rootfs and kernel (|new_image|, |new_kernel_part|), reads them
20  // sequentially, creating a full update of chunk_size chunks. Populates
21  // |graph|, |kernel_ops|, and |final_order|, with data about the update
22  // operations, and writes relevant data to |fd|, updating |data_file_size| as
23  // it does. Only the first |image_size| bytes are read from |new_image|
24  // assuming that this is the actual file system.
25  static bool Run(
26      Graph* graph,
27      const std::string& new_kernel_part,
28      const std::string& new_image,
29      off_t image_size,
30      int fd,
31      off_t* data_file_size,
32      off_t chunk_size,
33      off_t block_size,
34      std::vector<DeltaArchiveManifest_InstallOperation>* kernel_ops,
35      std::vector<Vertex::Index>* final_order);
36
37 private:
38  // This should never be constructed.
39  DISALLOW_IMPLICIT_CONSTRUCTORS(FullUpdateGenerator);
40};
41
42}  // namespace chromeos_update_engine
43
44#endif  // UPDATE_ENGINE_PAYLOAD_GENERATOR_FULL_UPDATE_GENERATOR_H_
45