experimental-vms/trisquel-manual-netinstall-lxc/Makefile

80 lines
2.2 KiB
Makefile
Raw Permalink Normal View History

# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
CURL ?= curl
MIRROR ?= https://cdimage.trisquel.info/trisquel-images
VERSION ?= 11.0
.precious: \
trisquel_$(VERSION)_amd64.iso \
trisquel_$(VERSION)_amd64.iso.asc \
trisquel-netinst_$(VERSION)_amd64.iso \
trisquel-netinst_$(VERSION)_amd64.iso.asc
.PHONY: all install-vm
all: verify-trisquel-netinst_$(VERSION)_amd64
trisquel-archive-signkey.gpg:
gpg --list-keys D24DDAC9226D5BA5E9F3BED3F5DAAAF74AD4C938 || \
$(CURL) https://archive.trisquel.info/trisquel/$@ -o $@
gpg --list-keys D24DDAC9226D5BA5E9F3BED3F5DAAAF74AD4C938 || \
gpg --import trisquel-archive-signkey.gpg
%.iso:
$(CURL) $(MIRROR)/$@ -o $@
%.asc: trisquel-archive-signkey.gpg %
$(CURL) $(MIRROR)/$@ -o $@
verify-%: %.iso.asc
gpg --verify $<
install-iso:
virsh -c qemu:///system vol-list installation | \
tail +3 | \
awk '{print $1}' | \
grep '^trisquel-netinst_11.0_amd64.iso$' || \
( \
virsh -c qemu:///system \
vol-create-as \
installation trisquel-netinst_11.0_amd64.iso 0 && \
virsh -c qemu:///system \
vol-upload \
--pool installation trisquel-netinst_11.0_amd64.iso \
--file $PWD/trisquel-netinst_11.0_amd64.iso \
)
# We need that for transparency reasons
install-signature:
virsh -c qemu:///system vol-list installation | \
tail +3 | \
awk '{print $1}' | \
grep '^trisquel-netinst_11.0_amd64.iso.asc$' || \
( \
virsh -c qemu:///system \
vol-create-as \
installation trisquel-netinst_11.0_amd64.iso.asc 0 && \
virsh -c qemu:///system \
vol-upload \
--pool installation trisquel-netinst_11.0_amd64.iso \
--file $PWD/trisquel-netinst_11.0_amd64.iso.asc \
)
VM_DEPENDENCIES = \
install-iso \
install-signature \
verify-trisquel-netinst_$(VERSION)_amd64
install-vm: $(VM_DEPENDENCIES)
if ! virsh -c qemu:///system \
desc experimental-trisquel-netinstall ; then \
virsh -c qemu:///system destroy \
experimental-trisquel-netinstall || true ; \
virsh -c qemu:///system undefine \
experimental-trisquel-netinstall ; \
fi
virsh -c qemu:///system \
define --file experimental-trisquel-netinstall.xml