diff options
author | Jonathan Bauer | 2018-05-07 14:36:59 +0200 |
---|---|---|
committer | Jonathan Bauer | 2018-05-07 14:36:59 +0200 |
commit | 407299a9a2bada76edb4d97e2398a2305f015a61 (patch) | |
tree | 69972d729c470e064acd8e8c161e78ae0f7e266b | |
parent | support patches for submodules (diff) | |
download | systemd-init-407299a9a2bada76edb4d97e2398a2305f015a61.tar.gz systemd-init-407299a9a2bada76edb4d97e2398a2305f015a61.tar.xz systemd-init-407299a9a2bada76edb4d97e2398a2305f015a61.zip |
[dnbd3-rootfs] add support for configurable kernel
... version to compile dnbd3 against different kernel then the one
running. Note, this uses the dracut's internal variable storing the
kernel version (specifically '--kver'). This value will be passed to
buid_compile_dnbd3 per environment and injected when calling cmake.
-rwxr-xr-x | builder/modules.d/dnbd3-rootfs/module-setup.sh | 3 | ||||
-rw-r--r-- | builder/modules.d/dnbd3-rootfs/scripts/build.sh | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/builder/modules.d/dnbd3-rootfs/module-setup.sh b/builder/modules.d/dnbd3-rootfs/module-setup.sh index 715161bc..759cd476 100755 --- a/builder/modules.d/dnbd3-rootfs/module-setup.sh +++ b/builder/modules.d/dnbd3-rootfs/module-setup.sh @@ -113,7 +113,8 @@ check() { if [[ ! -f "$moddir/binaries/dnbd3/build/dnbd3.ko" ]] || \ [[ ! -f "$moddir/binaries/dnbd3/build/dnbd3-client" ]] then - build_compile_dnbd3 "$moddir/binaries/dnbd3/" + CMAKE_FLAGS="-DKERNEL_VERSION=${kernel}" \ + build_compile_dnbd3 "$moddir/binaries/dnbd3/" [[ $? != 0 ]] && return 1 fi if [[ ! -f "$moddir/binaries/systemd-preserve-process-marker/systemd-preserve-process-marker" ]]; then diff --git a/builder/modules.d/dnbd3-rootfs/scripts/build.sh b/builder/modules.d/dnbd3-rootfs/scripts/build.sh index 47e5dcc7..4df163df 100644 --- a/builder/modules.d/dnbd3-rootfs/scripts/build.sh +++ b/builder/modules.d/dnbd3-rootfs/scripts/build.sh @@ -81,13 +81,19 @@ build_compile_dnbd3() { Examples: `build_compile_dnbd3 path/to/dnbd3/source/` + + Passing the kernel version to cmake: + `CMAKE_FLAGS="-DKERNEL_VERSION=4.14.6-openslx+" \ + build_compile_dnbd3 path/to/dnbd3/source/` ' pushd "$1" # NOTE: The generic way would be: "./build.sh" but this tries to build # more than we really need and takes more time. mkdir --parents build pushd build - cmake ../ + # Inject CMAKE_FLAGS as a way to control how cmake is called, + # e.g. to pass the kernel version + cmake ${CMAKE_FLAGS} ../ make -j4 dnbd3 dnbd3-client popd return $? |