Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
612a74a
virtio/fs: move init binary blob into its own crate
mtjhrc May 11, 2026
cf3145d
virtio/fs: introduce InodeAllocator for shared inode numbering
mtjhrc May 4, 2026
8c5c68e
virtio/fs: introduce generic AugmentFs overlay for files like init.krun
mtjhrc May 4, 2026
d214cc8
lib: add krun_disable_implicit_init()
mtjhrc May 4, 2026
6eed1e1
lib: add krun_fs_add_overlay_file()
mtjhrc May 4, 2026
942d396
lib: add krun_get_default_init()
mtjhrc May 6, 2026
51716c1
libkrun.h: document that implicit resource creation will become opt-in
mtjhrc May 4, 2026
24caab5
virtio/fs: add NullFs, a minimal empty-root FileSystem
mtjhrc May 5, 2026
1b94214
lib: rewrite krun_set_root_disk_remount to use newly introduced NullFs
mtjhrc May 5, 2026
d413cde
virtio/fs: remove REMOVE_ROOT_DIR ioctl and allow_root_dir_delete
mtjhrc May 5, 2026
b3615e3
virtio/fs: move EXIT_CODE ioctl to AugmentFs
mtjhrc May 5, 2026
1a5b09e
tests: add augmentfs integration test
mtjhrc May 6, 2026
89a7101
tests: add root-disk-remount integration test
mtjhrc May 11, 2026
f199cf7
init: scaffold Rust krun-init crate and wire into build system
jakecorrenti May 6, 2026
3b1adc0
init: implement filesystem mounting
jakecorrenti May 6, 2026
cbf74a7
init: implement KRUN_BLOCK_ROOT_DEVICE pivot and shared root mount
jakecorrenti May 6, 2026
72ff0d7
init: implement DHCP client
jakecorrenti May 6, 2026
7dc5cd5
init: implement JSON config parsing
jakecorrenti May 6, 2026
f804a46
init: implement network interface setup
jakecorrenti May 6, 2026
3885956
init: implement environment and resource setup
jakecorrenti May 6, 2026
14418e3
init: implement I/O redirects and workload launch
jakecorrenti May 6, 2026
13fd1ca
init: wire main.rs with full boot sequence
jakecorrenti May 6, 2026
ddcca2f
init: add FreeBSD platform helpers
jakecorrenti May 6, 2026
934cb73
init: wire FreeBSD platform support
jakecorrenti May 6, 2026
b553c6c
ci: fix FreeBSD cross-compilation
jakecorrenti May 8, 2026
a8d313a
init: port timesync clock_worker to Rust
jakecorrenti May 7, 2026
2a0a08b
init: remove C sources and tee/ attestation code
jakecorrenti May 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/actions/setup-build-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ runs:
rustup update stable
rustup default stable
rustup component add rustfmt clippy
rustup target add x86_64-unknown-freebsd
rustup toolchain install nightly
rustup component add rust-src --toolchain nightly

- name: Cache Cargo dependencies
uses: actions/cache@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cross-compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Install cross-compilation dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends lld
sudo apt-get install -y --no-install-recommends clang lld

- name: Build FreeBSD init on Linux
run: make BUILD_BSD_INIT=1 -- init/init-freebsd
Expand All @@ -52,7 +52,7 @@ jobs:
- name: Install cross-compilation dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends lld
sudo apt-get install -y --no-install-recommends clang lld

