fix obs build problem

This commit is contained in:
solar.hu 2020-03-14 17:21:27 +08:00
parent 8f72ec220a
commit 6d8b88630d
3 changed files with 35 additions and 9 deletions

View File

@ -0,0 +1,20 @@
#/bin/bash
#Copyright (c) [2019] Huawei Technologies Co., Ltd.
#generic-release is licensed under the Mulan PSL v1.
#You can use this software according to the terms and conditions of the Mulan PSL v1.
#You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL
#THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
#PURPOSE.
#See the Mulan PSL v1 for more details.
CPUNO=`cat /proc/cpuinfo|grep processor|wc -l`
export GOMP_CPU_AFFINITY=0-$[CPUNO - 1]
sysctl -w vm.min_free_kbytes=112640 &> /dev/null
sysctl -w vm.dirty_ratio=60 &> /dev/null
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag
sysctl -w kernel.sched_autogroup_enabled=0 &> /dev/null
sysctl -p &> /dev/null

View File

@ -69,12 +69,3 @@ else
echo -e "To run a command as administrator(user \"root\"),use \"sudo <command>\"."
fi
CPUNO=`cat /proc/cpuinfo|grep processor|wc -l`
export GOMP_CPU_AFFINITY=0-$[CPUNO - 1]
sysctl -w vm.min_free_kbytes=112640 &> /dev/null
sysctl -w vm.dirty_ratio=60 &> /dev/null
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag
sysctl -w kernel.sched_autogroup_enabled=0 &> /dev/null
sysctl -p &> /dev/null

View File

@ -33,6 +33,15 @@ Requires: %{product_family}-repos
%description
%{product_family} release files
%package -n openEuler-performance
Requires: coreutils systemd setup
Summary:performance script
%description -n openEuler-performance
performance script
%prep
%setup -q -n generic-release-%{builtin_release_version}
@ -58,6 +67,7 @@ EOF
mkdir -p -m 755 $RPM_BUILD_ROOT/etc/profile.d
cp -a system-info.sh $RPM_BUILD_ROOT/etc/profile.d/
cp -a performance.sh $RPM_BUILD_ROOT/etc/profile.d/
# write cpe to /etc/system/release-cpe
echo "cpe:/o:%{product_family}:%{product_family}:%{version}:ga:server" > $RPM_BUILD_ROOT/etc/system-release-cpe
@ -101,6 +111,7 @@ install -m 0644 %{SOURCE3} %{buildroot}%{_prefix}/lib/systemd/system-preset/
rm -rf $RPM_BUILD_ROOT
%files
%defattr(0644,root,root,0755)
/etc/system-release
@ -117,6 +128,10 @@ rm -rf $RPM_BUILD_ROOT
/var/lib/supportinfo
/usr/share/eula/eula.*
%files -n openEuler-performance
%defattr(0644,root,root,0755)
/etc/profile.d/performance.sh
%changelog
* Fri Mar 13 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.0-25
- add performance script,close transparent_hugepage,change vm.min_free_kbytes=112640,export GOMP_CPU_AFFINITY