]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Add photon to CI 486/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 31 Jul 2020 20:10:07 +0000 (21:10 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 4 Aug 2020 23:43:24 +0000 (00:43 +0100)
We build tdnf along with the centos dependencies as it needs libsolv as
well and splitting everything up in separate steps is relatively more
complexity for a little extra run time.

We should look into caching the dependency building so we don't rebuild
the same dependencies each build.

.github/workflows/ci.yml
mkosi

index e1e51c095977c3169c3ccb01eb1f0385057ce6e5..9332844161571c541e934c0a42fa60cd1ba70dd2 100644 (file)
@@ -25,6 +25,7 @@ jobs:
           - openmandriva
           - mageia
           - opensuse
+          - photon
         format:
           - directory
           - tar
@@ -42,6 +43,9 @@ jobs:
           # Remove once https://github.com/clearlinux/clr-boot-manager/pull/238 is merged and available.
           - distro: clear
             format: gpt_btrfs
+          # Remove once https://github.com/vmware/tdnf/issues/154 is fixed.
+          - distro: photon
+            format: gpt_btrfs
 
     steps:
     - uses: actions/checkout@v2
@@ -226,6 +230,27 @@ jobs:
         sudo cmake --install build/dnf
 
         sudo ln -s /usr/bin/dnf-3 /usr/bin/dnf
+
+        wget https://github.com/metalink-dev/libmetalink/archive/release-$LIBMETALINK_VERSION.tar.gz
+        tar xf release-$LIBMETALINK_VERSION.tar.gz
+
+        pushd libmetalink-release-$LIBMETALINK_VERSION
+        ./buildconf
+        ./configure --prefix /usr
+        make
+        sudo make install
+        popd
+
+        wget https://github.com/vmware/tdnf/archive/v$TDNF_VERSION.tar.gz
+        tar xf v$TDNF_VERSION.tar.gz
+
+        cmake \
+          -S tdnf-$TDNF_VERSION \
+          -B build/tdnf \
+          -DCMAKE_BUILD_TYPE=Release \
+          -DCMAKE_INSTALL_PREFIX=/usr
+        cmake --build build/tdnf
+        sudo cmake --install build/tdnf
       env:
         CMAKE_GENERATOR: Ninja
         LIBCOMPS_VERSION: "0.1.15"
@@ -234,6 +259,8 @@ jobs:
         LIBSOLV_VERSION: "0.7.14"
         LIBDNF_VERSION: "0.48.0"
         DNF_VERSION: "4.2.23"
+        LIBMETALINK_VERSION: "0.1.3"
+        TDNF_VERSION: "2.1.1"
 
     - name: Install swupd-extract (Clear Linux)
       if: matrix.distro == 'clear'
@@ -249,7 +276,7 @@ jobs:
 
     - name: Build ${{ matrix.distro }}/${{ matrix.format }} UEFI
       if: matrix.format != 'directory' && matrix.format != 'tar' && matrix.format != 'plain_squashfs' &&
-          (matrix.distro != 'clear' || matrix.format != 'gpt_squashfs')
+          (matrix.distro != 'clear' || matrix.format != 'gpt_squashfs') && matrix.distro != 'photon'
       run: sudo ./mkosi
             --debug run
             --distribution ${{ matrix.distro }}
diff --git a/mkosi b/mkosi
index 9782d1d26477f56e788abfafc7b6cc121f760aac..0289bf52cdcbfe3f1635d67cc30554f1a8f9b668 100755 (executable)
--- a/mkosi
+++ b/mkosi
@@ -1591,7 +1591,7 @@ def invoke_dnf(args: CommandLineArguments,
         run(cmdline, check=True)
 
 
-def invoke_tdnf(args: CommandLineArguments, root: str, repositories: List[str], packages: List[str]) -> None:
+def invoke_tdnf(args: CommandLineArguments, root: str, repositories: List[str], packages: List[str], gpgcheck: bool) -> None:
     repos = ["--enablerepo=" + repo for repo in repositories]
     config_file = os.path.join(workspace(root), 'dnf.conf')
     packages = make_rpm_list(args, packages)
@@ -1605,6 +1605,9 @@ def invoke_tdnf(args: CommandLineArguments, root: str, repositories: List[str],
                *repos
                ]
 
+    if not gpgcheck:
+        cmdline.append("--nogpgcheck")
+
     cmdline += ['install', *packages]
 
     with mount_api_vfs(args, root):
@@ -1676,7 +1679,7 @@ def install_photon(args: CommandLineArguments, root: str, do_run_build_script: b
     if not do_run_build_script and args.bootable:
         packages += ["linux", "initramfs"]
 
-    invoke_tdnf(args, root, args.repositories or ["photon", "photon-updates"], packages)
+    invoke_tdnf(args, root, args.repositories or ["photon", "photon-updates"], packages, os.path.exists(gpgpath))
     reenable_kernel_install(args, root, masked)