aboutsummaryrefslogtreecommitdiff
blob: ddb8a24fb70248883731032e5a1b915778042e8c (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Copyright 2021-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

KERNEL_VERSION=$(ver_cut 1-3)
KERNEL_TRUNK=$(ver_cut 1-2)
UEK_PATCH_VERSION=$(ver_cut 4-6)
UEK_VERSION="${KERNEL_VERSION}-${UEK_PATCH_VERSION}"

ETYPE="sources"

K_GENPATCHES_VER="143"
K_SECURITY_UNSUPPORTED="1"
CKV="${KERNEL_VERSION}_p${UEK_PATCH_VERSION}"

inherit kernel-2
detect_version
detect_arch

DESCRIPTION="Unbreakable Enterprise Kernel (UEK) sources built from Oracle"
HOMEPAGE="https://github.com/oracle/linux-uek"
SRC_URI="
	https://github.com/oracle/linux-uek/archive/refs/tags/v${UEK_VERSION}.tar.gz
		-> linux-uek-${UEK_VERSION}.tar.gz
	mirror://gentoo/genpatches-${KERNEL_TRUNK}-${K_GENPATCHES_VER}.base.tar.xz
	mirror://gentoo/genpatches-${KERNEL_TRUNK}-${K_GENPATCHES_VER}.experimental.tar.xz
	mirror://gentoo/genpatches-${KERNEL_TRUNK}-${K_GENPATCHES_VER}.extras.tar.xz
"
S="${WORKDIR}/linux-uek-${UEK_VERSION}"

LICENSE="GPL-2"
KEYWORDS="~amd64"
IUSE="+gentoo experimental"

PATCHES=(
	"${FILESDIR}"/uek-sources-5.4.17.2136.303.2-O3.patch
)

src_unpack() {
	default

	# remove all backup files
	find . -iname "*~" -print -exec rm {} \; 2>/dev/null

	unpack_set_extraversion
	unpack_fix_install_path

	env_setup_xmakeopts
}

src_prepare() {
	use gentoo && PATCHES+=(
		"${WORKDIR}"/1500_XATTR_USER_PREFIX.patch
		"${WORKDIR}"/1510_fs-enable-link-security-restrictions-by-default.patch
		"${WORKDIR}"/2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch
		"${WORKDIR}"/2920_sign-file-patch-for-libressl.patch
		"${WORKDIR}"/3000_Support-printing-firmware-info.patch
		"${WORKDIR}"/4567_distro-Gentoo-Kconfig.patch
	)
	use experimental && PATCHES+=(
		"${WORKDIR}"/5010_enable-cpu-optimizations-universal.patch
	)
	default
}