CentOS 8: Build layering, scripts update for centos8

(1)Use dnf instead of yum
(2)add repo for centos8
(3)upgrade python2 to python3

Change-Id: I39ec30eec33d9c912f9c56aa855fb3f71ebd08d4
Story: 2006729
Task: 39591
Signed-off-by: Yong Fu <fuyong@neusoft.com>
This commit is contained in:
Yong Fu 2020-04-28 16:26:13 +08:00
parent 05ba65cb05
commit ef3a893db1
7 changed files with 36 additions and 9 deletions

View File

@ -5,7 +5,7 @@
#
#
# Download non-RPM files from http://vault.centos.org/7.4.1708/os/x86_64/
# Download non-RPM files from http://vault.centos.org/8.1.1911/os/x86_64/
#
DL_OTHER_FROM_CENTOS_REPO_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}" )" )"
@ -98,7 +98,7 @@ if [ ! -e $download_list ];then
fi
save_path=$2
upstream_url_prefix="http://mirror.centos.org/centos/8/BaseOS/x86_64/os/"
upstream_url_prefix="http://mirror.centos.org/centos/8.1.1911/BaseOS/x86_64/os/"
stx_mirror_url_prefix="$(url_to_stx_mirror_url "$upstream_url_prefix" "$distro")"
echo "NOTE: please assure Internet access to $upstream_url_prefix !!"

View File

@ -8,7 +8,7 @@
set -o errexit
set -o nounset
# By default, we use "sudo" and we don't use a local yum.conf. These can
# By default, we use "sudo" and we don't use a local dnf.conf. These can
# be overridden via flags.
DL_RPMS_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}" )" )"
@ -40,7 +40,7 @@ distro="centos"
while getopts "u:h" o; do
case "${o}" in
u)
# Use an alternate yum.conf
# Use an alternate dnf.conf
BASE_URL="$OPTARG"
;;
h)

View File

@ -155,8 +155,9 @@ CENGN_DNF_CONF="$TEMP_DIR/dnf.conf"
CENGN_DNF_LOG="$TEMP_DIR/dnf.log"
CENGN_DNF_CACHDIR="$TEMP_DIR/cache/dnf/\$basearch/\$releasever"
RELEASEVER=$(get_releasever)
ARCH=$(get_arch)
RELEASEVER="8"
ARCH="x86_64"
CONTENTDIR="centos"
#
# Copy as yet unmodified dnf.conf and yum.repos.d from source to dest.
@ -232,6 +233,7 @@ for REPO in $(find "$CENGN_REPOS_DIR" -type f -name '*repo'); do
#
sed "s#/[$]releasever/#/$RELEASEVER/#g" -i "$REPO"
sed "s#/[$]basearch/#/$ARCH/#g" -i "$REPO"
sed "s#/[$]contentdir/#/$CONTENTDIR/#g" -i "$REPO"
#
# Turn off gpgcheck for now.

View File

@ -12,9 +12,18 @@ get_dnf_command() {
local _file=$1
local _level=$2
local rpm_name=""
local arr=( $(split_filename $_file) )
local arch=${arr[3]}
local dnf_download_extra_opts=""
rpm_name="$(get_rpm_level_name $_file $_level)"
echo "dnf download -q ${DNFCONFOPT} ${RELEASEVER} $rpm_name"
if [ "$arch" == "src" ]; then
dnf_download_extra_opts="--source"
else
dnf_download_extra_opts="--exclude='*.i686' --archlist=$arch"
fi
echo "dnf download -q -C ${DNFCONFOPT} ${RELEASEVER} $dnf_download_extra_opts $rpm_name"
}
get_wget_command() {

View File

@ -39,3 +39,19 @@ name=OpenStack train Trunk Tested
baseurl=https://trunk.rdoproject.org/centos7-train/current-passed-ci/
gpgcheck=0
enabled=0
[centos8-openstack-train]
name=CentOS-8 - OpenStack train
baseurl=http://mirror.centos.org/centos/8/cloud/$basearch/openstack-train/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud
exclude=sip,PyQt4
[centos8-openstack-train-source]
name=CentOS-8 - OpenStack train - Source
baseurl=http://vault.centos.org/centos/8.0.1905/cloud/Source/openstack-train/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud
exclude=sip,PyQt4

2
tb.sh
View File

@ -22,7 +22,7 @@ fi
CMD=$1
TC_CONTAINER_NAME=${MYUNAME}-centos-builder
TC_CONTAINER_TAG=local/${MYUNAME}-stx-builder:8
TC_CONTAINER_TAG=local/${MYUNAME}-stx-builder:8.1.1911
TC_DOCKERFILE=Dockerfile
function create_container {

View File

@ -1,2 +1,2 @@
more-itertools===5.0.0;python_version=='2.7' # Last version with official 2.7 support
more-itertools===5.0.0;python_version=='3.6' # Last version with official 3.6 support