From 2dc994447ed9a87db039c9e80373785bd13981ae Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Fri, 9 Feb 2024 21:44:54 +0000 Subject: [PATCH 01/13] add workflow --- .gitmodules | 3 +++ submodules/fedora-kickstarts | 1 + 2 files changed, 4 insertions(+) create mode 100644 .gitmodules create mode 160000 submodules/fedora-kickstarts diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..31c05d6d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "submodules/fedora-kickstarts"] + path = submodules/fedora-kickstarts + url = https://pagure.io/fedora-kickstarts.git diff --git a/submodules/fedora-kickstarts b/submodules/fedora-kickstarts new file mode 160000 index 00000000..d6c06a16 --- /dev/null +++ b/submodules/fedora-kickstarts @@ -0,0 +1 @@ +Subproject commit d6c06a16f9006b0de0e593bda69a0d90a4678346 From 89d1e900cdf328cab401b5723c687db0c2a33749 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Fri, 9 Feb 2024 21:47:08 +0000 Subject: [PATCH 02/13] add workflow --- .github/workflows/iso.yml | 52 +++++++++++++++++++++++++++++++++++++++ .gitmodules | 1 + kickstart.ks | 1 + 3 files changed, 54 insertions(+) create mode 100644 .github/workflows/iso.yml create mode 100644 kickstart.ks diff --git a/.github/workflows/iso.yml b/.github/workflows/iso.yml new file mode 100644 index 00000000..4cca9975 --- /dev/null +++ b/.github/workflows/iso.yml @@ -0,0 +1,52 @@ +name: Create and publish an ISO + +env: + MAJOR_VERION: "f39" + +on: + push: + branches: + - 'main' + tags: + - 'v*' + pull_request: + +jobs: + build-and-push-iso: + runs-on: ubuntu-latest + container: + image: fedora:${{ env.MAJOR_VERSION }} + options: "--device=/dev/loop-control:/dev/loop-control --device=/dev/loop0:/dev/loop0 --cap-add SYS_ADMIN" + permissions: + contents: read + packages: write + + steps: + - name: Install livecd-tools + run: | + dnf install -y \ + livecd-tools \ + pykickstart + + - name: Flatten Kickstart file + run: | + ksflatten \ + -c kickstart.ks \ + -o kickstart-flat.ks + + - name: Create ISO + run: | + livecd-creator --verbose \ + --config=kickstart-flat.ks \ + --fslabel=Fedora-LiveCD \ + --cache =/var/cache/live + + - name: Upload ISO as Artifact + uses: actions/upload-artifact@v4 + with: + name: installer.iso + path: something.iso + if-no-files-found: error + retention-days: 0 + compression-level: 0 + overwrite: true diff --git a/.gitmodules b/.gitmodules index 31c05d6d..5bdcf9c5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "submodules/fedora-kickstarts"] path = submodules/fedora-kickstarts url = https://pagure.io/fedora-kickstarts.git + branch = f39 diff --git a/kickstart.ks b/kickstart.ks new file mode 100644 index 00000000..31faec94 --- /dev/null +++ b/kickstart.ks @@ -0,0 +1 @@ +%include submodules/fedora-kickstarts/fedora-live-base.ks From 23e9d49fa9c7cb09ee28186c6bc701d6fb05e5ab Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Fri, 9 Feb 2024 21:48:00 +0000 Subject: [PATCH 03/13] hardcode --- .github/workflows/iso.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/iso.yml b/.github/workflows/iso.yml index 4cca9975..17a12af2 100644 --- a/.github/workflows/iso.yml +++ b/.github/workflows/iso.yml @@ -1,8 +1,5 @@ name: Create and publish an ISO -env: - MAJOR_VERION: "f39" - on: push: branches: @@ -15,7 +12,7 @@ jobs: build-and-push-iso: runs-on: ubuntu-latest container: - image: fedora:${{ env.MAJOR_VERSION }} + image: fedora:f39 options: "--device=/dev/loop-control:/dev/loop-control --device=/dev/loop0:/dev/loop0 --cap-add SYS_ADMIN" permissions: contents: read From c60f03204a0af81e293b98a658ee0b51435130f2 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Fri, 9 Feb 2024 21:49:15 +0000 Subject: [PATCH 04/13] no f --- .github/workflows/iso.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/iso.yml b/.github/workflows/iso.yml index 17a12af2..ec1167c7 100644 --- a/.github/workflows/iso.yml +++ b/.github/workflows/iso.yml @@ -12,7 +12,7 @@ jobs: build-and-push-iso: runs-on: ubuntu-latest container: - image: fedora:f39 + image: fedora:39 options: "--device=/dev/loop-control:/dev/loop-control --device=/dev/loop0:/dev/loop0 --cap-add SYS_ADMIN" permissions: contents: read From 4fcea269f182013d93d0bf74b643d354b706a117 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Fri, 9 Feb 2024 21:51:31 +0000 Subject: [PATCH 05/13] checkout repo --- .github/workflows/iso.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/iso.yml b/.github/workflows/iso.yml index ec1167c7..85a751b2 100644 --- a/.github/workflows/iso.yml +++ b/.github/workflows/iso.yml @@ -19,6 +19,9 @@ jobs: packages: write steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Install livecd-tools run: | dnf install -y \ From d2657375b91edaae3f6dadab40beefaddfc1aaff Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Fri, 9 Feb 2024 21:53:37 +0000 Subject: [PATCH 06/13] with submodules --- .github/workflows/iso.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/iso.yml b/.github/workflows/iso.yml index 85a751b2..18b2bbe9 100644 --- a/.github/workflows/iso.yml +++ b/.github/workflows/iso.yml @@ -21,7 +21,9 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - + with: + submodules: recursive + - name: Install livecd-tools run: | dnf install -y \ From 9e56ef013d7941a5f01fe4f15645219f6f1ac5a8 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Fri, 9 Feb 2024 21:54:40 +0000 Subject: [PATCH 07/13] install git --- .github/workflows/iso.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/iso.yml b/.github/workflows/iso.yml index 18b2bbe9..d9715afe 100644 --- a/.github/workflows/iso.yml +++ b/.github/workflows/iso.yml @@ -19,17 +19,18 @@ jobs: packages: write steps: + - name: Install Tools + run: | + dnf install -y \ + livecd-tools \ + pykickstart \ + git + - name: Checkout repository uses: actions/checkout@v3 with: submodules: recursive - - name: Install livecd-tools - run: | - dnf install -y \ - livecd-tools \ - pykickstart - - name: Flatten Kickstart file run: | ksflatten \ From 3eb12341f8d5b4ad34ecf130aa933bcf1a9622a6 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Fri, 9 Feb 2024 21:56:20 +0000 Subject: [PATCH 08/13] more access --- .github/workflows/iso.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/iso.yml b/.github/workflows/iso.yml index d9715afe..b9dcad0b 100644 --- a/.github/workflows/iso.yml +++ b/.github/workflows/iso.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest container: image: fedora:39 - options: "--device=/dev/loop-control:/dev/loop-control --device=/dev/loop0:/dev/loop0 --cap-add SYS_ADMIN" + options: "--device=/dev/loop-control:/dev/loop-control --device=/dev/loop0:/dev/loop0 --privileged" permissions: contents: read packages: write From 089b8b16b2d75c8cf3e0b077e8bb677b4ec1fb89 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Fri, 9 Feb 2024 22:06:48 +0000 Subject: [PATCH 09/13] fix iso name --- .github/workflows/iso.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/iso.yml b/.github/workflows/iso.yml index b9dcad0b..0304ad91 100644 --- a/.github/workflows/iso.yml +++ b/.github/workflows/iso.yml @@ -47,8 +47,8 @@ jobs: - name: Upload ISO as Artifact uses: actions/upload-artifact@v4 with: - name: installer.iso - path: something.iso + name: Fedora-LiveCD.iso + path: Fedora-LiveCD.iso if-no-files-found: error retention-days: 0 compression-level: 0 From 273e1c716163e9006d504673aef1265b455a4dce Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Fri, 9 Feb 2024 22:57:32 +0000 Subject: [PATCH 10/13] remove submodule --- .gitmodules | 4 ---- submodules/fedora-kickstarts | 1 - 2 files changed, 5 deletions(-) delete mode 100644 .gitmodules delete mode 160000 submodules/fedora-kickstarts diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 5bdcf9c5..00000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "submodules/fedora-kickstarts"] - path = submodules/fedora-kickstarts - url = https://pagure.io/fedora-kickstarts.git - branch = f39 diff --git a/submodules/fedora-kickstarts b/submodules/fedora-kickstarts deleted file mode 160000 index d6c06a16..00000000 --- a/submodules/fedora-kickstarts +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d6c06a16f9006b0de0e593bda69a0d90a4678346 From b2ec57e4e3c6ca28aa07e9bcfcc55ed96c21bd1b Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Fri, 9 Feb 2024 23:00:25 +0000 Subject: [PATCH 11/13] add correct submodule --- .gitmodules | 4 ++++ submodules/fedora-kickstarts | 1 + 2 files changed, 5 insertions(+) create mode 100644 .gitmodules create mode 160000 submodules/fedora-kickstarts diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..5bdcf9c5 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "submodules/fedora-kickstarts"] + path = submodules/fedora-kickstarts + url = https://pagure.io/fedora-kickstarts.git + branch = f39 diff --git a/submodules/fedora-kickstarts b/submodules/fedora-kickstarts new file mode 160000 index 00000000..465debb7 --- /dev/null +++ b/submodules/fedora-kickstarts @@ -0,0 +1 @@ +Subproject commit 465debb7c90c8ab4c68e14ff48fe50f796b1c089 From 1828adb29962b018790367c1585dc7c56e085588 Mon Sep 17 00:00:00 2001 From: Jason N <33561705+JasonN3@users.noreply.github.com> Date: Wed, 14 Feb 2024 08:19:09 -0500 Subject: [PATCH 12/13] Generate Anaconda installer --- .github/workflows/iso.yml | 58 +++++++++++++++++++++++------------- .gitmodules | 4 --- kickstart.ks | 1 - submodules/fedora-kickstarts | 1 - 4 files changed, 37 insertions(+), 27 deletions(-) delete mode 100644 .gitmodules delete mode 100644 kickstart.ks delete mode 160000 submodules/fedora-kickstarts diff --git a/.github/workflows/iso.yml b/.github/workflows/iso.yml index 0304ad91..985c635a 100644 --- a/.github/workflows/iso.yml +++ b/.github/workflows/iso.yml @@ -8,48 +8,64 @@ on: - 'v*' pull_request: +env: + IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} + + jobs: build-and-push-iso: runs-on: ubuntu-latest container: image: fedora:39 - options: "--device=/dev/loop-control:/dev/loop-control --device=/dev/loop0:/dev/loop0 --privileged" + options: "--privileged" + volumes: + - /:/host permissions: contents: read packages: write steps: - - name: Install Tools + - name: Cleanup host space + run: | + df -h /host || true + rm -rf /host/usr/local/lib/android || true + rm -rf /host/usr/share/dotnet || true + rm -rf /host/opt/ghc || true + rm -rf /host/usr/local/.ghcup || true + df -h /host || true + + - name: Install tools run: | dnf install -y \ - livecd-tools \ - pykickstart \ - git + lorax \ + xorriso \ + git \ + rpm-ostree - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive - - name: Flatten Kickstart file + - name: Create boot.iso + env: + version: "39" + arch: "x86_64" run: | - ksflatten \ - -c kickstart.ks \ - -o kickstart-flat.ks + lorax -p Fedora -v $version -r $version -t Server \ + --isfinal --buildarch=${arch} --volid=Fedora-S-dvd-${arch}-${version} \ + --macboot --noupgrade \ + --repo /etc/yum.repos.d/fedora.repo \ + --repo /etc/yum.repos.d/fedora-updates.repo \ + --rootfs-size 9 \ + ./results/ - - name: Create ISO - run: | - livecd-creator --verbose \ - --config=kickstart-flat.ks \ - --fslabel=Fedora-LiveCD \ - --cache =/var/cache/live - - - name: Upload ISO as Artifact + - name: Upload ISO as artifact uses: actions/upload-artifact@v4 with: - name: Fedora-LiveCD.iso - path: Fedora-LiveCD.iso + name: ISOs + path: results/images/boot.iso if-no-files-found: error retention-days: 0 compression-level: 0 - overwrite: true + overwrite: true \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 5bdcf9c5..00000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "submodules/fedora-kickstarts"] - path = submodules/fedora-kickstarts - url = https://pagure.io/fedora-kickstarts.git - branch = f39 diff --git a/kickstart.ks b/kickstart.ks deleted file mode 100644 index 31faec94..00000000 --- a/kickstart.ks +++ /dev/null @@ -1 +0,0 @@ -%include submodules/fedora-kickstarts/fedora-live-base.ks diff --git a/submodules/fedora-kickstarts b/submodules/fedora-kickstarts deleted file mode 160000 index 465debb7..00000000 --- a/submodules/fedora-kickstarts +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 465debb7c90c8ab4c68e14ff48fe50f796b1c089 From a00fc343c688ab0a2112961bb4527482f7b409a8 Mon Sep 17 00:00:00 2001 From: Jason N <33561705+JasonN3@users.noreply.github.com> Date: Thu, 15 Feb 2024 09:08:55 -0500 Subject: [PATCH 13/13] Run setup using ostreecontainer --- .github/workflows/iso.yml | 98 +++++++++++++++------- .gitignore | 12 +++ Makefile | 78 +++++++++++++++++ lorax_templates/configure_upgrades.tmpl.in | 3 + lorax_templates/set_installer.tmpl.in | 1 + xorriso/gen_input.sh.in | 15 ++++ 6 files changed, 176 insertions(+), 31 deletions(-) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 lorax_templates/configure_upgrades.tmpl.in create mode 100644 lorax_templates/set_installer.tmpl.in create mode 100644 xorriso/gen_input.sh.in diff --git a/.github/workflows/iso.yml b/.github/workflows/iso.yml index 985c635a..85b7f628 100644 --- a/.github/workflows/iso.yml +++ b/.github/workflows/iso.yml @@ -8,9 +8,40 @@ on: - 'v*' pull_request: -env: - IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} + workflow_call: + inputs: + IMAGE_VERSION: + required: true + type: string + IMAGE_ARCH: + required: true + type: string + IMAGE_NAME: + required: true + type: string + IMAGE_REPO: + required: true + type: string + VARIANT: + required: true + type: string + BUILD_REPO: + required: false + type: string + default: JasonN3/container-installer + BUILD_REF: + required: false + type: string + default: main +env: + IMAGE_VERSION: ${{ github.event.inputs.IMAGE_VERSION || '39' }} + IMAGE_ARCH: ${{ github.event.inputs.IMAGE_ARCH || 'x86_64' }} + IMAGE_NAME: ${{ github.event.inputs.IMAGE_NAME || 'base-main' }} + IMAGE_REPO: ${{ github.event.inputs.IMAGE_REPO || 'ghcr.io/ublue-os' }} + VARIANT: ${{ github.event.inputs.VARIANT || 'Silverblue' }} + CURR_REPO: ${{ github.event.inputs.BUILD_REPO || github.repository }} + CURR_REF: ${{ github.event.inputs.BUILD_REF || github.ref }} jobs: build-and-push-iso: @@ -18,53 +49,58 @@ jobs: container: image: fedora:39 options: "--privileged" - volumes: - - /:/host permissions: contents: read packages: write steps: - - name: Cleanup host space - run: | - df -h /host || true - rm -rf /host/usr/local/lib/android || true - rm -rf /host/usr/share/dotnet || true - rm -rf /host/opt/ghc || true - rm -rf /host/usr/local/.ghcup || true - df -h /host || true - - - name: Install tools - run: | - dnf install -y \ - lorax \ - xorriso \ - git \ - rpm-ostree + - name: Install make and git + run: dnf install -y make git - name: Checkout repository uses: actions/checkout@v4 with: + repository: ${{ env.CURR_REPO }} + ref: ${{ env.CURR_REF }} submodules: recursive + - name: Install dependencies + run: make install-deps + + - name: Download image + run: | + make container/${IMAGE_NAME}-${IMAGE_VERSION} \ + arch=${IMAGE_ARCH} \ + version=${IMAGE_VERSION} \ + image_repo=${IMAGE_REPO} \ + image_name=${IMAGE_NAME} \ + variant=${VARIANT} + - name: Create boot.iso - env: - version: "39" - arch: "x86_64" run: | - lorax -p Fedora -v $version -r $version -t Server \ - --isfinal --buildarch=${arch} --volid=Fedora-S-dvd-${arch}-${version} \ - --macboot --noupgrade \ - --repo /etc/yum.repos.d/fedora.repo \ - --repo /etc/yum.repos.d/fedora-updates.repo \ - --rootfs-size 9 \ - ./results/ + make boot.iso \ + arch=${IMAGE_ARCH} \ + version=${IMAGE_VERSION} \ + image_repo=${IMAGE_REPO} \ + image_name=${IMAGE_NAME} \ + variant=${VARIANT} + + - name: Create deploy.iso + run: | + make ${IMAGE_NAME}-${IMAGE_VERSION}.iso \ + arch=${IMAGE_ARCH} \ + version=${IMAGE_VERSION} \ + image_repo=${IMAGE_REPO} \ + image_name=${IMAGE_NAME} \ + variant=${VARIANT} + mkdir end_iso + mv ${IMAGE_NAME}-${IMAGE_VERSION}.iso end_iso/ - name: Upload ISO as artifact uses: actions/upload-artifact@v4 with: name: ISOs - path: results/images/boot.iso + path: end_iso/*.iso if-no-files-found: error retention-days: 0 compression-level: 0 diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..03894b91 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +/debugdata +/container +/pkglists +/results +/lorax_templates/*.tmpl +/xorriso/input.txt +/xorriso/*.sh +/original-pkgsizes.txt +/final-pkgsizes.txt +/lorax.conf +/*.iso +/*.log \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..d3844766 --- /dev/null +++ b/Makefile @@ -0,0 +1,78 @@ +arch = x86_64 +version = 39 +base_dir = $(shell pwd) +image_repo = ghcr.io/ublue-os +image_name = base-main +variant = Silverblue + +image_repo_escaped = $(subst /,\/,$(image_repo)) +image_repo_double_escaped = $(subst \,\\\,$(image_repo_escaped)) + +ifeq ($(variant),'Server') +lorax_args = --macboot --noupgrade +else +lorax_args = --nomacboot +endif + +$(image_name)-$(version).iso: boot.iso container/$(image_name)-$(version) xorriso/input.txt + xorriso -dialog on < $(base_dir)/xorriso/input.txt + +boot.iso: lorax_templates/set_installer.tmpl lorax_templates/configure_upgrades.tmpl + rm -Rf $(base_dir)/results + lorax -p $(image_name) -v $(version) -r $(version) -t $(variant) \ + --isfinal --buildarch=$(arch) --volid=$(image_name)-$(arch)-$(version) \ + $(lorax_args) \ + --repo /etc/yum.repos.d/fedora.repo \ + --repo /etc/yum.repos.d/fedora-updates.repo \ + --add-template $(base_dir)/lorax_templates/set_installer.tmpl \ + --add-template $(base_dir)/lorax_templates/configure_upgrades.tmpl \ + $(base_dir)/results/ + mv $(base_dir)/results/images/boot.iso $(base_dir)/ + +container/$(image_name)-$(version): + mkdir container + podman pull $(image_repo)/$(image_name):$(version) + podman save --format oci-dir -o $(base_dir)/container/$(image_name)-$(version) $(image_repo)/$(image_name):$(version) + podman rmi $(image_repo)/$(image_name):$(version) + +install-deps: + dnf install -y lorax xorriso podman git rpm-ostree + + + +lorax_templates/%.tmpl: lorax_templates/%.tmpl.in + sed 's/@IMAGE_NAME@/$(image_name)/' $(base_dir)/lorax_templates/$*.tmpl.in > $(base_dir)/lorax_templates/$*.tmpl + sed 's/@IMAGE_REPO@/$(image_repo_escaped)/' $(base_dir)/lorax_templates/$*.tmpl > $(base_dir)/lorax_templates/$*.tmpl.tmp + mv $(base_dir)/lorax_templates/$*.tmpl{.tmp,} + sed 's/@VERSION@/$(version)/' $(base_dir)/lorax_templates/$*.tmpl > $(base_dir)/lorax_templates/$*.tmpl.tmp + mv $(base_dir)/lorax_templates/$*.tmpl{.tmp,} + sed 's/@IMAGE_REPO_ESCAPED@/$(image_repo_double_escaped)/' $(base_dir)/lorax_templates/$*.tmpl > $(base_dir)/lorax_templates/$*.tmpl.tmp + mv $(base_dir)/lorax_templates/$*.tmpl{.tmp,} + + + +xorriso/input.txt: xorriso/gen_input.sh + bash $(base_dir)/xorriso/gen_input.sh | tee $(base_dir)/xorriso/input.txt + +xorriso/%.sh: xorriso/%.sh.in + sed 's/@IMAGE_NAME@/$(image_name)/' $(base_dir)/xorriso/$*.sh.in > $(base_dir)/xorriso/$*.sh + sed 's/@VERSION@/$(version)/' $(base_dir)/xorriso/$*.sh > $(base_dir)/xorriso/$*.sh.tmp + mv $(base_dir)/xorriso/$*.sh{.tmp,} + sed 's/@ARCH@/$(arch)/' $(base_dir)/xorriso/$*.sh > $(base_dir)/xorriso/$*.sh.tmp + mv $(base_dir)/xorriso/$*.sh{.tmp,} + + +clean: + rm -Rf $(base_dir)/container || true + rm -Rf $(base_dir)/debugdata || true + rm -Rf $(base_dir)/pkglists || true + rm -Rf $(base_dir)/results || true + rm -f $(base_dir)/lorax_templates/*.tmpl || true + rm -f $(base_dir)/xorriso/input.txt || true + rm -f $(base_dir)/xorriso/*.sh || true + rm -f $(base_dir)/{original,final}-pkgsizes.txt || true + rm -f $(base_dir)/lorax.conf || true + rm -f $(base_dir)/*.iso || true + rm -f $(base_dir)/*.log || true + + diff --git a/lorax_templates/configure_upgrades.tmpl.in b/lorax_templates/configure_upgrades.tmpl.in new file mode 100644 index 00000000..2bbb92ae --- /dev/null +++ b/lorax_templates/configure_upgrades.tmpl.in @@ -0,0 +1,3 @@ +append usr/share/anaconda/interactive-defaults.ks "%post --erroronfail" +append usr/share/anaconda/interactive-defaults.ks "sed -i 's/container-image-reference=.*/container-image-reference=ostree-image-signed:docker:\/\/@IMAGE_REPO_ESCAPED@\/@IMAGE_NAME@:@VERSION@/' /ostree/deploy/default/deploy/*.origin" +append usr/share/anaconda/interactive-defaults.ks "%end" \ No newline at end of file diff --git a/lorax_templates/set_installer.tmpl.in b/lorax_templates/set_installer.tmpl.in new file mode 100644 index 00000000..13332ff6 --- /dev/null +++ b/lorax_templates/set_installer.tmpl.in @@ -0,0 +1 @@ +append usr/share/anaconda/interactive-defaults.ks "ostreecontainer --url=/run/install/repo/@IMAGE_NAME@-@VERSION@ --transport=oci --no-signature-verification" \ No newline at end of file diff --git a/xorriso/gen_input.sh.in b/xorriso/gen_input.sh.in new file mode 100644 index 00000000..167e3b03 --- /dev/null +++ b/xorriso/gen_input.sh.in @@ -0,0 +1,15 @@ +#!/bin/bash + +echo "-indev $(pwd)/boot.iso" +echo "-outdev $(pwd)/@IMAGE_NAME@-@VERSION@.iso" +echo "-boot_image any replay" +echo "-volid @IMAGE_NAME@-@ARCH@-@VERSION@" +echo "-joliet on" +echo "-compliance joliet_long_names" +cd container +for file in $(find @IMAGE_NAME@-@VERSION@) +do + echo "-map $(pwd)/${file} ${file}" + echo "-chmod 0444 ${file}" +done +echo "-end" \ No newline at end of file