From e3037d8f1ecf07aece30e07812e16547c268b833 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Wed, 14 Feb 2024 13:23:36 +0000 Subject: [PATCH] generate with ostree objects --- .github/workflows/iso.yml | 1 + lorax_templates/config_repo.tmpl | 11 +++++++++++ lorax_templates/embed.tmpl | 5 +++++ lorax_templates/registry_cache.tmpl | 1 + scripts/gen_xorriso.sh | 11 +++++++++++ 5 files changed, 29 insertions(+) create mode 100644 lorax_templates/config_repo.tmpl create mode 100644 lorax_templates/embed.tmpl create mode 100644 lorax_templates/registry_cache.tmpl create mode 100644 scripts/gen_xorriso.sh diff --git a/.github/workflows/iso.yml b/.github/workflows/iso.yml index 985c635..5595bac 100644 --- a/.github/workflows/iso.yml +++ b/.github/workflows/iso.yml @@ -57,6 +57,7 @@ jobs: --macboot --noupgrade \ --repo /etc/yum.repos.d/fedora.repo \ --repo /etc/yum.repos.d/fedora-updates.repo \ + --add-template ${GITHUB_WORKSPACE}/lorax_templates/embed.tmpl \ --rootfs-size 9 \ ./results/ diff --git a/lorax_templates/config_repo.tmpl b/lorax_templates/config_repo.tmpl new file mode 100644 index 0000000..72db516 --- /dev/null +++ b/lorax_templates/config_repo.tmpl @@ -0,0 +1,11 @@ +<%page args="ostree_osname, ostree_install_repo, ostree_update_repo, ostree_install_ref, ostree_update_ref, ostree_oskey"/> + +append usr/share/anaconda/interactive-defaults.ks "ostreesetup --nogpg --osname=${ostree_osname} --remote=${ostree_osname} --url=file:///ostree/repo --ref=${ostree_update_ref}" +append usr/share/anaconda/interactive-defaults.ks "firewall --use-system-defaults" +append usr/share/anaconda/interactive-defaults.ks "%post --erroronfail" +%if ostree_osname != "fedora": + append usr/share/anaconda/interactive-defaults.ks "rm -f /etc/ostree/remotes.d/${ostree_osname}.conf" + append usr/share/anaconda/interactive-defaults.ks "ostree remote add --set=gpg-verify=true --set=gpgkeypath=/etc/pki/rpm-gpg/ --set=contenturl=${ostree_contenturl} ${ostree_osname} '${ostree_update_repo}'" +%endif +append usr/share/anaconda/interactive-defaults.ks "cp /etc/skel/.bash* /root" +append usr/share/anaconda/interactive-defaults.ks "%end" \ No newline at end of file diff --git a/lorax_templates/embed.tmpl b/lorax_templates/embed.tmpl new file mode 100644 index 0000000..0af56ec --- /dev/null +++ b/lorax_templates/embed.tmpl @@ -0,0 +1,5 @@ +<%page args="root"/> +runcmd mkdir ${root}/ostree +runcmd ostree --repo=${root}/ostree/repo init --mode=bare +runcmd ostree container unencapsulate --repo=${root}/ostree/repo ostree-unverified-image:docker://ghcr.io/jasonn3/base-main:39 +runcmd ostree --repo=${root}/ostree/repo summary -u \ No newline at end of file diff --git a/lorax_templates/registry_cache.tmpl b/lorax_templates/registry_cache.tmpl new file mode 100644 index 0000000..8975fed --- /dev/null +++ b/lorax_templates/registry_cache.tmpl @@ -0,0 +1 @@ +append usr/share/anaconda/interactive-defaults.ks "ostreecontainer --remote=ostree-unverified-image:registry:ghcr.io/ublue-os/base-main:39 --url=file:///run/install/repo/base-main.tar --transport=oci-archive --no-signature-verification" diff --git a/scripts/gen_xorriso.sh b/scripts/gen_xorriso.sh new file mode 100644 index 0000000..df758e8 --- /dev/null +++ b/scripts/gen_xorriso.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +echo "-indev $(pwd)/results/images/boot.iso" +echo "-outdev $(pwd)/results/images/deploy.iso" +echo "-boot_image any replay" +echo "-volid Fedora-S-dvd-x86_64-39" +echo "-joliet on" +echo "-compliance joliet_long_names" +echo "-map $(pwd)/base-main.tar base-main.tar" +echo "-chmod 0444 base-main.tar" +echo "-end" \ No newline at end of file