summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dennis Shen <dzshen@google.com> 2022-11-02 16:03:42 +0000
committer Dennis Shen <dzshen@google.com> 2022-11-03 22:54:48 +0000
commitc232049c9980e6a80baf91f135baf89f23d9075d (patch)
tree930194cd2696e66f8ab9be1286838cf3c5d026b2
parentb34672426f067db0b9fa48f9d6f276d8f7c31219 (diff)
Update deapexer extract call
BUG: b/255963179, b/240288941 Test: art/build/apex/runtests.sh Change-Id: I1bca2baf0aa43d092f75dad5d5b1ead9d7b55455
-rw-r--r--build/apex/Android.bp4
-rwxr-xr-xbuild/apex/art_apex_test.py16
-rwxr-xr-xbuild/apex/runtests.sh2
-rwxr-xr-xtools/buildbot-build.sh5
-rwxr-xr-xtools/buildbot-sync.sh2
5 files changed, 26 insertions, 3 deletions
diff --git a/build/apex/Android.bp b/build/apex/Android.bp
index 6728821d92..07b37f97ea 100644
--- a/build/apex/Android.bp
+++ b/build/apex/Android.bp
@@ -523,6 +523,8 @@ python_binary_host {
art_check_apex_gen_stem = "$(location art-apex-tester)" +
" --deapexer $(location deapexer)" +
" --debugfs $(location debugfs_static)" +
+ " --fsckerofs $(location fsck.erofs)" +
+ " --blkid $(location blkid)" +
" --tmpdir $(genDir)"
// The non-flattened APEXes are always checked, as they are always generated
@@ -532,8 +534,10 @@ genrule_defaults {
defaults: ["art_module_source_build_genrule_defaults"],
tools: [
"art-apex-tester",
+ "blkid",
"deapexer",
"debugfs_static",
+ "fsck.erofs",
],
}
diff --git a/build/apex/art_apex_test.py b/build/apex/art_apex_test.py
index 3f98903244..900ada7926 100755
--- a/build/apex/art_apex_test.py
+++ b/build/apex/art_apex_test.py
@@ -65,12 +65,14 @@ def isEnvTrue(var):
return var in os.environ and os.environ[var] == 'true'
-def extract_apex(apex_path, deapexer_path, debugfs_path, tmpdir):
+def extract_apex(apex_path, deapexer_path, debugfs_path, fsckerofs_path,
+ blkid_path, tmpdir):
_, apex_name = os.path.split(apex_path)
extract_path = os.path.join(tmpdir, apex_name)
if os.path.exists(extract_path):
shutil.rmtree(extract_path)
subprocess.check_call([deapexer_path, '--debugfs', debugfs_path,
+ '--fsckerofs', fsckerofs_path, '--blkid', blkid_path,
'extract', apex_path, extract_path],
stdout=subprocess.DEVNULL)
return extract_path
@@ -898,6 +900,12 @@ def art_apex_test_main(test_args):
if not test_args.debugfs:
logging.error("Need debugfs.")
return 1
+ if not test_args.fsckerofs:
+ logging.error("Need fsck.erofs.")
+ return 1
+ if not test_args.blkid:
+ logging.error("Need blkid.")
+ return 1
if test_args.host:
# Host APEX.
@@ -937,7 +945,7 @@ def art_apex_test_main(test_args):
# Extract the apex. It would be nice to use the output from "deapexer list"
# to avoid this work, but it doesn't provide info about executable bits.
apex_dir = extract_apex(test_args.apex, test_args.deapexer, test_args.debugfs,
- test_args.tmpdir)
+ test_args.fsckerofs, test_args.blkid, test_args.tmpdir)
apex_provider = TargetApexProvider(apex_dir)
except (zipfile.BadZipFile, zipfile.LargeZipFile) as e:
logging.error('Failed to create provider: %s', e)
@@ -1023,6 +1031,8 @@ def art_apex_test_default(test_parser):
test_args = test_parser.parse_args(['unused']) # For consistency.
test_args.debugfs = '%s/bin/debugfs' % host_out
+ test_args.fsckerofs = '%s/bin/fsck.erofs' % host_out
+ test_args.blkid = '%s/bin/blkid' % host_out
test_args.tmpdir = '.'
test_args.tree = False
test_args.list = False
@@ -1078,6 +1088,8 @@ if __name__ == "__main__":
parser.add_argument('--tmpdir', help='Directory for temp files')
parser.add_argument('--deapexer', help='Path to deapexer')
parser.add_argument('--debugfs', help='Path to debugfs')
+ parser.add_argument('--fsckerofs', help='Path to fsck.erofs')
+ parser.add_argument('--blkid', help='Path to blkid')
parser.add_argument('--bitness', help='Bitness to check', choices=BITNESS_ALL,
default=BITNESS_AUTO)
diff --git a/build/apex/runtests.sh b/build/apex/runtests.sh
index a452fe619a..9e6167a188 100755
--- a/build/apex/runtests.sh
+++ b/build/apex/runtests.sh
@@ -206,6 +206,8 @@ for apex_module in ${apex_modules[@]}; do
if $have_deapexer_p; then
art_apex_test_args="$art_apex_test_args --deapexer $HOST_OUT/bin/deapexer"
art_apex_test_args="$art_apex_test_args --debugfs $HOST_OUT/bin/debugfs_static"
+ art_apex_test_args="$art_apex_test_args --fsckerofs $HOST_OUT/bin/fsck.erofs"
+ art_apex_test_args="$art_apex_test_args --blkid $HOST_OUT/bin/blkid"
fi
case $apex_module in
(*.debug) test_only_args="--flavor debug";;
diff --git a/tools/buildbot-build.sh b/tools/buildbot-build.sh
index 25f3b600ba..d540d74363 100755
--- a/tools/buildbot-build.sh
+++ b/tools/buildbot-build.sh
@@ -168,6 +168,8 @@ if [[ $build_target == "yes" ]]; then
# Extract prebuilt APEXes.
debugfs=$ANDROID_HOST_OUT/bin/debugfs_static
+ fsckerofs=$ANDROID_HOST_OUT/bin/fsck.erofs
+ blkid=$ANDROID_HOST_OUT/bin/blkid
for apex in ${apexes[@]}; do
dir="$ANDROID_PRODUCT_OUT/system/apex/${apex}"
apexbase="$ANDROID_PRODUCT_OUT/system/apex/${apex}"
@@ -181,7 +183,8 @@ if [[ $build_target == "yes" ]]; then
msginfo "Extracting APEX file:" "${file}"
rm -rf $dir
mkdir -p $dir
- $ANDROID_HOST_OUT/bin/deapexer --debugfs_path $debugfs extract $file $dir
+ $ANDROID_HOST_OUT/bin/deapexer --debugfs_path $debugfs --fsckerofs_path $fsckerofs \
+ --blkid_path $blkid extract $file $dir
fi
done
diff --git a/tools/buildbot-sync.sh b/tools/buildbot-sync.sh
index 28dab0ce04..afc0691984 100755
--- a/tools/buildbot-sync.sh
+++ b/tools/buildbot-sync.sh
@@ -95,6 +95,8 @@ activate_apex() {
msginfo "Extracting APEX ${src_apex_file}..."
mkdir -p $src_apex_path
$ANDROID_HOST_OUT/bin/deapexer --debugfs_path $ANDROID_HOST_OUT/bin/debugfs_static \
+ --fsckerofs_path $ANDROID_HOST_OUT/bin/fsck.erofs \
+ --blkid_path $ANDROID_HOST_OUT/bin/blkid \
extract ${src_apex_file} $src_apex_path
fi