RustForge

rust-kernel

Rustbelt: a hobby x86_64 kernel written in Rust

rust-kernel / scripts / runner.sh
502 bytes ยท raw
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env bash
# Cargo runner (see .cargo/config.toml): `cargo run` calls this with the
# kernel ELF path followed by any extra args.
#
# Why not call `bootimage runner` directly? When you switch cargo features
# (e.g. --features headless and back), cargo re-uses an older kernel binary
# with an *old* timestamp, so bootimage thinks its cached disk image is still
# up to date and boots the wrong kernel. Touching the ELF forces a rebuild.
set -euo pipefail
touch "$1"
exec bootimage runner "$@"