From ca41746866991f2da2d3c7132223598a6d0a5b3b Mon Sep 17 00:00:00 2001 From: madomado Date: Tue, 14 May 2024 15:28:09 +0800 Subject: [PATCH 1/7] feat: switch to dnf5 as default backend --- src/builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/builder.rs b/src/builder.rs index 5ef7e32..4ef703d 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -289,7 +289,7 @@ pub trait RootBuilder { } fn _default_dnf() -> String { - String::from("dnf") + String::from("dnf5") } #[derive(Deserialize, Debug, Clone, Serialize, Default)] From b0822bd23693e268b920ea7579dba2f590ff81a6 Mon Sep 17 00:00:00 2001 From: madomado Date: Tue, 14 May 2024 16:09:53 +0800 Subject: [PATCH 2/7] chore(ci): switch to f40 --- .github/workflows/build-test.yml | 7 +-- .github/workflows/release.yml | 73 +++++++++++++++----------------- .github/workflows/test.yml | 6 +-- Dockerfile | 2 +- 4 files changed, 39 insertions(+), 49 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 68e56da..2f43ef6 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -41,7 +41,7 @@ jobs: image-arm: runs-on: ubuntu-latest container: - image: ghcr.io/terrapkg/builder:f38 + image: ghcr.io/terrapkg/builder:f40 # Pass /dev from host to container # Very hacky, but it works # Microsoft/Github, if you're reading this, @@ -138,7 +138,6 @@ jobs: name: image-x86_64 path: tests/ng/katsu-work/image/*.raw.xz - iso-x86_64: runs-on: ubuntu-latest container: @@ -189,7 +188,6 @@ jobs: name: iso-x86_64 path: tests/ng/katsu-work/image/*.iso.xz - iso-limine-x86_64: runs-on: ubuntu-latest container: @@ -240,8 +238,6 @@ jobs: name: iso-limine-x86_64 path: tests/ng/katsu-work/image/*.iso.xz - - fs-test-x86_64: runs-on: ubuntu-latest container: @@ -291,4 +287,3 @@ jobs: with: name: iso-limine-x86_64 path: tests/ng/katsu-work/chroot.tar.xz - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c13f7b3..3d09d1f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,50 +38,45 @@ env: isomd5sum jobs: - build: - strategy: - matrix: - arch: [x86_64, aarch64] + build: + strategy: + matrix: + arch: [x86_64, aarch64] - # run job on ubuntu-latest unless aarch64 then arm64 - runs-on: ${{ matrix.arch == 'aarch64' && 'arm64' || 'ubuntu-latest' }} + # run job on ubuntu-latest unless aarch64 then arm64 + runs-on: ${{ matrix.arch == 'aarch64' && 'arm64' || 'ubuntu-latest' }} - container: - image: ghcr.io/terrapkg/builder:f38 + container: + image: ghcr.io/terrapkg/builder:f40 - steps: - - uses: actions/checkout@v4 + steps: + - uses: actions/checkout@v4 - - name: Install dependencies - run: | - dnf install -y $DNF_PKGS + - name: Install dependencies + run: | + dnf install -y $DNF_PKGS - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - - name: Build - run: - cargo build --release - - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ matrix.arch }} - path: target/release/terra - - - - name: Add binary to release - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: target/release/katsu - asset_name: katsu-${{ matrix.arch }} - tag: ${{ github.ref }} - # release_name: ${{ github.ref }} - overwrite: true + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - name: Build + run: cargo build --release + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.arch }} + path: target/release/terra + - name: Add binary to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: target/release/katsu + asset_name: katsu-${{ matrix.arch }} + tag: ${{ github.ref }} + # release_name: ${{ github.ref }} + overwrite: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b4a0c11..37e46c5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ env: jobs: check: container: - image: ghcr.io/terrapkg/builder:f38 + image: ghcr.io/terrapkg/builder:f40 name: Check runs-on: ubuntu-latest steps: @@ -48,7 +48,7 @@ jobs: clippy: name: Clippy container: - image: ghcr.io/terrapkg/builder:f38 + image: ghcr.io/terrapkg/builder:f40 runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -76,7 +76,7 @@ jobs: unit-test: runs-on: ubuntu-latest container: - image: ghcr.io/terrapkg/builder:f38 + image: ghcr.io/terrapkg/builder:f40 steps: - uses: actions/checkout@v4 diff --git a/Dockerfile b/Dockerfile index a4b92d7..982d703 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/terrapkg/builder:f38 +FROM ghcr.io/terrapkg/builder:f40 RUN dnf install -y \ xorriso \ From 5825e23addc5e61cb41c28947b0863a1f3854267 Mon Sep 17 00:00:00 2001 From: madomado Date: Tue, 14 May 2024 16:45:06 +0800 Subject: [PATCH 3/7] chore(tests): again, let's try f40 --- tests/katsudon-arm.yaml | 5 ++--- tests/katsudon-test.yaml | 2 +- tests/ng/katsu-arm.yaml | 3 +-- tests/ng/katsu-iso-limine.yaml | 2 +- tests/ng/katsu-iso.yaml | 2 +- tests/ng/katsu-script-test.yaml | 2 +- tests/ng/katsu.yaml | 2 +- 7 files changed, 8 insertions(+), 10 deletions(-) diff --git a/tests/katsudon-arm.yaml b/tests/katsudon-arm.yaml index 73783c9..2666c1d 100644 --- a/tests/katsudon-arm.yaml +++ b/tests/katsudon-arm.yaml @@ -47,16 +47,15 @@ packages: - shim-aa64 - shim-unsigned-aarch64 - disk: bootloader: true root_format: ext4 disk_size: 8G sys: - releasever: 38 + releasever: 40 rootpw: ultramarine script: init: init.sh - postinst: postinst.sh \ No newline at end of file + postinst: postinst.sh diff --git a/tests/katsudon-test.yaml b/tests/katsudon-test.yaml index c8fbdb7..c399085 100644 --- a/tests/katsudon-test.yaml +++ b/tests/katsudon-test.yaml @@ -31,7 +31,7 @@ packages: - polkit sys: - releasever: 38 + releasever: 40 rootpw: ultramarine script: diff --git a/tests/ng/katsu-arm.yaml b/tests/ng/katsu-arm.yaml index 8d9402d..b45d6a0 100644 --- a/tests/ng/katsu-arm.yaml +++ b/tests/ng/katsu-arm.yaml @@ -1,4 +1,3 @@ - import: - katsu.yaml # Example manifest for a Katsu build @@ -25,4 +24,4 @@ disk: dnf: arch: aarch64 - releasever: 39 + releasever: 40 diff --git a/tests/ng/katsu-iso-limine.yaml b/tests/ng/katsu-iso-limine.yaml index 34ace13..5c9607a 100644 --- a/tests/ng/katsu-iso-limine.yaml +++ b/tests/ng/katsu-iso-limine.yaml @@ -10,7 +10,7 @@ kernel_cmdline: "quiet rhgb" bootloader: limine dnf: - releasever: 39 + releasever: 40 options: - --setopt=keepcache=True - --nogpgcheck diff --git a/tests/ng/katsu-iso.yaml b/tests/ng/katsu-iso.yaml index ca8e7ed..20c19c8 100644 --- a/tests/ng/katsu-iso.yaml +++ b/tests/ng/katsu-iso.yaml @@ -10,7 +10,7 @@ kernel_cmdline: "quiet rhgb" bootloader: grub dnf: - releasever: 39 + releasever: 40 options: - --setopt=keepcache=True - --nogpgcheck diff --git a/tests/ng/katsu-script-test.yaml b/tests/ng/katsu-script-test.yaml index ed472e5..55b357e 100644 --- a/tests/ng/katsu-script-test.yaml +++ b/tests/ng/katsu-script-test.yaml @@ -7,6 +7,6 @@ dnf: options: - --nogpgcheck repodir: modules/repodir/ - releasever: 39 + releasever: 40 packages: - busybox diff --git a/tests/ng/katsu.yaml b/tests/ng/katsu.yaml index d170dbc..bdea9a2 100644 --- a/tests/ng/katsu.yaml +++ b/tests/ng/katsu.yaml @@ -29,5 +29,5 @@ disk: filesystem: ext4 mountpoint: / dnf: - dnf5: true + exec: dnf5 releasever: 39 From dc76e597227a5cdee62c5457791266e02f32ccbd Mon Sep 17 00:00:00 2001 From: madomado Date: Fri, 31 May 2024 11:07:37 +0800 Subject: [PATCH 4/7] fix!: build process continues even if dnf fails --- src/builder.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 4ef703d..bec44da 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -365,10 +365,15 @@ impl RootBuilder for DnfRootBuilder { options.append(&mut exclude.iter().map(|p| format!("--exclude={p}")).collect()); info!("Initializing system with dnf"); - crate::chroot_run_cmd!(&chroot, + let res = crate::chroot_run_cmd!(&chroot, $dnf install -y --releasever=$releasever --installroot=$chroot $[packages] $[options] 2>&1; $dnf clean all --installroot=$chroot; - )?; + ); + + if let Err(e) = res { + error!("{} failed with error: {e:?}", self.exec); + info!("Katsu will continue the build process."); + } info!("Setting up users"); From b92cabbe34e2570cd34b1444a5b2c608a5be72c9 Mon Sep 17 00:00:00 2001 From: madomado Date: Fri, 31 May 2024 11:16:44 +0800 Subject: [PATCH 5/7] fix rustc err --- src/builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/builder.rs b/src/builder.rs index ebd260e..406b6e0 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -354,7 +354,7 @@ impl RootBuilder for DnfRootBuilder { ); if let Err(e) = res { - error!("{} failed with error: {e:?}", self.exec); + tracing::error!("{} failed with error: {e:?}", self.exec); info!("Katsu will continue the build process."); } From 103a9ffb30592fc73dd1dd9a0d421175f2462ddb Mon Sep 17 00:00:00 2001 From: madomado Date: Sat, 1 Jun 2024 11:58:15 +0800 Subject: [PATCH 6/7] try dnf --setopt=tsflags= --- tests/ng/modules/base.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ng/modules/base.yaml b/tests/ng/modules/base.yaml index 93bad70..6fe7118 100644 --- a/tests/ng/modules/base.yaml +++ b/tests/ng/modules/base.yaml @@ -30,6 +30,7 @@ dnf: - --setopt=cachedir=/var/cache/dnf - --nogpgcheck - --setopt=keepcache=True + - --setopt=tsflags= exclude: - fedora-release* - generic-release* From d066aac13d31ddd31a50916256d27200c2aa8add Mon Sep 17 00:00:00 2001 From: madomado Date: Sat, 1 Jun 2024 15:09:54 +0800 Subject: [PATCH 7/7] add max_parallel_downloads into tests --- tests/ng/modules/base.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ng/modules/base.yaml b/tests/ng/modules/base.yaml index 6fe7118..41a1caa 100644 --- a/tests/ng/modules/base.yaml +++ b/tests/ng/modules/base.yaml @@ -31,6 +31,7 @@ dnf: - --nogpgcheck - --setopt=keepcache=True - --setopt=tsflags= + - --setopt=max_parallel_downloads=20 exclude: - fedora-release* - generic-release*