-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (26 loc) · 948 Bytes
/
Makefile
File metadata and controls
32 lines (26 loc) · 948 Bytes
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
OBJS = source/container.o source/controller.o source/main.o source/cap_controller.o
LIBS = -lcap
LDFLAGS = -L/lib/x86_64-linux-gnu
setup:
@#sudo apt update
@#sudo apt -y install debootstrap libcap2-dev make gcc bridge-utils
@if [ ! -e debian ]; then \
echo "\e[36m[INFO]\e[0m: rootfs file: ./debian not found! create..."; \
sudo debootstrap --arch amd64 buster ./debian http://ftp.jp.debian.org/debian; \
else \
echo "\e[36m[INFO]\e[0m: rootfs file: ./debian found!"; \
fi
@if [ ! -e layer ]; then \
echo "\e[36m[INFO]\e[0m: layer directory create!"; \
mkdir -p ./layer/root ./layer/work ./layer/diff; \
else \
echo "\e[36m[INFO]\e[0m: layer directory found!"; \
fi
@echo "\e[36m[INFO]\e[0m: setup complete!"
build: $(OBJS:.o=.c)
@gcc -w $(LDFLAGS) $(OBJS:.o=.c) $(LIBS) -o container
run: build
@sudo cp ./config/start.sh ./layer/diff/start.sh
@sudo ./container
observer:
@sudo python3 tools/container_observer.py &