summaryrefslogtreecommitdiff
path: root/system/easy-kernel/APKBUILD
blob: f184f9ab5a5baa838299181479a0c9d3d73bd9c7 (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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: Adelie Platform Group <adelie-devel@lists.adelielinux.org>
# KEEP THIS IN SYNC with the other easy-kernel packages.
_kflavour=""
_patchver=0  # must match 1000-version.patch
_pkgname=easy-kernel$_kflavour
pkgver=6.1.3
pkgrel=0
pkgname=$_pkgname-$pkgver-mc$_patchver
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="kernel-boot"
makedepends="bc bison flex gzip kmod lzop openssl-dev xz"
provides="easy-kernel$_kflavour=$pkgver-r$pkgrel"
replaces="easy-kernel-power8 easy-kernel-power8-64k"
subpackages="$_pkgname-modules-$pkgver-mc$_patchver:modules
	$_pkgname-src-$pkgver-mc$_patchver:src
	linux-headers:headers"
_pkgmajver=${pkgver%%.*}
_pkgminver=${pkgver%.*}
source="https://cdn.kernel.org/pub/linux/kernel/v${_pkgmajver}.x/linux-${_pkgminver}.tar.xz
	config-aarch64
	config-armv7
	config-m68k
	config-pmmx
	config-ppc
	config-ppc64
	config-sparc64
	config-x86_64
	kernel.h

	0100-linux-6.1.3.patch
	0120-XATTR_USER_PREFIX.patch
	0122-link-security-restrictions.patch
	0124-bluetooth-keysize-check.patch
	0126-sign-file-libressl.patch
	0200-x86-compile.patch
	0260-reduce-swappiness.patch
	0300-tmp513-regression-fix.patch
	0500-print-fw-info.patch
	0502-gcc9-kcflags.patch
	1000-version.patch

	no-require-gnu-tar.patch
	no-require-lilo.patch

	no-autoload-fb.conf

	mkimage-missing-not-fatal.patch
	"
builddir="$srcdir/linux-${_pkgminver}"

prepare() {
	default_prepare

	cd "$srcdir"
	cp config-$CARCH linux-${_pkgminver}/.config
	cp -pr linux-${_pkgminver} linux-src
	if [ -f $HOME/kernel_key.pem ]; then
		cp $HOME/kernel_key.pem "$builddir"/certs/signing_key.pem
	fi
}

build() {
	make LDFLAGS=""

	cd "$srcdir/linux-src"
	make LDFLAGS="" modules_prepare clean
	cp "$builddir/Module.symvers" .

	# Kernel bug: crtsavres.o is required to build modules, but modules_prepare doesn't create it.
	if [ $CARCH = ppc ]; then
		cp "$builddir/arch/powerpc/lib/crtsavres.o" arch/powerpc/lib/
	fi
}

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 \
			"$pkgdir"/boot/vmlinuz-$pkgver-mc$_patchver-easy$_kflavour
	fi
	if [ -f "$pkgdir"/boot/vmlinux ]; then
		mv "$pkgdir"/boot/vmlinux \
			"$pkgdir"/boot/vmlinux-$pkgver-mc$_patchver-easy$_kflavour
	fi

	if [ -f "$pkgdir"/boot/System.map ]; then
		mv "$pkgdir"/boot/System.map \
			"$pkgdir"/boot/System.map-$pkgver-mc$_patchver-easy$_kflavour
	fi

	case $CARCH in
	aarch64|arm*)	make INSTALL_PATH="$pkgdir"/boot dtbs_install ;;
	esac

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

modules() {
	pkgdesc="Modules / device drivers for easy-kernel"
	provides="easy-kernel$_kflavour-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$_patchver-easy$_kflavour/build
	rm "$subpkgdir"/lib/modules/$pkgver-mc$_patchver-easy$_kflavour/source
	ln -s "../../../usr/src/linux-$pkgver-mc$_patchver$_kflavour" \
		"$subpkgdir"/lib/modules/$pkgver-mc$_patchver-easy$_kflavour/build
	ln -s "../../../usr/src/linux-$pkgver-mc$_patchver$_kflavour" \
		"$subpkgdir"/lib/modules/$pkgver-mc$_patchver-easy$_kflavour/source

	mkdir -p "$subpkgdir"/etc/modprobe.d
	install -m644 "$srcdir"/no-autoload-fb.conf \
		"$subpkgdir"/etc/modprobe.d/no-autoload-fb.conf
}

headers() {
	pkgdesc="System headers provided by the Linux kernel"

	mkdir -p "$subpkgdir"/usr
	make -C "$builddir" headers
	find "$builddir"/usr/include -name '.*' -delete
	rm "$builddir"/usr/include/Makefile
	cp -rv "$builddir"/usr/include "$subpkgdir/usr"

	find "$subpkgdir/usr" \( -name .install -o -name ..install.cmd \) -exec \
		rm -f {} \;

	# provided by libdrm
	rm -rf "$subpkgdir"/usr/include/drm

	# needed for spl, VMware on x86, etc
	install -D -m644 "$builddir"/include/generated/utsrelease.h \
		"$subpkgdir"/usr/include/linux/utsrelease.h

	install -m644 "$srcdir"/kernel.h "$subpkgdir"/usr/include/linux/kernel.h
}

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$_patchver$_kflavour
}

