mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 10:57:55 +01:00
Merge branch 'main' into flatpak
This commit is contained in:
commit
0d01b0ddb9
4 changed files with 61 additions and 21 deletions
47
Makefile
47
Makefile
|
|
@ -26,8 +26,7 @@ _LORAX_TEMPLATES = $(subst .in,,$(shell ls lorax_templates/*.tmpl.in))
|
|||
_FLATPAK_TEMPLATES = $(_BASE_DIR)/external/fedora-lorax-templates/ostree-based-installer/lorax-embed-flatpaks.tmpl
|
||||
_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 = FLATPAK_REMOTE_NAME FLATPAK_REMOTE_URL FLATPAK_REMOTE_REFS _FLATPAK_REPO_URL _FLATPAK_REPO_GPG
|
||||
|
||||
_TEMPLATE_VARS = ARCH VERSION IMAGE_REPO IMAGE_NAME IMAGE_TAG VARIANT WEB_UI REPOS _IMAGE_REPO_ESCAPED _IMAGE_REPO_DOUBLE_ESCAPED FLATPAK_REMOTE_NAME FLATPAK_REMOTE_URL FLATPAK_REMOTE_REFS _FLATPAK_REPO_URL _FLATPAK_REPO_GPG
|
||||
|
||||
ifeq ($(VARIANT),Server)
|
||||
_LORAX_ARGS = --macboot --noupgrade
|
||||
|
|
@ -51,8 +50,50 @@ build/deploy.iso: boot.iso container/$(IMAGE_NAME)-$(IMAGE_TAG) xorriso/input.t
|
|||
implantisomd5 build/deploy.iso
|
||||
|
||||
# Step 1: Generate Lorax Templates
|
||||
lorax_templates/post_%.tmpl: lorax_templates/scripts/post/%
|
||||
# Support interactive-defaults.ks
|
||||
$(eval _ISO_FILE = usr/share/anaconda/interactive-defaults.ks)
|
||||
|
||||
header=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 \
|
||||
echo "append $(_ISO_FILE) \"%post --erroronfail\"" >> lorax_templates/post_$*.tmpl; \
|
||||
header=1; \
|
||||
fi; \
|
||||
echo "append $(_ISO_FILE) \"$$line\"" >> lorax_templates/post_$*.tmpl; \
|
||||
fi; \
|
||||
done < lorax_templates/scripts/post/$*
|
||||
echo "append $(_ISO_FILE) \"%end\"" >> lorax_templates/post_$*.tmpl
|
||||
|
||||
# Support new Anaconda method
|
||||
$(eval _ISO_FILE = usr/share/anaconda/post-scripts/configure_upgrades.ks)
|
||||
|
||||
header=0; \
|
||||
while read -r line; \
|
||||
do \
|
||||
if [[ $$line =~ ^\<\% ]]; \
|
||||
then \
|
||||
echo >> lorax_templates/post_$*.tmpl; \
|
||||
else \
|
||||
if [[ $$header == 0 ]]; \
|
||||
then \
|
||||
echo "append $(_ISO_FILE) \"%post --erroronfail\"" >> lorax_templates/post_$*.tmpl; \
|
||||
header=1; \
|
||||
fi; \
|
||||
echo "append $(_ISO_FILE) \"$$line\"" >> lorax_templates/post_$*.tmpl; \
|
||||
fi; \
|
||||
done < lorax_templates/scripts/post/$*
|
||||
echo "append $(_ISO_FILE) \"%end\"" >> lorax_templates/post_$*.tmpl
|
||||
|
||||
lorax_templates/%.tmpl: lorax_templates/%.tmpl.in
|
||||
$(eval _VARS = IMAGE_NAME IMAGE_TAG _IMAGE_REPO_DOUBLE_ESCAPED)
|
||||
$(eval _VARS = IMAGE_NAME IMAGE_TAG _IMAGE_REPO_DOUBLE_ESCAPED _IMAGE_REPO_ESCAPED)
|
||||
$(foreach var,$(_VARS),$(var)=$($(var))) envsubst '$(foreach var,$(_VARS),$$$(var))' < $(_BASE_DIR)/lorax_templates/$*.tmpl.in > $(_BASE_DIR)/lorax_templates/$*.tmpl
|
||||
|
||||
# Step 2: Replace vars in repo files
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ runs:
|
|||
# Check if running inside of the action repo
|
||||
if [[ -z "${{ github.action_ref }}" ]]; then if [[ "${{ github.ref_name }}" =~ (.*)/merge ]]; then tag=pr-${BASH_REMATCH[1]}; else tag=${{ github.ref_name }}; fi; fi
|
||||
if [[ -z "${tag}" ]]; then tag=${{ github.action_ref }}; fi
|
||||
docker run --privileged --volume .:/github/workspace/ ghcr.io/jasonn3/build-container-installer:${tag} \
|
||||
docker run --privileged --volume ${{ github.workspace }}:/github/workspace/ ghcr.io/jasonn3/build-container-installer:${tag} \
|
||||
ARCH=${{ inputs.arch }} \
|
||||
IMAGE_NAME=${{ inputs.image_name }} \
|
||||
IMAGE_REPO=${{ inputs.image_repo }} \
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
append usr/share/anaconda/interactive-defaults.ks "%post --erroronfail"
|
||||
append usr/share/anaconda/interactive-defaults.ks "sed -i 's/container-image-reference=.*/container-image-reference=ostree-image-signed:docker:\/\/${_IMAGE_REPO_DOUBLE_ESCAPED}\/${IMAGE_NAME}:${IMAGE_TAG}/' /ostree/deploy/default/deploy/*.origin"
|
||||
append usr/share/anaconda/interactive-defaults.ks "%end"
|
||||
|
||||
append usr/share/anaconda/post-scripts/configure_upgrades.ks "%post --erroronfail"
|
||||
append usr/share/anaconda/post-scripts/configure_upgrades.ks "sed -i 's/container-image-reference=.*/container-image-reference=ostree-image-signed:docker:\/\/${_IMAGE_REPO_DOUBLE_ESCAPED}\/${IMAGE_NAME}:${IMAGE_TAG}/' /ostree/deploy/default/deploy/*.origin"
|
||||
append usr/share/anaconda/post-scripts/configure_upgrades.ks "%end"
|
||||
|
||||
7
lorax_templates/scripts/post/configure_upgrades
Normal file
7
lorax_templates/scripts/post/configure_upgrades
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<%page args="image_repo, _image_repo_double_escaped, image_name, image_tag"/>
|
||||
if (which bootc &> /dev/null)
|
||||
then
|
||||
bootc switch ${image_repo}/${image_name}:${image_tag}
|
||||
else
|
||||
sed -i 's/container-image-reference=.*/container-image-reference=ostree-image-signed:docker:\/\/${_image_repo_double_escaped}\/${image_name}:${image_tag}/' /ostree/deploy/default/deploy/*.origin
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue