-
Notifications
You must be signed in to change notification settings - Fork 79
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
Implement sparse image support #30
base: master
Are you sure you want to change the base?
Conversation
Based on original work from linux-msm#5 Signed-off-by: Christopher Obbard <[email protected]>
n = read(fd, buf, chunk_size * program->sector_size); | ||
if (n < 0) | ||
err(1, "failed to read"); | ||
// TODO originally used sparse_stream_callback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently it times out.
thanks for sending this PR.. support for sparse support is very much needed.. I am wondering if using libsparse is really a great thing though. First the distribution of libsparse in distro is not always great (I don't think Archlinux has it), and hardcoding the lib path like you did is problematic. Also, I think it complicates the main loop when processing the file quite a bit.. how difficult (or wrong?) would it be to implement a small 'unsparse' algorithm directly in qdl? would that be a bad idea? |
@ndechesne I agree. It would be better to not pull in library dependency, and implement the sparse algorithm directly. |
Right, using the library is a bit of a pain. The other two open PRs vendor in libsparse. If that is acceptable, I can do that here too? |
CFLAGS := -O2 -Wall -g `pkg-config --cflags libxml-2.0` | ||
LDFLAGS := `pkg-config --libs libxml-2.0 libudev` | ||
CFLAGS := -O2 -Wall -g `pkg-config --cflags libxml-2.0` -I/usr/include/android | ||
LDFLAGS := `pkg-config --libs libxml-2.0 libudev` -L/usr/lib/x86_64-linux-gnu/android -Wl,-rpath=/usr/lib/x86_64-linux-gnu/android -lsparse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this part of a commonly available package in most distributions?
What can be done about the "x86_64"-part, I'm exclusively running qdl on my ARM64 laptop.
I was under the impression that the sparse format essentially is a form of run-length-encoding to avoid encoding the empty regions in the image. Would it be possible to implement this in qdl, instead of relying on a 3rd party library?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andersson I don't have the bandwidth to make this modification right now.
Based on original work from #5
Signed-off-by: Christopher Obbard [email protected]