參考kernel config裡的一些設定方式,試著做出想要的功能
原來的menuconfig如下,我想在MX51 BABBAGE那邊多加選項,變成可以選公板或我們自己的板子。
改變後如下兩張圖
點進去後長樣子
程式碼如下
choice
prompt "Board Selected:"
default RSC_IMX51
depends on MACH_MX51_BABBAGE
config RSC_IMX51
bool "Avalue RSC-IMX51"
help
This enables support for systems based on the Avalue RISC Product RSC-IMX51 Board
config EVK_IMX51
bool "Freescale EVK-IMX51"
help
This enables support for systems based on the Freescale i.MX51 EVK Board
endchoice
其實為何要用的那麼麻煩,因為我本來是直接加#define RSC_IMX51在code裡面,但是compile時,會該該叫(Warning),所以就循正規做法來實作。