fixbug when installing openeuler in qs server and remove fpi_to_tail when remove openEuler-release-custom
This commit is contained in:
parent
b36bfd7b46
commit
3e61a1728a
@ -6,7 +6,7 @@
|
||||
%define generic_version 20.03
|
||||
%define generic_patch_level LTS
|
||||
%define generic_patch_level_extend SP3
|
||||
%define generic_release 49
|
||||
%define generic_release 50
|
||||
%define builtin_release_version 1.0
|
||||
|
||||
%define current_arch %{_arch}
|
||||
@ -14,6 +14,8 @@
|
||||
%define current_arch x86
|
||||
%endif
|
||||
|
||||
%global boot_args fpi_to_tail=off
|
||||
|
||||
Name: %{product_family}-release
|
||||
Version: %{generic_version}%{generic_patch_level}_%{generic_patch_level_extend}
|
||||
Release: %{generic_release}
|
||||
@ -70,23 +72,23 @@ openeuler-release-custom
|
||||
%prep
|
||||
%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
|
||||
fi
|
||||
sed -i "s/%{boot_args} //g" /etc/grub.d/10_linux
|
||||
|
||||
%posttrans -n %{product_family}-release-custom
|
||||
|
||||
# parameters for grub2
|
||||
array="rd.shell=0 fpi_to_tail=off"
|
||||
|
||||
vendorid=`lscpu | grep "Vendor ID:" | awk '{print $3}'`
|
||||
model=`lscpu | grep "Model:" | awk '{print $2}'`
|
||||
|
||||
if [ "0x70" == "${vendorid}" -a "3" == "${model}" ]; then
|
||||
cmdline=`grep GRUB_CMDLINE_LINUX= /etc/default/grub | awk -F\" '{print $2}'`
|
||||
for var in ${array[@]}
|
||||
do
|
||||
echo ${cmdline} | grep -q -w "${var}"
|
||||
if [ $? -ne 0 ]; then
|
||||
cmdline+=" ${var}"
|
||||
fi
|
||||
done
|
||||
sed -i "s#GRUB_CMDLINE_LINUX=.*#GRUB_CMDLINE_LINUX=\"${cmdline}\"#g" /etc/default/grub
|
||||
if [ "0x70" == "${vendorid}" -a "3" == "${model}" ]; then
|
||||
sed -i "s/ ro .*args/ ro %{boot_args} \$\{args/g" /etc/grub.d/10_linux
|
||||
fi
|
||||
|
||||
%build
|
||||
@ -200,6 +202,9 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%files -n %{product_family}-release-custom
|
||||
|
||||
%changelog
|
||||
* Tue Dec 31 2021 chemingdao <chemingdao@huawei.com> - 1.0-50
|
||||
- Bugfix: openenEuler-release-custom dnf error when openEuler installing.
|
||||
|
||||
* Tue Dec 31 2021 chemingdao <chemingdao@huawei.com> - 1.0-49
|
||||
- init openeuler custom
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user