Add package validation command#64
Open
landerweit-phytec wants to merge 19 commits intophytec:mainfrom
Open
Conversation
812ecaa to
92ddeb8
Compare
418f8e1 to
2458213
Compare
2458213 to
5cc4bbc
Compare
319aac1 to
ad3f15f
Compare
mschwan-phytec
requested changes
Sep 22, 2023
Collaborator
mschwan-phytec
left a comment
There was a problem hiding this comment.
A first glimpse on your PR...
Collaborator
|
You may want to consider squashing some commit fixing earlier stuff of your PR, e.g.: There is code in |
mschwan-phytec
requested changes
Sep 22, 2023
doc/usage.rst
Outdated
Comment on lines
+54
to
+56
| -s, --skip-checksums Skip checksum verification for all input files | ||
| -w, --write-file Install the package to a file as an additional validation step | ||
| -k, --keep-file-as=FILENAME Keep the file. Implies --write-file |
Collaborator
There was a problem hiding this comment.
From a user perspective I think it is not clear, what you mean exactly with "file" in the options --write-file and --keep-file-as as the term collides with the input files.
src/pu-main.c
Outdated
| { "skip-checksums", 's', G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, | ||
| &arg_validate_skip_checksums, "Skip checksum verification for all input files", NULL }, | ||
| { "size", 0, G_OPTION_FLAG_NONE, G_OPTION_ARG_STRING, | ||
| &arg_validate_file_size, "Size of loop device. Default is 1G", "SIZE" }, |
Collaborator
There was a problem hiding this comment.
Again, a user may not be familiar with loop devices, so this description is not easy to understand without looking at the inner workings of partup.
ad3f15f to
794acc2
Compare
Only append the source filename in case the destination is a directory. Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
Add functions to create and remove loop devices. Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
Separate input files from flash specific information as they only contain general information like filename, checksums and size on target. Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
Add a list for all input files regardless of their destination. Use it to get the absolute path and size of all input files at once after config parsing instead of during writing. Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
Add a new function for config validation. For now only verifies checksums. Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
Checksum verification is done with the validate command. So remove it from the install command to save time when writing to a device. Update the docs accordingly. Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
These steps are not necessary for package installation so execute them only when validating a package. Also, update the tests accordingly. Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
Add an additional validation step to check if the input files of each partition fit into the corresponding partition. Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
Check if the fixed size partitions fit into the device. This does not check expanding partitions. Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
Add a new function pu_parse_size() which accepts a size string and returns the size in bytes. Accepts strings with the same format as ped_parse_unit, but only with absolute units. Also, add a corresponding unit test. Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
The new command 'validate' validates a package either against a provided device or a new loop device. Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
Writing the package to the loop device is an additional validation step. This is similar to installing the package to a real device. Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
The generated image can be written with dd. Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
8cc250f to
b056f7f
Compare
a97a710 to
ed48627
Compare
9ab6f72 to
41bf69f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add a new command for package validation
validate.The goal of package validation is to make sure a package can be written to a device without writing to the device. Additionally, remove most validation steps from the
installcommand to reduce the time i takes to write to the device.Open tasks:
validatewithout passing a device (maybe use a loop device and pass eMMC size as argument)