Merge "Skip the cache size check on host" am: 31bcd7c002
am: fb8496e3aa
Change-Id: If57297252bfe3ccf9c45028747a8fa8760052c48
This commit is contained in:
@@ -30,6 +30,8 @@ cc_defaults {
|
|||||||
cc_library_static {
|
cc_library_static {
|
||||||
name: "libapplypatch",
|
name: "libapplypatch",
|
||||||
|
|
||||||
|
host_supported: true,
|
||||||
|
|
||||||
defaults: [
|
defaults: [
|
||||||
"applypatch_defaults",
|
"applypatch_defaults",
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -450,9 +450,8 @@ int CacheSizeCheck(size_t bytes) {
|
|||||||
if (MakeFreeSpaceOnCache(bytes) < 0) {
|
if (MakeFreeSpaceOnCache(bytes) < 0) {
|
||||||
printf("unable to make %zu bytes available on /cache\n", bytes);
|
printf("unable to make %zu bytes available on /cache\n", bytes);
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function applies binary patches to EMMC target files in a way that is safe (the original
|
// This function applies binary patches to EMMC target files in a way that is safe (the original
|
||||||
@@ -477,7 +476,7 @@ int CacheSizeCheck(size_t bytes) {
|
|||||||
// become obsolete since we have dropped the support for patching non-EMMC targets (EMMC targets
|
// become obsolete since we have dropped the support for patching non-EMMC targets (EMMC targets
|
||||||
// have the size embedded in the filename).
|
// have the size embedded in the filename).
|
||||||
int applypatch(const char* source_filename, const char* target_filename,
|
int applypatch(const char* source_filename, const char* target_filename,
|
||||||
const char* target_sha1_str, size_t target_size __unused,
|
const char* target_sha1_str, size_t /* target_size */,
|
||||||
const std::vector<std::string>& patch_sha1_str,
|
const std::vector<std::string>& patch_sha1_str,
|
||||||
const std::vector<std::unique_ptr<Value>>& patch_data, const Value* bonus_data) {
|
const std::vector<std::unique_ptr<Value>>& patch_data, const Value* bonus_data) {
|
||||||
printf("patch %s: ", source_filename);
|
printf("patch %s: ", source_filename);
|
||||||
|
|||||||
@@ -111,6 +111,12 @@ static std::set<std::string> FindExpendableFiles() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int MakeFreeSpaceOnCache(size_t bytes_needed) {
|
int MakeFreeSpaceOnCache(size_t bytes_needed) {
|
||||||
|
#ifndef __ANDROID__
|
||||||
|
// TODO (xunchang) implement a heuristic cache size check during host simulation.
|
||||||
|
printf("Skip making (%zu) bytes free space on cache; program is running on host\n", bytes_needed);
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
size_t free_now = FreeSpaceForFile("/cache");
|
size_t free_now = FreeSpaceForFile("/cache");
|
||||||
printf("%zu bytes free on /cache (%zu needed)\n", free_now, bytes_needed);
|
printf("%zu bytes free on /cache (%zu needed)\n", free_now, bytes_needed);
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
cc_library_static {
|
cc_library_static {
|
||||||
name: "libotafault",
|
name: "libotafault",
|
||||||
|
|
||||||
|
host_supported: true,
|
||||||
|
|
||||||
srcs: [
|
srcs: [
|
||||||
"config.cpp",
|
"config.cpp",
|
||||||
"ota_io.cpp",
|
"ota_io.cpp",
|
||||||
|
|||||||
Reference in New Issue
Block a user