From 78ccf7b51df87b64225863407520830975dedcd5 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Tue, 12 Mar 2024 11:56:45 -0400 Subject: [PATCH] use templates from matching lorax version --- .github/workflows/build-and-test.yml | 2 ++ .gitmodules | 3 +++ Makefile | 12 ++++++++---- external/lorax | 1 + 4 files changed, 14 insertions(+), 4 deletions(-) create mode 160000 external/lorax diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index b6ed40c..aacae17 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -73,6 +73,7 @@ jobs: version: - 38 - 39 + - 40 outputs: iso_name-38: ${{ steps.save_output.outputs.iso_name-38 }} iso_name-39: ${{ steps.save_output.outputs.iso_name-39 }} @@ -142,6 +143,7 @@ jobs: version: - 38 - 39 + - 40 steps: - name: Checkout repo uses: actions/checkout@v4 diff --git a/.gitmodules b/.gitmodules index fe51240..e05748a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,3 +2,6 @@ path = external/fedora-lorax-templates url = https://pagure.io/fedora-lorax-templates.git branch = f39 +[submodule "external/lorax"] + path = external/lorax + url = https://github.com/weldr/lorax.git diff --git a/Makefile b/Makefile index 91ba0b5..b8e32bc 100644 --- a/Makefile +++ b/Makefile @@ -84,6 +84,10 @@ build/deploy.iso: boot.iso container/$(IMAGE_NAME)-$(IMAGE_TAG) xorriso/input.t xorriso -dialog on < $(_BASE_DIR)/xorriso/input.txt implantisomd5 build/deploy.iso +lorax_repo: + git config advice.detachedHead false + cd external/lorax && git checkout tags/$(shell cd external/lorax && git tag -l lorax-$(VERSION).* | tail -n 1) + # Step 1: Generate Lorax Templates lorax_templates/post_%.tmpl: lorax_templates/scripts/post/% # Support interactive-defaults.ks @@ -163,7 +167,7 @@ repos/%.repo: /etc/yum.repos.d/%.repo %.repo: # Step 3: Build boot.iso using Lorax -boot.iso: $(filter lorax_templates/%,$(_LORAX_TEMPLATES)) $(_REPO_FILES) +boot.iso: lorax_repo $(filter lorax_templates/%,$(_LORAX_TEMPLATES)) $(_REPO_FILES) rm -Rf $(_BASE_DIR)/results || true mv /etc/rpm/macros.image-language-conf $(_TEMP_DIR)/macros.image-language-conf || true @@ -174,7 +178,7 @@ boot.iso: $(filter lorax_templates/%,$(_LORAX_TEMPLATES)) $(_REPO_FILES) fi lorax -p $(IMAGE_NAME) -v $(VERSION) -r $(VERSION) -t $(VARIANT) \ - --isfinal --squashfs-only --buildarch=$(ARCH) --volid=$(_VOLID) \ + --isfinal --squashfs-only --buildarch=$(ARCH) --volid=$(_VOLID) --sharedir $(_BASE_DIR)/external/lorax/share/templates.d/99-generic \ $(_LORAX_ARGS) \ $(foreach file,$(_REPO_FILES),--repo $(_BASE_DIR)/$(file)) \ $(foreach file,$(_LORAX_TEMPLATES),--add-template $(_BASE_DIR)/$(file)) \ @@ -220,7 +224,7 @@ clean: rm -f $(_BASE_DIR)/*.log || true install-deps: - dnf install -y lorax xorriso skopeo flatpak dbus-daemon ostree coreutils gettext + dnf install -y lorax xorriso skopeo flatpak dbus-daemon ostree coreutils gettext git test: test-iso test-vm @@ -250,4 +254,4 @@ test-vm: chmod +x $(foreach test,$(_TESTS),tests/vm/$(test)) for test in $(_TESTS); do ./tests/vm/$${test} deploy.iso; done -.PHONY: clean install-deps test test-iso test-vm container/$(IMAGE_NAME)-$(IMAGE_TAG) +.PHONY: clean install-deps test test-iso test-vm lorax_repo diff --git a/external/lorax b/external/lorax new file mode 160000 index 0000000..ffba307 --- /dev/null +++ b/external/lorax @@ -0,0 +1 @@ +Subproject commit ffba3078beab843c5d663f6443dca28d8e820948