FBOSS BSP Mapping Config Generation
Prerequisites
Python 3 is required in order to run the helper script. You can install it via one of the below commands depending on which Linux distribution you're on.
Debian
sudo apt update
sudo apt -y upgrade
sudo apt install python3
CentOS
sudo dnf upgrade -y
sudo dnf install python3
Instructions
The BSP Mapping configuration can be generated by running the helper shell script: run-helper.sh by using the command below. The helper script needs to be run from the root of the FBOSS repository.
$ ./fboss/lib/bsp/bspmapping/run-helper.sh
You may need to give the file executable permissions first.
$ chmod +x ./fboss/lib/bsp/bspmapping/run-helper.sh
This will write the configs for each platform to a directory called generated_configs in the system temporary directory (for Linux, this will be /tmp/generated_configs). You will need to copy and paste the generated JSON configuration from those files to the C++ files located in fboss/lib/bsp/. The subdirectory names for each platform should match the JSON files, but for convenience we have mapped out the files below:
| JSON File Name | C++ File Location |
|---|---|
| generated_configs/janga800bic.json | fboss/lib/bsp/janga800bic/Janga800bicBspPlatformMapping.cpp |
| generated_configs/meru400bfu.json | fboss/lib/bsp/meru400bfu/Meru400bfuBspPlatformMapping.cpp |
| generated_configs/meru400biu.json | fboss/lib/bsp/meru400biu/Meru400biuBspPlatformMapping.cpp |
| generated_configs/meru800bfa.json | fboss/lib/bsp/meru800bfa/Meru800bfaBspPlatformMapping.cpp |
| generated_configs/meru800bia.json | fboss/lib/bsp/meru800bia/Meru800biaBspPlatformMapping.cpp |
| generated_configs/montblanc.json | fboss/lib/bsp/montblanc/MontblancBspPlatformMapping.cpp |
| generated_configs/morgan800cc.json | fboss/lib/bsp/morgan800cc/Morgan800ccBspPlatformMapping.cpp |
| generated_configs/tahan800bc.json | fboss/lib/bsp/tahan800bc/Tahan800bcBspPlatformMapping.cpp |
Instructions (Meta-Internal)
Running this script internally can be done via buck:
buck run fboss/lib/bsp/bspmapping:fboss-bspmapping-gen