mstflint: update to 4.32.0

This commit updates the mstflint package to
the latest 4.32.0 release.

It also includes a patch to fix a musl build error that
has been merged into the upstream development branch [1],
but is not yet part of any official release.

Obsolete patches have been removed,
as they are now included in this version.

Additionally, three new binaries introduced
in 4.32.0 have been added to the package.

[1] https://github.com/Mellanox/mstflint/pull/1239

Signed-off-by: Til Kaiser <mail@tk154.de>
This commit is contained in:
Til Kaiser
2025-05-09 10:43:30 +02:00
committed by Hannu Nyman
parent 48a24c73f7
commit 536e1ff8d0
5 changed files with 71 additions and 123 deletions

View File

@@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=mstflint
PKG_VERSION:=4.31.0
PKG_VERSION:=4.32.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-1.tar.gz
PKG_SOURCE_URL:=https://github.com/Mellanox/$(PKG_NAME)/releases/download/v$(PKG_VERSION)-1
PKG_SOURCE_DATE:=2025-02-06
PKG_HASH:=c0152414e7580a18925c7707ebe2cb659d3a1ed7b80015a35bea4d723b64f8e7
PKG_SOURCE_DATE:=2025-05-08
PKG_HASH:=74db217a49f5efbd29b00ac8bc19d18e3407409cea37ac4e0c63dad95b8ca076
PKG_MAINTAINER:=Til Kaiser <mail@tk154.de>
PKG_LICENSE:=GPL-2.0-only
@@ -110,16 +110,19 @@ define Package/mstflint/install
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mstarchive $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mstconfig $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mstcongestion $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mstdevices_info $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mstflint $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mstfwctrl $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mstfwmanager $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mstlink $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mstmcra $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mstmget_temp $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mstmread $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mstmtserver $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mstmwrite $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mstreg $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mstregdump $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/msttokengenerator $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mstvpd $(1)/usr/bin/
$(INSTALL_DIR) $(1)/usr/share/mstflint

View File

