Compiling the Firmware
Compilation Procedure
- Go to the directory where the top-level CMakeLists.txt script of the user code is located.
cd ovs_project
- Create a build directory and run the cmake command (the ovs_project code is used as an example).
umask 077 mkdir build cd build cmake ..
The build files are successfully generated if the following information is displayed:
-- Configuring done -- Generating done -- Build files have been written to: {Custom installation path}/flexda_sdk/example/fullnat/build
- If this is not the first time to compile the firmware, delete the build directory before performing step 2.
- The umask 077 command ensures that the permissions on the directories and files generated by cmake/make are not too high.
- You are not advised to store the build directory in a system directory (such as /, /usr, or /boot).
- Run the make command to compile the firmware.
make
The compilation is successful if the following information is displayed:
[100%] Built target flash_bin
All logs generated during the compilation are saved in build/flexdacc_log.txt.
- Go to the product path and obtain the firmware and the corresponding configinfo file.
cd ovs_project/bin/flash/hinic_flash_{Board type}
- Hinic3_flash.bin: Generated firmware.
- configinfo: Flow table configuration file, which is used by the programming framework to detect user-defined flow table configuration and perform basic verification on user data on the control plane. You need to copy the file to the etc directory in the DPU environment when updating the firmware. Ensure that the configuration file is complete and the permission on the file is 400.
Special Scenarios
ovs_example.zip is used as an example (prepared by the user). Decompress the example code, save the example directory to {Custom programming framework installation path}/flexda_sdk, and then perform the firmware compilation procedure. The following uses FullNAT as an example:
cd {Custom programming framework installation path}/flexda_sdk/example/fullnat
umask 077
mkdir build
cd build
cmake ..
make
Parent topic: OVS Programming