mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 10:57:55 +01:00
use builtin conditions where possible
This commit is contained in:
parent
c3e7518310
commit
2dde2b4f5c
2 changed files with 21 additions and 23 deletions
40
Makefile
40
Makefile
|
|
@ -75,10 +75,16 @@ _LORAX_ARGS =
|
||||||
_LORAX_TEMPLATES = $(call get_templates,install)
|
_LORAX_TEMPLATES = $(call get_templates,install)
|
||||||
_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
|
||||||
|
|
@ -96,12 +102,6 @@ _LORAX_TEMPLATES += $(call get_templates,cache)
|
||||||
_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))
|
||||||
|
|
@ -136,10 +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
|
||||||
[ $(VERSION) -le 38 ] && $(call convert_post_to_tmpl,$*,usr/share/anaconda/interactive-defaults.ks,true)
|
([ ${_RHEL} == false ] && [ $(VERSION) -le 38 ]) && ($(call convert_post_to_tmpl,$*,usr/share/anaconda/interactive-defaults.ks,true)) || true
|
||||||
|
|
||||||
# Support new Anaconda method
|
# Support new Anaconda method
|
||||||
[ $(VERSION) -ge 39 ] && $(call convert_post_to_tmpl,$*,usr/share/anaconda/post-scripts/$*.sh)
|
([ ${_RHEL} == true ] || [ $(VERSION) -ge 39 ]) && ($(call convert_post_to_tmpl,$*,usr/share/anaconda/post-scripts/$*.sh,true)) || true
|
||||||
|
|
||||||
repos: $(_REPO_FILES)
|
repos: $(_REPO_FILES)
|
||||||
|
|
||||||
|
|
@ -161,10 +161,9 @@ boot.iso: lorax_repo $(filter lorax_templates/%,$(_LORAX_TEMPLATES)) $(_REPO_FIL
|
||||||
mv /etc/rpm/macros.image-language-conf $(_TEMP_DIR)/macros.image-language-conf || true
|
mv /etc/rpm/macros.image-language-conf $(_TEMP_DIR)/macros.image-language-conf || true
|
||||||
|
|
||||||
# Download the secure boot key
|
# Download the secure boot key
|
||||||
if [ -n "$(SECURE_BOOT_KEY_URL)" ]; \
|
ifneq ($(SECURE_BOOT_KEY_URL),)
|
||||||
then \
|
curl --fail -L -o $(_BASE_DIR)/sb_pubkey.der $(SECURE_BOOT_KEY_URL)
|
||||||
curl --fail -L -o $(_BASE_DIR)/sb_pubkey.der $(SECURE_BOOT_KEY_URL); \
|
endif
|
||||||
fi
|
|
||||||
|
|
||||||
lorax -p $(IMAGE_NAME) -v $(VERSION) -r $(VERSION) -t $(VARIANT) \
|
lorax -p $(IMAGE_NAME) -v $(VERSION) -r $(VERSION) -t $(VARIANT) \
|
||||||
--isfinal --squashfs-only --buildarch=$(ARCH) --volid=$(_VOLID) --sharedir $(_BASE_DIR)/external/lorax/share/templates.d/99-generic \
|
--isfinal --squashfs-only --buildarch=$(ARCH) --volid=$(_VOLID) --sharedir $(_BASE_DIR)/external/lorax/share/templates.d/99-generic \
|
||||||
|
|
@ -236,14 +235,13 @@ test-iso:
|
||||||
done
|
done
|
||||||
|
|
||||||
# flapak tests
|
# flapak tests
|
||||||
if [ -n "$(FLATPAK_REMOTE_REFS)" ]; \
|
ifneq ($(FLATPAK_REMOTE_REFS),)
|
||||||
then \
|
chmod +x $(foreach test,$(filter flatpak_%,$(_TESTS)),tests/iso/$(test))
|
||||||
chmod +x $(foreach test,$(filter flatpak_%,$(_TESTS)),tests/iso/$(test)); \
|
for test in $(_TESTS); \
|
||||||
for test in $(_TESTS); \
|
do \
|
||||||
do \
|
$(foreach var,$(_VARS),$(var)=$($(var))) ./tests/iso/$${test}; \
|
||||||
$(foreach var,$(_VARS),$(var)=$($(var))) ./tests/iso/$${test}; \
|
done
|
||||||
done; \
|
endif
|
||||||
fi
|
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
sudo umount /mnt/install
|
sudo umount /mnt/install
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<%page args="image_repo, _image_repo_double_escaped, image_name, image_tag, version"/>
|
<%page args="image_repo, _image_repo_double_escaped, image_name, image_tag, _rhel, version"/>
|
||||||
if (which bootc &> /dev/null) && [ ${version} -ge 39 ]
|
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