From e4a9c1c760eccfd409ab1d33cb8a7df5e11f43db Mon Sep 17 00:00:00 2001 From: Fiona Klute Date: Fri, 1 May 2026 15:10:29 +0200 Subject: [PATCH] package/kmod: switch to Meson build The upstream changelog for version 34 states that the next major version will drop the Autotools build, and the 34 series is meant for distros to switch. Notable changes in the Buildroot package: * The Meson build handles symlink install, so we can drop the post install hooks. * Simplify the merged-usr and merged-bin symlink install handling. Only the non merged-usr case needs special handling now for placing the correct symlink to block busybox placing it's only kmod applet symlink unto /sbin later. * The previous point also means that host-kmod now installs the full set of tools. * Explicitly disable openssl support in host-kmod tools. It is enabled by default and the build fails if OpenSSL cannot be found. In the autotools build it was not explicitly set. Signed-off-by: Fiona Klute [Marcus: explain the merged-bin, merged-usr simplifications in the commit message] Signed-off-by: Marcus Hoffmann --- package/kmod/kmod.mk | 82 ++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 52 deletions(-) diff --git a/package/kmod/kmod.mk b/package/kmod/kmod.mk index bcf65fd9be..0901afc872 100644 --- a/package/kmod/kmod.mk +++ b/package/kmod/kmod.mk @@ -17,43 +17,43 @@ KMOD_LICENSE_FILES = libkmod/COPYING KMOD_CPE_ID_VENDOR = kernel -# static linking not supported, see -# https://git.kernel.org/cgit/utils/kernel/kmod/kmod.git/commit/?id=b7016153ec8 -KMOD_CONF_OPTS = --disable-static --enable-shared - -KMOD_CONF_OPTS += --disable-manpages -HOST_KMOD_CONF_OPTS = --disable-manpages +KMOD_CONF_OPTS = -Dmanpages=false +HOST_KMOD_CONF_OPTS = -Dmanpages=false ifeq ($(BR2_PACKAGE_BASH_COMPLETION),y) -KMOD_CONF_OPTS += --with-bashcompletiondir=/usr/share/bash-completion/completions +KMOD_CONF_OPTS += -Dbashcompletiondir=/usr/share/bash-completion/completions +else +KMOD_CONF_OPTS += -Dbashcompletiondir=no endif +KMOD_CONF_OPTS += -Dfishcompletiondir=no -Dzshcompletiondir=no + ifeq ($(BR2_PACKAGE_ZLIB),y) KMOD_DEPENDENCIES += zlib -KMOD_CONF_OPTS += --with-zlib +KMOD_CONF_OPTS += -Dzlib=enabled else -KMOD_CONF_OPTS += --without-zlib +KMOD_CONF_OPTS += -Dzlib=disabled endif ifeq ($(BR2_PACKAGE_ZSTD),y) KMOD_DEPENDENCIES += zstd -KMOD_CONF_OPTS += --with-zstd +KMOD_CONF_OPTS += -Dzstd=enabled else -KMOD_CONF_OPTS += --without-zstd +KMOD_CONF_OPTS += -Dzstd=disabled endif ifeq ($(BR2_PACKAGE_XZ),y) KMOD_DEPENDENCIES += xz -KMOD_CONF_OPTS += --with-xz +KMOD_CONF_OPTS += -Dxz=enabled else -KMOD_CONF_OPTS += --without-xz +KMOD_CONF_OPTS += -Dxz=disabled endif ifeq ($(BR2_PACKAGE_OPENSSL),y) KMOD_DEPENDENCIES += openssl -KMOD_CONF_OPTS += --with-openssl +KMOD_CONF_OPTS += -Dopenssl=enabled else -KMOD_CONF_OPTS += --without-openssl +KMOD_CONF_OPTS += -Dopenssl=disabled endif ifeq ($(BR2_PACKAGE_KMOD_TOOLS),y) @@ -62,61 +62,39 @@ ifeq ($(BR2_PACKAGE_KMOD_TOOLS),y) KMOD_LICENSE += , GPL-2.0+ (tools) KMOD_LICENSE_FILES += COPYING -# /sbin is really /usr/sbin with merged /usr, and /usr/sbin is -# really /usr/bin with merged-bin, so adjust relative symlink -ifeq ($(BR2_ROOTFS_MERGED_USR),y) -ifeq ($(BR2_ROOTFS_MERGED_BIN),y) -KMOD_BIN_PATH = kmod -KMOD_SBIN_DIR = bin -else -KMOD_BIN_PATH = ../bin/kmod -KMOD_SBIN_DIR = sbin -endif -else -KMOD_BIN_PATH = ../usr/bin/kmod -KMOD_SBIN_DIR = sbin +ifeq ($(BR2_ROOTFS_MERGED_USR),) +# Busybox would install its modutils symlinks to /sbin, so kmod needs +# to do the same to take priority (Busybox won't overwrite them, see +# its install-noclobber). +KMOD_CONF_OPTS += -Dsbindir=/sbin endif -define KMOD_INSTALL_TOOLS - for i in depmod insmod lsmod modinfo modprobe rmmod; do \ - ln -sf $(KMOD_BIN_PATH) $(TARGET_DIR)/$(KMOD_SBIN_DIR)/$$i; \ - done -endef - -KMOD_POST_INSTALL_TARGET_HOOKS += KMOD_INSTALL_TOOLS else -KMOD_CONF_OPTS += --disable-tools +KMOD_CONF_OPTS += -Dtools=false endif ifeq ($(BR2_PACKAGE_HOST_KMOD_GZ),y) HOST_KMOD_DEPENDENCIES += host-zlib -HOST_KMOD_CONF_OPTS += --with-zlib +HOST_KMOD_CONF_OPTS += -Dzlib=enabled else -HOST_KMOD_CONF_OPTS += --without-zlib +HOST_KMOD_CONF_OPTS += -Dzlib=disabled endif ifeq ($(BR2_PACKAGE_HOST_KMOD_ZSTD),y) HOST_KMOD_DEPENDENCIES += host-zstd -HOST_KMOD_CONF_OPTS += --with-zstd +HOST_KMOD_CONF_OPTS += -Dzstd=enabled else -HOST_KMOD_CONF_OPTS += --without-zstd +HOST_KMOD_CONF_OPTS += -Dzstd=disabled endif ifeq ($(BR2_PACKAGE_HOST_KMOD_XZ),y) HOST_KMOD_DEPENDENCIES += host-xz -HOST_KMOD_CONF_OPTS += --with-xz +HOST_KMOD_CONF_OPTS += -Dxz=enabled else -HOST_KMOD_CONF_OPTS += --without-xz +HOST_KMOD_CONF_OPTS += -Dxz=disabled endif -# We only install depmod, since that's the only tool used for the -# host. -define HOST_KMOD_INSTALL_TOOLS - mkdir -p $(HOST_DIR)/sbin/ - ln -sf ../bin/kmod $(HOST_DIR)/sbin/depmod -endef +HOST_KMOD_CONF_OPTS += -Dopenssl=disabled -HOST_KMOD_POST_INSTALL_HOOKS += HOST_KMOD_INSTALL_TOOLS - -$(eval $(autotools-package)) -$(eval $(host-autotools-package)) +$(eval $(meson-package)) +$(eval $(host-meson-package))