@@ -29,7 +29,10 @@ pub(crate) fn install(
2929 bootdir. create_dir ( GRUB2DIR , 0o700 ) ?;
3030 }
3131
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 ( ) ) ;
3336
3437 let dropindir = openat:: Dir :: open ( & Path :: new ( CONFIGDIR ) . join ( DROPINDIR ) ) ?;
3538 // Sort the files for reproducibility
@@ -47,16 +50,11 @@ pub(crate) fn install(
4750 log:: debug!( "Ignoring {name}" ) ;
4851 continue ;
4952 }
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}" ) ;
6058 }
6159
6260 bootdir
0 commit comments