From 1e7db2ab01b6fe68c51b6e7531d95ab2634d92c0 Mon Sep 17 00:00:00 2001 From: Konstantin Vasin <126960927+k-v1@users.noreply.github.com> Date: Wed, 6 Sep 2023 09:42:34 +0300 Subject: [PATCH] [build]: Don't build ethtool from source (#15856) Why I did it There is no reason to build deb package ethtool from source code. We can install the same version from Debian bullseye mirror. How I did it Remove ethtool Makefiles from sonic-buildimage. Install ethtool via apt-get in pmon container. --- dockers/docker-platform-monitor/Dockerfile.j2 | 3 ++- rules/docker-platform-monitor.mk | 2 +- rules/ethtool.dep | 8 ------ rules/ethtool.mk | 13 ---------- src/ethtool/Makefile | 26 ------------------- 5 files changed, 3 insertions(+), 49 deletions(-) delete mode 100644 rules/ethtool.dep delete mode 100644 rules/ethtool.mk delete mode 100644 src/ethtool/Makefile diff --git a/dockers/docker-platform-monitor/Dockerfile.j2 b/dockers/docker-platform-monitor/Dockerfile.j2 index 1c6b484814..ee971e369d 100755 --- a/dockers/docker-platform-monitor/Dockerfile.j2 +++ b/dockers/docker-platform-monitor/Dockerfile.j2 @@ -28,7 +28,8 @@ RUN apt-get update && \ iputils-ping \ pciutils \ # smartmontools version should match the installed smartmontools in sonic_debian_extension build template - smartmontools=7.2-1 + smartmontools=7.2-1 \ + ethtool # On Arista devices, the sonic_platform wheel is not installed in the container. # Instead, the installation directory is mounted from the host OS. However, this method diff --git a/rules/docker-platform-monitor.mk b/rules/docker-platform-monitor.mk index 1bfd256ef5..6652dfe18a 100644 --- a/rules/docker-platform-monitor.mk +++ b/rules/docker-platform-monitor.mk @@ -6,7 +6,7 @@ DOCKER_PLATFORM_MONITOR_DBG = $(DOCKER_PLATFORM_MONITOR_STEM)-$(DBG_IMAGE_MARK). $(DOCKER_PLATFORM_MONITOR)_PATH = $(DOCKERS_PATH)/$(DOCKER_PLATFORM_MONITOR_STEM) -$(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(LIBSENSORS) $(LM_SENSORS) $(FANCONTROL) $(SENSORD) $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) $(ETHTOOL) $(MFT) +$(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(LIBSENSORS) $(LM_SENSORS) $(FANCONTROL) $(SENSORD) $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) $(MFT) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PLATFORM_COMMON_PY3) diff --git a/rules/ethtool.dep b/rules/ethtool.dep deleted file mode 100644 index 15a9608404..0000000000 --- a/rules/ethtool.dep +++ /dev/null @@ -1,8 +0,0 @@ -SPATH := $($(ETHTOOL)_SRC_PATH) -DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/ethtool.mk rules/ethtool.dep -DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) -DEP_FILES += $(shell git ls-files $(SPATH)) - -$(ETHTOOL)_CACHE_MODE := GIT_CONTENT_SHA -$(ETHTOOL)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) -$(ETHTOOL)_DEP_FILES := $(DEP_FILES) diff --git a/rules/ethtool.mk b/rules/ethtool.mk deleted file mode 100644 index 11c857811a..0000000000 --- a/rules/ethtool.mk +++ /dev/null @@ -1,13 +0,0 @@ -# ethtool - -ETHTOOL_VERSION_BASE = 5.9 -export ETHTOOL_VERSION_BASE - -ETHTOOL = ethtool_$(ETHTOOL_VERSION_BASE)-1_$(CONFIGURED_ARCH).deb -$(ETHTOOL)_SRC_PATH = $(SRC_PATH)/ethtool -SONIC_MAKE_DEBS += $(ETHTOOL) - -ETHTOOL_DBG = ethtool-dbgsym_$(ETHTOOL_VERSION_BASE)-1_$(CONFIGURED_ARCH).deb -$(eval $(call add_extra_package,$(ETHTOOL),$(ETHTOOL_DBG))) - -export ETHTOOL ETHTOOL_DBG diff --git a/src/ethtool/Makefile b/src/ethtool/Makefile deleted file mode 100644 index 6190a58aa3..0000000000 --- a/src/ethtool/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -.ONESHELL: -SHELL = /bin/bash -.SHELLFLAGS += -e - -MAIN_TARGET = $(ETHTOOL) -DERIVED_TARGET = $(ETHTOOL_DBG) - -$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : - # Obtaining the ethtool debian package - rm -rf ethtool* - git clone https://salsa.debian.org/kernel-team/ethtool/ - pushd ethtool - git checkout tags/debian/1%$(ETHTOOL_VERSION_BASE)-1 - # Build package -ifeq ($(MULTIARCH_QEMU_ENVIRON), y) - DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) -else ifeq ($(CROSS_BUILD_ENVIRON), y) - DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -rfakeroot -b -us -uc -a$(CONFIGURED_ARCH) -Pcross,nocheck -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) -else - dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) -endif - - popd - mv $(DERIVED_TARGET) $* $(DEST)/ - -$(addprefix $(DEST)/, $(DERIVED_TARGET)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)