Skip to content
Walter Doekes edited this page Nov 15, 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

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

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

Clone this wiki locally