fix obs build problem
This commit is contained in:
parent
8f72ec220a
commit
6d8b88630d
20
generic-release-1.0/performance.sh
Normal file
20
generic-release-1.0/performance.sh
Normal 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
|
||||||
@ -69,12 +69,3 @@ else
|
|||||||
echo -e "To run a command as administrator(user \"root\"),use \"sudo <command>\"."
|
echo -e "To run a command as administrator(user \"root\"),use \"sudo <command>\"."
|
||||||
fi
|
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
|
|
||||||
|
|||||||
@ -33,6 +33,15 @@ Requires: %{product_family}-repos
|
|||||||
%description
|
%description
|
||||||
%{product_family} release files
|
%{product_family} release files
|
||||||
|
|
||||||
|
%package -n openEuler-performance
|
||||||
|
Requires: coreutils systemd setup
|
||||||
|
|
||||||
|
Summary:performance script
|
||||||
|
%description -n openEuler-performance
|
||||||
|
performance script
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n generic-release-%{builtin_release_version}
|
%setup -q -n generic-release-%{builtin_release_version}
|
||||||
|
|
||||||
@ -58,6 +67,7 @@ EOF
|
|||||||
|
|
||||||
mkdir -p -m 755 $RPM_BUILD_ROOT/etc/profile.d
|
mkdir -p -m 755 $RPM_BUILD_ROOT/etc/profile.d
|
||||||
cp -a system-info.sh $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
|
# write cpe to /etc/system/release-cpe
|
||||||
echo "cpe:/o:%{product_family}:%{product_family}:%{version}:ga:server" > $RPM_BUILD_ROOT/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
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(0644,root,root,0755)
|
%defattr(0644,root,root,0755)
|
||||||
/etc/system-release
|
/etc/system-release
|
||||||
@ -117,6 +128,10 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
/var/lib/supportinfo
|
/var/lib/supportinfo
|
||||||
/usr/share/eula/eula.*
|
/usr/share/eula/eula.*
|
||||||
|
|
||||||
|
%files -n openEuler-performance
|
||||||
|
%defattr(0644,root,root,0755)
|
||||||
|
/etc/profile.d/performance.sh
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Fri Mar 13 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.0-25
|
* 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
|
- add performance script,close transparent_hugepage,change vm.min_free_kbytes=112640,export GOMP_CPU_AFFINITY
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user