2021-04-01 02:13:12 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
|
|
|
set -eu
|
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
# NOTE(xinliang): This script should run before script elements/yum-minimal/root.d/08-yum-chroot
|
|
|
|
# So set the script name prefix as 00-
|
|
|
|
yum_repos_dir="$(dirname $0)/../yum.repos.d"
|
|
|
|
mkdir -p $yum_repos_dir
|
|
|
|
|
2022-07-05 02:05:16 +00:00
|
|
|
REPO_URL=${DIB_DISTRIBUTION_MIRROR:-http://repo.openeuler.org}
|
2021-04-01 02:13:12 +00:00
|
|
|
repo_file=$(mktemp)
|
|
|
|
cat > $repo_file << EOF
|
|
|
|
[OS]
|
|
|
|
name=openEuler-$DIB_RELEASE - OS
|
2022-07-05 02:05:16 +00:00
|
|
|
baseurl=${REPO_URL}/openEuler-$DIB_RELEASE/OS/\$basearch/
|
2021-04-01 02:13:12 +00:00
|
|
|
enabled=1
|
|
|
|
gpgcheck=0
|
|
|
|
|
|
|
|
[update]
|
|
|
|
name=openEuler-$DIB_RELEASE - update
|
2022-07-05 02:05:16 +00:00
|
|
|
baseurl=${REPO_URL}/openEuler-$DIB_RELEASE/update/\$basearch/
|
2021-04-01 02:13:12 +00:00
|
|
|
enabled=1
|
|
|
|
gpgcheck=0
|
|
|
|
EOF
|
|
|
|
|
|
|
|
mv $repo_file ${yum_repos_dir}/openEuler.repo
|