@@ -1,49 +0,0 @@
From 215d3c274125321ea6254b59dc28996370705d5e Mon Sep 17 00:00:00 2001
From: Til Kaiser <mail@tk154.de>
Date: Fri, 7 Feb 2025 14:26:52 +0100
Subject: [PATCH 1/3] fwctrl: include missing function declarations
The fwctrl fails to build with the following error:
fwctrl.c: In function 'fwctl_control_access_register':
fwctrl.c:190:27: error: implicit declaration of function 'return_by_reg_status' [-Wimplicit-function-declaration]
190 | *reg_status = return_by_reg_status(cmd_status);
| ^~~~~~~~~~~~~~~~~~~~
In file included from fwctrl.c:45:
fwctrl.c:195:56: error: implicit declaration of function 'm_err2str' [-Wimplicit-function-declaration]
195 | reg_id, cmd_status, *reg_status, m_err2str(status));
|
This commit adds the return_by_reg_status prototype to the
mtcr_ul_com.h file and includes mtcr_ul_com.h and mtcr.h
(where the m_err2str prototype is defined) inside fwctrl.c.
Signed-off-by: Til Kaiser <mail@tk154.de>
---
mtcr_ul/fwctrl.c | 2 ++
mtcr_ul/mtcr_ul_com.h | 2 ++
2 files changed, 4 insertions(+)
--- a/mtcr_ul/fwctrl.c
+++ b/mtcr_ul/fwctrl.c
@@ -40,7 +40,9 @@
#include <errno.h>
#include <string.h>
#include <stddef.h>
+#include "mtcr.h"
#include "mtcr_mf.h"
+#include "mtcr_ul_com.h"
#include "fwctrl.h"
#include "fwctrl_ioctl.h"
--- a/mtcr_ul/mtcr_ul_com.h
+++ b/mtcr_ul/mtcr_ul_com.h
@@ -165,6 +165,8 @@ int mclear_pci_semaphore_ul(const char*
int mvpd_read4_ul(mfile* mf, unsigned int offset, u_int8_t value[4]);
+int return_by_reg_status(int reg_status);
+
int space_to_cap_offset(int space);
int get_dma_pages(mfile* mf, struct mtcr_page_info* page_info, int page_amount);

View File

@@ -0,0 +1,65 @@
From e674e1e15cdbae9911699bad071bb2992c4ed5a5 Mon Sep 17 00:00:00 2001
From: Til Kaiser <mail@tk154.de>
Date: Fri, 9 May 2025 15:04:37 +0200
Subject: [PATCH] pldmlib: include <sys/types.h> for musl compatibility
Currently, the following errors occur when attempting to
compile the latest mstflint release using the musl toolchain:
In file included from pldm_utils.cpp:21:
pldm_utils.h:63:22: error: 'u_int32_t' was not declared in this scope; did you mean 'uint32_t'?
63 | std::string NumToStr(u_int32_t num);
| ^~~~~~~~~
| uint32_t
pldm_utils.h:66:80: error: 'u_int16_t' has not been declared
66 | void ComponentIdentifierToStringValue(ComponentIdentifier componentIdentifier, u_int16_t field, std::string& value);
| ^~~~~~~~~
pldm_utils.h:67:74: error: 'u_int16_t' has not been declared
67 | void ComponentIdentifierToValue(ComponentIdentifier componentIdentifier, u_int16_t field, u_int16_t& value);
| ^~~~~~~~~
pldm_utils.h:67:91: error: 'u_int16_t' has not been declared
67 | void ComponentIdentifierToValue(ComponentIdentifier componentIdentifier, u_int16_t field, u_int16_t& value);
| ^~~~~~~~~
pldm_utils.h:70:7: error: 'u_int8_t' does not name a type; did you mean 'uint8_t'?
70 | const u_int8_t expectedHeaderIdentifier[16] = {0xf0, 0x18, 0x87, 0x8c, 0xcb, 0x7d, 0x49, 0x43,
| ^~~~~~~~
| uint8_t
pldm_utils.cpp:64:8: error: redefinition of 'std::string NumToStr'
64 | string NumToStr(u_int32_t num)
| ^~~~~~~~
pldm_utils.h:63:13: note: 'std::string NumToStr' previously declared here
63 | std::string NumToStr(u_int32_t num);
| ^~~~~~~~
pldm_utils.cpp:64:17: error: 'u_int32_t' was not declared in this scope; did you mean 'uint32_t'?
64 | string NumToStr(u_int32_t num)
| ^~~~~~~~~
| uint32_t
pldm_utils.cpp:89:80: error: 'u_int16_t' has not been declared
89 | void ComponentIdentifierToStringValue(ComponentIdentifier componentIdentifier, u_int16_t field, string& value)
| ^~~~~~~~~
pldm_utils.cpp:108:74: error: 'u_int16_t' has not been declared
108 | void ComponentIdentifierToValue(ComponentIdentifier componentIdentifier, u_int16_t field, u_int16_t& value)
| ^~~~~~~~~
pldm_utils.cpp:108:91: error: 'u_int16_t' has not been declared
108 | void ComponentIdentifierToValue(ComponentIdentifier componentIdentifier, u_int16_t field, u_int16_t& value)
| ^~~~~~~~~
make[5]: *** [Makefile:507: pldm_utils.lo] Error 1
This issue arises because musl's stdlib.h does not include <sys/types.h>, unlike the glibc toolchain.
This patch manually includes <sys/types.h> to resolve the problem.
Signed-off-by: Til Kaiser <mail@tk154.de>
---
pldmlib/pldm_utils.h | 1 +
1 file changed, 1 insertion(+)
--- a/pldmlib/pldm_utils.h
+++ b/pldmlib/pldm_utils.h
@@ -13,6 +13,7 @@
#ifndef PLDM_UTILS_H_
#define PLDM_UTILS_H_
+#include <sys/types.h>
#include <memory>
#include <string>
#include <vector>

View File

@@ -1,40 +0,0 @@
From 873c1822521b0524571ba54f4ce5d565fbf59c1f Mon Sep 17 00:00:00 2001
From: Til Kaiser <mail@tk154.de>
Date: Fri, 7 Feb 2025 14:42:25 +0100
Subject: [PATCH 2/3] fwctrl: fix reg status typo
There is the following build error:
fwctrl.c: In function 'fwctl_control_access_register':
fwctrl.c:197:66: error: incompatible type for argument 1 of 'm_err2str'
197 | reg_id, cmd_status, *reg_status, m_err2str(status));
| ^~~~~~
| |
| void *
../include/mtcr_ul/fwctrl_ioctl.h:47:81: note: in definition of macro 'FWCTL_DEBUG_PRINT'
47 | printf("%s: %s %d: " format, FWCTL_ENV_VAR_DEBUG, __func__, __LINE__, ##arg); \
| ^~~
In file included from fwctrl.c:43:
../include/mtcr_ul/mtcr.h:173:30: note: expected 'MError' but argument is of type 'void *'
173 | const char* m_err2str(MError status);
| ~~~~~~~^~~~~~
Looking at the format string, this seems to be just a typo,
so fix that to the correct variable name.
Signed-off-by: Til Kaiser <mail@tk154.de>
---
mtcr_ul/fwctrl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/mtcr_ul/fwctrl.c
+++ b/mtcr_ul/fwctrl.c
@@ -194,7 +194,7 @@ int fwctl_control_access_register(int
}
FWCTL_DEBUG_PRINT(mf, "register id = 0x%x, command status = 0x%x, reg status code: 0x%x, reg status: %s\n",
- reg_id, cmd_status, *reg_status, m_err2str(status));
+ reg_id, cmd_status, *reg_status, m_err2str(*reg_status));
out:
free(out);
free(in);

View File

@@ -1,31 +0,0 @@
From dea0155b131b55cdc1bb3bc867ad53c1782fa724 Mon Sep 17 00:00:00 2001
From: Til Kaiser <mail@tk154.de>
Date: Fri, 7 Feb 2025 14:52:35 +0100
Subject: [PATCH 3/3] dev_mgt: include missing function declaration
The dev_mgt fails to build with the following error:
tools_dev_types.c: In function 'dm_get_device_id_inner':
tools_dev_types.c:695:13: error: implicit declaration of function 'read_device_id'; did you mean 'dm_get_device_id'? [-Wimplicit-function-declaration]
695 | if (read_device_id(mf, &dword) != 4) {
| ^~~~~~~~~~~~~~
| dm_get_device_id
This commit includes mtcr_ul_com.h (where read_device_id
is defined) into tools_dev_types.c to fix the error.
Signed-off-by: Til Kaiser <mail@tk154.de>
---
dev_mgt/tools_dev_types.c | 1 +
1 file changed, 1 insertion(+)
--- a/dev_mgt/tools_dev_types.c
+++ b/dev_mgt/tools_dev_types.c
@@ -48,6 +48,7 @@
#include <tools_layouts/reg_access_hca_layouts.h>
#include "tools_dev_types.h"
#include "mflash/mflash_types.h"
+#include "mtcr_ul/mtcr_ul_com.h"
enum dm_dev_type {
DM_UNKNOWN = -1,