-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
101 lines (86 loc) · 2.05 KB
/
Makefile
File metadata and controls
101 lines (86 loc) · 2.05 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# ba0fde3d-bee7-4307-b97b-17d0d20aff50
SUDO = sudo
PODMAN = $(SUDO) podman
IMAGE_NAME ?= localhost/myimage
CONTAINER_FILE ?= ./Dockerfile
VARIANT ?=
IMAGE_CONFIG ?= ./iso.toml
IMAGE_TYPE ?= iso
QEMU_DISK_RAW ?= ./output/disk.raw
QEMU_DISK_QCOW2 ?= ./output/qcow2/disk.qcow2
QEMU_ISO ?= ./output/bootiso/install.iso
.ONESHELL:
clean:
$(SUDO) rm -rf ./output
image:
$(PODMAN) build \
--security-opt=label=disable \
--cap-add=all \
--device /dev/fuse \
--build-arg IMAGE_NAME=$(IMAGE_NAME) \
--build-arg IMAGE_REGISTRY=localhost \
--build-arg VARIANT=$(VARIANT) \
-t $(IMAGE_NAME) \
-f $(CONTAINER_FILE) \
.
bib_image:
$(SUDO) rm -rf ./output
mkdir -p ./output
cp $(IMAGE_CONFIG) ./output/config.toml
# Don't bother trying to switch to a new image, this is just for local testing
sed -i '/bootc switch/d' ./output/config.toml
if [ "$(IMAGE_TYPE)" = "iso" ]; then
LIBREPO=False;
else
LIBREPO=True;
fi;
$(PODMAN) run \
--rm \
-it \
--privileged \
--pull=newer \
--security-opt label=type:unconfined_t \
-v ./output:/output \
-v ./output/config.toml:/config.toml:ro \
-v /var/lib/containers/storage:/var/lib/containers/storage \
quay.io/centos-bootc/bootc-image-builder:latest \
--type $(IMAGE_TYPE) \
--use-librepo=$$LIBREPO \
--progress verbose \
$(IMAGE_NAME)
iso:
make bib_image IMAGE_TYPE=iso
qcow2:
make bib_image IMAGE_TYPE=qcow2
run-qemu-qcow:
qemu-system-x86_64 \
-M accel=kvm \
-cpu host \
-smp 2 \
-m 4096 \
-bios /usr/share/OVMF/x64/OVMF.4m.fd \
-serial stdio \
-snapshot $(QEMU_DISK_QCOW2)
run-qemu-iso:
mkdir -p ./output
# Make a disk to install to
[[ ! -e $(QEMU_DISK_RAW) ]] && dd if=/dev/null of=$(QEMU_DISK_RAW) bs=1M seek=20480
qemu-system-x86_64 \
-M accel=kvm \
-cpu host \
-smp 2 \
-m 4096 \
-bios /usr/share/OVMF/x64/OVMF.4m.fd \
-serial stdio \
-boot d \
-cdrom $(QEMU_ISO) \
-hda $(QEMU_DISK_RAW)
run-qemu:
qemu-system-x86_64 \
-M accel=kvm \
-cpu host \
-smp 2 \
-m 4096 \
-bios /usr/share/OVMF/x64/OVMF.4m.fd \
-serial stdio \
-hda $(QEMU_DISK_RAW)