-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (59 loc) · 2.29 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
SHELL=/bin/bash
getkernel=$(shell source ./initramfs.sh; getkernel)
bubo=$(shell source ./initramfs.sh; bubo)
distro_artifact=$(shell source ./initramfs.sh; distro_artifact)
sparse=$(shell source ./initramfs.sh; sparse)
qemuit=$(shell source ./initramfs.sh; qemuit)
vacuum=$(shell source ./initramfs.sh; vacuum)
build: kernel busybox
@echo "Building..."
kernel:
@echo "invoking linux..."
source ./scripts/ccr.sh; checker && \
source ./initramfs.sh; getkernel
busybox:
@echo "invoking busybox..."
#source ./scripts/ccr.sh; checker && \
chmod +rx ./initramfs.sh ./scripts/ccr.sh && \
#./scripts/ccr.sh checker && \
./initramfs.sh bubo
#source ./initramfs.sh; bubo
distro_artifact:
@echo "Generating initramfs..."
source ./scripts/ccr.sh; checker && \
source ./initramfs.sh; distro_artifact
boot: initramfz.cpio.gz bzImage
@echo "Booting on QEMU..."
source ./initramfs.sh; qemuit
# boots the kernel with the initramfs on QEMU
.PHONY: build
clean:
@echo "Cleaning..."
source ./initramfs.sh; vacuum
#@$(call vacuum) # cleans the build files
# build into OCI containers. The docker-compose is being run as a Podman Service
# systemd's socket unit file. There is no need for "--file=" flag because of
# the build context that is being specified into the compose.yml. Without this,
# the COPY build context would be difficult because there would be the need of a
# script workaround since the build context for the container runtimes is the same
# as where the Dockerfile is located, passed by the "--file=" argument flag.
#
# btw, the same is true for the context of the .dockerignore. So, the OCI build
# context affects at least: dockerfile COPY build context and .dockerignore
containerize: build_linux build_bubo
build_bubo:
@echo "Building busybox container..."
source ./scripts/ccr.sh; checker && \
docker compose -f ./compose.yml --progress=plain build busybox
build_linux:
@echo "Building the Linux kernel container..."
source ./scripts/ccr.sh; checker && \
docker compose -f ./compose.yml build linux
up_bubo:
@echo "Running the busybox container entrypoint..."
source ./scripts/ccr.sh; checker && \
docker compose -f ./compose.yml up busybox
down_bubo:
@echo "Shutting down the busybox container entrypoint..."
source ./scripts/ccr.sh; checker && \
docker compose -f ./compose.yml down busybox