APKBUILD 3.4 KB
Newer Older
1
2
# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: Adelie Platform Group <adelie-devel@lists.adelielinux.org>
3
4
5
# KEEP THIS IN SYNC with the other easy-kernel packages.
_kflavour=-power8-64k
_pkgname=easy-kernel$_kflavour
6
7
pkgver=4.14.138
pkgrel=15
8
9
10
11
12
13
14
pkgname=$_pkgname-$pkgver-mc$pkgrel
pkgdesc="The Linux kernel, packaged for POWER8 and POWER9 computers (with 64K page size)"
url="https://kernel.org/"
arch="ppc64"
options="!check !dbg !strip !tracedeps"
license="GPL-2.0-only"
depends=""
15
16
17
18
19
20
21
22
makedepends="bc gzip kmod lzop openssl-dev xz"
provides="easy-kernel$_kflavour=$pkgver-r$pkgrel"
subpackages="$_pkgname-modules-$pkgver-mc$pkgrel:modules
	$_pkgname-src-$pkgver-mc$pkgrel:src
	"
_pkgmajver=${pkgver%%.*}
_pkgminver=${pkgver%.*}
source="https://cdn.kernel.org/pub/linux/kernel/v${_pkgmajver}.x/linux-${_pkgminver}.tar.xz
23
	https://distfiles.adelielinux.org/source/linux-${_pkgminver}-mc$pkgrel-patches.tar.xz
24
25
26
	ast-endianness.patch
	config-ppc64
	"
27
builddir="$srcdir/linux-${_pkgminver}"
28
29

prepare() {
30
31
32
	for patch in "$srcdir/linux-${_pkgminver}-mc$pkgrel-patches"/*; do
		patch -p1 -i "$patch"
	done
33
	default_prepare
34

35
	cd "$srcdir"
36
37
	cp config-$CARCH linux-${_pkgminver}/.config
	cp -pr linux-${_pkgminver} linux-src
38
39
40
41
}

build() {
	make LDFLAGS=""
42
43
44
45

	cd "$srcdir/linux-src"
	make LDFLAGS="" modules_prepare clean
	cp "$builddir/Module.symvers" .
46
47
48
49
50
51
52
53
54
55
}

package() {
	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 \
56
			"$pkgdir"/boot/vmlinuz-$pkgver-mc$pkgrel-easy$_kflavour
57
58
59
	fi
	if [ -f "$pkgdir"/boot/vmlinux ]; then
		mv "$pkgdir"/boot/vmlinux \
60
			"$pkgdir"/boot/vmlinux-$pkgver-mc$pkgrel-easy$_kflavour
61
62
	fi

63
	mv "$pkgdir"/boot/System.map "$pkgdir"/boot/System.map-$pkgver-mc$pkgrel-easy$_kflavour
64
65

	install -D "$builddir"/include/config/kernel.release \
66
		"$pkgdir"/usr/share/kernel/easy-$pkgver-mc$pkgrel$_kflavour/kernel.release
67
68
69
70
}

modules() {
	pkgdesc="Modules / device drivers for easy-kernel"
71
	provides="easy-kernel$_kflavour-modules=$pkgver-r$pkgrel"
72
73
74
	autodeps=0  # modules should not depend on src just for symlink
	mkdir -p "$subpkgdir"/lib
	mv "$pkgdir"/lib/modules "$subpkgdir"/lib/
75
76
77
78
79
80
81
82
83
84
85
86
87
	rm "$subpkgdir"/lib/modules/$pkgver-mc$pkgrel-easy$_kflavour/build
	rm "$subpkgdir"/lib/modules/$pkgver-mc$pkgrel-easy$_kflavour/source
	ln -s "../../../usr/src/linux-$pkgver-mc$pkgrel$_kflavour" \
		"$subpkgdir"/lib/modules/$pkgver-mc$pkgrel-easy$_kflavour/build
	ln -s "../../../usr/src/linux-$pkgver-mc$pkgrel$_kflavour" \
		"$subpkgdir"/lib/modules/$pkgver-mc$pkgrel-easy$_kflavour/source
}

src() {
	pkgdesc="Kernel source code used to build the kernel"
	provides="easy-kernel$_kflavour-src=$pkgver-r$pkgrel"
	mkdir -p "$subpkgdir"/usr/src
	mv "$srcdir"/linux-src "$subpkgdir"/usr/src/linux-$pkgver-mc$pkgrel$_kflavour
88
89
90
}

sha512sums="77e43a02d766c3d73b7e25c4aafb2e931d6b16e870510c22cef0cdb05c3acb7952b8908ebad12b10ef982c6efbe286364b1544586e715cf38390e483927904d8  linux-4.14.tar.xz
91
f81ad5ed82bc1141b97be22c3767d3c1984bed50ff847f3596609bdece05a70ba8e73fb7d5aa3163898b7e77c8b5eb4d8be4f2e9f84f17579f8b70c96f465317  linux-4.14-mc15-patches.tar.xz
92
e41d9111219342ad13367902242444ecdd847a93575c3f9709d6c6a075bc650f4a15be9db1a8798435fc0a0b56d41705829bfe0d2c2d88f8d1c28931e27ef5be  ast-endianness.patch
93
b4f8d49567243ea97731d031b1850d8b764177597c14a4ec56af0235c1cc5d69a336985db89fc941ea3b9c8ba3eac7ef63f4c7370a945f7b8fab3ba0c0f140aa  config-ppc64"