#!/bin/sh

set -e
set -x

cpu_arch="$(dpkg-architecture -qDEB_HOST_GNU_CPU)"
case "$cpu_arch" in
    powerpc64le)
        arch=ppc64le
        ;;
    loongarch64 | riscv64)
        # No mirrors in CentOS, just check that the binary works for now
        dnf5 --help 2>/dev/null
        exit 0
        ;;
    *)
        arch="$cpu_arch"
        ;;
esac

dnf5 \
 --assumeyes \
 --installroot=/var/tmp/bootstrap \
 --repofrompath "centos10,http://mirror.stream.centos.org/10-stream/BaseOS/$arch/os/" \
 --repo=centos10 \
 install filesystem

