Skip to content

Commit 3b50d94

Browse files
authored
Merge pull request #343 from jiaqizhao122/OS_version_check
lkp-exec/install: add OS version check and mirror source for centos
2 parents 6b9493b + f0e79b2 commit 3b50d94

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lkp-exec/install

+20
Original file line numberDiff line numberDiff line change
@@ -351,11 +351,31 @@ install_base_support()
351351
create_host_config
352352
}
353353

354+
enable_centos_source(){
355+
if ! yum list installed | grep -q yum-utils; then
356+
yum install -y yum-utils
357+
fi
358+
359+
if [ "$_system_version" = 9 ]; then
360+
echo "enable source crb"
361+
dnf config-manager --set-enabled crb
362+
elif [ "$_system_version" = 8 ]; then
363+
echo "enable source powertools"
364+
dnf config-manager --set-enabled powertools
365+
fi
366+
367+
}
368+
354369
. $LKP_SRC/lib/install.sh
355370

356371
detect_system
357372
distro=$_system_name_lowercase
358373

374+
echo "distro=$distro"
375+
echo "version=$_system_version"
376+
377+
[ "$distro" = "centos" ] && enable_centos_source
378+
359379
DISTRO=$distro
360380
export DISTRO
361381

0 commit comments

Comments
 (0)