Polish namings and interfaces of linux boot

This commit is contained in:
Zhang Junyang
2023-10-26 11:27:35 +08:00
committed by Tate, Hongliang Tian
parent 33ec7dec02
commit 0a17d90532
6 changed files with 11 additions and 12 deletions

View File

@ -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

2
Cargo.lock generated
View File

@ -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",

View File

@ -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

View File

@ -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());

View File

@ -1,5 +1,5 @@
[package]
name = "jinux-frame-x86-boot-setup"
name = "jinux-frame-x86-boot-linux-setup"
version = "0.1.0"
edition = "2021"

View File

@ -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())