| 1 |
export GO111MODULE=on |
| 2 |
|
| 3 |
# Canonical version of this in https://github.com/coreos/coreos-assembler/blob/6eb97016f4dab7d13aa00ae10846f26c1cd1cb02/Makefile#L19 |
| 4 |
GOARCH:=$(shell uname -m) |
| 5 |
ifeq ($(GOARCH),x86_64) |
| 6 |
GOARCH=amd64 |
| 7 |
else ifeq ($(GOARCH),aarch64) |
| 8 |
GOARCH=arm64 |
| 9 |
else ifeq ($(patsubst armv%,arm,$(GOARCH)),arm) |
| 10 |
GOARCH=arm |
| 11 |
else ifeq ($(patsubst i%86,386,$(GOARCH)),386) |
| 12 |
GOARCH=386 |
| 13 |
endif |
| 14 |
|
| 15 |
.PHONY: all |
| 16 |
all: |
| 17 |
./build |
| 18 |
|
| 19 |
.PHONY: install |
| 20 |
install: all |
| 21 |
for x in dracut/*; do \ |
| 22 |
bn=$$(basename $$x); \ |
| 23 |
install -m 0644 -D -t $(DESTDIR)/usr/lib/dracut/modules.d/$${bn} $$x/*; \ |
| 24 |
done |
| 25 |
chmod a+x $(DESTDIR)/usr/lib/dracut/modules.d/*/*.sh $(DESTDIR)/usr/lib/dracut/modules.d/*/*-generator |
| 26 |
install -m 0644 -D -t $(DESTDIR)/usr/lib/systemd/system systemd/ignition-delete-config.service |
| 27 |
install -m 0755 -D -t $(DESTDIR)/usr/lib/dracut/modules.d/30ignition bin/$(GOARCH)/ignition |
| 28 |
install -m 0755 -D -t $(DESTDIR)/usr/bin bin/$(GOARCH)/ignition-validate |
| 29 |
install -m 0755 -d $(DESTDIR)/usr/libexec |
| 30 |
ln -sf ../lib/dracut/modules.d/30ignition/ignition $(DESTDIR)/usr/libexec/ignition-rmcfg |
| 31 |
|
| 32 |
.PHONY: vendor |
| 33 |
vendor: |
| 34 |
@go mod vendor |
| 35 |
@go mod tidy |