linux: autoload nfsd module if available
[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 DEFCONFIG_IN_SRC_URI = "${@base_contains('SRC_URI', 'file://defconfig', 'true', 'false', d)}"
23
24 do_configure_prepend() {
25     if [ -n "${DEFCONFIG}" ] && ! ${DEFCONFIG_IN_SRC_URI}; then
26         oe_runmake ${DEFCONFIG}_defconfig
27         mv ${B}/.config ${WORKDIR}/defconfig
28     fi
29
30     echo "" > ${S}/.config
31     CONF_SED_SCRIPT=""
32
33     if [ -n "${CMDLINE}" ]; then
34         kernel_conf_variable CMDLINE "\"${CMDLINE}\""
35     fi
36
37     if [ -n "${LOCALVERSION}" ]; then
38         kernel_conf_variable LOCALVERSION "\"${LOCALVERSION}\""
39     fi
40     kernel_conf_variable LOCALVERSION_AUTO n
41
42     kernel_conf_variable SYSFS_DEPRECATED n
43     kernel_conf_variable SYSFS_DEPRECATED_V2 n
44     kernel_conf_variable HOTPLUG y
45     kernel_conf_variable UEVENT_HELPER_PATH \"\"
46     kernel_conf_variable UNIX y
47     kernel_conf_variable SYSFS y
48     kernel_conf_variable PROC_FS y
49     kernel_conf_variable TMPFS y
50     kernel_conf_variable INOTIFY_USER y
51     kernel_conf_variable SIGNALFD y
52     kernel_conf_variable TMPFS_POSIX_ACL y
53     kernel_conf_variable BLK_DEV_BSG y
54     kernel_conf_variable DEVTMPFS y
55     kernel_conf_variable DEVTMPFS_MOUNT y
56
57     # Newer inits like systemd need cgroup support
58     if [ "${KERNEL_ENABLE_CGROUPS}" = "1" ] ; then
59         kernel_conf_variable CGROUP_SCHED y
60         kernel_conf_variable CGROUPS y
61         kernel_conf_variable CGROUP_NS y
62         kernel_conf_variable CGROUP_FREEZER y
63         kernel_conf_variable CGROUP_DEVICE y
64         kernel_conf_variable CPUSETS y
65         kernel_conf_variable PROC_PID_CPUSET y
66         kernel_conf_variable CGROUP_CPUACCT y
67         kernel_conf_variable RESOURCE_COUNTERS y
68     fi
69
70     sed -e "${CONF_SED_SCRIPT}" \
71     < '${WORKDIR}/defconfig' >>'${S}/.config'
72
73     yes '' | oe_runmake oldconfig
74 }
75
76 do_configure_append() {
77     if test -e scripts/Makefile.fwinst ; then
78         sed -i -e "s:-m0644:-m 0644:g" scripts/Makefile.fwinst
79     fi
80 }
81
82 do_install_append() {
83     oe_runmake headers_install INSTALL_HDR_PATH=${D}${exec_prefix}/src/linux-${KERNEL_VERSION} ARCH=$ARCH
84 }
85
86 PACKAGES =+ "kernel-headers"
87 FILES_kernel-headers = "${exec_prefix}/src/linux*"
88
89 KERNEL_MODULE_AUTOLOAD += "nfsd"