Fedora CoreOS can be provisioned on a QEMU virtual machine by providing the Ignition configuration via `fw_cfg` value. Unfortunately, the `string` method does not work with JSON values, so we have to use `file`. The configuration file has to be uploaded via SFTP, rather than `virsh vol-import`, since the latter would create the file with the wrong permissions, and QEMU does not automatically adjust the permissions of files used this way (like it does for disks).
34 lines
519 B
Makefile
34 lines
519 B
Makefile
.PHONY: \
|
|
all \
|
|
clean \
|
|
publish \
|
|
vm
|
|
|
|
.DEFAULT_GOAL := all
|
|
|
|
clean:
|
|
rm -f *.ign
|
|
|
|
define genrules
|
|
$(patsubst %.yaml,%.ign,$(1)): $(1) $$(shell sed -rn 's/.*local: (.*)/\1/p' $(1))
|
|
butane -d . $$< > $$@
|
|
|
|
all: $(patsubst %.yaml,%.ign,$(1))
|
|
endef
|
|
|
|
$(foreach t,$(wildcard *.yaml),$(eval $(call genrules,$(t))))
|
|
|
|
%.env: %.env.gpg
|
|
gpg2 --decrypt $< > $@
|
|
|
|
%.token: %.token.gpg
|
|
gpg2 --decrypt $< > $@
|
|
|
|
publish: \
|
|
nvr1.ign
|
|
rsync -rti $^ files.pyrocufflink.blue:public_html/
|
|
|
|
vm: \
|
|
$(VMNAME).ign
|
|
sh mkvm.sh $(VMNAME)
|