Android11代码路径:
external/avb/libavb
修改点:
android/external/avb$ git diff diff --git a/Android.bp b/Android.bp index dfb1cc1..c4ddea0 100644 --- a/Android.bp +++ b/Android.bp @@ -208,7 +208,7 @@ cc_library_static { "avb_headers", ], export_header_lib_headers: ["avb_headers"], - shared_libs: ["libbase"], + shared_libs: ["libbase", "liblog",], static_libs: ["libfs_mgr"], cflags: [ "-DAVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED", diff --git a/libavb/avb_slot_verify.c b/libavb/avb_slot_verify.c index 0d75210..0a8b18a 100644 --- a/libavb/avb_slot_verify.c +++ b/libavb/avb_slot_verify.c @@ -691,6 +691,7 @@ static AvbSlotVerifyResult load_and_verify_vbmeta( NULL); } + LOGI("[load_and_verify_vbmeta] --> read_from partition: %s", full_partition_name); io_ret = ops->read_from_partition(ops, full_partition_name, vbmeta_offset, @@ -735,6 +736,7 @@ static AvbSlotVerifyResult load_and_verify_vbmeta( /* Check if the image is properly signed and get the public key used * to sign the image. */ + LOGI("[load_and_verify_vbmeta] --> avb_vbmeta_image_verify"); vbmeta_ret = avb_vbmeta_image_verify(vbmeta_buf, vbmeta_num_read, &pk_data, &pk_len); switch (vbmeta_ret) { @@ -1481,6 +1483,7 @@ AvbSlotVerifyResult avb_slot_verify(AvbOps* ops, } else { /* Usual path, load "vbmeta"... */ + LOGI("[avb_slot_verify] --> load_and_verify_vbmeta"); ret = load_and_verify_vbmeta(ops, requested_partitions, ab_suffix, diff --git a/libavb/avb_util.h b/libavb/avb_util.h index 3ca84f0..246a32a 100644 --- a/libavb/avb_util.h +++ b/libavb/avb_util.h @@ -30,6 +30,7 @@ #define AVB_UTIL_H_ #include "avb_sysdeps.h" +#include <android/log.h> #ifdef __cplusplus extern "C" { @@ -38,6 +39,16 @@ extern "C" { #define AVB_STRINGIFY(x) #x #define AVB_TO_STRING(x) AVB_STRINGIFY(x) +#ifndef MODULE_NAME +#define MODULE_NAME "libavb" +#endif + +#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, MODULE_NAME, __VA_ARGS__) +#define LOGW(...) __android_log_print(ANDROID_LOG_WARN, MODULE_NAME, __VA_ARGS__) +#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, MODULE_NAME, __VA_ARGS__) +#define LOGF(...) __android_log_print(ANDROID_LOG_FATAL, MODULE_NAME, __VA_ARGS__) + + #ifdef AVB_ENABLE_DEBUG /* Aborts the program if |expr| is false. * (END)
串口log或者logcat log中输出:
行 1062: 01-03 04:10:20.879 0 0 I libavb : [avb_slot_verify] --> load_and_verify_vbmeta 行 1064: 01-03 04:10:20.896 0 0 I libavb : [load_and_verify_vbmeta] --> read_from partition: vbmeta_a 行 1066: 01-03 04:10:20.914 0 0 I libavb : [load_and_verify_vbmeta] --> avb_vbmeta_image_verify 行 1068: 01-03 04:10:20.929 0 0 I libavb : [load_and_verify_vbmeta] --> read_from partition: vbmeta_system_a 行 1070: 01-03 04:10:20.942 0 0 I libavb : [load_and_verify_vbmeta] --> avb_vbmeta_image_verify
标签:11,__,log,verify,load,libavb,vbmeta,avb From: https://www.cnblogs.com/xiululu/p/18517234