mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-10-20 06:35:31 +00:00
feat(genesis): enable shared package repository
This commit is contained in:
@@ -23,11 +23,13 @@ mkdir -p %{buildroot}%{_sysconfdir}/yum.repos.d
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/pki/rpm-gpg
|
||||
install -m 0644 xcat-core.repo %{buildroot}%{_sysconfdir}/yum.repos.d/xcat-core.repo
|
||||
install -m 0644 xcat-dep.repo %{buildroot}%{_sysconfdir}/yum.repos.d/xcat-dep.repo
|
||||
install -m 0644 xcat-dep-common.repo %{buildroot}%{_sysconfdir}/yum.repos.d/xcat-dep-common.repo
|
||||
install -m 0644 RPM-GPG-KEY-xCAT %{buildroot}%{_sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-xCAT
|
||||
|
||||
%files
|
||||
%config(noreplace) %{_sysconfdir}/yum.repos.d/xcat-core.repo
|
||||
%config(noreplace) %{_sysconfdir}/yum.repos.d/xcat-dep.repo
|
||||
%config(noreplace) %{_sysconfdir}/yum.repos.d/xcat-dep-common.repo
|
||||
%{_sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-xCAT
|
||||
|
||||
%changelog
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
[xcat-dep-common]
|
||||
name=xCAT common dependencies
|
||||
baseurl=https://xcat.org/files/xcat/repos/yum/latest/xcat-dep/common
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
repo_gpgcheck=1
|
||||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-xCAT
|
||||
@@ -189,6 +189,7 @@ GO_XCAT_DEFAULT_INSTALL_PATH="/install/xcat"
|
||||
# The package list of xcat-core
|
||||
GO_XCAT_CORE_PACKAGE_LIST=()
|
||||
GO_XCAT_DEP_PACKAGE_LIST=()
|
||||
GO_XCAT_DEP_REPOSITORY_IDS=(xcat-dep)
|
||||
|
||||
# The package list of all the packages should be installed
|
||||
GO_XCAT_INSTALL_LIST=(perl-xCAT xCAT-client xCAT xCAT-buildkit
|
||||
@@ -204,12 +205,20 @@ GO_XCAT_INSTALL_LIST=(perl-xcat xcat-client xcat xcat-buildkit
|
||||
# The package list of all the packages should be uninstalled
|
||||
GO_XCAT_UNINSTALL_LIST=("${GO_XCAT_INSTALL_LIST[@]}"
|
||||
goconserver xCAT-SoftLayer xCAT-confluent xCAT-csm xCAT-genesis-builder
|
||||
xCAT-genesis-openembedded-x86 xCAT-genesis-openembedded-x86_64
|
||||
xCAT-genesis-openembedded-ppc64 xCAT-genesis-openembedded-ppc64le
|
||||
xCAT-genesis-openembedded-armv7hf xCAT-genesis-openembedded-aarch64
|
||||
xCAT-genesis-openembedded-riscv64
|
||||
xCAT-openbmc-py xCAT-probe xCAT-test xCAT-vlan xCATsn xCAT-UI-deps
|
||||
xCAT-buildkit conserver-xcat yaboot-xcat)
|
||||
# For Debian/Ubuntu, it will need a slightly different package list
|
||||
type dpkg >/dev/null 2>&1 &&
|
||||
GO_XCAT_UNINSTALL_LIST=("${GO_XCAT_INSTALL_LIST[@]}"
|
||||
goconserver xcat-confluent xcat-probe xcat-test xcat-vlan xcatsn
|
||||
xcat-genesis-openembedded-x86 xcat-genesis-openembedded-x86-64
|
||||
xcat-genesis-openembedded-ppc64 xcat-genesis-openembedded-ppc64le
|
||||
xcat-genesis-openembedded-armv7hf xcat-genesis-openembedded-aarch64
|
||||
xcat-genesis-openembedded-riscv64
|
||||
xcat-buildkit conserver-xcat)
|
||||
|
||||
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
@@ -478,7 +487,7 @@ function debug_trace()
|
||||
return "${rc}"
|
||||
}
|
||||
|
||||
internal_setup
|
||||
[[ ${GO_XCAT_LIBRARY_ONLY:-0} == 1 ]] || internal_setup
|
||||
|
||||
# Check operating system
|
||||
function check_os()
|
||||
@@ -1491,6 +1500,9 @@ function remove_repo_yum()
|
||||
"xcat-dep")
|
||||
mv /etc/yum.repos.d/xCAT-dep.repo{,.nouse} 2>/dev/null
|
||||
;;
|
||||
"xcat-dep-common")
|
||||
mv /etc/yum.repos.d/xCAT-dep-common.repo{,.nouse} 2>/dev/null
|
||||
;;
|
||||
esac
|
||||
yum clean metadata
|
||||
:
|
||||
@@ -1509,6 +1521,9 @@ function remove_repo_zypper()
|
||||
"xcat-dep")
|
||||
mv /etc/zypp/repos.d/xCAT-dep.repo{,.nouse} 2>/dev/null
|
||||
;;
|
||||
"xcat-dep-common")
|
||||
mv /etc/zypp/repos.d/xCAT-dep-common.repo{,.nouse} 2>/dev/null
|
||||
;;
|
||||
esac
|
||||
:
|
||||
}
|
||||
@@ -1592,6 +1607,52 @@ function add_xcat_core_repo()
|
||||
function_dispatch "${FUNCNAME[0]}" "$@"
|
||||
}
|
||||
|
||||
function add_xcat_dep_common_repo_yum_or_zypper()
|
||||
{
|
||||
type yum >/dev/null 2>&1 || type zypper >/dev/null 2>&1 || return 255
|
||||
local url="$1"
|
||||
local ver="$2"
|
||||
local common_url=""
|
||||
local metadata=""
|
||||
local repo_id=""
|
||||
[[ -z "${ver}" ]] && ver="latest"
|
||||
|
||||
[[ -z "${url}" ]] &&
|
||||
url="${GO_XCAT_DEFAULT_BASE_URL}/yum/${ver}/xcat-dep"
|
||||
case "${url##*/}" in
|
||||
*".repo"|*".tar"|*".tar.Z"|*".tar.bz"|*".tar.bz2"|*".tar.gz"|*".tar.xz"|*".tbz"|*".tbz2"|*".tgz"|*".tz"|*".txz")
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
case "${url%%://*}" in
|
||||
"ftp"|"http"|"https")
|
||||
common_url="${url%/}/common"
|
||||
metadata="${TMP_DIR}/xcat-dep-common-repomd.xml"
|
||||
download_file "${common_url}/repodata/repomd.xml" "${metadata}" \
|
||||
>/dev/null 2>&1 || return 0
|
||||
;;
|
||||
"file")
|
||||
url="${url#file://}"
|
||||
[[ "${url:0:1}" = "/" ]] || url="${PWD}/${url}"
|
||||
common_url="${url%/}/common"
|
||||
[[ -f "${common_url}/repodata/repomd.xml" ]] || return 0
|
||||
;;
|
||||
*)
|
||||
[[ "${url:0:1}" = "/" ]] || url="${PWD}/${url}"
|
||||
common_url="${url%/}/common"
|
||||
[[ -f "${common_url}/repodata/repomd.xml" ]] || return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
add_repo_by_url_yum_or_zypper "${common_url}" "xcat-dep-common" || return 0
|
||||
for repo_id in "${GO_XCAT_DEP_REPOSITORY_IDS[@]}"
|
||||
do
|
||||
[[ "${repo_id}" == "xcat-dep-common" ]] && return 0
|
||||
done
|
||||
GO_XCAT_DEP_REPOSITORY_IDS+=(xcat-dep-common)
|
||||
}
|
||||
|
||||
function add_xcat_dep_repo_yum_or_zypper()
|
||||
{
|
||||
type yum >/dev/null 2>&1 || type zypper >/dev/null 2>&1 || return 255
|
||||
@@ -1636,8 +1697,10 @@ function add_xcat_dep_repo_yum_or_zypper()
|
||||
url="${tmp}"
|
||||
;;
|
||||
*)
|
||||
url="${url}/${distro}/${GO_XCAT_ARCH}"
|
||||
add_repo_by_url_yum_or_zypper "${url}" "xcat-dep"
|
||||
local repository_root="${url}"
|
||||
url="${repository_root}/${distro}/${GO_XCAT_ARCH}"
|
||||
add_repo_by_url_yum_or_zypper "${url}" "xcat-dep" || return "$?"
|
||||
add_xcat_dep_common_repo_yum_or_zypper "${repository_root}" "${ver}"
|
||||
return "$?"
|
||||
;;
|
||||
esac
|
||||
@@ -1657,8 +1720,10 @@ function add_xcat_dep_repo_yum_or_zypper()
|
||||
then
|
||||
# make sure it is an absolute pathname.
|
||||
[[ "${url:0:1}" = "/" ]] || url="${PWD}/${url}"
|
||||
url="${url}/${distro}/${GO_XCAT_ARCH}"
|
||||
add_repo_by_url_yum_or_zypper "${url}" "xcat-dep"
|
||||
local repository_root="${url}"
|
||||
url="${repository_root}/${distro}/${GO_XCAT_ARCH}"
|
||||
add_repo_by_url_yum_or_zypper "${url}" "xcat-dep" || return "$?"
|
||||
add_xcat_dep_common_repo_yum_or_zypper "${repository_root}" "${ver}"
|
||||
return "$?"
|
||||
fi
|
||||
warn_if_bad "1" "invalid xcat-dep URL"
|
||||
@@ -1969,10 +2034,10 @@ function trash_xcat()
|
||||
rm -rf /etc/xcat
|
||||
rm -rf /etc/xcatdockerca
|
||||
rm -f /etc/apt/sources.list.d/xcat-{core,dep}.list
|
||||
rm -f /etc/yum.repos.d/xCAT-{core,dep}.repo{,.nouse}
|
||||
rm -f /etc/yum.repos.d/xcat-{core,dep}.repo
|
||||
rm -f /etc/zypp/repos.d/xCAT-{core,dep}.repo{,.nouse}
|
||||
rm -f /etc/zypp/repos.d/xcat-{core,dep}.repo
|
||||
rm -f /etc/yum.repos.d/xCAT-{core,dep,dep-common}.repo{,.nouse}
|
||||
rm -f /etc/yum.repos.d/xcat-{core,dep,dep-common}.repo
|
||||
rm -f /etc/zypp/repos.d/xCAT-{core,dep,dep-common}.repo{,.nouse}
|
||||
rm -f /etc/zypp/repos.d/xcat-{core,dep,dep-common}.repo
|
||||
rm -rf /install/postscripts
|
||||
rm -rf /opt/xcat
|
||||
rm -rf /root/.xcat
|
||||
@@ -2002,7 +2067,12 @@ function uninstall_xcat_completely()
|
||||
function list_xcat_packages()
|
||||
{
|
||||
GO_XCAT_CORE_PACKAGE_LIST=($(get_package_list xcat-core))
|
||||
GO_XCAT_DEP_PACKAGE_LIST=($(get_package_list xcat-dep))
|
||||
GO_XCAT_DEP_PACKAGE_LIST=($(
|
||||
for repo_id in "${GO_XCAT_DEP_REPOSITORY_IDS[@]}"
|
||||
do
|
||||
get_package_list "${repo_id}"
|
||||
done | tr ' ' '\n' | sort -u
|
||||
))
|
||||
|
||||
[ "${#GO_XCAT_CORE_PACKAGE_LIST[@]}" -gt "0" ]
|
||||
warn_if_bad "$?" "Failed to get package list from repository \`xcat-core'." || return 1
|
||||
@@ -2250,6 +2320,11 @@ function boo_boo_if_bad()
|
||||
#
|
||||
# Main program goes here.
|
||||
|
||||
if [[ ${GO_XCAT_LIBRARY_ONLY:-0} == 1 ]]
|
||||
then
|
||||
return 0 2>/dev/null || exit 0
|
||||
fi
|
||||
|
||||
declare -a GO_XCAT_YES=()
|
||||
GO_XCAT_ACTION=""
|
||||
GO_XCAT_CORE_URL=""
|
||||
@@ -2435,6 +2510,7 @@ ERR_MSG="$(
|
||||
"${GO_XCAT_DEP_URL}" "${GO_XCAT_VERSION}"
|
||||
then
|
||||
debug_trace update_repo && exit 0
|
||||
debug_trace remove_repo "xcat-dep-common"
|
||||
debug_trace remove_repo "xcat-dep"
|
||||
fi
|
||||
debug_trace remove_repo "xcat-core"
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ Homepage: https://xcat.org/
|
||||
Package: xcat
|
||||
Architecture: amd64 ppc64el
|
||||
Depends: ${perl:Depends}, goconserver(>= 0.3.3-snap000000000000), xcat-server (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libdbd-sqlite3-perl, isc-dhcp-server | kea, bind9, apache2, nfs-kernel-server, libxml-parser-perl, rsync, tftpd-hpa, libnet-telnet-perl, xcat-genesis-scripts-amd64 (>= 2.13-snap000000000000)
|
||||
Recommends: net-tools, nmap, kea, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000)
|
||||
Recommends: net-tools, nmap, kea, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000), xcat-genesis-openembedded-x86-64, xcat-genesis-openembedded-ppc64le
|
||||
Suggests: yaboot-xcat
|
||||
Description: Metapackage for a common, default xCAT setup
|
||||
xCAT is Extreme Cluster/Cloud Administration Toolkit. xCAT offers complete
|
||||
|
||||
@@ -55,6 +55,8 @@ Requires: xCAT-server = 4:%{version}-%{release}
|
||||
%if %nots390x
|
||||
Requires: xCAT-probe = 4:%{version}-%{release}
|
||||
Requires: xCAT-genesis-scripts-%{genesistarch} = 1:%{version}-%{release}
|
||||
Recommends: xCAT-genesis-openembedded-x86_64
|
||||
Recommends: xCAT-genesis-openembedded-ppc64le
|
||||
%endif
|
||||
|
||||
Requires: rsync
|
||||
|
||||
@@ -9,7 +9,7 @@ Homepage: https://xcat.org/
|
||||
Package: xcatsn
|
||||
Architecture: amd64 ppc64el
|
||||
Depends: ${perl:Depends}, goconserver (>=0.3.3-snap000000000000), xcat-server (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libdbd-sqlite3-perl, libxml-parser-perl, tftpd-hpa, libnet-telnet-perl, isc-dhcp-server | kea, bind9, apache2, nfs-kernel-server, xcat-genesis-scripts-amd64 (>= 2.13-snap000000000000)
|
||||
Recommends: net-tools, nmap, kea, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000)
|
||||
Recommends: net-tools, nmap, kea, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000), xcat-genesis-openembedded-x86-64, xcat-genesis-openembedded-ppc64le
|
||||
Suggests: yaboot-xcat
|
||||
Description: Metapackage for a common, default xCAT service node setup
|
||||
xCATsn is a service node management package intended for at-scale
|
||||
|
||||
@@ -21,6 +21,8 @@ Requires: perl-DBD-SQLite
|
||||
Requires: xCAT-client = 4:%{version}-%{release}
|
||||
Requires: xCAT-server = 4:%{version}-%{release}
|
||||
Requires: xCAT-probe = 4:%{version}-%{release}
|
||||
Recommends: xCAT-genesis-openembedded-x86_64
|
||||
Recommends: xCAT-genesis-openembedded-ppc64le
|
||||
|
||||
# Match xCAT-genesis-scripts package naming by build architecture.
|
||||
%ifarch i386 i586 i686 x86
|
||||
|
||||
Reference in New Issue
Block a user