diff --git a/.cargo/config.toml b/.cargo/config.toml index c353f950..0b4b26d9 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -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" diff --git a/Cargo.lock b/Cargo.lock index df5bda4d..f811274b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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" diff --git a/Makefile b/Makefile index 81a455e0..485b2646 100644 --- a/Makefile +++ b/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 diff --git a/runner/Cargo.toml b/runner/Cargo.toml index 69d11f0e..778bddfb 100644 --- a/runner/Cargo.toml +++ b/runner/Cargo.toml @@ -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 diff --git a/runner/src/machine/qemu_grub_efi/mod.rs b/runner/src/machine/qemu_grub_efi/mod.rs index a0fd489b..d88bd069 100644 --- a/runner/src/machine/qemu_grub_efi/mod.rs +++ b/runner/src/machine/qemu_grub_efi/mod.rs @@ -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"), }; diff --git a/runner/src/main.rs b/runner/src/main.rs index 3551134f..5cf11734 100644 --- a/runner/src/main.rs +++ b/runner/src/main.rs @@ -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() {