Skip to content

Commit aa97d3d

Browse files
committed
Add more target to build rootfs/containers
1 parent b88257b commit aa97d3d

File tree

1 file changed

+33
-29
lines changed

1 file changed

+33
-29
lines changed

Makefile

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
PLATFORMS?=linux/arm64
22
IMAGE?=archlinuxarm
33

4-
.PHONY: qemu
5-
qemu:
4+
.PHONY: binfmt
5+
binfmt:
66
docker run --privileged --rm tonistiigi/binfmt --install arm64
77

88
# --- Builds ---
@@ -16,51 +16,55 @@ build-minimal:
1616
--load \
1717
.
1818

19-
.PHONY: build-rpi-aarch64
20-
build-rpi-aarch64:
21-
$(MAKE) build-aarch64 kind=rpi-aarch64 kernel=linux-rpi
22-
23-
.PHONY: build-generic-aarch64
24-
build-generic-aarch64:
25-
$(MAKE) build-aarch64 kind=generic-aarch64 kernel=linux-aarch64
26-
2719
.PHONY: build-aarch64
28-
build-aarch64:
20+
build-aarch64: binfmt
2921
docker buildx build \
30-
--build-arg KERNEL=$(kernel) \
3122
--platform $(PLATFORMS) \
32-
-t $(IMAGE):$(kind) \
23+
-t $(IMAGE):generic-aarch64 \
3324
-f dockerfiles/Dockerfile.aarch64 \
25+
--target builder \
3426
--load \
3527
.
3628

37-
.PHONY: export
38-
export:
29+
.PHONY: build-aarch64-rootfs
30+
build-aarch64-rootfs: binfmt
3931
docker buildx build \
40-
--platform $(PLATFORMS) \
41-
-t $(IMAGE):minimal-aarch64-export \
42-
-f dockerfiles/Dockerfile.base \
32+
--platform $(PLATFORMS) \
33+
-t $(IMAGE):generic-aarch64-rootfs \
34+
-f dockerfiles/Dockerfile.aarch64 \
4335
--target export \
44-
--load .
36+
--load \
37+
.
4538

46-
.PHONY: export-rpi
47-
export-rpi:
39+
.PHONY: build-astroarch
40+
build-astroarch: binfmt
4841
docker buildx build \
49-
--platform $(PLATFORMS) \
50-
-t $(IMAGE):rpi-aarch64-export \
51-
-f dockerfiles/Dockerfile.aarch64 \
52-
--target export \
53-
--load .
42+
--platform $(PLATFORMS) \
43+
-t astroarch:latest \
44+
-f dockerfiles/Dockerfile.astroarch \
45+
--target builder \
46+
--load \
47+
.
48+
49+
.PHONY: build-astroarch-rootfs
50+
build-astroarch-rootfs: binfmt
51+
docker buildx build \
52+
--platform $(PLATFORMS) \
53+
-t astroarch-rootfs:latest \
54+
-f dockerfiles/Dockerfile.astroarch \
55+
--target astroarch-rootfs \
56+
--load \
57+
.
5458

5559
.PHONY: create-rootfs-container
5660
create-rootfs-container:
57-
docker create --platform=linux/arm64 --name take $(IMAGE):generic-aarch64 sh
61+
docker create --platform=$(PLATFORMS) --name take astroarch-rootfs:latest sh
5862

5963
.PHONY: copy-rootfs-tar
6064
copy-rootfs-tar:
61-
docker cp take:/archlinuxarm-rpi-aarch64-rootfs.tar ./rootfs.tar
65+
docker cp take:/astroarch-rootfs.tar ./rootfs.tar
6266
docker rm -f take
6367

6468
.PHONY: prepare-rpi-img
65-
prepare-rpi-image: create-rootfs-container copy-rootfs-tar
69+
prepare-rpi-image: build-astroarch-rootfs create-rootfs-container copy-rootfs-tar
6670
./scripts/build_img.sh

0 commit comments

Comments
 (0)