diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 4a5153b..5650e67 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -15,6 +15,7 @@ env: IMAGE_REPO: 'quay.io/fedora-ostree-desktops' VERSION: '39' VARIANT: 'Server' + FLATPAK_REFS: app/org.videolan.VLC/x86_64/stable jobs: build-container: @@ -88,6 +89,7 @@ jobs: version: ${{ env.VERSION }} variant: ${{ env.VARIANT }} action_version: ${{ steps.meta.outputs.tags || 'latest' }} + flatpak_remote_refs: ${{ env.FLATPAK_REFS }} - name: Rename ISO run: | diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..fe51240 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "external/fedora-lorax-templates"] + path = external/fedora-lorax-templates + url = https://pagure.io/fedora-lorax-templates.git + branch = f39 diff --git a/Makefile b/Makefile index 0ef451f..a4dd0fc 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,10 @@ VARIANT = Server WEB_UI = false REPOS = /etc/yum.repos.d/fedora.repo /etc/yum.repos.d/fedora-updates.repo ADDITIONAL_TEMPLATES = "" +FLATPAK_REMOTE_NAME = flathub +FLATPAK_REMOTE_URL = https://dl.flathub.org/repo/ +FLATPAK_REMOTE_REFS = + ROOTFS_SIZE = 4 # Generated vars @@ -19,6 +23,8 @@ _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 = $(subst .in,,$(shell ls lorax_templates/*.tmpl.in)) +_FLATPAK_TEMPLATES = $(_BASE_DIR)/external/fedora-lorax-templates/ostree-based-installer/lorax-embed-flatpaks.tmpl +_TEMPLATE_VARS = FLATPAK_REMOTE_NAME FLATPAK_REMOTE_URL FLATPAK_REMOTE_REFS ifeq ($(VARIANT),Server) _LORAX_ARGS = --macboot --noupgrade @@ -42,7 +48,6 @@ lorax_templates/%.tmpl: lorax_templates/%.tmpl.in $(eval _VARS = IMAGE_NAME IMAGE_TAG _IMAGE_REPO_DOUBLE_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 repos/%.repo: /etc/yum.repos.d/%.repo mkdir repos || true @@ -63,7 +68,9 @@ boot.iso: $(_LORAX_TEMPLATES) $(_REPO_FILES) $(foreach file,$(_REPO_FILES),--repo $(_BASE_DIR)/$(file)) \ $(foreach file,$(_LORAX_TEMPLATES),--add-template $(_BASE_DIR)/$(file)) \ $(foreach file,$(ADDITIONAL_TEMPLATES),--add-template $(file)) \ + $(foreach file,$(_FLATPAK_TEMPLATES),--add-template $(file)) \ --rootfs-size $(ROOTFS_SIZE) \ + $(foreach var,$(_TEMPLATE_VARS),--add-template-var "$(var)=$($(var))") \ $(_BASE_DIR)/results/ mv $(_BASE_DIR)/results/images/boot.iso $(_BASE_DIR)/ diff --git a/action.yml b/action.yml index 985bd01..5b0236f 100644 --- a/action.yml +++ b/action.yml @@ -34,8 +34,20 @@ inputs: required: true default: "latest" additional_templates: - description: Space delimetered list of additional Lorax templates to include + description: Space delimited list of additional Lorax templates to include required: false + flatpak_remote_name: + description: Name of the Flatpak remote repo + required: false + default: "flathub" + flatpak_remote_url: + description: The URL of the Flatpak remote repo + required: false + default: https://dl.flathub.org/repo/ + flatpak_remote_refs: + description: Space delimited list of refs to the flatpak packages to install + required: false + default: "" runs: using: composite @@ -51,5 +63,8 @@ runs: VERSION=${{ inputs.version }} \ IMAGE_TAG=${{ inputs.image_tag || inputs.version }} \ WEB_UI=${{ inputs.web_ui }} \ - "ADDITIONAL_TEMPLATES=${{ inputs.additional_templates }}" + "ADDITIONAL_TEMPLATES=${{ inputs.additional_templates }}" \ + FLATPAK_REMOTE_NAME=${{ inputs.flatpak_remote_name }} \ + FLATPAK_REMOTE_URL=${{ inputs.flatpak_remote_url }} \ + FLATPAK_REMOTE_REFS=${{ inputs.flatpak_remote_refs }} diff --git a/external/fedora-lorax-templates b/external/fedora-lorax-templates new file mode 160000 index 0000000..cc11553 --- /dev/null +++ b/external/fedora-lorax-templates @@ -0,0 +1 @@ +Subproject commit cc1155372046baa58f9d2cc27a9e5473bf05a3fb