Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions base/cvd/BUILD.e2fsprogs.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ package(
],
)

cc_binary(
name = "blkid",
srcs = [
"misc/blkid.c",
],
includes = [
"lib",
],
deps = [
"@//build_external/e2fsprogs:e2fsprogs_config",
"@//build_external/e2fsprogs:libext2fs_generated",
":e2fsprogs_version",
":libext2fs",
":libext2_blkid",
],
)

cc_binary(
name = "e2fsdroid",
srcs = [
Expand Down
1 change: 1 addition & 0 deletions base/cvd/cuttlefish/common/libs/utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ cc_library(
copts = COPTS,
strip_include_prefix = "//cuttlefish",
deps = [
"//cuttlefish/host/libs/config:known_paths",
"//cuttlefish/common/libs/utils:result",
"//cuttlefish/common/libs/utils:subprocess",
"//libbase",
Expand Down
8 changes: 5 additions & 3 deletions base/cvd/cuttlefish/common/libs/utils/archive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include "common/libs/utils/result.h"
#include "common/libs/utils/subprocess.h"

#include "host/libs/config/known_paths.h"

namespace cuttlefish {
namespace {

Expand Down Expand Up @@ -57,7 +59,7 @@ Result<std::vector<std::string>> ExtractHelper(
Result<std::vector<std::string>> ExtractFiles(
const std::string& archive, const std::vector<std::string>& to_extract,
const std::string& target_directory) {
Command bsdtar_cmd = Command("/usr/bin/bsdtar")
Command bsdtar_cmd = Command(BsdtarBinary())
.AddParameter("-x")
.AddParameter("-v")
.AddParameter("-C")
Expand Down Expand Up @@ -129,7 +131,7 @@ Result<std::vector<std::string>> ExtractArchiveContents(

std::string ExtractArchiveToMemory(const std::string& archive_filepath,
const std::string& archive_member) {
Command bsdtar_cmd("/usr/bin/bsdtar");
Command bsdtar_cmd(BsdtarBinary());
bsdtar_cmd.AddParameter("-xf");
bsdtar_cmd.AddParameter(archive_filepath);
bsdtar_cmd.AddParameter("-O");
Expand All @@ -146,7 +148,7 @@ std::string ExtractArchiveToMemory(const std::string& archive_filepath,
}

std::vector<std::string> ArchiveContents(const std::string& archive) {
Command bsdtar_cmd("/usr/bin/bsdtar");
Command bsdtar_cmd(BsdtarBinary());
bsdtar_cmd.AddParameter("-tf");
bsdtar_cmd.AddParameter(archive);
std::string bsdtar_input, bsdtar_output;
Expand Down
1 change: 1 addition & 0 deletions base/cvd/cuttlefish/host/libs/config/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ cc_library(
"//cuttlefish/host/libs/config:config_utils",
"//cuttlefish/host/libs/config:cuttlefish_config",
"//cuttlefish/host/libs/config:esp",
"//cuttlefish/host/libs/config:known_paths",
"//cuttlefish/host/libs/config:mbr",
"//cuttlefish/host/libs/config:openwrt_args",
"//libbase",
Expand Down
8 changes: 4 additions & 4 deletions base/cvd/cuttlefish/host/libs/config/data_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "cuttlefish/host/libs/config/config_utils.h"
#include "cuttlefish/host/libs/config/cuttlefish_config.h"
#include "cuttlefish/host/libs/config/esp.h"
#include "cuttlefish/host/libs/config/known_paths.h"
#include "cuttlefish/host/libs/config/mbr.h"
#include "cuttlefish/host/libs/config/openwrt_args.h"

Expand Down Expand Up @@ -102,7 +103,7 @@ Result<void> ResizeImage(const std::string& data_image, int data_image_mb,
}

std::string GetFsType(const std::string& path) {
Command command("/usr/sbin/blkid");
Command command(BlkidBinary());
command.AddParameter(path);

std::string blkid_out;
Expand Down Expand Up @@ -179,11 +180,10 @@ Result<void> CreateBlankImage(const std::string& image, int num_mb,
}

if (image_fmt == "ext4") {
CF_EXPECT(Execute({"/sbin/mkfs.ext4", image}) == 0);
CF_EXPECT(Execute({Mke2fsBinary(), image}) == 0);
} else if (image_fmt == "f2fs") {
auto make_f2fs_path = HostBinaryPath("make_f2fs");
CF_EXPECT(
Execute({make_f2fs_path, "-l", "data", image, "-C", "utf8", "-O",
Execute({Makef2fsBinary(), "-l", "data", image, "-C", "utf8", "-O",
"compression,extra_attr,project_quota,casefold", "-g",
"android", "-b", F2FS_BLOCKSIZE, "-w", F2FS_BLOCKSIZE}) == 0);
} else if (image_fmt == "sdcard") {
Expand Down
8 changes: 8 additions & 0 deletions base/cvd/cuttlefish/host/libs/config/known_paths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ std::string AutomotiveProxyBinary() {

std::string AvbToolBinary() { return HostBinaryPath("avbtool.py"); }

std::string BlkidBinary() { return HostBinaryPath("blkid"); }

std::string BsdtarBinary() { return HostBinaryPath("bsdtar"); }

std::string CasimirBinary() { return HostBinaryPath("casimir"); }

std::string CasimirControlServerBinary() {
Expand Down Expand Up @@ -93,12 +97,16 @@ std::string KernelLogMonitorBinary() {

std::string LogcatReceiverBinary() { return HostBinaryPath("logcat_receiver"); }

std::string Makef2fsBinary() { return HostBinaryPath("make_f2fs"); }

std::string McopyBinary() { return HostBinaryPath("mcopy"); }

std::string MetricsBinary() { return HostBinaryPath("metrics"); }

std::string MkbootimgBinary() { return HostBinaryPath("mkbootimg.py"); }

std::string Mke2fsBinary() { return HostBinaryPath("mke2fs"); }

std::string MkfsFat() { return HostBinaryPath("mkfs.fat"); }

std::string MkuserimgMke2fsBinary() {
Expand Down
4 changes: 4 additions & 0 deletions base/cvd/cuttlefish/host/libs/config/known_paths.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ namespace cuttlefish {
std::string AdbConnectorBinary();
std::string AutomotiveProxyBinary();
std::string AvbToolBinary();
std::string BlkidBinary();
std::string BsdtarBinary();
std::string CasimirBinary();
std::string CasimirControlServerBinary();
std::string ConsoleForwarderBinary();
Expand All @@ -39,9 +41,11 @@ std::string EchoServerBinary();
std::string GnssGrpcProxyBinary();
std::string KernelLogMonitorBinary();
std::string LogcatReceiverBinary();
std::string Makef2fsBinary();
std::string McopyBinary();
std::string MetricsBinary();
std::string MkbootimgBinary();
std::string Mke2fsBinary();
std::string MkfsFat();
std::string MkuserimgMke2fsBinary();
std::string MmdBinary();
Expand Down
2 changes: 2 additions & 0 deletions base/cvd/cuttlefish/package/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ package_files(
"cuttlefish-common/bin/allocd_client": "//cuttlefish/host/libs/allocd:allocd_client",
"cuttlefish-common/bin/assemble_cvd": "//cuttlefish/host/commands/assemble_cvd",
"cuttlefish-common/bin/avbtool.py": "@avb//:avbtool.py",
"cuttlefish-common/bin/blkid": "@e2fsprogs//:blkid",
"cuttlefish-common/bin/bsdtar": "@libarchive//tar:bsdtar",
"cuttlefish-common/bin/casimir_control_server": "//cuttlefish/host/commands/casimir_control_server",
"cuttlefish-common/bin/cf_vhost_user_input": "//cuttlefish/host/commands/vhost_user_input:cf_vhost_user_input",
"cuttlefish-common/bin/console_forwarder": "//cuttlefish/host/commands/console_forwarder",
Expand Down
1 change: 0 additions & 1 deletion base/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Depends: adduser,
grub-efi-ia32-bin [!arm64],
iproute2,
iptables,
libarchive-tools | bsdtar,
libcurl4,
libdrm2,
libfdt1,
Expand Down
Loading