Fix get_bmc_ip failure caused by search rule issue

Signed-off-by: zhangzikang <zhangzikang@kylinos.cn>
This commit is contained in:
zhangzikang1992 2024-10-08 14:50:53 +08:00
parent 4fc1d36dc9
commit da1bba218b
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,27 @@
From bfc156d725d3262d331a771a2be06e3dd9eeb6be Mon Sep 17 00:00:00 2001
From: zhangzikang <zhangzikang@kylinos.cn>
Date: Wed, 25 Sep 2024 14:26:54 +0800
Subject: [PATCH] Fix get_bmc_ip failure caused by search rule issue
---
contrib/exchange-bmc-os-info.init.redhat | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/exchange-bmc-os-info.init.redhat b/contrib/exchange-bmc-os-info.init.redhat
index b7ec43f..98efbe6 100644
--- a/contrib/exchange-bmc-os-info.init.redhat
+++ b/contrib/exchange-bmc-os-info.init.redhat
@@ -199,8 +199,8 @@ get_bmc_ip()
#Thanks to http://ingvar.blog.redpill-linpro.com
for CHANNEL in `seq 1 14`
do
- [ $(${IPMI_TOOL} lan print ${CHANNEL} 2>/dev/null \
- | grep -q "^Set") ] || break
+ ${IPMI_TOOL} lan print ${CHANNEL} 2>/dev/null \
+ | grep -q "^IP Address .*:" && break
done
# Get BMC_IPv4 and BMC_URL from BMC
--
2.27.0

View File

@ -1,6 +1,6 @@
Name: ipmitool
Version: 1.8.18
Release: 22
Release: 23
Summary: Utility for IPMI control
License: BSD
URL: https://codeberg.org/IPMITool/ipmitool
@ -47,6 +47,8 @@ Patch6027: backport-lanplus-Realloc-the-msg-if-the-payload_length-gets-u.p
Patch6028: backport-lan-channel-Fix-set-alert-on-off.patch
Patch6029: backport-fru-Fix-crashes-on-6-bit-ASCII-strings.patch
Patch9000: 0006-Fix-get_bmc_ip-failure-caused-by-search-rule-issue.patch
BuildRequires: openssl-devel readline-devel ncurses-devel
%{?systemd_requires}
BuildRequires: systemd
@ -174,6 +176,12 @@ install -Dm 755 contrib/bmc-snmp-proxy %{buildroot}%{_libexecdir}/bmc-sn
%{_mandir}/man8/ipmievd.8*
%changelog
* Tue Oct 08 2024 zhangzikang <zhangzikang@kylinos.cn> - 1.8.18-23
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:Fix get_bmc_ip failure caused by search rule issue
* Mon Dec 04 2023 Huang Yang <huangyang@loongson.cn> - 1.8.18-22
- Type:bugfix
- ID:NA