SONiC Redfish implementation providing bmcweb and sonic-dbus-bridge as Debian packages.
- Overview
- Quick Start
- Build System
- Patch Management
- Cleanup Targets
- Dependency Management
- Configuration
- Components
- Redfish API Endpoints
- Troubleshooting
- License
This repository contains:
- bmcweb: OpenBMC web server source code with SONiC-specific patches
- sonic-dbus-bridge: Bridge between SONiC Redis and D-Bus for bmcweb integration
Both components are built as Debian packages (.deb) for easy integration with SONiC.
- Docker installed on your system
- Git
- sudo access (for cleaning root-owned build artifacts)
# Build all components (Docker-based, produces .deb packages)
make
# Or explicitly
make allBuild artifacts will be available in target/debs/trixie/:
bmcweb_1.0.0_arm64.debbmcweb-dbg_1.0.0_arm64.debsonic-dbus-bridge_1.0.0_arm64.debsonic-dbus-bridge-dbgsym_1.0.0_arm64.deb
# Show all available targets
make help
# Build individual components (automatically runs clean + dependencies)
make build-bmcweb # Runs: clean → setup-bmcweb → apply-patches → build
make build-bridge # Runs: clean → build
# Clean build artifacts (removes build dirs, resets bmcweb source)
make clean
# Complete reset (clean + remove Docker images + full git reset)
make reset# Use custom number of parallel jobs (default: nproc)
make SONIC_CONFIG_MAKE_JOBS=8
# Use custom output directory (default: target/debs/trixie)
make SONIC_REDFISH_TARGET=output/debs
# Build with specific bmcweb commit (default: 6926d430)
make BMCWEB_HEAD_COMMIT=abc123
# Build with custom bmcweb repository URL
make BMCWEB_REPO_URL=https://github.com/custom/bmcweb.gitThe build system is designed for Debian Trixie and uses:
- Docker-based builds: All compilation happens inside a
debian:trixiecontainer for consistency - Debian packaging: Uses
dpkg-buildpackageto create.debpackages - Meson subprojects: Dependencies (sdbusplus, stdexec) are managed via
.wrapfiles - Automatic dependencies: Build targets automatically trigger required cleanup and setup steps
- Patch management: Uses a
patches/seriesfile to define patch order
make all
1. Build Docker image (sonic-redfish-builder:latest)
- Base: debian:trixie
- Installs: build-essential, meson, debhelper, C++23 toolchain, sdbusplus
2. Setup bmcweb source
- Auto-clone from GitHub if not present
- Checkout to specified commit (default: 6926d430)
3. Apply patches
- Apply patches from patches/series to bmcweb source
4. Build sonic-dbus-bridge
- Meson downloads dependencies (sdbusplus, stdexec) via .wrap files
- dpkg-buildpackage creates .deb packages
5. Build bmcweb
- Meson downloads dependencies via .wrap files
- dpkg-buildpackage creates .deb packages
6. Collect artifacts to target/debs/trixie/
- bmcweb_1.0.0_arm64.deb
- bmcweb-dbg_1.0.0_arm64.deb
- sonic-dbus-bridge_1.0.0_arm64.deb
- sonic-dbus-bridge-dbgsym_1.0.0_arm64.deb
- Plus .changes, .buildinfo, .dsc files
The build system automatically handles dependencies:
build-bmcweb: Automatically runsclean→setup-bmcweb→apply-patches→ buildbuild-bridge: Automatically runsclean→ build
This ensures a clean, reproducible build every time.
Patches are located in patches/ directory:
patches/series- Defines patch order (lines starting with#are comments)patches/*.patch- Individual patch files
Current patches:
0001-Integrating-bmcweb-with-SONiC-s-build-system.patch- Adds Debian packaging
To add a new patch:
- Make changes in bmcweb source directory
- Generate patch:
cd bmcweb && git format-patch -1 HEAD - Move patch to
patches/directory - Add patch filename to
patches/series
- Removes:
obj-*,debian/,.debfiles, subproject builds - Resets: bmcweb source to clean git state (so patches can be reapplied)
- Keeps: Docker images, target directory
- Use when: You want to rebuild from scratch
- Does everything
cleandoes, plus: - Removes: Docker images, target directory
- Resets: bmcweb to base commit with
git clean -fdx - Use when: You want to start completely fresh
Dependencies are managed via Meson wrap files (.wrap):
bmcweb/subprojects/sdbusplus.wrap- D-Bus C++ bindingsbmcweb/subprojects/stdexec.wrap- C++23 executors- Plus other dependencies defined in bmcweb upstream
sonic-dbus-bridge/subprojects/sdbusplus.wrap- D-Bus C++ bindingssonic-dbus-bridge/subprojects/stdexec.wrap- C++23 executors
Meson automatically downloads and builds these dependencies during the build process.
The Debian packages can be installed in SONiC images.
- Source: https://github.com/openbmc/bmcweb
- Base commit: 6926d430 (configurable via
BMCWEB_HEAD_COMMIT) - License: Apache-2.0
- Purpose: Redfish API server providing standard Redfish REST API
- Build system: Meson + Debian packaging
- Output:
bmcweb_1.0.0_arm64.deb,bmcweb-dbg_1.0.0_arm64.deb - Auto-clone: Automatically cloned from GitHub if not present
- License: Apache-2.0
- Purpose: Bridge SONiC Redis database to D-Bus for bmcweb integration
- Features:
- Redis to D-Bus data synchronization
- Platform inventory management
- FRU EEPROM data export
- User management integration
- State management (host, chassis)
- Build system: Meson + Debian packaging
- Output:
sonic-dbus-bridge_1.0.0_arm64.deb,sonic-dbus-bridge-dbgsym_1.0.0_arm64.deb - Configuration:
config/config.yamlfor Redis, D-Bus, and platform settings
The bridge is configured via sonic-dbus-bridge/config/config.yaml:
- Redis settings: Connection parameters for CONFIG_DB and STATE_DB
- Platform data: Path to platform.json and FRU EEPROM locations
- D-Bus settings: Service name and bus configuration
- Update behavior: Polling intervals and pub/sub settings
- Logging: Log levels and output configuration
D-Bus security policies are defined in sonic-dbus-bridge/dbus/:
xyz.openbmc_project.Inventory.Manager.conf- Inventory managementxyz.openbmc_project.ObjectMapper.conf- Object mapper servicexyz.openbmc_project.State.Host.conf- Host state managementxyz.openbmc_project.User.Manager.conf- User managementxyz.openbmc_project.bmcweb.conf- bmcweb service
These files are installed to /etc/dbus-1/system.d/ during package installation.
Below are the currently supported Redfish API endpoints and their sample responses.
GET /redfish/v1/UpdateService/FirmwareInventory
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory",
"@odata.type": "#SoftwareInventoryCollection.SoftwareInventoryCollection",
"Members": [
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/bios"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/bmc"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/switch"
}
],
"[email protected]": 3,
"Name": "Software Inventory Collection"
}GET /redfish/v1/UpdateService/FirmwareInventory/bios
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/bios",
"@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory",
"Description": "Other image",
"Id": "bios",
"Name": "Software Inventory",
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
},
"Updateable": false,
"Version": "N/A"
}GET /redfish/v1/UpdateService/FirmwareInventory/bmc
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/bmc",
"@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory",
"Description": "BMC image",
"Id": "bmc",
"Name": "Software Inventory",
"RelatedItem": [
{
"@odata.id": "/redfish/v1/Managers/bmc"
}
],
"[email protected]": 1,
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
},
"Updateable": false,
"Version": "sonic-redfish-build.0-ddbc425a4"
}GET /redfish/v1/UpdateService/FirmwareInventory/switch
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/switch",
"@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory",
"Description": "Host image",
"Id": "switch",
"Name": "Software Inventory",
"RelatedItem": [
{
"@odata.id": "/redfish/v1/Systems/system/Bios"
}
],
"[email protected]": 1,
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
},
"Updateable": false,
"Version": "N/A"
}GET /redfish/v1/
{
"@odata.id": "/redfish/v1",
"@odata.type": "#ServiceRoot.v1_15_0.ServiceRoot",
"AccountService": {
"@odata.id": "/redfish/v1/AccountService"
},
"Cables": {
"@odata.id": "/redfish/v1/Cables"
},
"CertificateService": {
"@odata.id": "/redfish/v1/CertificateService"
},
"Chassis": {
"@odata.id": "/redfish/v1/Chassis"
},
"EventService": {
"@odata.id": "/redfish/v1/EventService"
},
"Id": "RootService",
"JsonSchemas": {
"@odata.id": "/redfish/v1/JsonSchemas"
},
"Links": {
"ManagerProvidingService": {
"@odata.id": "/redfish/v1/Managers/bmc"
},
"Sessions": {
"@odata.id": "/redfish/v1/SessionService/Sessions"
}
},
"Managers": {
"@odata.id": "/redfish/v1/Managers"
},
"Name": "Root Service",
"Product": "SONiCBMC",
"ProtocolFeaturesSupported": {
"DeepOperations": {
"DeepPATCH": false,
"DeepPOST": false
},
"ExcerptQuery": false,
"ExpandQuery": {
"ExpandAll": false,
"Levels": false,
"Links": false,
"NoLinks": false
},
"FilterQuery": false,
"OnlyMemberQuery": true,
"SelectQuery": true
},
"RedfishVersion": "1.17.0",
"Registries": {
"@odata.id": "/redfish/v1/Registries"
},
"SessionService": {
"@odata.id": "/redfish/v1/SessionService"
},
"Systems": {
"@odata.id": "/redfish/v1/Systems"
},
"Tasks": {
"@odata.id": "/redfish/v1/TaskService"
},
"TelemetryService": {
"@odata.id": "/redfish/v1/TelemetryService"
},
"UUID": "00000000-0000-0000-0000-000000000000",
"UpdateService": {
"@odata.id": "/redfish/v1/UpdateService"
}
}POST /redfish/v1/Systems/system/Actions/ComputerSystem.Reset
Content-Type: application/json
{"ResetType": "On"}
This action writes a host transition request to Redis STATE_DB:
root@sonic:/home/admin# redis-cli -n 6 HGETALL BMC_HOST_REQUEST
1) "request_id"
2) "req_1775040896_000001"
3) "requested_transition"
4) "reset-out"
5) "status"
6) "pending"
7) "timestamp"
8) "1775040896157648224"
POST /redfish/v1/Systems/system/Actions/ComputerSystem.Reset
Content-Type: application/json
{"ResetType": "GracefulShutdown"}
Redis STATE_DB after the request:
root@sonic:/home/admin# redis-cli -n 6 HGETALL BMC_HOST_REQUEST
1) "request_id"
2) "req_1775041067_000002"
3) "requested_transition"
4) "reset-in"
5) "status"
6) "pending"
7) "timestamp"
8) "1775041067766120204"
POST /redfish/v1/Systems/system/Actions/ComputerSystem.Reset
Content-Type: application/json
{"ResetType": "PowerCycle"}
Redis STATE_DB after the request:
root@sonic:/home/admin# redis-cli -n 6 HGETALL BMC_HOST_REQUEST
1) "request_id"
2) "req_1775041121_000003"
3) "requested_transition"
4) "reset-cycle"
5) "status"
6) "pending"
7) "timestamp"
8) "1775041121924146637"
Run make reset to completely clean the workspace, then rebuild.
The build creates root-owned files inside Docker. The Makefile uses sudo rm to clean them.
Make sure you have sudo access.
Check your internet connection - the build downloads packages from Debian repositories.
Check internet connection and firewall settings. Meson needs to access GitHub to download dependencies.
Apache-2.0
