RFC: support streaming a block index' content into a char device #227
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Within RAUC (an updating solution for embedded systems) we want to apply
casync
to the usecase of updating UBI volumes whose interface to userspace consists of char devices: to do so the only working solution today without intermediate extraction to a temporary regular file would be to spawncasync mkdev <BLOB_INDEX>
and then to copy the whole contents of the attached/dev/nbdX
over to the UBI volume's char device/dev/ubiY_Z
. This is inefficient as the data has to be moved around bycasync
first and a second time by the copying mechanism. It would definitively be resource saving ifcasync extract <BLOB_INDEX> /dev/ubiY_Z
works which is what the pull request's commit finally permits.As
casync
checks the output's file descriptor for belonging to a regular file or a block device several times in the code I am uncertain if there are implicit assumptions incasync's
decoder that I am not aware of and that are breaking down now (that's why I put the RFC in front of the pull request's title). So the question is if my patch is valid at all?Although what this pull request changes is enough for our usecase it would definitely be appreciated if
casync extract <BLOB_INDEX>
could cope with pipes as output, too. Having that feature would allow to manually do things like# casync extract <BLOB_INDEX> | ubiupdatevol /dev/ubiY_Z --size=<bytes> -
on the commandline. It should be straight forward to extend this patch with
S_ISFIFO(…)
correspondingly.