Skip to content

update tar2ext4 package#1785

Merged
anmaxvl merged 2 commits intomicrosoft:mainfrom
anmaxvl:tar2ext4-updates
May 23, 2023
Merged

update tar2ext4 package#1785
anmaxvl merged 2 commits intomicrosoft:mainfrom
anmaxvl:tar2ext4-updates

Conversation

@anmaxvl
Copy link
Copy Markdown
Contributor

@anmaxvl anmaxvl commented May 18, 2023

Add another ReadExt4SuperBlock implementatino to work with io.ReadSeeker in addition to working with files directly. This way we'll be able to work with e.g. ext4 GPT partitions.

Additionally write verity superblock directly without io.SeekEnd, assumming that the writer is already set at correct offset.

@anmaxvl anmaxvl requested a review from a team as a code owner May 18, 2023 01:25
Copy link
Copy Markdown
Contributor

@helsaawy helsaawy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change w in ComputeAndWriteHashDevice from io.WriteSeeker to io.Writer, so its explicit that it just appends the hash to the current location, without seeking?
Or, if its exported, update the comments to specify that?

@anmaxvl anmaxvl force-pushed the tar2ext4-updates branch 3 times, most recently from 11ad2ee to b67ce8e Compare May 18, 2023 16:44
@anmaxvl anmaxvl force-pushed the tar2ext4-updates branch 3 times, most recently from 0813a8c to 4c90763 Compare May 19, 2023 00:25
@anmaxvl anmaxvl changed the title update ReadExt4SuperBlock and ComputeAndWriteHashDevice update tar2ext4 package May 19, 2023
Add another `ReadExt4SuperBlockReadSeeker` implementation
to work with `io.ReadSeeker` in addition to working with
files directly. This way we'll be able to work with e.g.
ext4 GPT partitions. The existing `ReadExt4SuperBlock` works
the same, but has been updated to call `ReadExt4SuperBlockReadSeeker`.

Add `ReadDMVerityInfoReader` that reads dmverity superblock
from an `io.Reader` and update `ReadDMVerityInfo` accordingly.

Additionally write verity superblock directly without `io.SeekEnd`,
assumming that the writer is already set at correct offset.
`ComputeAndWriteHashDevice` parameters have been updated
accordingly.

Add `Ext4FileSystemSize` function that reads ext4 superblock
from a given `io.ReadSeeker` and returns the underlying
ext4 filesystem size and its superblock.

Signed-off-by: Maksim An <[email protected]>
@anmaxvl anmaxvl force-pushed the tar2ext4-updates branch from 4c90763 to 12e71f5 Compare May 19, 2023 23:20
Signed-off-by: Maksim An <[email protected]>
@anmaxvl anmaxvl merged commit 36359c0 into microsoft:main May 23, 2023
@anmaxvl anmaxvl deleted the tar2ext4-updates branch May 23, 2023 20:38
anmaxvl pushed a commit that referenced this pull request Oct 20, 2023
princepereira pushed a commit to princepereira/hcsshim that referenced this pull request Aug 29, 2024
Add another `ReadExt4SuperBlockReadSeeker` implementation
to work with `io.ReadSeeker` in addition to working with
files directly. This way we'll be able to work with e.g.
ext4 GPT partitions. The existing `ReadExt4SuperBlock` works
the same, but has been updated to call `ReadExt4SuperBlockReadSeeker`.

Add `ReadDMVerityInfoReader` that reads dmverity superblock
from an `io.Reader` and update `ReadDMVerityInfo` accordingly.

Additionally write verity superblock directly without `io.SeekEnd`,
assumming that the writer is already set at correct offset.
`ComputeAndWriteHashDevice` parameters have been updated
accordingly.

Add `Ext4FileSystemSize` function that reads ext4 superblock
from a given `io.ReadSeeker` and returns the underlying
ext4 filesystem size and its superblock.

Signed-off-by: Maksim An <[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.

3 participants