- /* normalise '/dev/foo' to 'foo' for easy comparisons, we'll expand
- * back before returning.
- */
- 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;
+static void load_sftp(struct load_task *task)
+{
+ const char *argv[] = {
+ pb_system_apps.sftp,
+ NULL, /* 1: host:path */
+ NULL, /* 2: local file */
+ NULL,
+ };
+
+ argv[1] = talloc_asprintf(task, "%s:%s",
+ task->url->host, task->url->path);
+ load_process_to_local_file(task, argv, 2);
+}
+
+static enum tftp_type check_tftp_type(void *ctx)
+{
+ const char *argv[] = { pb_system_apps.tftp, "-V", NULL };
+ struct process *process;
+ enum tftp_type type;
+
+ process = process_create(ctx);
+ process->path = pb_system_apps.tftp;
+ process->argv = argv;
+ process->keep_stdout = true;
+ process->add_stderr = true;
+ process_run_sync(process);
+
+ if (!process->stdout_buf || process->stdout_len == 0) {
+ pb_log("Can't check TFTP client type!\n");
+ type = TFTP_TYPE_BROKEN;
+
+ } else if (memmem(process->stdout_buf, process->stdout_len,
+ "tftp-hpa", strlen("tftp-hpa"))) {
+ pb_debug("Found TFTP client type: tftp-hpa\n");
+ type = TFTP_TYPE_HPA;
+
+ } else if (memmem(process->stdout_buf, process->stdout_len,
+ "BusyBox", strlen("BusyBox"))) {
+ pb_debug("Found TFTP client type: BusyBox tftp\n");
+ type = TFTP_TYPE_BUSYBOX;
+
+ } else {
+ pb_log("Unknown TFTP client type!\n");
+ type = TFTP_TYPE_BROKEN;