[uClibc]Devfsd

Justin Cormack justin at street-vision.com
Tue Jul 30 09:17:32 UTC 2002


> 
> Hi!
> 
> I subscribed to this list a couple of days ago, since I've just started using 
> uClibc.
> 
> According to the working apps list on the site devfsd should work with uClibc 
> but I can't get it to compile correctly, and after searching thew web 
> (google) for a while found that there should be a NIS patch around some where 
> but I can't find that one.
> 
> Now do I need this patch or am I missing something else? 

the patch is here, you do need it.

I never looked into why devfsd needs this stuff...

Justin


diff -b -r -u devfsd/GNUmakefile devfsd-uclibc/GNUmakefile
--- devfsd/GNUmakefile	Fri Nov 23 07:12:33 2001
+++ devfsd-uclibc/GNUmakefile	Fri Nov 30 15:57:09 2001
@@ -5,11 +5,15 @@
 CONFIG_FILE = $(CONFDIR)/devfsd.conf
 DEFINES     :=
 
+ifdef WITHOUT_NSL
+DEFINES     += -DWITHOUT_NSL=1
+else
 nsl_libs := $(wildcard /lib/libnsl.so.*)
 ifneq ($(nsl_libs),)
 LIBNSL      = $(shell for file in /lib/libnsl.so.[0-9]* ; do echo $$file ; done | sort -t . -n +2 | head -1)
 DEFINES     += -DLIBNSL="\"$(LIBNSL)\""
 endif
+endif
 
 
 all:	devfsd rpm.spec
@@ -33,8 +37,8 @@
 	if [ ! -e $(SBINDIR) ]; then mkdir $(SBINDIR); fi
 	rm -f $(SBINDIR)/devfsd
 	install -s devfsd $(SBINDIR)/devfsd
-	if [ ! -e $(MANDIR)/man5 ]; then mkdir $(MANDIR)/man5; fi
-	if [ ! -e $(MANDIR)/man8 ]; then mkdir $(MANDIR)/man8; fi
+	if [ ! -e $(MANDIR)/man5 ]; then mkdir -p $(MANDIR)/man5; fi
+	if [ ! -e $(MANDIR)/man8 ]; then mkdir -p $(MANDIR)/man8; fi
 	-rm -f $(MANDIR)/*/devfsd.*
 	cp -p devfsd.8 $(MANDIR)/man8
 	cp -p devfsd.conf.5 $(MANDIR)/man5
diff -b -r -u devfsd/devfsd.c devfsd-uclibc/devfsd.c
--- devfsd/devfsd.c	Fri Nov 30 06:30:41 2001
+++ devfsd-uclibc/devfsd.c	Fri Nov 30 15:41:19 2001
@@ -259,8 +259,10 @@
 #include <regex.h>
 #include <errno.h>
 #include <dlfcn.h>
+#ifndef WITHOUT_NSL
 #include <rpcsvc/ypclnt.h>
 #include <rpcsvc/yp_prot.h>
+#endif
 #include <karma.h>
 #include "devfsd.h"
 #include "version.h"
@@ -390,9 +392,11 @@
 			      unsigned long *event_mask);
 static void process_config_line (CONST char *line, unsigned long *event_mask);
 static void *dlsym_nofail (const char *file, void *handle, char *symbol);
+#ifndef WITHOUT_NSL
 static int process_yp_line (int instatus, char *inkey, int inkeylen,
 			    char *inval, int invallen, char *indata);
 static void load_libnsl (void);
+#endif
 static void do_servicing (int fd, unsigned long event_mask);
 static void service_name (const struct devfsd_notify_struct *info);
 static void action_permissions (const struct devfsd_notify_struct *info,
@@ -460,9 +464,11 @@
     {"fd/2", "stderr"},
     {NULL, NULL},
 };
+#ifndef WITHOUT_NSL
 static int (*my_yp_all) (char *domain, char *map,
 			 struct ypall_callback *callback); /* = NULL */
 static int (*my_yp_get_default_domain) (char **domainptr); /* = NULL */
+#endif
 static struct event_type
 {
     unsigned int type;        /*  The DEVFSD_NOTIFY_* value                  */
@@ -675,6 +681,7 @@
     [RETURNS] Nothing.
 */
 {
+#ifndef WITHOUT_NSL
     if (location[0] == '+')
     {
 	/*  It's a YP map  */
@@ -697,6 +704,7 @@
 	SYSLOG (LOG_ERR, "error reading map: \"%s\"\n", location + 1);
 	exit (1);
     }
+#endif
     read_config_file (location, optional, event_mask);
 }   /*  End Function read_config   */
 
@@ -967,6 +975,7 @@
     return (result);
 }   /*  End Function dlsym_nofail  */
 
+#ifndef WITHOUT_NSL
 static void load_libnsl (void)
 {
 #ifdef LIBNSL  /*  It comes from a shared object  */
@@ -995,6 +1004,7 @@
     if (invallen > 0) process_config_line (inval, (unsigned long *) indata);
     return (0);
 }   /*  End Function process_yp_line  */
+#endif
 
 static void do_servicing (int fd, unsigned long event_mask)
 /*  [SUMMARY] Service devfs changes until a signal is received.



More information about the uClibc mailing list