Changes between Initial Version and Version 1 of OpenWrt/kernelconfig


Ignore:
Timestamp:
10/22/2017 05:28:45 AM (7 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OpenWrt/kernelconfig

    v1 v1  
     1[[PageOutline]]
     2
     3= Kernel Configuration and Customization =
     4OpenWrt specifies the kernel configuration for a target. It does allow some customization via the command make menuconfig but for things that are not available in OpenWrt configuration, you need to modify the kernel configuration directly located in the target/linux/<targetarch>/config* file. OpenWrt allows you to do this through the command make kernel_menuconfig.
     5
     6Note that there are 2 different config files:
     7 * make menuconfig - main configuration for OpenWrt including all build options and package includes - often modified (.config file)
     8 * make kernel_menuconfig - configuration for kernel - rarely modified (target/linux/<targetarch>/config*
     9
     10
     11== Tutorial ==
     12To modify the kernel, please go to your build directory and type the command:
     13{{{
     14make kernel_menuconfig
     15}}}
     16
     17You should then see a screen like this:
     18[[Image(kernelconfig.png)]]
     19
     20So, for example, to turn on PPS support for GPS, please go to the following:
     21 1. make kernel_menuconfig - gui should come up
     22 2. In the gui - go down and select Device Drivers
     23 3. Go down and select PPS support
     24 4. Enable PPS support (check the checkbox by making it an asterisk by kitting the spacebar
     25 5. Select anything else in PPS you may need
     26 6. Exit and be sure to save
     27 7. Rebuild everything with a make inside of the trunk directory
     28{{{
     29make -j8 V=99
     30}}}
     31 * NOTE: Do not navigate up a directory and do a make imx6, etc as this will overwrite the config.
     32
     33
     34'''CAUTION: Kernel config items can be overwritten by OpenWrt Modules. Use the asterisk * when selecting a kernel item. DO NOT turn it into a module, represented by the letter M. The asterisk will build the item into the kernel as static'''
     35 
     36'''CAUTION:''' Kernel config can very easily be wiped out and not saved. Everytime a make is ran for open wrt it is overwritten because of the location of it, as seen below:
     37
     38EXAMPLE:
     39{{{
     40rerbstoesser@softdev:/usr/src/rerbstoesser/builds/gateworks-openwrt-trunk$ ls trunk/target/linux/cns3xxx/config-3.3
     41}}}
     42
     43
     44== Target Kernel Config ==
     45While on the target, you can see what the kernel config is:
     46
     47{{{
     48root@OpenWrt:/# zcat /proc/config.gz
     49#
     50# Automatically generated make config: don't edit
     51# Linux/arm 2.6.39.2 Kernel Configuration
     52# Wed Nov 14 15:37:55 2012
     53#
     54CONFIG_ARM=y
     55CONFIG_MIGHT_HAVE_PCI=y
     56CONFIG_SYS_SUPPORTS_APM_EMULATION=y
     57CONFIG_GENERIC_GPIO=y
     58# CONFIG_ARCH_USES_GETTIMEOFFSET is not set
     59CONFIG_GENERIC_CLOCKEVENTS=y
     60CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
     61CONFIG_KTIME_SCALAR=y
     62CONFIG_HAVE_PROC_CPU=y
     63CONFIG_STACKTRACE_SUPPORT=y
     64CONFIG_LOCKDEP_SUPPORT=y
     65CONFIG_TRACE_IRQFLAGS_SUPPORT=y
     66CONFIG_HARDIRQS_SW_RESEND=y
     67CONFIG_GENERIC_IRQ_PROBE=y
     68CONFIG_RWSEM_GENERIC_SPINLOCK=y
     69...........
     70.............
     71
     72}}}
     73
     74To do this on the target, you must first enable this feature in the make menuconfig while building the BSP.
     75
     76[[Image(turnonkernelconfig.png)]]
     77
     78
     79== Troubleshooting ==
     80Occasionally after using 'make kernelmenuconfig', the OpenWrt build system may start prompting you for specific kernel configuration items every time you do a 'make'.
     81
     82This is the result of a kernel config which isn't specified in target/linux/<targetarch>/config or the other places used to generate kernel configuration. To work around this, add the configs you are being prompted for manually to target/linux/<targetarch/config.
     83
     84For example, if you are working with Ventana (imx6 arch) and find you keep getting prompted with a question regarding GENERIC_CPUFREQ_CPU0 after doing a 'make kernel_menuconfig', simply add a proper default for 'CONFIG_GENERIC_CPUFREQ_CPU0' to the config file manually. If you wish to disable this for example:
     85{{{
     86echo "#CONFIG_GENERIC_CPUFREQ_CPU0 is not set" >> target/linux/imx6/config-3.14
     87}}}
     88
     89
     90
     91