12-kernel-modules-build-environment 851 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
#!/bin/sh

set -e
set -u
set -x

echo "Setting up a build environment for kernel modules"

. /usr/share/amnesia/build/variables

11
12
# Import ensure_hook_dependency_is_installed() and
# install_fake_package()
intrigeri's avatar
intrigeri committed
13
. /usr/local/lib/tails-shell-library/build.sh
14
15
16
17

# Install gcc-6 and fake linux-compiler-gcc-7-x86
# (linux-headers-4.14+ depends on it, but Stretch hasn't GCC 7)
# XXX:Buster: remove this hack.
18
ensure_hook_dependency_is_installed gcc-6
19
20
21
22
23
24
25
26
27
NEWEST_INSTALLED_KERNEL_VERSION="$(
    dpkg-query --showformat '${Version}\n' --show 'linux-image-*-amd64' \
    | sort --version-sort | tail -n1
)"
install_fake_package \
    linux-compiler-gcc-7-x86 \
    "${NEWEST_INSTALLED_KERNEL_VERSION}~0tails1"
ln -s /usr/bin/gcc-6 /usr/bin/gcc-7

28
ensure_hook_dependency_is_installed \
29
    build-essential \
30
    libelf-dev \
31
    "linux-headers-${KERNEL_VERSION}-amd64"