Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpio: Only reassign inodes when missing #178

Merged
merged 1 commit into from
Oct 1, 2023
Merged

cpio: Only reassign inodes when missing #178

merged 1 commit into from
Oct 1, 2023

Conversation

chenxiaolong
Copy link
Owner

This way, archives with hard links can pass through cpio unpack and cpio pack, even though there's no explicit support for hard links.

This also changes the trailer entry logic to not set an inode number. AOSP's mkbootfs and magiskboot both start at 300000 and increment by one for each entry, including the trailer. However, GNU cpio, bsdcpio, busybox, and toybox all set it to 0, which makes more sense given that it doesn't represent anything on disk.

This way, archives with hard links can pass through `cpio unpack` and
`cpio pack`, even though there's no explicit support for hard links.

This also changes the trailer entry logic to not set an inode number.
AOSP's mkbootfs and magiskboot both start at 300000 and increment by one
for each entry, including the trailer. However, GNU cpio, bsdcpio,
busybox, and toybox all set it to 0, which makes more sense given that
it doesn't represent anything on disk.

Signed-off-by: Andrew Gunnerson <[email protected]>
@chenxiaolong chenxiaolong self-assigned this Oct 1, 2023
@chenxiaolong chenxiaolong merged commit 83265e5 into master Oct 1, 2023
26 checks passed
@chenxiaolong chenxiaolong deleted the cpio branch October 1, 2023 20:38
chenxiaolong added a commit that referenced this pull request Oct 1, 2023
Signed-off-by: Andrew Gunnerson <[email protected]>
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.

1 participant