]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/udev/udevadm-hwdb.c
Merge pull request #30284 from YHNdnzj/fstab-wantedby-defaultdeps
[thirdparty/systemd.git] / src / udev / udevadm-hwdb.c
index e9db2847cf1f6d94c576ab855fb0b8a190195ba5..f306a4ffd6d82975d078be0c5eb010f0f69c923c 100644 (file)
@@ -4,7 +4,6 @@
 
 #include "hwdb-util.h"
 #include "udevadm.h"
-#include "util.h"
 
 static const char *arg_test = NULL;
 static const char *arg_root = NULL;
@@ -48,7 +47,7 @@ static int parse_argv(int argc, char *argv[]) {
         int c;
 
         while ((c = getopt_long(argc, argv, "ust:r:Vh", options, NULL)) >= 0)
-                switch(c) {
+                switch (c) {
                 case 'u':
                         arg_update = true;
                         break;
@@ -88,14 +87,16 @@ int hwdb_main(int argc, char *argv[], void *userdata) {
                 return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
                                        "Either --update or --test must be used.");
 
-        if (arg_update) {
+        log_notice("udevadm hwdb is deprecated. Use systemd-hwdb instead.");
+
+        if (arg_update && !hwdb_bypass()) {
                 r = hwdb_update(arg_root, arg_hwdb_bin_dir, arg_strict, true);
                 if (r < 0)
                         return r;
         }
 
         if (arg_test)
-                return hwdb_query(arg_test);
+                return hwdb_query(arg_test, NULL);
 
         return 0;
 }