From f06b436899ea4502634e868e64ab53ee5407db08 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Fri, 31 Jul 2020 21:10:07 +0100 Subject: [PATCH] Add photon to CI 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 | 29 ++++++++++++++++++++++++++++- mkosi | 7 +++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1e51c095..933284416 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 9782d1d26..0289bf52c 100755 --- 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) -- 2.47.2