Commit 3e214785 authored by Kay Sievers's avatar Kay Sievers

move imported udev into place

parent 19c5f19d
......@@ -107,3 +107,14 @@ ltmain.sh
*.tar.gz
*.tar.bz2
libtool
/accelerometer
/ata_id
/cdrom_id
/collect
/gtk-doc.make
/keymap
/mtd_probe
/scsi_id
/udevadm
/udevd
/v4l_id
This diff is collapsed.
......@@ -342,3 +342,28 @@ Regularly:
* pahole
* set_put(), hashmap_put() return values check. i.e. == 0 doesn't free()!
udev:
- find a way to tell udev to not cancel firmware
requests in initramfs
- scsi_id -> sg3_utils?
- make gtk-doc optional like kmod
- move /usr/lib/udev/devices/ to tmpfiles
- trigger --subsystem-match=usb/usb_device
- kill rules_generator
- have a $attrs{} ?
- remove RUN+="socket:"
- libudev.so.1
- symbol versioning
- return object with *_unref()
- udev_monitor_from_socket()
- udev_queue_get_failed_list_entry()
......@@ -21,6 +21,7 @@ if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
echo "Activated pre-commit hook."
fi
gtkdocize
intltoolize --force --automake
autoreconf --force --install --symlink
......@@ -32,7 +33,8 @@ args="\
--sysconfdir=/etc \
--localstatedir=/var \
--libdir=$(libdir /usr/lib) \
--libexecdir=/usr/lib"
--libexecdir=/usr/lib \
--enable-gtk-doc"
if [ ! -L /bin ]; then
args="$args \
......
This diff is collapsed.
......@@ -4,3 +4,4 @@ ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
gtk-doc.m4
/99-systemd.rules
*~
*.o
*.a
*.lo
*.la
.libs
.deps
.dirstamp
Makefile
Makefile.in
/aclocal.m4
/autom4te.cache
/config.h
/config.h.in
/config.log
/config.status
/config.guess
/config.sub
/libtool
/ltmain.sh
/install-sh
/missing
/configure
/stamp-h1
/depcomp
/gtk-doc.make
/build-aux
/udev-test-install
/udevd
/udevadm
/test-udev
......@@ -38,3 +11,8 @@ Makefile.in
/v4l_id
/keymap
/scsi_id
*.[78]
*.html
udev.pc
libudev.pc
udev*.service
This diff is collapsed.
This diff is collapsed.
The options used usually look like:
%configure \
--prefix=/usr \
--sysconfdir=/etc \
--bindir=/usr/bin \
--libdir=/usr/lib64 \
--libexecdir=/usr/lib \
--with-systemdsystemunitdir=/usr/lib/systemd/system \
--with-selinux
The options used in a RPM spec file look like:
%configure \
--prefix=%{_prefix} \
--sysconfdir=%{_sysconfdir} \
--bindir=%{_bindir} \
--libdir=%{_libdir} \
--libexecdir=%{_prefix}/lib \
--with-systemdsystemunitdir=%{_prefix}/lib/systemd/system \
--with-selinux
The options to install udev in the rootfs instead of /usr,
and udevadm in /sbin:
--prefix=%{_prefix} \
--with-rootprefix= \
--sysconfdir=%{_sysconfdir} \
--bindir=/sbin \
--libdir=%{_libdir} \
--with-rootlibdir=/lib64 \
--libexecdir=/lib \
--with-systemdsystemunitdir=/lib/systemd/system \
--with-selinux
Some tools expect udevadm in 'sbin'. A symlink to udevadm in 'bin'
needs to be manually created if needed.
The defined location for scripts and binaries which are called
from rules is (/usr)/lib/udev/ on all systems and architectures. Any
other location will break other packages, who rightfully expect
the (/usr)/lib/udev/ directory, to install their rule helper and udev
rule files.
Default udev rules and persistent device naming rules may be required
by other software that depends on the data udev collects from the
devices.
This diff is collapsed.
This diff is collapsed.
udev - Linux userspace device management
Integrating udev in the system has complex dependencies and may differ from
distribution to distribution. A system may not be able to boot up or work
reliably without a properly installed udev version. The upstream udev project
does not recommend replacing a distro's udev installation with the upstream
version.
The upstream udev project's set of default rules may require a most recent
kernel release to work properly.
Tools and rules shipped by udev are not public API and may change at any time.
Never call any private tool in /usr/lib/udev from any external application; it
might just go away in the next release. Access to udev information is only offered
by udevadm and libudev. Tools and rules in /usr/lib/udev and the entire contents
of the /run/udev directory are private to udev and do change whenever needed.
Requirements:
- Version 2.6.34 of the Linux kernel with sysfs, procfs, signalfd, inotify,
unix domain sockets, networking and hotplug enabled
- Some architectures might need a later kernel, that supports accept4(),
or need to backport the accept4() syscall wiring in the kernel.
- These options are required:
CONFIG_DEVTMPFS=y
CONFIG_HOTPLUG=y
CONFIG_INOTIFY_USER=y
CONFIG_NET=y
CONFIG_PROC_FS=y
CONFIG_SIGNALFD=y
CONFIG_SYSFS=y
CONFIG_SYSFS_DEPRECATED*=n
CONFIG_UEVENT_HELPER_PATH=""
- These options might be needed:
CONFIG_BLK_DEV_BSG=y (SCSI devices)
CONFIG_TMPFS_POSIX_ACL=y (user ACLs for device nodes)
- The /dev directory needs the 'devtmpfs' filesystem mounted.
Udev only manages the permissions and ownership of the
kernel-provided device nodes, and possibly creates additional symlinks.
- Udev requires /run to be writable, which is usually done by mounting a
'tmpfs' filesystem.
- This version of udev does not work properly with the CONFIG_SYSFS_DEPRECATED*
option enabled.
- The deprecated hotplug helper /sbin/hotplug should be disabled in the
kernel configuration, it is not needed today, and may render the system
unusable because the kernel may create too many processes in parallel
so that the system runs out-of-memory.
- The proc filesystem must be mounted on /proc, and the sysfs filesystem must
be mounted at /sys. No other locations are supported by a standard
udev installation.
- The default rule sset requires the following group names resolvable at udev startup:
disk, cdrom, floppy, tape, audio, video, lp, tty, dialout, and kmem.
Especially in LDAP setups, it is required that getgrnam() be able to resolve
these group names with only the rootfs mounted and while no network is
available.
- Some udev extras have external dependencies like:
libglib2, usbutils, pciutils, and gperf.
All these extras can be disabled with configure options.
Setup:
- The udev daemon should be started to handle device events sent by the kernel.
During bootup, the events for already existing devices can be replayed, so
that they are configured by udev. The systemd service files contain the
needed commands to start the udev daemon and the coldplug sequence.
- Restarting the daemon never applies any rules to existing devices.
- New/changed rule files are picked up automatically; there is usually no
daemon restart or signal needed.
Operation:
- Based on events the kernel sends out on device creation/removal, udev
creates/removes device nodes and symlinks in the /dev directory.
- All kernel events are matched against a set of specified rules, which
possibly hook into the event processing and load required kernel
modules to set up devices. For all devices, the kernel exports a major/minor
number; if needed, udev creates a device node with the default kernel
device name. If specified, udev applies permissions/ownership to the device
node, creates additional symlinks pointing to the node, and executes
programs to handle the device.
- The events udev handles, and the information udev merges into its device
database, can be accessed with libudev:
http://www.kernel.org/pub/linux/utils/kernel/hotplug/libudev/
http://www.kernel.org/pub/linux/utils/kernel/hotplug/gudev/
For more details about udev and udev rules, see the udev man pages:
http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/
Please direct any comment/question to the linux-hotplug mailing list at:
linux-hotplug@vger.kernel.org
- find a way to tell udev to not cancel firmware
requests in initramfs
- scsi_id -> sg3_utils?
- make gtk-doc optional like kmod
- move /usr/lib/udev/devices/ to tmpfiles
- trigger --subsystem-match=usb/usb_device
- kill rules_generator
- have a $attrs{} ?
- remove RUN+="socket:"
- libudev.so.1
- symbol versioning
- return object with *_unref()
- udev_monitor_from_socket()
- udev_queue_get_failed_list_entry()
#!/bin/sh -e
if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
chmod +x .git/hooks/pre-commit && \
echo "Activated pre-commit hook."
fi
gtkdocize
autoreconf --install --symlink
libdir() {
echo $(cd $1/$(gcc -print-multi-os-directory); pwd)
}
args="$args \
--prefix=/usr \
--sysconfdir=/etc \
--libdir=$(libdir /usr/lib) \
--with-selinux \
--enable-gtk-doc"
if [ -L /bin ]; then
args="$args \
--libexecdir=/usr/lib \
--with-systemdsystemunitdir=/usr/lib/systemd/system \
"
else
args="$args \
--with-rootprefix= \
---with-rootlibdir=$(libdir /lib) \
--bindir=/sbin \
--libexecdir=/lib \
--with-systemdsystemunitdir=/lib/systemd/system \
"
fi
echo
echo "----------------------------------------------------------------"
echo "Initialized build system. For a common configuration please run:"
echo "----------------------------------------------------------------"
echo
echo "./configure CFLAGS='-g -O1' $args"
echo
This diff is collapsed.
......@@ -21,7 +21,7 @@ DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
# gtk-doc will search all .c & .h files beneath here for inline comments
# documenting the functions and macros.
# e.g. DOC_SOURCE_DIR=../../../gtk
DOC_SOURCE_DIR=$(top_srcdir)/src
DOC_SOURCE_DIR=$(top_srcdir)/src/udev
# Extra options to pass to gtkdoc-scangobj. Not normally needed.
SCANGOBJ_OPTIONS=
......@@ -48,8 +48,8 @@ FIXXREF_OPTIONS=
# Used for dependencies. The docs will be rebuilt if any of these change.
# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
HFILE_GLOB=$(top_srcdir)/src/libudev*.h
CFILE_GLOB=$(top_srcdir)/src/libudev*.c
HFILE_GLOB=$(top_srcdir)/src/udev/libudev*.h
CFILE_GLOB=$(top_srcdir)/src/udev/libudev*.c
# Extra header to include when scanning, which are not under DOC_SOURCE_DIR
# e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h
......
Makefile
gudev-overrides.txt
gudev-decl-list.txt
gudev-decl.txt
......
......@@ -21,7 +21,7 @@ DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
# gtk-doc will search all .c & .h files beneath here for inline comments
# documenting the functions and macros.
# e.g. DOC_SOURCE_DIR=../../../gtk
DOC_SOURCE_DIR=$(top_srcdir)/src
DOC_SOURCE_DIR=$(top_srcdir)/src/udev/gudev
# Extra options to pass to gtkdoc-scangobj. Not normally needed.
SCANGOBJ_OPTIONS=
......@@ -48,8 +48,8 @@ FIXXREF_OPTIONS=
# Used for dependencies. The docs will be rebuilt if any of these change.
# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
HFILE_GLOB=$(top_srcdir)/src/gudev/*.h
CFILE_GLOB=$(top_srcdir)/src/gudev/*.c
HFILE_GLOB=$(top_srcdir)/src/udev/gudev/*.h
CFILE_GLOB=$(top_srcdir)/src/udev/gudev/*.c
# Extra header to include when scanning, which are not under DOC_SOURCE_DIR
# e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h
......@@ -80,8 +80,8 @@ expand_content_files=
GTKDOC_CFLAGS = \
$(DBUS_GLIB_CFLAGS) \
$(GLIB_CFLAGS) \
-I$(top_srcdir)/src/gudev \
-I$(top_builddir)/src/gudev
-I$(top_srcdir)/src/udev/gudev \
-I$(top_builddir)/src/udev/gudev
GTKDOC_LIBS = \
$(GLIB_LIBS) \
......
......@@ -423,7 +423,7 @@ int main(int argc, char **argv)
if (f) {
merge_table(fd, f);
} else {
snprintf(keymap_path, sizeof(keymap_path), "%s%s", PKGLIBEXECDIR "/keymaps/", filearg);
snprintf(keymap_path, sizeof(keymap_path), "%s%s", UDEVLIBEXECDIR "/keymaps/", filearg);
f = fopen(keymap_path, "r");
if (f)
merge_table(fd, f);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.