sha512sums="6ed2a73c2699d0810e54753715635736fc370288ad5ce95c594f2379959b0e418665cd71bc512a0273fe226fe90074d8b10d14c209080a6466498417a4fdda68  linux-6.1.tar.xz
e1b496c86bab54401fbb98e26bdfcd7eb482e35a2d4c85fc9da964dbe7f3f54fb72d76b46f17af920f5f21f66cc5d9b32f794a32ba15fabcbfd5b74d3afad0d8  config-aarch64
9f5279d20fc6eaad78ab27b7fb86553e310369c8a68a2ff60c7cd9895febd3002cae748ad3a8b4fddbb62c6e829104138fc2bbca939e1c88c0bfcf7aa42809bf  config-armv7
d87b8052b5180e5a2ebfe248fae9917afad3aec4c156836106238368e7f990f9ac5e5f6fa4251cd240c3726bfb8bdab91467902d1ddf65305049a2e74ce2ba02  config-m68k
4f585e36cc0f4a8ec47a131f15fc25c2e36e42a2ec00ddbb8b2460ba136c63d70bd1d435b418ac23b5df75a51cb3d05a5e3e174c85aad5261f0d0d73f6353b30  config-pmmx
9a0010921060d791df9f492c37f6e607da27a060587393b308cc3da1acc3ca516917f023e5b649b3fa90792963a0edad1e703f880721cafe37d718b90ccd1cd0  config-ppc
c6b7f7cb0c6a155465b2db849187a95ff1a31dd157699019a3f3f44e522c62c6e6ec29532b1b1b0c508142e32200a5611e3be3d44d6ea750883808ac6578401c  config-ppc64
e0c859b385140a390ef696a6c26ff28843282d0a0d57cabb50b0d8da66bbb17c37ee5733010d57bd58c6eac5f4e1eb4accf33216d8638115d376f0a431803f78  config-sparc64
d02dad2531c13ccb8dc9b0bdb31943ba12b374f559b6c0ffaac7cf7d3b809e35b83df705758ce1ea223611ffe6f399295a06286e6ad9033ae8b861ad4933f049  config-x86_64
1ca1bc094a8106b33176ab6cfb55c9514e7d69f1ed30c580eee419a3c422a2e6625d71c4581702e911f36c4bbac175010f46b7123bb81fda3303d4decdc57287  kernel.h
09685671e002ccd3787d6b1690f7066641d666c10d28d55fdab0eb1a52bd4607074d7c7397f727a1a5dde4cd431906d854fc0ffbef3b8d02fa419abcd99c54ab  0100-linux-6.1.3.patch
489dd3e2f2991526043b91614cc2ebf626f809e0981cbb6569d7b201586be019fbc3e8587925de7a22bac5511f4d472a6bc216878eb9f0c20baa9e7fca2f2073  0120-XATTR_USER_PREFIX.patch
d333494e1a261175ab11d84ace49ad3dcb010614e61d0bfe1d39d7c330d1c0e0311699423fbec5841c9c6ff514f4f5b1e63072f0289450ac2883f1d3a80c2961  0122-link-security-restrictions.patch
dc47b18749d95a456f8bc47fd6a0618c286b646b38466c3d950dfbeb25adf3fc1a794e95552e4da1abb58e49f0bd841f7222e71c4d04cb0264ca23476ca9caef  0124-bluetooth-keysize-check.patch
79eaf814d76402a445efc961666a7c7c74207e552b0cb32d93d5cb828da580f7dbe93509dc9f53321c7844663205a8dce4e518ba047e4c57fc55f5c3498088ec  0126-sign-file-libressl.patch
8ee913a4187740457a2de64708edf757666c6a8a7f8ef30aaa8eee22290a30fa5d636d10de1fad334a30b4acdb733ffe556fb046d5d1769bde3b4e85906189d5  0200-x86-compile.patch
5f74e6a72876d3cf3b3188a43b999b981b6ea0ca401ad72b3c7d5cc65bf505f50e7ee17d435ec95b7a012dc92e6540aea1bdb501f48690c242705c47d2403513  0260-reduce-swappiness.patch
4e637935c2f37cc18f347293e3c94b18f90e2caccca726304a95c4891257a5b2bb3093aee7a97571038b29c0c987cc60a9a80aefd0d4c9a063b33d102f03579e  0300-tmp513-regression-fix.patch
8ddac562bd16fd96aea4b5165cf4a93eaee49011805c5d648913cea6865a1415c61aed5a34bfc319e4cd394dbaebad1360a6e07dab6e02b6b425a0e414107984  0500-print-fw-info.patch
acadf608e1546761388b41a632eff08b57ab4aba6daf62e3d7f48a07515e3cd7be7ea66032c9785b06c86b31e018c70df6b0d6dfc77cfd13bd7f64bd020f9218  0502-gcc9-kcflags.patch
44eea23f3911764bead8ec1e038acf237fa84c75892391bf96197c866a0b2f1dd2d648fce5b206788937e47885353f3f33c7bdaae0b3ab02ab14fc44b4a0e604  1000-version.patch
03a73db9eda84a52315499cb511f730946939d2de1b3aa52c60f9bd3a364377a65ddf2b62f505689a84d3e2f0fc7da5ca90429629d93d9909360ee0c3c599bbe  no-require-gnu-tar.patch
aadf8a3cc46a08e3a396ebd45656aee235103db7a2155cc6980df20b750151a9938b8b73c9319c6cd1b5f8aba6ce707f857a47dabf69df8d91dd93d440cffcb5  no-require-lilo.patch
7bb07eb22002cc48caf0cd55d17ce4097aa583e0ca4048c11c92e1519761b2ae982ffe98311543d4b0dfc991c8bc411b2e1c7be9488b6c6f19ffaa08e69e2f47  no-autoload-fb.conf
b0e0634c84440a480be208da5157b03cb914790faab08fd3fdc2faeceed2c0a03d52c0e029084190708190f80028648923c4fd6feb11ec68ab4f740488161b0a  mkimage-missing-not-fatal.patch"