-
Notifications
You must be signed in to change notification settings - Fork 2
initial fastboot OCI support #6
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c1a134b
initial fastboot
bennyz 99f0128
update README.md
bennyz 22cb752
use oci:// prefix to mark OCI images
bennyz ffe2ae7
add support for default partitions
bennyz 104e868
remove unused params
bennyz 09fd312
reduce duplications in log
bennyz 8855f06
update timeout and rename annotations param
bennyz d135a9b
remove duplications and unused code
bennyz 085883f
add missing FLS_REGISTRY_USER
bennyz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| //! CentOS Automotive Suite OCI constant | ||
| //! | ||
|
|
||
| /// OCI annotation keys used by automotive images for partition mapping | ||
| pub mod annotations { | ||
| pub const PARTITION_ANNOTATION: &str = "automotive.sdv.cloud.redhat.com/partition"; | ||
|
|
||
| pub const DECOMPRESSED_SIZE: &str = "automotive.sdv.cloud.redhat.com/decompressed-size"; | ||
|
|
||
| pub const TARGET: &str = "automotive.sdv.cloud.redhat.com/target"; | ||
|
|
||
| pub const ARCH: &str = "automotive.sdv.cloud.redhat.com/arch"; | ||
|
|
||
| pub const DISTRO: &str = "automotive.sdv.cloud.redhat.com/distro"; | ||
|
|
||
| pub const MULTI_LAYER: &str = "automotive.sdv.cloud.redhat.com/multi-layer"; | ||
|
|
||
| pub const PARTS: &str = "automotive.sdv.cloud.redhat.com/parts"; | ||
|
|
||
| /// Comma-separated list of default partitions to flash | ||
| pub const DEFAULT_PARTITIONS: &str = "automotive.sdv.cloud.redhat.com/default-partitions"; | ||
| } | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| pub mod targets { | ||
| pub const RIDESX4: &str = "ridesx4"; | ||
| pub const AUTOSD: &str = "autosd"; | ||
| } | ||
|
|
||
| /// Extract partition name from layer annotations | ||
| pub fn extract_partition_name( | ||
| layer_annotations: &std::collections::HashMap<String, String>, | ||
| ) -> Option<String> { | ||
| layer_annotations | ||
| .get(annotations::PARTITION_ANNOTATION) | ||
| .cloned() | ||
| } | ||
|
|
||
| /// Extract decompressed size from layer annotations | ||
| pub fn extract_decompressed_size( | ||
| layer_annotations: &std::collections::HashMap<String, String>, | ||
| ) -> Option<u64> { | ||
| layer_annotations | ||
| .get(annotations::DECOMPRESSED_SIZE) | ||
| .and_then(|s| s.parse().ok()) | ||
| } | ||
|
|
||
| /// Extract target platform from OCI annotations | ||
| pub fn extract_target_from_annotations( | ||
| manifest_annotations: &std::collections::HashMap<String, String>, | ||
| ) -> Option<String> { | ||
| manifest_annotations.get(annotations::TARGET).cloned() | ||
| } | ||
Oops, something went wrong.
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.
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.
probably better suited for the jumpstarter driver...