Info |
---|
This page is under review |
Why flag ?
- If the code changes has to be enabled only on certain scenarios or only applicable for specific boards , then we have to define the flag .
Defining a new flag
- The flag has to be defined in ccsp_common.inc file
- There are two ways to define the flag
1. Having the flag enabled always
2. Enabling only for specific board or on specific condition
Having the flag enabled always
- Go to ccsp_common.inc file
- Add the flag under "CFLAGS_append +="
Syntax
CFLAGS_append += " <FLAG> " |
---|
Sample
![](/download/attachments/102073641/image2021-6-8_19-45-18.png?version=1&modificationDate=1623161666000&api=v2)
- By this method, the flag is always set to 1 (true)
- Now add the flag at required pieces of code
Enabling only for specific board or on specific condition
- Add the flag using DISTRO_FEATURE in ccsp_common.inc file as below
Syntax
CFLAGS_append += " ${@bb.utils.contains('DISTRO_FEATURES', '<keyword>', '<FLAG>', '', d)}" |
---|
- Now to enable the flag for the specific platform , invoke from platform specific machine conf file
Syntax
DISTRO_FEATURES_append = " ........ <keyword> " |
---|
Sample
In ccsp_common.inc
![](/download/attachments/102073641/image2021-6-8_19-54-35.png?version=1&modificationDate=1623162223000&api=v2)
In raspberrypi-rdk-broadband.conf
![](/download/attachments/102073641/image2021-6-8_19-55-19.png?version=1&modificationDate=1623162266000&api=v2)
...
- the package enable/disable for the specific platform can be controlled
![](/download/attachments/102073641/image2021-6-8_20-8-31.png?version=1&modificationDate=1623163058000&api=v2)
- installation of file based on feature availability
Image Removed
Image Added - Functionality of feature can be controlled
![](/download/attachments/102073641/image2021-6-8_20-14-18.png?version=1&modificationDate=1623163405000&api=v2)
...