SHA256
Change uki image location to EFI/boot
This commit is contained in:
+11
-13
@@ -25,18 +25,18 @@ use time_format;
|
||||
|
||||
const SNAPS_DIR: &str = "/bzz-snaps";
|
||||
const EFI_BOOT_MOUNT_POINT: &str = "/beefi";
|
||||
const UKI_IMAGE_NAME: &str = "/beefi/EFI/linux-kira-lts.efi";
|
||||
const UKI_IMAGE_BACK_NAME: &str = "/beefi/EFI/linux-kira-lts-back.efi";
|
||||
const EFI_BOOT_DIR: &str = "/beefi/EFI/boot";
|
||||
const UKI_IMAGE_NAME: &str = "/beefi/EFI/boot/linux-kira-lts.efi";
|
||||
const UKI_IMAGE_BACK_NAME: &str = "/beefi/EFI/boot/linux-kira-lts-back.efi";
|
||||
const EFI_PARTLABEL: &str = "bee-efi";
|
||||
|
||||
const BOOT_MENU_LABEL: &str = "Kira OS";
|
||||
const BOOT_MENU_LABEL_BACK: &str = "Kira OS Fallback";
|
||||
const BOOT_UKI_IMAGE_NAME: &str = "\\EFI\\linux-kira-lts.efi";
|
||||
const BOOT_UKI_IMAGE_NAME_BACK: &str = "\\EFI\\linux-kira-lts-back.efi";
|
||||
const BOOT_UKI_IMAGE_NAME: &str = "\\EFI\\boot\\linux-kira-lts.efi";
|
||||
const BOOT_UKI_IMAGE_NAME_BACK: &str = "\\EFI\\boot\\linux-kira-lts-back.efi";
|
||||
|
||||
const PAC_LOCK_FILE: &str = "/var/lib/hive-up/pac-lock";
|
||||
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct CommandFailed {
|
||||
pub stderr: Vec<u8>,
|
||||
@@ -187,7 +187,6 @@ pub fn exec_command_out(cmd: &str, args: &Vec<&str>) -> Result<String, ExecComma
|
||||
// exec_command("pacman", &vec!["-Su", "--noconfirm", "--noprogressbar"])
|
||||
// }
|
||||
|
||||
|
||||
///
|
||||
/// creates read only snapshoy of "subvolume" and places it into "target"]
|
||||
/// bcachefs subvolume snapshot -r /subvolume /target
|
||||
@@ -195,7 +194,6 @@ pub fn exec_command_out(cmd: &str, args: &Vec<&str>) -> Result<String, ExecComma
|
||||
/// returns snapshot time on sucess
|
||||
///
|
||||
pub fn snapshot(subvolume: &str, target: &str) -> Result<(), ExecCommandError> {
|
||||
|
||||
exec_command(
|
||||
"bcachefs",
|
||||
&vec!["subvolume", "snapshot", "-r", subvolume, target],
|
||||
@@ -205,7 +203,7 @@ pub fn snapshot(subvolume: &str, target: &str) -> Result<(), ExecCommandError> {
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
/// bcachefs subvolume snapshot -r /target /SNAPS_DIR/bzz-target-yyyy-mm-ddTHH-MM-SS
|
||||
/// Creates read only snapshots of /usr and /var subvolumes
|
||||
/// And places them to /SNAPS_DIR/bzz-usr-yyyy-mm-ddTHH-MM-SS and /SNAPS_DIR/bzz-var-yyyy-mm-ddTHH-MM-SS
|
||||
@@ -231,7 +229,7 @@ pub fn snapshot_system() -> Result<String, ExecCommandError> {
|
||||
}
|
||||
|
||||
/// Function for pacman preTransaction hook
|
||||
///
|
||||
///
|
||||
pub fn pac_start() -> Result<(), ExecCommandError> {
|
||||
use std::path::Path;
|
||||
// Check if lock file exist
|
||||
@@ -254,8 +252,7 @@ pub fn pac_finish() -> Result<(), ExecCommandError> {
|
||||
if pack_lock_path.exists() {
|
||||
println!("Remowing pac-lock...");
|
||||
fs::remove_file(pack_lock_path)?;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
println!("Warning! Pac Lock file does not exist - something is wrong...");
|
||||
}
|
||||
Ok(())
|
||||
@@ -526,8 +523,9 @@ pub fn init_efi_boot_partition_content() -> Result<(), ExecCommandError> {
|
||||
let efi_dir = format!("{}/EFI", EFI_BOOT_MOUNT_POINT);
|
||||
println!("Romoving efi dir {}", efi_dir);
|
||||
fs::remove_dir_all(&efi_dir)?;
|
||||
println!("Creating efi dir {}", efi_dir);
|
||||
fs::create_dir(efi_dir)?;
|
||||
|
||||
println!("Creating efi dir {}", EFI_BOOT_DIR);
|
||||
fs::create_dir_all(EFI_BOOT_DIR)?;
|
||||
println!("Copy {} to {}", kernel_img_path, UKI_IMAGE_NAME);
|
||||
fs::copy(&kernel_img_path, UKI_IMAGE_NAME)?;
|
||||
println!("Copy {} to {}", kernel_img_path, UKI_IMAGE_BACK_NAME);
|
||||
|
||||
Reference in New Issue
Block a user