forked from vandycknick/virt-fwk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (37 loc) · 1.49 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
DISTRO:=ubuntu-24.04
KERNEL_VERSION:=6.1.26
.PHONY: build-kernel
build-kernel:
@docker volume create kernel-build-cache
@docker build -f tools/Dockerfile -t kernel-builder .
@docker run -t --mount source=kernel-build-cache,target=/builder/obj -v $(shell pwd):/app kernel-builder kernel
.PHONY: build-initramfs
build-initramfs:
@docker volume create kernel-build-cache
@docker build -f tools/Dockerfile -t kernel-builder .
@docker run -t --mount source=kernel-build-cache,target=/builder/obj -v $(shell pwd):/app kernel-builder initramfs
.PHONY: build-rootfs
build-rootfs:
@docker volume create kernel-build-cache
@docker build -f tools/rootfs/Dockerfile.${DISTRO} -t rootfs-${DISTRO} .
@docker run -it --mount source=kernel-build-cache,target=/builder/obj -v $(shell pwd):/app --privileged --cap-add=CAP_MKNOD rootfs-${DISTRO}
.PHONY: build-shell
build-shell:
@docker run -it --mount source=kernel-build-cache,target=/builder/obj -v $(shell pwd):/app --entrypoint bash kernel-builder
.PHONY: debug
debug:
cargo build --bin simple-vm
codesign -f --entitlement ./virt-fwk.entitlements -s - target/debug/simple-vm
.PHONY: simple-vm
simple-vm: debug
@RUST_BACKTRACE=full ./target/debug/simple-vm --kernel $(shell pwd)/assets/kernel-${KERNEL_VERSION} --initrd $(shell pwd)/assets/initramfs --disk $(shell pwd)/assets/${DISTRO}.img
.PHONY: check
check:
cargo clippy
.PHONY: publish
publish:
cargo publish -p virt-fwk --dry-run
.PHONY: docs
docs:
cargo doc -p virt-fwk
@cd ./target/doc && python -m http.server