fix release-custom uninstall error

This commit is contained in:
lyn1001 2022-11-11 11:26:52 +08:00
parent 61f425143f
commit b621944401

View File

@ -6,7 +6,7 @@
%define generic_version 20.03
%define generic_patch_level LTS
%define generic_patch_level_extend SP3
%define generic_release 53
%define generic_release 54
%define builtin_release_version 1.0
%define current_arch %{_arch}
@ -72,12 +72,17 @@ openeuler-release-custom
%setup -q -n generic-release-%{builtin_release_version}
%postun -n %{product_family}-release-custom
grep "%{boot_args}" /etc/grub.d/10_linux > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "ERROR: failed to clean up boot args in /etc/grub.d/10_linux because they have been modified"
exit 1
vendorid=`lscpu | grep "Vendor ID:" | awk '{print $3}'`
model=`lscpu | grep "Model:" | awk '{print $2}'`
if [ "0x70" == "${vendorid}" -a "3" == "${model}" ]; then
grep "%{boot_args}" /etc/grub.d/10_linux > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "ERROR: failed to clean up boot args in /etc/grub.d/10_linux because they have been modified"
exit 1
fi
sed -i "s/%{boot_args} //g" /etc/grub.d/10_linux
fi
sed -i "s/%{boot_args} //g" /etc/grub.d/10_linux
%posttrans -n %{product_family}-release-custom
@ -201,6 +206,9 @@ rm -rf $RPM_BUILD_ROOT
%files -n %{product_family}-release-custom
%changelog
* Tue Nov 8 2022 liyanan <liyanan32@h-partners.com> - 1.0-54
- fix release-custom uninstall error
* Tue Nov 8 2022 liyanan <liyanan32@h-partners.com> - 1.0-53
- sysconfig parameters have a impact on performance,comment out the relevant content