SONiC support for BMC cards based on Aspeed AST2720#24898
SONiC support for BMC cards based on Aspeed AST2720#24898yxieca merged 19 commits intosonic-net:masterfrom
Conversation
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
8091249 to
fd82d21
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
fd82d21 to
1287188
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…eval board
Platform Introduction:
• New Aspeed platform for ARM64 architecture
• Kernel drivers via src/sonic-linux-kernel (separate PR)
• Build infrastructure: platform/aspeed + device/aspeed → sonic-aspeed.bin target
• eMMC installation tooling with ext4 image creation scripts
Installation & Image Management:
• Initial platform infrastructure under platform/aspeed and device/aspeed directories
• SONiC installer-based approach with single partition and multiple directory-based
installs (replacing two-partition setup)
• eMMC image download support via HTTP/SCP with flashing capabilities
• U-Boot environment variable configuration for proper boot management
• Fixed sonic-installer for bootonce logic and image creation
System Services & Configuration:
• New sonic-bmc-platform-aspeed debian package for BMC initialization and management
• Reorganized systemd services: added/removed/masked units as needed
• Enhanced service dependencies (config-topology, config-setup, etc.)
Build & Packaging:
• Modernized Debian packaging for debhelper-compat 13 compatibility
• Rust stable version 1.86 for build stability
• Multi-distribution support: Trixie and Bookworm
• Database Docker container support for BMC
Hardware Monitoring & Services:
• Platform support for fan, temperature sensors, thermal monitoring, reboot cause, and
watchdog
• GNMI service auto-start on BMC boot with ASIC dependencies removed
• New bmcdb database type (similar to dpudb) to avoid BMP_STATE_DB dependencies
Signed-off-by: Chandrasekaran Swaminathan <[email protected]>
1287188 to
ae02708
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Chandrasekaran Swaminathan <[email protected]>
|
/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). |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
nats-nokia
left a comment
There was a problem hiding this comment.
Hello Chinmoy – we are also building and using the AST2700 eval board to load SONIC build. We would like to leverage your commit but there are several files that are using the FIT implementation rather than a UEFI implementation. We would like the scripts to support a UEFI installation. Are you planning to add UEFI support?
| # Aspeed BMC platform: Filter services for BMC use case | ||
| if [[ $CONFIGURED_PLATFORM == aspeed ]]; then | ||
| # Show original service count | ||
| ORIGINAL_COUNT=$(wc -l < $GENERATED_SERVICE_FILE) |
There was a problem hiding this comment.
Build error is observed.
+ sudo rm -f syslog-counter_1.0.0_arm64.deb
+ [[ aspeed == aspeed ]]
++ wc -l
./sonic_debian_extension.sh: line 1288: ./fsroot-aspeed/etc/sonic/generated_services.conf: Permission denied
+ ORIGINAL_COUNT=
+ clean_sys
This line requires sudo to resolve
ORIGINAL_COUNT=$(sudo bash -c "wc -l < $GENERATED_SERVICE_FILE")
There was a problem hiding this comment.
@nats-nokia , thank you for the feedback. somehow missed notification earlier. We’ll look into this and provide an update soon.
There was a problem hiding this comment.
Yes, adding sudo would improve consistency and help safeguard against potential umask changes. Thank you for pointing this out.
It was not identified earlier because, the file is created using sudo tee (for example, lines 413 and 418), which results in a root owned file with default permissions of 644 (rw-r--r--). The ubuntu user falls under the “others” category and therefore has read permission .However, if a stricter umask were in effect (for example, 077), the file would be created with permission 600 (owner-only), and the command would fail without sudo. We will push the change.
[05:01:53] ubuntu@ip-172-31-7-82:~/private-sonic-buildimage (chinmoy-aspeed)
$ ls -l fsroot-aspeed/etc/sonic/generated_services.conf
-rw-r--r-- 1 root root 433 Jan 12 15:53 fsroot-aspeed/etc/sonic/generated_services.conf
[05:02:43] ubuntu@ip-172-31-7-82:~/private-sonic-buildimage (chinmoy-aspeed)
$ wc -l < fsroot-aspeed/etc/sonic/generated_services.conf
19
[05:03:14] ubuntu@ip-172-31-7-82:~/private-sonic-buildimage (chinmoy-aspeed)
$ sudo bash -c "wc -l < fsroot-aspeed/etc/sonic/generated_services.conf"
19
[05:03:49] ubuntu@ip-172-31-7-82:~/private-sonic-buildimage (chinmoy-aspeed)
$ whoami
ubuntu
[05:04:36] ubuntu@ip-172-31-7-82:~/private-sonic-buildimage (chinmoy-aspeed)
$ groups
ubuntu adm dialout cdrom floppy sudo audio dip video plugdev netdev lxd docker
[05:04:40] ubuntu@ip-172-31-7-82:~/private-sonic-buildimage (chinmoy-aspeed)
$ sudo -n true
[05:04:53] ubuntu@ip-172-31-7-82:~/private-sonic-buildimage (chinmoy-aspeed)
$ umask
0002
[05:08:53] ubuntu@ip-172-31-7-82:~/private-sonic-buildimage (chinmoy-aspeed)
$ sudo sh -c 'umask' <===== Created with this umask
0022
Minor fix: adding missing 'sudo'
- adding sudo would improve consistency and
help safeguard against potential umask changes.
Signed-off-by: Chandrasekaran Swaminathan <[email protected]>
|
/azp run Azure.sonic-buildimage |
| @@ -0,0 +1,2 @@ | |||
| # BMC platform environment | |||
| export BMC_PLATFORM=1 No newline at end of file | |||
| "skip_ledd": true, | ||
| "skip_xcvrd": true, | ||
| "skip_psud": true, | ||
| "skip_syseepromd": true, |
There was a problem hiding this comment.
We could have syseepromd NOT skipped in BMC to get EEPROM data and store in DB ?
There was a problem hiding this comment.
This is placeholder code and needs a revisit when the hardware is fully ready
| 'procdockerstatsd.service', # Container resource monitoring | ||
|
|
||
| # Time synchronization | ||
| 'ntp.service', # NTP time synchronization |
There was a problem hiding this comment.
Can you check if NTP is replaced with chrony in sonic master
There was a problem hiding this comment.
We will look into this and share an update, @judyjoseph . Kindly let us know if addressing this in the next PR works for you.
There was a problem hiding this comment.
Will do and take up enabling of all the required systemd services (and docker containers) as a follow up PR. Same for all the comments that follow. Hope thats fine?
|
|
||
| # SONiC NOS services - not needed for BMC | ||
| 'sonic-hostservice.service', # SONiC host services (VLAN, LAG, etc.) - NOS-specific | ||
| 'hostcfgd.service', # SONiC host config daemon - NOS-specific |
There was a problem hiding this comment.
We would need hostcfgd service .. this is one which handles AAA/PAM
| # Services to REMOVE for BMC platform (not needed) | ||
| BMC_EXCLUDED_SERVICES = { | ||
| # AAA/TACACS - not needed on BMC | ||
| 'tacacs-config.service', |
There was a problem hiding this comment.
we need AAA/TACACS in BMC - as we can login to BMC directly
| '[email protected]', # Local console - only if VGA/HDMI available | ||
|
|
||
| # Optional services - can be excluded for minimal BMC | ||
| 'auditd.service', # Security audit - only needed for compliance |
There was a problem hiding this comment.
auditd also would be needed @qiluo-msft could you confirm if we can skip this service
| 'pmon.service', # Platform monitor container (sensors, fans, PSU, etc.) | ||
|
|
||
| # Telemetry and monitoring | ||
| 'gnmi.service', # gNMI telemetry service |
There was a problem hiding this comment.
Can we include sysmgr.service, this is needed alone with gnmi for remote reboot backend implementation.
There was a problem hiding this comment.
Sure, @judyjoseph thank you for sharing your comments here . Shall we plan to address the systemd-related feedback in the next PR?
There was a problem hiding this comment.
Have added all the containers requested for. @judyjoseph please have a look.
| set -e | ||
|
|
||
| # Configuration | ||
| GADGET_NAME="g1" |
There was a problem hiding this comment.
At the moment, I’m not sure whether this script and the service that starts it on system boot can be fully vendor‑independent. It’s possible that initialization of the usb0 network interface varies by vendor, in which case this logic should be moved into the vendor‑specific folder.
There was a problem hiding this comment.
Can you add more details on what all will be vendor specific? I would prefer to have this in common services, till more details emerge
There was a problem hiding this comment.
I mean that at this moment I'm not sure whether the creation and initialization of the usb0 device will be the same for NVIDIA as it is for Nexhop. For now, let's keep it as is, but we may need to revisit this implementation in the future.
There was a problem hiding this comment.
Of course! Refactoring should be done when we have more vendors adding support for their platforms.
There was a problem hiding this comment.
Moved the USB creation to Nexthop platform module.
| $(SONIC_ONE_IMAGE)_ARCH = arm64 | ||
| $(SONIC_ONE_IMAGE)_MACHINE = aspeed | ||
| $(SONIC_ONE_IMAGE)_PLATFORM = aspeed | ||
| $(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie |
There was a problem hiding this comment.
Can you confirm whether the generated image is compatible with the sonic-installer that runs on platforms using U-Boot?
Reference: https://github.com/sonic-net/sonic-utilities/blob/master/sonic_installer/bootloader/uboot.py
There was a problem hiding this comment.
Yes, we use uboot in our hardware and the eval board. Port first burn to eMMC, we use sonic-installer install to install subsequent images.
platform/aspeed/one-image.mk
Outdated
| $(SONIC_ONE_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR) | ||
| $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(ASPEED_EVB_AST2700_PLATFORM_MODULE) | ||
| $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(ASPEED_NEXTHOP_B27_PLATFORM_MODULE) | ||
| # $(SONIC_ONE_IMAGE)_DOCKERS = $(DOCKER_DATABASE) $(DOCKER_GNMI) $(DOCKER_RESTAPI) $(DOCKER_OBMC_CONSOLE) $(DOCKER_PLATFORM_MONITOR) $(DOCKER_BMCWEB) |
There was a problem hiding this comment.
looks like this line is not needed
There was a problem hiding this comment.
We use it for our internal dev. Will be upstreamed when ready.
- Move TACACS+, hostcfgd, auditd, sysmgr to BMC_REQUIRED_SERVICES - Switch from ntp to chrony for time synchronization - Add BMC overrides for sysmgr and telemetry (remove swss/syncd deps) - Add telemetry, sysmgr, lldp docker images to BMC platform - Fix telemetry auto-start by adding [Install] section to service template - Remove unused BMC_PLATFORM variable from platform_env.conf Signed-off-by: Chandrasekaran Swaminathan <[email protected]>
| GADGET_NAME="g1" | ||
| FUNCTION_TYPE="ncm" # Options: ncm, ecm, eem, rndis | ||
| INTERFACE_NAME="usb0" | ||
| SUBNET_MASK="24" |
There was a problem hiding this comment.
SUBNET_MASK variable is not used
There was a problem hiding this comment.
Will fix. Thanks for pointing out.
|
|
||
| # Step 1: Load kernel modules | ||
| logger -t usb-network "Loading kernel modules..." | ||
| modprobe libcomposite 2>/dev/null || true |
There was a problem hiding this comment.
Is there any particular reason why the drivers are loaded from the script rather than by modprobe at system start?
There was a problem hiding this comment.
These modules pertain to USB gadget configuration for aspeed. So has to be aspeed specific. I will investigate if there is a way to do this in a platform specific way, without having to rely on the platform specific debian package.
There was a problem hiding this comment.
Moved the USB network initialization to the Nexthop vendor platform module
| modprobe libcomposite 2>/dev/null || true | ||
| modprobe usb_f_${FUNCTION_TYPE} 2>/dev/null || true | ||
| modprobe u_ether 2>/dev/null || true | ||
| modprobe aspeed_vhub 2>/dev/null || true |
There was a problem hiding this comment.
Please do not redirect errors during driver loading to /dev/null. If the driver is critical and required for the USB interface, any error that occurs during loading should be logged along with the return code; otherwise, debugging will be impossible.
If we can safely ignore a failure to load the driver, then is the driver needed at all?
- Update debian/rules to support multi-package build (common + card-specific) - Add build caching (.dep files) for NextHop and EVB platforms - Add postinst script for common package to handle module loading - Update setup.py to build shared wheel from common/sonic_platform - Remove duplicate b27/setup.py Signed-off-by: Chandrasekaran Swaminathan <[email protected]>
|
/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). |
|
@Blueve and @apoorv-arista Please have a look at commit 40f4febf70f3217b844712c7fcea81377fc49fe6 that just got pushed to this PR. |
consutil can work. Signed-off-by: Chandrasekaran Swaminathan <[email protected]>
40f4feb to
0d23517
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
yxieca
left a comment
There was a problem hiding this comment.
Per offline discussions. This PR doesn't pose blocking issues and is building a foundation for the BMC project to move forward.
There are open issues from this PR, we agreed to continue working on them with subsequent quick iterations.
| }, | ||
| "components": [ | ||
| { | ||
| "name": "BMC" |
There was a problem hiding this comment.
Please remove BMC as component. not sure why we need this . Same applies to other platform/sku
| "chassis": { | ||
| "AST2700-EVB-BMC": { | ||
| "component": { | ||
| "BMC": {}, |
There was a problem hiding this comment.
BMC as a component here too
Why I did it
We need to be able to run SONIC on BMC cards based on AST2720 (ARM64 SOC)
How I did it
this SOC
device/{aspeed, nexthop...} directories
multiple directory-based installs along with updating U-Boot environment
variables for proper boot management
etc to the image and install them at run time (first boot) using the existing
SONiC lazy install infra.
How to verify it
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)