SHA256
Compare commits
19
Commits
212fa7ed44
...
v0.1.2
| Author | SHA256 | Date | |
|---|---|---|---|
|
|
32a1491537 | ||
|
|
56d181864a | ||
|
|
ba4cca635b | ||
|
|
92cb61dccc | ||
|
|
f15fa368ac | ||
|
|
70246f0d97 | ||
|
|
856a759315 | ||
|
|
4d01705527 | ||
|
|
e6a3425109 | ||
|
|
81a0f4f8a2 | ||
|
|
0b4291b97e | ||
|
|
f74461f6fb | ||
|
|
4396c5011b | ||
|
|
acdf923ce0 | ||
|
|
68c19d84cf | ||
|
|
33cabc86c9 | ||
|
|
379a992421 | ||
|
|
ab7ba83428 | ||
|
|
75c043b652 |
@@ -0,0 +1,43 @@
|
|||||||
|
name: "Build Release Binary"
|
||||||
|
run-name: "Build Release: ${{ inputs.tag_name }}"
|
||||||
|
|
||||||
|
on:
|
||||||
|
# Allows triggering from another workflow
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
tag_name:
|
||||||
|
description: 'Git tag to build (e.g., v1.0.0)'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
workflow_dispatch: # Enables manual triggering
|
||||||
|
inputs:
|
||||||
|
tag_name:
|
||||||
|
description: 'Git tag to build (e.g., v1.0.0)'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
env:
|
||||||
|
GIT_DEFAULT_HASH: sha256
|
||||||
|
with:
|
||||||
|
# If triggered manually, use the input tag.
|
||||||
|
# If triggered by push, GITHUB_REF_NAME is the tag.
|
||||||
|
ref: ${{ inputs.tag_name || gitea.ref_name }}
|
||||||
|
|
||||||
|
- name: Setup Rust toolchain
|
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
|
||||||
|
- name: Build Release Binary
|
||||||
|
run: cargo build --release
|
||||||
|
|
||||||
|
- name: Upload Artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: nyanit-${{ inputs.tag_name || gitea.ref_name }}
|
||||||
|
path: target/release/nyanit
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
name: Create Release with Binary
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch: # Enables manual triggering
|
||||||
|
inputs:
|
||||||
|
tag_name:
|
||||||
|
description: 'Git tag to build (e.g., v1.0.0)'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
rel_description:
|
||||||
|
description: 'Release description'
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
# This job calls the reusable workflow
|
||||||
|
build-binary:
|
||||||
|
uses: ./.gitea/workflows/build-release-binary.yml
|
||||||
|
with:
|
||||||
|
tag_name: "${{ inputs.tag_name }}"
|
||||||
|
|
||||||
|
create-release:
|
||||||
|
needs: build-binary # Wait for the reusable workflow to finish
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Download Artifact
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: nyanit-${{ inputs.tag_name }}
|
||||||
|
|
||||||
|
- name: Create Release and Attach Binary
|
||||||
|
uses: actions/release-action@main
|
||||||
|
with:
|
||||||
|
artifacts: "nyanit-${{ inputs.tag_name }}"
|
||||||
|
api_key: ${{ secrets.bzzpss_release_psszz }}
|
||||||
|
tag_name: ${{ inputs.tag_name }}
|
||||||
|
name: Release ${{ inputs.tag_name }}
|
||||||
|
body: "Automated release for ${{ inputs.tag_name }}\n${{ inputs.rel_description }}"
|
||||||
|
|
||||||
Generated
+1
-1
@@ -287,7 +287,7 @@ checksum = "6aa2c4e539b869820a2b82e1aef6ff40aa85e65decdd5185e83fb4b1249cd00f"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nyanit"
|
name = "nyanit"
|
||||||
version = "0.1.0"
|
version = "0.1.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ratatui",
|
"ratatui",
|
||||||
"ratatui-textarea",
|
"ratatui-textarea",
|
||||||
|
|||||||
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "nyanit"
|
name = "nyanit"
|
||||||
version = "0.1.0"
|
version = "0.1.2"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
ratatui = { version = "0.30", default-features = false, features = ["termion"] }
|
ratatui = { version = "0.30", default-features = false, features = ["termion"] }
|
||||||
ratatui-textarea = { version = "0.9", default-features = false, features = ["termion"] }
|
ratatui-textarea = { version = "0.9", default-features = false, features = ["termion"] }
|
||||||
regex = "1.12.4"
|
regex = "1.12"
|
||||||
termion = "4"
|
termion = "4"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,21 @@
|
|||||||
# nyanit
|
# nyanit
|
||||||
|
|
||||||
Init program for initrd
|
Kira-Linux init program for initrd
|
||||||
|
|
||||||
|
|
||||||
|
1. It looks for partitoin with GPT labelve **bee-root** what will shown in dev tree as **/dev/disk/by-partlabel/bee-root**
|
||||||
|
And this partition should be formated to bcachefs.
|
||||||
|
|
||||||
|
2. Nyanit checks if bcachefs is encrypted, and asks for unlock password if it is.
|
||||||
|
|
||||||
|
3. Then it mounts it to **/mnt/bee-root**.
|
||||||
|
|
||||||
|
4. And looks for snapshots with name pattern **/mnt/bee-root/bzz_snaps/bzz-yyyy-mm-ddTHH-MM-SS**
|
||||||
|
|
||||||
|
5. If no snapshots are found it calls **switch_root** for **/mnt/bee-root**
|
||||||
|
|
||||||
|
6. Othervise vait for F2 for few seconds.
|
||||||
|
And if F2 pressed provides list of snapshoots to boot from.
|
||||||
|
|
||||||
|
7. After some snapshoot or just **/mnt/bee-root** is selected, Nyanit doing **switch_root** to it.
|
||||||
|
|
||||||
|
|||||||
+12
-7
@@ -241,7 +241,6 @@ impl NyanitTUI<'_> {
|
|||||||
frame.render_widget(ok_text, vertical_chunks[1]);
|
frame.render_widget(ok_text, vertical_chunks[1]);
|
||||||
// just some time to look at message
|
// just some time to look at message
|
||||||
thread::sleep(Duration::from_millis(1000))
|
thread::sleep(Duration::from_millis(1000))
|
||||||
|
|
||||||
}
|
}
|
||||||
_ => (),
|
_ => (),
|
||||||
};
|
};
|
||||||
@@ -285,7 +284,10 @@ impl NyanitTUI<'_> {
|
|||||||
if unlocked {
|
if unlocked {
|
||||||
// need to check for subvolumes and stuff
|
// need to check for subvolumes and stuff
|
||||||
self.state = match mount_and_check_snaps() {
|
self.state = match mount_and_check_snaps() {
|
||||||
Ok(st) => st,
|
Ok(st) => {
|
||||||
|
self.time_counter = 0;
|
||||||
|
st
|
||||||
|
}
|
||||||
Err(ex) => NyanitState::Error(ex.to_string()),
|
Err(ex) => NyanitState::Error(ex.to_string()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -321,11 +323,14 @@ impl NyanitTUI<'_> {
|
|||||||
} else {
|
} else {
|
||||||
// Tick time
|
// Tick time
|
||||||
thread::sleep(Duration::from_millis(500));
|
thread::sleep(Duration::from_millis(500));
|
||||||
self.time_counter = self.time_counter.wrapping_add(1u32);
|
|
||||||
// 2.5 sec wait
|
if let NyanitState::WaitForF2(_) = self.state {
|
||||||
if self.time_counter > 5 {
|
self.time_counter = self.time_counter.wrapping_add(1u32);
|
||||||
// boot from root
|
// 2.5 sec wait
|
||||||
self.state = NyanitState::HandOff(TMP_ROOT.into());
|
if self.time_counter > 5 {
|
||||||
|
// boot from root
|
||||||
|
self.state = NyanitState::HandOff(TMP_ROOT.into());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
+4
-3
@@ -145,9 +145,10 @@ pub fn bcachefs_unlock(pass: String, dev: &str) -> Result<bool, ExecCommandError
|
|||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::process::Stdio;
|
use std::process::Stdio;
|
||||||
|
// "-k", "session" is important as it stores key in sessyin keyring what allows
|
||||||
|
// system to mount filesystem after switch_root
|
||||||
let mut child = Command::new("bcachefs")
|
let mut child = Command::new("bcachefs")
|
||||||
.arg("unlock")
|
.args(&vec!["unlock", "-k", "session", dev])
|
||||||
.arg(dev)
|
|
||||||
.stdin(Stdio::piped())
|
.stdin(Stdio::piped())
|
||||||
.stdout(Stdio::piped())
|
.stdout(Stdio::piped())
|
||||||
.stderr(Stdio::piped())
|
.stderr(Stdio::piped())
|
||||||
@@ -222,7 +223,7 @@ pub fn prepare_env() -> Result<(), ExecCommandError> {
|
|||||||
exec_command("mount", &vec!["-t", "sysfs", "none", "/sys"])?;
|
exec_command("mount", &vec!["-t", "sysfs", "none", "/sys"])?;
|
||||||
|
|
||||||
// modprobe bcachefs
|
// modprobe bcachefs
|
||||||
exec_command("modprobe", &vec!["bcachefs"])?;
|
// exec_command("modprobe", &vec!["bcachefs"])?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user