summaryrefslogtreecommitdiff
path: root/testsuite/mkosi/mkosi.build
blob: a6b325f55e7a626c2d7911299071f4faf3d90b87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash -ex

if [ -f configure ]; then
    make distclean
fi

rm -rf build
mkdir build
cd build

kdirs=(/usr/lib/modules/*/build/Makefile)
if [[ ! -f ${kdirs[0]} ]]; then
  printf '==> Unable to find kernel headers to build modules for tests\n' >&2
  return 1
fi

kdir=${kdirs[0]%/Makefile}
IFS=/ read _ _ _ kver _ <<<"$kdir"

../autogen.sh c
make -j
make check KDIR="$kdir" KVER="$kver"
make install