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 Avb& avb,
28 const std::string& new_kernel_path,
29 const std::string& boot_image_path,
30 const std::string& new_boot_image_path,
31 const std::string& build_dir);
32bool RepackVendorBootImage(const std::string& new_ramdisk_path,
33 const std::string& vendor_boot_image_path,
34 const std::string& new_vendor_boot_image_path,
35 const std::string& unpack_dir,
36 bool bootconfig_supported);
38 const std::string& vendor_boot_image_path,
39 const std::string& new_vendor_boot_image_path,
40 const std::string& unpack_dir, bool bootconfig_supported);
41
42Result<std::string> UnpackBootImage(const std::string& boot_image_path,
43 const std::string& unpack_dir);
44
46 const std::string& vendor_boot_image_path, const std::string& unpack_dir);
47void RepackGem5BootImage(const std::string& initrd_path,
48 const std::optional<BootConfigPartition>&,
49 const std::string& unpack_dir,
50 const std::string& input_ramdisk_path);
51Result<std::string> ReadAndroidVersionFromBootImage(
52 const std::string& boot_image_path);
53
54void UnpackRamdisk(const std::string& original_ramdisk_path,
55 const std::string& ramdisk_stage_dir);
56void PackRamdisk(const std::string& ramdisk_stage_dir,
57 const std::string& output_ramdisk);
58}
Definition: alloc_utils.cpp:23
Result< std::string > ReadAndroidVersionFromBootImage(const std::string &boot_image_path)
Definition: boot_image_utils.cc:472
bool 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:384
Result< std::string > UnpackBootImage(const std::string &boot_image_path, const std::string &unpack_dir)
Definition: boot_image_utils.cc:192
bool UnpackVendorBootImageIfNotUnpacked(const std::string &vendor_boot_image_path, const std::string &unpack_dir)
Definition: boot_image_utils.cc:207
void PackRamdisk(const std::string &ramdisk_stage_dir, const std::string &output_ramdisk)
Definition: boot_image_utils.cc:147
void UnpackRamdisk(const std::string &original_ramdisk_path, const std::string &ramdisk_stage_dir)
Definition: boot_image_utils.cc:153
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:395
bool 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:307
Result< void > RepackBootImage(const Avb &avb, const std::string &new_kernel_path, const std::string &boot_image_path, const std::string &new_boot_image_path, const std::string &build_dir)
Definition: boot_image_utils.cc:270