codeironman f5b2038871
ospp project (feature) add namespace overlayfs cgroup (#949)
## 开发进展:
## namespace
- pid_namespace 基本实现,基于pid_struct等数据结构实现隔离
- mnt_namespace 基本实现,挂载点的隔离通过不同的挂载树来实现
- usernamespace 作为支持性的namespace,目前受限实现全局静态
## overlayfs
- 实现若干个文件系统的叠加,在mount中传入多个路径作为多个fs的mount路径以及最后merge层的fs路径
- copy-up机制的,除最上层外其他层为只读层,满足写时拷贝,需要修改的时候copy到上层修改
- whiteout特殊文件,用于标记在下层需要被删除的文件用来掩盖需要删除的文件
## cgroups
- 目前cgroups还处于框架阶段,之后具体实现具体的内存、CPU等子系统
2024-10-31 00:50:34 +08:00

64 lines
1.9 KiB
TOML

# Makefile.toml
[env]
TOOLCHAIN = "+nightly-2023-08-15-x86_64-unknown-linux-gnu"
ARCH = { default = "x86_64" }
RUST_TARGET = { default = { if = "eq(env.ARCH, 'riscv64')", value = "riscv64gc-unknown-linux-gnu", else = "x86_64-unknown-linux-musl" } }
INSTALL_DIR = { default = { if = "defined(env.DADK_CURRENT_BUILD_DIR)", value = "${DADK_CURRENT_BUILD_DIR}", else = "./install" } }
[tasks.build]
description = "Build the project"
command = "cargo"
args = ["${TOOLCHAIN}", "build", "--target", "${RUST_TARGET}"]
[tasks.run]
description = "Run the project"
command = "cargo"
args = ["${TOOLCHAIN}", "run", "--target", "${RUST_TARGET}"]
[tasks.clean]
description = "Clean the project"
command = "cargo"
args = ["${TOOLCHAIN}", "clean", "--target", "${RUST_TARGET}"]
[tasks.test]
description = "Run the tests"
command = "cargo"
args = ["${TOOLCHAIN}", "test", "--target", "${RUST_TARGET}"]
[tasks.doc]
description = "Generate documentation"
command = "cargo"
args = ["${TOOLCHAIN}", "doc", "--target", "${RUST_TARGET}"]
[tasks.fmt]
description = "Format the code"
command = "cargo"
args = ["${TOOLCHAIN}", "fmt"]
[tasks.fmt-check]
description = "Check code format"
command = "cargo"
args = ["${TOOLCHAIN}", "fmt", "--check"]
[tasks.run-release]
description = "Run the project in release mode"
command = "cargo"
args = ["${TOOLCHAIN}", "run", "--target", "${RUST_TARGET}", "--release"]
[tasks.build-release]
description = "Build the project in release mode"
command = "cargo"
args = ["${TOOLCHAIN}", "build", "--target", "${RUST_TARGET}", "--release"]
[tasks.test-release]
description = "Test the project in release mode"
command = "cargo"
args = ["${TOOLCHAIN}", "test", "--target", "${RUST_TARGET}", "--release"]
[tasks.install]
description = "Install the project"
command = "cargo"
args = ["${TOOLCHAIN}", "install", "--target", "${RUST_TARGET}", "--path", ".", "--no-track", "--root", "${INSTALL_DIR}", "--force"]