mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 10:57:55 +01:00
Allowing storing the Flatpak refs in files (#66)
This commit is contained in:
parent
f4fd87855a
commit
4fac21d55f
9 changed files with 75 additions and 32 deletions
13
.github/workflows/build-and-test.yml
vendored
13
.github/workflows/build-and-test.yml
vendored
|
|
@ -15,7 +15,7 @@ env:
|
||||||
IMAGE_REPO: 'quay.io/fedora-ostree-desktops'
|
IMAGE_REPO: 'quay.io/fedora-ostree-desktops'
|
||||||
IMAGE_TAG: '39'
|
IMAGE_TAG: '39'
|
||||||
VARIANT: 'Server'
|
VARIANT: 'Server'
|
||||||
FLATPAK_REMOTE_REFS: app/org.videolan.VLC/x86_64/stable runtime/org.kde.Platform/x86_64/5.15-23.08
|
FLATPAK_REMOTE_REFS_DIR: flatpak_refs
|
||||||
SECURE_BOOT_KEY_URL: 'https://github.com/ublue-os/akmods/raw/main/certs/public_key.der'
|
SECURE_BOOT_KEY_URL: 'https://github.com/ublue-os/akmods/raw/main/certs/public_key.der'
|
||||||
ENROLLMENT_PASSWORD: 'container-installer'
|
ENROLLMENT_PASSWORD: 'container-installer'
|
||||||
|
|
||||||
|
|
@ -175,7 +175,16 @@ jobs:
|
||||||
- name: Run ISO checks
|
- name: Run ISO checks
|
||||||
run: |
|
run: |
|
||||||
mv ${{ needs['build-and-push-iso']['outputs'][format('iso_name-{0}', matrix.version)] }} deploy.iso
|
mv ${{ needs['build-and-push-iso']['outputs'][format('iso_name-{0}', matrix.version)] }} deploy.iso
|
||||||
make test-iso VERSION=${{ matrix.version }} FLATPAK_REMOTE_REFS="${{ env.FLATPAK_REMOTE_REFS}}"
|
make test-iso \
|
||||||
|
ARCH=${{ env.ARCH}} \
|
||||||
|
IMAGE_NAME=${{ env.IMAGE_NAME}} \
|
||||||
|
IMAGE_REPO=${{ env.IMAGE_REPO}} \
|
||||||
|
IMAGE_TAG=${{ env.IMAGE_TAG }} \
|
||||||
|
VERSION=${{ matrix.version }} \
|
||||||
|
VARIANT=${{ env.VARIANT }} \
|
||||||
|
FLATPAK_REMOTE_REFS_DIR=${{ env.FLATPAK_REMOTE_REFS_DIR }} \
|
||||||
|
SECURE_BOOT_KEY_URL=${{ env.SECURE_BOOT_KEY_URL }} \
|
||||||
|
ENROLLMENT_PASSWORD=${{ env.ENROLLMENT_PASSWORD }}
|
||||||
|
|
||||||
- name: Add Kickstart and Grub options to ISO
|
- name: Add Kickstart and Grub options to ISO
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
23
Makefile
23
Makefile
|
|
@ -16,6 +16,7 @@ WEB_UI = false
|
||||||
FLATPAK_REMOTE_NAME = flathub
|
FLATPAK_REMOTE_NAME = flathub
|
||||||
FLATPAK_REMOTE_URL = https://flathub.org/repo/flathub.flatpakrepo
|
FLATPAK_REMOTE_URL = https://flathub.org/repo/flathub.flatpakrepo
|
||||||
FLATPAK_REMOTE_REFS =
|
FLATPAK_REMOTE_REFS =
|
||||||
|
FLATPAK_REMOTE_REFS_DIR =
|
||||||
# Secure boot
|
# Secure boot
|
||||||
ENROLLMENT_PASSWORD =
|
ENROLLMENT_PASSWORD =
|
||||||
SECURE_BOOT_KEY_URL =
|
SECURE_BOOT_KEY_URL =
|
||||||
|
|
@ -60,6 +61,11 @@ else
|
||||||
_PLATFORM_ID = platform:f$(VERSION)
|
_PLATFORM_ID = platform:f$(VERSION)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq ($(FLATPAK_REMOTE_REFS_DIR),)
|
||||||
|
COLLECTED_REFS = $(foreach file,$(shell ls $(FLATPAK_REMOTE_REFS_DIR)/*),$(shell cat $(file)))
|
||||||
|
FLATPAK_REMOTE_REFS += $(sort $(COLLECTED_REFS))
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(FLATPAK_REMOTE_REFS),)
|
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)
|
||||||
|
|
@ -166,6 +172,8 @@ repos/%.repo: /etc/yum.repos.d/%.repo
|
||||||
# Don't do anything for custom repos
|
# Don't do anything for custom repos
|
||||||
%.repo:
|
%.repo:
|
||||||
|
|
||||||
|
flatpak_list:
|
||||||
|
|
||||||
# Step 3: Build boot.iso using Lorax
|
# Step 3: Build boot.iso using Lorax
|
||||||
boot.iso: lorax_repo $(filter lorax_templates/%,$(_LORAX_TEMPLATES)) $(_REPO_FILES)
|
boot.iso: lorax_repo $(filter lorax_templates/%,$(_LORAX_TEMPLATES)) $(_REPO_FILES)
|
||||||
rm -Rf $(_BASE_DIR)/results || true
|
rm -Rf $(_BASE_DIR)/results || true
|
||||||
|
|
@ -239,12 +247,23 @@ test-iso:
|
||||||
sudo mount -o loop deploy.iso /mnt/iso
|
sudo mount -o loop deploy.iso /mnt/iso
|
||||||
sudo mount -t squashfs -o loop /mnt/iso/images/install.img /mnt/install
|
sudo mount -t squashfs -o loop /mnt/iso/images/install.img /mnt/install
|
||||||
|
|
||||||
chmod +x $(foreach test,$(_TESTS),tests/iso/$(test))
|
# install tests
|
||||||
|
chmod +x $(foreach test,$(filter install_%,$(_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
|
||||||
|
|
||||||
|
# flapak tests
|
||||||
|
if [ -n "$(FLATPAK_REMOTE_REFS)" ]; \
|
||||||
|
then \
|
||||||
|
chmod +x $(foreach test,$(filter flatpak_%,$(_TESTS)),tests/iso/$(test)); \
|
||||||
|
for test in $(_TESTS); \
|
||||||
|
do \
|
||||||
|
$(foreach var,$(_VARS),$(var)=$($(var))) ./tests/iso/$${test}; \
|
||||||
|
done; \
|
||||||
|
fi
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
sudo umount /mnt/install
|
sudo umount /mnt/install
|
||||||
sudo umount /mnt/iso
|
sudo umount /mnt/iso
|
||||||
|
|
@ -254,4 +273,4 @@ test-vm:
|
||||||
chmod +x $(foreach test,$(_TESTS),tests/vm/$(test))
|
chmod +x $(foreach test,$(_TESTS),tests/vm/$(test))
|
||||||
for test in $(_TESTS); do ./tests/vm/$${test} deploy.iso; done
|
for test in $(_TESTS); do ./tests/vm/$${test} deploy.iso; done
|
||||||
|
|
||||||
.PHONY: clean install-deps test test-iso test-vm lorax_repo
|
.PHONY: clean install-deps test test-iso test-vm lorax_repo flatpak_list
|
||||||
|
|
|
||||||
32
README.md
32
README.md
|
|
@ -38,20 +38,24 @@ See [Customizing](#customizing) for information about customizing the ISO that g
|
||||||
The following variables can be used to customize the created ISO.
|
The following variables can be used to customize the created ISO.
|
||||||
|
|
||||||
### Inputs
|
### Inputs
|
||||||
| Variable | Description | Default Value |
|
| Variable | Description | Default Value |
|
||||||
| -------------------- | ---------------------------------------------------------------------------- | ------------------------------ |
|
| ---------------------- | ---------------------------------------------------------------------------- | -------------------------------------------- |
|
||||||
| additional_templates | Space delimited list of additional Lorax templates to include | \[empty\] |
|
| additional_templates | Space delimited list of additional Lorax templates to include | \[empty\] |
|
||||||
| arch | Architecture for image to build | x86_64 |
|
| arch | Architecture for image to build | x86_64 |
|
||||||
| enrollment_password | Used for supporting secure boot (requires SECURE_BOOT_KEY_URL to be defined) | container-installer |
|
| enrollment_password | Used for supporting secure boot (requires SECURE_BOOT_KEY_URL to be defined) | container-installer |
|
||||||
| extra_boot_params | Extra params used by grub to boot the anaconda installer | \[empty\] |
|
| extra_boot_params | Extra params used by grub to boot the anaconda installer | \[empty\] |
|
||||||
| image_name | Name of the source container image | base |
|
| flatpak_remote_name | Name of the Flatpak repo on the destination OS | flathub |
|
||||||
| image_repo | Repository containing the source container image | quay.io/fedora-ostree-desktops |
|
| flatpak_remote_refs | Space separated list of flatpak refs to install | \[empty\] |
|
||||||
| image_tag | Tag of the source container image | *VERSION* |
|
| flatpak_remote_refs_dir | Directory that contains files that list the flatpak refs to install | \[empty\] |
|
||||||
| iso_name | Name of the ISO you wish to output when completed | build/deploy.iso |
|
| flatpak_remote_url | URL of the flatpakrepo file | https://flathub.org/repo/flathub.flatpakrepo |
|
||||||
| secure_boot_key_url | Secure boot key that is installed from URL location\*\* | \[empty\] |
|
| image_name | Name of the source container image | base |
|
||||||
| variant | Source container variant\* | Server |
|
| image_repo | Repository containing the source container image | quay.io/fedora-ostree-desktops |
|
||||||
| version | Fedora version of installer to build | 39 |
|
| image_tag | Tag of the source container image | *VERSION* |
|
||||||
| web_ui | Enable Anaconda WebUI (experimental) | false |
|
| iso_name | Name of the ISO you wish to output when completed | build/deploy.iso |
|
||||||
|
| secure_boot_key_url | Secure boot key that is installed from URL location\*\* | \[empty\] |
|
||||||
|
| variant | Source container variant\* | Server |
|
||||||
|
| version | Fedora version of installer to build | 39 |
|
||||||
|
| web_ui | Enable Anaconda WebUI (experimental) | false |
|
||||||
|
|
||||||
\*Available options for VARIANT can be found by running `dnf provides system-release`.
|
\*Available options for VARIANT can be found by running `dnf provides system-release`.
|
||||||
Variant will be the third item in the package name. Example: `fedora-release-kinoite-39-34.noarch` will be kinoite
|
Variant will be the third item in the package name. Example: `fedora-release-kinoite-39-34.noarch` will be kinoite
|
||||||
|
|
|
||||||
29
action.yml
29
action.yml
|
|
@ -39,6 +39,10 @@ inputs:
|
||||||
description: Space delimited list of refs to the flatpak packages to install
|
description: Space delimited list of refs to the flatpak packages to install
|
||||||
required: false
|
required: false
|
||||||
default: ""
|
default: ""
|
||||||
|
flatpak_remote_refs_dir:
|
||||||
|
description: Directory that contains files that list the flatpak refs to install
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
flatpak_remote_url:
|
flatpak_remote_url:
|
||||||
description: The URL of the Flatpak remote flatpakrepo file
|
description: The URL of the Flatpak remote flatpakrepo file
|
||||||
required: false
|
required: false
|
||||||
|
|
@ -152,19 +156,20 @@ runs:
|
||||||
fi
|
fi
|
||||||
docker run --privileged --volume ${{ github.workspace }}:/github/workspace/ ${cache} ghcr.io/jasonn3/build-container-installer:${tag} \
|
docker run --privileged --volume ${{ github.workspace }}:/github/workspace/ ${cache} ghcr.io/jasonn3/build-container-installer:${tag} \
|
||||||
ADDITIONAL_TEMPLATES="${{ inputs.additional_templates }}" \
|
ADDITIONAL_TEMPLATES="${{ inputs.additional_templates }}" \
|
||||||
ARCH=${{ inputs.arch }} \
|
ARCH="${{ inputs.arch }}" \
|
||||||
DNF_CACHE=/cache/dnf \
|
DNF_CACHE="/cache/dnf" \
|
||||||
ENROLLMENT_PASSWORD=${{ inputs.enrollment_password }} \
|
ENROLLMENT_PASSWORD="${{ inputs.enrollment_password }}" \
|
||||||
FLATPAK_REMOTE_NAME=${{ inputs.flatpak_remote_name }} \
|
FLATPAK_REMOTE_NAME="${{ inputs.flatpak_remote_name }}" \
|
||||||
FLATPAK_REMOTE_REFS="${{ inputs.flatpak_remote_refs }}" \
|
FLATPAK_REMOTE_REFS="${{ inputs.flatpak_remote_refs }}" \
|
||||||
FLATPAK_REMOTE_URL=${{ inputs.flatpak_remote_url }} \
|
FLATPAK_REMOTE_REFS_DIR="${{ inputs.flatpak_remote_refs_dir }}" \
|
||||||
IMAGE_NAME=${{ inputs.image_name }} \
|
FLATPAK_REMOTE_URL="${{ inputs.flatpak_remote_url }}" \
|
||||||
IMAGE_REPO=${{ inputs.image_repo }} \
|
IMAGE_NAME="${{ inputs.image_name }}" \
|
||||||
IMAGE_TAG=${{ inputs.image_tag || inputs.version }} \
|
IMAGE_REPO="${{ inputs.image_repo }}" \
|
||||||
SECURE_BOOT_KEY_URL=${{ inputs.secure_boot_key_url }} \
|
IMAGE_TAG="${{ inputs.image_tag || inputs.version }}" \
|
||||||
VARIANT=${{ inputs.variant }} \
|
SECURE_BOOT_KEY_URL="${{ inputs.secure_boot_key_url }}" \
|
||||||
VERSION=${{ inputs.version }} \
|
VARIANT="${{ inputs.variant }}" \
|
||||||
WEB_UI=${{ inputs.web_ui }}
|
VERSION="${{ inputs.version }}" \
|
||||||
|
WEB_UI="${{ inputs.web_ui }}"
|
||||||
|
|
||||||
- name: Save dnf cache
|
- name: Save dnf cache
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
2
flatpak_refs/VLC
Normal file
2
flatpak_refs/VLC
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
app/org.videolan.VLC/x86_64/stable
|
||||||
|
runtime/org.kde.Platform/x86_64/5.15-23.08
|
||||||
|
|
@ -5,3 +5,7 @@ append etc/anaconda/conf.d/anaconda.conf "flatpak_remote = ${flatpak_remote_name
|
||||||
replace "flatpak_manager\.add_remote\(\".*\", \".*\"\)" "flatpak_manager.add_remote(\"${flatpak_remote_name}\", \"${_flatpak_repo_url}\")" /usr/lib64/python*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree/flatpak_installation.py
|
replace "flatpak_manager\.add_remote\(\".*\", \".*\"\)" "flatpak_manager.add_remote(\"${flatpak_remote_name}\", \"${_flatpak_repo_url}\")" /usr/lib64/python*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree/flatpak_installation.py
|
||||||
replace "flatpak_manager\.replace_installed_refs_remote\(\".*\"\)" "flatpak_manager.replace_installed_refs_remote(\"${flatpak_remote_name}\")" /usr/lib64/python*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree/flatpak_installation.py
|
replace "flatpak_manager\.replace_installed_refs_remote\(\".*\"\)" "flatpak_manager.replace_installed_refs_remote(\"${flatpak_remote_name}\")" /usr/lib64/python*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree/flatpak_installation.py
|
||||||
% endif
|
% endif
|
||||||
|
|
||||||
|
%if flatpak_remote_name != 'fedora'
|
||||||
|
systemctl disable flatpak-add-fedora-repos.service
|
||||||
|
% endif
|
||||||
Loading…
Add table
Add a link
Reference in a new issue