Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
ae02708
Support for SONiC image compilation and deployment on Aspeed AST2720…
chander-nexthop Oct 22, 2025
df20a9f
Remove unwanted scripts
chander-nexthop Dec 22, 2025
1c96a1c
Merge branch 'master' into bmc-ast2720-arm64
chander-nexthop Dec 22, 2025
8875ce1
Merge branch 'master' into bmc-ast2720-arm64
chander-nexthop Dec 24, 2025
dd9f18c
Thanks Chinmoy Dey <[email protected]> for this change
chander-nexthop Jan 16, 2026
dff5051
Merge branch 'master' into bmc-ast2720-arm64
chander-nexthop Feb 12, 2026
153d0a6
1. Add changes for a single image with multiple DTB
chander-nexthop Feb 16, 2026
2070732
Address commenrs - remove unused vars
chander-nexthop Feb 16, 2026
3e8fee4
Move to the lazy install mechanism of sonic for the vendor packages
chander-nexthop Feb 18, 2026
1a98329
Add postinst scripts with dynamic platform detection by reading
chander-nexthop Feb 24, 2026
be5dad4
Remove unwanted DEPENDS
chander-nexthop Feb 24, 2026
a2b5ea4
Ensure the right python wheel is installed during lazy install of the
chander-nexthop Feb 25, 2026
ca44f22
Add a script to create a disk image from the target sonic image
chander-nexthop Feb 27, 2026
33b9dd5
Address most of the review comments.
chander-nexthop Feb 28, 2026
41bd2db
Remove the commented out BMC_IP
chander-nexthop Feb 28, 2026
12bec31
Use rm -rf instead of individual cleanup
chander-nexthop Feb 28, 2026
b467546
BMC: Enable telemetry, sysmgr, and required services
chander-nexthop Mar 3, 2026
44ac5e5
- Move platform API from b27/ to common/ for sharing across all cards
chander-nexthop Mar 4, 2026
0d23517
Add support to populate the vendor specific console to REDIS so that
chander-nexthop Mar 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 64 additions & 1 deletion build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -764,10 +764,73 @@ if [[ $TARGET_BOOTLOADER == uboot ]]; then
## Overwriting the initrd image with uInitrd
sudo LANG=C chroot $FILESYSTEM_ROOT mv /boot/u${INITRD_FILE} /boot/$INITRD_FILE
else
sudo cp -v $PLATFORM_DIR/$CONFIGURED_PLATFORM/sonic_fit.its $FILESYSTEM_ROOT/boot/
# Check if sonic_fit.its uses placeholders (template-based)
if grep -q "__KERNEL_VERSION__\|__KERNEL_PATH__" $PLATFORM_DIR/$CONFIGURED_PLATFORM/sonic_fit.its 2>/dev/null; then
# Generate sonic_fit.its with actual kernel version
# Detect the actual installed kernel version from the filesystem
# The kernel package may have a different version suffix than LINUX_KERNEL_VERSION
KERNEL_FILE=$(ls $FILESYSTEM_ROOT/boot/vmlinuz-* 2>/dev/null | head -1)
if [ -z "$KERNEL_FILE" ]; then
echo "Error: No kernel found in $FILESYSTEM_ROOT/boot/"
exit 1
fi
KERNEL_VERSION_FULL=$(basename "$KERNEL_FILE" | sed 's/^vmlinuz-//')

# Replace placeholders with actual paths
KERNEL_PATH="/boot/vmlinuz-${KERNEL_VERSION_FULL}"
INITRD_PATH="/boot/initrd.img-${KERNEL_VERSION_FULL}"

# For aspeed platform, construct DTB directory path
# The FIT image template contains multiple DTBs, we only substitute the directory path
if [[ $CONFIGURED_PLATFORM == aspeed ]]; then
DTB_DIR_PATH="/usr/lib/linux-image-${KERNEL_VERSION_FULL}/aspeed"
else
DTB_DIR_PATH="/usr/lib/linux-image-${KERNEL_VERSION_FULL}/${CONFIGURED_PLATFORM}"
fi

# Substitute placeholders in sonic_fit.its template
sed -e "s|__KERNEL_PATH__|${KERNEL_PATH}|g" \
-e "s|__INITRD_PATH__|${INITRD_PATH}|g" \
-e "s|__DTB_PATH_ASPEED__|${DTB_DIR_PATH}|g" \
$PLATFORM_DIR/$CONFIGURED_PLATFORM/sonic_fit.its > /tmp/sonic_fit.its.tmp

