Skip to content

Commit d8f04c5

Browse files
committed
Switch to unimplemented! instead of todo!
This will allow things to at least get pass lint checks into more proper CI runs. (But we should actually still more carefully have a gate that prevents merges into main with `unimplemented!`) Signed-off-by: Colin Walters <[email protected]>
1 parent fd0a554 commit d8f04c5

File tree

2 files changed

+42
-40
lines changed

2 files changed

+42
-40
lines changed

crates/lib/src/deploy.rs

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ use ostree_ext::tokio_util::spawn_blocking_cancellable_flatten;
2525
use rustix::fs::{fsync, renameat_with, AtFlags, RenameFlags};
2626

2727
use crate::bls_config::{parse_bls_config, BLSConfig};
28+
#[allow(unused_imports)]
2829
use crate::install::{get_efi_uuid_source, get_user_config, BootType};
2930
use crate::progress_jsonl::{Event, ProgressWriter, SubTaskBytes, SubTaskStep};
3031
use crate::spec::ImageReference;
@@ -743,40 +744,41 @@ pub(crate) async fn stage(
743744
}
744745

745746
#[context("Rolling back UKI")]
746-
pub(crate) fn rollback_composefs_uki(current: &BootEntry, rollback: &BootEntry) -> Result<()> {
747-
let user_cfg_name = "grub2/user.cfg.staged";
748-
let user_cfg_path = PathBuf::from("boot").join(user_cfg_name);
749-
let sysroot = &Dir::open_ambient_dir("/sysroot", cap_std::ambient_authority())?;
750-
751-
let efi_uuid_source = get_efi_uuid_source();
752-
753-
let rollback_verity = if let Some(composefs) = &rollback.composefs {
754-
composefs.verity.clone()
755-
} else {
756-
// Shouldn't really happen
757-
anyhow::bail!("Verity not found for rollback deployment")
758-
};
759-
let rollback_config = get_user_config(todo!(), &rollback_verity).as_bytes();
760-
761-
let current_verity = if let Some(composefs) = &current.composefs {
762-
composefs.verity.clone()
763-
} else {
764-
// Shouldn't really happen
765-
anyhow::bail!("Verity not found for booted deployment")
766-
};
767-
let current_config = get_user_config(todo!(), &current_verity).as_bytes();
768-
769-
// TODO: Need to check if user.cfg.staged exists
770-
sysroot
771-
.atomic_replace_with(user_cfg_path, |w| {
772-
write!(w, "{efi_uuid_source}")?;
773-
w.write_all(rollback_config)?;
774-
w.write_all(current_config)?;
775-
Ok(())
776-
})
777-
.with_context(|| format!("Writing {user_cfg_name}"))?;
778-
779-
Ok(())
747+
pub(crate) fn rollback_composefs_uki(_current: &BootEntry, _rollback: &BootEntry) -> Result<()> {
748+
unimplemented!()
749+
// let user_cfg_name = "grub2/user.cfg.staged";
750+
// let user_cfg_path = PathBuf::from("boot").join(user_cfg_name);
751+
// let sysroot = &Dir::open_ambient_dir("/sysroot", cap_std::ambient_authority())?;
752+
753+
// let efi_uuid_source = get_efi_uuid_source();
754+
755+
// let rollback_verity = if let Some(composefs) = &rollback.composefs {
756+
// composefs.verity.clone()
757+
// } else {
758+
// // Shouldn't really happen
759+
// anyhow::bail!("Verity not found for rollback deployment")
760+
// };
761+
// let rollback_config = get_user_config(todo!(), &rollback_verity).as_bytes();
762+
763+
// let current_verity = if let Some(composefs) = &current.composefs {
764+
// composefs.verity.clone()
765+
// } else {
766+
// // Shouldn't really happen
767+
// anyhow::bail!("Verity not found for booted deployment")
768+
// };
769+
// let current_config = get_user_config(todo!(), &current_verity).as_bytes();
770+
771+
// // TODO: Need to check if user.cfg.staged exists
772+
// sysroot
773+
// .atomic_replace_with(user_cfg_path, |w| {
774+
// write!(w, "{efi_uuid_source}")?;
775+
// w.write_all(rollback_config)?;
776+
// w.write_all(current_config)?;
777+
// Ok(())
778+
// })
779+
// .with_context(|| format!("Writing {user_cfg_name}"))?;
780+
781+
// Ok(())
780782
}
781783

782784
/// Filename for `loader/entries`

crates/lib/src/install.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,9 +1647,9 @@ pub(crate) fn setup_composefs_bls_boot(
16471647
let boot_dir = root_path.join("boot");
16481648

16491649
let bls_config = match &entry {
1650-
ComposefsBootEntry::Type1(..) => todo!(),
1651-
ComposefsBootEntry::Type2(..) => todo!(),
1652-
ComposefsBootEntry::UsrLibModulesUki(..) => todo!(),
1650+
ComposefsBootEntry::Type1(..) => unimplemented!(),
1651+
ComposefsBootEntry::Type2(..) => unimplemented!(),
1652+
ComposefsBootEntry::UsrLibModulesUki(..) => unimplemented!(),
16531653

16541654
ComposefsBootEntry::UsrLibModulesVmLinuz(usr_lib_modules_vmlinuz) => {
16551655
// Write the initrd and vmlinuz at /boot/<id>/
@@ -1829,9 +1829,9 @@ pub(crate) fn setup_composefs_uki_boot(
18291829
.run()?;
18301830

18311831
let boot_label = match entry {
1832-
ComposefsBootEntry::Type1(..) => todo!(),
1833-
ComposefsBootEntry::UsrLibModulesUki(..) => todo!(),
1834-
ComposefsBootEntry::UsrLibModulesVmLinuz(..) => todo!(),
1832+
ComposefsBootEntry::Type1(..) => unimplemented!(),
1833+
ComposefsBootEntry::UsrLibModulesUki(..) => unimplemented!(),
1834+
ComposefsBootEntry::UsrLibModulesVmLinuz(..) => unimplemented!(),
18351835

18361836
ComposefsBootEntry::Type2(type2_entry) => {
18371837
let uki = read_file(&type2_entry.file, &repo).context("Reading UKI")?;

0 commit comments

Comments
 (0)