diff options
author | Kay Sievers <kay@vrfy.org> | 2013-03-03 18:35:22 +0100 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2013-03-03 18:35:22 +0100 |
commit | 1d600df55bdba448b05d6f8293028d6b6702914b (patch) | |
tree | 3f34f69524aa770a38b9e589070727713c795c3a /src/udev/udevd.c | |
parent | 3f60bcb5e69846fe8a3156ca1c9a7e0813ac158a (diff) |
udev: remove database conversion code
Diffstat (limited to 'src/udev/udevd.c')
-rw-r--r-- | src/udev/udevd.c | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 92911efa90..0a3ab687fd 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -896,90 +896,6 @@ static int mem_size_mb(void) return memsize; } -static int convert_db(struct udev *udev) -{ - char filename[UTIL_PATH_SIZE]; - struct udev_enumerate *udev_enumerate; - struct udev_list_entry *list_entry; - - /* current database */ - if (access("/run/udev/data", F_OK) >= 0) - return 0; - - /* make sure we do not get here again */ - mkdir_p("/run/udev/data", 0755); - - /* old database */ - strscpyl(filename, sizeof(filename), "/dev/.udev/db", NULL); - if (access(filename, F_OK) < 0) - return 0; - - print_kmsg("converting old udev database\n"); - - udev_enumerate = udev_enumerate_new(udev); - if (udev_enumerate == NULL) - return -1; - udev_enumerate_scan_devices(udev_enumerate); - udev_list_entry_foreach(list_entry, udev_enumerate_get_list_entry(udev_enumerate)) { - struct udev_device *device; - - device = udev_device_new_from_syspath(udev, udev_list_entry_get_name(list_entry)); - if (device == NULL) - continue; - - /* try to find the old database for devices without a current one */ - if (udev_device_read_db(device, NULL) < 0) { - bool have_db; - const char *id; - struct stat stats; - char devpath[UTIL_PATH_SIZE]; - char from[UTIL_PATH_SIZE]; - - have_db = false; - - /* find database in old location */ - id = udev_device_get_id_filename(device); - strscpyl(from, sizeof(from), "/dev/.udev/db/", id, NULL); - if (lstat(from, &stats) == 0) { - if (!have_db) { - udev_device_read_db(device, from); - have_db = true; - } - unlink(from); - } - - /* find old database with $subsys:$sysname name */ - strscpyl(from, sizeof(from), "/dev/.udev/db/", - udev_device_get_subsystem(device), ":", udev_device_get_sysname(device), NULL); - if (lstat(from, &stats) == 0) { - if (!have_db) { - udev_device_read_db(device, from); - have_db = true; - } - unlink(from); - } - - /* find old database with the encoded devpath name */ - util_path_encode(udev_device_get_devpath(device), devpath, sizeof(devpath)); - strscpyl(from, sizeof(from), "/dev/.udev/db/", devpath, NULL); - if (lstat(from, &stats) == 0) { - if (!have_db) { - udev_device_read_db(device, from); - have_db = true; - } - unlink(from); - } - - /* write out new database */ - if (have_db) - udev_device_update_db(device); - } - udev_device_unref(device); - } - udev_enumerate_unref(udev_enumerate); - return 0; -} - static int systemd_fds(struct udev *udev, int *rctrl, int *rnetlink) { int ctrl = -1, netlink = -1; @@ -1355,9 +1271,6 @@ int main(int argc, char *argv[]) goto exit; } - /* if needed, convert old database from earlier udev version */ - convert_db(udev); - if (children_max <= 0) { int memsize = mem_size_mb(); |