introduce Broadcom legacy image for 7060cx#25192
introduce Broadcom legacy image for 7060cx#25192StormLiangMS merged 15 commits intosonic-net:masterfrom
Conversation
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
… version Signed-off-by: xuliping@microsoft.com <xuliping@microsoft.com> Signed-off-by: Liping Xu <xuliping@microsoft.com>
Signed-off-by: xuliping@microsoft.com <xuliping@microsoft.com> Signed-off-by: Liping Xu <xuliping@microsoft.com>
Signed-off-by: xuliping@microsoft.com <xuliping@microsoft.com> Signed-off-by: Liping Xu <xuliping@microsoft.com>
Signed-off-by: xuliping@microsoft.com <xuliping@microsoft.com> Signed-off-by: Liping Xu <xuliping@microsoft.com>
Signed-off-by: xuliping@microsoft.com <xuliping@microsoft.com> Signed-off-by: Liping Xu <xuliping@microsoft.com>
…est script Fix build failure caused by missing execute permission. The platform_asic_checker script is executed during build but had 644 permissions instead of 755. Error: /bin/bash: line 15: ./platform_asic_checker: Permission denied Signed-off-by: Liping Xu <xuliping@microsoft.com>
Signed-off-by: Liping Xu <xuliping@microsoft.com>
27534e0 to
b266db4
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Update build system and kernel API compatibility for Trixie kernel 6.12: Build System Changes (debian/rules): - Dynamic kernel version detection instead of hardcoded 6.1.0-29-2-amd64 - Use KVER_ARCH and KVER_COMMON variables for flexible kernel version handling - Add -f flags to rm/ln/cp commands for idempotent builds Kernel API Compatibility: - MAX_ORDER -> MAX_PAGE_ORDER (kernel 6.5+) - PCI_IRQ_LEGACY -> PCI_IRQ_INTX (kernel 6.8+) - strlcpy() -> strscpy() (kernel 6.12+) - platform_driver.remove: int -> void return type (kernel 6.11+) - ethtool_ts_info -> kernel_ethtool_ts_info (kernel 6.11+) Compiler Flags: - Add -Wno-declaration-after-statement, -Wno-missing-prototypes, -Wno-array-bounds, -fcf-protection for GCC 14 compatibility Signed-off-by: Liping Xu <xuliping@microsoft.com>
Update kernel version references in debian packaging files: - debian/control: Depend on linux-image-6.12.41+deb13-sonic-amd64-unsigned - debian/opennsl-modules.install: Install modules to lib/modules/6.12.41+deb13-sonic-amd64/extra - debian/opennsl-modules.dirs: Create directory for 6.12.41+deb13-sonic-amd64 Without these fixes: - Package fails dependency check and gets deinstalled by dpkg - Kernel modules are installed to wrong directory - opennsl-modules.service fails to load modules, causing syncd/swss boot failure Signed-off-by: Liping Xu <xuliping@microsoft.com>
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Remove unnecessary -f flags from rm, ln, and cp commands in build-arch section to be consistent with saibcm-modules (XGS). Signed-off-by: Liping Xu <xuliping@microsoft.com>
Add nosemgrep inline comments to suppress Semgrep false positive for the strlcpy compatibility macro '#define strscpy strlcpy'. This macro is only used for backward compatibility with kernels < 4.19 and is never compiled on Trixie (kernel 6.12). strlcpy is bounds-checked and safe; it was removed from kernel 6.12 in favor of strscpy, not due to security issues. Signed-off-by: Liping Xu <xuliping@microsoft.com>
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Add nosemgrep inline comment to suppress Semgrep false positive for strncpy usage in ngknet_linux.h sal_strncpy function. This is a SAL (System Abstraction Layer) compatibility wrapper that provides platform-independent string operations. The strncpy usage is intentional for backward compatibility and has proper bounds checking. Signed-off-by: Liping Xu <xuliping@microsoft.com>
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Fix build failure: 'supervisor-proc-exit-listener': not found Changes: 1. Remove invalid COPY line for supervisor-proc-exit-listener (file doesn't exist) 2. Fix variable name: docker_syncd_brcm_debs -> docker_syncd_brcm_legacy_debs 3. Update to multi-stage build format to match docker-syncd-brcm 4. Use copy_files macro instead of manual COPY loop This aligns the legacy Dockerfile with the XGS variant structure. Signed-off-by: Liping Xu <xuliping@microsoft.com>
ecce860 to
1cab69d
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Liping Xu <xuliping@microsoft.com>
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 90 out of 585 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (5)
platform/broadcom/saibcm-modules-legacy/sdklt/Makefile:30
- Typo in help text:
CROSS_COPILEshould beCROSS_COMPILEto match the exported variable name and common kernel build conventions.
@echo 'CROSS_COPILE - Cross-compiler prefix (optional)'
platform/broadcom/saibcm-modules-legacy/debian/control:13
- Hardcoding an exact kernel-image dependency makes this package brittle across kernel updates. For kernel module packages, it’s usually better to depend on a virtual/kernel ABI–specific package name (or use debhelper mechanisms to inject the correct dependency), so the package can be rebuilt/consumed across supported kernel revisions without editing control metadata.
Depends: linux-image-6.12.41+deb13-sonic-amd64-unsigned
platform/broadcom/saibcm-modules-legacy/GLOG:2
- This file appears to be a generated log and includes absolute internal build paths. It’s best not to commit build logs that can leak environment details. Suggest removing
GLOGfrom the repo and adding it to.gitignore(and/or ensuring it’s not produced in the source tree during builds).
CMD = [/projects/csg_sonic2/sk411346/repos/SAI/6.5.29/ocp_sai/sdk-src/hsdk-6.5.29/xgs-sdk-6.5.29-gpl-modules/, gtags --single-update systems/linux/kernel/modules/bcm-knet/bcm-knet.c]
CMD = [/projects/csg_sonic2/sk411346/repos/SAI/6.5.29/ocp_sai/sdk-src/hsdk-6.5.29/xgs-sdk-6.5.29-gpl-modules/, gtags --single-update systems/linux/kernel/modules/knet-cb/knet-cb.c]
platform/broadcom/docker-syncd-brcm-legacy/bcmsh:7
- Typo in usage text:
quiteshould bequiet.
-q quite, no banner (default: verbose)"
platform/broadcom/docker-syncd-brcm-legacy/start.sh:18
- Typo in comment:
cacseshould becase.
# There is also a possibility that both sai.profile.j2 and config.bcm.j2 are absent. in that cacse just copy
| # create links | ||
| cd /; sudo mkdir -p /lib/modules/$(KVER_ARCH) | ||
| cd /; sudo rm /lib/modules/$(KVER_ARCH)/build | ||
| cd /; sudo rm /lib/modules/$(KVER_ARCH)/source | ||
| cd /; sudo ln -s /usr/src/linux-headers-$(KVER_COMMON)/ /lib/modules/$(KVER_ARCH)/source | ||
| cd /; sudo ln -s /usr/src/linux-headers-$(KVER_ARCH)/ /lib/modules/$(KVER_ARCH)/build | ||
| cd /; sudo ln -s /usr/src/linux-headers-$(KVER_ARCH)/include/generated/ /usr/src/linux-headers-$(KVER_COMMON)/include/generated | ||
| cd /; sudo ln -s /usr/src/linux-headers-$(KVER_ARCH)/arch/x86/include/generated/ /usr/src/linux-headers-$(KVER_COMMON)/arch/x86/include/generated | ||
| cd /; sudo ln -s /usr/src/linux-headers-$(KVER_ARCH)/arch/x86/module.lds /usr/src/linux-headers-$(KVER_COMMON)/arch/x86/module.lds | ||
| cd /; sudo ln -s /usr/src/linux-headers-$(KVER_ARCH)/include/config/ /usr/src/linux-headers-$(KVER_COMMON)/include/config | ||
| cd /; sudo cp /usr/src/linux-headers-$(KVER_ARCH)/Module.symvers /usr/src/linux-headers-$(KVER_COMMON)/Module.symvers |
There was a problem hiding this comment.
The Debian package build uses sudo and mutates host paths under /lib/modules and /usr/src. Package builds (including in CI/build containers) are typically non-root and must not alter the build host. Instead, drive the build by passing the correct kernel header paths (e.g., via KDIR/KERNDIR/KERNEL_SRC) without creating global symlinks, or confine any necessary staging under the package build directory (e.g., debian/tmp).
| systems/linux/user/x86-smp_generic_64-2_6/linux-bcm-knet.ko lib/modules/6.12.41+deb13-sonic-amd64/extra | ||
| systems/linux/user/x86-smp_generic_64-2_6/linux-kernel-bde.ko lib/modules/6.12.41+deb13-sonic-amd64/extra | ||
| systems/linux/user/x86-smp_generic_64-2_6/linux-user-bde.ko lib/modules/6.12.41+deb13-sonic-amd64/extra | ||
| systems/linux/user/x86-smp_generic_64-2_6/linux-knet-cb.ko lib/modules/6.12.41+deb13-sonic-amd64/extra | ||
| systemd/opennsl-modules.service lib/systemd/system | ||
| sdklt/build/bde/linux_ngbde.ko lib/modules/6.12.41+deb13-sonic-amd64/extra | ||
| sdklt/build/knet/linux_ngknet.ko lib/modules/6.12.41+deb13-sonic-amd64/extra | ||
| sdklt/build/knetcb/linux_ngknetcb.ko lib/modules/6.12.41+deb13-sonic-amd64/extra |
There was a problem hiding this comment.
The install destinations hardcode a specific kernel version (6.12.41+deb13-sonic-amd64). This will break as soon as the kernel version changes. Consider generating this .install file during the build from KVERSION/KVERS/KVER_ARCH in debian/rules, or installing into a staging path and letting postinst/depmod place modules under the running kernel version.
| systems/linux/user/x86-smp_generic_64-2_6/linux-bcm-knet.ko lib/modules/6.12.41+deb13-sonic-amd64/extra | |
| systems/linux/user/x86-smp_generic_64-2_6/linux-kernel-bde.ko lib/modules/6.12.41+deb13-sonic-amd64/extra | |
| systems/linux/user/x86-smp_generic_64-2_6/linux-user-bde.ko lib/modules/6.12.41+deb13-sonic-amd64/extra | |
| systems/linux/user/x86-smp_generic_64-2_6/linux-knet-cb.ko lib/modules/6.12.41+deb13-sonic-amd64/extra | |
| systemd/opennsl-modules.service lib/systemd/system | |
| sdklt/build/bde/linux_ngbde.ko lib/modules/6.12.41+deb13-sonic-amd64/extra | |
| sdklt/build/knet/linux_ngknet.ko lib/modules/6.12.41+deb13-sonic-amd64/extra | |
| sdklt/build/knetcb/linux_ngknetcb.ko lib/modules/6.12.41+deb13-sonic-amd64/extra | |
| systems/linux/user/x86-smp_generic_64-2_6/linux-bcm-knet.ko lib/modules/*/extra | |
| systems/linux/user/x86-smp_generic_64-2_6/linux-kernel-bde.ko lib/modules/*/extra | |
| systems/linux/user/x86-smp_generic_64-2_6/linux-user-bde.ko lib/modules/*/extra | |
| systems/linux/user/x86-smp_generic_64-2_6/linux-knet-cb.ko lib/modules/*/extra | |
| systemd/opennsl-modules.service lib/systemd/system | |
| sdklt/build/bde/linux_ngbde.ko lib/modules/*/extra | |
| sdklt/build/knet/linux_ngknet.ko lib/modules/*/extra | |
| sdklt/build/knetcb/linux_ngknetcb.ko lib/modules/*/extra |
StormLiangMS
left a comment
There was a problem hiding this comment.
@lipxu Review comments:
Blockers:
-
*Hardcoded kernel version in \debian/opennsl-modules.install* — Install paths reference \lib/modules/6.12.41+deb13-sonic-amd64/extra. This will break on any kernel version change. Should be generated from \KVERSION\ at build time.
-
*\sudo\ in \debian/rules* — Package build uses \sudo\ to mutate host paths under /lib/modules\ and /usr/src. This is unsafe in CI and may fail in non-root build containers. Should use \KDIR/\KERNDIR\ to pass kernel header paths instead.
Question:
- ~580 vendored source files — The entire \saibcm-modules-legacy/\ kernel module source tree is checked into the repo. Is there a submodule or package alternative to avoid carrying this in-tree? If vendoring is the only option, please confirm in the PR description.
Thank you for your detailed review @StormLiangMS ! I'd like to clarify the scope: Blockers:1. Hardcoded kernel version in Both of these are pre-existing issues that have existed in the codebase since the original implementation and are currently present in:
Key points:
Risk Assessment: Recommendation:
This approach ensures we don't block the Legacy ASIC feature while acknowledging the technical debt can be improved across the board. Question:~665 vendored source files The Future plan:
Recommendation: |
Hi, @Ryangwaite , |
Yeah, that's a good approach |
|
/azp run Azure.sonic-buildimage |
|
Commenter does not have sufficient privileges for PR 25192 in repo sonic-net/sonic-buildimage |
|
/azpw run Azure.sonic-buildimage |
|
/AzurePipelines run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Cherry-pick PR to 202511: #25878 |

Why I did it
Broadcom would still support TH SAI with current version, but no upgrade plan.
Work item tracking
36193015
How I did it
Introduce the Broadcom legacy image for 7060cx with the latest SONiC code and old SAI binary.
How to verify it
https://elastictest.org/scheduler/testplan/697ecfc0d7617b89998e1669
https://elastictest.org/scheduler/testplan/697ecfc0d7617b89998e1663
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)