diskimage-builder/diskimage_builder/elements/openeuler-minimal/root.d/00-00-generate-repo

31 lines
704 B
Plaintext
Raw Normal View History

#!/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
REPO_URL=${DIB_DISTRIBUTION_MIRROR:-http://repo.openeuler.org}
repo_file=$(mktemp)
cat > $repo_file << EOF
[OS]
name=openEuler-$DIB_RELEASE - OS
baseurl=${REPO_URL}/openEuler-$DIB_RELEASE/OS/\$basearch/
enabled=1
gpgcheck=0
[update]
name=openEuler-$DIB_RELEASE - update
baseurl=${REPO_URL}/openEuler-$DIB_RELEASE/update/\$basearch/
enabled=1
gpgcheck=0
EOF
mv $repo_file ${yum_repos_dir}/openEuler.repo