SHA256
Compare commits
2
Commits
212fa7ed44
...
v0.1.0-rc1
| Author | SHA256 | Date | |
|---|---|---|---|
|
|
ab7ba83428 | ||
|
|
75c043b652 |
@@ -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.
|
||||||
|
|
||||||
|
|||||||
+7
-2
@@ -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,6 +323,8 @@ impl NyanitTUI<'_> {
|
|||||||
} else {
|
} else {
|
||||||
// Tick time
|
// Tick time
|
||||||
thread::sleep(Duration::from_millis(500));
|
thread::sleep(Duration::from_millis(500));
|
||||||
|
|
||||||
|
if let NyanitState::WaitForF2(_) = self.state {
|
||||||
self.time_counter = self.time_counter.wrapping_add(1u32);
|
self.time_counter = self.time_counter.wrapping_add(1u32);
|
||||||
// 2.5 sec wait
|
// 2.5 sec wait
|
||||||
if self.time_counter > 5 {
|
if self.time_counter > 5 {
|
||||||
@@ -328,6 +332,7 @@ impl NyanitTUI<'_> {
|
|||||||
self.state = NyanitState::HandOff(TMP_ROOT.into());
|
self.state = NyanitState::HandOff(TMP_ROOT.into());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -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())
|
||||||
|
|||||||
Reference in New Issue
Block a user