-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
63 lines (54 loc) · 2.1 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
SHELL := bash
.SHELLFLAGS := -e -c
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
MKFILE_DIR := $(shell echo $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) | sed 'sA/$$AA')
DOCKER_BUILDX_FLAGS ?=
GPG_PUBKEY ?= test
all: build
init: grub-debian grub-fedora
grub-debian:
git clone https://salsa.debian.org/grub-team/grub.git grub-debian
grub-fedora:
git clone https://src.fedoraproject.org/rpms/grub2.git grub-fedora
.PHONY: build
build:
docker buildx build \
-f Dockerfile \
-t ghcr.io/githedgehog/grub-build:latest \
--progress=plain \
--build-arg EFIARCH=x64 \
--build-arg TARGETHOSTARCH=x86_64 \
--build-arg MKIMAGEARCH=x86_64 \
--build-arg GPG_PUBKEY=$(GPG_PUBKEY) \
--platform=linux/amd64 $(DOCKER_BUILDX_FLAGS) . 2>&1 | tee build-x86_64.log
docker rm grub-build &>/dev/null || true
docker create --name grub-build ghcr.io/githedgehog/grub-build:latest
docker cp grub-build:/artifacts/onie-grubx64.efi $(MKFILE_DIR)/artifacts/
docker cp grub-build:/artifacts/onie-recovery-grubx64.efi $(MKFILE_DIR)/artifacts/
docker cp grub-build:/artifacts/sonic-grubx64.efi $(MKFILE_DIR)/artifacts/
docker rm grub-build
.PHONY: build-arm64
build-arm64:
docker buildx build \
-f Dockerfile.arm64 \
-t ghcr.io/githedgehog/grub-build:latest \
--progress=plain \
--build-arg EFIARCH=aa64 \
--build-arg TARGETHOSTARCH=aarch64 \
--build-arg MKIMAGEARCH=arm64 \
--build-arg GPG_PUBKEY=$(GPG_PUBKEY) \
--platform=linux/arm64 $(DOCKER_BUILDX_FLAGS) . 2>&1 | tee build-arm64.log
docker rm grub-build &>/dev/null || true
docker create --name grub-build ghcr.io/githedgehog/grub-build:latest
docker cp grub-build:/artifacts/onie-grubaa64.efi $(MKFILE_DIR)/artifacts/
docker cp grub-build:/artifacts/onie-recovery-grubaa64.efi $(MKFILE_DIR)/artifacts/
docker cp grub-build:/artifacts/sonic-grubaa64.efi $(MKFILE_DIR)/artifacts/
docker rm grub-build
.PHONY: shell
shell:
docker run -ti --rm --entrypoint=/bin/bash ghcr.io/githedgehog/grub-build:latest --login
ci: DOCKER_BUILDX_FLAGS = --load
ci: grub-fedora build
ci-arm64: DOCKER_BUILDX_FLAGS = --load
ci-arm64: grub-fedora build-arm64