Skip to content

Commit

Permalink
[mellanox]: Disable MFT bash autocompletion. (sonic-net#17359)
Browse files Browse the repository at this point in the history
A W/A to overcome delay of about 20 sec on login due to MFT bash autocompletion bug.
Should be reverted once a formal solution will be available in future MFT release.

Why I did it
To overcome SN2700 20 sec delay on login
Work item tracking
N/A
How I did it
Removed MFT bash autocompletion part
How to verify it
make configure PLATFORM=mellanox
make target/sonic-mellanox.bin
  • Loading branch information
nazariig authored Dec 8, 2023
1 parent f445416 commit 06ed67d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion platform/mellanox/mft/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2016-2021 NVIDIA CORPORATION & AFFILIATES.
# Copyright (c) 2016-2023 NVIDIA CORPORATION & AFFILIATES.
# Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -42,6 +42,8 @@ DERIVED_TARGETS = $(MOD_DEB) mft-oem_$(MFT_VERSION)-$(MFT_REVISION)_$(CONFIGURED
DKMS_BMDEB = /var/lib/dkms/kernel-mft-dkms/$(MFT_VERSION)/bmdeb
DKMS_TMP := $(shell mktemp -u -d -t dkms.XXXXXXXXXX)

MFT_TMP := $(shell mktemp -u -d -t mft.XXXXXXXXXX)

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
rm -rf $(MFT_NAME)
wget -O $(MFT_TGZ) $(MFT_TGZ_URL)
Expand Down Expand Up @@ -75,6 +77,19 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :

rm -rf $(DKMS_TMP)

# w/a: disable bash autocompletion
mkdir -p $(MFT_TMP)/DEBIAN

dpkg -e $(MFT_NAME)/DEBS/$(MAIN_TARGET) $(MFT_TMP)/DEBIAN
dpkg -x $(MFT_NAME)/DEBS/$(MAIN_TARGET) $(MFT_TMP)

rm -rf $(MFT_TMP)/etc/bash_completion.d
sed -i '/bash_completion.d/d' $(MFT_TMP)/DEBIAN/conffiles

dpkg -b $(MFT_TMP) $(MFT_NAME)/DEBS/$(MAIN_TARGET)

rm -rf $(MFT_TMP)

# fix timestamp because we do not actually build tools, only kernel
touch $(MFT_NAME)/DEBS/*.deb
mv $(MFT_NAME)/DEBS/*.deb $(DEST)
Expand Down

0 comments on commit 06ed67d

Please sign in to comment.