From 82c0f337619ba9c8f6622d4e6176f9af6e971e17 Mon Sep 17 00:00:00 2001 From: Lleyton Gray Date: Fri, 4 Oct 2024 00:56:16 -0700 Subject: [PATCH 1/6] feat: WSL --- katsu/modules/wsl/wsl.yaml | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 katsu/modules/wsl/wsl.yaml diff --git a/katsu/modules/wsl/wsl.yaml b/katsu/modules/wsl/wsl.yaml new file mode 100644 index 0000000..87b77af --- /dev/null +++ b/katsu/modules/wsl/wsl.yaml @@ -0,0 +1,41 @@ +builder: dnf + +scripts: + post: + - id: cleanup + name: Clean up system + file: cleanup.sh + - id: selinux-setup + name: Set up SELinux + file: selinux.sh + - id: buildstamp + name: Generate buildstamp + file: buildstamp.sh + +dnf: + repodir: ../base/repodir/ + releasever: 41 + exec: dnf4 + options: + - --setopt=cachedir=/var/cache/dnf + - --setopt=keepcache=True + - --setopt=tsflags= + - --setopt=max_parallel_downloads=20 + exclude: + - fedora-release* + - generic-release* + - kernel* + - linux-firmware + packages: + - "@core" + - "@ultramarine-product-common" + - filesystem + - setup + - glibc + - glibc-common + - dnf + - git + - rpm + - libgomp + - ultramarine-release-identity-basic + - fedora-repos From f2a59c59873808f67f8dada20145131408737ceb Mon Sep 17 00:00:00 2001 From: lea Date: Fri, 4 Oct 2024 01:19:14 -0700 Subject: [PATCH 2/6] tar time --- .github/workflows/build-katsu.yml | 63 +++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/.github/workflows/build-katsu.yml b/.github/workflows/build-katsu.yml index 3a28a65..cd25fb5 100644 --- a/.github/workflows/build-katsu.yml +++ b/.github/workflows/build-katsu.yml @@ -190,6 +190,61 @@ jobs: path: katsu/*.iso compression-level: 0 + tar: + strategy: + fail-fast: false + matrix: + arch: + - x86_64 + - aarch64 + variant: + - wsl/wsl + runs-on: ${{ matrix.arch == 'x86_64' && 'ubuntu-latest' || 'arm64' }} + container: + image: ghcr.io/terrapkg/builder:f41 + # Pass /dev from host to container + # Very hacky, but it works + # Microsoft/Github, if you're reading this, + # I'm sorry. + options: --privileged -v /dev:/dev + steps: + - name: Install dependencies + run: | + dnf up -y + dnf install -y $DNF_PKGS + dnf clean all + - name: Checkout + uses: actions/checkout@v4 + - name: sanitize artifact name + run: | + name=$(echo ${{ matrix.variant }} | sed 's/\//-/g') + name=$name-${{ matrix.arch }} + + # set github variable + echo artifact=$name >> $GITHUB_ENV + # Get architecture + # e.g. base/base-disk-x86_64 -> x86_64 + echo arch=$(echo ${{ matrix.variant }} | cut -d'-' -f3) >> $GITHUB_ENV + + - name: ${{ env.KATSU_BUILD_TASK_NAME }} + run: | + rm -rf /etc/rpm/macros.image-language-conf + chcon system_u:object_r:install_exec_t:s0 "$(which katsu)" + pushd katsu + KATSU_LOG=trace katsu -v --output=fs "modules/${{ matrix.variant }}.yaml" + tar -cJf katsu-work/chroot.tar katsu-work/chroot + mv katsu-work/chroot.tar katsu-work/${{ env.artifact }}.tar + # compress tar as zst, output as .tar.zst + zstd -T0 -19 katsu-work/${{ env.artifact }}.tar -o katsu-work/${{ env.artifact }}.tar.zst + popd + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ env.artifact }}-tar + path: katsu/katsu-work/*.tar.zst + compression-level: 0 + #### LIVE ISO PUSH #### push-image: @@ -200,6 +255,7 @@ jobs: needs: - live-iso - image + - tar if: github.event_name != 'pull_request' steps: @@ -250,6 +306,13 @@ jobs: fi done + for file in artifacts/*-tar/*; do + # if is file + if [ -f "$file" ]; then + pack_image $file images + fi + done + - name: Upload to R2 run: | wget https://dl.min.io/client/mc/release/linux-arm64/mc From 0ebb18dc31a078118a5dcf5e76c470e22c343704 Mon Sep 17 00:00:00 2001 From: lea Date: Fri, 4 Oct 2024 01:23:54 -0700 Subject: [PATCH 3/6] no scripts for now --- katsu/modules/wsl/wsl.yaml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/katsu/modules/wsl/wsl.yaml b/katsu/modules/wsl/wsl.yaml index 87b77af..ad67fa1 100644 --- a/katsu/modules/wsl/wsl.yaml +++ b/katsu/modules/wsl/wsl.yaml @@ -1,17 +1,5 @@ builder: dnf -scripts: - post: - - id: cleanup - name: Clean up system - file: cleanup.sh - - id: selinux-setup - name: Set up SELinux - file: selinux.sh - - id: buildstamp - name: Generate buildstamp - file: buildstamp.sh - dnf: repodir: ../base/repodir/ releasever: 41 From 21ac089f24d2bf3da499eb867e2229de1c99c750 Mon Sep 17 00:00:00 2001 From: Lleyton Gray Date: Fri, 1 Nov 2024 21:05:25 -0700 Subject: [PATCH 4/6] fix: upload WSL add .tar.gz --- .github/workflows/build-katsu.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-katsu.yml b/.github/workflows/build-katsu.yml index cd25fb5..2e8a721 100644 --- a/.github/workflows/build-katsu.yml +++ b/.github/workflows/build-katsu.yml @@ -235,14 +235,21 @@ jobs: tar -cJf katsu-work/chroot.tar katsu-work/chroot mv katsu-work/chroot.tar katsu-work/${{ env.artifact }}.tar # compress tar as zst, output as .tar.zst - zstd -T0 -19 katsu-work/${{ env.artifact }}.tar -o katsu-work/${{ env.artifact }}.tar.zst + # have an exception for WSL, as it doesn't support zstd + if [ "${{ matrix.variant }}" = "wsl/wsl" ]; then + gzip -9 katsu-work/${{ env.artifact }}.tar > katsu-work/${{ env.artifact }}.tar.gz + elif + zstd -T0 -19 katsu-work/${{ env.artifact }}.tar -o katsu-work/${{ env.artifact }}.tar.zst + fi popd - name: Upload Artifact uses: actions/upload-artifact@v4 with: name: ${{ env.artifact }}-tar - path: katsu/katsu-work/*.tar.zst + path: | + katsu/katsu-work/*.tar.zst + katsu/katsu-work/*.tar.gz compression-level: 0 #### LIVE ISO PUSH #### From 98de8b4f193e48ba3b76bd5c8e12561381ac4f4e Mon Sep 17 00:00:00 2001 From: lea Date: Fri, 1 Nov 2024 21:30:13 -0700 Subject: [PATCH 5/6] a --- .github/workflows/build-katsu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-katsu.yml b/.github/workflows/build-katsu.yml index 2e8a721..1c84287 100644 --- a/.github/workflows/build-katsu.yml +++ b/.github/workflows/build-katsu.yml @@ -238,7 +238,7 @@ jobs: # have an exception for WSL, as it doesn't support zstd if [ "${{ matrix.variant }}" = "wsl/wsl" ]; then gzip -9 katsu-work/${{ env.artifact }}.tar > katsu-work/${{ env.artifact }}.tar.gz - elif + else zstd -T0 -19 katsu-work/${{ env.artifact }}.tar -o katsu-work/${{ env.artifact }}.tar.zst fi popd From 901c546634d2ef0fc4481907e78bb641c2923581 Mon Sep 17 00:00:00 2001 From: lea Date: Sat, 2 Nov 2024 12:19:23 -0700 Subject: [PATCH 6/6] gzip with -c for stdout? --- .github/workflows/build-katsu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-katsu.yml b/.github/workflows/build-katsu.yml index 1c84287..fa18998 100644 --- a/.github/workflows/build-katsu.yml +++ b/.github/workflows/build-katsu.yml @@ -237,7 +237,7 @@ jobs: # compress tar as zst, output as .tar.zst # have an exception for WSL, as it doesn't support zstd if [ "${{ matrix.variant }}" = "wsl/wsl" ]; then - gzip -9 katsu-work/${{ env.artifact }}.tar > katsu-work/${{ env.artifact }}.tar.gz + gzip -9 -c katsu-work/${{ env.artifact }}.tar > katsu-work/${{ env.artifact }}.tar.gz else zstd -T0 -19 katsu-work/${{ env.artifact }}.tar -o katsu-work/${{ env.artifact }}.tar.zst fi