2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-26 04:12:17 +00:00
Files
xcat-core/xCAT/postscripts/xcatpkgutils.sh
T
Vinícius Ferrão 16b6acf620 fix(openeuler): integrate current Genesis and installer changes
Merge current master into the openEuler support branch. Keep native
kernel, DHCP, locale and timezone requirements with the upstream payload
verifier and EL10 package paths. Preserve signed openEuler installation.

Update the native fixtures to check the merged payload contract.
2026-09-22 19:45:05 -03:00

64 lines
1.5 KiB
Bash
Executable File

#!/bin/sh
# EPL license http://www.eclipse.org/legal/epl-v10.html
# Shared POSIX shell helpers for the ospkgs and otherpkgs postscripts.
xcat_find_rpm_package_manager()
{
if [ -x "${1:-/usr/bin}/dnf" ]; then
printf '%s\n' dnf
elif [ -x "${1:-/usr/bin}/yum" ]; then
printf '%s\n' yum
else
return 1
fi
}
# The xCAT repositories are unsigned, and an unattended node cannot answer a debconf prompt.
xcat_apt_get()
{
DEBIAN_FRONTEND=noninteractive apt-get -y --allow-unauthenticated "$@"
}
# Keep the marker assignment last so callers know the whole library loaded.
xcat_is_el_modular_pkgdir()
{
case "$1" in
rhel[89]*|rhel1[0-9]*|rhels[89]*|rhels1[0-9]*|\
centos[89]*|centos1[0-9]*|rocky[89]*|rocky1[0-9]*|\
alma[89]*|alma1[0-9]*|almalinux[89]*|almalinux1[0-9]*|\
ol[89]*|ol1[0-9]*)
return 0
;;
esac
return 1
}
xcat_rpm_repository_policy()
{
case "$1" in
openeuler*)
printf '%s\n' 'gpgcheck=1' 'skip_if_unavailable=False'
printf 'gpgkey=%s\n' "${2:-file:///etc/pki/rpm-gpg/RPM-GPG-KEY-openEuler}"
;;
*)
printf '%s\n' 'gpgcheck=0' 'skip_if_unavailable=True'
;;
esac
}
xcat_dnf_strict()
{
dnf --setopt=strict=1 '--setopt=*.skip_if_unavailable=False' '--setopt=*.gpgcheck=1' "$@"
}
xcat_dnf_scoped()
{
xcat_dnf_strict '--disablerepo=*' "--enablerepo=$xcat_dnf_repositories" "$@"
}
# shellcheck disable=SC2034
XCATPKGUTILS_LOADED=1