@@ -6,14 +6,15 @@ use std::collections::BTreeSet;
6
6
use std:: env:: consts:: ARCH ;
7
7
use std:: os:: unix:: ffi:: OsStrExt ;
8
8
9
- use anyhow:: { Context , Result } ;
9
+ use anyhow:: Result ;
10
10
use camino:: { Utf8Path , Utf8PathBuf } ;
11
11
use cap_std:: fs:: Dir ;
12
12
use cap_std_ext:: cap_std;
13
13
use cap_std_ext:: cap_std:: fs:: MetadataExt ;
14
14
use cap_std_ext:: dirext:: CapStdExtDirExt as _;
15
15
use fn_error_context:: context;
16
16
use indoc:: indoc;
17
+ use ostree_ext:: ostree_prepareroot;
17
18
use serde:: Serialize ;
18
19
19
20
/// Reference to embedded default baseimage content that should exist.
@@ -286,15 +287,8 @@ fn check_baseimage_root_norecurse(dir: &Dir) -> LintResult {
286
287
return lint_err ( "Expected /ostree -> {expected}, not {link:?}" ) ;
287
288
}
288
289
289
- // Check the prepare-root config
290
- let prepareroot_path = "usr/lib/ostree/prepare-root.conf" ;
291
- let config_data = dir
292
- . read_to_string ( prepareroot_path)
293
- . context ( prepareroot_path) ?;
294
- let config = ostree_ext:: glib:: KeyFile :: new ( ) ;
295
- config. load_from_data ( & config_data, ostree_ext:: glib:: KeyFileFlags :: empty ( ) ) ?;
296
-
297
- if !ostree_ext:: ostree_prepareroot:: overlayfs_enabled_in_config ( & config) ? {
290
+ let config = ostree_prepareroot:: require_config_from_root ( dir) ?;
291
+ if !ostree_prepareroot:: overlayfs_enabled_in_config ( & config) ? {
298
292
return lint_err ( "{prepareroot_path} does not have composefs enabled" ) ;
299
293
}
300
294
0 commit comments