mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-08 21:06:48 +00:00
Hide OSDK installation if using Make
This commit is contained in:
parent
f415585dff
commit
7d0ea99650
6
.github/workflows/kernel_test.yml
vendored
6
.github/workflows/kernel_test.yml
vendored
@ -16,8 +16,6 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- run: make install_osdk
|
|
||||||
|
|
||||||
- name: Check
|
- name: Check
|
||||||
id: check
|
id: check
|
||||||
run: make check
|
run: make check
|
||||||
@ -31,8 +29,6 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- run: make install_osdk
|
|
||||||
|
|
||||||
- name: Usermode Unit test
|
- name: Usermode Unit test
|
||||||
id: usermode_unit_test
|
id: usermode_unit_test
|
||||||
run: make test
|
run: make test
|
||||||
@ -52,8 +48,6 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- run: make install_osdk
|
|
||||||
|
|
||||||
- name: Boot Test (Multiboot)
|
- name: Boot Test (Multiboot)
|
||||||
id: boot_test_mb
|
id: boot_test_mb
|
||||||
run: make run AUTO_TEST=boot ENABLE_KVM=0 BOOT_PROTOCOL=multiboot RELEASE_MODE=1
|
run: make run AUTO_TEST=boot ENABLE_KVM=0 BOOT_PROTOCOL=multiboot RELEASE_MODE=1
|
||||||
|
14
Makefile
14
Makefile
@ -98,14 +98,18 @@ OSDK_CRATES := \
|
|||||||
kernel/comps/virtio \
|
kernel/comps/virtio \
|
||||||
kernel/libs/aster-util
|
kernel/libs/aster-util
|
||||||
|
|
||||||
.PHONY: all install_osdk build tools run test docs check clean update_initramfs
|
.PHONY: all build tools run test docs check clean update_initramfs
|
||||||
|
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
install_osdk:
|
# Install or update OSDK from source
|
||||||
|
# To uninstall, do `cargo uninstall cargo-osdk`
|
||||||
|
install_osdk: osdk
|
||||||
@cargo install cargo-osdk --path osdk
|
@cargo install cargo-osdk --path osdk
|
||||||
|
|
||||||
build:
|
~/.cargo/bin/cargo-osdk: install_osdk
|
||||||
|
|
||||||
|
build: install_osdk ~/.cargo/bin/cargo-osdk
|
||||||
@make --no-print-directory -C regression
|
@make --no-print-directory -C regression
|
||||||
@cd kernel && cargo osdk build $(CARGO_OSDK_ARGS)
|
@cd kernel && cargo osdk build $(CARGO_OSDK_ARGS)
|
||||||
|
|
||||||
@ -120,7 +124,7 @@ test:
|
|||||||
(cd $$dir && cargo test) || exit 1; \
|
(cd $$dir && cargo test) || exit 1; \
|
||||||
done
|
done
|
||||||
|
|
||||||
ktest:
|
ktest: install_osdk ~/.cargo/bin/cargo-osdk
|
||||||
@# Exclude linux-bzimage-setup from ktest since it's hard to be unit tested
|
@# Exclude linux-bzimage-setup from ktest since it's hard to be unit tested
|
||||||
@for dir in $(OSDK_CRATES); do \
|
@for dir in $(OSDK_CRATES); do \
|
||||||
[ $$dir = "framework/libs/linux-bzimage/setup" ] && continue; \
|
[ $$dir = "framework/libs/linux-bzimage/setup" ] && continue; \
|
||||||
@ -135,7 +139,7 @@ docs:
|
|||||||
format:
|
format:
|
||||||
@./tools/format_all.sh
|
@./tools/format_all.sh
|
||||||
|
|
||||||
check:
|
check: install_osdk ~/.cargo/bin/cargo-osdk
|
||||||
@./tools/format_all.sh --check # Check Rust format issues
|
@./tools/format_all.sh --check # Check Rust format issues
|
||||||
@# Check if STD_CRATES and NOSTD_CRATES combined is the same as all workspace members
|
@# Check if STD_CRATES and NOSTD_CRATES combined is the same as all workspace members
|
||||||
@sed -n '/^\[workspace\]/,/^\[.*\]/{/members = \[/,/\]/p}' Cargo.toml | grep -v "members = \[" | tr -d '", \]' | sort > /tmp/all_crates
|
@sed -n '/^\[workspace\]/,/^\[.*\]/{/members = \[/,/\]/p}' Cargo.toml | grep -v "members = \[" | tr -d '", \]' | sort > /tmp/all_crates
|
||||||
|
16
README.md
16
README.md
@ -1,11 +1,11 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="docs/src/images/logo_en.svg" alt="asterinas-logo" width="620"><br>
|
<img src="docs/src/images/logo_en.svg" alt="asterinas-logo" width="620"><br>
|
||||||
A secure, fast, and general-purpose OS kernel written in Rust and compatible with Linux
|
A secure, fast, and general-purpose OS kernel written in Rust and compatible with Linux<br/>
|
||||||
|
<a href="https://github.com/asterinas/asterinas/actions/workflows/osdk_test.yml"><img src="https://github.com/asterinas/asterinas/actions/workflows/osdk_test.yml/badge.svg" alt="OSDK Test" style="max-width: 100%;"></a>
|
||||||
|
<a href="https://github.com/asterinas/asterinas/actions/workflows/kernel_test.yml"><img src="https://github.com/asterinas/asterinas/actions/workflows/kernel_test.yml/badge.svg" alt="Kernel Test" style="max-width: 100%;"></a>
|
||||||
|
<br/>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
[](https://github.com/asterinas/asterinas/actions/workflows/license_check.yml)
|
|
||||||
[](https://github.com/asterinas/asterinas/actions/workflows/kernel_test.yml)
|
|
||||||
|
|
||||||
English | [中文版](README_CN.md)
|
English | [中文版](README_CN.md)
|
||||||
|
|
||||||
## Introducing Asterinas
|
## Introducing Asterinas
|
||||||
@ -55,13 +55,7 @@ git clone https://github.com/asterinas/asterinas
|
|||||||
docker run -it --privileged --network=host --device=/dev/kvm -v ./asterinas:/root/asterinas asterinas/asterinas:0.4.0
|
docker run -it --privileged --network=host --device=/dev/kvm -v ./asterinas:/root/asterinas asterinas/asterinas:0.4.0
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Install the Asterinas OSDK from source.
|
3. Inside the container, go to the project folder to build and run Asterinas.
|
||||||
|
|
||||||
```bash
|
|
||||||
make install_osdk
|
|
||||||
```
|
|
||||||
|
|
||||||
4. Inside the container, go to the project folder to build and run Asterinas.
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
make build
|
make build
|
||||||
|
15
README_CN.md
15
README_CN.md
@ -1,10 +1,11 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="docs/src/images/logo_cn.svg" alt="asterinas-logo" width="620"><br>
|
<img src="docs/src/images/logo_cn.svg" alt="asterinas-logo" width="620"><br>
|
||||||
一个安全、快速、通用的操作系统内核,使用Rust编写,并与Linux兼容
|
一个安全、快速、通用的操作系统内核,使用Rust编写,并与Linux兼容<br/>
|
||||||
|
<a href="https://github.com/asterinas/asterinas/actions/workflows/osdk_test.yml"><img src="https://github.com/asterinas/asterinas/actions/workflows/osdk_test.yml/badge.svg" alt="OSDK Test" style="max-width: 100%;"></a>
|
||||||
|
<a href="https://github.com/asterinas/asterinas/actions/workflows/kernel_test.yml"><img src="https://github.com/asterinas/asterinas/actions/workflows/kernel_test.yml/badge.svg" alt="Kernel Test" style="max-width: 100%;"></a>
|
||||||
|
<br/>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
[](https://github.com/asterinas/asterinas/actions/workflows/aster_ci.yml)
|
|
||||||
|
|
||||||
[English](README.md) | 中文版
|
[English](README.md) | 中文版
|
||||||
|
|
||||||
## 初见星绽
|
## 初见星绽
|
||||||
@ -50,13 +51,7 @@ git clone https://github.com/asterinas/asterinas
|
|||||||
docker run -it --privileged --network=host --device=/dev/kvm -v ./asterinas:/root/asterinas asterinas/asterinas:0.4.0
|
docker run -it --privileged --network=host --device=/dev/kvm -v ./asterinas:/root/asterinas asterinas/asterinas:0.4.0
|
||||||
```
|
```
|
||||||
|
|
||||||
3. 从源码编译安装 Asterinas OSDK
|
3. 在容器内,进入项目文件夹构建并运行星绽。
|
||||||
|
|
||||||
```bash
|
|
||||||
make install_osdk
|
|
||||||
```
|
|
||||||
|
|
||||||
4. 在容器内,进入项目文件夹构建并运行星绽。
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
make build
|
make build
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Accelerate OS development with Asterinas OSDK
|
# Accelerate OS development with Asterinas OSDK
|
||||||
|
|
||||||
[](https://crates.io/crates/cargo-osdk)
|
[](https://crates.io/crates/cargo-osdk)
|
||||||
[](https://github.com/asterinas/asterinas/actions/workflows/osdk_ci.yml)
|
[](https://github.com/asterinas/asterinas/actions/workflows/osdk_test.yml)
|
||||||
|
|
||||||
### What is it?
|
### What is it?
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ pub struct TestArgs {
|
|||||||
pub struct CargoArgs {
|
pub struct CargoArgs {
|
||||||
#[arg(
|
#[arg(
|
||||||
long,
|
long,
|
||||||
help = "The Cargo build profile (built-in candidates are 'debug', 'release', 'dev' and 'bench')",
|
help = "The Cargo build profile (built-in candidates are 'dev', 'release', 'test' and 'bench')",
|
||||||
default_value = "dev"
|
default_value = "dev"
|
||||||
)]
|
)]
|
||||||
pub profile: String,
|
pub profile: String,
|
||||||
|
@ -150,7 +150,7 @@ fn check_args(arg_name: &str, args: &[String]) {
|
|||||||
/// Check cfg that is in the form that we can accept
|
/// Check cfg that is in the form that we can accept
|
||||||
fn check_cfg(cfg: &str) {
|
fn check_cfg(cfg: &str) {
|
||||||
if SELECT_REGEX.captures(cfg).is_none() {
|
if SELECT_REGEX.captures(cfg).is_none() {
|
||||||
error_msg!("{} is not allowed to used after `qemu` in `OSDK.toml`. Currently we only allow cfgs like `cfg(select=\"foo\")`", cfg);
|
error_msg!("{} is not allowed to be used after `qemu` in `OSDK.toml`. Currently we only allow cfgs like `cfg(select=\"foo\")`", cfg);
|
||||||
process::exit(Errno::ParseMetadata as _);
|
process::exit(Errno::ParseMetadata as _);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user