@@ -29,7 +29,10 @@ pub(crate) fn install(
29
29
bootdir. create_dir ( GRUB2DIR , 0o700 ) ?;
30
30
}
31
31
32
- let mut config = std:: fs:: read_to_string ( Path :: new ( CONFIGDIR ) . join ( "grub-static-pre.cfg" ) ) ?;
32
+ let mut config = String :: from ( "# Generated by bootupd / do not edit\n \n " ) ;
33
+
34
+ let pre = std:: fs:: read_to_string ( Path :: new ( CONFIGDIR ) . join ( "grub-static-pre.cfg" ) ) ?;
35
+ config. push_str ( pre. as_str ( ) ) ;
33
36
34
37
let dropindir = openat:: Dir :: open ( & Path :: new ( CONFIGDIR ) . join ( DROPINDIR ) ) ?;
35
38
// Sort the files for reproducibility
@@ -47,16 +50,11 @@ pub(crate) fn install(
47
50
log:: debug!( "Ignoring {name}" ) ;
48
51
continue ;
49
52
}
50
- writeln ! ( config, "source $prefix/{name}" ) ?;
51
- dropindir
52
- . copy_file_at ( name, bootdir, format ! ( "{GRUB2DIR}/{name}" ) )
53
- . with_context ( || format ! ( "Copying {name}" ) ) ?;
54
- println ! ( "Installed {name}" ) ;
55
- }
56
-
57
- {
58
- let post = std:: fs:: read_to_string ( Path :: new ( CONFIGDIR ) . join ( "grub-static-post.cfg" ) ) ?;
59
- config. push_str ( post. as_str ( ) ) ;
53
+ writeln ! ( config, "\n ### BEGIN {name} ###" ) ?;
54
+ let dropin = std:: fs:: read_to_string ( Path :: new ( CONFIGDIR ) . join ( DROPINDIR ) . join ( name) ) ?;
55
+ config. push_str ( dropin. as_str ( ) ) ;
56
+ writeln ! ( config, "### END {name} ###" ) ?;
57
+ println ! ( "Added {name}" ) ;
60
58
}
61
59
62
60
bootdir
0 commit comments