Rename jinux-runner to aster-runner

This commit is contained in:
Jianfeng Jiang 2023-12-25 03:31:06 +00:00 committed by Tate, Hongliang Tian
parent f3dab1f798
commit 2b248dc326
6 changed files with 31 additions and 31 deletions

View File

@ -1,6 +1,6 @@
[target.'cfg(target_os = "none")'] [target.'cfg(target_os = "none")']
runner = "cargo run --package jinux-runner --" runner = "cargo run --package aster-runner --"
[alias] [alias]
kcheck = "check --target x86_64-custom.json -Zbuild-std=core,alloc,compiler_builtins -Zbuild-std-features=compiler-builtins-mem" kcheck = "check --target x86_64-custom.json -Zbuild-std=core,alloc,compiler_builtins -Zbuild-std-features=compiler-builtins-mem"

22
Cargo.lock generated
View File

@ -242,6 +242,17 @@ dependencies = [
"syn 1.0.109", "syn 1.0.109",
] ]
[[package]]
name = "aster-runner"
version = "0.1.0"
dependencies = [
"anyhow",
"clap",
"glob",
"rand",
"xmas-elf",
]
[[package]] [[package]]
name = "aster-std" name = "aster-std"
version = "0.1.0" version = "0.1.0"
@ -836,17 +847,6 @@ dependencies = [
"either", "either",
] ]
[[package]]
name = "jinux-runner"
version = "0.1.0"
dependencies = [
"anyhow",
"clap",
"glob",
"rand",
"xmas-elf",
]
[[package]] [[package]]
name = "json" name = "json"
version = "0.12.4" version = "0.12.4"

View File

@ -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 AUTO_TEST ?= none
BOOT_METHOD ?= qemu-grub BOOT_METHOD ?= qemu-grub
BOOT_PROTOCOL ?= multiboot2 BOOT_PROTOCOL ?= multiboot2

View File

@ -1,5 +1,5 @@
[package] [package]
name = "jinux-runner" name = "aster-runner"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -70,13 +70,13 @@ pub const GRUB_PREFIX: &str = "/usr/local/grub";
pub const GRUB_VERSION: &str = "x86_64-efi"; pub const GRUB_VERSION: &str = "x86_64-efi";
pub fn create_bootdev_image( pub fn create_bootdev_image(
jinux_path: PathBuf, atser_path: PathBuf,
initramfs_path: PathBuf, initramfs_path: PathBuf,
grub_cfg: String, grub_cfg: String,
protocol: BootProtocol, protocol: BootProtocol,
release_mode: bool, release_mode: bool,
) -> PathBuf { ) -> PathBuf {
let target_dir = jinux_path.parent().unwrap(); let target_dir = atser_path.parent().unwrap();
let iso_root = target_dir.join("iso_root"); let iso_root = target_dir.join("iso_root");
// Clear or make the iso dir. // Clear or make the iso dir.
@ -105,15 +105,15 @@ pub fn create_bootdev_image(
.join("bin") .join("bin")
.join("aster-frame-x86-boot-linux-setup"); .join("aster-frame-x86-boot-linux-setup");
// Make the `bzImage`-compatible kernel image and place it in the boot directory. // Make the `bzImage`-compatible kernel image and place it in the boot directory.
let target_path = iso_root.join("boot").join("jinuz"); let target_path = iso_root.join("boot").join("asterinaz");
linux_boot::make_bzimage(&target_path, &jinux_path.as_path(), &header_path.as_path()) linux_boot::make_bzimage(&target_path, &atser_path.as_path(), &header_path.as_path())
.unwrap(); .unwrap();
target_path target_path
} }
BootProtocol::Multiboot | BootProtocol::Multiboot2 => { BootProtocol::Multiboot | BootProtocol::Multiboot2 => {
// Copy the kernel image to the boot directory. // Copy the kernel image to the boot directory.
let target_path = iso_root.join("boot").join("jinux"); let target_path = iso_root.join("boot").join("atserinas");
fs::copy(&jinux_path, &target_path).unwrap(); fs::copy(&atser_path, &target_path).unwrap();
target_path target_path
} }
}; };
@ -164,15 +164,15 @@ pub fn generate_grub_cfg(
let buffer = match protocol { let buffer = match protocol {
BootProtocol::Multiboot => buffer BootProtocol::Multiboot => buffer
.replace("#GRUB_CMD_KERNEL#", "multiboot") .replace("#GRUB_CMD_KERNEL#", "multiboot")
.replace("#KERNEL#", "/boot/jinux") .replace("#KERNEL#", "/boot/atserinas")
.replace("#GRUB_CMD_INITRAMFS#", "module --nounzip"), .replace("#GRUB_CMD_INITRAMFS#", "module --nounzip"),
BootProtocol::Multiboot2 => buffer BootProtocol::Multiboot2 => buffer
.replace("#GRUB_CMD_KERNEL#", "multiboot2") .replace("#GRUB_CMD_KERNEL#", "multiboot2")
.replace("#KERNEL#", "/boot/jinux") .replace("#KERNEL#", "/boot/atserinas")
.replace("#GRUB_CMD_INITRAMFS#", "module2 --nounzip"), .replace("#GRUB_CMD_INITRAMFS#", "module2 --nounzip"),
BootProtocol::Linux => buffer BootProtocol::Linux => buffer
.replace("#GRUB_CMD_KERNEL#", "linux") .replace("#GRUB_CMD_KERNEL#", "linux")
.replace("#KERNEL#", "/boot/jinuz") .replace("#KERNEL#", "/boot/asterinaz")
.replace("#GRUB_CMD_INITRAMFS#", "initrd"), .replace("#GRUB_CMD_INITRAMFS#", "initrd"),
}; };

View File

@ -1,8 +1,8 @@
//! jinux-runner is the Jinux runner script to ease the pain of running //! aster-runner is the Asterinas runner script to ease the pain of running
//! and testing Jinux inside a QEMU VM. It should be built and run as the //! 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 //! 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 //! 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 //! a GRUB boot device image, the runner would be responsible for generating
//! the appropriate kernel image and the boot device image. It also supports //! 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)] #[command(author, version, about, long_about = None)]
struct Args { struct Args {
// Positional arguments. // Positional arguments.
/// The Jinux binary path. /// The Asterinas binary path.
path: PathBuf, path: PathBuf,
/// Provide the kernel commandline, which specifies /// Provide the kernel commandline, which specifies
@ -117,7 +117,7 @@ pub fn random_hostfwd_ports() -> (u16, u16) {
pub const GDB_ARGS: &[&str] = &[ pub const GDB_ARGS: &[&str] = &[
"-chardev", "-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", "-gdb",
"chardev:gdb0", "chardev:gdb0",
"-S", "-S",
@ -145,13 +145,13 @@ fn main() {
port1, port2 port1, port2
)); ));
println!( println!(
"[jinux-runner] Binding host ports to guest ports: ({} -> {}); ({} -> {}).", "[aster-runner] Binding host ports to guest ports: ({} -> {}); ({} -> {}).",
port1, 22, port2, 8080 port1, 22, port2, 8080
); );
if args.halt_for_gdb { if args.halt_for_gdb {
if args.enable_kvm { 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; return;
} }
qemu_cmd.args(GDB_ARGS); qemu_cmd.args(GDB_ARGS);
@ -206,7 +206,7 @@ fn main() {
qemu_cmd.arg(bootdev_image.as_os_str()); 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(); let exit_status = qemu_cmd.status().unwrap();
if !exit_status.success() { if !exit_status.success() {