Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
64 changes: 63 additions & 1 deletion build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -756,10 +756,72 @@ 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}"

# Read DTB name from platform config if available
platform_conf_file="$PLATFORM_DIR/$CONFIGURED_PLATFORM/platform_${CONFIGURED_ARCH}.conf"
if [ ! -f "$platform_conf_file" ]; then
platform_conf_file="$PLATFORM_DIR/$CONFIGURED_PLATFORM/platform.conf"
fi

# Extract dtb_name from platform config (e.g., dtb_name="ast2700-evb.dtb")
# Strip quotes and comments
DTB_NAME=$(grep "^dtb_name=" "$platform_conf_file" 2>/dev/null | cut -d'=' -f2 | sed 's/#.*//' | tr -d '"' | tr -d "'" | tr -d ' ')

if [ -z "$DTB_NAME" ]; then
echo "Warning: dtb_name not found in $platform_conf_file, using default"
DTB_NAME="default.dtb"
fi

# Construct DTB path based on platform
if [[ $CONFIGURED_PLATFORM == aspeed ]]; then
DTB_PATH="/usr/lib/linux-image-${KERNEL_VERSION_FULL}/aspeed/${DTB_NAME}"
else
# Generic fallback - use platform name
DTB_PATH="/usr/lib/linux-image-${KERNEL_VERSION_FULL}/${CONFIGURED_PLATFORM}/${DTB_NAME}"
fi

# Substitute placeholders in sonic_fit.its template
sed -e "s|__KERNEL_VERSION__|${KERNEL_VERSION_FULL}|g" \
-e "s|__KERNEL_PATH__|${KERNEL_PATH}|g" \
-e "s|__INITRD_PATH__|${INITRD_PATH}|g" \
-e "s|__DTB_PATH__|${DTB_PATH}|g" \
-e "s|__DTB_NAME__|${DTB_NAME}|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 U-Boot environment initialization script and service for aspeed platform
if [[ $CONFIGURED_PLATFORM == aspeed ]]; then
echo "Installing U-Boot environment initialization service for aspeed platform..."
sudo cp -v $PLATFORM_DIR/$CONFIGURED_PLATFORM/sonic-uboot-env-init.sh $FILESYSTEM_ROOT/usr/bin/
sudo chmod +x $FILESYSTEM_ROOT/usr/bin/sonic-uboot-env-init.sh
sudo cp -v $PLATFORM_DIR/$CONFIGURED_PLATFORM/sonic-uboot-env-init.service $FILESYSTEM_ROOT/etc/systemd/system/
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable sonic-uboot-env-init.service
fi
fi

# Collect host image version files before cleanup
Expand Down
2 changes: 2 additions & 0 deletions device/aspeed/arm64-aspeed_ast2700-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
NUM_ASIC=1
1 change: 1 addition & 0 deletions device/aspeed/arm64-aspeed_ast2700-r0/default_sku
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AST2700-BMC
4 changes: 4 additions & 0 deletions device/aspeed/arm64-aspeed_ast2700-r0/installer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# AST2700 uses U-Boot, not GRUB, so CONSOLE_PORT/CONSOLE_DEV are not used
# Console configuration is handled in platform_arm64.conf via kernel cmdline
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX=""
CONSOLE_SPEED=115200
23 changes: 23 additions & 0 deletions device/aspeed/arm64-aspeed_ast2700-r0/platform.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"chassis": {
"name": "AST2700-BMC",
"thermal_manager": false,
"status_led": {
"controllable": true,
"colors": ["green", "amber", "off"]
},
"components": [
{
"name": "BMC"
},
{
"name": "BIOS"
}
],
"fans": [],
"psus": [],
"thermals": [],
"sfps": []
},
"interfaces": {}
}
1 change: 1 addition & 0 deletions device/aspeed/arm64-aspeed_ast2700-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-r0/platform_components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"chassis": {
"AST2700-BMC": {
"component": {
"BMC": {},
"BIOS": {}
}
}
}
}
2 changes: 2 additions & 0 deletions device/aspeed/arm64-aspeed_ast2700-r0/platform_env.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# BMC platform environment
export BMC_PLATFORM=1
17 changes: 17 additions & 0 deletions device/aspeed/arm64-aspeed_ast2700-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": false,
"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
}
}

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