Skip to content

Commit

Permalink
Merge pull request sonic-net#584 from mssonicbld/sonicbld/202405-merge
Browse files Browse the repository at this point in the history
[code sync] Merge code from sonic-net/sonic-buildimage:202405 to 202405
  • Loading branch information
mssonicbld authored Feb 5, 2025
2 parents f41e78f + 6eafc7c commit 6474bc4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
28 changes: 28 additions & 0 deletions files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,26 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i {{deb}} || sudo LANG=C DEBIAN_FRONTEND=noni
{% endfor %}
{% endif %}

{% if installer_debs.strip() -%}
{% for deb in installer_debs.strip().split(' ') -%}

# For some SONiC patch packages, Debian offcial version may higher than SONiC version
# When install SONiC packages, fix broken install by 'apt-get -y install -f' may upgrade some installed SONiC packages to Debian offical version
# Check and install upgraded SONiC package again, if install failed, need manually check and fix SONiC package version issue
PACKAGE_NAME=$(dpkg-deb -f {{deb}} Package)
PACKAGE_VERSION=$(dpkg-deb -f {{deb}} Version)
INSTALLED_VERSION=$(dpkg-query --showformat='${Version}' --show $PACKAGE_NAME || true)
if [ "$INSTALLED_VERSION" != "" ] && [ "$INSTALLED_VERSION" != "$PACKAGE_VERSION" ]; then
sudo dpkg --root=$FILESYSTEM_ROOT -i {{deb}}
fi

## SONiC packages may have lower version than Debian offical package, install offical Debian package will break feature
## Hold installed packages to prevent these packages be upgrade by apt commands in this file
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-mark hold $PACKAGE_NAME

{% endfor %}
{% endif %}

## Run depmod command for target kernel modules
sudo LANG=C chroot $FILESYSTEM_ROOT depmod -a {{kversion}}

Expand Down Expand Up @@ -1135,3 +1155,11 @@ sudo rm -rf $FILESYSTEM_ROOT/tmp/mask_disabled_services.py


sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install python3-dbus

{% if installer_debs.strip() -%}
{% for deb in installer_debs.strip().split(' ') -%}
## Unhold installed packages to allow these packages be upgrade after SONiC installed
PACKAGE_NAME=$(dpkg-deb -f {{deb}} Package)
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-mark unhold $PACKAGE_NAME
{% endfor %}
{% endif %}
2 changes: 1 addition & 1 deletion rules/sonic-fips.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# fips packages

ifeq ($(BLDENV), bookworm)
FIPS_VERSION = 1.4.3-1
FIPS_VERSION = 1.5.2
FIPS_OPENSSL_VERSION = 3.0.11-1~deb12u2+fips
FIPS_OPENSSH_VERSION = 9.2p1-2+deb12u3+fips
FIPS_PYTHON_MAIN_VERSION = 3.11
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-py-common/sonic_py_common/device_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ def get_system_mac(namespace=None, hostname=None):
mac_tmp = "{:012x}".format(int(mac_tmp, 16) + 1)
mac_tmp = re.sub("(.{2})", "\\1:", mac_tmp, 0, re.DOTALL)
mac = mac_tmp[:-1]
return mac
return mac.strip() if mac else None


def get_system_routing_stack():
Expand Down

0 comments on commit 6474bc4

Please # to comment.