Skip to content

Create linux-sparse files when extracting zip archive members#2261

Merged
Databean merged 1 commit intogoogle:mainfrom
Databean:extract_linux_sparse
Mar 13, 2026
Merged

Create linux-sparse files when extracting zip archive members#2261
Databean merged 1 commit intogoogle:mainfrom
Databean:extract_linux_sparse

Conversation

@Databean
Copy link
Copy Markdown
Member

@Databean Databean commented Mar 13, 2026

  • Uses NativeFileystem for the output of ExtractFile for zip files
  • Adds WriterSeeker::Truncate which delegates to ftruncate for file descriptors
  • Adds a new function SparseCopy that uses Truncate to extend file sizes without allocating space.

Bug: b/492300650
Test: bazel run //cuttlefish/package:cvd -c opt -- fetch --default_build=aosp-android12-gsi/aosp_cf_x86_64_phone-userdebug --target_directory=$HOME/a && ls -l ~/a/userdata.img && du -hs ~/a/userdata.img

@Databean Databean requested review from cjreynol and rmuthiah March 13, 2026 00:47
- Uses NativeFileystem for the output of ExtractFile for zip files
- Adds WriterSeeker::Truncate which delegates to ftruncate for file
  descriptors
- Adds a new function SparseCopy that uses Truncate to extend file sizes
  without allocating space.

Bug: b/492300650
Test: bazel run //cuttlefish/package:cvd -c opt -- fetch --default_build=aosp-android12-gsi/aosp_cf_x86_64_phone-userdebug --target_directory=$HOME/a && ls -l ~/a/userdata.img && du -hs ~/a/userdata.img
@Databean Databean force-pushed the extract_linux_sparse branch from 1da73bf to 213b7b9 Compare March 13, 2026 00:58
@Databean Databean added this pull request to the merge queue Mar 13, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Mar 13, 2026
@Databean Databean added this pull request to the merge queue Mar 13, 2026
Merged via the queue into google:main with commit dfcb9cd Mar 13, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants