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