Skip to content

Commit

Permalink
Merge pull request #340 from salvete/main
Browse files Browse the repository at this point in the history
[EROFS] Add support for xattr reservation of the base layer rootdir
  • Loading branch information
BigVan authored Jul 30, 2024
2 parents b5b704b + 13ff566 commit 35d90d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/overlaybd/tar/erofs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include(FetchContent)
FetchContent_Declare(
erofs-utils
GIT_REPOSITORY git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git
GIT_TAG 617d708925b3c5d1dd132853e47d9d9f51443e6f
GIT_TAG ac0997ea32a465a6b0db7b782bb8d4d07952365a
)

FetchContent_MakeAvailable(erofs-utils)
Expand Down
5 changes: 5 additions & 0 deletions src/overlaybd/tar/erofs/liberofs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#define round_down_blk(addr) ((addr) & (~(SECTOR_SIZE - 1)))
#define round_up_blk(addr) (round_down_blk((addr) + SECTOR_SIZE - 1))
#define min(a, b) (a) < (b) ? (a) : (b)
#define EROFS_ROOT_XATTR_SZ (16 * 1024)

#define EROFS_UNIMPLEMENTED 1

Expand Down Expand Up @@ -641,6 +642,10 @@ int LibErofs::extract_tar(photon::fs::IFile *source, bool meta_only, bool first_
cfg.incremental = !first_layer;
erofs_cfg = erofs_get_configure();
erofs_cfg->c_ovlfs_strip = true;
if (first_layer)
erofs_cfg->c_root_xattr_isize = EROFS_ROOT_XATTR_SZ;
else
erofs_cfg->c_root_xattr_isize = 0;
cfg.mp_fp = std::tmpfile();

err = erofs_mkfs(&cfg);
Expand Down

0 comments on commit 35d90d2

Please sign in to comment.