Lines Matching refs:apex_file
297 Result<ApexFile> apex_file = ApexFile::Open(path); in RemovePreviouslyActiveApexFiles() local
298 if (!apex_file.ok()) { in RemovePreviouslyActiveApexFiles()
299 return apex_file.error(); in RemovePreviouslyActiveApexFiles()
302 const std::string& package_name = apex_file->GetManifest().name(); in RemovePreviouslyActiveApexFiles()
309 if (files_to_keep.find(apex_file->GetPath()) != files_to_keep.end()) { in RemovePreviouslyActiveApexFiles()
314 LOG(DEBUG) << "Deleting previously active apex " << apex_file->GetPath(); in RemovePreviouslyActiveApexFiles()
315 if (unlink(apex_file->GetPath().c_str()) != 0) { in RemovePreviouslyActiveApexFiles()
316 return ErrnoError() << "Failed to unlink " << apex_file->GetPath(); in RemovePreviouslyActiveApexFiles()
599 for (const ApexFile& apex_file : apexes) { in PrePostinstallPackages() local
600 if (!(apex_file.GetManifest().*fn)().empty()) { in PrePostinstallPackages()
637 Result<ApexFile> apex_file = ApexFile::Open(path); in OpenApexFiles() local
638 if (!apex_file.ok()) { in OpenApexFiles()
639 return apex_file.error(); in OpenApexFiles()
641 ret.emplace_back(std::move(*apex_file)); in OpenApexFiles()
662 Result<void> VerifyPackageBoot(const ApexFile& apex_file) { in VerifyPackageBoot() argument
663 Result<ApexVerityData> verity_or = apex_file.VerifyApexVerity(); in VerifyPackageBoot()
668 if (shim::IsShimApex(apex_file)) { in VerifyPackageBoot()
672 const auto& result = ValidateStagingShimApex(apex_file); in VerifyPackageBoot()
684 Result<void> VerifyPackageInstall(const ApexFile& apex_file) { in VerifyPackageInstall() argument
685 const auto& verify_package_boot_status = VerifyPackageBoot(apex_file); in VerifyPackageInstall()
689 Result<ApexVerityData> verity_or = apex_file.VerifyApexVerity(); in VerifyPackageInstall()
694 return RunVerifyFnInsideTempMount(apex_file, kSuccessFn); in VerifyPackageInstall()
707 for (const ApexFile& apex_file : *apex_files) { in verifyPackages()
708 Result<void> result = verify_apex_fn(apex_file); in verifyPackages()
781 auto backup_path_fn = [](const ApexFile& apex_file) { in BackupActivePackages() argument
783 GetPackageId(apex_file.GetManifest()).c_str(), in BackupActivePackages()
797 Result<ApexFile> apex_file = ApexFile::Open(path); in BackupActivePackages() local
798 if (!apex_file.ok()) { in BackupActivePackages()
799 return Error() << "Backup failed : " << apex_file.error(); in BackupActivePackages()
801 const auto& dest_path = backup_path_fn(*apex_file); in BackupActivePackages()
802 if (link(apex_file->GetPath().c_str(), dest_path.c_str()) != 0) { in BackupActivePackages()
803 return ErrnoError() << "Failed to backup " << apex_file->GetPath(); in BackupActivePackages()
954 Result<void> activatePackageImpl(const ApexFile& apex_file) { in activatePackageImpl() argument
955 const ApexManifest& manifest = apex_file.GetManifest(); in activatePackageImpl()
957 if (gBootstrap && !isBootstrapApex(apex_file)) { in activatePackageImpl()
997 auto mountStatus = MountPackage(apex_file, mountPoint); in activatePackageImpl()
1015 gMountedApexes.SetLatest(manifest.name(), apex_file.GetPath()); in activatePackageImpl()
1018 LOG(DEBUG) << "Successfully activated " << apex_file.GetPath() in activatePackageImpl()
1027 Result<ApexFile> apex_file = ApexFile::Open(full_path); in activatePackage() local
1028 if (!apex_file.ok()) { in activatePackage()
1029 return apex_file.error(); in activatePackage()
1031 return activatePackageImpl(*apex_file); in activatePackage()
1160 Result<ApexFile> apex_file = ApexFile::Open(path); in getFactoryPackages() local
1161 if (!apex_file.ok()) { in getFactoryPackages()
1162 LOG(ERROR) << apex_file.error(); in getFactoryPackages()
1164 ret.emplace_back(std::move(*apex_file)); in getFactoryPackages()
1219 Result<ApexFile> apex_file = ApexFile::Open(name); in ScanApexFiles() local
1220 if (!apex_file.ok()) { in ScanApexFiles()
1221 LOG(ERROR) << "Failed to scan " << name << " : " << apex_file.error(); in ScanApexFiles()
1223 ret.emplace_back(std::move(*apex_file)); in ScanApexFiles()
1634 Result<ApexFile> apex_file = ApexFile::Open(apex); in scanStagedSessionsDirAndStage() local
1635 if (!apex_file.ok()) { in scanStagedSessionsDirAndStage()
1639 session.AddApexName(apex_file->GetManifest().name()); in scanStagedSessionsDirAndStage()
1679 std::string StageDestPath(const ApexFile& apex_file) { in StageDestPath() argument
1681 GetPackageId(apex_file.GetManifest()).c_str(), in StageDestPath()
1730 Result<ApexFile> apex_file = ApexFile::Open(path); in stagePackages() local
1731 if (!apex_file.ok()) { in stagePackages()
1732 return apex_file.error(); in stagePackages()
1736 std::string new_hashtree_file = GetHashTreeFileName(*apex_file, in stagePackages()
1738 std::string old_hashtree_file = GetHashTreeFileName(*apex_file, in stagePackages()
1749 std::string dest_path = StageDestPath(*apex_file); in stagePackages()
1757 if (link(apex_file->GetPath().c_str(), dest_path.c_str()) != 0) { in stagePackages()
1758 return ErrnoError() << "Unable to link " << apex_file->GetPath() << " to " in stagePackages()
1762 staged_packages.insert(apex_file->GetManifest().name()); in stagePackages()
1764 LOG(DEBUG) << "Success linking " << apex_file->GetPath() << " to " in stagePackages()