From 8ebb2a409c38dee7b7b2b4b98963ff19735c873a Mon Sep 17 00:00:00 2001 From: sharpenedblade Date: Mon, 6 Nov 2023 16:22:58 -0800 Subject: [PATCH] Add support for multiple ISOs Large ISOs are split --- .github/workflows/build-iso.yml | 4 +-- .gitignore | 1 + README.md | 2 ++ build.sh | 42 ++++++++++++++++++++---------- t2linux-fedora-workstation-live.ks | 2 -- 5 files changed, 33 insertions(+), 18 deletions(-) create mode 100644 .gitignore delete mode 100644 t2linux-fedora-workstation-live.ks diff --git a/.github/workflows/build-iso.yml b/.github/workflows/build-iso.yml index 38aeaf5..4fd39c3 100644 --- a/.github/workflows/build-iso.yml +++ b/.github/workflows/build-iso.yml @@ -44,11 +44,11 @@ jobs: uses: actions/upload-artifact@v3 with: name: fedora-iso - path: ./_output/* + path: builddir/iso/*.iso - name: Release uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: files: | - _output/*.iso + builddir/iso/*.iso diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e2be6ae --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +builddir/ diff --git a/README.md b/README.md index 873d1f5..3e26c89 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # t2linux-fedora-iso A instalation ISO for Fedora on T2 macs. It uses the kernel patches from the [t2linux](https://t2linux.org) project. Read the [kernel README](https://github.com/t2linux/fedora-kernel/) for more information. Make sure to download the `.iso` or `.iso.0x` file. +Combine the split ISOs with `cat name_of_iso_here.iso.* > full.iso`. + ## Disclaimer This project is not officially provided or supported by the Fedora Project. The official Fedora software is available at [https://fedoraproject.org/](https://fedoraproject.org/). This project is not related to Fedora in any way. diff --git a/build.sh b/build.sh index c605401..cf4f4be 100755 --- a/build.sh +++ b/build.sh @@ -1,18 +1,32 @@ #!/usr/bin/bash +set -e -cd /repo/fedora-kickstarts -cp -rfv /repo/*.ks . -sudo ksflatten -c t2linux-fedora-workstation-live.ks -o flat.ks +kickstarts=( "fedora-live-workstation" ) -livemedia-creator \ - --ks flat.ks \ - --no-virt \ - --resultdir /var/lmc \ - --project Fedora-Workstation-Live-t2linux \ - --make-iso \ - --volid Fedora-WS-Live-t2-39-0.1.5 \ - --iso-only \ - --iso-name Fedora-Workstation-Live-t2linux-x86_64-39-0.1.5.iso \ - --releasever 39 +mkdir -p /repo/builddir/iso +builddir=$(mktemp -d -p "/repo/builddir"); export builddir +function cleanup { + rm -rf "$builddir" +} +trap cleanup EXIT -mkdir -p _output && mv /var/lmc/*.iso _output/ +for ks in "${kickstarts[@]}"; do + ks_builddir="$builddir/$ks"; mkdir -p $ks_builddir; cd "$ks_builddir" + cp -r /repo/fedora-kickstarts/* .; cp -f /repo/*.ks . + echo '%include t2linux-fedora-common.ks' >> "$ks.ks" + sudo ksflatten --config "$ks.ks" --output "$ks-flat.ks" --version F39 + livemedia-creator \ + --make-iso \ + --iso-only \ + --no-virt \ + --nomacboot \ + --resultdir results \ + --releasever 39 \ + --ks "$ks-flat.ks" \ + --project t2linux-Fedora-Live \ + --volid t2linux-Fedora-Live-39 \ + --iso-name "t2linux-$ks-39.iso" + find results/*.iso -size +2G -exec sh -c "split -b 1999M -x {} {}. && rm {}" \; + mv results/* /repo/builddir/iso/ +done +cleanup diff --git a/t2linux-fedora-workstation-live.ks b/t2linux-fedora-workstation-live.ks deleted file mode 100644 index a2a28d8..0000000 --- a/t2linux-fedora-workstation-live.ks +++ /dev/null @@ -1,2 +0,0 @@ -%include t2linux-fedora-common.ks -%include fedora-live-workstation.ks