udev.h \
udev_utils.h \
udev_rules.h \
- udev_db.h \
logging.h \
udev_libc_wrapper.h \
udev_selinux.h \
mandir = ${prefix}/usr/share/man
configdir = ${etcdir}/udev
udevdir = /dev
-udevdb = ${udevdir}/.udevdb
LOCAL_CFG_DIR = etc/udev
DESTDIR =
@echo "Creating udev_version.h"
@echo \#define UDEV_VERSION \"$(VERSION)\" > $@
@echo \#define UDEV_ROOT \"$(udevdir)\" >> $@
- @echo \#define UDEV_DB \"$(udevdb)\" >> $@
@echo \#define UDEV_CONFIG_DIR \"$(configdir)\" >> $@
@echo \#define UDEV_CONFIG_FILE \"$(configdir)/udev.conf\" >> $@
@echo \#define UDEV_RULES_FILE \"$(configdir)/rules.d\" >> $@
done;
ifndef DESTDIR
- killall udevd
- - rm -rf $(udevdb)
+ - rm -rf /dev/.udev
- $(sbindir)/udevd --daemon
endif
.PHONY: install-bin
- rm -f $(DESTDIR)$(DESTDIR)$(usrbindir)/udevtest
ifndef DESTDIR
- killall udevd
- - rm -rf $(udevdb)
+ - rm -rf /dev/.udev
endif
@extras="$(EXTRAS)"; for target in $$extras; do \
echo $$target; \
be emulated by a rule placed before all other rules:
ACTION=="add", DEVPATH=="/devices/*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus"
+The option "udev_db" does no longer exist. All udev state will always
+be in /$udev_root/.udev/ now, there is no longer an option to set this
+to anything else.
+
udev 075
========
Silent a too verbose error logging for the old hotplug.d/ dev.d/
</listitem>
</varlistentry>
- <varlistentry>
- <term><option>udev_db</option></term>
- <listitem>
- <para>The name and location of the udev database. The default value is
- <filename>/dev/.udevdb</filename>.</para>
- </listitem>
- </varlistentry>
-
<varlistentry>
<term><option>udev_rules</option></term>
<listitem>
# Where in the filesystem to place the device nodes
udev_root="@udevdir@"
-# The name and location of the udev database.
-udev_db="@udevdir@/.udevdb"
-
# The name and location of the udev rules file(s).
udev_rules="@configdir@/rules.d"
my $sysfs = "sys/";
my $udev_bin = "../udev";
my $udev_root = "udev-root/"; # !!! directory will be removed !!!
-my $udev_db = ".udevdb";
my $udev_conf = "udev-test.conf";
my $udev_rules = "udev-test.rules";
print "\n";
if (defined($rules->{option}) && $rules->{option} eq "clean") {
- system("rm -rf $udev_db");
system("rm -rf $udev_root");
mkdir($udev_root) || die "unable to create udev_root: $udev_root\n";
}
# create config file
open CONF, ">$udev_conf" || die "unable to create config file: $udev_conf";
print CONF "udev_root=\"$udev_root\"\n";
-print CONF "udev_db=\"$udev_db\"\n";
print CONF "udev_rules=\"$udev_rules\"\n";
print CONF "udev_log=\"info\"\n";
close CONF;
print "$error errors occured\n\n";
# cleanup
-system("rm -rf $udev_db");
system("rm -rf $udev_root");
unlink($udev_rules);
unlink($udev_conf);
Specifies where to place the device nodes in the filesystem. The default value is
\fI/dev\fR.
.TP
-\fBudev_db\fR
-The name and location of the udev database. The default value is
-\fI/dev/.udevdb\fR.
-.TP
\fBudev_rules\fR
The name of the udev rules file or directory to look for files with the suffix
\fI.rules\fR. Multiple rule files are read in lexical order. The default value is
#include "list.h"
#define COMMENT_CHARACTER '#'
+#define PATH_TO_NAME_CHAR '@'
#define LINE_SIZE 512
#define NAME_SIZE 128
#define PATH_SIZE 256
#define DEFAULT_PARTITIONS_COUNT 15
#define UDEV_ALARM_TIMEOUT 180
+#define DB_DIR ".udev/db"
+
struct udev_rules;
enum device_type {
extern int udev_start(void);
extern int udev_make_node(struct udevice *udev, const char *file, dev_t devt, mode_t mode, uid_t uid, gid_t gid);
+extern int udev_db_add_device(struct udevice *dev);
+extern int udev_db_delete_device(struct udevice *dev);
+extern int udev_db_get_device(struct udevice *udev, const char *devpath);
+extern int udev_db_lookup_name(const char *name, char *devpath, size_t len);
+extern int udev_db_get_all_entries(struct list_head *name_list);
+
extern char sysfs_path[PATH_SIZE];
extern char udev_root[PATH_SIZE];
-extern char udev_db_path[PATH_SIZE];
extern char udev_config_filename[PATH_SIZE];
extern char udev_rules_filename[PATH_SIZE];
extern int udev_log_priority;
#include "udev_version.h"
#include "logging.h"
#include "udev_rules.h"
-#include "udev_db.h"
#include "udev_selinux.h"
/* global variables */
char sysfs_path[PATH_SIZE];
char udev_root[PATH_SIZE];
-char udev_db_path[PATH_SIZE];
char udev_config_filename[PATH_SIZE];
char udev_rules_filename[PATH_SIZE];
int udev_log_priority;
continue;
}
- if (strcasecmp(variable, "udev_db") == 0) {
- strlcpy(udev_db_path, value, sizeof(udev_db_path));
- remove_trailing_chars(udev_db_path, '/');
- continue;
- }
-
if (strcasecmp(variable, "udev_rules") == 0) {
strlcpy(udev_rules_filename, value, sizeof(udev_rules_filename));
remove_trailing_chars(udev_rules_filename, '/');
const char *env;
strcpy(udev_root, UDEV_ROOT);
- strcpy(udev_db_path, UDEV_DB);
strcpy(udev_config_filename, UDEV_CONFIG_FILE);
strcpy(udev_rules_filename, UDEV_RULES_FILE);
udev_log_priority = LOG_ERR;
dbg("sysfs_path='%s'", sysfs_path);
dbg("UDEV_CONFIG_FILE='%s'", udev_config_filename);
dbg("udev_root='%s'", udev_root);
- dbg("udev_db='%s'", udev_db_path);
dbg("udev_rules='%s'", udev_rules_filename);
dbg("udev_log=%d", udev_log_priority);
}
#include "udev.h"
#include "udev_utils.h"
#include "logging.h"
-#include "udev_db.h"
-#define PATH_TO_NAME_CHAR '@'
static int devpath_to_db_path(const char *devpath, char *filename, size_t len)
{
size_t start, end, i;
/* add location of db files */
- start = strlcpy(filename, udev_db_path, len);
+ strlcpy(filename, udev_root, len);
+ strlcat(filename, "/", len);
+ start = strlcat(filename, DB_DIR, len);
end = strlcat(filename, devpath, len);
if (end > len)
end = len;
int udev_db_lookup_name(const char *name, char *devpath, size_t len)
{
+ char dbpath[PATH_MAX];
DIR *dir;
int found = 0;
- dir = opendir(udev_db_path);
+ strlcpy(dbpath, udev_root, sizeof(dbpath));
+ strlcat(dbpath, "/", sizeof(dbpath));
+ strlcat(dbpath, DB_DIR, sizeof(dbpath));
+ dir = opendir(dbpath);
if (dir == NULL) {
- err("unable to open udev_db '%s': %s", udev_db_path, strerror(errno));
+ err("unable to open udev_db '%s': %s", dbpath, strerror(errno));
return -1;
}
if (ent->d_name[0] == '.')
continue;
- snprintf(filename, sizeof(filename), "%s/%s", udev_db_path, ent->d_name);
+ snprintf(filename, sizeof(filename), "%s/%s", dbpath, ent->d_name);
filename[sizeof(filename)-1] = '\0';
dbg("looking at '%s'", filename);
int udev_db_get_all_entries(struct list_head *name_list)
{
+ char dbpath[PATH_MAX];
DIR *dir;
- dir = opendir(udev_db_path);
+ strlcpy(dbpath, udev_root, sizeof(dbpath));
+ strlcat(dbpath, "/", sizeof(dbpath));
+ strlcat(dbpath, DB_DIR, sizeof(dbpath));
+ dir = opendir(dbpath);
if (dir == NULL) {
- err("unable to open udev_db '%s': %s", udev_db_path, strerror(errno));
+ err("unable to open udev_db '%s': %s", dbpath, strerror(errno));
return -1;
}
+++ /dev/null
-/*
- * udev_db.h
- *
- * Copyright (C) 2003 Greg Kroah-Hartman <greg@kroah.com>
- * Copyright (C) 2004-2005 Kay Sievers <kay.sievers@vrfy.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef _UDEV_DB_H_
-#define _UDEV_DB_H_
-
-
-extern int udev_db_add_device(struct udevice *dev);
-extern int udev_db_delete_device(struct udevice *dev);
-
-extern int udev_db_get_device(struct udevice *udev, const char *devpath);
-extern int udev_db_lookup_name(const char *name, char *devpath, size_t len);
-extern int udev_db_get_all_entries(struct list_head *name_list);
-
-#endif /* _UDEV_DB_H_ */
#include "udev.h"
#include "udev_utils.h"
#include "udev_version.h"
-#include "udev_db.h"
#include "logging.h"
static int delete_path(const char *path)
#include "udev_version.h"
#include "logging.h"
#include "udev_rules.h"
-#include "udev_db.h"
/* extract possible {attr} and move str behind it */
EVENT_FAILED,
};
-#define PATH_TO_NAME_CHAR '@'
-#define EVENT_QUEUE_DIR ".udev/queue"
-#define EVENT_FAILED_DIR ".udev/failed"
static void export_event_state(struct uevent_msg *msg, enum event_state state)
{
char filename[PATH_SIZE];
#define UDEVD_PRIORITY -4
#define UDEV_PRIORITY -2
+#define EVENT_QUEUE_DIR ".udev/queue"
+#define EVENT_FAILED_DIR ".udev/failed"
+
/* maximum limit of runnig childs */
#define UDEVD_MAX_CHILDS 64
/* start to throttle forking if maximum number of running childs in our session is reached */
#include "udev.h"
#include "udev_utils.h"
#include "udev_version.h"
-#include "udev_db.h"
#include "logging.h"