- name: Build FreeBSD init on Linux aarch64
run: make BUILD_BSD_INIT=1 -- init/init-freebsd
16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[workspace]
members = [
"init",
"src/libkrun",
"src/init-blob",
"src/input",
"src/display",
"src/utils",
Expand Down
33 changes: 28 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ AWS_NITRO_INIT_SRC = \

AWS_NITRO_INIT_LD_FLAGS = -larchive -lnsm

INIT_SRC = init/init.c

ifeq ($(SEV),1)
VARIANT = -sev
FEATURE_FLAGS := --features amd-sev
Expand Down Expand Up @@ -130,6 +128,7 @@ else
endif
# Cross-compile on macOS with the LLVM linker (brew install lld)
CC_BSD=$(CLANG) -target $(ARCH)-unknown-freebsd -fuse-ld=lld -stdlib=libc++ -Wl,-strip-debug --sysroot $(SYSROOT_BSD)
CARGO_BSD_RUSTFLAGS = -C linker=$(CLANG) -C link-arg=-target -C link-arg=$(ARCH)-unknown-freebsd -C link-arg=-fuse-ld=lld -C link-arg=-stdlib=libc++ -C link-arg=--sysroot=$(abspath $(SYSROOT_BSD))
else ifeq ($(OS),Linux)
# Linux -> FreeBSD cross-compilation
ifeq ($(SYSROOT_BSD),)
Expand All @@ -140,16 +139,34 @@ else
endif
# Cross-compile on Linux with clang
CC_BSD=$(CLANG) -target $(ARCH)-unknown-freebsd -fuse-ld=lld -Wl,-strip-debug --sysroot $(SYSROOT_BSD)
CARGO_BSD_RUSTFLAGS = -C linker=$(CLANG) -C link-arg=-target -C link-arg=$(ARCH)-unknown-freebsd -C link-arg=-fuse-ld=lld -C link-arg=--sysroot=$(abspath $(SYSROOT_BSD))
else
# Build on FreeBSD host
CC_BSD=$(CC)
SYSROOT_BSD_TARGET =
CARGO_BSD_RUSTFLAGS =
endif

FREEBSD_RUST_TARGET = $(subst arm64,aarch64,$(ARCH))-unknown-freebsd

# aarch64-unknown-freebsd is Tier 3: no prebuilt std, requires nightly + build-std.
ifeq ($(FREEBSD_RUST_TARGET),aarch64-unknown-freebsd)
CARGO_BSD_TOOLCHAIN = +nightly
CARGO_BSD_EXTRA_FLAGS = -Z build-std
else
CARGO_BSD_TOOLCHAIN =
CARGO_BSD_EXTRA_FLAGS =
endif

ifeq ($(BUILD_BSD_INIT),1)
INIT_BINARY_BSD = init/init-freebsd
$(INIT_BINARY_BSD): $(INIT_SRC) $(SYSROOT_BSD_TARGET)
$(CC_BSD) -std=c23 -O2 -static -Wall -o $@ $(INIT_SRC) -lutil
$(INIT_BINARY_BSD): $(shell find init/src -name '*.rs') init/Cargo.toml $(SYSROOT_BSD_TARGET)
RUSTFLAGS="$(CARGO_BSD_RUSTFLAGS)" \
cargo $(CARGO_BSD_TOOLCHAIN) build --release \
$(CARGO_BSD_EXTRA_FLAGS) \
--manifest-path init/Cargo.toml \
--target $(FREEBSD_RUST_TARGET)
cp target/$(FREEBSD_RUST_TARGET)/release/krun-init $@
endif

# Sysroot preparation rules for cross-compilation on macOS
Expand Down Expand Up @@ -272,7 +289,13 @@ TEST_FLAGS ?=
EXTRA_LIBPATH_Linux =
EXTRA_LIBPATH_Darwin = /opt/homebrew/opt/libkrunfw/lib:/opt/homebrew/opt/llvm/lib

# Extra cargo features for the test runner (passed via KRUN_TEST_FEATURES).
TEST_FEATURE_FLAGS :=
ifeq ($(BLK),1)
TEST_FEATURE_FLAGS += blk
endif

# On macOS, SIP strips DYLD_LIBRARY_PATH when executing scripts via a shebang,
# so we pass the path via LIBKRUN_LIB_PATH and let run.sh set the real variable.
test: test-prefix
cd tests; RUST_LOG=trace LIBKRUN_LIB_PATH="$$(realpath ../test-prefix/$(LIBDIR_$(OS))/):$(EXTRA_LIBPATH_$(OS))" PKG_CONFIG_PATH="$$(realpath ../test-prefix/$(LIBDIR_$(OS))/pkgconfig/)" ./run.sh test --test-case "$(TEST)" $(TEST_FLAGS)
cd tests; RUST_LOG=trace KRUN_TEST_FEATURES="$(TEST_FEATURE_FLAGS)" LIBKRUN_LIB_PATH="$$(realpath ../test-prefix/$(LIBDIR_$(OS))/):$(EXTRA_LIBPATH_$(OS))" PKG_CONFIG_PATH="$$(realpath ../test-prefix/$(LIBDIR_$(OS))/pkgconfig/)" ./run.sh test --test-case "$(TEST)" $(TEST_FLAGS)
Loading
Loading