diff --git a/src/config.rs b/src/config.rs index 2f79d52..04ba457 100644 --- a/src/config.rs +++ b/src/config.rs @@ -304,6 +304,20 @@ impl PartitionLayout { let mut fstab = String::new(); + const PREPEND_COMMENT: &str = r#" +# /etc/fstab: static file system information. +# Automatically generated by Katsu Image Builder. See +# katsu::config::PartitionLayout::fstab for more information. + + "#; + + fstab.push_str(PREPEND_COMMENT.trim()); + + const LEGEND: &str = + "# \t\t\t\t\t\n\n"; + + fstab.push_str(LEGEND.trim()); + for part in &ordered.partitions { // get devname by finding from mount, instead of index because we won't be using it as much let mountpoint = PathBuf::from(&part.mountpoint); @@ -334,19 +348,6 @@ impl PartitionLayout { } }; - const PREPEND_COMMENT: &str = r#" -# /etc/fstab: static file system information. -# Automatically generated by Katsu Image Builder. See -# katsu::config::PartitionLayout::fstab for more information. - -"#; - - fstab.push_str(PREPEND_COMMENT.trim()); - - const LEGEND: &str = "# \t\t\t\t\t\n\n"; - - fstab.push_str(LEGEND.trim()); - let fsck = if part.filesystem == "efi" { "0" } else { "2" }; let entry = format!(