[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.
This commit is contained in:
Konstantin Vasin 2023-09-06 09:42:34 +03:00 committed by GitHub
parent 204579a0cc
commit 1e7db2ab01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 3 additions and 49 deletions

View File

@ -28,7 +28,8 @@ RUN apt-get update && \
iputils-ping \ iputils-ping \
pciutils \ pciutils \
# smartmontools version should match the installed smartmontools in sonic_debian_extension build template # 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. # 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 # Instead, the installation directory is mounted from the host OS. However, this method

View File

@ -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)_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) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PLATFORM_COMMON_PY3)

View File

@ -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)

View File

@ -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

View File

@ -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)