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 a7fbfe2 commit f878a04
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ jobs:
run: |
set -euxo pipefail
find test/.tmp -name '*.deb' -print0 | xargs -t -0 -I {} \
sh -c "dpkg --fsys-tarfile {} | tar -C test/.tmp --wildcards --extract '*vmlinuz*' --file -"
sh -c "dpkg --fsys-tarfile {} | tar -C test/.tmp --wildcards --extract '*vmlinuz*' --wildcards --extract '*config*' --file -"
- name: Run local integration tests
if: runner.os == 'Linux'
Expand Down
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 f878a04

Please sign in to comment.