-
Notifications
You must be signed in to change notification settings - Fork 76
Rebase: Flash script as build result #1196
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
base: main
Are you sure you want to change the base?
Rebase: Flash script as build result #1196
Conversation
Signed-off-by: Valentin Kharin <[email protected]>
Signed-off-by: juliuskoskela-unikie <[email protected]>
Signed-off-by: juliuskoskela-unikie <[email protected]>
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.
Pull Request Overview
This PR updates the flake modules for various targets to wrap packages with a flash script as part of the build result. The primary changes include modifying package definitions in multiple target-specific modules to use the new flash script generator and introducing the helper function genPkgWithFlashScript in lib.nix.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| targets/nvidia-jetson-orin/flake-module.nix | Wraps packages with genPkgWithFlashScript for aarch64-linux and x86_64-linux targets. |
| targets/microchip-icicle-kit/flake-module.nix | Updates x86_64-linux package generation to include flash script. |
| targets/laptop/flake-module.nix | Adjusts package mapping to use genPkgWithFlashScript with a dynamic system value. |
| targets/generic-x86_64/flake-module.nix | Updates x86_64-linux package generation in a similar manner. |
| lib.nix | Introduces genPkgWithFlashScript to combine package and flash-script components. |
Comments suppressed due to low confidence (1)
targets/nvidia-jetson-orin/flake-module.nix:207
- Verify that the hard-coded architecture string 'aarch64-linux' passed to genPkgWithFlashScript is consistent with all target definitions and matches downstream expectations.
t: lib.nameValuePair t.name (self.outputs.lib.genPkgWithFlashScript t.package "aarch64-linux")
| in | ||
| lib.elem system platforms | ||
| ); | ||
|
|
Copilot
AI
May 12, 2025
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.
Consider adding documentation comments to the 'genPkgWithFlashScript' function to explain its parameters, purpose, and the structure of the returned package, which will help maintainability and ease of use.
| /* | |
| * | |
| Generates a Nix package that includes the given package and a flash script. | |
| This function creates a "ghaf-image" package containing two components: | |
| 1. The provided package (`pkg`) as "image". | |
| 2. A flash script as "flash-script". | |
| # Type | |
| ``` | |
| genPkgWithFlashScript :: AttrSet -> String -> AttrSet | |
| ``` | |
| # Arguments | |
| - [pkg] The package to include in the "ghaf-image". | |
| - [system] The target system platform (e.g., "x86_64-linux"). | |
| # Returns | |
| An attribute set representing the "ghaf-image" package, which includes: | |
| - `image`: The provided package. | |
| - `flash-script`: A flash script package. | |
| */ |
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.
The arm targets already have their own flashing scripts
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.
This is a non maintained target
|
overall would it make more sense to add this to the devshell and also to have it exposed directly as a package in the outputs? you need the script to be downloaded/installed once and technically it is still generic as this PR does not "fill in" the target package that is to be flashed. so it I think it should be a one time build/download and installed when setting up a system. |
I agree. So basically the same way it is done for Jetson targets. The original ticket reads: So should we change the requirements slightly and just generate |
|
Flash script is now part of the devshell. Should this be closed? @brianmcgillion @juliuskoskela |
Description of Changes
Bundle flash-script with image build. For example:
Will no produce
Instead of only the image.
Type of Change
Related Issues / Tickets
#927
Checklist
make-checksand it passesTesting Instructions
Applicable Targets
aarch64aarch64x86_64x86_64Installation Method
nixos-rebuild ... switchTest Steps To Verify: