1eb8dc403SDave CobbleyDESCRIPTION = "Linux Kernel"
2eb8dc403SDave CobbleySECTION = "kernel"
39aee5003SAndrew GeisslerLICENSE = "GPL-2.0-only"
4eb8dc403SDave CobbleyLIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
5eb8dc403SDave Cobbley
6eb8dc403SDave CobbleyINC_PR = "r0"
7eb8dc403SDave Cobbley
8eb8dc403SDave Cobbleyinherit kernel siteinfo
9eb8dc403SDave Cobbley
10eb8dc403SDave Cobbley# Enable OABI compat for people stuck with obsolete userspace
11eb8dc403SDave CobbleyARM_KEEP_OABI ?= "0"
12eb8dc403SDave Cobbley
13eb8dc403SDave Cobbley# Set the verbosity of kernel messages during runtime
14eb8dc403SDave Cobbley# You can define CMDLINE_DEBUG in your local.conf or distro.conf to override this behaviour
15eb8dc403SDave CobbleyCMDLINE_DEBUG ?= "loglevel=3"
16eb8dc403SDave Cobbley
17eb8dc403SDave Cobbley# Kernel bootlogo is distro-specific (default is OE logo).
18eb8dc403SDave Cobbley# Logo resolution (qvga, vga, ...) is machine-specific.
19eb8dc403SDave CobbleyLOGO_SIZE ?= '${@oe.utils.conditional("MACHINE_GUI_CLASS", "bigscreen", "vga", "qvga", d)}'
20eb8dc403SDave Cobbley# To use this, add file://${LOGO_SIZE}/logo_linux_clut224.ppm.bz2 or similar
21eb8dc403SDave Cobbley# to your kernel recipe, and then structure your logos for each resolution
22eb8dc403SDave Cobbley# accordingly.
23eb8dc403SDave Cobbley
24eb8dc403SDave CobbleyLOCALVERSION ?= ""
25eb8dc403SDave Cobbley
26eb8dc403SDave Cobbley#kernel_conf_variable CMDLINE "\"${CMDLINE} ${CMDLINE_DEBUG}\""
27eb8dc403SDave Cobbleykernel_conf_variable() {
28eb8dc403SDave Cobbley    CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;"
29eb8dc403SDave Cobbley    if test "$2" = "n"
30eb8dc403SDave Cobbley    then
31eb8dc403SDave Cobbley        echo "# CONFIG_$1 is not set" >> ${B}/.config
32eb8dc403SDave Cobbley    else
33eb8dc403SDave Cobbley        echo "CONFIG_$1=$2" >> ${B}/.config
34eb8dc403SDave Cobbley    fi
35eb8dc403SDave Cobbley}
36eb8dc403SDave Cobbley
37213cb269SPatrick Williamsdo_configure:prepend() {
38eb8dc403SDave Cobbley    echo "" > ${B}/.config
39eb8dc403SDave Cobbley    CONF_SED_SCRIPT=""
40eb8dc403SDave Cobbley
41eb8dc403SDave Cobbley    #
42eb8dc403SDave Cobbley    # logo support, if you supply logo_linux_clut224.ppm in SRC_URI, then it's going to be used
43eb8dc403SDave Cobbley    #
44*edff4923SAndrew Geissler    if [ -e ${UNPACKDIR}/logo_linux_clut224.ppm ]; then
45*edff4923SAndrew Geissler        install -m 0644 ${UNPACKDIR}/logo_linux_clut224.ppm drivers/video/logo/logo_linux_clut224.ppm
46eb8dc403SDave Cobbley        kernel_conf_variable LOGO y
47eb8dc403SDave Cobbley        kernel_conf_variable LOGO_LINUX_CLUT224 y
48eb8dc403SDave Cobbley    fi
49eb8dc403SDave Cobbley
50eb8dc403SDave Cobbley    #
51eb8dc403SDave Cobbley    # oabi / eabi support
52eb8dc403SDave Cobbley    #
53eb8dc403SDave Cobbley    kernel_conf_variable AEABI y
54eb8dc403SDave Cobbley    if [ "${ARM_KEEP_OABI}" = "1" ] ; then
55eb8dc403SDave Cobbley        kernel_conf_variable OABI_COMPAT y
56eb8dc403SDave Cobbley    else
57eb8dc403SDave Cobbley        kernel_conf_variable OABI_COMPAT n
58eb8dc403SDave Cobbley    fi
59eb8dc403SDave Cobbley
60eb8dc403SDave Cobbley    # When enabling thumb for userspace we also need thumb support in the kernel
61eb8dc403SDave Cobbley    if [ "${ARM_INSTRUCTION_SET}" = "thumb" ] ; then
62eb8dc403SDave Cobbley        kernel_conf_variable ARM_THUMB y
63eb8dc403SDave Cobbley    fi
64eb8dc403SDave Cobbley
65eb8dc403SDave Cobbley    kernel_conf_variable CMDLINE "\"${CMDLINE} ${CMDLINE_DEBUG}\""
66eb8dc403SDave Cobbley
67eb8dc403SDave Cobbley    kernel_conf_variable LOCALVERSION "\"${LOCALVERSION}\""
68eb8dc403SDave Cobbley    kernel_conf_variable LOCALVERSION_AUTO n
69eb8dc403SDave Cobbley
70eb8dc403SDave Cobbley    kernel_conf_variable SYSFS_DEPRECATED n
71eb8dc403SDave Cobbley    kernel_conf_variable SYSFS_DEPRECATED_V2 n
72eb8dc403SDave Cobbley    kernel_conf_variable HOTPLUG y
73eb8dc403SDave Cobbley    kernel_conf_variable UEVENT_HELPER_PATH \"\"
74eb8dc403SDave Cobbley    kernel_conf_variable UNIX y
75eb8dc403SDave Cobbley    kernel_conf_variable SYSFS y
76eb8dc403SDave Cobbley    kernel_conf_variable PROC_FS y
77eb8dc403SDave Cobbley    kernel_conf_variable TMPFS y
78eb8dc403SDave Cobbley    kernel_conf_variable INOTIFY_USER y
79eb8dc403SDave Cobbley    kernel_conf_variable SIGNALFD y
80eb8dc403SDave Cobbley    kernel_conf_variable TMPFS_POSIX_ACL y
81eb8dc403SDave Cobbley    kernel_conf_variable BLK_DEV_BSG y
82eb8dc403SDave Cobbley    kernel_conf_variable DEVTMPFS y
83eb8dc403SDave Cobbley    kernel_conf_variable DEVTMPFS_MOUNT y
84eb8dc403SDave Cobbley
85eb8dc403SDave Cobbley    # Newer inits like systemd need cgroup support
86eb8dc403SDave Cobbley    if [ "${KERNEL_ENABLE_CGROUPS}" = "1" ] ; then
87eb8dc403SDave Cobbley        kernel_conf_variable CGROUP_SCHED y
88eb8dc403SDave Cobbley        kernel_conf_variable CGROUPS y
89eb8dc403SDave Cobbley        kernel_conf_variable CGROUP_NS y
90eb8dc403SDave Cobbley        kernel_conf_variable CGROUP_FREEZER y
91eb8dc403SDave Cobbley        kernel_conf_variable CGROUP_DEVICE y
92eb8dc403SDave Cobbley        kernel_conf_variable CPUSETS y
93eb8dc403SDave Cobbley        kernel_conf_variable PROC_PID_CPUSET y
94eb8dc403SDave Cobbley        kernel_conf_variable CGROUP_CPUACCT y
95eb8dc403SDave Cobbley        kernel_conf_variable RESOURCE_COUNTERS y
96eb8dc403SDave Cobbley    fi
97eb8dc403SDave Cobbley
98eb8dc403SDave Cobbley    #
99eb8dc403SDave Cobbley    # root-over-nfs-over-usb-eth support. Limited, but should cover some cases.
100eb8dc403SDave Cobbley    # Enable this by setting a proper CMDLINE_NFSROOT_USB.
101eb8dc403SDave Cobbley    #
102eb8dc403SDave Cobbley    if [ ! -z "${CMDLINE_NFSROOT_USB}" ]; then
103eb8dc403SDave Cobbley        bbnote "Configuring the kernel for root-over-nfs-over-usb-eth with CMDLINE ${CMDLINE_NFSROOT_USB}"
104eb8dc403SDave Cobbley        kernel_conf_variable INET y
105eb8dc403SDave Cobbley        kernel_conf_variable IP_PNP y
106eb8dc403SDave Cobbley        kernel_conf_variable USB_GADGET y
107eb8dc403SDave Cobbley        kernel_conf_variable USB_GADGET_SELECTED y
108eb8dc403SDave Cobbley        kernel_conf_variable USB_ETH y
109eb8dc403SDave Cobbley        kernel_conf_variable NFS_FS y
110eb8dc403SDave Cobbley        kernel_conf_variable ROOT_NFS y
111eb8dc403SDave Cobbley        kernel_conf_variable CMDLINE \"${CMDLINE_NFSROOT_USB} ${CMDLINE_DEBUG}\"
112eb8dc403SDave Cobbley    fi
113eb8dc403SDave Cobbley
114eb8dc403SDave Cobbley    sed -e "${CONF_SED_SCRIPT}" \
115eb8dc403SDave Cobbley    < '${WORKDIR}/defconfig' >>'${B}/.config'
116eb8dc403SDave Cobbley
117eb8dc403SDave Cobbley    yes '' | oe_runmake -C ${S} O=${B} oldconfig
118eb8dc403SDave Cobbley}
119eb8dc403SDave Cobbley
120213cb269SPatrick Williamsdo_configure:append() {
121eb8dc403SDave Cobbley    if test -e scripts/Makefile.fwinst ; then
122eb8dc403SDave Cobbley        sed -i -e "s:-m0644:-m 0644:g" scripts/Makefile.fwinst
123eb8dc403SDave Cobbley    fi
124eb8dc403SDave Cobbley}
125eb8dc403SDave Cobbley
126213cb269SPatrick Williamsdo_install:append() {
127eb8dc403SDave Cobbley    oe_runmake headers_install INSTALL_HDR_PATH=${D}${exec_prefix}/src/linux-${KERNEL_VERSION} ARCH=$ARCH
128eb8dc403SDave Cobbley}
129eb8dc403SDave Cobbley
130eb8dc403SDave CobbleyPACKAGES =+ "kernel-headers"
131213cb269SPatrick WilliamsFILES:kernel-headers = "${exec_prefix}/src/linux*"
132