Used for collecting hardware metrics that aren’t accessible through the regular Windows APIs, such as per-core CPU temperatures.
This is kept as a separate repository as it is versioned independently from the main Netdata Agent code due to code signing complexities for drivers.
This repository builds the Windows kernel driver as netdata_driver.sys, stages netdata_driver.inf, and generates netdata_driver.cat for the driver package.
- Build on Windows using either:
- an MSYS2 MinGW shell, or
- a Microsoft Visual C++ compiler environment with the Windows Driver Kit (WDK) available.
- Install CMake and a build tool such as Ninja or GNU Make.
- For MSYS2 MinGW builds, install a MinGW toolchain capable of linking
kernel32andntoskrnl. - For GNU-style Windows toolchains, ensure the Windows DDK headers are installed in a directory containing
ntddk.h. Common MSYS2 layouts include/mingw64/include/ddk,/clang64/include/ddk,/ucrt64/include/ddk, and/usr/include/w32api/ddk. - If the headers live elsewhere, pass
-DNETDATA_DRIVER_GNU_DDK_INCLUDE_DIR=<path>pointing to the directory that containsntddk.h. - Install the Windows Driver Kit (WDK) so
Inf2Catis available during the Windows build.
Inf2Cat is mandatory for the Windows build. The repository root CMakeLists.txt now selects compiler-specific include paths and flags for GNU-style Windows toolchains and MSVC separately, and still generates netdata_driver.cat during the normal Windows build.
Preferred helper script:
./packaging/compile-on-msys.shMSVC helper script:
.\packaging\compile-on-msvc.ps1Manual configure command:
cmake -S . -B build -G NinjaIf Ninja is not available, use:
cmake -S . -B build -G "Unix Makefiles"For MSVC/WDK environments, use .\packaging\compile-on-msvc.ps1, or run CMake manually with a Visual Studio generator or Ninja from a developer prompt where the WDK include and library paths are already configured. For example:
cmake -S . -B build -G NinjaIf you used the helper script, it already performs this step.
Manual build command:
cmake --build buildTo install the generated files using CMake's install rules:
cmake --install buildBy default, installation uses CMAKE_INSTALL_BINDIR. If BINDIR is provided by a parent CMake project, that value is used instead.
To stage the installed files into /opt/netdata and build the MSI using the repository helper:
./packaging/package-windows.shSet BUILD_DIR, PACKAGE_ROOT, WIX_BIN, WIX_ARCH, WIX_SOURCE, or WIX_OUTPUT if you need to override the default build directory, staging root, WiX executable, or WiX output settings. WIX_SOURCE and WIX_OUTPUT are evaluated from inside the build directory by default.
After a successful build, the main artifacts are:
build/netdata_driver.sysbuild/netdata_driver.infbuild/netdata_driver.cat
packaging/compile-on-msys.shchecks the required binaries before building, auto-detects a supported MSYS2 DDK include directory, and usesbuild/as the output directory.packaging/compile-on-msys.shauto-detectsInf2Cat.exefrom the default Windows Kits 10 installation directory when it is not already onPATH.packaging/compile-on-msvc.ps1defaults tobuild-msvc/and selectsNinjawhen bothninjaandclare already available; otherwise it falls back toVisual Studio 17 2022.packaging/compile-on-msvc.ps1usesCMAKE_BUILD_TYPEas the configuration name for multi-config generators. The default isRelWithDebInfo.packaging/compile-on-msvc.shis retained only as a compatibility wrapper that forwards to the PowerShell script.NETDATA_DRIVER_GNU_DDK_INCLUDE_DIRcontrols where GNU-style Windows builds look forntddk.h. The configure step auto-detects a supported MSYS2 DDK include directory when possible.packaging/package-windows.shinstalls the generated driver package artifacts frombuild/into/opt/netdataby default, then changes intobuild/and runswix buildthere so the packaged assets resolve correctly.cmake -S . -B buildnow also stages Windows installer assets intobuild/, includingbuild/netdata_driver.wxs.- Override the Inf2Cat OS target list with
-DNETDATA_DRIVER_INF2CAT_OS=<comma-separated-identifiers>if you need a different Windows support matrix. packaging/package-windows.shuseswixfromPATHwhen available, otherwise it probes common WiX installation directories and buildsbuild/netdata-driver-x64.msiby default.- This repository currently documents the build flow, but the commands have not been validated in this repository yet.
- Driver signing is not handled by this repository CMake file.