On 31/05/14 14:14, Samuli Suominen wrote:
> 1. "libsystemd_network_la_SOURCES =" in Makefile.am includes
> "src/libsystemd-network/network-internal.h"
> and there is no anykind of #ifdef -logic behind it
>
> 2. "src/libsystemd-network/network-internal.h" has #include <libkmod.h>
> and there is no anykind of #ifdef
> -logic behind it
>
> so kmod is hardcoded dependency in systemd-213:
>
>

This patch is a half-complete hack that only works with
--disable-networkd, as it only covers the files
that are outside of the #if NETWORKD in Makefile.am
As in, I've used this patch only for the package within Gentoo that
builds only udev, not rest of systemd,
that uses --disable-networkd
So consider this as proof of consept, not for inclusion

- Samuli
This only works with --disable-networkd as it doesn't cover all of the files. As in, this is Gentoo specific
hack for >=sys-fs/udev-213 only.

http://lists.freedesktop.org/archives/systemd-devel/2014-May/019634.html
http://bugs.gentoo.org/511924

--- src/libsystemd-network/network-internal.c
+++ src/libsystemd-network/network-internal.c
@@ -327,6 +327,7 @@ int net_parse_inaddr(const char *address, unsigned char *family, void *dst) {
         return 0;
 }
 
+#if HAVE_KMOD
 int load_module(struct kmod_ctx *ctx, const char *mod_name) {
         struct kmod_list *modlist = NULL, *l;
         int r;
@@ -361,6 +362,7 @@ int load_module(struct kmod_ctx *ctx, const char *mod_name) {
 
         return r;
 }
+#endif
 
 void serialize_in_addrs(FILE *f, const char *key, struct in_addr *addresses, size_t size) {
         unsigned i;
--- src/libsystemd-network/network-internal.h
+++ src/libsystemd-network/network-internal.h
@@ -24,7 +24,9 @@
 #include <netinet/ether.h>
 #include <netinet/in.h>
 #include <stdbool.h>
+#if HAVE_KMOD
 #include <libkmod.h>
+#endif
 
 #include "udev.h"
 #include "condition-util.h"
@@ -67,7 +69,9 @@ int net_parse_inaddr(const char *address, unsigned char *family, void *dst);
 
 int net_get_unique_predictable_data(struct udev_device *device, uint8_t result[8]);
 
+#if HAVE_KMOD
 int load_module(struct kmod_ctx *ctx, const char *mod_name);
+#endif
 
 void serialize_in_addrs(FILE *f, const char *key, struct in_addr *addresses, size_t size);
 int deserialize_in_addrs(struct in_addr **addresses, size_t *size, const char *string);
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to