1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00
VILLASnode/packaging/live-iso/Makefile

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

86 lines
2.2 KiB
Makefile
Raw Permalink Normal View History

2022-03-06 05:20:56 -05:00
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
NAME ?= VILLASlive
2022-03-06 05:20:56 -05:00
RELEASEVER ?= 35
RELEASEARCH ?= x86_64
DATE = $(shell date +%Y-%m-%d)
2022-03-06 05:20:56 -05:00
DEPLOY_PATH ?= https://files.fein-aachen.org/
DEPLOY_USER ?= webdav
ifneq ($(CI),)
VERSION = $(CI_COMMIT_REF_NAME)
else
VERSION = $(shell git describe --tags)
endif
BASE = $(NAME)-$(RELEASEARCH)-$(RELEASEVER)
IMG = $(BASE)-$(VERSION:v%=%).img
IMG_LATEST = $(BASE)-latest.iso
2022-03-06 05:20:56 -05:00
BASE_ISO=Fedora-Server-netinst-$(RELEASEARCH)-$(RELEASEVER)-1.2.iso
SRCDIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
BUILDDIR ?= $(SRCDIR)/build
export BUILDDIR
FILES = $(shell find $(SRCDIR)/files -type f)
PATCHED_FILES = $(FILES:$(SRCDIR)/files/%=$(BUILDDIR)/patched_files/%)
# Tools
2022-03-06 05:20:56 -05:00
LMC = livemedia-creator \
--releasever=$(RELEASEVER) \
--ram=8192 \
--vcpus=16
# Targets
2022-03-06 05:20:56 -05:00
all: iso
iso: $(BUILDDIR)/$(ISO)
patched: $(PATCHED_FILES)
clean:
rm -rf $(BUILDDIR)
2022-03-06 05:20:56 -05:00
deploy: #$(BUILDDIR)/$(ISO)
rclone config create fein webdav url ${DEPLOY_PATH} vendor other user ${DEPLOY_USER} pass ${DEPLOY_PASS}
rclone config show
rclone copy $(BUILDDIR)/$(ISO) fein:villas/iso
2022-03-06 05:20:56 -05:00
$(BUILDDIR)/$(ISO): $(BUILDDIR)/iso/villas.iso
ln -s $< $@
2022-03-06 05:20:56 -05:00
$(BUILDDIR)/iso/%.iso: $(SRCDIR)/%.ks /tmp/$(BASE_ISO)
# livemedia-creator requires that the resultdir is not present
rm -rf $(dir $@)
# livemedia-creator uses losetup to mount the image
# When used in a Docker container, we must make sure
# that there are some usable /dev/loopX devices.
./ensure_loop.sh
2022-03-06 05:20:56 -05:00
$(LMC) \
--make-iso \
--iso-only \
--iso-name=$(notdir $@) \
--iso /tmp/$(BASE_ISO) \
--resultdir=$(dir $@) \
--kernel-args "inst.ks=file:/villas.ks" \
--ks $<
2022-03-06 05:20:56 -05:00
/tmp/$(BASE_ISO):
wget -nv -O $@ https://ftp.halifax.rwth-aachen.de/fedora/linux/releases/$(RELEASEVER)/Server/$(RELEASEARCH)/iso/$(BASE_ISO)
$(BUILDDIR)/patched_files/%: $(SRCDIR)/files/%
@mkdir -p $(dir $@)
sed -e "s/§VERSION§/$(VERSION)/g" \
-e "s/§RELEASEVER§/$(RELEASEVER)/g" \
-e "s/§RELEASEARCH§/$(RELEASEARCH)/g" \
-e "s/§DATE§/$(DATE)/g" < $< > $@
2022-03-06 05:20:56 -05:00
.PHONY: all deploy clean deploy patched iso
.PRECIOUS: %