blob: bd6648716de2cf3dce4642ca28b4f9e38de6444a [file] [log] [blame]
Alex Deymo2b19cfb2015-03-26 00:35:07 -07001// Copyright 2015 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_RAW_FILESYSTEM_H_
6#define UPDATE_ENGINE_PAYLOAD_GENERATOR_RAW_FILESYSTEM_H_
7
8// A simple filesystem interface implementation used for unknown filesystem
9// format such as the kernel.
10
11#include "update_engine/payload_generator/filesystem_interface.h"
12
13#include <string>
14#include <vector>
15
16namespace chromeos_update_engine {
17
18class RawFilesystem : public FilesystemInterface {
19 public:
20 static std::unique_ptr<RawFilesystem> Create(
21 const std::string& filename, uint64_t block_size, uint64_t block_count);
22 virtual ~RawFilesystem() = default;
23
24 // FilesystemInterface overrides.
25 size_t GetBlockSize() const override;
26 size_t GetBlockCount() const override;
27
28 // GetFiles will return only one file with all the blocks of the filesystem
29 // with the name passed during construction.
30 bool GetFiles(std::vector<File>* files) const override;
31
Alex Deymo2e9533b2015-06-26 20:57:06 -070032 bool LoadSettings(chromeos::KeyValueStore* store) const override {
33 return false;
34 }
35
Alex Deymo2b19cfb2015-03-26 00:35:07 -070036 private:
37 RawFilesystem() = default;
38
39 std::string filename_;
40 uint64_t block_count_;
41 uint64_t block_size_;
42
43 DISALLOW_COPY_AND_ASSIGN(RawFilesystem);
44};
45
46} // namespace chromeos_update_engine
47
48#endif // UPDATE_ENGINE_PAYLOAD_GENERATOR_RAW_FILESYSTEM_H_