[systemd-commits] 2 commits - src/udev TODO

Kay Sievers kay at kemper.freedesktop.org
Sun Mar 3 09:44:22 PST 2013


 TODO                             |    2 
 src/udev/udev-builtin-firmware.c |   18 --------
 src/udev/udevadm-info.c          |    6 --
 src/udev/udevd.c                 |   87 ---------------------------------------
 4 files changed, 1 insertion(+), 112 deletions(-)

New commits:
commit 1d600df55bdba448b05d6f8293028d6b6702914b
Author: Kay Sievers <kay at vrfy.org>
Date:   Sun Mar 3 18:35:22 2013 +0100

    udev: remove database conversion code

diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 92911ef..0a3ab68 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();
 

commit 3f60bcb5e69846fe8a3156ca1c9a7e0813ac158a
Author: Kay Sievers <kay at vrfy.org>
Date:   Sun Mar 3 18:20:09 2013 +0100

    udev: firmware - do not created /run/udev/firmware-missing/
    
    The userspace firmware loader is deprecated now, and will be entirely
    removed when we depend on a kernel version with the built-in firmware
    loader available.

diff --git a/TODO b/TODO
index 5f351b2..4ea0471 100644
--- a/TODO
+++ b/TODO
@@ -421,7 +421,7 @@ Features:
 * ConditionSecurity= should learn about IMA and SMACK
 
 * udev:
-  - remove all (misguided from day 1) userspace firmware_class handling
+  - remove src/udev/udev-builtin-firmware.c (CONFIG_FW_LOADER_USER_HELPER=n)
   - move to LGPL
   - unify utf8 validator code with shared/
   - kill scsi_id
diff --git a/src/udev/udev-builtin-firmware.c b/src/udev/udev-builtin-firmware.c
index 9cb4294..b80940b 100644
--- a/src/udev/udev-builtin-firmware.c
+++ b/src/udev/udev-builtin-firmware.c
@@ -78,8 +78,6 @@ static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], boo
 {
         struct udev *udev = udev_device_get_udev(dev);
         static const char *searchpath[] = { FIRMWARE_PATH };
-        char fwencpath[UTIL_PATH_SIZE];
-        char misspath[UTIL_PATH_SIZE];
         char loadpath[UTIL_PATH_SIZE];
         char datapath[UTIL_PATH_SIZE];
         char fwpath[UTIL_PATH_SIZE];
@@ -111,23 +109,10 @@ static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], boo
                         break;
         }
 
-        util_path_encode(firmware, fwencpath, sizeof(fwencpath));
-        strscpyl(misspath, sizeof(misspath), "/run/udev/firmware-missing/", fwencpath, NULL);
         strscpyl(loadpath, sizeof(loadpath), udev_device_get_syspath(dev), "/loading", NULL);
 
         if (fwfile == NULL) {
-                int err;
-
-                /* This link indicates the missing firmware file and the associated device */
                 log_debug("did not find firmware file '%s'\n", firmware);
-                do {
-                        err = mkdir_parents(misspath, 0755);
-                        if (err != 0 && err != -ENOENT)
-                                break;
-                        err = symlink(udev_device_get_devpath(dev), misspath);
-                        if (err != 0)
-                                err = -errno;
-                } while (err == -ENOENT);
                 rc = EXIT_FAILURE;
                 /*
                  * Do not cancel the request in the initrd, the real root might have
@@ -146,9 +131,6 @@ static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], boo
                 goto exit;
         }
 
-        if (unlink(misspath) == 0)
-                util_delete_path(udev, misspath);
-
         if (!set_loading(udev, loadpath, "1"))
                 goto exit;
 
diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c
index 0f4565e..c478214 100644
--- a/src/udev/udevadm-info.c
+++ b/src/udev/udevadm-info.c
@@ -256,12 +256,6 @@ static void cleanup_db(struct udev *udev)
                 cleanup_dir(dir, 0, 1);
                 closedir(dir);
         }
-
-        dir = opendir("/run/udev/firmware-missing");
-        if (dir != NULL) {
-                cleanup_dir(dir, 0, 1);
-                closedir(dir);
-        }
 }
 
 static struct udev_device *find_device(struct udev *udev, const char *id, const char *prefix)



More information about the systemd-commits mailing list