-
Notifications
You must be signed in to change notification settings - Fork 60
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
Add universal flashing script #713
Conversation
Do we need to change the ghaf-installer.sh script also? And should the flash script be an application in the default devShell? This way we can put the scripts in one place and not clutter the root directory of the repository. |
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.
@milva-unikie noticed that she had to replace #!/bin/bash
with #!/run/current-system/sw/bin/bash
in her nixos environment.
How about using #!/usr/bin/env bash
?
How universal should the script be? Is it meant that user modifies these
OUTPUT_DIR="result"
UNCOMPRESSED_NAME="nixos.img"
COMPRESSED_NAME="disk1.raw.zst"
Now it works fine for flashing lenovo-x1 image (result/disk1.raw.zst) or icicle-kit image (result/nixos.img). For using the script for other targets:
- lenovo-x1 installer (e.g. result/iso/ghaf-24.11.20240802.c488d21-x86_64-linux.iso)
- orin agx/nx (e.g. /result/sd-image/nixos-sd-image-24.11.20240802.c488d21-aarch64-linux.img.zst)
one has to modify.
Lenovo-X1 images installed with the installer get stuck at boot, so it definitely should also be fixed.
Also to add to this, builds made in Himalia and Jenkins produce their own output packages with different names. The latest Lenovo-X1 Himalia-image for example is: |
Since we have different paths depending on the target, maybe it is better to generate a flash script with the build, like the Orin: |
6353455
to
8db7002
Compare
8db7002
to
4e27b1d
Compare
I initially wanted to keep this flashing script as a separate independent entity and do not contaminate target files. So I've added the possibility to pass the image file name as an argument. |
4e27b1d
to
cd03604
Compare
cd03604
to
6e7fd5d
Compare
6e7fd5d
to
acf9fef
Compare
For the Orin images on vedenemo.dev one just has to first uncompress the *.tar.xz and then the flash script is applicable. |
acf9fef
to
34dba9b
Compare
This is expected since the script is used in the "Build and Run" section of the documentation. The |
I think it's enough that flash script covers the 'run and build' case. No need to serve everything. |
The 'flash.sh' script makes image flashing easy and hassle-free, both for compressed and uncompressed images. Signed-off-by: Ivan Nikolaenko <ivan.nikolaenko@unikie.com> Co-authored-by: Valentin Kharin <valentin.kharin@unikie.com>
34dba9b
to
115b014
Compare
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.
LGTM - improvements can come later, if needed
The 'flash.sh' script makes image flashing easy and hassle-free, both for compressed and uncompressed images.
Description of changes
These changes should fix the recent issue with ZFS, when the device does not boot after the storage media was reflashed.
Checklist for things done
x86_64
aarch64
riscv64
nix flake check --accept-flake-config
and it passesTesting
Build an image, flash it to the media using
flash.sh
script and boot the device.