Remove requirement that fsv_meta file is next to its input file
In soong-built partitions, we will generate fsv_meta files before
a partition staging directory is generated. This means that the source
file will be some module-specific intermediates path, and the dest
file will be a path local to the filesystem module. Relax the
requirement that fsv_meta files are next to the files they protect.
Bug: 394404628
Test: m aosp_shared_system_image, verified it didn't change before/after
Change-Id: I6bbbd23aa93b15220c5b2302cb0b229e8f8de69c
diff --git a/tools/releasetools/fsverity_metadata_generator.py b/tools/releasetools/fsverity_metadata_generator.py
index 50e23e7..e531cca 100644
--- a/tools/releasetools/fsverity_metadata_generator.py
+++ b/tools/releasetools/fsverity_metadata_generator.py
@@ -230,12 +230,6 @@
if not output_file:
output_file = input_file + '.fsv_meta'
- if output_file != args.input + '.fsv_meta':
- sys.exit('When generating .fsv_meta files for symlinks, we assume that all fsv_meta files '
- 'are named the same as the file they protect, just with the .fsv_meta suffix appended. '
- 'We require that all .fsv_meta files follow this convention regardless of if it\'s a link or '
- 'not. However {args.input} had a different output file: {args.output}')
-
# remove the output file first, as switching between a file and a symlink can be complicated
try:
os.remove(output_file)