mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 02:47:56 +01:00
Only run some actions on 38 or older (#69)
This commit is contained in:
parent
6f1f78fa89
commit
bbac3469b1
4 changed files with 64 additions and 77 deletions
5
.github/workflows/build-and-test.yml
vendored
5
.github/workflows/build-and-test.yml
vendored
|
|
@ -8,6 +8,11 @@ on:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
|
||||||
# Test Values
|
# Test Values
|
||||||
env:
|
env:
|
||||||
ARCH: 'x86_64'
|
ARCH: 'x86_64'
|
||||||
|
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,5 +1,6 @@
|
||||||
/debugdata
|
/debugdata
|
||||||
/build
|
/build
|
||||||
|
/lorax_templates/post_*
|
||||||
/pkglists
|
/pkglists
|
||||||
/repos
|
/repos
|
||||||
/results
|
/results
|
||||||
|
|
|
||||||
131
Makefile
131
Makefile
|
|
@ -23,20 +23,68 @@ SECURE_BOOT_KEY_URL =
|
||||||
# Cache
|
# Cache
|
||||||
DNF_CACHE =
|
DNF_CACHE =
|
||||||
|
|
||||||
|
# Functions
|
||||||
|
## Formatting = lowercase
|
||||||
|
# Get a list of templates for the feature
|
||||||
|
# $1 = feature
|
||||||
|
get_templates = $(shell ls lorax_templates/$(1)_*.tmpl) \
|
||||||
|
$(foreach file,$(notdir $(shell ls lorax_templates/scripts/post/$(1)_*)),lorax_templates/post_$(file).tmpl)
|
||||||
|
|
||||||
|
# Converts a post script to a template
|
||||||
|
# $1 = script to convert
|
||||||
|
# $2 = file on ISO to write
|
||||||
|
# $3 = whether to copy the '<%' lines to the template
|
||||||
|
convert_post_to_tmpl = header=0; \
|
||||||
|
skip=0; \
|
||||||
|
while read -r line; \
|
||||||
|
do \
|
||||||
|
if [[ $$line =~ ^\<\% ]]; \
|
||||||
|
then \
|
||||||
|
if [[ '$(3)' == 'true' ]]; \
|
||||||
|
then \
|
||||||
|
echo $$line >> lorax_templates/post_$(1).tmpl; \
|
||||||
|
fi; \
|
||||||
|
echo >> lorax_templates/post_$(1).tmpl; \
|
||||||
|
else \
|
||||||
|
if [[ $$header == 0 ]]; \
|
||||||
|
then \
|
||||||
|
if [[ $$line =~ ^\#\#\ (.*)$$ ]]; \
|
||||||
|
then \
|
||||||
|
echo "append $(2) \"%post --erroronfail $${BASH_REMATCH[1]}\"" >> lorax_templates/post_$(1).tmpl; \
|
||||||
|
skip=1; \
|
||||||
|
else \
|
||||||
|
echo "append $(2) \"%post --erroronfail\"" >> lorax_templates/post_$(1).tmpl; \
|
||||||
|
fi; \
|
||||||
|
header=1; \
|
||||||
|
fi; \
|
||||||
|
if [[ $$skip == 0 ]]; \
|
||||||
|
then \
|
||||||
|
echo "append $(2) \"$${line//\"/\\\"}\"" >> lorax_templates/post_$(1).tmpl; \
|
||||||
|
fi; \
|
||||||
|
skip=0; \
|
||||||
|
fi; \
|
||||||
|
done < lorax_templates/scripts/post/$(1); \
|
||||||
|
echo "append $(2) \"%end\"" >> lorax_templates/post_$(1).tmpl
|
||||||
|
|
||||||
# Generated/internal vars
|
# Generated/internal vars
|
||||||
## Formatting = _UPPERCASE
|
## Formatting = _UPPERCASE
|
||||||
_BASE_DIR = $(shell pwd)
|
_BASE_DIR = $(shell pwd)
|
||||||
_IMAGE_REPO_ESCAPED = $(subst /,\/,$(IMAGE_REPO))
|
_IMAGE_REPO_ESCAPED = $(subst /,\/,$(IMAGE_REPO))
|
||||||
_IMAGE_REPO_DOUBLE_ESCAPED = $(subst \,\\\,$(_IMAGE_REPO_ESCAPED))
|
_IMAGE_REPO_DOUBLE_ESCAPED = $(subst \,\\\,$(_IMAGE_REPO_ESCAPED))
|
||||||
_LORAX_ARGS =
|
_LORAX_ARGS =
|
||||||
_LORAX_TEMPLATES = $(shell ls lorax_templates/install_*.tmpl) \
|
_LORAX_TEMPLATES = $(call get_templates,install)
|
||||||
$(foreach file,$(notdir $(shell ls lorax_templates/scripts/post/install_*)),lorax_templates/post_$(file).tmpl)
|
|
||||||
_REPO_FILES = $(subst /etc/yum.repos.d,repos,$(REPOS))
|
_REPO_FILES = $(subst /etc/yum.repos.d,repos,$(REPOS))
|
||||||
_TEMP_DIR = $(shell mktemp -d)
|
_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
|
_TEMPLATE_VARS = ARCH IMAGE_NAME IMAGE_REPO _IMAGE_REPO_DOUBLE_ESCAPED _IMAGE_REPO_ESCAPED IMAGE_TAG REPOS _RHEL VARIANT VERSION WEB_UI
|
||||||
_VOLID = $(firstword $(subst -, ,$(IMAGE_NAME)))-$(ARCH)-$(IMAGE_TAG)
|
_VOLID = $(firstword $(subst -, ,$(IMAGE_NAME)))-$(ARCH)-$(IMAGE_TAG)
|
||||||
|
|
||||||
ifeq ($(findstring redhat.repo,$(REPOS)),redhat.repo)
|
ifeq ($(findstring redhat.repo,$(REPOS)),redhat.repo)
|
||||||
|
_RHEL = true
|
||||||
|
else
|
||||||
|
_RHEL = false
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(_RHEL),true)
|
||||||
_LORAX_ARGS += --nomacboot --noupgrade
|
_LORAX_ARGS += --nomacboot --noupgrade
|
||||||
else ifeq ($(VARIANT),Server)
|
else ifeq ($(VARIANT),Server)
|
||||||
_LORAX_ARGS += --macboot --noupgrade
|
_LORAX_ARGS += --macboot --noupgrade
|
||||||
|
|
@ -50,17 +98,10 @@ endif
|
||||||
|
|
||||||
ifneq ($(DNF_CACHE),)
|
ifneq ($(DNF_CACHE),)
|
||||||
_LORAX_ARGS += --cachedir $(DNF_CACHE)
|
_LORAX_ARGS += --cachedir $(DNF_CACHE)
|
||||||
_LORAX_TEMPLATES += $(shell ls lorax_templates/cache_*.tmpl) \
|
_LORAX_TEMPLATES += $(call get_templates,cache)
|
||||||
$(foreach file,$(notdir $(shell ls lorax_templates/scripts/post/cache_*)),lorax_templates/post_$(file).tmpl)
|
|
||||||
_TEMPLATE_VARS += DNF_CACHE
|
_TEMPLATE_VARS += DNF_CACHE
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(findstring redhat.repo,$(REPOS)),redhat.repo)
|
|
||||||
_PLATFORM_ID = platform:el$(VERSION)
|
|
||||||
else
|
|
||||||
_PLATFORM_ID = platform:f$(VERSION)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(FLATPAK_REMOTE_REFS_DIR),)
|
ifneq ($(FLATPAK_REMOTE_REFS_DIR),)
|
||||||
COLLECTED_REFS = $(foreach file,$(shell ls $(FLATPAK_REMOTE_REFS_DIR)/*),$(shell cat $(file)))
|
COLLECTED_REFS = $(foreach file,$(shell ls $(FLATPAK_REMOTE_REFS_DIR)/*),$(shell cat $(file)))
|
||||||
FLATPAK_REMOTE_REFS += $(sort $(COLLECTED_REFS))
|
FLATPAK_REMOTE_REFS += $(sort $(COLLECTED_REFS))
|
||||||
|
|
@ -70,16 +111,14 @@ ifneq ($(FLATPAK_REMOTE_REFS),)
|
||||||
_FLATPAK_REPO_GPG = $(shell curl -L $(FLATPAK_REMOTE_URL) | grep -i '^GPGKey=' | cut -d= -f2)
|
_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)
|
_FLATPAK_REPO_URL = $(shell curl -L $(FLATPAK_REMOTE_URL) | grep -i '^URL=' | cut -d= -f2)
|
||||||
_LORAX_ARGS += -i flatpak-libs
|
_LORAX_ARGS += -i flatpak-libs
|
||||||
_LORAX_TEMPLATES += $(shell ls lorax_templates/flatpak_*.tmpl) \
|
_LORAX_TEMPLATES += $(call get_templates,flatpak) \
|
||||||
$(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
|
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
|
_TEMPLATE_VARS += FLATPAK_REMOTE_NAME FLATPAK_REMOTE_REFS FLATPAK_REMOTE_URL _FLATPAK_REPO_GPG _FLATPAK_REPO_URL
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(SECURE_BOOT_KEY_URL),)
|
ifneq ($(SECURE_BOOT_KEY_URL),)
|
||||||
_LORAX_TEMPLATES += $(shell ls lorax_templates/secureboot_*.tmpl) \
|
_LORAX_TEMPLATES += $(call get_templates,secureboot)
|
||||||
$(foreach file,$(notdir $(shell ls lorax_templates/scripts/post/secureboot_*)),lorax_templates/post_$(file).tmpl)
|
|
||||||
_TEMPLATE_VARS += ENROLLMENT_PASSWORD
|
_TEMPLATE_VARS += ENROLLMENT_PASSWORD
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
@ -97,68 +136,10 @@ lorax_repo:
|
||||||
# Step 1: Generate Lorax Templates
|
# Step 1: Generate Lorax Templates
|
||||||
lorax_templates/post_%.tmpl: lorax_templates/scripts/post/%
|
lorax_templates/post_%.tmpl: lorax_templates/scripts/post/%
|
||||||
# Support interactive-defaults.ks
|
# Support interactive-defaults.ks
|
||||||
$(eval _ISO_FILE = usr/share/anaconda/interactive-defaults.ks)
|
([ ${_RHEL} == false ] && [ $(VERSION) -le 38 ]) && ($(call convert_post_to_tmpl,$*,usr/share/anaconda/interactive-defaults.ks,true)) || true
|
||||||
|
|
||||||
header=0; \
|
|
||||||
skip=0; \
|
|
||||||
while read -r line; \
|
|
||||||
do \
|
|
||||||
if [[ $$line =~ ^\<\% ]]; \
|
|
||||||
then \
|
|
||||||
echo $$line >> lorax_templates/post_$*.tmpl; \
|
|
||||||
echo >> lorax_templates/post_$*.tmpl; \
|
|
||||||
else \
|
|
||||||
if [[ $$header == 0 ]]; \
|
|
||||||
then \
|
|
||||||
if [[ $$line =~ ^##\ (.*)$$ ]]; \
|
|
||||||
then \
|
|
||||||
echo "append $(_ISO_FILE) \"%post --erroronfail $${BASH_REMATCH[1]}\"" >> lorax_templates/post_$*.tmpl; \
|
|
||||||
skip=1; \
|
|
||||||
else \
|
|
||||||
echo "append $(_ISO_FILE) \"%post --erroronfail\"" >> lorax_templates/post_$*.tmpl; \
|
|
||||||
fi; \
|
|
||||||
header=1; \
|
|
||||||
fi; \
|
|
||||||
if [[ $$skip == 0 ]]; \
|
|
||||||
then \
|
|
||||||
echo "append $(_ISO_FILE) \"$${line//\"/\\\"}\"" >> lorax_templates/post_$*.tmpl; \
|
|
||||||
fi; \
|
|
||||||
skip=0; \
|
|
||||||
fi; \
|
|
||||||
done < lorax_templates/scripts/post/$*
|
|
||||||
echo "append $(_ISO_FILE) \"%end\"" >> lorax_templates/post_$*.tmpl
|
|
||||||
|
|
||||||
# Support new Anaconda method
|
# Support new Anaconda method
|
||||||
$(eval _ISO_FILE = usr/share/anaconda/post-scripts/configure_upgrades.ks)
|
([ ${_RHEL} == true ] || [ $(VERSION) -ge 39 ]) && ($(call convert_post_to_tmpl,$*,usr/share/anaconda/post-scripts/$*.sh,true)) || true
|
||||||
|
|
||||||
header=0; \
|
|
||||||
skip=0; \
|
|
||||||
while read -r line; \
|
|
||||||
do \
|
|
||||||
if [[ $$line =~ ^\<\% ]]; \
|
|
||||||
then \
|
|
||||||
echo >> lorax_templates/post_$*.tmpl; \
|
|
||||||
else \
|
|
||||||
if [[ $$header == 0 ]]; \
|
|
||||||
then \
|
|
||||||
if [[ $$line =~ ^##\ (.*)$$ ]]; \
|
|
||||||
then \
|
|
||||||
echo "append $(_ISO_FILE) \"%post --erroronfail $${BASH_REMATCH[1]}\"" >> lorax_templates/post_$*.tmpl; \
|
|
||||||
skip=1; \
|
|
||||||
else \
|
|
||||||
echo "append $(_ISO_FILE) \"%post --erroronfail\"" >> lorax_templates/post_$*.tmpl; \
|
|
||||||
fi; \
|
|
||||||
header=1; \
|
|
||||||
fi; \
|
|
||||||
if [[ $$skip == 0 ]]; \
|
|
||||||
then \
|
|
||||||
echo "append $(_ISO_FILE) \"$${line//\"/\\\"}\"" >> lorax_templates/post_$*.tmpl; \
|
|
||||||
fi; \
|
|
||||||
skip=0; \
|
|
||||||
fi; \
|
|
||||||
done < lorax_templates/scripts/post/$*
|
|
||||||
echo "append $(_ISO_FILE) \"%end\"" >> lorax_templates/post_$*.tmpl
|
|
||||||
|
|
||||||
|
|
||||||
repos: $(_REPO_FILES)
|
repos: $(_REPO_FILES)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<%page args="image_repo, _image_repo_double_escaped, image_name, image_tag"/>
|
<%page args="image_repo, _image_repo_double_escaped, image_name, image_tag, _rhel, version"/>
|
||||||
if (which bootc &> /dev/null)
|
if (which bootc &> /dev/null) && [ ${_rhel} == 'false' && ${version} -ge 39 ]
|
||||||
then
|
then
|
||||||
bootc switch --mutate-in-place --enforce-container-sigpolicy --transport registry ${image_repo}/${image_name}:${image_tag}
|
bootc switch --mutate-in-place --enforce-container-sigpolicy --transport registry ${image_repo}/${image_name}:${image_tag}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue