Home
last modified time | relevance | path

Searched refs:path (Results 1 – 25 of 53) sorted by relevance

123

/bootable/recovery/tests/unit/
Dsysutil_test.cpp39 ASSERT_TRUE(android::base::WriteStringToFile(android::base::Join(content, '\n'), temp_file.path)); in TEST()
41 auto block_map_data = BlockMapData::ParseBlockMapFile(temp_file.path); in TEST()
42 ASSERT_EQ("/dev/abc", block_map_data.path()); in TEST()
59 ASSERT_TRUE(android::base::WriteStringToFile(android::base::Join(content, '\n'), temp_file.path)); in TEST()
61 auto block_map_data1 = BlockMapData::ParseBlockMapFile(temp_file.path); in TEST()
74 ASSERT_TRUE(android::base::WriteStringToFile(android::base::Join(content, '\n'), temp_file.path)); in TEST()
76 auto block_map_data = BlockMapData::ParseBlockMapFile(temp_file.path); in TEST()
77 ASSERT_EQ("/dev/abc", block_map_data.path()); in TEST()
82 ASSERT_TRUE(android::base::WriteStringToFile(android::base::Join(content, '\n'), temp_file.path)); in TEST()
83 auto large_block_size = BlockMapData::ParseBlockMapFile(temp_file.path); in TEST()
[all …]
Dapplypatch_test.cpp62 target_partition = Partition(partition_file.path, target_size, target_sha1); in SetUp()
69 Paths::Get().set_cache_temp_source(cache_temp_source.path); in SetUp()
73 ASSERT_TRUE(android::base::RemoveFileIfExists(cache_temp_source.path)); in TearDown()
168 std::string path = dirname + "/" + de->d_name; in FindFilesInDir() local
171 if (stat(path.c_str(), &st) == 0 && S_ISREG(st.st_mode)) { in FindFilesInDir()
189 Paths::Get().set_cache_log_directory(mock_log_dir.path); in SetUp()
215 AddFilesToDir(mock_cache.path, files); in TEST_F()
216 ASSERT_EQ(files, FindFilesInDir(mock_cache.path)); in TEST_F()
217 ASSERT_EQ(4096 * 7, MockFreeSpaceChecker(mock_cache.path)); in TEST_F()
219 ASSERT_TRUE(RemoveFilesInDirectory(4096 * 9, mock_cache.path, MockFreeSpaceChecker)); in TEST_F()
[all …]
Ddirutil_test.cpp39 ASSERT_EQ(0, mkdir_recursively(td.path, 0755, false, nullptr)); in TEST()
46 ASSERT_EQ(-1, mkdir_recursively(tf.path, 0755, false, nullptr)); in TEST()
52 std::string prefix(td.path); in TEST()
53 std::string path = prefix + "/a/b"; in TEST() local
55 ASSERT_EQ(0, mkdir_recursively(path, mode, false, nullptr)); in TEST()
59 ASSERT_EQ(0, stat(path.c_str(), &sb)) << strerror(errno); in TEST()
71 std::string prefix(td.path); in TEST()
72 std::string path = prefix + "/a/b"; in TEST() local
73 ASSERT_EQ(0, mkdir_recursively(path, 0755, true, nullptr)); in TEST()
80 ASSERT_EQ(-1, stat(path.c_str(), &sb)); in TEST()
[all …]
Dfuse_provider_test.cpp37 fake_block_device.path, "10000 4096", "3", "10 11", "20 21", "22 23", in TEST()
41 android::base::WriteStringToFile(android::base::Join(lines, '\n'), temp_file.path); in TEST()
42 auto block_map_data = FuseBlockDataProvider::CreateFromBlockMap(temp_file.path, 4096); in TEST()
58 ASSERT_TRUE(android::base::WriteStringToFile(content, fake_block_device.path)); in TEST()
61 fake_block_device.path, in TEST()
67 android::base::WriteStringToFile(android::base::Join(lines, '\n'), temp_file.path); in TEST()
68 auto block_map_data = FuseBlockDataProvider::CreateFromBlockMap(temp_file.path, 4096); in TEST()
86 ASSERT_TRUE(android::base::WriteStringToFile(content, temp_file.path)); in TEST()
89 temp_file.path, "36384 4096", "2", "0 5", "6 10", in TEST()
92 ASSERT_TRUE(android::base::WriteStringToFile(android::base::Join(lines, '\n'), block_map.path)); in TEST()
[all …]
Dparse_install_logs_test.cpp30 auto metrics = ParseLastInstall(last_install.path); in TEST()
36 ASSERT_TRUE(android::base::WriteStringToFile("/cache/recovery/ota.zip\n0\n", last_install.path)); in TEST()
37 auto metrics = ParseLastInstall(last_install.path); in TEST()
40 ASSERT_TRUE(android::base::WriteStringToFile("/sideload/package.zip\n0\n", last_install.path)); in TEST()
41 metrics = ParseLastInstall(last_install.path); in TEST()
Dfuse_sideload_test.cpp72 ASSERT_TRUE(android::base::WriteStringToFile(content, temp_file.path)); in TEST()
74 auto provider = std::make_unique<FuseFileDataProvider>(temp_file.path, 4096); in TEST()
79 ASSERT_EQ(0, run_fuse_sideload(std::move(provider), mount_point.path)); in TEST()
83 std::string package = std::string(mount_point.path) + "/" + FUSE_SIDELOAD_HOST_FILENAME; in TEST()
105 std::string exit_flag = std::string(mount_point.path) + "/" + FUSE_SIDELOAD_HOST_EXIT_FLAG; in TEST()
Dupdater_test.cpp145 Paths::Get().set_cache_temp_source(temp_saved_source_.path); in SetUp()
146 Paths::Get().set_last_command_file(temp_last_command_.path); in SetUp()
147 Paths::Get().set_stash_directory_base(temp_stash_base_.path); in SetUp()
149 last_command_file_ = temp_last_command_.path; in SetUp()
150 image_file_ = image_temp_file_.path; in SetUp()
158 std::string updated_marker{ temp_stash_base_.path }; in TearDown()
159 updated_marker += "/" + GetSha1(image_temp_file_.path) + ".UPDATED"; in TearDown()
179 ASSERT_TRUE(updater_.Init(temp_pipe.release(), zip_file.path, false)); in RunBlockImageUpdate()
186 ASSERT_TRUE(android::base::ReadFileToString(temp_pipe.path, &pipe_content)); in RunBlockImageUpdate()
306 ASSERT_TRUE(android::base::WriteStringToFile(buffer, temp_file1.path)); in TEST_F()
[all …]
Dinstall_test.cpp60 ASSERT_EQ(0, OpenArchive(temp_file.path, &zip)); in TEST()
70 ASSERT_EQ(0, OpenArchive(temp_file2.path, &zip)); in TEST()
82 ASSERT_EQ(0, OpenArchive(temp_file.path, &zip)); in TEST()
99 ASSERT_TRUE(android::base::ReadFileToString(temp_file.path, &wipe_package)); in TEST()
120 ASSERT_EQ(0, OpenArchive(temp_file.path, &zip)); in TEST()
124 std::string binary_path = std::string(td.path) + "/update_binary"; in TEST()
160 ASSERT_EQ(0, OpenArchive(temp_file.path, &zip)); in TEST()
164 Paths::Get().set_temporary_update_binary(std::string(td.path) + "/update_binary"); in TEST()
192 ASSERT_EQ(0, OpenArchive(temp_file.path, &zip)); in VerifyAbUpdateCommands()
243 ASSERT_EQ(0, OpenArchive(temp_file.path, &zip)); in TEST()
[all …]
Dapplypatch_modes_test.cpp64 ASSERT_TRUE(android::base::WriteStringToFile("", patched_file_.path)); in SetUp()
65 target = GetEmmcTargetString(recovery_file, patched_file_.path); in SetUp()
68 Paths::Get().set_cache_temp_source(cache_source_.path); in SetUp()
145 patch_file.path, nullptr)); in TEST_F()
148 "applypatch", "--patch", patch_file.path, "--target", target, "--source", source, in TEST_F()
/bootable/recovery/install/
Dfuse_install.cpp58 static std::string BrowseDirectory(const std::string& path, Device* device, RecoveryUI* ui) { in BrowseDirectory() argument
59 ensure_path_mounted(path); in BrowseDirectory()
61 std::unique_ptr<DIR, decltype(&closedir)> d(opendir(path.c_str()), closedir); in BrowseDirectory()
63 PLOG(ERROR) << "error opening " << path; in BrowseDirectory()
90 std::vector<std::string> headers{ "Choose a package to install:", path }; in BrowseDirectory()
109 std::string new_path = path + "/" + item; in BrowseDirectory()
124 static bool StartInstallPackageFuse(std::string_view path) { in StartInstallPackageFuse() argument
125 if (path.empty()) { in StartInstallPackageFuse()
130 bool is_block_map = android::base::ConsumePrefix(&path, "@"); in StartInstallPackageFuse()
132 is_block_map ? FuseBlockDataProvider::CreateFromBlockMap(std::string(path), FUSE_BLOCK_SIZE) in StartInstallPackageFuse()
[all …]
Dpackage.cpp35 MemoryPackage(const std::string& path, std::unique_ptr<MemMapping> map,
88 FilePackage(android::base::unique_fd&& fd, uint64_t file_size, const std::string& path,
121 const std::string& path, const std::function<void(float)>& set_progress) { in CreateMemoryPackage() argument
123 if (!mmap->MapFile(path)) { in CreateMemoryPackage()
128 return std::make_unique<MemoryPackage>(path, std::move(mmap), set_progress); in CreateMemoryPackage()
132 const std::string& path, const std::function<void(float)>& set_progress) { in CreateFilePackage() argument
133 android::base::unique_fd fd(open(path.c_str(), O_RDONLY)); in CreateFilePackage()
135 PLOG(ERROR) << "Failed to open " << path; in CreateFilePackage()
145 return std::make_unique<FilePackage>(std::move(fd), file_size, path, set_progress); in CreateFilePackage()
153 MemoryPackage::MemoryPackage(const std::string& path, std::unique_ptr<MemMapping> map, in MemoryPackage() argument
[all …]
/bootable/recovery/tests/unit/host/
Dimgdiff_test.cpp120 ASSERT_TRUE(android::base::WriteStringToFile(src, src_file.path)); in TEST()
124 ASSERT_TRUE(android::base::WriteStringToFile(tgt, tgt_file.path)); in TEST()
128 "imgdiff", src_file.path, tgt_file.path, patch_file.path, in TEST()
134 ASSERT_TRUE(android::base::ReadFileToString(patch_file.path, &patch)); in TEST()
173 "imgdiff", "-z", src_file.path, tgt_file.path, patch_file.path, in TEST()
179 ASSERT_TRUE(android::base::ReadFileToString(tgt_file.path, &tgt)); in TEST()
181 ASSERT_TRUE(android::base::ReadFileToString(src_file.path, &src)); in TEST()
183 ASSERT_TRUE(android::base::ReadFileToString(patch_file.path, &patch)); in TEST()
227 "imgdiff", "-z", src_file.path, tgt_file.path, patch_file.path, in TEST()
233 ASSERT_TRUE(android::base::ReadFileToString(tgt_file.path, &tgt)); in TEST()
[all …]
Dupdate_simulator_test.cpp75 patch_file.path, nullptr)); in CreateBsdiffPatch()
76 ASSERT_TRUE(android::base::ReadFileToString(patch_file.path, patch)); in CreateBsdiffPatch()
85 Paths::Get().set_cache_temp_source(temp_saved_source.path); in RunSimulation()
86 Paths::Get().set_last_command_file(temp_last_command.path); in RunSimulation()
87 Paths::Get().set_stash_directory_base(temp_stash_base.path); in RunSimulation()
96 BuildInfo build_info(work_dir.path, false); in RunSimulation()
154 TargetFile target_file(zip_file.path, false); in TEST_F()
160 "IMAGES/system.img", FstabInfo("/dev/system", "system", "ext4"), temp_dir.path, &raw_image)); in TEST_F()
164 ASSERT_TRUE(android::base::ReadFileToString(raw_image.path, &content)); in TEST_F()
174 TargetFile target_file(zip_file.path, false); in TEST_F()
[all …]
/bootable/recovery/otautil/
Ddirutil.cpp33 static DirStatus dir_status(const std::string& path) { in dir_status() argument
35 if (stat(path.c_str(), &sb) == 0) { in dir_status()
58 std::string path = input_path; in mkdir_recursively() local
61 size_t pos = path.rfind('/'); in mkdir_recursively()
66 path.resize(pos + 1); in mkdir_recursively()
69 path.push_back('/'); in mkdir_recursively()
73 DirStatus ds = dir_status(path); in mkdir_recursively()
82 while (prev_end < path.size()) { in mkdir_recursively()
83 size_t next_end = path.find('/', prev_end + 1); in mkdir_recursively()
87 std::string dir_path = path.substr(0, next_end); in mkdir_recursively()
/bootable/recovery/fuse_sideload/
Dfuse_provider.cpp36 FuseFileDataProvider::FuseFileDataProvider(const std::string& path, uint32_t block_size) { in FuseFileDataProvider() argument
38 if (stat(path.c_str(), &sb) == -1) { in FuseFileDataProvider()
39 fprintf(stderr, "failed to stat %s: %s\n", path.c_str(), strerror(errno)); in FuseFileDataProvider()
43 fd_.reset(open(path.c_str(), O_RDONLY)); in FuseFileDataProvider()
45 fprintf(stderr, "failed to open %s: %s\n", path.c_str(), strerror(errno)); in FuseFileDataProvider()
52 std::unique_ptr<FuseDataProvider> FuseFileDataProvider::CreateFromFile(const std::string& path, in CreateFromFile() argument
54 return std::make_unique<FuseFileDataProvider>(path, block_size); in CreateFromFile()
142 android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(block_map.path().c_str(), O_RDONLY))); in CreateFromBlockMap()
144 PLOG(ERROR) << "Failed to open " << block_map.path(); in CreateFromBlockMap()
/bootable/recovery/recovery_utils/include/recovery_utils/
Droots.h33 int ensure_path_mounted(const std::string& path);
36 int ensure_path_mounted_at(const std::string& path, const std::string& mount_point);
40 int ensure_path_unmounted(const std::string& path);
/bootable/recovery/uncrypt/
Duncrypt.cpp171 static std::string FindBlockDevice(const std::string& path, bool* encryptable, bool* encrypted, in FindBlockDevice() argument
180 if (android::base::StartsWith(path, entry.mount_point + "/")) { in FindBlockDevice()
243 static int ProductBlockMap(const std::string& path, const std::string& map_file, in ProductBlockMap() argument
264 if (stat(path.c_str(), &sb) != 0) { in ProductBlockMap()
265 PLOG(ERROR) << "failed to stat " << path; in ProductBlockMap()
291 android::base::unique_fd fd(open(path.c_str(), O_RDWR)); in ProductBlockMap()
293 PLOG(ERROR) << "failed to open " << path << " for reading"; in ProductBlockMap()
327 PLOG(ERROR) << "Failed to set pin_file for f2fs: " << path << " on " << blk_dev; in ProductBlockMap()
352 int error = RetryFibmap(fd, path, &block, head_block); in ProductBlockMap()
374 PLOG(ERROR) << "failed to read " << path; in ProductBlockMap()
[all …]
/bootable/recovery/recovery_utils/
Dlogging.cpp61 static FILE* fopen_path(const std::string& path, const char* mode, const selabel_handle* sehandle) { in fopen_path() argument
62 if (ensure_path_mounted(path) != 0) { in fopen_path()
63 LOG(ERROR) << "Can't mount " << path; in fopen_path()
70 mkdir_recursively(path, 0777, true, sehandle); in fopen_path()
72 return fopen(path.c_str(), mode); in fopen_path()
274 std::string path = android::base::StringPrintf("%s/%s", CACHE_LOG_DIR, de->d_name); in ReadLogFilesToMemory() local
277 if (stat(path.c_str(), &sb) != 0) { in ReadLogFilesToMemory()
278 PLOG(ERROR) << "Failed to stat " << path; in ReadLogFilesToMemory()
285 android::base::unique_fd log_fd(TEMP_FAILURE_RETRY(open(path.c_str(), O_RDONLY))); in ReadLogFilesToMemory()
287 PLOG(ERROR) << "Failed to read log file " << path; in ReadLogFilesToMemory()
[all …]
Dthermalutil.cpp64 for (const auto& path : thermal_paths) { in GetMaxValueFromThermalZone() local
66 if (!android::base::ReadFileToString(path, &content)) { in GetMaxValueFromThermalZone()
67 PLOG(WARNING) << "Failed to read " << path; in GetMaxValueFromThermalZone()
Droots.cpp79 int ensure_path_mounted_at(const std::string& path, const std::string& mount_point) { in ensure_path_mounted_at() argument
80 return android::fs_mgr::EnsurePathMounted(&fstab, path, mount_point) ? 0 : -1; in ensure_path_mounted_at()
83 int ensure_path_mounted(const std::string& path) { in ensure_path_mounted() argument
85 return android::fs_mgr::EnsurePathMounted(&fstab, path) ? 0 : -1; in ensure_path_mounted()
88 int ensure_path_unmounted(const std::string& path) { in ensure_path_unmounted() argument
89 return android::fs_mgr::EnsurePathUnmounted(&fstab, path) ? 0 : -1; in ensure_path_unmounted()
/bootable/recovery/updater_sample/tools/
Dtest_gen_update_config.py25 import os.path
55 ota_package = os.path.join(os.path.dirname(__file__),
/bootable/recovery/applypatch/
Dfreecache.cpp54 std::string path = android::base::StringPrintf("/proc/%s/fd/", de->d_name); in EliminateOpenFiles() local
57 std::unique_ptr<DIR, decltype(&closedir)> fdd(opendir(path.c_str()), closedir); in EliminateOpenFiles()
59 PLOG(ERROR) << "Failed to open " << path; in EliminateOpenFiles()
63 std::string fd_path = path + fdde->d_name; in EliminateOpenFiles()
92 std::string path = dirname + "/" + de->d_name; in FindExpendableFiles() local
96 if (path == Paths::Get().cache_temp_source()) { in FindExpendableFiles()
106 if (stat(path.c_str(), &st) == 0 && S_ISREG(st.st_mode)) { in FindExpendableFiles()
107 files.insert(path); in FindExpendableFiles()
/bootable/recovery/otautil/include/otautil/
Dsysutil.h47 std::string path() const { in path() function
63 BlockMapData(const std::string& path, uint64_t file_size, uint32_t block_size, in BlockMapData() argument
65 : path_(path), in BlockMapData()
/bootable/recovery/updater/
Dupdate_simulator_main.cpp134 Paths::Get().set_cache_temp_source(temp_saved_source.path); in main()
135 Paths::Get().set_last_command_file(temp_last_command.path); in main()
136 Paths::Get().set_stash_directory_base(temp_stash_base.path); in main()
141 work_dir = source_temp_dir.path; in main()
/bootable/recovery/install/include/install/
Dpackage.h41 const std::string& path, const std::function<void(float)>& set_progress);
44 static std::unique_ptr<Package> CreateFilePackage(const std::string& path,

123