diff options
author | Paul Barker <pbarker@toganlabs.com> | 2017-09-08 09:49:46 +0000 |
---|---|---|
committer | Andrei Gherzan <andrei@gherzan.com> | 2017-09-24 20:39:35 +0100 |
commit | e7bac0bed5797342ac52431cf9678981bfd8decf (patch) | |
tree | 2e2d702eaf9a74631e0c73bbf42f59a888260a5d | |
parent | 46f78e37e30b5686631b71c551402f5087274610 (diff) | |
download | meta-raspberrypi-e7bac0bed5797342ac52431cf9678981bfd8decf.tar.gz |
linux-raspberrypi: Merge inc files
There is no need to have 2 separate inc files any more and the existing code has
several duplications.
Signed-off-by: Paul Barker <pbarker@toganlabs.com>
-rw-r--r-- | recipes-kernel/linux/linux-raspberrypi.inc | 126 | ||||
-rw-r--r-- | recipes-kernel/linux/linux-rpi.inc | 131 |
2 files changed, 124 insertions, 133 deletions
diff --git a/recipes-kernel/linux/linux-raspberrypi.inc b/recipes-kernel/linux/linux-raspberrypi.inc index 154e4da..9f401d0 100644 --- a/recipes-kernel/linux/linux-raspberrypi.inc +++ b/recipes-kernel/linux/linux-raspberrypi.inc | |||
@@ -1,5 +1,3 @@ | |||
1 | require linux-rpi.inc | ||
2 | |||
3 | DESCRIPTION = "Linux Kernel for Raspberry Pi" | 1 | DESCRIPTION = "Linux Kernel for Raspberry Pi" |
4 | SECTION = "kernel" | 2 | SECTION = "kernel" |
5 | LICENSE = "GPLv2" | 3 | LICENSE = "GPLv2" |
@@ -10,6 +8,9 @@ COMPATIBLE_MACHINE = "^rpi$" | |||
10 | PE = "1" | 8 | PE = "1" |
11 | PV = "${LINUX_VERSION}+git${SRCPV}" | 9 | PV = "${LINUX_VERSION}+git${SRCPV}" |
12 | 10 | ||
11 | inherit kernel siteinfo | ||
12 | require recipes-kernel/linux/linux-yocto.inc | ||
13 | |||
13 | KCONFIG_MODE = "--alldefconfig" | 14 | KCONFIG_MODE = "--alldefconfig" |
14 | KBUILD_DEFCONFIG_raspberrypi ?= "bcmrpi_defconfig" | 15 | KBUILD_DEFCONFIG_raspberrypi ?= "bcmrpi_defconfig" |
15 | KBUILD_DEFCONFIG_raspberrypi2 ?= "bcm2709_defconfig" | 16 | KBUILD_DEFCONFIG_raspberrypi2 ?= "bcm2709_defconfig" |
@@ -25,10 +26,131 @@ CMDLINE_append = ' ${@base_conditional("ENABLE_KGDB", "1", "kgdboc=serial0,11520 | |||
25 | # Disable rpi logo on boot | 26 | # Disable rpi logo on boot |
26 | CMDLINE_append += ' ${@base_conditional("DISABLE_RPI_BOOT_LOGO", "1", "logo.nologo", "", d)}' | 27 | CMDLINE_append += ' ${@base_conditional("DISABLE_RPI_BOOT_LOGO", "1", "logo.nologo", "", d)}' |
27 | 28 | ||
29 | # You can define CMDLINE_DEBUG as "debug" in your local.conf or distro.conf | ||
30 | # to enable kernel debugging. | ||
31 | CMDLINE_DEBUG ?= "" | ||
32 | CMDLINE_append = " ${CMDLINE_DEBUG}" | ||
33 | |||
34 | # Quirk for udev greater or equal 141 | ||
28 | UDEV_GE_141 ?= "1" | 35 | UDEV_GE_141 ?= "1" |
29 | 36 | ||
37 | # Enable OABI compat for people stuck with obsolete userspace | ||
38 | ARM_KEEP_OABI ?= "1" | ||
39 | |||
40 | KERNEL_INITRAMFS ?= '${@base_conditional("INITRAMFS_IMAGE_BUNDLE", "1", "1", "", d)}' | ||
41 | |||
30 | KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains("MACHINE_FEATURES", "pitft28r", "stmpe-ts", "", d)}" | 42 | KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains("MACHINE_FEATURES", "pitft28r", "stmpe-ts", "", d)}" |
31 | 43 | ||
44 | # Set a variable in .configure | ||
45 | # $1 - Configure variable to be set | ||
46 | # $2 - value [n/y/value] | ||
47 | kernel_configure_variable() { | ||
48 | # Remove the config | ||
49 | CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;" | ||
50 | if test "$2" = "n" | ||
51 | then | ||
52 | echo "# CONFIG_$1 is not set" >> ${B}/.config | ||
53 | else | ||
54 | echo "CONFIG_$1=$2" >> ${B}/.config | ||
55 | fi | ||
56 | } | ||
57 | |||
58 | do_configure_prepend() { | ||
59 | mv -f ${B}/.config ${B}/.config.patched | ||
60 | CONF_SED_SCRIPT="" | ||
61 | |||
62 | # oabi / eabi support | ||
63 | kernel_configure_variable AEABI y | ||
64 | if [ "${ARM_KEEP_OABI}" = "1" ] ; then | ||
65 | kernel_configure_variable OABI_COMPAT y | ||
66 | else | ||
67 | kernel_configure_variable OABI_COMPAT n | ||
68 | fi | ||
69 | |||
70 | # Set cmdline | ||
71 | kernel_configure_variable CMDLINE "\"${CMDLINE}\"" | ||
72 | |||
73 | # Localversion | ||
74 | kernel_configure_variable LOCALVERSION "\"\"" | ||
75 | kernel_configure_variable LOCALVERSION_AUTO n | ||
76 | |||
77 | # Udev quirks | ||
78 | # Newer versions of udev mandate that sysfs doesn't have deprecated entries | ||
79 | if [ "${UDEV_GE_141}" = "1" ] ; then | ||
80 | kernel_configure_variable SYSFS_DEPRECATED n | ||
81 | kernel_configure_variable SYSFS_DEPRECATED_V2 n | ||
82 | kernel_configure_variable HOTPLUG y | ||
83 | kernel_configure_variable UEVENT_HELPER_PATH "\"\"" | ||
84 | kernel_configure_variable UNIX y | ||
85 | kernel_configure_variable SYSFS y | ||
86 | kernel_configure_variable PROC_FS y | ||
87 | kernel_configure_variable TMPFS y | ||
88 | kernel_configure_variable INOTIFY_USER y | ||
89 | kernel_configure_variable SIGNALFD y | ||
90 | kernel_configure_variable TMPFS_POSIX_ACL y | ||
91 | kernel_configure_variable BLK_DEV_BSG y | ||
92 | kernel_configure_variable DEVTMPFS y | ||
93 | kernel_configure_variable DEVTMPFS_MOUNT y | ||
94 | fi | ||
95 | |||
96 | # Newer inits like systemd need cgroup support | ||
97 | if [ "${KERNEL_ENABLE_CGROUPS}" = "1" ] ; then | ||
98 | kernel_configure_variable CGROUP_SCHED y | ||
99 | kernel_configure_variable CGROUPS y | ||
100 | kernel_configure_variable CGROUP_NS y | ||
101 | kernel_configure_variable CGROUP_FREEZER y | ||
102 | kernel_configure_variable CGROUP_DEVICE y | ||
103 | kernel_configure_variable CPUSETS y | ||
104 | kernel_configure_variable PROC_PID_CPUSET y | ||
105 | kernel_configure_variable CGROUP_CPUACCT y | ||
106 | kernel_configure_variable RESOURCE_COUNTERS y | ||
107 | fi | ||
108 | |||
109 | # root-over-nfs-over-usb-eth support. Limited, but should cover some cases | ||
110 | # Enable this by setting a proper CMDLINE_NFSROOT_USB. | ||
111 | if [ ! -z "${CMDLINE_NFSROOT_USB}" ]; then | ||
112 | oenote "Configuring the kernel for root-over-nfs-over-usb-eth with CMDLINE ${CMDLINE_NFSROOT_USB}" | ||
113 | kernel_configure_variable INET y | ||
114 | kernel_configure_variable IP_PNP y | ||
115 | kernel_configure_variable USB_GADGET y | ||
116 | kernel_configure_variable USB_GADGET_SELECTED y | ||
117 | kernel_configure_variable USB_ETH y | ||
118 | kernel_configure_variable NFS_FS y | ||
119 | kernel_configure_variable ROOT_NFS y | ||
120 | kernel_configure_variable ROOT_NFS y | ||
121 | kernel_configure_variable CMDLINE "\"${CMDLINE_NFSROOT_USB}\"" | ||
122 | fi | ||
123 | if [ ! -z "${KERNEL_INITRAMFS}" ]; then | ||
124 | kernel_configure_variable BLK_DEV_INITRD y | ||
125 | kernel_configure_variable INITRAMFS_SOURCE "" | ||
126 | kernel_configure_variable RD_GZIP y | ||
127 | kernel_configure_variable OVERLAY_FS y | ||
128 | kernel_configure_variable SQUASHFS y | ||
129 | kernel_configure_variable UBIFS_FS y | ||
130 | fi | ||
131 | # Activate CONFIG_LEGACY_PTYS | ||
132 | kernel_configure_variable LEGACY_PTYS y | ||
133 | # this module is built externally via drbd-utils | ||
134 | kernel_configure_variable BLK_DEV_DRBD n | ||
135 | |||
136 | # Activate the configuration options for VC4 | ||
137 | VC4GRAPHICS="${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "1", "0", d)}" | ||
138 | if [ ${VC4GRAPHICS} = "1" ]; then | ||
139 | kernel_configure_variable I2C_BCM2835 y | ||
140 | kernel_configure_variable DRM y | ||
141 | kernel_configure_variable DRM_FBDEV_EMULATION y | ||
142 | kernel_configure_variable DRM_VC4 y | ||
143 | kernel_configure_variable FB_BCM2708 n | ||
144 | fi | ||
145 | |||
146 | # Keep this the last line | ||
147 | # Remove all modified configs and add the rest to .config | ||
148 | sed -e "${CONF_SED_SCRIPT}" < '${B}/.config.patched' >> '${B}/.config' | ||
149 | rm -f ${B}/.config.patched | ||
150 | |||
151 | yes '' | oe_runmake oldconfig | ||
152 | } | ||
153 | |||
32 | do_compile_append_raspberrypi3-64() { | 154 | do_compile_append_raspberrypi3-64() { |
33 | cc_extra=$(get_cc_option) | 155 | cc_extra=$(get_cc_option) |
34 | oe_runmake dtbs CC="${KERNEL_CC} $cc_extra " LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} | 156 | oe_runmake dtbs CC="${KERNEL_CC} $cc_extra " LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} |
diff --git a/recipes-kernel/linux/linux-rpi.inc b/recipes-kernel/linux/linux-rpi.inc deleted file mode 100644 index 715cd06..0000000 --- a/recipes-kernel/linux/linux-rpi.inc +++ /dev/null | |||
@@ -1,131 +0,0 @@ | |||
1 | DESCRIPTION = "Linux Kernel" | ||
2 | SECTION = "kernel" | ||
3 | LICENSE = "GPLv2" | ||
4 | |||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" | ||
6 | |||
7 | inherit kernel siteinfo | ||
8 | require recipes-kernel/linux/linux-yocto.inc | ||
9 | |||
10 | # Enable OABI compat for people stuck with obsolete userspace | ||
11 | ARM_KEEP_OABI ?= "1" | ||
12 | |||
13 | # Quirk for udev greater or equal 141 | ||
14 | UDEV_GE_141 ?= "1" | ||
15 | |||
16 | # You can define CMDLINE_DEBUG as "debug" in your local.conf or distro.conf | ||
17 | # to enable kernel debugging. | ||
18 | CMDLINE_DEBUG ?= "" | ||
19 | CMDLINE_append = " ${CMDLINE_DEBUG}" | ||
20 | |||
21 | KERNEL_INITRAMFS ?= '${@base_conditional("INITRAMFS_IMAGE_BUNDLE", "1", "1", "", d)}' | ||
22 | |||
23 | # Set a variable in .configure | ||
24 | # $1 - Configure variable to be set | ||
25 | # $2 - value [n/y/value] | ||
26 | kernel_configure_variable() { | ||
27 | # Remove the config | ||
28 | CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;" | ||
29 | if test "$2" = "n" | ||
30 | then | ||
31 | echo "# CONFIG_$1 is not set" >> ${B}/.config | ||
32 | else | ||
33 | echo "CONFIG_$1=$2" >> ${B}/.config | ||
34 | fi | ||
35 | } | ||
36 | |||
37 | do_configure_prepend() { | ||
38 | mv -f ${B}/.config ${B}/.config.patched | ||
39 | CONF_SED_SCRIPT="" | ||
40 | |||
41 | # oabi / eabi support | ||
42 | kernel_configure_variable AEABI y | ||
43 | if [ "${ARM_KEEP_OABI}" = "1" ] ; then | ||
44 | kernel_configure_variable OABI_COMPAT y | ||
45 | else | ||
46 | kernel_configure_variable OABI_COMPAT n | ||
47 | fi | ||
48 | |||
49 | # Set cmdline | ||
50 | kernel_configure_variable CMDLINE "\"${CMDLINE}\"" | ||
51 | |||
52 | # Localversion | ||
53 | kernel_configure_variable LOCALVERSION "\"\"" | ||
54 | kernel_configure_variable LOCALVERSION_AUTO n | ||
55 | |||
56 | # Udev quirks | ||
57 | # Newer versions of udev mandate that sysfs doesn't have deprecated entries | ||
58 | if [ "${UDEV_GE_141}" = "1" ] ; then | ||
59 | kernel_configure_variable SYSFS_DEPRECATED n | ||
60 | kernel_configure_variable SYSFS_DEPRECATED_V2 n | ||
61 | kernel_configure_variable HOTPLUG y | ||
62 | kernel_configure_variable UEVENT_HELPER_PATH "\"\"" | ||
63 | kernel_configure_variable UNIX y | ||
64 | kernel_configure_variable SYSFS y | ||
65 | kernel_configure_variable PROC_FS y | ||
66 | kernel_configure_variable TMPFS y | ||
67 | kernel_configure_variable INOTIFY_USER y | ||
68 | kernel_configure_variable SIGNALFD y | ||
69 | kernel_configure_variable TMPFS_POSIX_ACL y | ||
70 | kernel_configure_variable BLK_DEV_BSG y | ||
71 | kernel_configure_variable DEVTMPFS y | ||
72 | kernel_configure_variable DEVTMPFS_MOUNT y | ||
73 | fi | ||
74 | |||
75 | # Newer inits like systemd need cgroup support | ||
76 | if [ "${KERNEL_ENABLE_CGROUPS}" = "1" ] ; then | ||
77 | kernel_configure_variable CGROUP_SCHED y | ||
78 | kernel_configure_variable CGROUPS y | ||
79 | kernel_configure_variable CGROUP_NS y | ||
80 | kernel_configure_variable CGROUP_FREEZER y | ||
81 | kernel_configure_variable CGROUP_DEVICE y | ||
82 | kernel_configure_variable CPUSETS y | ||
83 | kernel_configure_variable PROC_PID_CPUSET y | ||
84 | kernel_configure_variable CGROUP_CPUACCT y | ||
85 | kernel_configure_variable RESOURCE_COUNTERS y | ||
86 | fi | ||
87 | |||
88 | # root-over-nfs-over-usb-eth support. Limited, but should cover some cases | ||
89 | # Enable this by setting a proper CMDLINE_NFSROOT_USB. | ||
90 | if [ ! -z "${CMDLINE_NFSROOT_USB}" ]; then | ||
91 | oenote "Configuring the kernel for root-over-nfs-over-usb-eth with CMDLINE ${CMDLINE_NFSROOT_USB}" | ||
92 | kernel_configure_variable INET y | ||
93 | kernel_configure_variable IP_PNP y | ||
94 | kernel_configure_variable USB_GADGET y | ||
95 | kernel_configure_variable USB_GADGET_SELECTED y | ||
96 | kernel_configure_variable USB_ETH y | ||
97 | kernel_configure_variable NFS_FS y | ||
98 | kernel_configure_variable ROOT_NFS y | ||
99 | kernel_configure_variable ROOT_NFS y | ||
100 | kernel_configure_variable CMDLINE "\"${CMDLINE_NFSROOT_USB}\"" | ||
101 | fi | ||
102 | if [ ! -z "${KERNEL_INITRAMFS}" ]; then | ||
103 | kernel_configure_variable BLK_DEV_INITRD y | ||
104 | kernel_configure_variable INITRAMFS_SOURCE "" | ||
105 | kernel_configure_variable RD_GZIP y | ||
106 | kernel_configure_variable OVERLAY_FS y | ||
107 | kernel_configure_variable SQUASHFS y | ||
108 | kernel_configure_variable UBIFS_FS y | ||
109 | fi | ||
110 | # Activate CONFIG_LEGACY_PTYS | ||
111 | kernel_configure_variable LEGACY_PTYS y | ||
112 | # this module is built externally via drbd-utils | ||
113 | kernel_configure_variable BLK_DEV_DRBD n | ||
114 | |||
115 | # Activate the configuration options for VC4 | ||
116 | VC4GRAPHICS="${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "1", "0", d)}" | ||
117 | if [ ${VC4GRAPHICS} = "1" ]; then | ||
118 | kernel_configure_variable I2C_BCM2835 y | ||
119 | kernel_configure_variable DRM y | ||
120 | kernel_configure_variable DRM_FBDEV_EMULATION y | ||
121 | kernel_configure_variable DRM_VC4 y | ||
122 | kernel_configure_variable FB_BCM2708 n | ||
123 | fi | ||
124 | |||
125 | # Keep this the last line | ||
126 | # Remove all modified configs and add the rest to .config | ||
127 | sed -e "${CONF_SED_SCRIPT}" < '${B}/.config.patched' >> '${B}/.config' | ||
128 | rm -f ${B}/.config.patched | ||
129 | |||
130 | yes '' | oe_runmake oldconfig | ||
131 | } | ||