forked from fengguang/lkp-tests
-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Philip Li <[email protected]>
- Loading branch information
Showing
2 changed files
with
174 additions
and
174 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
centos |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
#!/bin/bash | ||
|
||
shopt -s nullglob | ||
|
||
. $LKP_SRC/lib/install.sh | ||
. $LKP_SRC/distro/common | ||
. $LKP_SRC/lib/debug.sh | ||
|
||
fixup_distro_mirror() | ||
{ | ||
dnf config-manager --set-enabled crb | ||
} | ||
|
||
install() | ||
{ | ||
local pkg="$1" | ||
|
||
rpm --quiet --query "$pkg" || $LKP_SRC/distro/installer/$DISTRO "$pkg" | ||
} | ||
|
||
distro_install_depends() | ||
{ | ||
local script | ||
local bm="$1" | ||
local script=$(get_dependency_file $bm) | ||
[[ -f $script ]] || { | ||
echo "no depends file found for $bm" | ||
return 0 | ||
} | ||
|
||
packages=$(get_dependency_packages $DISTRO $bm) | ||
|
||
[ -z "$packages" ] && return | ||
|
||
echo install packages for $bm: $packages | ||
|
||
local ocfs2_tools_name=$(echo "$packages" | grep 'ocfs2-tools') | ||
[ -n "$ocfs2_tools_name" ] && install_ocfs2_tools "$ocfs2_tools_name" | ||
|
||
for pkg in $packages | ||
do | ||
install $pkg | ||
done | ||
} | ||
|
||
pack_benchmark() | ||
{ | ||
setup_proxy | ||
|
||
distro_install_depends lkp-dev | ||
|
||
# Process each benchmark | ||
for BM_NAME in $benchmark | ||
do | ||
distro_install_depends $BM_NAME-dev || continue | ||
echo $LKP_SRC/sbin/pack -d $DISTRO -f -c -s $PKG_MNT/$pack_to $BM_NAME | ||
( | ||
$LKP_SRC/sbin/pack -d $DISTRO -f -c -s $PKG_MNT/$pack_to $BM_NAME | ||
) | ||
done | ||
} | ||
|
||
download() | ||
{ | ||
# use --allowerasing to resolve issue on centos 9 | ||
# Problem: problem with installed package libcurl-minimal-7.76.1-31.el9.x86_64 | ||
# - package libcurl-minimal-7.76.1-31.el9.x86_64 from @System conflicts with libcurl(x86-64) provided by libcurl-7.76.1-31.el9.x86_64 from baseos | ||
$LKP_SRC/distro/installer/$DISTRO --allowerasing --downloadonly $* | ||
} | ||
|
||
pack() | ||
{ | ||
local target_dir=/opt/rpms | ||
local date=$(date +"%Y%m%d") | ||
|
||
local downloaded_rpms=$(find /var/ -type f -name "*.rpm") | ||
|
||
[ "$downloaded_rpms" ] || return | ||
|
||
mkdir -p $target_dir | ||
|
||
mv $downloaded_rpms $target_dir | ||
|
||
find $target_dir | cpio --quiet -o -H newc --owner=root.root | gzip -n -9 >$pack_to/${BM_NAME}_$date.cgz | ||
|
||
ln -sf ${BM_NAME}_$date.cgz $pack_to/${BM_NAME}.cgz || return | ||
chown .lkp $pack_to/${BM_NAME}_$date.cgz $pack_to/${BM_NAME}.cgz || return | ||
echo package installed to $pack_to/${BM_NAME}.cgz | ||
|
||
ls $target_dir/*.rpm > $pack_to/.${BM_NAME}.packages | ||
|
||
rm -rf $target_dir | ||
} | ||
|
||
cleanup_downloaded_rpms() | ||
{ | ||
find /var/ -type f -name "*.rpm" -exec rm -f -- '{}' \; | ||
} | ||
|
||
pack_benchmark_deps() | ||
{ | ||
setup_proxy | ||
|
||
for BM_NAME in $benchmark | ||
do | ||
cleanup_downloaded_rpms | ||
|
||
check_shared_package $BM_NAME | ||
|
||
packages=$(get_dependency_packages $DISTRO $BM_NAME) | ||
|
||
local ocfs2_tools_name=$(echo "$packages" | grep 'ocfs2-tools') | ||
[ -n "$ocfs2_tools_name" ] && download_ocfs2_tools "$ocfs2_tools_name" | ||
|
||
if download "$packages"; then | ||
pack | ||
else | ||
echo "failed to pack-deps $BM_NAME" >&2 | ||
fi | ||
done | ||
} | ||
|
||
install_gcc7() | ||
{ | ||
if [ $DISTRO = "aliyun" ]; then | ||
wget -O /tmp/centos-release-scl-rh-2-3.el7.centos.noarch.rpm https://rpmfind.net/linux/centos/7/extras/x86_64/Packages/centos-release-scl-rh-2-3.el7.centos.noarch.rpm | ||
rpm -ivh --ignoresize /tmp/centos-release-scl-rh-2-3.el7.centos.noarch.rpm | ||
else | ||
install centos-release-scl-rh | ||
fi | ||
|
||
$LKP_SRC/distro/installer/$DISTRO "devtoolset-7-gcc*" | ||
|
||
source /opt/rh/devtoolset-7/enable | ||
} | ||
|
||
download_rpm() | ||
{ | ||
local rpm=$1 | ||
|
||
install wget | ||
|
||
mkdir -p /opt/rpms | ||
wget -nc -P /opt/rpms $rpm | ||
} | ||
|
||
download_ocfs2_tools() | ||
{ | ||
local pkgs=$1 | ||
|
||
download_rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/ocfs2-tools-1.8.6-11.el7.x86_64.rpm | ||
|
||
local download_pkgs="/opt/rpms/ocfs2-tools-1.8.6-11.el7.x86_64.rpm" | ||
|
||
if echo "$pkgs" | grep -q 'ocfs2-tools-devel'; then | ||
download_rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/ocfs2-tools-devel-1.8.6-11.el7.x86_64.rpm | ||
download_pkgs="$download_pkgs /opt/rpms/ocfs2-tools-devel-1.8.6-11.el7.x86_64.rpm" | ||
fi | ||
|
||
# Try to download the dependences of ocfs2-tools/ocfs2-tools-devel | ||
$LKP_SRC/distro/installer/$DISTRO --downloadonly "$download_pkgs" | ||
} | ||
|
||
install_ocfs2_tools() | ||
{ | ||
local pkgs=$1 | ||
|
||
download_ocfs2_tools "$pkgs" | ||
|
||
$LKP_SRC/distro/installer/$DISTRO /opt/rpms/ocfs2-tools-1.8.6-11.el7.x86_64.rpm | ||
|
||
echo "$pkgs" | grep -q 'ocfs2-tools-devel' && $LKP_SRC/distro/installer/$DISTRO /opt/rpms/ocfs2-tools-devel-1.8.6-11.el7.x86_64.rpm | ||
} |