Android-cuttlefish cvd tool
boot_image_utils.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#pragma once
17
18#include <optional>
19#include <string>
20
24
25namespace cuttlefish {
26
27Result<void> RepackBootImage(const std::string& new_kernel_path,
28 const std::string& boot_image_path,
29 const std::string& new_boot_image_path);
30Result<void> RepackVendorBootImage(
31 const std::string& new_ramdisk_path,
32 const std::string& vendor_boot_image_path,
33 const std::string& new_vendor_boot_image_path,
34 const std::string& unpack_dir, bool bootconfig_supported);
36 const std::string& vendor_boot_image_path,
37 const std::string& new_vendor_boot_image_path,
38 const std::string& unpack_dir, bool bootconfig_supported);
39
40Result<void> UnpackBootImage(const std::string& boot_image_path,
41 const std::string& unpack_dir);
42
43Result<VendorBootImage> UnpackVendorBootImageIfNotUnpacked(
44 const std::string& vendor_boot_image_path, const std::string& unpack_dir);
45Result<void> RepackGem5BootImage(const std::string& initrd_path,
46 const std::optional<BootConfigPartition>&,
47 const std::string& unpack_dir,
48 const std::string& input_ramdisk_path);
49Result<std::string> ReadAndroidVersionFromBootImage(
50 const std::string& boot_image_path);
51
52Result<void> UnpackRamdisk(const std::string& original_ramdisk_path,
53 const std::string& ramdisk_stage_dir);
54Result<void> PackRamdisk(const std::string& ramdisk_stage_dir,
55 const std::string& output_ramdisk);
56} // namespace cuttlefish
Definition: alloc_driver.h:20
Result< void > RepackVendorBootImageWithEmptyRamdisk(const std::string &vendor_boot_image_path, const std::string &new_vendor_boot_image_path, const std::string &unpack_dir, bool bootconfig_supported)
Definition: boot_image_utils.cc:369
Result< std::string > ReadAndroidVersionFromBootImage(const std::string &boot_image_path)
Definition: boot_image_utils.cc:458
Result< void > UnpackBootImage(const std::string &boot_image_path, const std::string &unpack_dir)
Definition: boot_image_utils.cc:203
Result< void > RepackGem5BootImage(const std::string &initrd_path, const std::optional< BootConfigPartition > &bootconfig_partition, const std::string &unpack_dir, const std::string &input_ramdisk_path)
Definition: boot_image_utils.cc:382
Result< void > RepackVendorBootImage(const std::string &new_ramdisk, const std::string &vendor_boot_image_path, const std::string &new_vendor_boot_image_path, const std::string &unpack_dir, bool bootconfig_supported)
Definition: boot_image_utils.cc:298
Result< VendorBootImage > UnpackVendorBootImageIfNotUnpacked(const std::string &vendor_boot_image_path, const std::string &unpack_dir)
Definition: boot_image_utils.cc:220
Result< void > UnpackRamdisk(const std::string &original_ramdisk_path, const std::string &ramdisk_stage_dir)
Definition: boot_image_utils.cc:174
Result< void > PackRamdisk(const std::string &ramdisk_stage_dir, const std::string &output_ramdisk)
Definition: boot_image_utils.cc:167
Result< void > RepackBootImage(const std::string &new_kernel_path, const std::string &boot_image_path, const std::string &new_boot_image_path)
Definition: boot_image_utils.cc:256