MCPcopy Create free account
hub / github.com/bootc-dev/bootc / check_usretc

Function check_usretc

crates/lib/src/lints.rs:457–470  ·  view source on GitHub ↗
(root: &Dir, _config: &LintExecutionConfig)

Source from the content-addressed store, hash-verified

455 check_usretc,
456);
457fn check_usretc(root: &Dir, _config: &LintExecutionConfig) -> LintResult {
458 let etc_exists = root.symlink_metadata_optional("etc")?.is_some();
459 // For compatibility/conservatism don't bomb out if there's no /etc.
460 if !etc_exists {
461 return lint_ok();
462 }
463 // But having both /etc and /usr/etc is not something we want to support.
464 if root.symlink_metadata_optional("usr/etc")?.is_some() {
465 return lint_err(
466 "Found /usr/etc - this is a bootc implementation detail and not supported to use in containers",
467 );
468 }
469 lint_ok()
470}
471
472/// Validate that we can parse the /usr/lib/bootc/kargs.d files.
473#[distributed_slice(LINTS)]

Callers 1

test_usr_etcFunction · 0.85

Calls 2

lint_okFunction · 0.85
lint_errFunction · 0.85

Tested by 1

test_usr_etcFunction · 0.68