ART: Change signature file derivation
Derive the name of the signature apex by walking the directory
chain.
Also drop etc.
Bug: 125474642
Test: manual
Change-Id: I88bf00273d8a327c72d3a4b9ccc1e930ff9c8b9a
diff --git a/build/apex/art_prepostinstall_utils.sh b/build/apex/art_prepostinstall_utils.sh
index bc21b76..f5a94d1 100644
--- a/build/apex/art_prepostinstall_utils.sh
+++ b/build/apex/art_prepostinstall_utils.sh
@@ -49,14 +49,18 @@
}
function setup_fsverity {
+ local full_shell_path=`readlink -f $0`
+ local bin_dir=`dirname $full_shell_path`
+ local apex_dir=`dirname $bin_dir`
+ local sig_dir="${apex_dir}.signatures"
local file=$1
- local signature_file="/apex/com.android.runtime.signatures/etc/$file.sig"
+ local signature_file="$sig_dir/$file.sig"
# Setup.
- log -t art_apex "fsverity setup for $file"
+ log_info "fsverity setup for $file"
SETUP_MSG=`fsverity setup $file --signature=$signature_file --hash=sha256 2>&1` || \
{ log_error "Setup failed: $SETUP_MSG" ; return 300 ; }
# Enable.
- log -t art_apex "fsverity enable for $file"
+ log_info "fsverity enable for $file"
ENABLE_MSG=`fsverity enable $file 2>&1` || \
{ log_error "Enable failed: $ENABLE_MSG" ; return 301 ; }
# Test integrity.