From 0a17d905328ee499a6893f812349185e11c596f7 Mon Sep 17 00:00:00 2001 From: Zhang Junyang Date: Thu, 26 Oct 2023 11:27:35 +0800 Subject: [PATCH] Polish namings and interfaces of linux boot --- .github/workflows/integration_test.yml | 5 ++--- Cargo.lock | 2 +- Makefile | 8 ++++---- framework/jinux-frame/build.rs | 4 ++-- .../src/arch/x86/boot/linux_boot/setup/Cargo.toml | 2 +- runner/src/machine/qemu_grub_efi/mod.rs | 2 +- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index f84ed914c..1a353e006 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -5,7 +5,6 @@ on: push: branches: - main - - releases/* jobs: test: @@ -19,11 +18,11 @@ jobs: - name: Boot Test (Multiboot) id: boot_test_mb - run: RUSTFLAGS="-C opt-level=1" make run AUTO_TEST=dummy ENABLE_KVM=0 BOOT_PROTOCOL=multiboot + run: RUSTFLAGS="-C opt-level=1" make run AUTO_TEST=boot ENABLE_KVM=0 BOOT_PROTOCOL=multiboot - name: Boot Test (Multiboot2) id: boot_test_mb2 - run: RUSTFLAGS="-C opt-level=1" make run AUTO_TEST=dummy ENABLE_KVM=0 BOOT_PROTOCOL=multiboot2 + run: RUSTFLAGS="-C opt-level=1" make run AUTO_TEST=boot ENABLE_KVM=0 BOOT_PROTOCOL=multiboot2 - name: Syscall Test (Linux Boot Protocol) id: syscall_test_linux diff --git a/Cargo.lock b/Cargo.lock index 9bb3fe158..525849772 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -650,7 +650,7 @@ dependencies = [ ] [[package]] -name = "jinux-frame-x86-boot-setup" +name = "jinux-frame-x86-boot-linux-setup" version = "0.1.0" dependencies = [ "uart_16550", diff --git a/Makefile b/Makefile index e4a199830..f6fb1d671 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -# Make arguments and their defaults -AUTO_TEST ?= 0 +# Make varaiables and defaults, you should refer to jinux-runner for more details +AUTO_TEST ?= none BOOT_METHOD ?= qemu-grub BOOT_PROTOCOL ?= multiboot2 BUILD_SYSCALL_TEST ?= 0 @@ -9,14 +9,14 @@ GDB_CLIENT ?= 0 GDB_SERVER ?= 0 INTEL_TDX ?= 0 SKIP_GRUB_MENU ?= 1 -# End of Make arguments +# End of setting up Make varaiables KERNEL_CMDLINE := SHELL="/bin/sh" LOGNAME="root" HOME="/" USER="root" PATH="/bin" init=/usr/bin/busybox -- sh -l ifeq ($(AUTO_TEST), syscall) BUILD_SYSCALL_TEST := 1 KERNEL_CMDLINE += /opt/syscall_test/run_syscall_test.sh endif -ifeq ($(AUTO_TEST), dummy) +ifeq ($(AUTO_TEST), boot) KERNEL_CMDLINE += -c exit 0 endif diff --git a/framework/jinux-frame/build.rs b/framework/jinux-frame/build.rs index 24cacd70d..c8d65f3dc 100644 --- a/framework/jinux-frame/build.rs +++ b/framework/jinux-frame/build.rs @@ -32,7 +32,7 @@ fn build_linux_setup_header( let cargo = std::env::var("CARGO").unwrap(); let mut cmd = std::process::Command::new(cargo); - cmd.arg("install").arg("jinux-frame-x86-boot-setup"); + cmd.arg("install").arg("jinux-frame-x86-boot-linux-setup"); cmd.arg("--debug"); cmd.arg("--locked"); cmd.arg("--path").arg(setup_crate_dir.to_str().unwrap()); @@ -51,7 +51,7 @@ fn build_linux_setup_header( std::io::stdout().write_all(&output.stdout).unwrap(); std::io::stderr().write_all(&output.stderr).unwrap(); return Err(format!( - "Failed to build linux x86 setup header::\n\tcommand `{:?}`\n\treturned {}", + "Failed to build linux x86 setup header:\n\tcommand `{:?}`\n\treturned {}", cmd, output.status ) .into()); diff --git a/framework/jinux-frame/src/arch/x86/boot/linux_boot/setup/Cargo.toml b/framework/jinux-frame/src/arch/x86/boot/linux_boot/setup/Cargo.toml index 1f0481959..019b0c64c 100644 --- a/framework/jinux-frame/src/arch/x86/boot/linux_boot/setup/Cargo.toml +++ b/framework/jinux-frame/src/arch/x86/boot/linux_boot/setup/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "jinux-frame-x86-boot-setup" +name = "jinux-frame-x86-boot-linux-setup" version = "0.1.0" edition = "2021" diff --git a/runner/src/machine/qemu_grub_efi/mod.rs b/runner/src/machine/qemu_grub_efi/mod.rs index 0638dbbcc..f1b798494 100644 --- a/runner/src/machine/qemu_grub_efi/mod.rs +++ b/runner/src/machine/qemu_grub_efi/mod.rs @@ -90,7 +90,7 @@ pub fn create_bootdev_image( let header_path = Path::new(bs_out_dir.into_iter().next().unwrap().unwrap().as_path()) .join("out") .join("bin") - .join("jinux-frame-x86-boot-setup"); + .join("jinux-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())