From 8ef2c5420da5e3b4d81690cbfa35b608a67fc93b Mon Sep 17 00:00:00 2001 From: Nikita Dubrovskii Date: Mon, 4 Oct 2021 13:57:47 +0200 Subject: [PATCH] rdcore: fail if system has more than 1 boot partition Signed-off-by: Nikita Dubrovskii --- src/bin/rdcore/rootmap.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bin/rdcore/rootmap.rs b/src/bin/rdcore/rootmap.rs index e93bef7f4..7681c0633 100644 --- a/src/bin/rdcore/rootmap.rs +++ b/src/bin/rdcore/rootmap.rs @@ -27,6 +27,10 @@ use libcoreinst::runcmd_output; use crate::cmdline::*; pub fn rootmap(config: &RootmapConfig) -> Result<()> { + // fail if we have more than 1 partition with boot label + if !check_single_partition("boot")? { + bail!("System has several partitions with boot label. Please 'wipefs' other disks"); + } // get the backing device for the root mount let mount = Mount::from_existing(&config.root_mount)?; let device = PathBuf::from(mount.device());