├── .codacy
└── markdownlint.rb
├── .devcontainer
└── devcontainer.json
├── .dockerignore
├── .github
├── CODEOWNERS
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── dependabot.yml
├── release.yml
└── workflows
│ ├── bot_commands.yml
│ ├── build_container.yml
│ ├── build_iso.yml
│ ├── build_vars.yml
│ ├── clean_repo.yml
│ ├── stale.yml
│ ├── test_deployment.yml
│ ├── test_iso.yml
│ ├── test_repo.yml
│ ├── tests.yml
│ └── update_wiki.yml
├── .gitignore
├── .gitmodules
├── .mdlrc
├── .vscode
└── settings.json
├── Containerfile
├── LICENSE
├── Makefile
├── Makefile.inputs
├── README.md
├── action.yml
├── container
└── Makefile
├── cosign.pub
├── docs
├── Makefile
├── README.md
├── _Sidebar.md
├── development
│ ├── container.md
│ ├── makefile.md
│ └── vscode.md
├── examples
│ └── adding-flatpaks.md
├── home.md
├── known_errors.md
└── usage.md
├── entrypoint.sh
├── external
└── Makefile
├── flatpak_refs
├── Firefox
└── VLC
├── flatpaks
└── Makefile
├── lorax_templates
├── Makefile
├── cache_copy_dnf.tmpl
├── flatpak_link.tmpl
├── flatpak_set_repo.tmpl
├── install_set_installer.tmpl
└── scripts
│ └── post
│ ├── flatpak_configure
│ ├── install_configure_upgrades
│ └── secureboot_enroll_key
├── repos
└── Makefile
├── test
├── Makefile
├── iso
│ ├── Makefile
│ ├── README.md
│ ├── flatpak_repo_updated.sh
│ ├── install_hash.sh
│ └── install_os-release.sh
├── repo
│ ├── Makefile
│ └── vars.py
└── vm
│ ├── Makefile
│ ├── README.md
│ ├── files
│ └── ks.cfg
│ ├── flatpak_fedora_repo_disabled.yml
│ ├── flatpak_installed.yml
│ ├── flatpak_update.yml
│ └── install_image_source.yml
└── xorriso
├── Makefile
└── gen_input.sh
/.codacy/markdownlint.rb:
--------------------------------------------------------------------------------
1 | all
2 | rule 'MD033', :allowed_elements => ["a","img","picture","source"]
--------------------------------------------------------------------------------
/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2 | // README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
3 | {
4 | "name": "Existing Dockerfile",
5 | // "build": {
6 | // "context": "..",
7 | // "dockerfile": "../Containerfile",
8 | // "args": {
9 | // "version": "39"
10 | // }
11 | // },
12 | "image": "ghcr.io/jasonn3/build-container-installer:latest",
13 | "overrideCommand": true,
14 | "shutdownAction": "stopContainer",
15 | "privileged": true
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/.dockerignore:
--------------------------------------------------------------------------------
1 | .devcontainer
2 | .github
3 | .gitignore
4 | action.yml
5 | Containerfile
6 |
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # Default owner of code within this repo
2 | * @JasonN3
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: "[BUG] What is not working"
5 | labels: bug, help wanted
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 |
16 | 1. Go to '...'
17 | 2. Click on '....'
18 | 3. Scroll down to '....'
19 | 4. See error
20 |
21 | **Expected behavior**
22 | A clear and concise description of what you expected to happen.
23 |
24 | **Screenshots**
25 | If applicable, add screenshots to help explain your problem.
26 |
27 | **Desktop (please complete the following information):**
28 |
29 | - OS: [e.g. iOS]
30 | - Version [e.g. 22]
31 |
32 | **Additional context**
33 | Add any other context about the problem here.
34 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: "[FR] What would you like it to do"
5 | labels: enhancement, help wanted
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5 |
6 | version: 2
7 | updates:
8 | - package-ecosystem: "github-actions" # See documentation for possible values
9 | directory: "/" # Location of package manifests
10 | schedule:
11 | interval: "daily"
12 | - package-ecosystem: "github-actions" # See documentation for possible values
13 | directory: "/external" # Location of package manifests
14 | schedule:
15 | interval: "daily"
16 | ignore:
17 | - dependency-name: "lorax"
18 |
--------------------------------------------------------------------------------
/.github/release.yml:
--------------------------------------------------------------------------------
1 | changelog:
2 | exclude:
3 | labels:
4 | - ignore-for-release
5 | categories:
6 | - title: "Breaking Changes :boom:"
7 | labels:
8 | - breaking-change
9 | - title: "New Features :sparkles:"
10 | labels:
11 | - enhancement
12 | - title: "Bug Fixes :bug:"
13 | labels:
14 | - bug
15 | - title: Other Changes
16 | labels:
17 | - "*"
18 |
--------------------------------------------------------------------------------
/.github/workflows/bot_commands.yml:
--------------------------------------------------------------------------------
1 | name: Bot commands
2 | on: issue_comment
3 |
4 | jobs:
5 | permissions:
6 | name: Check Permissions
7 | runs-on: ubuntu-latest
8 | steps:
9 | - name: Check association
10 | run: |
11 | allowed=("OWNER" "COLLABORATOR")
12 | value="\<${{ github.event.issue.author_association }}\>"
13 |
14 | if [[ ${allowed[@]} =~ $value ]]
15 | then
16 | exit 0
17 | else
18 | exit 1
19 | fi
20 |
21 | load_vars:
22 | uses: ./.github/workflows/build_vars.yml
23 |
24 | run-all_tests:
25 | name: Run All Tests
26 | if: >
27 | github.event.issue.pull_request &&
28 | contains(github.event.comment.body, '/run tests')
29 | permissions:
30 | contents: read
31 | packages: write
32 | statuses: write
33 | needs:
34 | - permissions
35 | uses: ./.github/workflows/tests.yml
36 | with:
37 | pr: ${{ github.event.issue.number }}
38 | parent_job_name: Run All Tests
39 |
40 | run_build_container:
41 | name: Run Build Container
42 | if: >
43 | github.event.issue.pull_request &&
44 | contains(github.event.comment.body, '/run build container')
45 | permissions:
46 | contents: read
47 | packages: write
48 | statuses: write
49 | needs:
50 | - permissions
51 | uses: ./.github/workflows/build_container.yml
52 | with:
53 | pr: ${{ github.event.issue.number }}
54 | parent_job_name: Run Build Container
55 |
56 | run_build_iso:
57 | name: Run Build ISO
58 | if: >
59 | github.event.issue.pull_request &&
60 | contains(github.event.comment.body, '/run build iso')
61 | permissions:
62 | contents: read
63 | packages: write
64 | statuses: write
65 | needs:
66 | - permissions
67 | uses: ./.github/workflows/build_iso.yml
68 | with:
69 | pr: ${{ github.event.issue.number }}
70 | parent_job_name: Run Build ISO
71 |
72 | run_test_iso:
73 | name: Run ISO Tests
74 | if: >
75 | github.event.issue.pull_request &&
76 | contains(github.event.comment.body, '/run test iso')
77 | permissions:
78 | contents: read
79 | packages: write
80 | statuses: write
81 | needs:
82 | - permissions
83 | - load_vars
84 | uses: ./.github/workflows/test_iso.yml
85 | with:
86 | pr: ${{ github.event.issue.number }}
87 | parent_job_name: Run ISO Tests
88 |
89 | run_test_deployment:
90 | name: Run ISO Deployment Tests
91 | if: >
92 | github.event.issue.pull_request &&
93 | contains(github.event.comment.body, '/run test iso')
94 | permissions:
95 | contents: read
96 | packages: write
97 | statuses: write
98 | needs:
99 | - permissions
100 | - load_vars
101 | - run_test_iso
102 | uses: ./.github/workflows/test_deployment.yml
103 | with:
104 | pr: ${{ github.event.issue.number }}
105 | parent_job_name: Run ISO Deployment Tests
106 |
--------------------------------------------------------------------------------
/.github/workflows/build_container.yml:
--------------------------------------------------------------------------------
1 | name: Build Container
2 |
3 | on:
4 | workflow_call:
5 | inputs:
6 | pr:
7 | required: false
8 | type: string
9 | parent_job_name:
10 | required: true
11 | type: string
12 |
13 | jobs:
14 | build-container:
15 | if: >
16 | github.event_name == 'push' ||
17 | github.event_name == 'issue_comment' ||
18 | github.event_name == 'workflow_dispatch'
19 | name: Build Container Image
20 | env:
21 | JOB_NAME: Build Container Image
22 | runs-on: ubuntu-latest
23 | permissions:
24 | contents: read
25 | packages: write
26 | statuses: write
27 | steps:
28 | - name: Checkout
29 | uses: actions/checkout@v4
30 | with:
31 | submodules: recursive
32 | fetch-depth: 0
33 | fetch-tags: 'true'
34 |
35 | - name: Switch branch
36 | if: inputs.pr
37 | env:
38 | GITHUB_USER: ${{ github.actor }}
39 | GITHUB_TOKEN: ${{ github.token }}
40 | run: |
41 | sudo apt-get update
42 | sudo apt-get install -y hub
43 | hub pr checkout ${{ inputs.pr }}
44 | echo "sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
45 |
46 | - name: Get Current Job Log URL
47 | if: inputs.pr && always()
48 | uses: Tiryoh/gha-jobid-action@v1
49 | id: jobs
50 | with:
51 | github_token: ${{ secrets.GITHUB_TOKEN }}
52 | job_name: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }}"
53 | per_page: 100
54 |
55 | - name: Set status
56 | if: inputs.pr && always()
57 | uses: myrotvorets/set-commit-status-action@v2.0.1
58 | with:
59 | token: ${{ secrets.GITHUB_TOKEN }}
60 | status: pending
61 | context: ${{ env.JOB_NAME }}
62 | sha: ${{ env.sha }}
63 | targetUrl: ${{ steps.jobs.outputs.html_url }}
64 |
65 | - name: Docker meta
66 | if: inputs.pr == ''
67 | id: meta
68 | uses: docker/metadata-action@v5
69 | with:
70 | images: |
71 | ghcr.io/${{ github.repository }}
72 | tags: |
73 | type=ref,event=branch
74 | type=ref,event=pr
75 | type=raw,value=${{ github.sha }}
76 | type=semver,pattern=v{{version}}
77 | type=semver,pattern=v{{major}}.{{minor}}
78 | type=semver,pattern=v{{major}}.{{minor}}.{{patch}}
79 |
80 | - name: Docker meta for PR
81 | if: inputs.pr
82 | id: meta_pr
83 | uses: docker/metadata-action@v5
84 | with:
85 | images: |
86 | ghcr.io/${{ github.repository }}
87 | tags: |
88 | pr-${{ inputs.pr }}
89 | ${{ github.sha }}
90 |
91 | - name: Buildah Build
92 | id: build-image
93 | uses: redhat-actions/buildah-build@v2
94 | with:
95 | containerfiles: Containerfile
96 | tags: ${{ steps.meta.outputs.tags || steps.meta_pr.outputs.tags }}
97 | labels: ${{ steps.meta.outputs.labels || steps.meta_pr.outputs.labels }}
98 |
99 | - name: Login to GitHub Container Registry
100 | uses: docker/login-action@v3.4.0
101 | with:
102 | registry: ghcr.io
103 | username: ${{ github.actor }}
104 | password: ${{ secrets.GITHUB_TOKEN }}
105 |
106 | - name: Push image
107 | uses: redhat-actions/push-to-registry@v2
108 | with:
109 | image: ${{ steps.build-image.outputs.image }}
110 | tags: ${{ steps.build-image.outputs.tags }}
111 | username: ${{ github.actor }}
112 | password: ${{ github.token }}
113 |
114 | - name: Set status
115 | if: inputs.pr && always()
116 | uses: myrotvorets/set-commit-status-action@v2.0.1
117 | with:
118 | token: ${{ secrets.GITHUB_TOKEN }}
119 | status: ${{ job.status }}
120 | context: ${{ env.JOB_NAME }}
121 | sha: ${{ env.sha }}
122 | targetUrl: ${{ steps.jobs.outputs.html_url }}
123 |
124 | - name: Install Cosign
125 | if: startsWith(github.ref, 'refs/tags/v')
126 | uses: sigstore/cosign-installer@v3.8.2
127 |
128 | - name: Sign the images
129 | if: startsWith(github.ref, 'refs/tags/v')
130 | env:
131 | TAGS: ${{ steps.build-image.outputs.tags }}
132 | COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
133 | COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
134 | run: |
135 | images=""
136 | digest=""
137 | for tag in ${TAGS}; do
138 | if [[ -z "${digest}" ]]
139 | then
140 | digest=$(cat $(echo ${tag} | tr '/:' '--')_digest.txt)
141 | fi
142 | images+="${tag}@${digest} "
143 | done
144 | cosign sign --key env://COSIGN_PRIVATE_KEY --yes ${images}
145 |
--------------------------------------------------------------------------------
/.github/workflows/build_iso.yml:
--------------------------------------------------------------------------------
1 | name: Build ISO
2 |
3 | on:
4 | workflow_call:
5 | inputs:
6 | pr:
7 | required: false
8 | type: string
9 | parent_job_name:
10 | required: true
11 | type: string
12 |
13 | jobs:
14 | load_vars:
15 | name: Load Variables
16 | uses: ./.github/workflows/build_vars.yml
17 |
18 | build_iso:
19 | name: Build ISO
20 | env:
21 | JOB_NAME: Build ISO
22 | runs-on: ubuntu-latest
23 | needs:
24 | - load_vars
25 | permissions:
26 | contents: read
27 | packages: write
28 | statuses: write
29 | continue-on-error: false
30 | strategy:
31 | fail-fast: false
32 | matrix: ${{ fromJson(needs.load_vars.outputs.BUILD_MATRIX) }}
33 | steps:
34 | - name: Checkout
35 | uses: actions/checkout@v4
36 | with:
37 | submodules: recursive
38 |
39 | - name: Switch branch
40 | if: inputs.pr
41 | env:
42 | GITHUB_USER: ${{ github.actor }}
43 | GITHUB_TOKEN: ${{ github.token }}
44 | run: |
45 | sudo apt-get update
46 | sudo apt-get install -y hub
47 | hub pr checkout ${{ inputs.pr }}
48 | echo "sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
49 |
50 | - name: Get Current Job Log URL
51 | if: inputs.pr && always()
52 | uses: Tiryoh/gha-jobid-action@v1
53 | id: jobs
54 | with:
55 | github_token: ${{ secrets.GITHUB_TOKEN }}
56 | job_name: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }}, ${{ matrix.flatpaks }}, ${{ matrix.image_repo }}, ${{ matrix.image_name }})"
57 | per_page: 100
58 |
59 | - name: Set status
60 | if: inputs.pr && always()
61 | uses: myrotvorets/set-commit-status-action@v2.0.1
62 | with:
63 | token: ${{ secrets.GITHUB_TOKEN }}
64 | status: pending
65 | context: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }}, ${{ matrix.flatpaks }}, ${{ matrix.image_repo }}, ${{ matrix.image_name }})"
66 | sha: ${{ env.sha }}
67 | targetUrl: ${{ steps.jobs.outputs.html_url }}
68 |
69 | - name: Free Disk Space (Ubuntu)
70 | uses: jlumbroso/free-disk-space@main
71 | with:
72 | # this might remove tools that are actually needed,
73 | # if set to "true" but frees about 6 GB
74 | tool-cache: false
75 |
76 | # all of these default to true, but feel free to set to
77 | # "false" if necessary for your workflow
78 | android: true
79 | dotnet: true
80 | haskell: true
81 | large-packages: true
82 | docker-images: true
83 | swap-storage: true
84 |
85 | - name: Lowercase Registry
86 | id: registry_case
87 | uses: ASzc/change-string-case-action@v6
88 | with:
89 | string: ${{ needs.load_vars.outputs.IMAGE_REPO }}
90 |
91 | - name: Get image version
92 | id: meta
93 | uses: docker/metadata-action@v5
94 | with:
95 | tags: |
96 | type=ref,event=branch
97 | type=ref,event=pr
98 |
99 | - name: Login to Registry
100 | run: |
101 | echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
102 |
103 | - name: Build ISO
104 | uses: ./
105 | id: build
106 | with:
107 | arch: ${{ needs.load_vars.outputs.ARCH }}
108 | image_name: ${{ matrix.image_name }}
109 | image_repo: ${{ matrix.image_repo}}
110 | image_src: ${{ matrix.image_src }}
111 | image_tag: ${{ matrix.version }}
112 | version: ${{ matrix.version }}
113 | repos: ${{ matrix.repos }}
114 | variant: ${{ needs.load_vars.outputs.VARIANT }}
115 | flatpak_remote_refs: ${{ matrix.flatpaks == 'flatpak_refs' && needs.load_vars.outputs.FLATPAK_REMOTE_REFS || '' }}
116 | flatpak_remote_refs_dir: ${{ matrix.flatpaks == 'flatpak_refs_dir' && needs.load_vars.outputs.FLATPAK_REMOTE_REFS_DIR || '' }}
117 | secure_boot_key_url: ${{ needs.load_vars.outputs.SECURE_BOOT_KEY_URL }}
118 | enrollment_password: ${{ needs.load_vars.outputs.ENROLLMENT_PASSWORD }}
119 | iso_name: build/${{ matrix.image_name }}-${{ matrix.version }}${{ matrix.flatpaks == 'false' && '' || format('-{0}', matrix.flatpaks) }}.iso
120 |
121 | - name: Upload ISO as artifact
122 | if: matrix.version != 'fake'
123 | id: upload
124 | uses: actions/upload-artifact@v4
125 | with:
126 | name: ${{ matrix.image_name }}-${{ matrix.version }}${{ matrix.flatpaks == 'false' && '' || format('-{0}', matrix.flatpaks) }}
127 | path: |
128 | build/${{ matrix.image_name }}-${{ matrix.version }}${{ matrix.flatpaks == 'false' && '' || format('-{0}', matrix.flatpaks) }}.iso
129 | build/${{ matrix.image_name }}-${{ matrix.version }}${{ matrix.flatpaks == 'false' && '' || format('-{0}', matrix.flatpaks) }}.iso-CHECKSUM
130 | if-no-files-found: error
131 | retention-days: 0
132 | compression-level: 0
133 | overwrite: true
134 |
135 | - name: Set status
136 | if: inputs.pr && always()
137 | uses: myrotvorets/set-commit-status-action@v2.0.1
138 | with:
139 | token: ${{ secrets.GITHUB_TOKEN }}
140 | status: ${{ job.status }}
141 | context: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }}, ${{ matrix.flatpaks }}, ${{ matrix.image_repo }}, ${{ matrix.image_name }})"
142 | sha: ${{ env.sha }}
143 | targetUrl: ${{ steps.jobs.outputs.html_url }}
144 |
145 |
--------------------------------------------------------------------------------
/.github/workflows/build_vars.yml:
--------------------------------------------------------------------------------
1 | name: Build Vars
2 |
3 | on:
4 | workflow_call:
5 | outputs:
6 | ARCH:
7 | value: 'x86_64'
8 | BUILD_MATRIX:
9 | value: '
10 | {
11 | "version": [
12 | "40",
13 | "41",
14 | "42"
15 | ],
16 | "flatpaks": [
17 | "false",
18 | "flatpak_refs_dir",
19 | "flatpak_refs"
20 | ],
21 | "image_repo": [
22 | "ghcr.io/ublue-os",
23 | "quay.io/fedora",
24 | "quay.io/fedora-ostree-desktops"
25 | ],
26 | "include": [
27 | {
28 | "image_repo": "ghcr.io/ublue-os",
29 | "image_name": "base-main",
30 | },
31 | {
32 | "image_repo": "quay.io/fedora",
33 | "image_name": "fedora-bootc"
34 | },
35 | {
36 | "image_repo": "quay.io/fedora-ostree-desktops",
37 | "image_name": "base-atomic"
38 | }
39 | ],
40 | "exclude": [
41 | {
42 | "image_repo": "quay.io/fedora",
43 | "flatpaks": "flatpak_refs_dir"
44 | },
45 | {
46 | "image_repo": "quay.io/fedora",
47 | "flatpaks": "flatpak_refs"
48 | },
49 | {
50 | "image_repo": "quay.io/fedora-ostree-desktops",
51 | "flatpaks": "flatpak_refs_dir"
52 | },
53 | {
54 | "image_repo": "quay.io/fedora-ostree-desktops",
55 | "flatpaks": "flatpak_refs"
56 | },
57 | {
58 | "image_repo": "quay.io/fedora-ostree-desktops",
59 | "version": "40"
60 | }
61 | ]
62 | }'
63 | VARIANT:
64 | value: 'Server'
65 | FLATPAK_REMOTE_REFS_DIR:
66 | value: flatpak_refs
67 | FLATPAK_REMOTE_REFS:
68 | value: "app/org.mozilla.firefox/x86_64/stable app/org.videolan.VLC/x86_64/stable"
69 | SECURE_BOOT_KEY_URL:
70 | value: 'https://github.com/ublue-os/akmods/raw/main/certs/public_key.der'
71 | ENROLLMENT_PASSWORD:
72 | value: 'container-installer'
73 |
74 |
75 | jobs:
76 | load-vars:
77 | name: Load Variables
78 | runs-on: ubuntu-latest
79 | steps:
80 | - name: Sucess
81 | run:
82 | echo "Vars loaded"
83 |
--------------------------------------------------------------------------------
/.github/workflows/clean_repo.yml:
--------------------------------------------------------------------------------
1 | name: Clean Container Registry
2 | on:
3 | # schedule:
4 | # - cron: '0 21 * * 0'
5 |
6 | workflow_dispatch:
7 |
8 | jobs:
9 | delete_untagged:
10 | name: Delete Untagged Packages
11 | runs-on: ubuntu-latest
12 | steps:
13 | - name: Delete Untagged Packages
14 | uses: Chizkiyahu/delete-untagged-ghcr-action@v5
15 | with:
16 | token: ${{ secrets.PACKAGE_DELETER }}
17 | repository_owner: ${{ github.repository_owner }}
18 | repository: ${{ github.repository }}
19 | untagged_only: true
20 | owner_type: user
21 |
22 | delete_old_pr:
23 | name: Delete Old PR Packages
24 | runs-on: ubuntu-latest
25 | permissions:
26 | packages: read
27 | steps:
28 | - name: Delete Old PR Packages
29 | id: all_tags
30 | run: |
31 | curl -L \
32 | -H "Accept: application/vnd.github+json" \
33 | -H "Authorization: Bearer ${{ github.token }}" \
34 | -H "X-GitHub-Api-Version: 2022-11-28" \
35 | "https://api.github.com/user/packages/container/build-container-installer/versions" > all_packages.json
36 | curl -L \
37 | -H "Accept: application/vnd.github+json" \
38 | -H "Authorization: Bearer ${{ github.token }}" \
39 | -H "X-GitHub-Api-Version: 2022-11-28" \
40 | https://api.github.com/repos/${{ github.repository }}/pulls | \
41 | jq -r '.[] | select(.state == "open") | .number' | \
42 | sed 's/^/pr-/g' > open_prs
43 | cat << EOF | python
44 | import json
45 | import re
46 |
47 | prs = open("open_prs", "r")
48 | open_prs = prs.readlines()
49 | open_prs = [x.strip() for x in open_prs]
50 |
51 | all_packages = open('all_packages.json')
52 | data = json.load(all_packages)
53 |
54 | delete_versions = open("delete_versions", "w")
55 |
56 | for i in data:
57 | delete = True
58 | for tag in i['metadata']['container']['tags']:
59 | if not re.match('pr-.*', tag):
60 | delete = False
61 | continue
62 | if tag in open_prs:
63 | delete = False
64 | if delete:
65 | print("delete", i['id'])
66 | delete_versions.write(str(i['id']))
67 | delete_versions.write("\n")
68 | print(i['metadata']['container']['tags'])
69 | EOF
70 |
71 | for id in $(cat delete_versions)
72 | do
73 | curl -L \
74 | -X DELETE \
75 | -H "Accept: application/vnd.github+json" \
76 | -H "Authorization: Bearer ${{ secrets.PACKAGE_DELETER }}" \
77 | -H "X-GitHub-Api-Version: 2022-11-28" \
78 | https://api.github.com/user/packages/container/build-container-installer/versions/${id}
79 | done
80 |
81 |
82 | delete_old_branches:
83 | name: Delete Old Branch Packages
84 | runs-on: ubuntu-latest
85 | permissions:
86 | packages: read
87 | steps:
88 | - name: Delete Old Branch Packages
89 | run: |
90 | curl -L \
91 | -H "Accept: application/vnd.github+json" \
92 | -H "Authorization: Bearer ${{ github.token }}" \
93 | -H "X-GitHub-Api-Version: 2022-11-28" \
94 | "https://api.github.com/user/packages/container/build-container-installer/versions" > all_packages.json
95 | curl -L \
96 | -H "Accept: application/vnd.github+json" \
97 | -H "Authorization: Bearer ${{ github.token }}" \
98 | -H "X-GitHub-Api-Version: 2022-11-28" \
99 | https://api.github.com/repos/${{ github.repository }}/branches | jq -r '.[].name' > branches
100 |
101 | cat << EOF | python
102 | import json
103 | import re
104 |
105 | branches_f = open("branches", "r")
106 | branches = branches_f.readlines()
107 | branches = [x.strip() for x in branches]
108 |
109 | all_packages_f = open('all_packages.json')
110 | data = json.load(all_packages_f)
111 |
112 | delete_versions = open("delete_versions", "w")
113 |
114 | for i in data:
115 | delete = True
116 | for tag in i['metadata']['container']['tags']:
117 | if re.match('v[0-9]+\\\.[0-9]+\\\.[0-9]+', tag):
118 | delete = False
119 | continue
120 | if re.match('pr-.*', tag):
121 | delete = False
122 | continue
123 | if tag in branches:
124 | delete = False
125 | continue
126 | if tag == "latest":
127 | delete = False
128 | if delete:
129 | print("delete", i['id'])
130 | delete_versions.write(str(i['id']))
131 | delete_versions.write("\n")
132 | print(i['metadata']['container']['tags'])
133 | EOF
134 |
135 | for id in $(cat delete_versions)
136 | do
137 | curl -L \
138 | -X DELETE \
139 | -H "Accept: application/vnd.github+json" \
140 | -H "Authorization: Bearer ${{ secrets.PACKAGE_DELETER }}" \
141 | -H "X-GitHub-Api-Version: 2022-11-28" \
142 | https://api.github.com/user/packages/container/build-container-installer/versions/${id}
143 | done
144 |
--------------------------------------------------------------------------------
/.github/workflows/stale.yml:
--------------------------------------------------------------------------------
1 | # This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
2 | #
3 | # You can adjust the behavior by modifying this file.
4 | # For more information, see:
5 | # https://github.com/actions/stale
6 | name: Mark stale issues and pull requests
7 |
8 | on:
9 | schedule:
10 | - cron: '0 21 * * *'
11 |
12 | jobs:
13 | stale:
14 |
15 | runs-on: ubuntu-latest
16 | permissions:
17 | issues: write
18 | pull-requests: write
19 |
20 | steps:
21 | - uses: actions/stale@v9
22 | with:
23 | repo-token: ${{ secrets.GITHUB_TOKEN }}
24 | stale-issue-message: 'Issue is stale and will be closed in 14 days if there is no further activity'
25 | stale-pr-message: 'Pull request is stale and will be closed in 14 days if there is no further activity'
26 | stale-issue-label: 'no-issue-activity'
27 | stale-pr-label: 'no-pr-activity'
28 | days-before-stale: 60
29 | days-before-close: 17
30 | remove-stale-when-updated: true
31 | only-issue-labels: help wanted
32 |
33 |
--------------------------------------------------------------------------------
/.github/workflows/test_deployment.yml:
--------------------------------------------------------------------------------
1 | name: Test Deployment
2 |
3 | on:
4 | workflow_call:
5 | inputs:
6 | pr:
7 | required: true
8 | type: string
9 | parent_job_name:
10 | required: true
11 | type: string
12 |
13 | jobs:
14 | load_vars:
15 | name: Load Variables
16 | uses: ./.github/workflows/build_vars.yml
17 |
18 | test-deployment:
19 | name: Test deployment
20 | env:
21 | JOB_NAME: Test deployment
22 | runs-on: ubuntu-latest
23 | needs:
24 | - load_vars
25 | permissions:
26 | contents: read
27 | statuses: write
28 | continue-on-error: false
29 | strategy:
30 | fail-fast: false
31 | matrix: ${{ fromJson(needs.load_vars.outputs.BUILD_MATRIX) }}
32 | steps:
33 | - name: Checkout
34 | uses: actions/checkout@v4
35 | with:
36 | submodules: recursive
37 |
38 | - name: Switch branch
39 | if: inputs.pr
40 | env:
41 | GITHUB_USER: ${{ github.actor }}
42 | GITHUB_TOKEN: ${{ github.token }}
43 | run: |
44 | sudo apt-get update
45 | sudo apt-get install -y hub
46 | hub pr checkout ${{ inputs.pr }}
47 | echo "sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
48 |
49 | - name: Get Current Job Log URL
50 | if: inputs.pr && always()
51 | uses: Tiryoh/gha-jobid-action@v1
52 | id: jobs
53 | with:
54 | github_token: ${{ secrets.GITHUB_TOKEN }}
55 | job_name: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }}, ${{ matrix.flatpaks }}, ${{ matrix.image_repo }}, ${{ matrix.image_name }})"
56 | per_page: 100
57 |
58 | - name: Set status
59 | if: inputs.pr && always()
60 | uses: myrotvorets/set-commit-status-action@v2.0.1
61 | with:
62 | token: ${{ secrets.GITHUB_TOKEN }}
63 | status: pending
64 | context: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }}, ${{ matrix.flatpaks }}, ${{ matrix.image_repo }}, ${{ matrix.image_name }})"
65 | sha: ${{ env.sha }}
66 | targetUrl: ${{ steps.jobs.outputs.html_url }}
67 |
68 | - name: Install test tools
69 | run: |
70 | sudo apt-get update
71 | sudo apt-get install -y unzip make
72 | sudo make test/vm/install-deps PACKAGE_MANAGER=apt-get
73 |
74 | - name: Download generated ISO
75 | uses: actions/download-artifact@v4
76 | with:
77 | name: ${{ matrix.image_name }}-${{ matrix.version }}${{ matrix.flatpaks == 'false' && '' || format('-{0}', matrix.flatpaks) }}
78 |
79 | - name: Run VM Tests
80 | env:
81 | VM_USER: core
82 | VM_PASS: foobar
83 | VM_IP: "127.0.0.1"
84 | VM_PORT: "5555"
85 | run: |
86 | make test/vm \
87 | ARCH=${{ needs.load_vars.outputs.ARCH}} \
88 | ENROLLMENT_PASSWORD=${{ needs.load_vars.outputs.ENROLLMENT_PASSWORD }} \
89 | ${{ matrix.flatpaks == 'flatpak_refs' && format('FLATPAK_REMOTE_REFS="{0}"', needs.load_vars.outputs.FLATPAK_REMOTE_REFS) || '' }} \
90 | ${{ matrix.flatpaks == 'flatpak_refs_dir' && format('FLATPAK_REMOTE_REFS_DIR="{0}"', needs.load_vars.outputs.FLATPAK_REMOTE_REFS_DIR) || '' }} \
91 | IMAGE_NAME=${{ matrix.image_name }} \
92 | IMAGE_REPO=${{ matrix.image_repo }} \
93 | IMAGE_TAG=${{ matrix.version }} \
94 | ISO_NAME=${{ matrix.image_name }}-${{ matrix.version }}${{ matrix.flatpaks == 'false' && '' || format('-{0}', matrix.flatpaks) }}.iso \
95 | ${{ matrix.repos != '' && format('REPOS="{0}"', matrix.repos) || '' }} \
96 | SECURE_BOOT_KEY_URL=${{ needs.load_vars.outputs.SECURE_BOOT_KEY_URL }} \
97 | VARIANT=${{ needs.load_vars.outputs.VARIANT }} \
98 | VERSION=${{ matrix.version }} \
99 | VM_IP=${VM_IP} \
100 | VM_PASS=${VM_PASS} \
101 | VM_PORT=${VM_PORT} \
102 | VM_USER=${VM_USER}
103 |
104 | - name: Set status
105 | if: inputs.pr && always()
106 | uses: myrotvorets/set-commit-status-action@v2.0.1
107 | with:
108 | token: ${{ secrets.GITHUB_TOKEN }}
109 | status: ${{ job.status }}
110 | context: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }}, ${{ matrix.flatpaks }}, ${{ matrix.image_repo }}, ${{ matrix.image_name }})"
111 | sha: ${{ env.sha }}
112 | targetUrl: ${{ steps.jobs.outputs.html_url }}
113 |
--------------------------------------------------------------------------------
/.github/workflows/test_iso.yml:
--------------------------------------------------------------------------------
1 | name: Test ISO
2 |
3 | on:
4 | workflow_call:
5 | inputs:
6 | pr:
7 | required: false
8 | type: string
9 | parent_job_name:
10 | required: true
11 | type: string
12 |
13 | jobs:
14 | load_vars:
15 | name: Load Variables
16 | uses: ./.github/workflows/build_vars.yml
17 |
18 | test-iso:
19 | name: Test ISO
20 | env:
21 | JOB_NAME: Test ISO
22 | runs-on: ubuntu-latest
23 | needs:
24 | - load_vars
25 | permissions:
26 | contents: read
27 | statuses: write
28 | continue-on-error: false
29 | strategy:
30 | fail-fast: false
31 | matrix: ${{ fromJson(needs.load_vars.outputs.BUILD_MATRIX) }}
32 | steps:
33 | - name: Checkout
34 | uses: actions/checkout@v4
35 | with:
36 | submodules: recursive
37 |
38 | - name: Switch branch
39 | if: inputs.pr
40 | env:
41 | GITHUB_USER: ${{ github.actor }}
42 | GITHUB_TOKEN: ${{ github.token }}
43 | run: |
44 | sudo apt-get update
45 | sudo apt-get install -y hub
46 | hub pr checkout ${{ inputs.pr }}
47 | echo "sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
48 |
49 | - name: Get Current Job Log URL
50 | if: inputs.pr && always()
51 | uses: Tiryoh/gha-jobid-action@v1
52 | id: jobs
53 | with:
54 | github_token: ${{ secrets.GITHUB_TOKEN }}
55 | job_name: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }}, ${{ matrix.flatpaks }}, ${{ matrix.image_repo }}, ${{ matrix.image_name }})"
56 | per_page: 100
57 |
58 | - name: Set status
59 | if: inputs.pr && always()
60 | uses: myrotvorets/set-commit-status-action@v2.0.1
61 | with:
62 | token: ${{ secrets.GITHUB_TOKEN }}
63 | status: pending
64 | context: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }}, ${{ matrix.flatpaks }}, ${{ matrix.image_repo }}, ${{ matrix.image_name }})"
65 | sha: ${{ env.sha }}
66 | targetUrl: ${{ steps.jobs.outputs.html_url }}
67 |
68 | - name: Install test tools
69 | run: |
70 | sudo apt-get update
71 | sudo apt-get install -y make
72 | sudo make test/iso/install-deps PACKAGE_MANAGER=apt-get
73 |
74 | - name: Download generated ISO
75 | uses: actions/download-artifact@v4
76 | with:
77 | name: ${{ matrix.image_name }}-${{ matrix.version }}${{ matrix.flatpaks == 'false' && '' || format('-{0}', matrix.flatpaks) }}
78 |
79 | - name: Run ISO checks
80 | run: |
81 | make test/iso \
82 | ARCH=${{ needs.load_vars.outputs.ARCH}} \
83 | ENROLLMENT_PASSWORD=${{ needs.load_vars.outputs.ENROLLMENT_PASSWORD }} \
84 | ${{ matrix.flatpaks == 'flatpak_refs' && format('FLATPAK_REMOTE_REFS="{0}"', needs.load_vars.outputs.FLATPAK_REMOTE_REFS) || '' }} \
85 | ${{ matrix.flatpaks == 'flatpak_refs_dir' && format('FLATPAK_REMOTE_REFS_DIR="{0}"', needs.load_vars.outputs.FLATPAK_REMOTE_REFS_DIR) || '' }} \
86 | IMAGE_NAME=${{ matrix.image_name }} \
87 | IMAGE_REPO=${{ matrix.image_repo }} \
88 | IMAGE_TAG=${{ matrix.version }} \
89 | ISO_NAME=${{ matrix.image_name }}-${{ matrix.version }}${{ matrix.flatpaks == 'false' && '' || format('-{0}', matrix.flatpaks) }}.iso \
90 | ${{ matrix.repos != '' && format('REPOS="{0}"', matrix.repos) || '' }} \
91 | SECURE_BOOT_KEY_URL=${{ needs.load_vars.outputs.SECURE_BOOT_KEY_URL }} \
92 | VARIANT=${{ needs.load_vars.outputs.VARIANT }} \
93 | VERSION=${{ matrix.version }}
94 |
95 | - name: Set status
96 | if: inputs.pr && always()
97 | uses: myrotvorets/set-commit-status-action@v2.0.1
98 | with:
99 | token: ${{ secrets.GITHUB_TOKEN }}
100 | status: ${{ job.status }}
101 | context: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }}, ${{ matrix.flatpaks }}, ${{ matrix.image_repo }}, ${{ matrix.image_name }})"
102 | sha: ${{ env.sha }}
103 | targetUrl: ${{ steps.jobs.outputs.html_url }}
--------------------------------------------------------------------------------
/.github/workflows/test_repo.yml:
--------------------------------------------------------------------------------
1 | name: Test Repo
2 |
3 | on:
4 | push:
5 | branches:
6 | - 'main'
7 | tags:
8 | - 'v*'
9 | pull_request:
10 |
11 | concurrency:
12 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
13 | cancel-in-progress: true
14 |
15 | jobs:
16 | variables:
17 | name: Check variables are listed
18 | runs-on: ubuntu-latest
19 | permissions:
20 | contents: read
21 | steps:
22 | - name: Checkout repo
23 | uses: actions/checkout@v4
24 |
25 | - name: Run test
26 | run: |
27 | sudo apt-get update
28 | sudo apt-get install -y make
29 | sudo make test/repo/install-deps
30 | make test/repo
--------------------------------------------------------------------------------
/.github/workflows/tests.yml:
--------------------------------------------------------------------------------
1 | name: All Tests
2 |
3 | on:
4 | push:
5 | branches:
6 | - 'main'
7 | tags:
8 | - 'v*'
9 |
10 | workflow_dispatch:
11 |
12 | workflow_call:
13 | inputs:
14 | pr:
15 | required: true
16 | type: string
17 | parent_job_name:
18 | required: true
19 | type: string
20 |
21 |
22 | concurrency:
23 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
24 | cancel-in-progress: true
25 |
26 | jobs:
27 | build_container:
28 | name: Build Container
29 | uses: ./.github/workflows/build_container.yml
30 | secrets: inherit
31 | with:
32 | pr: ${{ inputs.pr }}
33 | parent_job_name: ${{ inputs.parent_job_name && format('{0} / ', inputs.parent_job_name) }}Build Container
34 |
35 | build_isos:
36 | name: Build ISOs
37 | needs:
38 | - build_container
39 | uses: ./.github/workflows/build_iso.yml
40 | with:
41 | pr: ${{ inputs.pr }}
42 | parent_job_name: ${{ inputs.parent_job_name && format('{0} / ', inputs.parent_job_name) }}Build ISOs
43 |
44 | test_isos:
45 | name: Test ISOs
46 | needs:
47 | - build_isos
48 | uses: ./.github/workflows/test_iso.yml
49 | with:
50 | pr: ${{ inputs.pr }}
51 | parent_job_name: ${{ inputs.parent_job_name && format('{0} / ', inputs.parent_job_name) }}Test ISOs
52 |
53 | test_deployments:
54 | name: Test Deployments
55 | needs:
56 | - build_isos
57 | uses: ./.github/workflows/test_deployment.yml
58 | with:
59 | pr: ${{ inputs.pr }}
60 | parent_job_name: ${{ inputs.parent_job_name && format('{0} / ', inputs.parent_job_name) }}Test Deployments
61 |
--------------------------------------------------------------------------------
/.github/workflows/update_wiki.yml:
--------------------------------------------------------------------------------
1 | name: Update Wiki
2 | on:
3 | push:
4 | branches:
5 | - main
6 | paths:
7 | - 'docs/**'
8 | - '.github/workflows/update_wiki.yml'
9 |
10 | jobs:
11 | update-wiki:
12 | name: Update Wiki
13 | runs-on: ubuntu-latest
14 | permissions:
15 | contents: write
16 | steps:
17 | - name: Install packages
18 | run: |
19 | sudo apt install -y make rsync
20 | # Checkout Main Repo
21 | - uses: actions/checkout@v4
22 |
23 | # Checkout Wiki Repo
24 | - uses: actions/checkout@v4
25 | with:
26 | repository: ${{github.repository}}.wiki
27 | persist-credentials: true
28 | path: wiki
29 | ref: master
30 |
31 | # Generate final files
32 | - name: Generate Files
33 | run: |
34 | cd ${GITHUB_WORKSPACE}/docs
35 | make
36 |
37 | # Copy Docs
38 | - name: Copy files
39 | run: |
40 | rsync -av --exclude='.git/*' ${GITHUB_WORKSPACE}/docs/ ${GITHUB_WORKSPACE}/wiki/
41 |
42 | # Push Changes
43 | - name: Push changes
44 | run: |
45 | cd ${GITHUB_WORKSPACE}/wiki/
46 | git config --local user.email "action@github.com"
47 | git config --local user.name "GitHub Action"
48 | git add .
49 | git commit -m "Add changes"
50 | git push
51 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /debugdata
2 | /build
3 | /flatpaks/script.sh
4 | /flatpaks/repo
5 | /flatpaks/list.txt
6 | /lorax_templates/post_*
7 | /pkglists
8 | /repos/*.repo
9 | /results
10 | /xorriso/input.txt
11 | /original-pkgsizes.txt
12 | /final-pkgsizes.txt
13 | /lorax.conf
14 | /output
15 | /*.log
16 | /cache
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "external/fedora-lorax-templates"]
2 | path = external/fedora-lorax-templates
3 | url = https://pagure.io/fedora-lorax-templates.git
4 | branch = f40
5 | [submodule "external/lorax"]
6 | path = external/lorax
7 | url = https://github.com/weldr/lorax.git
8 |
--------------------------------------------------------------------------------
/.mdlrc:
--------------------------------------------------------------------------------
1 | style "#{File.dirname(__FILE__)}/.codacy/markdownlint.rb"
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "files.associations": {
3 | "Makefile.inputs": "makefile"
4 | }
5 | }
--------------------------------------------------------------------------------
/Containerfile:
--------------------------------------------------------------------------------
1 | FROM fedora:40
2 |
3 | ARG VERSION=39
4 |
5 | ENV ARCH="x86_64"
6 | ENV IMAGE_NAME="base"
7 | ENV IMAGE_REPO="quay.io/fedora-ostree-desktops"
8 | ENV IMAGE_TAG="${VERSION}"
9 | ENV VARIANT="Server"
10 | ENV VERSION="${VERSION}"
11 | ENV WEB_UI="false"
12 |
13 | RUN mkdir /build-container-installer
14 |
15 | COPY / /build-container-installer/
16 |
17 | WORKDIR /build-container-installer
18 | VOLUME /build-container-installer/build
19 | VOLUME /build-container-installer/repos
20 | VOLUME /cache
21 |
22 | RUN dnf install -y make && make install-deps && dnf clean all
23 |
24 | ENTRYPOINT ["/bin/bash", "/build-container-installer/entrypoint.sh"]
25 |
26 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | include Makefile.inputs
2 |
3 | ###################
4 | # Hidden vars
5 |
6 | export SHELL := /bin/sh
7 | # Cache
8 | export DNF_CACHE :=
9 | export PACKAGE_MANAGER := dnf
10 |
11 | # Functions
12 | ## Formatting = lowercase
13 | # Get a list of templates for the feature
14 | # $1 = feature
15 | define get_templates
16 | $(wildcard lorax_templates/$(1)_*.tmpl)
17 | $(foreach file,$(notdir $(wildcard lorax_templates/scripts/post/$(1)_*)),lorax_templates/post_$(file).tmpl)
18 | endef
19 |
20 | define install_pkg
21 | $(PACKAGE_MANAGER) install -y $(if $(findstring dnf,$(PACKAGE_MANAGER)),--disablerepo='*-testing')
22 | endef
23 | export install_pkg
24 |
25 | # Generated/internal vars
26 | ## Formatting = _UPPERCASE
27 | _IMAGE_REPO_ESCAPED := $(subst /,\/,$(IMAGE_REPO))
28 | _IMAGE_REPO_DOUBLE_ESCAPED := $(subst \,\\\,$(_IMAGE_REPO_ESCAPED))
29 | _LORAX_ARGS :=
30 | export _LORAX_TEMPLATES := $(call get_templates,install) lorax_templates/install_include_post.tmpl
31 | _REPO_FILES := $(subst /etc/yum.repos.d,repos,$(REPOS))
32 | _TEMP_DIR := $(shell mktemp -d)
33 | _TEMPLATE_VARS := ARCH IMAGE_NAME IMAGE_REPO _IMAGE_REPO_DOUBLE_ESCAPED _IMAGE_REPO_ESCAPED IMAGE_SIGNED IMAGE_TAG REPOS _RHEL VARIANT VERSION WEB_UI
34 | _VOLID := $(firstword $(subst -, ,$(IMAGE_NAME)))-$(ARCH)-$(IMAGE_TAG)
35 |
36 | ifeq ($(findstring redhat.repo,$(REPOS)),redhat.repo)
37 | export _RHEL := true
38 | export _LORAX_TEMPLATES += $(call get_templates,rhel)
39 | else
40 | undefine _RHEL
41 | endif
42 |
43 | ifeq ($(_RHEL),true)
44 | _LORAX_ARGS += --nomacboot --noupgrade
45 | else ifeq ($(VARIANT),Server)
46 | _LORAX_ARGS += --macboot --noupgrade --squashfs-only
47 | else
48 | _LORAX_ARGS += --nomacboot --squashfs-only
49 | endif
50 |
51 | ifeq ($(WEB_UI),true)
52 | _LORAX_ARGS += -i anaconda-webui
53 | endif
54 |
55 | ifneq ($(DNF_CACHE),)
56 | _LORAX_ARGS += --cachedir $(DNF_CACHE)
57 | export _LORAX_TEMPLATES += $(call get_templates,cache)
58 | _TEMPLATE_VARS += DNF_CACHE
59 | endif
60 |
61 | ifneq ($(FLATPAK_DIR),)
62 | _FLATPAK_REPO_GPG := $(shell curl -L $(FLATPAK_REMOTE_URL) | grep -i '^GPGKey=' | cut -d= -f2)
63 | export _FLATPAK_REPO_URL := $(shell curl -L $(FLATPAK_REMOTE_URL) | grep -i '^URL=' | cut -d= -f2)
64 | _LORAX_ARGS += -i flatpak-libs
65 | export _LORAX_TEMPLATES += $(call get_templates,flatpak)
66 | _TEMPLATE_VARS += FLATPAK_DIR FLATPAK_REMOTE_NAME FLATPAK_REMOTE_REFS FLATPAK_REMOTE_URL _FLATPAK_REPO_GPG _FLATPAK_REPO_URL
67 | else
68 | ifneq ($(FLATPAK_REMOTE_REFS_DIR),)
69 | COLLECTED_REFS := $(foreach file,$(filter-out README.md Makefile,$(wildcard $(FLATPAK_REMOTE_REFS_DIR)/*)),$(shell cat $(file)))
70 | export FLATPAK_REMOTE_REFS += $(sort $(COLLECTED_REFS))
71 | endif
72 |
73 | ifneq ($(FLATPAK_REMOTE_REFS),)
74 | _FLATPAK_REPO_GPG := $(shell curl -L $(FLATPAK_REMOTE_URL) | grep -i '^GPGKey=' | cut -d= -f2)
75 | export _FLATPAK_REPO_URL := $(shell curl -L $(FLATPAK_REMOTE_URL) | grep -i '^URL=' | cut -d= -f2)
76 | _LORAX_ARGS += -i flatpak-libs
77 | export _LORAX_TEMPLATES += $(call get_templates,flatpak) \
78 | external/fedora-lorax-templates/ostree-based-installer/lorax-embed-flatpaks.tmpl
79 | _TEMPLATE_VARS += FLATPAK_DIR FLATPAK_REMOTE_NAME FLATPAK_REMOTE_REFS FLATPAK_REMOTE_URL _FLATPAK_REPO_GPG _FLATPAK_REPO_URL
80 | endif
81 | endif
82 |
83 |
84 | ifneq ($(SECURE_BOOT_KEY_URL),)
85 | export _LORAX_TEMPLATES += $(call get_templates,secureboot)
86 | _TEMPLATE_VARS += ENROLLMENT_PASSWORD
87 | endif
88 |
89 | _SUBDIRS := container external flatpak_refs lorax_templates repos xorriso test
90 |
91 | # Create checksum
92 | ## Default action
93 | $(ISO_NAME)-CHECKSUM: $(ISO_NAME)
94 | cd $(dir $(ISO_NAME)) && sha256sum $(notdir $(ISO_NAME)) > $(notdir $(ISO_NAME))-CHECKSUM
95 |
96 | # Build end ISO
97 | $(ISO_NAME): results/images/boot.iso container/$(IMAGE_NAME)-$(IMAGE_TAG) xorriso/input.txt
98 | $(if $(wildcard $(dir $(ISO_NAME))),,mkdir -p $(dir $(ISO_NAME)); chmod ugo=rwX $(dir $(ISO_NAME)))
99 | xorriso -dialog on < xorriso/input.txt
100 | implantisomd5 $(ISO_NAME)
101 | chmod ugo=r $(ISO_NAME)
102 | $(if $(GITHUB_OUTPUT), echo "iso_name=$(ISO_NAME)" >> $(GITUHB_OUTPUT))
103 |
104 | # Download the secure boot key
105 | sb_pubkey.der:
106 | curl --fail -L -o sb_pubkey.der $(SECURE_BOOT_KEY_URL)
107 |
108 | # Build boot.iso using Lorax
109 | results/images/boot.iso: external/lorax/branch-$(VERSION) $(filter lorax_templates/%,$(_LORAX_TEMPLATES)) $(filter repos/%,$(_REPO_FILES)) $(if $(SECURE_BOOT_KEY_URL),sb_pubkey.der)
110 | $(if $(wildcard results), rm -Rf results)
111 | $(if $(wildcard /etc/rpm/macros.image-language-conf),mv /etc/rpm/macros.image-language-conf $(_TEMP_DIR)/macros.image-language-conf)
112 |
113 | lorax -p $(IMAGE_NAME) -v $(VERSION) -r $(VERSION) -t $(VARIANT) \
114 | --isfinal --buildarch=$(ARCH) --volid=$(_VOLID) --sharedir $(PWD)/external/lorax/share/templates.d/99-generic \
115 | $(_LORAX_ARGS) \
116 | $(foreach file,$(_REPO_FILES),--repo $(patsubst repos/%,$(PWD)/repos/%,$(file))) \
117 | $(foreach file,$(_LORAX_TEMPLATES),--add-template $(PWD)/$(file)) \
118 | $(foreach file,$(ADDITIONAL_TEMPLATES),--add-template $(file)) \
119 | $(foreach file,$(_FLATPAK_TEMPLATES),--add-template $(file)) \
120 | $(foreach file,$(_EXTERNAL_TEMPLATES),--add-template $(PWD)/external/$(file)) \
121 | --rootfs-size $(ROOTFS_SIZE) \
122 | $(foreach var,$(_TEMPLATE_VARS),--add-template-var "$(shell echo $(var) | tr '[:upper:]' '[:lower:]')=$($(var))") \
123 | results/
124 | $(if $(wildcard $(_TEMP_DIR)/macros.image-language-conf),mv -f $(_TEMP_DIR)/macros.image-language-conf /etc/rpm/macros.image-language-conf)
125 |
126 |
127 | FILES_TO_CLEAN := $(wildcard build debugdata pkglists results original-pkgsizes.txt final-pkgsizes.txt lorax.conf *.iso *log)
128 | .PHONY: clean
129 | clean:
130 | rm -Rf $(FILES_TO_CLEAN)
131 | $(foreach DIR,$(_SUBDIRS),$(MAKE) -w -C $(DIR) clean;)
132 |
133 | .PHONY: install-deps
134 | install-deps:
135 | $(install_pkg) lorax xorriso coreutils gettext syslinux-nonlinux
136 | $(foreach DIR,$(filter-out test,$(_SUBDIRS)),$(MAKE) -w -C $(DIR) install-deps;)
137 |
138 |
139 | .PHONY: $(_SUBDIRS) $(wildcard test/*) $(wildcard test/*/*)
140 | test $(addsuffix /*,$(_SUBDIRS)):
141 | $(eval DIR=$(firstword $(subst /, ,$@)))
142 | $(if $(filter-out $(DIR),$@), $(eval TARGET=$(subst $(DIR)/,,$@)),$(eval TARGET=))
143 | $(MAKE) -w -C $(DIR) $(TARGET)
144 |
145 | .DEFAULT:
146 | $(eval DIR=$(firstword $(subst /, ,$@)))
147 | $(if $(filter-out $(DIR),$@), $(eval TARGET=$(subst $(DIR)/,,$@)),$(eval TARGET=))
148 | $(MAKE) -w -C $(DIR) $(TARGET)
149 |
--------------------------------------------------------------------------------
/Makefile.inputs:
--------------------------------------------------------------------------------
1 | # Configuration vars
2 | ## Formatting = UPPERCASE
3 | # General
4 | export ADDITIONAL_TEMPLATES :=
5 | export ARCH := x86_64
6 | export EXTRA_BOOT_PARAMS :=
7 | export IMAGE_NAME := base
8 | export IMAGE_REPO := quay.io/fedora-ostree-desktops
9 | export IMAGE_SRC :=
10 | export IMAGE_TAG = $(VERSION)
11 | export IMAGE_SIGNED := true
12 | REPOS := $(subst :,\:,$(wildcard /etc/yum.repos.d/*.repo))
13 | export ROOTFS_SIZE := 4
14 | export VARIANT := Server
15 | export VERSION := 39
16 | export WEB_UI := false
17 | # Flatpak
18 | export FLATPAK_REMOTE_NAME := flathub
19 | export FLATPAK_REMOTE_URL := https://flathub.org/repo/flathub.flatpakrepo
20 | export FLATPAK_REMOTE_REFS :=
21 | export FLATPAK_REMOTE_REFS_DIR :=
22 | export FLATPAK_DIR :=
23 | # Secure boot
24 | export ENROLLMENT_PASSWORD :=
25 | export SECURE_BOOT_KEY_URL :=
26 | export ISO_NAME := build/deploy.iso
27 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://github.com/jasonn3/build-container-installer/actions/workflows/tests.yml)
2 | [](https://app.codacy.com/gh/JasonN3/build-container-installer/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
3 |
4 | # Build Container Installer Action
5 |
6 | This action is used to generate an ISO for installing an OSTree stored in a container image. This utilizes the anaconda command `ostreecontainer`, which also supports bootc.
7 |
8 | ## Usage
9 |
10 | This action is designed to be called from a GitHub workflow using the following format
11 |
12 | ```yaml
13 | - name: Build ISO
14 | uses: jasonn3/build-container-installer@main
15 | id: build
16 | with:
17 | arch: ${{ env.ARCH}}
18 | image_name: ${{ env.IMAGE_NAME}}
19 | image_repo: ${{ env.IMAGE_REPO}}
20 | image_tag: ${{ env.IMAGE_TAG }}
21 | version: ${{ env.VERSION }}
22 | variant: ${{ env.VARIANT }}
23 | iso_name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}-${{ env.VERSION }}.iso
24 |
25 | # This example is for uploading your ISO as a Github artifact. You can do something similar using any cloud storage, so long as you copy the output
26 | - name: Upload ISO as artifact
27 | id: upload
28 | uses: actions/upload-artifact@v4
29 | with:
30 | name: ${{ steps.build.outputs.iso_name }}
31 | path: |
32 | ${{ steps.build.outputs.iso_path }}
33 | ${{ steps.build.outputs.iso_path }}-CHECKSUM
34 | if-no-files-found: error
35 | retention-days: 0
36 | compression-level: 0
37 | ```
38 |
39 | **See the [Wiki](https://github.com/JasonN3/build-container-installer/wiki) for development and usage information.**
40 |
41 |
42 | ## Star History
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/action.yml:
--------------------------------------------------------------------------------
1 | name: Build Container Installer
2 | description: Generates an ISO for installing an OSTree stored in a container image
3 |
4 | inputs:
5 | action_version:
6 | description: Version of the action container to run
7 | deprecationMessage: No longer used. github.action_ref replaces the need for this. Will be removed in a future version.
8 | required: false
9 | additional_templates:
10 | description: Space delimited list of additional Lorax templates to include
11 | required: false
12 | arch:
13 | description: Architecture for image to build
14 | required: true
15 | default: x86_64
16 | dnf_cache_key:
17 | description: Overrides the dnf cache key
18 | required: false
19 | enable_cache_dnf:
20 | description: Whether to enable caching for dnf
21 | required: false
22 | default: "true"
23 | enable_cache_skopeo:
24 | description: Whether to enable caching for skopeo
25 | required: false
26 | default: "false"
27 | enable_flatpak_dependencies:
28 | description: Whether to enable automatically determining Flatpak dependencies
29 | required: false
30 | default: "true"
31 | enrollment_password:
32 | description: Used for supporting secure boot (requires SECURE_BOOT_KEY_URL to be defined)
33 | required: false
34 | default: "container-installer"
35 | extra_boot_params:
36 | description: Extra params used by grub to boot the anaconda installer
37 | required: false
38 | flatpak_remote_name:
39 | description: Name of the Flatpak repo on the destination OS
40 | required: false
41 | default: "flathub"
42 | flatpak_remote_refs:
43 | description: Space separated list of flatpak refs to install
44 | required: false
45 | default: ""
46 | flatpak_remote_refs_dir:
47 | description: Directory that contains files that list the flatpak refs to install
48 | required: false
49 | default: ""
50 | flatpak_remote_url:
51 | description: URL of the flatpakrepo file
52 | required: false
53 | default: https://flathub.org/repo/flathub.flatpakrepo
54 | image_name:
55 | description: Name of the source container image
56 | required: true
57 | default: base
58 | image_repo:
59 | description: Repository containing the source container image
60 | required: true
61 | default: quay.io/fedora-ostree-desktops
62 | image_signed:
63 | description: Whether the container image is signed. The policy to test the signing must be configured inside the container image
64 | required: false
65 | default: "true"
66 | image_src:
67 | description: Overrides the source of the container image. Must be formatted for the skopeo copy command
68 | required: false
69 | image_tag:
70 | description: Tag of the source container image
71 | required: false
72 | iso_name:
73 | description: Name of the ISO you wish to output when completed
74 | required: false
75 | default: build/deploy.iso
76 | make_target:
77 | description: Overrides the default make target
78 | required: false
79 | repos:
80 | description: List of repo files for Lorax to use
81 | required: false
82 | rootfs_size:
83 | description: The size (in GiB) for the squashfs runtime volume
84 | default: "2"
85 | secure_boot_key_url:
86 | description: Secure boot key that is installed from URL location
87 | required: false
88 | skopeo_cache_key:
89 | description: Overrides the skopeo cache key
90 | required: false
91 | variant:
92 | description: "Source container variant. Available options 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"
93 | required: true
94 | default: Server
95 | version:
96 | description: Fedora version of installer to build
97 | required: true
98 | default: "39"
99 | web_ui:
100 | description: Enable Anaconda WebUI
101 | required: false
102 | default: "false"
103 |
104 | outputs:
105 | iso_name:
106 | value: ${{ steps.docker.outputs.iso_name }}
107 | description: The name of the resulting .iso
108 | iso_path:
109 | value: ${{ steps.docker.outputs.iso_path }}
110 | description: The path of the resulting .iso
111 | flatpak_refs:
112 | value: ${{ steps.docker.outputs.flatpak_refs }}
113 | description: The list of Flatpak refs
114 |
115 | runs:
116 | using: composite
117 | steps:
118 | - name: Make cache directory
119 | shell: bash
120 | run: |
121 | sudo mkdir /cache
122 | sudo chmod 777 /cache
123 |
124 | - name: Load dnf cache
125 | id: load_dnf_cache
126 | env:
127 | dnf_cache_key: dnf-${{ inputs.version }}
128 | if: inputs.enable_cache_dnf == 'true'
129 | uses: actions/cache/restore@v4
130 | with:
131 | path: /cache/dnf
132 | key: ${{ inputs.dnf_cache_key || env.dnf_cache_key }}
133 |
134 | - name: Load skopeo cache
135 | id: load_skopeo_cache
136 | env:
137 | skopeo_cache_key: skopeo-${{ inputs.image_name }}-${{ inputs.version || inputs.image_tag }}
138 | if: inputs.enable_cache_skopeo == 'true'
139 | uses: actions/cache/restore@v4
140 | with:
141 | path: /cache/skopeo
142 | key: ${{ inputs.skopeo_cache_key || env.skopeo_cache_key }}
143 |
144 | - name: Ensure cache directories exist
145 | shell: bash
146 | run: |
147 | mkdir /cache/dnf || true
148 | mkdir /cache/dnf_new || true
149 | mkdir /cache/skopeo || true
150 |
151 | - name: Determine Flatpak dependencies
152 | if: inputs.enable_flatpak_dependencies == 'true' && (inputs.flatpak_remote_refs != '' || inputs.flatpak_remote_refs_dir != '')
153 | id: flatpak_dependencies
154 | shell: bash
155 | run: |
156 | cd ${{ github.action_path }}
157 | make flatpaks/repo \
158 | FLATPAK_REMOTE_NAME="${{ inputs.flatpak_remote_name }}" \
159 | ${{ inputs.flatpak_remote_refs && format('FLATPAK_REMOTE_REFS="{0}"', inputs.flatpak_remote_refs) || ''}} \
160 | ${{ inputs.flatpak_remote_refs_dir && format('FLATPAK_REMOTE_REFS_DIR="{0}/{1}"', github.workspace, inputs.flatpak_remote_refs_dir) || ''}} \
161 | FLATPAK_REMOTE_URL="${{ inputs.flatpak_remote_url }}" \
162 | IMAGE_NAME="${{ inputs.image_name }}" \
163 | IMAGE_REPO="${{ inputs.image_repo }}" \
164 | IMAGE_SRC="${{ inputs.image_src }}" \
165 | IMAGE_TAG="${{ inputs.image_tag || inputs.version }}"
166 |
167 | - name: Run docker image
168 | id: docker
169 | env:
170 | ACTION_REPO: ${{ github.action_repository }}
171 | ACTION_REF: ${{ github.action_ref }}
172 | shell: bash
173 | run: |
174 | image=$(echo "ghcr.io/${ACTION_REPO}" | tr [:upper:] [:lower:])
175 | # Check if running inside of the action repo
176 | if [[ -z "${ACTION_REPO}" ]]
177 | then
178 | image=$(echo "ghcr.io/${{ github.repository }}" | tr [:upper:] [:lower:])
179 | if [[ -n "${{ github.event.issue.number }}" ]]
180 | then
181 | tag="pr-${{ github.event.issue.number }}"
182 | else
183 | tag="${{ github.ref_name }}"
184 | fi
185 | else
186 | tag="${ACTION_REF}"
187 | fi
188 | if [[ "${{ inputs.enable_cache_dnf }}" == "true" ]]
189 | then
190 | cache="${cache} -v /cache/dnf:/cache/dnf"
191 | fi
192 | if [[ "${{ inputs.enable_cache_skopeo }}" == "true" ]]
193 | then
194 | cache="${cache} -v /cache/skopeo:/cache/skopeo"
195 | fi
196 | if [[ "${{ steps.load_dnf_cache.outputs.cache-hit }}" != "true" ]]
197 | then
198 | cache="${cache} -v /cache/dnf_new:/cache/dnf_new"
199 | fi
200 | vars=""
201 | if [[ -n "${{ inputs.flatpak_remote_refs }}" ]] && [[ -n "${{ inputs.flatpak_remote_refs_dir }}" ]]
202 | then
203 | echo "ERROR: flatpak_remote_refs is mutually exclusive to flatpak_remote_refs_dir"
204 | exit 1
205 | fi
206 | docker run --privileged --volume ${{ github.workspace }}:/github/workspace/ ${cache} ${image}:${tag} \
207 | ${{ inputs.make_target }} \
208 | ADDITIONAL_TEMPLATES="${{ inputs.additional_templates }}" \
209 | ARCH="${{ inputs.arch }}" \
210 | DNF_CACHE="/cache/dnf" \
211 | ENROLLMENT_PASSWORD="${{ inputs.enrollment_password }}" \
212 | EXTRA_BOOT_PARAMS="${{ inputs.extra_boot_params }}" \
213 | FLATPAK_REMOTE_NAME="${{ inputs.flatpak_remote_name }}" \
214 | ${{ inputs.flatpak_remote_refs && format('FLATPAK_REMOTE_REFS="{0}"', inputs.flatpak_remote_refs) || ''}} \
215 | ${{ inputs.flatpak_remote_refs_dir && format('FLATPAK_REMOTE_REFS_DIR="/github/workspace/{0}"', inputs.flatpak_remote_refs_dir) || ''}} \
216 | FLATPAK_REMOTE_URL="${{ inputs.flatpak_remote_url }}" \
217 | FLATPAK_DIR="${{ steps.flatpak_dependencies.outputs.flatpak_dir && format('/github/workspace/{0}', steps.flatpak_dependencies.outputs.flatpak_dir) || '' }}" \
218 | IMAGE_NAME="${{ inputs.image_name }}" \
219 | IMAGE_REPO="${{ inputs.image_repo }}" \
220 | IMAGE_SIGNED="${{ inputs.image_signed }}" \
221 | IMAGE_SRC="${{ inputs.image_src }}" \
222 | IMAGE_TAG="${{ inputs.image_tag || inputs.version }}" \
223 | ISO_NAME=/github/workspace/${{ inputs.iso_name }} \
224 | ${{ inputs.repos && format('REPOS="{0}"', inputs.repos) || '' }} \
225 | SECURE_BOOT_KEY_URL="${{ inputs.secure_boot_key_url }}" \
226 | VARIANT="${{ inputs.variant }}" \
227 | VERSION="${{ inputs.version }}" \
228 | WEB_UI="${{ inputs.web_ui }}"
229 | echo "iso_path=$(dirname ${{ inputs.iso_name }})" >> $GITHUB_OUTPUT
230 | echo "iso_name=$(basename ${{ inputs.iso_name }})" >> $GITHUB_OUTPUT
231 | if [[ "${{ steps.flatpak_dependencies.outputs.flatpak_dir }}" != '' ]]
232 | then
233 | echo "flatpak_refs=$(cat ${{ github.workspace }}/${{ steps.flatpak_dependencies.outputs.flatpak_dir }}/list.txt | tr '\n' ' ')" >> $GITHUB_OUTPUT
234 | else
235 | if [[ "${{ inputs.flatpak_remote_refs_dir }}" != '' ]]
236 | then
237 | echo "flatpak_refs=$(cat ${{ github.workspace }}/${{ inputs.flatpak_remote_refs_dir }}/* | tr '\n' ' ')" >> $GITHUB_OUTPUT
238 | else
239 | echo "flatpak_refs=${{ inputs.flatpak_remote_refs}}" >> $GITHUB_OUTPUT
240 | fi
241 | fi
242 |
243 | - name: Save dnf cache
244 | env:
245 | dnf_cache_key: dnf-${{ inputs.version }}
246 | if: inputs.enable_cache_dnf == 'true' && steps.load_dnf_cache.outputs.cache-hit != 'true'
247 | uses: actions/cache/save@v4
248 | with:
249 | path: /cache/dnf_new
250 | key: ${{ inputs.dnf_cache_key || env.dnf_cache_key }}
251 |
252 | - name: Save skopeo cache
253 | env:
254 | skopeo_cache_key: skopeo-${{ inputs.image_name }}-${{ inputs.version || inputs.image_tag }}
255 | if: inputs.enable_cache_skopeo == 'true' && steps.load_dnf_cache.outputs.cache-hit != 'true'
256 | uses: actions/cache/save@v4
257 | with:
258 | path: /cache/skopeo
259 | key: ${{ inputs.skopeo_cache_key || env.skopeo_cache_key }}
260 |
--------------------------------------------------------------------------------
/container/Makefile:
--------------------------------------------------------------------------------
1 | $(IMAGE_NAME)-$(IMAGE_TAG):
2 | skopeo copy $(if $(IMAGE_SRC),$(IMAGE_SRC),docker://$(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)) oci:$(IMAGE_NAME)-$(IMAGE_TAG)
3 |
4 | install-deps:
5 | $(install_pkg) skopeo
6 |
7 | FILES=$(filter-out Makefile,$(wildcard *))
8 | clean:
9 | ifneq ($(FILES),)
10 | rm -Rf $(FILES)
11 | endif
--------------------------------------------------------------------------------
/cosign.pub:
--------------------------------------------------------------------------------
1 | -----BEGIN PUBLIC KEY-----
2 | MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEY4ljyIhI2w9DOptB4WT20S+K5ts3
3 | GJTEKRkXmIYEXGfyKpJMdlGCWeg2kOam5dNhWKXXl46d3eBBo9S53TPpyQ==
4 | -----END PUBLIC KEY-----
5 |
--------------------------------------------------------------------------------
/docs/Makefile:
--------------------------------------------------------------------------------
1 | SHELL = /bin/bash
2 |
3 | docs:
4 | find -name '*.md' -print0 | xargs -0 -I {} bash -c ' \
5 | source_file=$${1:2}; \
6 | final_file=$${source_file//\//_}; \
7 | mv "$${source_file}" "$${final_file}"; \
8 | no_ext_source=$${source_file:0:-3}; \
9 | no_ext_final=$${final_file:0:-3}; \
10 | sed -i "s;(\(../\)*$${source_file});($${no_ext_final});g" $$(find -name '\''*.md'\''); \
11 | ' _ {}
12 | find . -type d -empty -delete
13 |
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | These are the files for the [wiki](https://github.com/JasonN3/build-container-installer/wiki)
--------------------------------------------------------------------------------
/docs/_Sidebar.md:
--------------------------------------------------------------------------------
1 | - [Home](home.md)
2 | - Development
3 | - [Using the Makefile](development/makefile.md)
4 | - [Using the Container](development/container.md)
5 | - [Using the VSCode Dev Container](development/vscode.md)
6 |
7 | - Examples
8 | - [Adding Flatpaks](examples/adding-flatpaks.md)
9 |
10 | - [Known Errors](known_errors.md)
--------------------------------------------------------------------------------
/docs/development/container.md:
--------------------------------------------------------------------------------
1 | # Using the Container
2 |
3 | A container with `make install-deps` already run is provided at `ghcr.io/jasonn3/build-container-installer:latest`
4 |
5 | To use the container file, run `podman run --privileged --volume .:/build-container-installer/build ghcr.io/jasonn3/build-container-installer:latest`.
6 |
7 | This will create an ISO with the baked in defaults of the container image. The resulting file will be called `deploy.iso`
8 |
9 | See [Inputs](usage#inputs) for information about customizing the ISO that gets created. The variables can be defined as environment variables or command arguments. All variables should be specified in CAPITALIZED form.
10 | Examples:
11 |
12 | Building an ISO to install Fedora 39
13 | ```bash
14 | podman run --rm --privileged --volume .:/build-container-installer/build ghcr.io/jasonn3/build-container-installer:latest VERSION=39 IMAGE_NAME=base IMAGE_TAG=39 VARIANT=Server
15 | ```
16 |
17 | Building an ISO to install Fedora 40
18 | ```bash
19 | podman run --rm --privileged --volume .:/build-container-installer/build ghcr.io/jasonn3/build-container-installer:latest VERSION=40 IMAGE_NAME=base IMAGE_TAG=40 VARIANT=Server
20 | ```
21 |
22 | The same commands are also available using `docker` by replacing `podman` with `docker` in each command.
23 |
--------------------------------------------------------------------------------
/docs/development/makefile.md:
--------------------------------------------------------------------------------
1 | # Using the Makefile
2 |
3 | The Makefile contains all the commands that are run in the action. There are separate targets for each file generated, however `make` can be used to generate the final image and `make clean` can be used to clean up the workspace. The resulting ISO will be stored in the `build` directory.
4 |
5 | `make install-deps` can be used to install the necessary packages.
6 |
7 | See [Inputs](usage#inputs) for information about the available parameters. All variables should be specified in CAPITALIZED form.
8 |
--------------------------------------------------------------------------------
/docs/development/vscode.md:
--------------------------------------------------------------------------------
1 | # Using the VSCode Dev Container
2 |
3 | There is a dev container configuration provided for development. By default, it will use the existing container image available at `ghcr.io/jasonn3/build-container-installer:latest`. However, you can have it build a new image by editing `.devcontainer/devcontainer.json` and replacing `image` with `build`. `Ctrl+/` can be used to comment and uncomment blocks of code within VSCode.
4 |
5 | The code from VSCode will be available at `/workspaces/build-container-installer` once the container has started.
6 |
7 | Privileged is required for access to loop devices for lorax.
8 |
9 | ## Use existing container image
10 |
11 | ```diff
12 | {
13 | "name": "Existing Image",
14 | - "build": {
15 | - "context": "..",
16 | - "dockerfile": "../Containerfile",
17 | - "args": {
18 | - "version": "39"
19 | - }
20 | - },
21 | + "image": "ghcr.io/jasonn3/build-container-installer:latest",
22 | "overrideCommand": true,
23 | "shutdownAction": "stopContainer",
24 | "privileged": true
25 | }
26 | ```
27 |
28 | ## Build a new container image
29 |
30 | ```diff
31 | {
32 | "name": "New Image",
33 | + "build": {
34 | + "context": "..",
35 | + "dockerfile": "../Containerfile",
36 | + "args": {
37 | + "version": "39"
38 | + }
39 | + },
40 | - "image": "ghcr.io/jasonn3/build-container-installer:latest",
41 | "overrideCommand": true,
42 | "shutdownAction": "stopContainer",
43 | "privileged": true
44 | }
45 | ```
46 |
47 |
--------------------------------------------------------------------------------
/docs/examples/adding-flatpaks.md:
--------------------------------------------------------------------------------
1 | # Adding Flatpaks
2 |
3 | - [Directly using refs](#directly-using-refs)
4 | - [Using a directory](#using-a-directory)
5 |
6 | ## Directly using refs
7 |
8 | Action:
9 | Specify the following in your workflow:
10 |
11 | ```yaml
12 | - name: Build ISO
13 | uses: jasonn3/build-container-installer@main
14 | id: build
15 | with:
16 | flatpak_remote_name: flathub
17 | flatpak_remote_url: https://flathub.org/repo/flathub.flatpakrepo
18 | flatpak_remote_refs: app/org.videolan.VLC/x86_64/stable runtime/org.kde.Platform/x86_64/5.15-23.08
19 | ```
20 |
21 | Podman:
22 | Run the following command:
23 |
24 | ```bash
25 | podman run --privileged --volume ./:/github/workspace/ ghcr.io/jasonn3/build-container-installer:main \
26 | FLATPAK_REMOTE_NAME=flathub \
27 | FLATPAK_REMOTE_URL=https://flathub.org/repo/flathub.flatpakrepo \
28 | FLATPAK_REMOTE_REFS="app/org.videolan.VLC/x86_64/stable runtime/org.kde.Platform/x86_64/5.15-23.08"
29 | ```
30 |
31 | ---
32 |
33 | ## Using a directory
34 |
35 | Action:
36 |
37 | 1. Create a directory within your GitHub repo named flatpak_refs
38 | 1. Create a file within flatpak_refs with the following content
39 |
40 | ```plaintext
41 | app/org.videolan.VLC/x86_64/stable
42 | runtime/org.kde.Platform/x86_64/5.15-23.08
43 | ```
44 |
45 | Specify the following in your workflow:
46 |
47 | ```yaml
48 | - name: Build ISO
49 | uses: jasonn3/build-container-installer@main
50 | id: build
51 | with:
52 | flatpak_remote_name: flathub
53 | flatpak_remote_url: https://flathub.org/repo/flathub.flatpakrepo
54 | flatpak_remote_refs_dir: /github/workspace/flatpak_refs
55 | ```
56 |
57 | Podman:
58 |
59 | 1. Create a directory named flatpak_refs
60 | 1. Create a file within flatpak_refs with the following content
61 |
62 | ```plaintext
63 | app/org.videolan.VLC/x86_64/stable
64 | runtime/org.kde.Platform/x86_64/5.15-23.08
65 | ```
66 |
67 | Run the following command:
68 |
69 | ```bash
70 | podman run --privileged --volume ./:/github/workspace/ ghcr.io/jasonn3/build-container-installer:main \
71 | FLATPAK_REMOTE_NAME=flathub \
72 | FLATPAK_REMOTE_URL=https://flathub.org/repo/flathub.flatpakrepo \
73 | FLATPAK_REMOTE_REFS="app/org.videolan.VLC/x86_64/stable runtime/org.kde.Platform/x86_64/5.15-23.08"
74 | ```
75 |
--------------------------------------------------------------------------------
/docs/home.md:
--------------------------------------------------------------------------------
1 | Welcome to the build-container-installer wiki!
2 |
3 | ## Index
4 |
5 | - Development
6 | - [Using the Makefile](development/makefile.md)
7 | - [Using the Container](development/container.md)
8 | - [Using the VSCode Dev Container](development/vscode.md)
9 |
10 | - Examples
11 | - [Adding Flatpaks](examples/adding-flatpaks.md)
12 |
13 | - [Known Errors](known_errors.md)
--------------------------------------------------------------------------------
/docs/known_errors.md:
--------------------------------------------------------------------------------
1 | # Known Errors
2 |
3 | This page describes known errors and how to resolve them.
4 |
5 | ## failed to write boot loader configuration
6 |
7 | Add `RUN bootupctl backend generate-update-metadata` at the end of your Dockerfile/Containerfile
--------------------------------------------------------------------------------
/docs/usage.md:
--------------------------------------------------------------------------------
1 | # Usage
2 |
3 | This action is designed to be called from a GitHub workflow using the following format
4 |
5 | ```yaml
6 | - name: Build ISO
7 | uses: jasonn3/build-container-installer@main
8 | id: build
9 | with:
10 | arch: ${{ env.ARCH}}
11 | image_name: ${{ env.IMAGE_NAME}}
12 | image_repo: ${{ env.IMAGE_REPO}}
13 | image_tag: ${{ env.IMAGE_TAG }}
14 | version: ${{ env.VERSION }}
15 | variant: ${{ env.VARIANT }}
16 | iso_name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}-${{ env.VERSION }}.iso
17 |
18 | # This example is for uploading your ISO as a Github artifact. You can do something similar using any cloud storage, so long as you copy the output
19 | - name: Upload ISO as artifact
20 | id: upload
21 | uses: actions/upload-artifact@v4
22 | with:
23 | name: ${{ steps.build.outputs.iso_name }}
24 | path: |
25 | ${{ steps.build.outputs.iso_path }}
26 | ${{ steps.build.outputs.iso_path }}-CHECKSUM
27 | if-no-files-found: error
28 | retention-days: 0
29 | compression-level: 0
30 | ```
31 |
32 | ## Inputs
33 |
34 | | Variable | Description | Default Value | Action | Container/Makefile |
35 | | ----------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------- | ------------------ | ------------------ |
36 | | additional_templates | Space delimited list of additional Lorax templates to include | \[empty\] | :white_check_mark: | :white_check_mark: |
37 | | arch | Architecture for image to build | x86_64 | :white_check_mark: | :white_check_mark: |
38 | | enrollment_password | Used for supporting secure boot (requires SECURE_BOOT_KEY_URL to be defined) | container-installer | :white_check_mark: | :white_check_mark: |
39 | | extra_boot_params | Extra params used by grub to boot the anaconda installer | \[empty\] | :white_check_mark: | :white_check_mark: |
40 | | flatpak_remote_name | Name of the Flatpak repo on the destination OS | flathub | :white_check_mark: | :white_check_mark: |
41 | | flatpak_remote_refs | Space separated list of flatpak refs to install | \[empty\] | :white_check_mark: | :white_check_mark: |
42 | | flatpak_remote_refs_dir | Directory that contains files that list the flatpak refs to install | \[empty\] | :white_check_mark: | :white_check_mark: |
43 | | flatpak_remote_url | URL of the flatpakrepo file | | :white_check_mark: | :white_check_mark: |
44 | | image_name | Name of the source container image | base | :white_check_mark: | :white_check_mark: |
45 | | image_repo | Repository containing the source container image | quay.io/fedora-ostree-desktops | :white_check_mark: | :white_check_mark: |
46 | | image_signed | Whether the container image is signed. The policy to test the signing must be configured inside the container image | true | :white_check_mark: | :white_check_mark: |
47 | | image_src | Overrides the source of the container image. Must be formatted for the skopeo copy command | \[empty\] | :white_check_mark: | :white_check_mark: |
48 | | image_tag | Tag of the source container image | *VERSION* | :white_check_mark: | :white_check_mark: |
49 | | iso_name | Name of the ISO you wish to output when completed | build/deploy.iso | :white_check_mark: | :white_check_mark: |
50 | | make_target | Overrides the default make target | *ISO_NAME*-Checksum | :white_check_mark: | :x: |
51 | | repos | List of repo files for Lorax to use | /etc/yum.repos.d/*.repo | :white_check_mark: | :white_check_mark: |
52 | | rootfs_size | The size (in GiB) for the squashfs runtime volume | 2 | :white_check_mark: | :white_check_mark: |
53 | | secure_boot_key_url | Secure boot key that is installed from URL location\*\* | \[empty\] | :white_check_mark: | :white_check_mark: |
54 | | variant | Source container variant\* | Server | :white_check_mark: | :white_check_mark: |
55 | | version | Fedora version of installer to build | 39 | :white_check_mark: | :white_check_mark: |
56 | | web_ui | Enable Anaconda WebUI (experimental) | false | :white_check_mark: | :white_check_mark: |
57 |
58 | \*Available options for VARIANT can be found by running `dnf provides system-release`.
59 | Variant will be the third item in the package name. Example: `fedora-release-kinoite-39-34.noarch` will be kinoite
60 |
61 | \*\* If you need to reference a local file, you can use `file://*path*`
62 |
63 | ## Outputs
64 |
65 | | Variable | Description | Usage |
66 | | -------- | ----------------------------------------| ------------------------------------------------ |
67 | | iso_name | The name of the resulting .iso | ${{ steps.YOUR_ID_FOR_ACTION.outputs.iso_name }} |
68 | | iso_path | The name and path of the resulting .iso | ${{ steps.YOUR_ID_FOR_ACTION.outputs.iso_name }} |
--------------------------------------------------------------------------------
/entrypoint.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -ex
4 |
5 | # Create /dev/loop0 if it doesn't already exist. `losetup` has an issue creating it during the first run
6 | mknod -m 0660 /dev/loop0 b 7 0 2>/dev/null || true
7 |
8 | if [[ -d /cache/skopeo ]]
9 | then
10 | ln -s /cache/skopeo /build-container-installer/container
11 | fi
12 |
13 | if [[ ! -d /cache/dnf ]]
14 | then
15 | mkdir /cache/dnf
16 | fi
17 |
18 | # Run make command
19 | make "$@"
20 |
--------------------------------------------------------------------------------
/external/Makefile:
--------------------------------------------------------------------------------
1 | lorax/branch-$(VERSION):
2 | git config advice.detachedHead false
3 | cd lorax && git reset --hard HEAD && git checkout $(if $(_RHEL),rhel$(word 1,$(subst ., ,$(VERSION)))-branch,tags/$(shell cd lorax && git tag -l lorax-$(VERSION).* --sort=creatordate | grep -v 'lorax-40\.5' | tail -n 1))
4 | touch lorax/branch-$(VERSION)
5 |
6 | install-deps:
7 | # Used by external/fedora-lorax-templates/ostree-based-installer/lorax-embed-flatpaks.tmpl
8 | $(install_pkg) flatpak dbus-daemon ostree
9 | # Used to clone proper lorax branch
10 | $(install_pkg) git
11 |
12 | clean:
--------------------------------------------------------------------------------
/flatpak_refs/Firefox:
--------------------------------------------------------------------------------
1 | app/org.mozilla.firefox/x86_64/stable
2 |
--------------------------------------------------------------------------------
/flatpak_refs/VLC:
--------------------------------------------------------------------------------
1 | app/org.videolan.VLC/x86_64/stable
2 |
--------------------------------------------------------------------------------
/flatpaks/Makefile:
--------------------------------------------------------------------------------
1 | IMAGE := $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)
2 | FLATPAK_DIR := $(if $(GITHUB_WORKSPACE),$(shell mktemp -d -p $(GITHUB_WORKSPACE) flatpak.XXX),$(PWD)/flatpaks)
3 |
4 | .PHONY: full_list
5 | full_list: repo
6 | cat $(FLATPAK_DIR)/list.txt >&2
7 |
8 |
9 | repo: script.sh
10 | $(if $(GITHUB_WORKSPACE),cp script.sh $(FLATPAK_DIR)/)
11 | docker run --rm --privileged --entrypoint bash -e FLATPAK_SYSTEM_DIR=/flatpak/flatpak -e FLATPAK_TRIGGERSDIR=/flatpak/triggers --volume $(FLATPAK_DIR):/flatpak_dir $(IMAGE) /flatpak_dir/script.sh
12 | $(if $(GITHUB_OUTPUT),echo "flatpak_dir=$(subst $(GITHUB_WORKSPACE)/,,$(FLATPAK_DIR))" >> $(GITHUB_OUTPUT))
13 | docker rmi $(IMAGE)
14 |
15 | script.sh:
16 | cat << EOF > script.sh
17 | which flatpak &> /dev/null || dnf install -y flatpak
18 | mkdir -p /flatpak/flatpak /flatpak/triggers
19 | mkdir /var/tmp || true
20 | chmod -R 1777 /var/tmp
21 | flatpak config --system --set languages "*"
22 | flatpak remote-add --system $(FLATPAK_REMOTE_NAME) $(FLATPAK_REMOTE_URL)
23 | flatpak install --system -y $(FLATPAK_REMOTE_REFS)
24 | ostree init --repo=/flatpak_dir/repo --mode=archive-z2
25 | for i in \$$(ostree refs --repo=\$${FLATPAK_SYSTEM_DIR}/repo | grep '^deploy/' | sed 's/^deploy\///g')
26 | do
27 | echo "Copying \$${i}..."
28 | ostree --repo=/flatpak_dir/repo pull-local \$${FLATPAK_SYSTEM_DIR}/repo \$$(ostree --repo=\$${FLATPAK_SYSTEM_DIR}/repo rev-parse $(FLATPAK_REMOTE_NAME)/\$${i})
29 | mkdir -p \$$(dirname /flatpak_dir/repo/refs/heads/\$${i})
30 | ostree --repo=\$${FLATPAK_SYSTEM_DIR}/repo rev-parse $(FLATPAK_REMOTE_NAME)/\$${i} > /flatpak_dir/repo/refs/heads/\$${i}
31 | done
32 | flatpak build-update-repo /flatpak_dir/repo
33 | ostree refs --repo=/flatpak_dir/repo | tee /flatpak_dir/list.txt
34 | EOF
35 |
36 | install-deps:
37 |
38 | clean:
39 | $(if $(wildcard script.sh),rm script.sh)
40 | $(if $(wildcard repo),rm -Rf repo)
41 | $(if $(wildcard list.txt),rm list.txt)
42 |
43 | .ONESHELL:
--------------------------------------------------------------------------------
/lorax_templates/Makefile:
--------------------------------------------------------------------------------
1 | # Converts a post script to a template
2 | # $1 = script to convert
3 | # $2 = file on ISO to write
4 | # $3 = whether to copy the '<%' lines to the template
5 | define convert_post_to_tmpl
6 | header=0; \
7 | skip=0; \
8 | while read -r line; \
9 | do \
10 | if [[ $$line =~ ^\<\% ]]; \
11 | then \
12 | if [[ '$(3)' == 'true' ]]; \
13 | then \
14 | echo $$line >> post_$(1).tmpl; \
15 | fi; \
16 | echo >> post_$(1).tmpl; \
17 | else \
18 | if [[ $$header == 0 ]]; \
19 | then \
20 | if [[ $$line =~ ^\#\#\ (.*)$$ ]]; \
21 | then \
22 | echo "append $(2) \"%post --erroronfail $${BASH_REMATCH[1]}\"" >> post_$(1).tmpl; \
23 | skip=1; \
24 | else \
25 | echo "append $(2) \"%post --erroronfail\"" >> post_$(1).tmpl; \
26 | fi; \
27 | header=1; \
28 | fi; \
29 | if [[ $$skip == 0 ]]; \
30 | then \
31 | echo "append $(2) \"$${line//\"/\\\"}\"" >> post_$(1).tmpl; \
32 | fi; \
33 | skip=0; \
34 | fi; \
35 | done < scripts/post/$(1); \
36 | echo "append $(2) \"%end\"" >> post_$(1).tmpl
37 | endef
38 |
39 | post_%.tmpl: scripts/post/%
40 | $(call convert_post_to_tmpl,$*,usr/share/anaconda/post-scripts/$*.ks,true)
41 |
42 | install_include_post.tmpl:
43 | echo '<%page />' > install_include_post.tmpl
44 | for file in $(patsubst post_%.tmpl, %, $(filter post_%, $(notdir $(_LORAX_TEMPLATES)))); do echo "append usr/share/anaconda/interactive-defaults.ks \"%include /usr/share/anaconda/post-scripts/$${file}.ks\"" >> install_include_post.tmpl; done
45 |
46 | install-deps:
47 |
48 | FILES=$(wildcard post_*) install_include_post.tmpl
49 | clean:
50 | ifneq ($(FILES),)
51 | rm -Rf $(FILES)
52 | endif
53 |
--------------------------------------------------------------------------------
/lorax_templates/cache_copy_dnf.tmpl:
--------------------------------------------------------------------------------
1 | <%page args="dnf_cache"/>
2 |
3 | runcmd bash -c "if [[ -e ${dnf_cache}_new ]]; then cp -R ${dnf_cache}/* ${dnf_cache}_new/; fi"
--------------------------------------------------------------------------------
/lorax_templates/flatpak_link.tmpl:
--------------------------------------------------------------------------------
1 | <%page args="flatpak_dir"/>
2 |
3 | %if flatpak_dir != "":
4 | symlink /run/install/repo/flatpak /flatpak
5 | %endif
--------------------------------------------------------------------------------
/lorax_templates/flatpak_set_repo.tmpl:
--------------------------------------------------------------------------------
1 | <%page args="flatpak_remote_name, _flatpak_repo_url, version"/>
2 | % if int(version) >= 41:
3 | append etc/anaconda/conf.d/anaconda.conf "[Payload]"
4 | append etc/anaconda/conf.d/anaconda.conf "flatpak_remote = ${flatpak_remote_name} ${_flatpak_repo_url}"
5 | % else:
6 | 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
7 | 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
8 | % endif
9 |
--------------------------------------------------------------------------------
/lorax_templates/install_set_installer.tmpl:
--------------------------------------------------------------------------------
1 | <%page args="image_name, image_tag"/>
2 |
3 | append usr/share/anaconda/interactive-defaults.ks "ostreecontainer --url=/run/install/repo/${image_name}-${image_tag} --transport=oci --no-signature-verification"
4 |
5 |
--------------------------------------------------------------------------------
/lorax_templates/scripts/post/flatpak_configure:
--------------------------------------------------------------------------------
1 | <%page args="_flatpak_repo_gpg, flatpak_remote_name"/>
2 |
3 | if [[ -d /ostree/deploy/default/var/lib/flatpak/repo ]]
4 | then
5 | echo ${_flatpak_repo_gpg} | base64 -d > /ostree/deploy/default/var/lib/flatpak/repo/flathub.trustedkeys.gpg
6 | elif [[ -d /var/lib/flatpak/repo ]]
7 | then
8 | echo ${_flatpak_repo_gpg} | base64 -d > /var/lib/flatpak/repo/flathub.trustedkeys.gpg
9 | else
10 | echo "Could not find Flatpaks repo"
11 | fi
12 |
13 | if [[ "${flatpak_remote_name}" != 'fedora' ]]
14 | then
15 | systemctl disable flatpak-add-fedora-repos.service
16 | fi
17 |
--------------------------------------------------------------------------------
/lorax_templates/scripts/post/install_configure_upgrades:
--------------------------------------------------------------------------------
1 | <%page args="image_repo, _image_repo_double_escaped, image_name, image_signed, image_tag, _rhel, version"/>
2 |
3 | if (which bootc &> /dev/null) && [ ${_rhel} == 'false' && ${version} -ge 39 ]
4 | then
5 | if [ ${image_signed} == 'true' ]
6 | then
7 | bootc switch --mutate-in-place --enforce-container-sigpolicy --transport registry ${image_repo}/${image_name}:${image_tag}
8 | else
9 | bootc switch --mutate-in-place --transport registry ${image_repo}/${image_name}:${image_tag}
10 | fi
11 | else
12 | if [ ${image_signed} == 'true' ]
13 | then
14 | 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
15 | else
16 | sed -i 's/container-image-reference=.*/container-image-reference=ostree-unverified-image:docker:\/\/${_image_repo_double_escaped}\/${image_name}:${image_tag}/' /ostree/deploy/default/deploy/*.origin
17 | fi
18 | fi
19 |
--------------------------------------------------------------------------------
/lorax_templates/scripts/post/secureboot_enroll_key:
--------------------------------------------------------------------------------
1 | <%page args="enrollment_password"/>
2 | ## --nochroot
3 |
4 | set -oue pipefail
5 |
6 | readonly ENROLLMENT_PASSWORD=${enrollment_password}
7 | readonly SECUREBOOT_KEY="/run/install/repo/sb_pubkey.der"
8 |
9 | if [[ ! -d "/sys/firmware/efi" ]]; then
10 | echo "EFI mode not detected. Skipping key enrollment."
11 | exit 0
12 | fi
13 |
14 | if [[ ! -f "$SECUREBOOT_KEY" ]]; then
15 | echo "Secure boot key not provided: $SECUREBOOT_KEY"
16 | exit 0
17 | fi
18 |
19 | SYS_ID="$(cat /sys/devices/virtual/dmi/id/product_name)"
20 | if [[ ":Jupiter:Galileo:" =~ ":$SYS_ID:" ]]; then
21 | echo "Steam Deck hardware detected. Skipping key enrollment."
22 | exit 0
23 | fi
24 |
25 | mokutil --timeout -1 || :
26 | echo -e "$ENROLLMENT_PASSWORD\n$ENROLLMENT_PASSWORD" | mokutil --import "$SECUREBOOT_KEY" || :
27 |
--------------------------------------------------------------------------------
/repos/Makefile:
--------------------------------------------------------------------------------
1 | repos: $(_REPO_FILES)
2 |
3 | # Step 2: Replace vars in repo files
4 | %.repo: /etc/yum.repos.d/%.repo
5 | cp /etc/yum.repos.d/$*.repo $*.repo
6 | sed -i "s/\$$releasever/$(VERSION)/g" $*.repo
7 | sed -i "s/\$$basearch/$(ARCH)/g" $*.repo
8 |
9 | install-deps:
10 |
11 | FILES=$(wildcard *.repo)
12 | clean:
13 | ifneq ($(FILES),)
14 | rm -Rf $(FILES)
15 | endif
--------------------------------------------------------------------------------
/test/Makefile:
--------------------------------------------------------------------------------
1 | all: $(filter-out README.md Makefile,$(wildcard *))
2 |
3 | $(filter-out README.md Makefile,$(wildcard *)):
4 | $(eval DIR=$(firstword $(subst /, ,$@)))
5 | $(MAKE) -w -C $(DIR)
6 |
7 | $(filter-out README.md Makefile,$(wildcard */*)):
8 | $(eval DIR=$(firstword $(subst /, ,$@)))
9 | $(eval TARGET=$(subst $(DIR)/,,$@))
10 | $(MAKE) -w -C $(DIR) $(TARGET)
11 |
12 | .DEFAULT:
13 | $(eval DIR=$(firstword $(subst /, ,$@)))
14 | $(if $(filter-out $(DIR),$@), $(eval TARGET=$(subst $(DIR)/,,$@)),$(eval TARGET=))
15 | $(MAKE) -w -C $(DIR) $(TARGET)
16 |
17 | install-deps:
18 | $(foreach DIR,$(filter-out README.md Makefile,$(wildcard *)),$(MAKE) -w -C $(DIR) install-deps;)
19 |
20 | clean:
21 | $(foreach DIR,$(filter-out README.md Makefile,$(wildcard *)),$(MAKE) -w -C $(DIR) clean;)
22 |
23 | .PHONY: all $(filter-out README.md Makefile,$(wildcard *)) $(filter-out README.md Makefile,$(wildcard */*))
--------------------------------------------------------------------------------
/test/iso/Makefile:
--------------------------------------------------------------------------------
1 | ISO_NAME=deploy.iso
2 | ISO_TESTS=$(wildcard install_*) $(if $(FLATPAK_REMOTE_REFS),$(wildcard flatpak_*))$(if $(FLATPAK_DIR),$(wildcard flatpak_*))
3 |
4 | all: $(ISO_TESTS) clean
5 |
6 | $(ISO_TESTS): mnt/iso
7 | $(eval _VARS = ISO_NAME VERSION FLATPAK_REMOTE_NAME _FLATPAK_REPO_URL)
8 | chmod +x $@
9 | $(foreach var,$(_VARS),$(var)=$($(var))) ./$@
10 |
11 | mnt/iso:
12 | sudo modprobe loop
13 | sudo mkdir -p mnt/iso mnt/install
14 | sudo mount -o loop ../../$(ISO_NAME) mnt/iso
15 | sudo mount -t squashfs -o loop mnt/iso/images/install.img mnt/install
16 |
17 | clean:
18 | sudo umount mnt/install || true
19 | sudo umount mnt/iso || true
20 | sudo rmdir mnt/install mnt/iso
21 |
22 | install-deps:
23 | $(install_pkg) isomd5sum coreutils squashfs-tools curl
24 |
25 | .PHONY: all $(ISO_TESTS) clean
--------------------------------------------------------------------------------
/test/iso/README.md:
--------------------------------------------------------------------------------
1 | Place scripts that will test the ISO. The ISO file will be passed as the first argument
--------------------------------------------------------------------------------
/test/iso/flatpak_repo_updated.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | if [[ ${VERSION} -ge 41 ]]
4 | then
5 | result=0
6 | grep "^\[Payload\]" mnt/install/etc/anaconda/conf.d/anaconda.conf > /dev/null || {
7 | echo "Missing [Payload] header"
8 | result=1
9 | }
10 | grep "^flatpak_remote = ${FLATPAK_REMOTE_NAME} ${_FLATPAK_REPO_URL}" mnt/install/etc/anaconda/conf.d/anaconda.conf > /dev/null || {
11 | echo "Missing flatpak_remote option"
12 | result=1
13 | }
14 | exit ${result}
15 | fi
16 |
17 | add_line=$(grep flatpak_manager.add_remote mnt/install/usr/lib64/python*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree/flatpak_installation.py)
18 |
19 | add_line_repo=$(echo "${add_line}" | grep "${FLATPAK_REMOTE_NAME}")
20 | add_line_url=$(echo "${add_line}" | grep "${_FLATPAK_REPO_URL}")
21 |
22 | result=0
23 | if [ -z "${add_line_repo}" ]
24 | then
25 | echo "Repo name not updated on add_remote line"
26 | echo "${add_line}"
27 | result=1
28 | else
29 | echo "Repo name found on add_remote line"
30 | fi
31 |
32 | if [ -z "${add_line_url}" ]
33 | then
34 | echo "Repo url not updated on add_remote line"
35 | echo "${add_line}"
36 | result=1
37 | else
38 | echo "Repo url found on add_remote line"
39 | fi
40 |
41 | replace_line=$(grep flatpak_manager.replace_installed_refs_remote mnt/install/usr/lib64/python*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree/flatpak_installation.py)
42 |
43 | replace_line_repo=$(echo "${replace_line}" | grep "${FLATPAK_REMOTE_NAME}")
44 |
45 | if [ -z "${replace_line_repo}" ]
46 | then
47 | echo "Repo name not updated on replace_installed_refs line"
48 | echo "${replace_line}"
49 | result=1
50 | else
51 | echo "Repo name found on replace_installed_refs line"
52 | fi
53 |
54 | exit ${result}
--------------------------------------------------------------------------------
/test/iso/install_hash.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #set -ex
4 |
5 | checkisomd5 "../../${ISO_NAME}"
6 | if [[ $? != 0 ]]
7 | then
8 | echo "Found:"
9 | checkisomd5 --md5sumonly "../../${ISO_NAME}"
10 | echo "Expected:"
11 | implantisomd5 --force "../../${ISO_NAME}"
12 | fi
13 |
14 | cd "$(dirname "../../${ISO_NAME}")" && sha256sum -c "$(basename "${ISO_NAME}")-CHECKSUM"
--------------------------------------------------------------------------------
/test/iso/install_os-release.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | FOUND_VERSION=$(grep VERSION_ID mnt/install/etc/os-release | cut -d= -f2 | tr -d '"')
4 |
5 | if [[ ${FOUND_VERSION} != ${VERSION} ]]
6 | then
7 | echo "Version mismatch"
8 | echo "Expected: ${VERSION}"
9 | echo "Found: ${FOUND_VERSION}"
10 | exit 1
11 | else
12 | echo "Correct version found"
13 | exit 0
14 | fi
--------------------------------------------------------------------------------
/test/repo/Makefile:
--------------------------------------------------------------------------------
1 | REPO_TESTS=$(filter-out README.md Makefile,$(wildcard *))
2 |
3 | all: $(REPO_TESTS)
4 |
5 | $(REPO_TESTS):
6 | chmod +x $@
7 | ./$@
8 |
9 | install-deps:
10 |
11 | .PHONY: $(REPO_TESTS)
--------------------------------------------------------------------------------
/test/repo/vars.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | makefile = open('../../Makefile.inputs', 'r')
4 | makefile_lines = makefile.readlines()
5 |
6 | inputs = {}
7 | outputs = {}
8 | errors = 0
9 |
10 | for line in makefile_lines:
11 | if line.startswith('#'):
12 | makefile_lines.remove(line)
13 | continue
14 | parts = line.split('=', 1)
15 | if parts[0].startswith('export'):
16 | var_name = parts[0].strip().split(' ')[1].lower()
17 | else:
18 | var_name = parts[0].strip().lower()
19 | inputs[var_name] = {'default_value': parts[1].strip(), 'makefile': True}
20 |
21 | action = open('../../action.yml', 'r')
22 | action_lines = action.readlines()
23 |
24 | at_inputs = False
25 | at_outputs = False
26 | for line in action_lines:
27 | if not at_inputs:
28 | if line.strip() == 'inputs:':
29 | at_inputs = True
30 | continue
31 | else:
32 | if line.startswith(' '):
33 | parts = line.strip().split(':', 1)
34 | if parts[0] == 'description':
35 | inputs[var_name]['description'] = parts[1].strip()
36 | if parts[0] == 'deprecationMessage':
37 | inputs[var_name]['deprecated'] = True
38 | if parts[0] == 'default':
39 | if 'default' in inputs[var_name]:
40 | if inputs[var_name]['default_value'] != parts[1].strip().strip('"'):
41 | print("ERROR: Default value for " + var_name + " in action.yml does not match Makefile")
42 | errors += 1
43 | else:
44 | inputs[var_name]['default_value'] = parts[1].strip().strip('"')
45 | elif line.startswith(' '):
46 | var_name = line.strip().strip(':').lower()
47 | if not var_name in inputs:
48 | inputs[var_name] = {}
49 | inputs[var_name]['action'] = True
50 | else:
51 | at_inputs = False
52 |
53 | if not at_outputs:
54 | if line.strip() == 'outputs:':
55 | at_outputs = True
56 | continue
57 | else:
58 | if line.startswith(' '):
59 | parts = line.strip().split(':', 1)
60 | if parts[0] == 'description':
61 | outputs[var_name]['description'] = parts[1].strip()
62 | if parts[0] == 'deprecationMessage':
63 | outputs[var_name]['deprecated'] = True
64 | if parts[0] == 'default':
65 | outputs[var_name]['default_value'] = parts[1].strip().strip('"')
66 | elif line.startswith(' '):
67 | var_name = line.strip().strip(':').lower()
68 | outputs[var_name] = {}
69 | else:
70 | at_outputs = False
71 |
72 |
73 | readme = open('../../README.md', 'r')
74 | readme_lines = readme.readlines()
75 |
76 | at_inputs = False
77 | skip_header = True
78 | at_outputs = False
79 | for line in readme_lines:
80 | if not at_inputs:
81 | if line.strip() == '### Inputs':
82 | at_inputs = True
83 | continue
84 | else:
85 | if skip_header:
86 | if line.startswith('| -----'):
87 | skip_header = False
88 | continue
89 | else:
90 | if not line.startswith('|'):
91 | at_inputs = False
92 | continue
93 | parts = line.split('|')
94 | var_name = parts[1].strip().lower()
95 | if not var_name in inputs:
96 | print("ERROR: " + var_name + " is not listed in action.yml or Makefile")
97 | errors += 1
98 | continue
99 | if 'description' in inputs[var_name]:
100 | if parts[2].strip().strip('\*') != inputs[var_name]['description']:
101 | print("WARNING: " + var_name + " description in README.md does not match action.yml")
102 | if 'default_value' in inputs[var_name]:
103 | if not parts[3].strip().strip('"<>').startswith('*'):
104 | if inputs[var_name]['default_value'] == "":
105 | if parts[3].strip().strip('"') != '\\[empty\\]':
106 | print("ERROR: " + var_name + " default value in README.md does not match action.yml")
107 | print("Found " + parts[3].strip().strip('"<>'))
108 | print("Expected " + inputs[var_name]['default_value'])
109 | errors += 1
110 | elif parts[3].strip().strip('"<>') != inputs[var_name]['default_value']:
111 | print("ERROR: " + var_name + " default value in README.md does not match action.yml")
112 | print("Found " + parts[3].strip().strip('"<>'))
113 | print("Expected " + inputs[var_name]['default_value'])
114 | errors += 1
115 | if 'action' in inputs[var_name] and inputs[var_name]['action']:
116 | if parts[4].strip() != ':white_check_mark:':
117 | print("WARNING: " + var_name + " not labeled as in action.yml in the README.md")
118 | if 'makefile' in inputs[var_name] and inputs[var_name]['makefile']:
119 | if parts[4].strip() != ':white_check_mark:':
120 | print("WARNING: " + var_name + " not labeled as in Makefile in the README.md")
121 |
122 | exit(errors)
--------------------------------------------------------------------------------
/test/vm/Makefile:
--------------------------------------------------------------------------------
1 | VM_TESTS=$(wildcard install_*) $(if $(FLATPAK_REMOTE_REFS),$(wildcard flatpak_*))$(if $(FLATPAK_DIR),$(wildcard flatpak_*))
2 |
3 | all: $(VM_TESTS) clean
4 |
5 | $(VM_TESTS): start_vm ansible_inventory
6 | $(eval _VARS = IMAGE_REPO IMAGE_NAME IMAGE_TAG)
7 |
8 | ansible -i ansible_inventory -m ansible.builtin.wait_for_connection vm
9 |
10 | chmod +x $@
11 | $(foreach var,$(_VARS),$(var)=$($(var))) ./$@
12 |
13 | ansible_inventory:
14 | echo "ungrouped:" > ansible_inventory
15 | echo " hosts:" >> ansible_inventory
16 | echo " vm:" >> ansible_inventory
17 | echo " ansible_host: $(VM_IP)" >> ansible_inventory
18 | echo " ansible_port: $(VM_PORT)" >> ansible_inventory
19 | echo " ansible_user: $(VM_USER)" >> ansible_inventory
20 | echo " ansible_password: $(VM_PASS)" >> ansible_inventory
21 | echo " ansible_become_pass: $(VM_PASS)" >> ansible_inventory
22 | echo " ansible_ssh_common_args: '-o StrictHostKeyChecking=no'" >> ansible_inventory
23 |
24 | .PHONY: $(VM_TESTS) install-deps
25 |
26 | install-deps:
27 | $(install_pkg) qemu-system qemu-utils xorriso qemu-system-x86 ncat socat jq ansible curl
28 |
29 | files/mnt/iso:
30 | $(if $(wildcard files/mnt),,mkdir files/mnt)
31 | $(if $(wildcard files/mnt/iso),,mkdir files/mnt/iso)
32 | sudo mount -o loop ../../$(ISO_NAME) files/mnt/iso
33 |
34 | files/grub.cfg: files/mnt/iso
35 | cp files/mnt/iso/$(if $(_RHEL),isolinux/grub.conf,boot/grub2/grub.cfg) files/grub.cfg
36 | sed -i 's/quiet/console=ttyS0,115200n8 inst.ks=cdrom:\/ks.cfg/' files/grub.cfg
37 | sed -i 's/set default="1"/set default="0"/' files/grub.cfg
38 | sed -i 's/set timeout=60/set timeout=1/' files/grub.cfg
39 |
40 | .PHONY: clean
41 | clean:
42 | $(if $(wildcard start_vm), kill "$(shell cat start_vm)")
43 | $(if $(wildcard files/mnt/iso),sudo umount files/mnt/iso)
44 | $(if $(wildcard files/mnt/iso),rmdir files/mnt/iso)
45 | $(if $(wildcard ansible_inventory),rm ansible_inventory)
46 | $(if $(wildcard files/install.iso),rm files/install.iso)
47 | $(if $(wildcard files/disk.qcow2),rm files/disk.qcow2)
48 | $(if $(wildcard install_os),rm install_os)
49 | $(if $(wildcard start_vm),rm start_vm)
50 |
51 | files/install.iso: files/grub.cfg
52 | xorriso -dialog on << EOF
53 | -indev ../../$(ISO_NAME)
54 | -outdev files/install.iso
55 | -boot_image any replay
56 | -joliet on
57 | -compliance joliet_long_names
58 | -map files/ks.cfg ks.cfg
59 | -chmod 0444 ks.cfg
60 | -map files/grub.cfg $(if $(_RHEL),isolinux/grub.conf,boot/grub2/grub.cfg)
61 | -end
62 | EOF
63 |
64 | files/disk.qcow2:
65 | qemu-img create -f qcow2 files/disk.qcow2 50G
66 |
67 | install_os: files/install.iso files/disk.qcow2
68 | timeout 1h qemu-system-x86_64 -name "Anaconda" -boot d -m 4096 -cpu qemu64 -display none -cdrom files/install.iso -smp 2 -hda files/disk.qcow2 -serial telnet:localhost:4321,server=on,wait=off & QEMU_PID=$$!
69 | echo "PID: $$QEMU_PID"
70 | timeout 1m bash -c "while ! (echo > /dev/tcp/127.0.0.1/4321); do sleep 0.1; done"
71 | (nc localhost 4321 | tee vm.stdout) &
72 | wait $$QEMU_PID
73 | touch install_os
74 |
75 | .ONESHELL:
76 |
77 | start_vm: install_os
78 | mkfifo vm.stdin
79 | qemu-system-x86_64 -name "Anaconda" \
80 | -m 4096 -cpu qemu64 -display none -smp 2 \
81 | -chardev socket,path=/tmp/qga.sock,server=on,wait=off,id=qga0 \
82 | -device e1000,netdev=net0 \
83 | -netdev user,id=net0,hostfwd=tcp::$(VM_PORT)-:22 \
84 | -device virtio-serial \
85 | -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 \
86 | -boot c -hda files/disk.qcow2 -serial telnet:localhost:4321,server=on,wait=off & export QEMU_PID=$$!
87 | echo "PID: $$QEMU_PID"
88 |
89 | timeout 1m bash -c "while ! (echo > /dev/tcp/127.0.0.1/4321); do sleep 0.1; done"
90 | (tail -f vm.stdin | nc localhost 4321 | tee vm.stdout) &
91 |
92 | timeout 30m bash -c "while ! (echo > /dev/tcp/$(VM_IP)/$(VM_PORT)); do sleep 1; done"
93 |
94 | if ! (echo > /dev/tcp/$(VM_IP)/$(VM_PORT))
95 | then
96 | echo "SSH must be installed and enabled inside the container"
97 | fi
98 |
99 | echo "VM ready for tests at IP $(VM_IP):$(VM_PORT)"
100 | echo $$QEMU_PID > start_vm
101 |
--------------------------------------------------------------------------------
/test/vm/README.md:
--------------------------------------------------------------------------------
1 | Place scripts that will test the VM. The VM will be available at ${VM_IP} using username ${VM_USER} and password ${VM_PASS}
--------------------------------------------------------------------------------
/test/vm/files/ks.cfg:
--------------------------------------------------------------------------------
1 | lang en_US.UTF-8
2 | keyboard us
3 | timezone Americas/New_York
4 | zerombr
5 | clearpart --all --initlabel
6 | autopart
7 | poweroff
8 | user --name=core --groups=wheel --password=foobar
9 | %include /usr/share/anaconda/interactive-defaults.ks
10 |
--------------------------------------------------------------------------------
/test/vm/flatpak_fedora_repo_disabled.yml:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env -S ansible-playbook -i ./ansible_inventory
2 | ---
3 | - name: Test fedora flatpak repo wasn't enabled
4 | hosts: vm
5 | gather_facts: no
6 |
7 | tasks:
8 | - name: Collect facts about system services
9 | service_facts:
10 | register: services_state
11 |
12 | - name: Check that flatpak-add-fedora-repos is disabled
13 | when: services_state['ansible_facts']['services']['flatpak-add-fedora-repos.service'] is defined
14 | ansible.builtin.assert:
15 | that:
16 | - services_state['ansible_facts']['services']['flatpak-add-fedora-repos.service']['status'] == 'disabled'
17 | fail_msg: 'flatpak-add-fedora-repos.service is not disabled'
18 | success_msg: 'flatpak-add-fedora-repos.service is correctly disabled'
19 |
--------------------------------------------------------------------------------
/test/vm/flatpak_installed.yml:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env -S ansible-playbook -i ./ansible_inventory
2 | ---
3 | - name: Test for installed flatpaks
4 | hosts: vm
5 | gather_facts: no
6 |
7 | tasks:
8 | # Verifies that the flatpaks are installed
9 | - name: Get list of installed Flatpaks
10 | become: true
11 | ansible.builtin.command:
12 | cmd: /usr/bin/flatpak list
13 | register: flatpaks
14 |
15 | - name: Check that VLC is installed
16 | ansible.builtin.assert:
17 | that:
18 | - "'VLC' in flatpaks.stdout"
19 | fail_msg: 'VLC is not installed'
20 |
21 | - name: Check that Firefox is installed
22 | ansible.builtin.assert:
23 | that:
24 | - "'Firefox' in flatpaks.stdout"
25 | fail_msg: 'Firefox is not installed'
26 |
--------------------------------------------------------------------------------
/test/vm/flatpak_update.yml:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env -S ansible-playbook -i ./ansible_inventory
2 | ---
3 | - name: Test flatpak update
4 | hosts: vm
5 | gather_facts: no
6 |
7 | tasks:
8 | # Verifies that the GPG key is functional
9 | - name: Test updating flatpak packages
10 | become: true
11 | ansible.builtin.command:
12 | cmd: /usr/bin/flatpak update -y --noninteractive
13 |
--------------------------------------------------------------------------------
/test/vm/install_image_source.yml:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env -S ansible-playbook -i ./ansible_inventory
2 | ---
3 | - name: Test Container Image source updates
4 | hosts: vm
5 | gather_facts: no
6 |
7 | tasks:
8 | # Get list of origins
9 | - name: Get origin
10 | become: true
11 | ansible.builtin.command:
12 | cmd: /bin/bash -c "cat /ostree/deploy/default/deploy/*.origin"
13 | register: origin
14 |
15 | - name: Get vars
16 | ansible.builtin.set_fact:
17 | image_repo: "{{ lookup('ansible.builtin.env', 'IMAGE_REPO') }}"
18 | image_name: "{{ lookup('ansible.builtin.env', 'IMAGE_NAME') }}"
19 | image_tag: "{{ lookup('ansible.builtin.env', 'IMAGE_TAG') }}"
20 |
21 | - name: Tests
22 | ansible.builtin.assert:
23 | that:
24 | - (image_repo + '/' + image_name + ':' + image_tag) in origin.stdout
25 | fail_msg: 'Origin not configured'
26 |
--------------------------------------------------------------------------------
/xorriso/Makefile:
--------------------------------------------------------------------------------
1 | input.txt: gen_input.sh
2 | find
3 | $(if $(wildcard ../results/boot/grub2/grub.cfg),sed -i 's/quiet/quiet $(EXTRA_BOOT_PARAMS)/g' ../results/boot/grub2/grub.cfg)
4 | sed -i 's/quiet/quiet $(EXTRA_BOOT_PARAMS)/g' ../results/EFI/BOOT/grub.cfg
5 | $(eval _VARS = ARCH FLATPAK_DIR IMAGE_NAME IMAGE_TAG ISO_NAME VERSION)
6 | $(foreach var,$(_VARS),$(var)=$($(var))) bash gen_input.sh | tee input.txt
7 |
8 | install-deps:
9 |
10 | FILES=$(wildcard input.txt)
11 | clean:
12 | ifneq ($(FILES),)
13 | rm -Rf $(FILES)
14 | endif
--------------------------------------------------------------------------------
/xorriso/gen_input.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "-report_about WARNING"
4 | echo "-indev ${PWD}/../results/images/boot.iso"
5 | echo "-outdev ${ISO_NAME}"
6 | echo "-boot_image any replay"
7 | echo "-joliet on"
8 | echo "-compliance joliet_long_names"
9 | pushd "${PWD}/../results" > /dev/null
10 | #for file in $(find .)
11 | for file in ./boot/grub2/grub.cfg ./EFI/BOOT/grub.cfg
12 | do
13 | if [[ "$file" == "./images/boot.iso" ]]
14 | then
15 | continue
16 | fi
17 | if [[ -f ${PWD}/${file} ]]
18 | then
19 | echo "-map ${PWD}/${file} ${file:2}"
20 | echo "-chmod 0444 ${file:2}"
21 | fi
22 | done
23 | popd > /dev/null
24 |
25 | if [[ -n "${FLATPAK_DIR}" ]]
26 | then
27 | pushd "${FLATPAK_DIR}" > /dev/null
28 | for file in $(find repo)
29 | do
30 | if [[ "${file}" == "repo/.lock" ]]
31 | then
32 | continue
33 | fi
34 | echo "-map ${PWD}/${file} flatpak/${file}"
35 | echo "-chmod 0444 flatpak/${file}"
36 | done
37 | popd > /dev/null
38 | fi
39 |
40 | if [ -f "${PWD}/../sb_pubkey.der" ]
41 | then
42 | echo "-map ${PWD}/../sb_pubkey.der sb_pubkey.der"
43 | echo "-chmod 0444 /sb_pubkey.der"
44 | fi
45 |
46 | pushd "${PWD}/../container" > /dev/null
47 | for file in $(find "${IMAGE_NAME}-${IMAGE_TAG}" -type f)
48 | do
49 | echo "-map ${PWD}/${file} ${file}"
50 | echo "-chmod 0444 ${file}"
51 | done
52 | popd > /dev/null
53 | echo "-end"
54 |
--------------------------------------------------------------------------------