Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ stages:
pool: sonicso1ES-arm64
variables:
PLATFORM_ARCH: arm64
- name: aspeed
pool: sonicso1ES-arm64
variables:
PLATFORM_ARCH: arm64

- stage: Test
dependsOn: BuildVS
Expand Down
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
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
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"
},
{
"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": {},
"BIOS": {}
}
}
}
}
2 changes: 2 additions & 0 deletions device/aspeed/arm64-aspeed_ast2700_evb-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_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,
"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
}
}

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/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"]
},
"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": {}
}
}
}
}
2 changes: 2 additions & 0 deletions device/nexthop/arm64-nexthop_b27-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/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
}
}

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"
}
}

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"
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