This repository has been archived by the owner on May 30, 2023. It is now read-only.
/
coreos-modules-5.3.11.ebuild
65 lines (54 loc) · 2 KB
/
coreos-modules-5.3.11.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
# Copyright 2014-2016 CoreOS, Inc.
# Distributed under the terms of the GNU General Public License v2
EAPI=5
COREOS_SOURCE_REVISION=""
inherit coreos-kernel savedconfig
DESCRIPTION="CoreOS Linux kernel modules"
KEYWORDS="amd64 arm64"
RDEPEND="!<sys-kernel/coreos-kernel-4.6.3-r1"
src_prepare() {
restore_config build/.config
if [[ ! -f build/.config ]]; then
local archconfig="$(find_archconfig)"
local commonconfig="$(find_commonconfig)"
elog "Building using config ${archconfig} and ${commonconfig}"
cat "${archconfig}" "${commonconfig}" >> build/.config || die
fi
# Check that an old pre-ebuild-split config didn't leak in.
grep -q "^CONFIG_INITRAMFS_SOURCE=" build/.config && \
die "CONFIG_INITRAMFS_SOURCE must be removed from kernel config"
}
src_compile() {
# Generate module signing key
setup_keys
# Build both vmlinux and modules (moddep checks symbols in vmlinux)
kmake vmlinux modules
}
src_install() {
# Install modules to /usr, assuming USE=symlink-usr
# Install firmware to a temporary (bogus) location.
# The linux-firmware package will be used instead.
# Stripping must be done here, not portage, to preserve sigs.
kmake INSTALL_MOD_PATH="${D}/usr" \
INSTALL_MOD_STRIP="--strip-unneeded" \
INSTALL_FW_PATH="${T}/fw" \
modules_install
# Install to /usr/lib/debug with debug symbols intact
kmake INSTALL_MOD_PATH="${D}/usr/lib/debug/usr" \
INSTALL_FW_PATH="${T}/fw" \
modules_install
rm "${D}/usr/lib/debug/usr/lib/modules/${KV_FULL}/"modules.* || die
rm "${D}/usr/lib/debug/usr/lib/modules/${KV_FULL}/"{source,build} || die
# Clean up the build tree
shred_keys
kmake clean
find "build/" -type d -empty -delete || die
rm "build/.config.old" || die
# Install /lib/modules/${KV_FULL}/{build,source}
install_build_source
# Not strictly required but this is where we used to install the config.
dodir "/usr/boot"
local build="lib/modules/${KV_FULL}/build"
dosym "../${build}/.config" "/usr/boot/config-${KV_FULL}"
dosym "../${build}/.config" "/usr/boot/config"
}