Skip to contentSkip to conversation

compiling udev 141 on linux 2.4

DISCUSSION Gabor Z. Papp 2 participants 5 messages Apr 23, 2009 – Apr 29, 2009

lore
Share & tools
lore
#0 lore raw

I would like to compile udev 141 on the following environment, but getting the attached error.

[kernel]
Linux gzpLinux 2.4.37 #1 Tue Dec 2 19:24:20 CET 2008 i686 GNU/Linux

[glibc]
GNU C Library stable release version 2.3.6, by Roland McGrath et al. Compiled by GNU CC version 4.1.2.
Compiled on a Linux 2.4.34-gzp1 system on 2007-04-04.

[gcc]
gcc (GCC) 4.3.3

[binutils]
GNU ld (Linux/GNU Binutils) 2.19.51.0.4.20090418

/* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */

/* Compile in debug messages */
/* #undef DEBUG */

/* Define to 1 if you have the <dlfcn.h> header file. */ #define HAVE_DLFCN_H 1

/* inotify available */
/* #undef HAVE_INOTIFY */

/* Define to 1 if you have the <inttypes.h> header file. */ #define HAVE_INTTYPES_H 1

/* Define to 1 if you have the `selinux' library (-lselinux). */ /* #undef HAVE_LIBSELINUX */

/* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1

/* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1

/* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1

/* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1

/* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1

/* Define to 1 if you have the <sys/stat.h> header file. */ #define HAVE_SYS_STAT_H 1

/* Define to 1 if you have the <sys/types.h> header file. */ #define HAVE_SYS_TYPES_H 1

/* Define to 1 if you have the <unistd.h> header file. */ #define HAVE_UNISTD_H 1

/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#define LT_OBJDIR ".libs/"

/* Name of package */
#define PACKAGE "udev"

/* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "[email protected]"

/* Define to the full name of this package. */
#define PACKAGE_NAME "udev"

/* Define to the full name and version of this package. */ #define PACKAGE_STRING "udev 141"

/* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "udev"

/* Define to the version of this package. */
#define PACKAGE_VERSION "141"

/* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1

/* Use logging/syslog */
#define USE_LOG 1

/* compile with SELinux support */
/* #undef USE_SELINUX */

/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE

# define _ALL_SOURCE 1
#endif
/* Enable GNU extensions on systems that have them.  */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
/* Enable threading extensions on Solaris.  */
#ifndef _POSIX_PTHREAD_SEMANTICS
# define _POSIX_PTHREAD_SEMANTICS 1
#endif
/* Enable extensions on HP NonStop.  */
#ifndef _TANDEM_SOURCE
# define _TANDEM_SOURCE 1
#endif
/* Enable general extensions on Solaris.  */
#ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1
#endif

/* Version number of package */
#define VERSION "141"

/* Number of bits in a file offset, on hosts where this is settable. */ #define _FILE_OFFSET_BITS 64

/* Define for large files, on AIX-style hosts. */
/* #undef _LARGE_FILES */

/* Define to 1 if on MINIX. */
/* #undef _MINIX */

/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
/* #undef _POSIX_1_SOURCE */

/* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */

#1 lore raw
Quoted 5 lines · Gabor Z. Papp

I would like to compile udev 141 on the following environment, but getting the attached error.

[kernel]
Linux gzpLinux 2.4.37 #1 Tue Dec 2 19:24:20 CET 2008 i686 GNU/Linux

Oh, what do you want with udev in that environment, it depends on sysfs and uevents wich are only in 2.6 kernels.

Your kernel headers are too old, you need recent headers to compile it.

Maybe you can copy netlink.h from more recent package, never tried that.

Or maybe just adding #include <linux/types.h> may make most of the warnings go away, and NETLINK_KOBJECT_UEVENT you can define to 15, if that still fails.

Good luck,
Kay

#2 lore raw
In reply to Gabor Z. Papp

* Kay Sievers <[email protected]>:

| > Linux gzpLinux 2.4.37 #1 Tue Dec 2 19:24:20 CET 2008 i686 GNU/Linux

| Oh, what do you want with udev in that environment, it depends on | sysfs and uevents wich are only in 2.6 kernels.

Chicken and egg, you know...

Switching from kernel 2.4 to 2.6 requires recent glibc. Recent glibc requires 2.6 kernel. 2.6 kernel requires udev. Sure, I could download some binary stuff from a distro, and try if it works, but old udev is outdated, new 2.6 requires new udev, but new udev binary runs on new glibc only. Problems everywhere. :-)

#3 lore raw
In reply to Gabor Z. Papp
Quoted 8 lines · Gabor Z. Papp

* Kay Sievers <[email protected]>:

| > Linux gzpLinux 2.4.37 #1 Tue Dec 2 19:24:20 CET 2008 i686 GNU/Linux

| Oh, what do you want with udev in that environment, it depends on | sysfs and uevents wich are only in 2.6 kernels.

Chicken and egg, you know...

You can run 2.6 without udev just fine, if you don't need to do fancy stuff. Especially coming from 2.4, there should be no problem to run a 2.6 kernel with a static /dev and add udev later ...

Kay

#4 lore raw
In reply to Gabor Z. Papp

* Kay Sievers <[email protected]>:

| Maybe you can copy netlink.h from more recent package, never tried | that.

Done.

| Or maybe just adding #include <linux/types.h> may make most of the
| warnings go away, and NETLINK_KOBJECT_UEVENT you can define to 15, if
| that still fails.

libudev-monitor.c: In function 'udev_monitor_set_receive_buffer_size':
libudev-monitor.c:170: error: 'SO_RCVBUFFORCE' undeclared (first use in this function)

Is this ok? #define SO_RCVBUFFORCE 33

udev-watch.o: In function `udev_watch_end':
/home/gzp/src/udev-141/udev/udev-watch.c:157: undefined reference to `inotify_rm_watch'

Solved with:

#ifdef HAVE_INOTIFY
        inotify_rm_watch(inotify_fd, wd);

#endif

udevd.c: In function 'handle_inotify':
udevd.c:549: error: invalid application of 'sizeof' to incomplete type 'struct inotify_event' udevd.c:549: error: dereferencing pointer to incomplete type
udevd.c:553: error: dereferencing pointer to incomplete type
udevd.c:554: error: dereferencing pointer to incomplete type
udevd.c:554: error: dereferencing pointer to incomplete type
udevd.c:559: error: dereferencing pointer to incomplete type
udevd.c:561: error: dereferencing pointer to incomplete type
udevd.c:562: error: dereferencing pointer to incomplete type
udevd.c:574: error: dereferencing pointer to incomplete type
udevd.c:574: error: 'IN_IGNORED' undeclared (first use in this function)

udevd.c:574: error: 'IN_IGNORED' undeclared solved with:

#define IN_IGNORED 0x00008000

but what about udevd.c:549: error: invalid application of 'sizeof' to incomplete type 'struct inotify_event'? Its ok to put the whole 'handle_inotify' into #ifdef HAVE_INOTIFY?

If yes, next error:

udevd.o: In function `main':
/home/gzp/src/udev-141/udev/udevd.c:981: undefined reference to ppoll' /home/gzp/src/udev-141/udev/udevd.c:1012: undefined reference to handle_inotify'