]> git.ozlabs.org Git - petitboot/blobdiff - discover/device-handler.c
discover: parse boot message from incoming ACTION_BOOT messages
[petitboot] / discover / device-handler.c
index e65eb61ebc2e353fb4880b4b59260c1f9c969a73..0d4349671dfa6c375f223cde0f43877c41ddad71 100644 (file)
@@ -10,7 +10,7 @@
 #include <talloc/talloc.h>
 #include <list/list.h>
 #include <log/log.h>
-#include <pb-protocol/pb-protocol.h>
+#include <types/types.h>
 #include <system/system.h>
 
 #include "device-handler.h"
 #include "udev.h"
 #include "paths.h"
 
-#define MOUNT_BIN "/bin/mount"
-
-#define UMOUNT_BIN "/bin/umount"
-
 struct device_handler {
        struct discover_server *server;
 
@@ -33,11 +29,6 @@ struct device_handler {
        struct list contexts;
 };
 
-struct mount_map {
-       char *device_path;
-       char *mount_point;
-};
-
 /**
  * device_handler_add - Add a device to the handler device array.
  */
@@ -194,7 +185,7 @@ static int mount_device(struct discover_context *ctx)
                pb_log("couldn't create mount directory %s: %s\n",
                                ctx->mount_path, strerror(errno));
 
-       argv[0] = MOUNT_BIN;
+       argv[0] = pb_system_apps.mount;
        argv[1] = ctx->device_path;
        argv[2] = ctx->mount_path;
        argv[3] = "-o";
@@ -205,7 +196,7 @@ static int mount_device(struct discover_context *ctx)
 
                /* Retry mount without ro option. */
 
-               argv[0] = MOUNT_BIN;
+               argv[0] = pb_system_apps.mount;
                argv[1] = ctx->device_path;
                argv[2] = ctx->mount_path;
                argv[3] = NULL;
@@ -236,7 +227,8 @@ static int umount_device(struct discover_context *ctx)
        }
 
        if (pid == 0) {
-               execl(UMOUNT_BIN, UMOUNT_BIN, ctx->mount_path, NULL);
+               execl(pb_system_apps.umount, pb_system_apps.umount,
+                                               ctx->mount_path, NULL);
                exit(EXIT_FAILURE);
        }