diff options
Diffstat (limited to 'recipes-kernel/linux/linux.inc')
-rw-r--r-- | recipes-kernel/linux/linux.inc | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux.inc b/recipes-kernel/linux/linux.inc new file mode 100644 index 0000000..1f28a56 --- /dev/null +++ b/recipes-kernel/linux/linux.inc | |||
@@ -0,0 +1,111 @@ | |||
1 | DESCRIPTION = "Linux Kernel" | ||
2 | SECTION = "kernel" | ||
3 | LICENSE = "GPLv2" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" | ||
5 | |||
6 | inherit kernel siteinfo | ||
7 | require recipes-kernel/linux/linux-yocto.inc | ||
8 | |||
9 | KERNEL_EXTRA_ARGS += "dtbs" | ||
10 | |||
11 | # Set the verbosity of kernel messages during runtime | ||
12 | # You can define CMDLINE_DEBUG in your local.conf or distro.conf to override this behaviour | ||
13 | CMDLINE_DEBUG ?= '${@base_conditional("DISTRO_TYPE", "release", "quiet", "debug", d)}' | ||
14 | CMDLINE_append = " ${CMDLINE_DEBUG}" | ||
15 | |||
16 | # Set a variable in .configure | ||
17 | # $1 - Configure variable to be set | ||
18 | # $2 - value [n/y/value] | ||
19 | kernel_configure_variable() { | ||
20 | # Remove the config | ||
21 | CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;" | ||
22 | if test "$2" = "n" | ||
23 | then | ||
24 | echo "# CONFIG_$1 is not set" >> ${B}/.config | ||
25 | else | ||
26 | echo "CONFIG_$1=$2" >> ${B}/.config | ||
27 | fi | ||
28 | } | ||
29 | |||
30 | # Quirk for udev greater or equal 141 | ||
31 | UDEV_GE_141 ?= "1" | ||
32 | |||
33 | do_configure_prepend() { | ||
34 | # Clean .config | ||
35 | echo "" > ${B}/.config | ||
36 | CONF_SED_SCRIPT="" | ||
37 | |||
38 | # bigendian support | ||
39 | if [[ "${MACHINE}" =~ .*-be ]]; then | ||
40 | kernel_configure_variable CPU_BIG_ENDIAN y | ||
41 | fi | ||
42 | |||
43 | # Set cmdline | ||
44 | kernel_configure_variable CMDLINE "\"${CMDLINE}\"" | ||
45 | |||
46 | # Localversion | ||
47 | kernel_configure_variable LOCALVERSION "\"\"" | ||
48 | kernel_configure_variable LOCALVERSION_AUTO n | ||
49 | |||
50 | # Udev quirks | ||
51 | # Newer versions of udev mandate that sysfs doesn't have deprecated entries | ||
52 | if [ "${UDEV_GE_141}" = "1" ] ; then | ||
53 | kernel_configure_variable SYSFS_DEPRECATED n | ||
54 | kernel_configure_variable SYSFS_DEPRECATED_V2 n | ||
55 | kernel_configure_variable HOTPLUG y | ||
56 | kernel_configure_variable UEVENT_HELPER_PATH "\"\"" | ||
57 | kernel_configure_variable UNIX y | ||
58 | kernel_configure_variable SYSFS y | ||
59 | kernel_configure_variable PROC_FS y | ||
60 | kernel_configure_variable TMPFS y | ||
61 | kernel_configure_variable INOTIFY_USER y | ||
62 | kernel_configure_variable SIGNALFD y | ||
63 | kernel_configure_variable TMPFS_POSIX_ACL y | ||
64 | kernel_configure_variable BLK_DEV_BSG y | ||
65 | kernel_configure_variable DEVTMPFS y | ||
66 | kernel_configure_variable DEVTMPFS_MOUNT y | ||
67 | fi | ||
68 | |||
69 | # Newer inits like systemd need cgroup support | ||
70 | if [ "${KERNEL_ENABLE_CGROUPS}" = "1" ] ; then | ||
71 | kernel_configure_variable CGROUP_SCHED y | ||
72 | kernel_configure_variable CGROUPS y | ||
73 | kernel_configure_variable CGROUP_NS y | ||
74 | kernel_configure_variable CGROUP_FREEZER y | ||
75 | kernel_configure_variable CGROUP_DEVICE y | ||
76 | kernel_configure_variable CPUSETS y | ||
77 | kernel_configure_variable PROC_PID_CPUSET y | ||
78 | kernel_configure_variable CGROUP_CPUACCT y | ||
79 | kernel_configure_variable RESOURCE_COUNTERS y | ||
80 | fi | ||
81 | |||
82 | # Activate CONFIG_LEGACY_PTYS | ||
83 | kernel_configure_variable LEGACY_PTYS y | ||
84 | |||
85 | # Keep this the last line | ||
86 | # Remove all modified configs and add the rest to .config | ||
87 | sed -e "${CONF_SED_SCRIPT}" < '${WORKDIR}/defconfig' >> '${B}/.config' | ||
88 | |||
89 | yes '' | oe_runmake oldconfig | ||
90 | } | ||
91 | |||
92 | do_deploy_append() { | ||
93 | install -m 0644 ${B}/arch/arm64/boot/dts/amd/amd-overdrive.dtb ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.dtb | ||
94 | } | ||
95 | |||
96 | # Automatically depend on lzop-native if CONFIG_KERNEL_LZO is enabled | ||
97 | python () { | ||
98 | try: | ||
99 | defconfig = bb.fetch2.localpath('file://defconfig', d) | ||
100 | except bb.fetch2.FetchError: | ||
101 | return | ||
102 | |||
103 | try: | ||
104 | configfile = open(defconfig) | ||
105 | except IOError: | ||
106 | return | ||
107 | |||
108 | if 'CONFIG_KERNEL_LZO=y\n' in configfile.readlines(): | ||
109 | depends = d.getVar('DEPENDS', False) | ||
110 | d.setVar('DEPENDS', depends + ' lzop-native') | ||
111 | } | ||