+void udev_set_values(struct udevice *udev, const char* devpath,
+ const char *subsystem, const char* action)
+{
+ memset(udev, 0x00, sizeof(struct udevice));
+ strfieldcpy(udev->devpath, devpath);
+ strfieldcpy(udev->subsystem, subsystem);
+ strfieldcpy(udev->action, action);
+ udev->type = get_device_type(devpath, subsystem);
+}
+
+int kernel_release_satisfactory(int version, int patchlevel, int sublevel)
+{
+ static struct utsname uts;
+ static int kversion = 0;
+ static int kpatchlevel;
+ static int ksublevel;
+
+ if (kversion == 0) {
+ if (uname(&uts) != 0)
+ return -1;
+
+ if (sscanf (uts.release, "%u.%u.%u", &kversion, &kpatchlevel, &ksublevel) != 3) {
+ kversion = 0;
+ return -1;
+ }
+ }
+
+ if (kversion >= version && kpatchlevel >= patchlevel && ksublevel >= sublevel)
+ return 1;
+ else
+ return 0;
+}
+
+int create_path(const char *path)
+{
+ char p[NAME_SIZE];
+ char *pos;
+ struct stat stats;
+
+ strcpy (p, path);
+ pos = strrchr(p, '/');
+ if (pos == p || pos == NULL)
+ return 0;
+
+ while (pos[-1] == '/')
+ pos--;
+
+ pos[0] = '\0';
+
+ dbg("stat '%s'\n", p);
+ if (stat (p, &stats) == 0 && (stats.st_mode & S_IFMT) == S_IFDIR)
+ return 0;
+
+ if (create_path (p) != 0)
+ return -1;
+
+ dbg("mkdir '%s'\n", p);
+ return mkdir(p, 0755);
+}
+