summaryrefslogtreecommitdiff
path: root/system/easy-kernel/APKBUILD
blob: 63c8ddd06c05bea016f634bfc93a4d47ad8a2414 (plain) (blame)
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
# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: Adelie Platform Group <adelie-devel@lists.adelielinux.org>
_pkgname=easy-kernel
pkgver=4.14.48
pkgrel=8
pkgname=$_pkgname-$pkgver-mc$pkgrel
pkgdesc="The Linux kernel, packaged for your convenience"
url="https://kernel.org/"
arch="all"
options="!check !dbg !strip !tracedeps"
license="GPL-2.0-only"
depends=""
makedepends="bc gzip lzop openssl-dev xz"
install=""
provides="easy-kernel=$pkgver-r$pkgrel"
subpackages="$_pkgname-modules-$pkgver-mc$pkgrel:modules
	$_pkgname-src-$pkgver-mc$pkgrel:src"
source="https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.14.tar.xz
	https://distfiles.adelielinux.org/source/linux-4.14-mc$pkgrel.patch.xz
	ast-endianness.patch
	config-ppc64
	config-ppc
	config-x86_64
	config-pmmx
	config-aarch64"
builddir="$srcdir/linux-4.14"

prepare() {
	default_prepare
	cd "$srcdir"
	cat linux-4.14-mc$pkgrel.patch.xz | unxz -> linux-4.14-mc$pkgrel.patch
	cd "$builddir"
	patch -Np1 <../linux-4.14-mc$pkgrel.patch
	cd "$srcdir"
	cp config-$CARCH linux-4.14/.config
	cp -pr linux-4.14 linux-src
}

build() {
	cd "$builddir"
	make LDFLAGS=""
}

package() {
	cd "$builddir"
	mkdir -p "$pkgdir"/boot
	make INSTALL_PATH="$pkgdir"/boot \
		INSTALL_MOD_PATH="$pkgdir" \
		install modules_install

	if [ -f "$pkgdir"/boot/vmlinuz ]; then
		mv "$pkgdir"/boot/vmlinuz \
			"$pkgdir"/boot/vmlinuz-$pkgver-mc$pkgrel-easy
	fi
	if [ -f "$pkgdir"/boot/vmlinux ]; then
		mv "$pkgdir"/boot/vmlinux \
			"$pkgdir"/boot/vmlinux-$pkgver-mc$pkgrel-easy
	fi

	install -D "$builddir"/include/config/kernel.release \
		"$pkgdir"/usr/share/kernel/easy-$pkgver-mc$pkgrel/kernel.release
}

modules() {
	pkgdesc="Modules / device drivers for easy-kernel"
	provides="easy-kernel-modules=$pkgver-r$pkgrel"
	autodeps=0  # modules should not depend on src just for symlink
	mkdir -p "$subpkgdir"/lib
	mv "$pkgdir"/lib/modules "$subpkgdir"/lib/
	rm "$subpkgdir"/lib/modules/$pkgver-mc$pkgrel-easy/build
	rm "$subpkgdir"/lib/modules/$pkgver-mc$pkgrel-easy/source
	ln -s "../../../usr/src/linux-$pkgver-mc$pkgrel" \
		"$subpkgdir"/lib/modules/$pkgver-mc$pkgrel-easy/build
	ln -s "../../../usr/src/linux-$pkgver-mc$pkgrel" \
		"$subpkgdir"/lib/modules/$pkgver-mc$pkgrel-easy/source
}

src() {
	pkgdesc="Kernel source code used to build the kernel"
	provides="easy-kernel-src=$pkgver-r$pkgrel"
	mkdir -p "$subpkgdir"/usr/src
	mv "$srcdir"/linux-src "$subpkgdir"/usr/src/linux-$pkgver-mc$pkgrel
}
sha512sums="77e43a02d766c3d73b7e25c4aafb2e931d6b16e870510c22cef0cdb05c3acb7952b8908ebad12b10ef982c6efbe286364b1544586e715cf38390e483927904d8  linux-4.14.tar.xz
3fe2da1714cc83d909ba43d27c7f22ef4f2a6ecfd91ff81e0e141a0dd742ec78ad11392186871762f410615ae7c7f33dd814e0f194c7f7aed1dee2d9fca0252d  linux-4.14-mc8.patch.xz
e41d9111219342ad13367902242444ecdd847a93575c3f9709d6c6a075bc650f4a15be9db1a8798435fc0a0b56d41705829bfe0d2c2d88f8d1c28931e27ef5be  ast-endianness.patch
160eb4d85e33bd7e6cdaf73d2d604abbf3cdc3f3c7268aac55790cba792d2518769b85da5f44fcf75b3a9c8488466be7aabea93b934352234ec5b9ee6c76d17b  config-ppc64
419dd30c2d2592293e7b6889a397784fed84a1f686c0d2d262177be98bcb022a9eab4f77c930866fbc8651fcec0a06a12fb796b85591b28f0b9852904347e44a  config-ppc
438a66561200d570b3bf6ab0481d9725a9f482b1fcf852a90f99c6db5aa4ee02d2b67b57235bb7afc01515a79289407cbe111536340824d7a391ce1a658c9a76  config-x86_64
e8f7749877c5b2574e7e853b757477b8f99d757b43225d4f83d611c20215b8b2690cc85369608c2dc8f7d6a619136a2d7dde4648031e37d2ae4dcc5ba85652c8  config-pmmx
0174e758ea318171c8036426ed0ad22aaafbdbac755732a46397686ec8dd24e977447f6fc275d59eed43ea047fc8a36061b7ad0d5862d522222455a60c943027  config-aarch64"