-
Notifications
You must be signed in to change notification settings - Fork 2
/
linux-4.17.4.ebuild
100 lines (82 loc) · 2.29 KB
/
linux-4.17.4.ebuild
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Copyright 1999-2018 Gentoo Foundation
# Author: Mikhail Klementev <[email protected]>
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit eutils
DESCRIPTION="Linux kernel"
HOMEPAGE="https://kernel.org/"
SRC_URI="https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-${PV}.tar.xz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"
IUSE="cryptsetup suid +initramfs +grub"
DEPEND="sys-devel/make
sys-devel/binutils
dev-lang/perl
sys-devel/bc
grub? ( sys-boot/grub )
initramfs? ( sys-kernel/genkernel )"
RDEPEND="${DEPEND}"
ARCH=x86
src_prepare() {
default
echo 'config LOCAL_CONFIG' >> Kconfig
echo -e '\tbool "Local configuration"' >> Kconfig
echo -e '\tdefault y' >> Kconfig
if use cryptsetup; then
echo -e '\tselect DM_CRYPT' >> Kconfig
echo -e '\tselect CRYPTO_USER_API_SKCIPHER' >> Kconfig
cat /proc/cpuinfo | grep aes >/dev/null && {
echo -e '\tselect CRYPTO_AES_NI_INTEL' >> Kconfig
}
fi
if use suid; then
echo -e '\tselect USER_NS' >> Kconfig
fi
# make.conf:
# # qemu
# KCONFIG="$KCONFIG KVM KVM_INTEL"
# # ethernet
# KCONFIG="$KCONFIG ALX"
# # wireless card
# KCONFIG="$KCONFIG ATH_CARDS ATH9K CFG80211_WEXT"
# # openvpn
# KCONFIG="$KCONFIG TUN"
# # audio
# ...
for i in $KCONFIG; do
echo -e "\tselect $i" >> Kconfig
done
# /etc/linux/Kconfig
# config INTEL_NUC_7I7DN
# bool "Intel NUC 7i7DN"
# default y
#
# select BLABLABLA
# ...
if [ -e /etc/linux/Kconfig ]; then
echo 'source "/etc/linux/Kconfig"' >> Kconfig
fi
make defconfig 2>&1 | grep warning && die "Broken config"
}
src_install() {
mkdir -p ./boot
make install INSTALL_PATH=./boot
insinto /usr/share/linux-${PV}/
ls ./boot | while read file; do
doins ./boot/${file}
done
}
pkg_postinst() {
# Hack for leave all kernel files after unmerge, to be able to boot old kernel
cp /usr/share/linux-${PV}/* /boot/
if use initramfs; then
if use cryptsetup; then
GENKERNEL_ARGS=--luks
fi
genkernel ${GENKERNEL_ARGS} initramfs --kerneldir=${S}
fi
if use grub; then
grub-mkconfig -o /boot/grub/grub.cfg
fi
}