blob: a2fb640fc5e2c63f66f9a38e6bfee79dd72effce (
plain)
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
|
# Maintainer: Vladimir Stoiakin <VStoiakin at lavabit dot com>
pkgbase=linux-librem5
pkgname=(
"$pkgbase"
"$pkgbase-docs"
)
pkgver=6.6.40
pkgrel=1
pkgdesc='The Linux kernel for Purism Librem 5'
url='https://source.puri.sm/Librem5/linux'
arch=('aarch64')
license=(GPL-2.0-only)
makedepends=(
bc
cpio
gettext
libelf
pahole
perl
python
tar
xz
# htmldocs
graphviz
imagemagick
python-sphinx
python-yaml
texlive-latexextra
)
options=(
!debug
!strip
)
_purismver=6.6.40pureos2
source=(https://source.puri.sm/Librem5/linux/-/archive/pureos/$_purismver/linux-pureos-$_purismver.tar.gz)
sha256sums=('197f61667610c8bb426b1792fc97f21305e2eaf3328595a3dff61e19753f7b17')
b2sums=('a6de14451e88cabd62ce1a90f3aaa217b11c3b8cdfa6bb155f2cbededf3a20c7d0a2ad89b67dcb4acb396624f351642d426ec0924c24ab52dbedc6642b7aa7f5')
export ARCH=arm64
export KBUILD_BUILD_HOST=archlinux
export KBUILD_BUILD_USER=$pkgbase
if [[ $(uname -m) != 'aarch64' ]]; then
makedepends+=( aarch64-linux-gnu-gcc )
export CARCH=aarch64
export CROSS_COMPILE=aarch64-linux-gnu-
fi
export KCFLAGS="-mtune=cortex-a53"
prepare() {
cd linux-pureos-$_purismver
echo "Setting version..."
echo "-$pkgrel" > localversion.10-pkgrel
echo "Setting config..."
make librem5_defconfig
make -s kernelrelease > version
echo "Prepared $pkgbase version $(<version)"
}
build() {
cd linux-pureos-$_purismver
make all
make htmldocs
}
package_linux-librem5() {
depends=(
coreutils
initramfs
kmod
)
optdepends=(
'wireless-regdb: to set the correct wireless channels of your country'
'linux-firmware: firmware images needed for some devices'
)
cd linux-pureos-$_purismver
local modulesdir="$pkgdir/usr/lib/modules/$(<version)"
echo "Installing boot image..."
# systemd expects to find the kernel here to allow hibernation
# https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344
install -Dm644 "$(make -s image_name)" "$modulesdir/vmlinuz"
# Used by mkinitcpio to name the kernel
echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase"
echo "Installing modules..."
ZSTD_CLEVEL=19 make INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 \
DEPMOD=/doesnt/exist modules_install # Suppress depmod
echo "Installing DTBs..."
install -Dm644 -t "$pkgdir/boot" "arch/arm64/boot/dts/freescale/imx8mq-librem5-r"*".dtb"
# remove build link
rm "$modulesdir"/build
}
package_linux-librem5-docs() {
pkgdesc="$pkgdesc (documentation)"
cd linux-pureos-$_purismver
local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
echo "Installing documentation..."
local src dst
while read -rd '' src; do
dst="${src#Documentation/}"
dst="$builddir/Documentation/${dst#output/}"
install -Dm644 "$src" "$dst"
done < <(find Documentation -name '.*' -prune -o ! -type d -print0)
echo "Adding symlink..."
mkdir -p "$pkgdir/usr/share/doc"
ln -sr "$builddir/Documentation" "$pkgdir/usr/share/doc/$pkgbase"
}
|