mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-08 21:06:48 +00:00
Rename jinux-runner to aster-runner
This commit is contained in:
parent
f3dab1f798
commit
2b248dc326
@ -1,6 +1,6 @@
|
||||
|
||||
[target.'cfg(target_os = "none")']
|
||||
runner = "cargo run --package jinux-runner --"
|
||||
runner = "cargo run --package aster-runner --"
|
||||
|
||||
[alias]
|
||||
kcheck = "check --target x86_64-custom.json -Zbuild-std=core,alloc,compiler_builtins -Zbuild-std-features=compiler-builtins-mem"
|
||||
|
22
Cargo.lock
generated
22
Cargo.lock
generated
@ -242,6 +242,17 @@ dependencies = [
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "aster-runner"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
"glob",
|
||||
"rand",
|
||||
"xmas-elf",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "aster-std"
|
||||
version = "0.1.0"
|
||||
@ -836,17 +847,6 @@ dependencies = [
|
||||
"either",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jinux-runner"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
"glob",
|
||||
"rand",
|
||||
"xmas-elf",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "json"
|
||||
version = "0.12.4"
|
||||
|
2
Makefile
2
Makefile
@ -1,4 +1,4 @@
|
||||
# Make varaiables and defaults, you should refer to jinux-runner for more details
|
||||
# Make varaiables and defaults, you should refer to aster-runner for more details
|
||||
AUTO_TEST ?= none
|
||||
BOOT_METHOD ?= qemu-grub
|
||||
BOOT_PROTOCOL ?= multiboot2
|
||||
|
@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "jinux-runner"
|
||||
name = "aster-runner"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
@ -70,13 +70,13 @@ pub const GRUB_PREFIX: &str = "/usr/local/grub";
|
||||
pub const GRUB_VERSION: &str = "x86_64-efi";
|
||||
|
||||
pub fn create_bootdev_image(
|
||||
jinux_path: PathBuf,
|
||||
atser_path: PathBuf,
|
||||
initramfs_path: PathBuf,
|
||||
grub_cfg: String,
|
||||
protocol: BootProtocol,
|
||||
release_mode: bool,
|
||||
) -> PathBuf {
|
||||
let target_dir = jinux_path.parent().unwrap();
|
||||
let target_dir = atser_path.parent().unwrap();
|
||||
let iso_root = target_dir.join("iso_root");
|
||||
|
||||
// Clear or make the iso dir.
|
||||
@ -105,15 +105,15 @@ pub fn create_bootdev_image(
|
||||
.join("bin")
|
||||
.join("aster-frame-x86-boot-linux-setup");
|
||||
// Make the `bzImage`-compatible kernel image and place it in the boot directory.
|
||||
let target_path = iso_root.join("boot").join("jinuz");
|
||||
linux_boot::make_bzimage(&target_path, &jinux_path.as_path(), &header_path.as_path())
|
||||
let target_path = iso_root.join("boot").join("asterinaz");
|
||||
linux_boot::make_bzimage(&target_path, &atser_path.as_path(), &header_path.as_path())
|
||||
.unwrap();
|
||||
target_path
|
||||
}
|
||||
BootProtocol::Multiboot | BootProtocol::Multiboot2 => {
|
||||
// Copy the kernel image to the boot directory.
|
||||
let target_path = iso_root.join("boot").join("jinux");
|
||||
fs::copy(&jinux_path, &target_path).unwrap();
|
||||
let target_path = iso_root.join("boot").join("atserinas");
|
||||
fs::copy(&atser_path, &target_path).unwrap();
|
||||
target_path
|
||||
}
|
||||
};
|
||||
@ -164,15 +164,15 @@ pub fn generate_grub_cfg(
|
||||
let buffer = match protocol {
|
||||
BootProtocol::Multiboot => buffer
|
||||
.replace("#GRUB_CMD_KERNEL#", "multiboot")
|
||||
.replace("#KERNEL#", "/boot/jinux")
|
||||
.replace("#KERNEL#", "/boot/atserinas")
|
||||
.replace("#GRUB_CMD_INITRAMFS#", "module --nounzip"),
|
||||
BootProtocol::Multiboot2 => buffer
|
||||
.replace("#GRUB_CMD_KERNEL#", "multiboot2")
|
||||
.replace("#KERNEL#", "/boot/jinux")
|
||||
.replace("#KERNEL#", "/boot/atserinas")
|
||||
.replace("#GRUB_CMD_INITRAMFS#", "module2 --nounzip"),
|
||||
BootProtocol::Linux => buffer
|
||||
.replace("#GRUB_CMD_KERNEL#", "linux")
|
||||
.replace("#KERNEL#", "/boot/jinuz")
|
||||
.replace("#KERNEL#", "/boot/asterinaz")
|
||||
.replace("#GRUB_CMD_INITRAMFS#", "initrd"),
|
||||
};
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
//! jinux-runner is the Jinux runner script to ease the pain of running
|
||||
//! and testing Jinux inside a QEMU VM. It should be built and run as the
|
||||
//! aster-runner is the Asterinas runner script to ease the pain of running
|
||||
//! and testing Asterinas inside a QEMU VM. It should be built and run as the
|
||||
//! cargo runner: https://doc.rust-lang.org/cargo/reference/config.html
|
||||
//!
|
||||
//! The runner will generate the filesystem image for starting Jinux. If
|
||||
//! The runner will generate the filesystem image for starting Asterinas. If
|
||||
//! we should use the runner in the default mode, which invokes QEMU with
|
||||
//! a GRUB boot device image, the runner would be responsible for generating
|
||||
//! the appropriate kernel image and the boot device image. It also supports
|
||||
@ -40,7 +40,7 @@ pub enum BootProtocol {
|
||||
#[command(author, version, about, long_about = None)]
|
||||
struct Args {
|
||||
// Positional arguments.
|
||||
/// The Jinux binary path.
|
||||
/// The Asterinas binary path.
|
||||
path: PathBuf,
|
||||
|
||||
/// Provide the kernel commandline, which specifies
|
||||
@ -117,7 +117,7 @@ pub fn random_hostfwd_ports() -> (u16, u16) {
|
||||
|
||||
pub const GDB_ARGS: &[&str] = &[
|
||||
"-chardev",
|
||||
"socket,path=/tmp/jinux-gdb-socket,server=on,wait=off,id=gdb0",
|
||||
"socket,path=/tmp/aster-gdb-socket,server=on,wait=off,id=gdb0",
|
||||
"-gdb",
|
||||
"chardev:gdb0",
|
||||
"-S",
|
||||
@ -145,13 +145,13 @@ fn main() {
|
||||
port1, port2
|
||||
));
|
||||
println!(
|
||||
"[jinux-runner] Binding host ports to guest ports: ({} -> {}); ({} -> {}).",
|
||||
"[aster-runner] Binding host ports to guest ports: ({} -> {}); ({} -> {}).",
|
||||
port1, 22, port2, 8080
|
||||
);
|
||||
|
||||
if args.halt_for_gdb {
|
||||
if args.enable_kvm {
|
||||
println!("[jinux-runner] Can't enable KVM when running QEMU as a GDB server. Abort.");
|
||||
println!("[aster-runner] Can't enable KVM when running QEMU as a GDB server. Abort.");
|
||||
return;
|
||||
}
|
||||
qemu_cmd.args(GDB_ARGS);
|
||||
@ -206,7 +206,7 @@ fn main() {
|
||||
qemu_cmd.arg(bootdev_image.as_os_str());
|
||||
}
|
||||
|
||||
println!("[jinux-runner] Running: {:#?}", qemu_cmd);
|
||||
println!("[aster-runner] Running: {:#?}", qemu_cmd);
|
||||
|
||||
let exit_status = qemu_cmd.status().unwrap();
|
||||
if !exit_status.success() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user