summaryrefslogtreecommitdiffstats
path: root/meta-rcar-gen2/recipes-kernel/linux/linux.inc
blob: b5b368a391a2db9efa6a74676780095e3c7ee4d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

@media only all and (prefers-color-scheme: dark) {
.highlight .hll { background-color: #49483e }
.highlight .c { color: #75715e } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #66d9ef } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #f8f8f2 } /* Name */
.highlight .o { color: #f92672 } /* Operator */
.highlight .p { color: #f8f8f2 } /* Punctuation */
.highlight .ch { color: #75715e } /* Comment.Hashbang */
.highlight .cm { color: #75715e } /* Comment.Multiline */
.highlight .cp { color: #75715e } /* Comment.Preproc */
.highlight .cpf { color: #75715e } /* Comment.PreprocFile */
.highlight .c1 { color: #75715e } /* Comment.Single */
.highlight .cs { color: #75715e } /* Comment.Special */
.highlight .gd { color: #f92672 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gi { color: #a6e22e } /* Generic.Inserted */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #75715e } /* Generic.Subheading */
.highlight .kc { color: #66d9ef } /* Keyword.Constant */
.highlight .kd { color: #66d9ef } /* Keyword.Declaration */
.highlight .kn { color: #f92672 } /* Keyword.Namespace */
.highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
.highlight .kr { color: #66d9ef } /* Keyword.Reserved */
.highlight .kt { color: #66d9ef } /* Keyword.Type */
.highlight .ld { color: #e6db74 } /* Literal.Date */
.highlight .m { color: #ae81ff } /* Literal.Number */
.highlight .s { color: #e6db74 } /* Literal.String */
.highlight .na { color: #a6e22e } /* Name.Attribute */
.highlight .nb { color: #f8f8f2 } /* Name.Builtin */
.highlight .nc { color: #a6e22e } /* Name.Class */
.highlight .no { color: #66d9ef } /* Name.Constant */
.highlight .nd { color: #a6e22e } /* Name.Decorator */
.highlight .ni { color: #f8f8f2 } /* Name.Entity */
.highlight .ne { color: #a6e22e } /* Name.Exception */
.highlight .nf { color: #a6e22e } /* Name.Function */
.highlight .nl { color: #f8f8f2 } /* Name.Label */
.highlight .nn { color: #f8f8f2 } /* Name.Namespace */
.highlight .nx { color: #a6e22e } /* Name.Other */
.highlight .py { color: #f8f8f2 } /* Name.Property */
.highlight .nt { color: #f92672 } /* Name.Tag */
.highlight .nv { color: #f8f8f2 } /* Name.Variable */
.highlight .ow { color: #f92672 } /* Operator.Word */
.highlight .w { color: #f8f8f2 } /* Text.Whitespace */
.highlight .mb { color: #ae81ff } /* Literal.Number.Bin */
.highlight .mf { color: #ae81ff } /* Literal.Number.Float */
.highlight .mh { color: #ae81ff } /* Literal.Number.Hex */
.highlight .mi { color: #ae81ff } /* Literal.Number.Integer */
.highlight .mo { color: #ae81ff } /* Literal.Number.Oct */
.highlight .sa { color: #e6db74 } /* Literal.String.Affix */
.highlight .sb { color: #e6db74 } /* Literal.String.Backtick */
.highlight .sc { color: #e6db74 } /* Literal.String.Char */
.highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */
.highlight .sd { color: #e6db74 } /* Literal.String.Doc */
.highlight .s2 { color: #e6db74 } /* Literal.String.Double */
.highlight .se { color: #ae81ff } /* Literal.String.Escape */
.highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */
.highlight .si { color: #e6db74 } /* Literal.String.Interpol */
.highlight .sx { color: #e6db74 } /* Literal.String.Other */
.highlight .sr { color: #e6db74 } /* Literal.String.Regex */
.highlight .s1 { color: #e6db74 } /* Literal.String.Single */
.highlight .ss { color: #e6db74 } /* Literal.String.Symbol */
.highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #a6e22e } /* Name.Function.Magic */
.highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */
.highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */
.highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */
.highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */
}
@media (prefers-color-scheme: light) {
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color:
DESCRIPTION = "Linux Kernel"
SECTION = "kernel"
LICENSE = "GPLv2"

LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"

inherit kernel siteinfo

# Enable OABI compat for people stuck with obsolete userspace
ARM_KEEP_OABI ?= "1"

# Quirk for udev greater or equal 141
UDEV_GE_141 ?= "1"

# Enable cgroups support for systemd
KERNEL_ENABLE_CGROUPS ?= "1"

# combine oe-core way with angstrom DISTRO_TYPE
DISTRO_TYPE ?= "${@base_contains("IMAGE_FEATURES", "debug-tweaks", "debug", "release",d)}"

# Set the verbosity of kernel messages during runtime
# You can define CMDLINE_DEBUG in your local.conf or distro.conf to override this behaviour
CMDLINE_DEBUG ?= '${@base_conditional("DISTRO_TYPE", "release", "quiet", "debug", d)}'
CMDLINE_append = " ${CMDLINE_DEBUG}"

# Set a variable in .configure
# $1 - Configure variable to be set
# $2 - value [n/y/value]
kernel_configure_variable() {
	# Remove the config
	CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;"
	if test "$2" = "n"
	then
		echo "# CONFIG_$1 is not set" >> ${B}/.config
	else
		echo "CONFIG_$1=$2" >> ${B}/.config
	fi
}

# returns all the elements from the src uri that are .cfg files
def find_cfgs(d):
    sources=src_patches(d, True)
    sources_list=[]
    for s in sources:
        if s.endswith('.cfg'):
            sources_list.append(s)

    return sources_list

do_configure_prepend() {
	# Clean .config
	echo "" > ${B}/.config
	CONF_SED_SCRIPT=""

	# oabi / eabi support
	if [ "${TARGET_OS}" = "linux-gnueabi" -o  "${TARGET_OS}" = "linux-uclibceabi" ]; then
		kernel_configure_variable AEABI y
		if [ "${ARM_KEEP_OABI}" = "1" ] ; then
			kernel_configure_variable OABI_COMPAT y
		else
			kernel_configure_variable OABI_COMPAT n
		fi
	else
		kernel_configure_variable AEABI n
		kernel_configure_variable OABI_COMPAT n
	fi

	# Set cmdline
	kernel_configure_variable CMDLINE "\"${CMDLINE}\""

	# Localversion
	kernel_configure_variable LOCALVERSION "\"\""
	kernel_configure_variable LOCALVERSION_AUTO n

	# Distribution-dependent kernel features
	case "${DISTRO_FEATURES}" in
		*bluetooth*) do_configure_bluetooth
	esac

	# Udev quirks
	# Newer versions of udev mandate that sysfs doesn't have deprecated entries
	if [ "${UDEV_GE_141}" = "1" ] ; then
		kernel_configure_variable SYSFS_DEPRECATED n
		kernel_configure_variable SYSFS_DEPRECATED_V2 n
		kernel_configure_variable HOTPLUG y
		kernel_configure_variable UEVENT_HELPER_PATH "\"\""
		kernel_configure_variable UNIX y
		kernel_configure_variable SYSFS y
		kernel_configure_variable PROC_FS y
		kernel_configure_variable TMPFS y
		kernel_configure_variable INOTIFY_USER y
		kernel_configure_variable SIGNALFD y
		kernel_configure_variable TMPFS_POSIX_ACL y
		kernel_configure_variable BLK_DEV_BSG y
		kernel_configure_variable DEVTMPFS y
		kernel_configure_variable DEVTMPFS_MOUNT y
	fi

	# Newer inits like systemd need cgroup support
	if [ "${KERNEL_ENABLE_CGROUPS}" = "1" ] ; then
		kernel_configure_variable CGROUP_SCHED y
		kernel_configure_variable CGROUPS y
		kernel_configure_variable CGROUP_NS y
		kernel_configure_variable CGROUP_FREEZER y
		kernel_configure_variable CGROUP_DEVICE y
		kernel_configure_variable CPUSETS y
		kernel_configure_variable PROC_PID_CPUSET y
		kernel_configure_variable CGROUP_CPUACCT y
		kernel_configure_variable RESOURCE_COUNTERS y
	fi

	# root-over-nfs-over-usb-eth support. Limited, but should cover some cases
	# Enable this by setting a proper CMDLINE_NFSROOT_USB.
	if [ ! -z "${CMDLINE_NFSROOT_USB}" ]; then
		oenote "Configuring the kernel for root-over-nfs-over-usb-eth with CMDLINE ${CMDLINE_NFSROOT_USB}"
		kernel_configure_variable INET y
		kernel_configure_variable IP_PNP y
		kernel_configure_variable USB_GADGET y
		kernel_configure_variable USB_GADGET_SELECTED y
		kernel_configure_variable USB_ETH y
		kernel_configure_variable NFS_FS y
		kernel_configure_variable ROOT_NFS y
		kernel_configure_variable ROOT_NFS y
		kernel_configure_variable CMDLINE "\"${CMDLINE_NFSROOT_USB}\""
	fi

	# Activate CONFIG_LEGACY_PTYS
	kernel_configure_variable LEGACY_PTYS y
	kernel_configure_variable LEGACY_PTY_COUNT 8

        # needed for ttySC6 login on koelsch with systemd
        kernel_configure_variable FHANDLE y

        # needed for USB touchscreens
        kernel_configure_variable HID_MULTITOUCH y

        # additional configs needed for Genivi compliance
        kernel_configure_variable EXPERIMENTAL y
        kernel_configure_variable ECRYPT_FS y
        kernel_configure_variable QUOTA y
        kernel_configure_variable BT y

        # add uinput for automated testing
        kernel_configure_variable INPUT_MISC y
        kernel_configure_variable INPUT_UINPUT y

	# psplash only
	kernel_configure_variable FRAMEBUFFER_CONSOLE n
	kernel_configure_variable LOGO n

	# systemd requires following
	kernel_configure_variable AUTOFS4_FS y
	kernel_configure_variable IPV6 y
	kernel_configure_variable SCHEDSTATS y

	# AGL spec. mentioned following
	kernel_configure_variable EXT4_FS y
	kernel_configure_variable FANOTIFY y
	kernel_configure_variable POSIX_MQUEUE y
	kernel_configure_variable TUN y

	# For containers support (AGL spec v1.0, section 7.3.1)
	kernel_configure_variable NAMESPACES y
	kernel_configure_variable UTS_NS n
	kernel_configure_variable IPC_NS y
	kernel_configure_variable USER_NS y
	kernel_configure_variable PID_NS y
	kernel_configure_variable NET_NS y

	# nbdroot support
	kernel_configure_variable BLK_DEV_LOOP y
	kernel_configure_variable BLK_DEV_NBD y
	kernel_configure_variable BLK_DEV_INITRD y
	kernel_configure_variable RD_GZIP y
	kernel_configure_variable RD_BZIP2 y
	kernel_configure_variable RD_XZ y
	kernel_configure_variable EXT4_FS y
	kernel_configure_variable EXT4_USE_FOR_EXT23 y
	kernel_configure_variable BLK_DEV_RAM y
	kernel_configure_variable BLK_DEV_RAM_COUNT 2
	kernel_configure_variable BLK_DEV_RAM_SIZE 16384

	# only when distro is built for debug
	if [ "${DISTRO_TYPE}" = "debug" ]; then
		kernel_configure_variable BLK_DEV_LOOP y
	fi

	if [ "x1" = "x${@base_contains("DISTRO_FEATURES", "usbgadget", "1", "",d)}" ]; then
		# activate USB-OTG & Gadget
		kernel_configure_variable USB_OTG y
		kernel_configure_variable USB_RENESAS_USBHS_UDC y
		kernel_configure_variable CONFIGFS_FS y
		kernel_configure_variable USB_GADGET y
		kernel_configure_variable USB_LIBCOMPOSITE y
		kernel_configure_variable USB_F_ACM y
		kernel_configure_variable USB_U_SERIAL y
		kernel_configure_variable USB_ETH m
		kernel_configure_variable USB_G_MULTI m
		kernel_configure_variable USB_G_MULTI_RNDIS n
		kernel_configure_variable USB_G_MULTI_CDC y

		# ethernet over usb tethering
		kernel_configure_variable NETFILTER y
		kernel_configure_variable NF_CONNTRACK_IPV4 y
		kernel_configure_variable NF_NAT_IPV4 y
		kernel_configure_variable BRIDGE y
		kernel_configure_variable IP_NF_TARGET_MASQUERADE y
	fi

	# Keep this the last line
	# Remove all modified configs and add the rest to .config
	sed -e "${CONF_SED_SCRIPT}" < '${WORKDIR}/defconfig' >> '${B}/.config'

	# add cfgs from SRC_URI.
	cfgs="${@" ".join(find_cfgs(d))}"
	cat ${cfgs} >> '${B}/.config'

	yes '' | oe_runmake -C ${S} O=${B} oldconfig
}

do_configure_bluetooth() {
    # Needed for Bluetooth hardware support
    kernel_configure_variable BT_HIDP y
    kernel_configure_variable BT_HCIBTUSB m
    kernel_configure_variable BT_BNEP m
    kernel_configure_variable BT_BNEP_MC_FILTER y
    kernel_configure_variable BT_BNEP_PROTO_FILTER y
    kernel_configure_variable BT_RFCOMM m
    kernel_configure_variable BT_RFCOMM_TTY y
    kernel_configure_variable RFKILL m
}

do_configure_append_porter() {
    # Enable CAN
    kernel_configure_variable CAN y
    kernel_configure_variable CAN_VCAN y
    kernel_configure_variable CAN_RCAR y

    yes '' | oe_runmake -C ${S} O=${B} oldconfig
}

do_configure_append_smack() {
    # Enable Smack
    kernel_configure_variable IP_NF_SECURITY m
    kernel_configure_variable IP6_NF_SECURITY m
    kernel_configure_variable EXT2_FS_SECURITY y
    kernel_configure_variable EXT3_FS_SECURITY y
    kernel_configure_variable EXT4_FS_SECURITY y
    kernel_configure_variable SECURITY y
    kernel_configure_variable SECURITY_SMACK y
    kernel_configure_variable TMPFS_XATTR y

    kernel_configure_variable DEFAULT_SECURITY "smack"
    kernel_configure_variable DEFAULT_SECURITY_SMACK y
    yes '' | oe_runmake -C ${S} O=${B} oldconfig
}

# Automatically depend on lzop-native if CONFIG_KERNEL_LZO is enabled
python () {
    try:
        defconfig = bb.fetch2.localpath('file://defconfig', d)
    except bb.fetch2.FetchError:
        return

    try:
        configfile = open(defconfig)
    except IOError:
        return

    if 'CONFIG_KERNEL_LZO=y\n' in configfile.readlines():
        depends = d.getVar('DEPENDS', False)
        d.setVar('DEPENDS', depends + ' lzop-native')
}