Fix i.MX6
[AGL/meta-agl.git] / meta-agl-bsp / meta-freescale-layer / recipes-kernel / linux / linux-fslc-imx_%.bbappend
1 # Borrowed fragments logic from linaro kernel configuration
2
3 FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
4 KERNEL_CONFIG_FRAGMENTS ?= ""
5
6 kernel_conf_variable() {
7     CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;"
8     if test "$2" = "n"
9     then
10         echo "# CONFIG_$1 is not set" >> ${B}/.config
11     else
12         echo "CONFIG_$1=$2" >> ${B}/.config
13     fi
14 }
15
16 do_configure_append() {
17
18     CONF_SED_SCRIPT=""
19
20     # kernel_conf_variable NAME y/n lines here
21
22     if [ -f '${WORKDIR}/defconfig' ]; then
23         sed -e "${CONF_SED_SCRIPT}" < '${WORKDIR}/defconfig' >> '${B}/.config'
24     else
25         sed -e "${CONF_SED_SCRIPT}" < '${KERNEL_DEFCONFIG}' >> '${B}/.config'
26     fi
27
28     # Check for kernel config fragments.  The assumption is that the config
29     # fragment will be specified with the absolute path.  For example:
30     #   * ${WORKDIR}/config1.cfg
31     #   * ${S}/config2.cfg
32     # Iterate through the list of configs and make sure that you can find
33     # each one.  If not then error out.
34     # NOTE: If you want to override a configuration that is kept in the kernel
35     #       with one from the OE meta data then you should make sure that the
36     #       OE meta data version (i.e. ${WORKDIR}/config1.cfg) is listed
37     #       after the in kernel configuration fragment.
38     # Check if any config fragments are specified.
39     if [ ! -z "${KERNEL_CONFIG_FRAGMENTS}" ]
40     then
41         for f in ${KERNEL_CONFIG_FRAGMENTS}
42         do
43             # Check if the config fragment was copied into the WORKDIR from
44             # the OE meta data
45             if [ ! -e "$f" ]
46             then
47                 echo "Could not find kernel config fragment $f"
48                 exit 1
49             fi
50         done
51
52 #        # Now that all the fragments are located merge them.
53 #        ( cd ${WORKDIR} && ${S}/scripts/kconfig/merge_config.sh -m -r -O ${B} ${B}/.config ${KERNEL_CONFIG_FRAGMENTS} 1>&2 )
54 #
55
56         cat ${KERNEL_CONFIG_FRAGMENTS} >> ${B}/.config
57     fi
58
59     yes '' | oe_runmake -C ${S} O=${B} oldconfig
60     oe_runmake -C ${S} O=${B} savedefconfig && cp ${B}/defconfig ${WORKDIR}/defconfig.saved
61 }
62
63 # Make sure these are enabled so that AGL configurations work
64
65 SRC_URI_append = " file://tmpfs.cfg"
66 KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/tmpfs.cfg"
67 SRC_URI_append = " file://namespace.cfg"
68 KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/namespace.cfg"
69 SRC_URI_append = " file://cgroup.cfg"
70 KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/cgroup.cfg"
71
72 # Fragments common to AGL demo platform (make sure they are added)
73
74 # Enable support for USB HID touch display
75 SRC_URI_append = " file://touchscreen.cfg"
76 KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/touchscreen.cfg"
77
78 # Enable support for TP-Link TL-W722N USB Wifi adapter
79 SRC_URI_append = " file://ath9k_htc.cfg"
80 KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/ath9k_htc.cfg"
81
82 # Enable support for RTLSDR
83 SRC_URI_append = " file://rtl_sdr.cfg"
84 KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/rtl_sdr.cfg"
85
86 # Enable support for Bluetooth HCI USB devices
87 SRC_URI_append = " file://btusb.cfg"
88 KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/btusb.cfg"
89
90 #-------------------------------------------------------------------------
91 # smack patches for handling bluetooth
92
93 SRC_URI_append_smack = "\
94        file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \
95 "
96
97 # Enable support for smack
98 KERNEL_CONFIG_FRAGMENTS_append_smack = "\
99        ${WORKDIR}/audit.cfg \
100        ${WORKDIR}/smack.cfg \
101        ${WORKDIR}/smack-default-lsm.cfg \
102 "
103