sudo cp -v /tmp/sonic_fit.its.tmp $FILESYSTEM_ROOT/boot/sonic_fit.its
rm -f /tmp/sonic_fit.its.tmp
else
# Platform uses hardcoded paths - copy as-is
sudo cp -v $PLATFORM_DIR/$CONFIGURED_PLATFORM/sonic_fit.its $FILESYSTEM_ROOT/boot/
fi

sudo LANG=C chroot $FILESYSTEM_ROOT mkimage -f /boot/sonic_fit.its /boot/sonic_${CONFIGURED_ARCH}.fit
fi
fi

# Install platform-level scripts and services for aspeed platform
if [[ $CONFIGURED_PLATFORM == aspeed ]]; then
echo "Installing platform scripts and services for aspeed..."

# Copy all scripts from platform/aspeed/scripts/
if [ -d "$PLATFORM_DIR/$CONFIGURED_PLATFORM/scripts" ]; then
for script in $PLATFORM_DIR/$CONFIGURED_PLATFORM/scripts/*.sh; do
if [ -f "$script" ]; then
echo "Installing $(basename $script)..."
sudo cp -v "$script" $FILESYSTEM_ROOT/usr/bin/
sudo chmod +x $FILESYSTEM_ROOT/usr/bin/$(basename $script)
fi
done
fi

# Copy all systemd services from platform/aspeed/systemd/
if [ -d "$PLATFORM_DIR/$CONFIGURED_PLATFORM/systemd" ]; then
for service in $PLATFORM_DIR/$CONFIGURED_PLATFORM/systemd/*.service; do
if [ -f "$service" ]; then
echo "Installing and enabling $(basename $service)..."
sudo cp -v "$service" $FILESYSTEM_ROOT/etc/systemd/system/
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable $(basename $service)
fi
done
fi
fi
fi

# Collect host image version files before cleanup
Expand Down
4 changes: 4 additions & 0 deletions device/aspeed/arm64-aspeed_ast2700_evb-r0/99-switchCpu.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Aspeed AST2700 EVB: Dummy placeholder for switch CPU console
# The EVB does not have a physical switch CPU console connection
# This file exists to prevent errors in sonic-platform-init.sh

2 changes: 2 additions & 0 deletions device/aspeed/arm64-aspeed_ast2700_evb-r0/asic.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# aspeed-ast2700 doesn't have a switch asic but SONIC assumes NUM_ASIC to be atleast 1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the error there even if this file "asic.conf" is not present ? or
Can we fix the place where it imposes the NUM_ASIC = 1 check ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NUM_ASIC being not zero seems to be a fundamental SONIC assumption. Even virtual switch implementations (device/virtual) define it to be 1. So went with this.

NUM_ASIC=1
1 change: 1 addition & 0 deletions device/aspeed/arm64-aspeed_ast2700_evb-r0/default_sku
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AST2700-EVB-BMC empty
13 changes: 13 additions & 0 deletions device/aspeed/arm64-aspeed_ast2700_evb-r0/installer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Console configuration for AST2700 EVB platform
# CONSOLE_DEV=12 means ttyS12
CONSOLE_DEV=12
CONSOLE_SPEED=115200

# Early console for debugging (UART12 on AST2700)
EARLYCON="earlycon=uart8250,mmio32,0x14c33b00"

# Variable log size(MB)
VAR_LOG_SIZE=512

# Additional kernel command line arguments
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX=""
23 changes: 23 additions & 0 deletions device/aspeed/arm64-aspeed_ast2700_evb-r0/platform.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"chassis": {
"name": "AST2700-EVB-BMC",
"thermal_manager": false,
"status_led": {
"controllable": true,
"colors": ["green", "amber", "off"]
},
"components": [
{
"name": "BMC"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove BMC as component. not sure why we need this . Same applies to other platform/sku

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done via #26002

},
{
"name": "BIOS"
}
],
"fans": [],
"psus": [],
"thermals": [],
"sfps": []
},
"interfaces": {}
}
1 change: 1 addition & 0 deletions device/aspeed/arm64-aspeed_ast2700_evb-r0/platform_asic
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
aspeed
10 changes: 10 additions & 0 deletions device/aspeed/arm64-aspeed_ast2700_evb-r0/platform_components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"chassis": {
"AST2700-EVB-BMC": {
"component": {
"BMC": {},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BMC as a component here too

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done via #26002

"BIOS": {}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# BMC platform environment
17 changes: 17 additions & 0 deletions device/aspeed/arm64-aspeed_ast2700_evb-r0/pmon_daemon_control.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"skip_thermalctld": false,
"skip_ledd": true,
"skip_xcvrd": true,
"skip_psud": true,
"skip_syseepromd": true,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could have syseepromd NOT skipped in BMC to get EEPROM data and store in DB ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is placeholder code and needs a revisit when the hardware is fully ready

"skip_pcied": true,
"skip_chassisd": true,
"skip_fancontrol": true,
"include_sensormond": false,
"thermalctld": {
"thermal_monitor_initial_interval": 5,
"thermal_monitor_update_interval": 60,
"thermal_monitor_update_elapsed_threshold": 30
}
}

12 changes: 12 additions & 0 deletions device/aspeed/arm64-aspeed_ast2700_evb-r0/switch_cpu_console.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Console configuration for Aspeed AST2700 EVB
# This file defines console port settings for the switch CPU console

# Baud rate for the switch CPU console (default: 115200)
CONSOLE_BAUD_RATE=115200

# Flow control: 0=disabled, 1=enabled (default: 0)
CONSOLE_FLOW_CONTROL=0

# Remote device name shown in consutil
CONSOLE_REMOTE_DEVICE=EVB

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"services_to_ignore": [],
"devices_to_ignore": ["psu", "fan", "asic"],
"user_defined_checkers": [],
"polling_interval": 300,
"led_color": {
"fault": "amber",
"normal": "green",
"booting": "amber_blink"
}
}

2 changes: 2 additions & 0 deletions device/aspeed/arm64-aspeed_ast2700_evb-r0/udevprefix.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ttySwitchCpu

3 changes: 3 additions & 0 deletions device/nexthop/arm64-nexthop_b27-r0/99-switchCpu.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Nexthop B27 BMC: Map host CPU console /dev/ttyS1 to common alias /dev/ttySwitchCpu0
SUBSYSTEM=="tty", KERNEL=="ttyS1", SYMLINK+="ttySwitchCpu0", MODE="0666"

2 changes: 2 additions & 0 deletions device/nexthop/arm64-nexthop_b27-r0/asic.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# BMC's don't have a switch asic but SONIC assumes NUM_ASIC to be atleast 1
NUM_ASIC=1
1 change: 1 addition & 0 deletions device/nexthop/arm64-nexthop_b27-r0/default_sku
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NH-B27 empty
13 changes: 13 additions & 0 deletions device/nexthop/arm64-nexthop_b27-r0/installer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Console configuration for AST2720 platform
# CONSOLE_DEV=12 means ttyS12
CONSOLE_DEV=12
CONSOLE_SPEED=115200

# Early console for debugging (UART12 on AST2720)
EARLYCON="earlycon=uart8250,mmio32,0x14c33b00"

# Variable log size (MB)
VAR_LOG_SIZE=512

# Additional kernel command line arguments
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX=""
23 changes: 23 additions & 0 deletions device/nexthop/arm64-nexthop_b27-r0/platform.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"chassis": {
"name": "NH-B27-BMC",
"thermal_manager": false,
"status_led": {
"controllable": true,
"colors": ["green", "amber", "off"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the real physical device with Switch-Host + BMC, is this led visible outside to user/admin ? can we bind the led color to the BMC status?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is placeholder code and needs to be revisited when the actual hardware platform becomes ready

},
"components": [
{
"name": "BMC"
},
{
"name": "BIOS"
}
],
"fans": [],
"psus": [],
"thermals": [],
"sfps": []
},
"interfaces": {}
}
1 change: 1 addition & 0 deletions device/nexthop/arm64-nexthop_b27-r0/platform_asic
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
aspeed
10 changes: 10 additions & 0 deletions device/nexthop/arm64-nexthop_b27-r0/platform_components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"chassis": {
"NH-B27-BMC": {
"component": {
"BMC": {},
"BIOS": {}
}
}
}
}
1 change: 1 addition & 0 deletions device/nexthop/arm64-nexthop_b27-r0/platform_env.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# BMC platform environment
17 changes: 17 additions & 0 deletions device/nexthop/arm64-nexthop_b27-r0/pmon_daemon_control.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"skip_thermalctld": false,
"skip_ledd": true,
"skip_xcvrd": true,
"skip_psud": true,
"skip_syseepromd": true,
"skip_pcied": true,
"skip_chassisd": true,
"skip_fancontrol": true,
"include_sensormond": false,
"thermalctld": {
"thermal_monitor_initial_interval": 5,
"thermal_monitor_update_interval": 60,
"thermal_monitor_update_elapsed_threshold": 30
}
}

12 changes: 12 additions & 0 deletions device/nexthop/arm64-nexthop_b27-r0/switch_cpu_console.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Console configuration for Nexthop B27 BMC
# This file defines console port settings for the switch CPU console

# Baud rate for the switch CPU console (default: 115200)
CONSOLE_BAUD_RATE=9600

# Flow control: 0=disabled, 1=enabled (default: 0)
CONSOLE_FLOW_CONTROL=0

# Remote device name shown in consutil
CONSOLE_REMOTE_DEVICE=SwitchCpu

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"services_to_ignore": [],
"devices_to_ignore": ["psu", "fan", "asic"],
"user_defined_checkers": [],
"polling_interval": 300,
"led_color": {
"fault": "amber",
"normal": "green",
"booting": "amber_blink"
}
}

2 changes: 2 additions & 0 deletions device/nexthop/arm64-nexthop_b27-r0/udevprefix.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ttySwitchCpu

4 changes: 3 additions & 1 deletion dockers/docker-database/database_config.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"persistence_for_warm_boot" : "yes"
}
{% endif %}
{% if DATABASE_TYPE is defined and DATABASE_TYPE == "dpudb" %}
{% if DATABASE_TYPE is defined and (DATABASE_TYPE == "dpudb" or DATABASE_TYPE == "bmcdb") %}
{% else %}
,
"redis_bmp":{
Expand Down Expand Up @@ -139,6 +139,8 @@
"separator": ":",
"instance" : {% if include_remote_db %} "remote_redis" {% else %} "redis" {% endif %}
}
{% elif DATABASE_TYPE is defined and DATABASE_TYPE == "bmcdb" %}
{# No BMP_STATE_DB for BMC devices #}
{% else %}
,
"BMP_STATE_DB" : {
Expand Down
9 changes: 8 additions & 1 deletion dockers/docker-database/docker-database-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ then
fi
fi

if [[ $IS_BMC_DEVICE == "true" ]]
then
export DATABASE_TYPE="bmcdb"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really don't have a use case to have a separate bmcdb ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DATABASE_TYPE bmcdb was added only to avoid BMP_STATE_DB (BGP monitoring protocol database) which doesn't make sense in our platform. Otherwise it behaves in an identical manner to DATABASE_TYPE being empty/not specified. So all the standard databases of SONIC (CONFIG_DB, APPL_DB, STATE_DB etc) would be present. If we don't have this new type, then the condition to avoid BMP_STATE_DB will have to be coded differently. I went with this approach because it was already used by one platform (dpudb).

fi

export BMP_DB_PORT=6400

REDIS_DIR=/var/run/redis$NAMESPACE_ID
Expand Down Expand Up @@ -143,6 +148,8 @@ done

chown -R redis:redis $REDIS_DIR
REDIS_BMP_DIR="/var/lib/redis_bmp"
chown -R redis:redis $REDIS_BMP_DIR
if [[ -d $REDIS_BMP_DIR ]]; then
chown -R redis:redis $REDIS_BMP_DIR
fi

exec /usr/local/bin/supervisord
14 changes: 11 additions & 3 deletions dockers/docker-database/multi_database_config.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,17 @@
"unix_socket_path": "",
"persistence_for_warm_boot" : "yes"
}
{% endif %},
{% endif %}
{% if DATABASE_TYPE is defined and (DATABASE_TYPE == "dpudb" or DATABASE_TYPE == "bmcdb") %}
{% else %}
,
"redis_bmp":{
"hostname" : "{{HOST_IP}}",
"port" : {{BMP_DB_PORT}},
"unix_socket_path" : "/var/run/redis{{DEV}}/redis_bmp.sock",
"persistence_for_warm_boot" : "yes"
}
{% endif %}
},
"DATABASES" : {
"APPL_DB": {
Expand Down Expand Up @@ -181,12 +185,16 @@
"separator": ":",
"instance" : {% if include_remote_db %} "remote_redis" {% else %} "redis" {% endif %}
}
{% endif %},
"BMP_STATE_DB" : {
{% elif DATABASE_TYPE is defined and DATABASE_TYPE == "bmcdb" %}
{# No BMP_STATE_DB for BMC devices #}
{% else %}
,
"BMP_STATE_DB" : {
"id" : 20,
"separator": "|",
"instance" : "redis_bmp"
}
{% endif %}
},
"VERSION" : "1.0"
}
Loading
Loading