Skip to content

Commit

Permalink
Autoload kernel config in the integration vm runner
Browse files Browse the repository at this point in the history
  • Loading branch information
davibe committed Sep 22, 2024
1 parent 09cb0a4 commit f3d8b7d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions xtask/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,28 @@ pub fn run(opts: Options) -> Result<()> {
}
}
}

// Copy kernel configs as well (based on Debian path conventions)
let config_path = PathBuf::from(
kernel_image
.to_string_lossy()
.replace("vmlinuz-", "config-"),
);
if config_path.exists() {
let mut destination = PathBuf::from("/boot");
destination.push(config_path.file_name().expect("filename"));
for bytes in [
"dir /boot 0755 0 0\n".as_bytes(),
"file ".as_bytes(),
destination.as_os_str().as_bytes(),
" ".as_bytes(),
config_path.as_os_str().as_bytes(),
" 0755 0 0\n".as_bytes(),
] {
stdin.write_all(bytes).expect("write");
}
}

// Must explicitly close to signal EOF.
drop(stdin);

Expand Down

0 comments on commit f3d8b7d

Please sign in to comment.