]> git.ozlabs.org Git - petitboot/blobdiff - discover/paths.c
Add discover server options
[petitboot] / discover / paths.c
index 5b550fabb2460537a868c33ed784fed1ff7c9582..fe7a87635fe7384642cb0400d2c4d4497032358a 100644 (file)
@@ -81,14 +81,6 @@ char *parse_device_path(void *alloc_ctx,
        if (is_prefix(dev_str, "/dev/"))
                dev_str += strlen("/dev/");
 
        if (is_prefix(dev_str, "/dev/"))
                dev_str += strlen("/dev/");
 
-       /* PS3 hack: if we're reading from a ps3dx device, and we refer to
-        * a sdx device, remap to ps3dx */
-       if (cur_dev && is_prefix(cur_dev, "/dev/ps3d")
-                       && is_prefix(dev_str, "sd")) {
-               snprintf(tmp, 255, "ps3d%s", dev_str + 2);
-               dev_str = tmp;
-       }
-
        return join_paths(alloc_ctx, "/dev", dev_str);
 }
 
        return join_paths(alloc_ctx, "/dev", dev_str);
 }
 
@@ -116,9 +108,17 @@ const char *mountpoint_for_device(const char *dev)
 
 char *resolve_path(void *alloc_ctx, const char *path, const char *current_dev)
 {
 
 char *resolve_path(void *alloc_ctx, const char *path, const char *current_dev)
 {
+       static const char s_file[] = "file://";
        char *ret;
        const char *devpath, *sep;
 
        char *ret;
        const char *devpath, *sep;
 
+       /* test for urls */
+
+       if (!strncasecmp(path, s_file, sizeof(s_file) - 1))
+               path += sizeof(s_file) - 1;
+       else if (strstr(path, "://"))
+               return talloc_strdup(alloc_ctx, path);
+
        sep = strchr(path, ':');
        if (!sep) {
                devpath = mountpoint_for_device(current_dev);
        sep = strchr(path, ':');
        if (!sep) {
                devpath = mountpoint_for_device(current_dev);