Skip to content
Walter Doekes edited this page Nov 19, 2024 · 5 revisions

Welcome to the OSSO sonic-buildimage wiki!

Introduction

This is not for anyone other than OSSO internally.

Building the image

git checkout --recursive BRANCH
# check rules/config
make init
make configure PLATFORM=broadcom  # takes a long time and uses quite some mem/disk
make target/sonic-broadcom.bin

BEWARE: You need plenty of disk and memory. And Docker with overlayfs (not ZFS) for a couple of build tricks.

This produces a 1.5GB target/sonic-broadcom.bin.

Building the image with debug symbols

See building the image. We also want INSTALL_DEBUG_TOOLS = y which installs gdb inside the dockers, and installs one or more dbg/dbgsym package that is relevant to the docker image.

Do not set SONIC_DEBUGGING_ON = y, because the resulting nostrip causes dbgsym packages to not get built: bug #19

This produces a 3.5GB target/sonic-broadcom.bin.

Note that the target/ dir might not be refreshed. Clean it before a new build to get proper changed compile options. Additionally we would like to take all the *.deb in there and put it in a snapshot in an apt-repository, so that the dbgsym files are available. And so we can Pin the versions to the SONiC-built packages.

Using the image

DHCPD config

# ###  DHCPv4               CUMULUS             SONIC                 
#  60  "Vendor class id"    vendor-class-id     -
#  --                       ("cumulus-linux x86_64")
#  61  "Client identifier"  -                   dhcp-client-identifier
#  66  "TFTP server name"   -                   tftp-server
#  67  "Bootfile name"      -                   ztp_json_url
#  77  "User Class"         -                   user-class "SONiC-ZTP"
#  --                                           ("SONiC-ZTP")
# 114  default-url          install-url         -
# 224  -                    -                   snmp_community
# 225  -                    -                   minigraph_url
# 226  -                    -                   acl_url
# 239  -                    cumulus-prov-url    ztp_provisioning_script_url
#
# See also:
# https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol#Options
# https://github.com/isc-projects/dhcp/blob/572032cb0e514606559de3784e3f7ca8e1539d17/common/tables.c#L217
host eth0.leaf1.dostno.systems {
  hardware ethernet f8:8e:xx:xx:xx:xx;
  fixed-address 10.xx.xx.xx;
  option host-name "leaf1.dostno.systems";
  option ztp_json_url "http://10.xx.xx.xx/sonic/sonic-broadcom-202405-osso.0-dirty-20241103.020641.json";
  #option ztp_provisioning_script_url "..."
}

ZTP config

{
  "ztp": {
    "firmware": {
      "install": {
        "url": "http://10.xx.xx.xx/sonic/sonic-broadcom-202405-osso.0-dirty-20241103.020641.bin",
        "set-default": true
      },
      "reboot-on-success": true
    }
  }
}

Setup (ZTP or not)

sonic-installer install http://10.xx.xx.xx/sonic/sonic-broadcom-202405-osso.0-dirty-20241103.020641.bin
sonic-installer list
sonic-installer set-default ...

Configuring/testing

Wipe/reset config

# broadcom spine
sonic-cfggen -H -k Accton-AS9716-32D --preset l3 > /etc/sonic/config_db.json 
config load
config save
# broadcom leaf
sonic-cfggen -H -k Accton-AS7326-56X --preset l3 > /etc/sonic/config_db.json 
config load
config save

The l3 preset is layer3 switch/router. There are other presets, like t1 and l2.

But, to really wipe the config (load only appends/overwrites) you do a config replace /etc/sonic/config_db.json. However, this can be hard if you're testing multiple images. See: https://github.com/ossobv/sonic-buildimage/issues/32 ("tips: Working around 'config replace' madness")

Versions

Spine:

root@spine2:0:~# printf '%s\n' 'bsv' 'show unit' 'ver' | xargs -d\\n -n1 bcmcmd -t 1 | grep '^[A-Z]'
BRCM SAI ver: [11.2.13.1], OCP SAI ver: [1.14.0], SDK ver: [sdk-6.5.30-SP4]
Unit 0 chip BCM56980_B0 (current)
Broadcom Command Monitor: Copyright (c) 1998-2024 Broadcom
Release: sdk-6.5.30-SP4 built 20241016 (Wed Oct 16 13:33:02 2024)
From root@7ec56acb7b44:/__w/1/s/output/x86-xgsall-deb/xgs-sdk-src/hsdk-all-6.5.30
Platform: X86
OS: Unix (Posix)

Leaf:

root@leaf1:0:~# printf '%s\n' 'bsv' 'show unit' 'ver' | xargs -d\\n -n1 bcmcmd -t 1 | grep '^[A-Z]'
BRCM SAI ver: [11.2.13.1], OCP SAI ver: [1.14.0], SDK ver: [sdk-6.5.30-SP4], CANCUN ver: [06.04.01]
Unit 0 chip BCM56873_A0 (current)
Broadcom Command Monitor: Copyright (c) 1998-2024 Broadcom
Release: sdk-6.5.30-SP4 built 20241016 (Wed Oct 16 13:33:02 2024)
From root@7ec56acb7b44:/__w/1/s/output/x86-xgsall-deb/xgs-sdk-src/hsdk-all-6.5.30
Platform: X86
OS: Unix (Posix)

Build version:

root@leaf1:0:~# show version

SONiC Software Version: SONiC.osso202405.0-c23a3f1a7
SONiC OS Version: 12
Distribution: Debian 12.8
Kernel: 6.1.0-22-2-amd64
Build commit: c23a3f1a7
Build date: Mon Nov 18 15:56:07 UTC 2024
Built by: [email protected]

Platform: x86_64-accton_as7326_56x-r0
HwSKU: Accton-AS7326-56X
ASIC: broadcom
ASIC Count: 1