Skip to content

Conversation

@dxdxdt
Copy link

@dxdxdt dxdxdt commented Oct 25, 2022

I've added MKE2FS_POPULATE_UID and MKE2FS_POPULATE_GID env vars for use with -d option so that I don't have to use root privileges to change the uid and gid when the contents of source root directory are not owned by root. mksquashfs sets the uid and gid to 0 by default. I wanted this feature in mke2fs as well.

I doubt the usefulness of these env vars as it seems no one really felt the need to implement these. I just wanted to put it out here so that someone can use my work.

- Add MKE2FS_POPULATE_UID and MKE2FS_POPULATE_GID env vars for use
  with -d option
- To implement mksquashfs -all-root option equivalent: the env vars
  will come in handy when creating a file system without root
  privileges
@zokier
Copy link

zokier commented Feb 19, 2024

Just for reference, e2fsdroid has this piece of code dealing with uids/gids https://github.com/tytso/e2fsprogs/blob/master/contrib/android/perms.c#L134-L156

Not sure why they opted to do it in a post-processing step instead of fs_callback during population. In any case, it might make sense to align these two similar features?

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