From f3df6e2f1bdea686a2d0405638a18b2b396a508e Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Thu, 16 Dec 2021 16:02:03 +0200 Subject: [PATCH] [Mellanox] fix hw-mgmt patches (#9539) - Why I did it To fix an issue that hw-mgmt patches were not applied. One patch was already in upstream hw-mgmt package thus applying it again caused an error and no other patches were applied. Also, I did it to improve the Makefile, so that the make will fail in case patches fail to apply. - How I did it Removed obsolete patch, made applying patches a hard failure in the build. - How to verify it Run the make and verify patches are applied. Signed-off-by: Stepan Blyschak --- ...gmt-system-MSN4600-A1-BU-config1-fix.patch | 28 ------------------- platform/mellanox/hw-management/Makefile | 3 +- 2 files changed, 2 insertions(+), 29 deletions(-) delete mode 100644 platform/mellanox/hw-management/0002-hw-mgmt-system-MSN4600-A1-BU-config1-fix.patch diff --git a/platform/mellanox/hw-management/0002-hw-mgmt-system-MSN4600-A1-BU-config1-fix.patch b/platform/mellanox/hw-management/0002-hw-mgmt-system-MSN4600-A1-BU-config1-fix.patch deleted file mode 100644 index 391121cff4..0000000000 --- a/platform/mellanox/hw-management/0002-hw-mgmt-system-MSN4600-A1-BU-config1-fix.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 1b2c2343d62b2fadb5c8fc9e61f2f654f4085193 Mon Sep 17 00:00:00 2001 -From: Mykola Kostenok -Date: Wed, 12 May 2021 10:59:57 +0300 -Subject: [PATCH] hw-mgmt: system: MSN4600 A1 BU config1 fix - -Fix config1 matching for MSN4600. - -Signed-off-by: Mykola Kostenok ---- - usr/usr/bin/hw-management.sh | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/usr/usr/bin/hw-management.sh b/usr/usr/bin/hw-management.sh -index d5b2728..150e583 100755 ---- a/usr/usr/bin/hw-management.sh -+++ b/usr/usr/bin/hw-management.sh -@@ -728,7 +728,7 @@ msn46xx_specific() - if [ $res -eq 0 ]; then - sys_ver=$(cut "$regio_path"/config1 -d' ' -f 1) - case $sys_ver in -- 3) -+ 1) - connect_msn4700_msn4600_A1 - ;; - *) --- -1.7.1 - diff --git a/platform/mellanox/hw-management/Makefile b/platform/mellanox/hw-management/Makefile index eb087b47bf..9c62312d18 100644 --- a/platform/mellanox/hw-management/Makefile +++ b/platform/mellanox/hw-management/Makefile @@ -6,7 +6,8 @@ MAIN_TARGET = hw-management_1.mlnx.$(MLNX_HW_MANAGEMENT_VERSION)_amd64.deb $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : pushd hw-mgmt - git am ../*.patch + git stash + git apply -3 ../*.patch || exit 1 chmod +x ./debian/rules KVERSION=$(KVERSION) dpkg-buildpackage -us -uc -b -rfakeroot -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd