From e1204fdd4fbe242204ab7356cbf565447d0c2abc Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Tue, 12 Mar 2024 09:09:17 -0400 Subject: [PATCH 1/3] replace shouldn't be needed after 41 --- lorax_templates/flatpak_set_repo.tmpl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lorax_templates/flatpak_set_repo.tmpl b/lorax_templates/flatpak_set_repo.tmpl index 622e9a16..40df5d8d 100644 --- a/lorax_templates/flatpak_set_repo.tmpl +++ b/lorax_templates/flatpak_set_repo.tmpl @@ -1,4 +1,7 @@ -<%page args="flatpak_remote_name, _flatpak_repo_url"/> - +<%page args="flatpak_remote_name, _flatpak_repo_url, version"/> +% if int(version) >= 41: +append etc/anaconda/conf.d/anaconda.conf "flatpak_remote = ${flatpak_remote_name} ${_flatpak_repo_url}" +% else replace "flatpak_manager\.add_remote\(\".*\", \".*\"\)" "flatpak_manager.add_remote(\"${flatpak_remote_name}\", \"${_flatpak_repo_url}\")" /usr/lib64/python*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree/flatpak_installation.py replace "flatpak_manager\.replace_installed_refs_remote\(\".*\"\)" "flatpak_manager.replace_installed_refs_remote(\"${flatpak_remote_name}\")" /usr/lib64/python*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree/flatpak_installation.py +% endif \ No newline at end of file From 213a9a5b7e91586ed4c664777218a0338e1fee67 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Tue, 12 Mar 2024 09:24:34 -0400 Subject: [PATCH 2/3] missing : --- lorax_templates/flatpak_set_repo.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lorax_templates/flatpak_set_repo.tmpl b/lorax_templates/flatpak_set_repo.tmpl index 40df5d8d..9cd006bc 100644 --- a/lorax_templates/flatpak_set_repo.tmpl +++ b/lorax_templates/flatpak_set_repo.tmpl @@ -1,7 +1,7 @@ <%page args="flatpak_remote_name, _flatpak_repo_url, version"/> % if int(version) >= 41: append etc/anaconda/conf.d/anaconda.conf "flatpak_remote = ${flatpak_remote_name} ${_flatpak_repo_url}" -% else +% else: replace "flatpak_manager\.add_remote\(\".*\", \".*\"\)" "flatpak_manager.add_remote(\"${flatpak_remote_name}\", \"${_flatpak_repo_url}\")" /usr/lib64/python*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree/flatpak_installation.py replace "flatpak_manager\.replace_installed_refs_remote\(\".*\"\)" "flatpak_manager.replace_installed_refs_remote(\"${flatpak_remote_name}\")" /usr/lib64/python*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree/flatpak_installation.py % endif \ No newline at end of file From 04e2ceb424108664820a2aa43728d1d7b65bc5f0 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Tue, 12 Mar 2024 09:37:57 -0400 Subject: [PATCH 3/3] only create vars when needed --- Makefile | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 9017ccd1..5398b9e6 100644 --- a/Makefile +++ b/Makefile @@ -27,18 +27,13 @@ DNF_CACHE = _BASE_DIR = $(shell pwd) _IMAGE_REPO_ESCAPED = $(subst /,\/,$(IMAGE_REPO)) _IMAGE_REPO_DOUBLE_ESCAPED = $(subst \,\\\,$(_IMAGE_REPO_ESCAPED)) -_VOLID = $(firstword $(subst -, ,$(IMAGE_NAME)))-$(ARCH)-$(IMAGE_TAG) -_REPO_FILES = $(subst /etc/yum.repos.d,repos,$(REPOS)) -_LORAX_TEMPLATES = $(shell ls lorax_templates/install_*.tmpl) $(foreach file,$(notdir $(shell ls lorax_templates/scripts/post/install_*)),lorax_templates/post_$(file).tmpl) -_LORAX_TEMPLATES_FLATPAKS = $(shell ls lorax_templates/flatpak_*.tmpl) $(foreach file,$(notdir $(shell ls lorax_templates/scripts/post/flatpak_*)),lorax_templates/post_$(file).tmpl) external/fedora-lorax-templates/ostree-based-installer/lorax-embed-flatpaks.tmpl -_LORAX_TEMPLATES_SECUREBOOT = $(shell ls lorax_templates/secureboot_*.tmpl) $(foreach file,$(notdir $(shell ls lorax_templates/scripts/post/secureboot_*)),lorax_templates/post_$(file).tmpl) -_LORAX_TEMPLATES_CACHE = $(shell ls lorax_templates/cache_*.tmpl) $(foreach file,$(notdir $(shell ls lorax_templates/scripts/post/cache_*)),lorax_templates/post_$(file).tmpl) _LORAX_ARGS = -_FLATPAK_REPO_URL = $(shell curl -L $(FLATPAK_REMOTE_URL) | grep -i '^URL=' | cut -d= -f2) -_FLATPAK_REPO_GPG = $(shell curl -L $(FLATPAK_REMOTE_URL) | grep -i '^GPGKey=' | cut -d= -f2) -_TEMPLATE_VARS = ARCH IMAGE_NAME IMAGE_REPO _IMAGE_REPO_DOUBLE_ESCAPED _IMAGE_REPO_ESCAPED IMAGE_TAG REPOS VARIANT VERSION WEB_UI +_LORAX_TEMPLATES = $(shell ls lorax_templates/install_*.tmpl) \ + $(foreach file,$(notdir $(shell ls lorax_templates/scripts/post/install_*)),lorax_templates/post_$(file).tmpl) +_REPO_FILES = $(subst /etc/yum.repos.d,repos,$(REPOS)) _TEMP_DIR = $(shell mktemp -d) - +_TEMPLATE_VARS = ARCH IMAGE_NAME IMAGE_REPO _IMAGE_REPO_DOUBLE_ESCAPED _IMAGE_REPO_ESCAPED IMAGE_TAG REPOS VARIANT VERSION WEB_UI +_VOLID = $(firstword $(subst -, ,$(IMAGE_NAME)))-$(ARCH)-$(IMAGE_TAG) ifeq ($(findstring redhat.repo,$(REPOS)),redhat.repo) _LORAX_ARGS += --nomacboot --noupgrade @@ -54,7 +49,8 @@ endif ifneq ($(DNF_CACHE),) _LORAX_ARGS += --cachedir $(DNF_CACHE) -_LORAX_TEMPLATES += $(_LORAX_TEMPLATES_CACHE) +_LORAX_TEMPLATES += $(shell ls lorax_templates/cache_*.tmpl) \ + $(foreach file,$(notdir $(shell ls lorax_templates/scripts/post/cache_*)),lorax_templates/post_$(file).tmpl) _TEMPLATE_VARS += DNF_CACHE endif @@ -65,13 +61,19 @@ _PLATFORM_ID = platform:f$(VERSION) endif ifneq ($(FLATPAK_REMOTE_REFS),) +_FLATPAK_REPO_GPG = $(shell curl -L $(FLATPAK_REMOTE_URL) | grep -i '^GPGKey=' | cut -d= -f2) +_FLATPAK_REPO_URL = $(shell curl -L $(FLATPAK_REMOTE_URL) | grep -i '^URL=' | cut -d= -f2) _LORAX_ARGS += -i flatpak-libs -_LORAX_TEMPLATES += $(_LORAX_TEMPLATES_FLATPAKS) +_LORAX_TEMPLATES += $(shell ls lorax_templates/flatpak_*.tmpl) \ + $(foreach file,$(notdir $(shell ls lorax_templates/scripts/post/flatpak_*)),lorax_templates/post_$(file).tmpl) \ + external/fedora-lorax-templates/ostree-based-installer/lorax-embed-flatpaks.tmpl _TEMPLATE_VARS += FLATPAK_REMOTE_NAME FLATPAK_REMOTE_REFS FLATPAK_REMOTE_URL _FLATPAK_REPO_GPG _FLATPAK_REPO_URL + endif ifneq ($(SECURE_BOOT_KEY_URL),) -_LORAX_TEMPLATES += $(_LORAX_TEMPLATES_SECUREBOOT) +_LORAX_TEMPLATES += $(shell ls lorax_templates/secureboot_*.tmpl) \ + $(foreach file,$(notdir $(shell ls lorax_templates/scripts/post/secureboot_*)),lorax_templates/post_$(file).tmpl) _TEMPLATE_VARS += ENROLLMENT_PASSWORD endif