meta-bsp/dm7080: merge into meta-dreambox
[opendreambox.git] / meta-dreambox / recipes-kernel / linux / linux.inc
1 DESCRIPTION = "Linux Kernel"
2 SECTION = "kernel"
3 LICENSE = "GPLv2"
4 LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
5
6 inherit kernel siteinfo
7
8 CMDLINE ?= ""
9 LOCALVERSION ?= ""
10
11 #kernel_conf_variable CMDLINE "\"${CMDLINE} ${CMDLINE_DEBUG}\""
12 kernel_conf_variable() {
13     CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;"
14     if test "$2" = "n"
15     then
16         echo "# CONFIG_$1 is not set" >> ${S}/.config
17     else
18         echo "CONFIG_$1=$2" >> ${S}/.config
19     fi
20 }
21
22 do_configure_prepend() {
23     if [ -n "${DEFCONFIG}" ] && [ ! -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then
24         oe_runmake ${DEFCONFIG}_defconfig
25         mv ${B}/.config ${WORKDIR}/defconfig
26     fi
27
28     echo "" > ${S}/.config
29     CONF_SED_SCRIPT=""
30
31     if [ -n "${CMDLINE}" ]; then
32         kernel_conf_variable CMDLINE "\"${CMDLINE}\""
33     fi
34
35     if [ -n "${LOCALVERSION}" ]; then
36         kernel_conf_variable LOCALVERSION "\"${LOCALVERSION}\""
37     fi
38     kernel_conf_variable LOCALVERSION_AUTO n
39
40     kernel_conf_variable SYSFS_DEPRECATED n
41     kernel_conf_variable SYSFS_DEPRECATED_V2 n
42     kernel_conf_variable HOTPLUG y
43     kernel_conf_variable UEVENT_HELPER_PATH \"\"
44     kernel_conf_variable UNIX y
45     kernel_conf_variable SYSFS y
46     kernel_conf_variable PROC_FS y
47     kernel_conf_variable TMPFS y
48     kernel_conf_variable INOTIFY_USER y
49     kernel_conf_variable SIGNALFD y
50     kernel_conf_variable TMPFS_POSIX_ACL y
51     kernel_conf_variable BLK_DEV_BSG y
52     kernel_conf_variable DEVTMPFS y
53     kernel_conf_variable DEVTMPFS_MOUNT y
54
55     # Newer inits like systemd need cgroup support
56     if [ "${KERNEL_ENABLE_CGROUPS}" = "1" ] ; then
57         kernel_conf_variable CGROUP_SCHED y
58         kernel_conf_variable CGROUPS y
59         kernel_conf_variable CGROUP_NS y
60         kernel_conf_variable CGROUP_FREEZER y
61         kernel_conf_variable CGROUP_DEVICE y
62         kernel_conf_variable CPUSETS y
63         kernel_conf_variable PROC_PID_CPUSET y
64         kernel_conf_variable CGROUP_CPUACCT y
65         kernel_conf_variable RESOURCE_COUNTERS y
66     fi
67
68     sed -e "${CONF_SED_SCRIPT}" \
69     < '${WORKDIR}/defconfig' >>'${S}/.config'
70
71     yes '' | oe_runmake oldconfig
72 }
73
74 do_configure_append() {
75     if test -e scripts/Makefile.fwinst ; then
76         sed -i -e "s:-m0644:-m 0644:g" scripts/Makefile.fwinst
77     fi
78 }
79
80 do_install_append() {
81     oe_runmake headers_install INSTALL_HDR_PATH=${D}${exec_prefix}/src/linux-${KERNEL_VERSION} ARCH=$ARCH
82 }
83
84 PACKAGES =+ "kernel-headers"
85 FILES_kernel-headers = "${exec_prefix}/src/linux*"