zipfuse now runs in microdroid as a service. The source zip file path
and the mount point are fixed to /dev/block/by-name/microdroid-apk and
/mnt/apk, respectively.
To support that, microdroid_payload.json is amended to add
MicrodroidTestAppk.apk to the payload.img file. This eventually should
be done dynamically by the virt manager.
Bug: 186377508
Test: atest MicrodroidHostTestCases
Change-Id: I7a031ad442995dbd3cdc00a51a0e939c1589a7b2
Add a test case to ensure that zipfuse works with a block device whose
content is backed by a zip file. Fortunately, zip-rs already supports
reading a zip file from a block device: it locates the end of central
directory record by reverse-scanning a file from the end.
Bug: 186377508
Test: cargo test (android test missing because we don't have the
loopdevice crate for Android, which is fine)
Change-Id: I8fbbfd18a2a0df2a550e3f679ba74ba603b59efd
Add a new test case for the deflate algorithm. Use the zip file that is
created using soong_zip as the input, mount the zip file using zipfuse
and then check the files.
Bug: 186377508
Test: cargo test
Test: atest ZipFuseTest
Change-Id: I62e9e8af535d8d867b4bc720c636d2dc45ed9953
This change fixes a bug that the 'size' parameter of the `readdir` call
was incorrectly interprested as the maximum number of directory entires
that kernel can accept. In fact, that is the maximum number of bytes
that kernel can accept for the directory entries.
To handle this correcty, we incrementally calculate the number of bytes
required to hold directories entries from the specified offset. When the
calculated number becomes greater than the requested buffer size, we
stop and pass the entries enumerated so far.
Adds a test to excercise the path that the directory entries are so many
that they don't fit to a single buffer (thus requiring multiple readdir
calls).
Also made a small change that opendir returns CACHE_DIR so that they are
cached.
Bug: 186377508
Test: atest ZipFuseTest
Change-Id: I86e767b58b2f0793132be462e2a8fa63266f7774
update_crate_tests.py would add ZipFuseTest to the
TEST_MAPPING of crates {syn,futures-task,proc-macro2,libc}
However, due to no test_suites, it would failed TEST_MAPPING presubmit,
error msg "Missing test_suite setting for test: ZipFuseTest"
Bug: 187946695
Test: TH
Change-Id: Ieb94930f5cbe262bffefbca9a68257a31b66f144
libfuse uses CString. In order to avoid conversion between OsString and
CString, zipfuse also internally uses CString.
Bug: 186377508
Test: atest ZipFuseTest
Change-Id: I48cfc294d3d897ab89179205465e652d8ffbeeee
zipfuse is a read-only FUSE implementation for zip archive. It will be
used to make files embedded in APKs (which are zip files) be accessible
as regular files in microdroid.
Bug: 186377508
Test: atest ZipFuseTest
Change-Id: Idf0fb4d32b8a2d957da9188fedeebb5610050e65