--- /dev/null
+diff -ruN devfsd.old/DIETLIBC devfsd/DIETLIBC
+--- devfsd.old/DIETLIBC 1969-12-31 19:00:00.000000000 -0500
++++ devfsd/DIETLIBC 2003-12-09 14:07:52.668863472 -0500
+@@ -0,0 +1,8 @@
++To build using dietlibc, run like this:
++
++CC="diet gcc" make has_dlopen=0 has_rpcsvc=0
++
++It will strip out the stuff that dietlibc doesn't
++support.
++
++
+diff -ruN devfsd.old/GNUmakefile devfsd/GNUmakefile
+--- devfsd.old/GNUmakefile 2003-12-09 12:34:13.000000000 -0500
++++ devfsd/GNUmakefile 2003-12-09 14:04:14.728995368 -0500
+@@ -8,22 +8,34 @@
+ KERNEL_DIR = /usr/src/linux
+ endif
+
++has_dlopen := 0
++has_rpcsvc := 0
++
+ 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 -k 2 | head -1)
++LIBNSL = $(shell for file in /lib/libnsl.so.[0-9]* ; do echo $$file ; done | sort -t . -n -k 2 | head -n1)
+ DEFINES += -DLIBNSL="\"$(LIBNSL)\""
+ endif
+
++ifneq ($(has_dlopen),1)
++DEFINES += -DNO_DLOPEN
++else
++LIBS += -ldl
++endif
++
++ifneq ($(has_rpcsvc),1)
++DEFINES += -DNO_RPCSVC
++endif
+
+ all: devfsd rpm.spec
+
+-
+ OBJECTS = devfsd.o expression.o compat_name.o check_kernel.o
+
+ CFLAGS = -O2 -I. -I$(KERNEL_DIR)/include -Wall $(CEXTRAS) $(DEFINES)
+
+ devfsd: $(OBJECTS)
+- $(CC) -O2 -o devfsd $(OBJECTS) $(LDFLAGS) -export-dynamic -ldl
++ $(CC) -O2 -o devfsd $(OBJECTS) $(LDFLAGS) -export-dynamic $(LIBS)
+
+ check_kernel.o: check_kernel.c
+ $(CC) -fomit-frame-pointer -O2 -c $<
+diff -ruN devfsd.old/devfsd.c devfsd/devfsd.c
+--- devfsd.old/devfsd.c 2003-12-09 12:34:13.000000000 -0500
++++ devfsd/devfsd.c 2003-12-09 14:05:45.967125064 -0500
+@@ -282,9 +282,13 @@
+ #include <signal.h>
+ #include <regex.h>
+ #include <errno.h>
++#ifndef NO_DLOPEN
+ #include <dlfcn.h>
++#endif
++#ifndef NO_RPCSVC
+ #include <rpcsvc/ypclnt.h>
+ #include <rpcsvc/yp_prot.h>
++#endif
+ #include <karma.h>
+ #include "devfsd.h"
+ #include "version.h"
+@@ -419,9 +423,15 @@
+ static void read_config_file (CONST char *path, flag optional,
+ unsigned long *event_mask);
+ static void process_config_line (CONST char *line, unsigned long *event_mask);
++
++#ifndef NO_DLOPEN
+ static void *dlsym_nofail (const char *file, void *handle, char *symbol);
++#endif
++
++#ifndef NO_RPCSVC
+ static int process_yp_line (int instatus, char *inkey, int inkeylen,
+ char *inval, int invallen, char *indata);
++#endif
+ static void load_libnsl (void);
+ static flag do_servicing (int fd, unsigned long event_mask);
+ static void service_name (const struct devfsd_notify_struct *info);
+@@ -492,9 +502,11 @@
+ {"fd/2", "stderr"},
+ {NULL, NULL},
+ };
++#ifndef NO_RPCSVC
+ 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 */
+@@ -720,6 +732,7 @@
+ [RETURNS] Nothing.
+ */
+ {
++#ifndef NO_RPCSVC
+ if (location[0] == '+')
+ {
+ /* It's a YP map */
+@@ -742,7 +755,8 @@
+ SYSLOG (LOG_ERR, "error reading map: \"%s\"\n", location + 1);
+ exit (1);
+ }
+- read_config_file (location, optional, event_mask);
++#endif
++ read_config_file (location, optional, event_mask);
+ } /* End Function read_config */
+
+ static void read_config_file (CONST char *path, flag optional,
+@@ -919,6 +933,7 @@
+ }
+ new->u.execute.argv[num_args] = NULL;
+ }
++#ifndef NO_DLOPEN
+ else if ( (strcasecmp (what, "MFUNCTION") == 0) ||
+ (strcasecmp (what, "CFUNCTION") == 0) )
+ {
+@@ -950,6 +965,7 @@
+ }
+ new->u.function.argv[num_args] = NULL;
+ }
++#endif
+ else if (strcasecmp (what, "COPY") == 0)
+ {
+ new->action.what = AC_COPY;
+@@ -1001,6 +1017,7 @@
+ last_config = new;
+ } /* End Function process_config_line */
+
++#ifndef NO_DLOPEN
+ static void *dlsym_nofail (const char *file, void *handle, char *symbol)
+ {
+ void *result = dlsym (handle, symbol);
+@@ -1011,9 +1028,11 @@
+ }
+ return (result);
+ } /* End Function dlsym_nofail */
++#endif
+
+ static void load_libnsl (void)
+ {
++#ifndef NO_RPCSVC
+ #ifdef LIBNSL /* It comes from a shared object */
+ void *libnsl_handle;
+
+@@ -1031,8 +1050,10 @@
+ my_yp_all = yp_all;
+ my_yp_get_default_domain = yp_get_default_domain;
+ #endif
++#endif
+ } /* End Function load_libnsl */
+
++#ifndef NO_RPCSVC
+ static int process_yp_line (int instatus, char *inkey, int inkeylen,
+ char *inval, int invallen, char *indata)
+ {
+@@ -1040,6 +1061,7 @@
+ if (invallen > 0) process_config_line (inval, (unsigned long *) indata);
+ return (0);
+ } /* End Function process_yp_line */
++#endif
+
+ static flag do_servicing (int fd, unsigned long event_mask)
+ /* [SUMMARY] Service devfs changes until a signal is received.
+@@ -1232,6 +1254,7 @@
+
+ if (first_time)
+ {
++#ifndef NO_DLOPEN
+ void *lib;
+
+ first_time = FALSE;
+@@ -1242,7 +1265,10 @@
+ }
+ else if (trace_level > 1)
+ fprintf (stderr, "/lib/modutils.so load failure: %s\n",dlerror() );
+- }
++#else
++ fprintf(stderr, "dlopen() not supported in this build");
++#endif
++ }
+ argv[0] = "/sbin/modprobe";
+ argv[1] = "-k";
+ argv[2] = "-C";
+@@ -1746,6 +1772,7 @@
+ }
+ first_config = NULL;
+ last_config = NULL;
++#ifndef NO_DLOPEN
+ for (so_entry = first_so; so_entry != NULL; so_entry = next)
+ {
+ next = so_entry->next;
+@@ -1753,6 +1780,7 @@
+ if (so_entry->handle != RTLD_DEFAULT) dlclose (so_entry->handle);
+ free (so_entry);
+ }
++#endif
+ first_so = NULL;
+ } /* End Function free_config */
+
+@@ -2055,6 +2083,7 @@
+ [RETURNS] A pointer to the object on success, else NULL.
+ */
+ {
++#ifndef NO_DLOPEN
+ struct shared_object *so;
+
+ for (so = first_so; so != NULL; so = so->next)
+@@ -2085,6 +2114,9 @@
+ so->next = first_so;
+ first_so = so;
+ return (so);
++#else
++ return(NULL);
++#endif
+ } /* End Function get_shared_object */
+
+ static flag expand_expression(char *output, unsigned int outsize,