-
Notifications
You must be signed in to change notification settings - Fork 8
/
build-kernel-headers.sh
executable file
·60 lines (53 loc) · 1.02 KB
/
build-kernel-headers.sh
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
#!/bin/bash -e
#
# Copyright 2016 (c) Yousong Zhou
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
. "$PWD/utils-toolchain.sh"
toolchain_init_pkg linux
PKG_NAME=kernel-headers
PKG_PLATFORM=linux
. "$PWD/env.sh"
toolchain_init_vars_build_cross "$PKG_NAME"
configure() {
true
}
compile() {
true
}
staging() {
local arch
case "$TRI_ARCH" in
arm|armeb)
arch=arm
;;
aarch64|aarch64_be)
arch=arm64
;;
mips|mipsel|mips64|mips64el)
arch=mips
;;
i686|x86_64)
arch=x86
;;
riscv32|riscv64)
arch=riscv
;;
*)
__errmsg "unknown TRI_ARCH: $TRI_ARCH"
return 1
esac
# it is said that INSTALL_HDR_PATH will be cleaned up when making
# headers_install, so the staging step here is actually required
cd "$PKG_SOURCE_DIR"
"${MAKEJ[@]}" \
ARCH="$arch" \
INSTALL_HDR_PATH="$PKG_STAGING_DIR$INSTALL_PREFIX" \
headers_install
}
install() {
mkdir -p "$TOOLCHAIN_DIR"
cpdir "$PKG_STAGING_DIR$INSTALL_PREFIX" "$TOOLCHAIN_DIR"
}