Add a totally hackish video mode change mecanism
[petitboot] / devices.c
index 0a0645096c0a30dcd4830ec210c0a82324215ef7..4936f9ab2adfc515c61ff30a990dcc7cdcfea369 100644 (file)
--- a/devices.c
+++ b/devices.c
@@ -1,4 +1,5 @@
 #include <stdlib.h>
+#include <stdio.h>
 #include <string.h>
 #include <errno.h>
 #include <unistd.h>
@@ -237,7 +238,7 @@ static twin_bool_t pboot_proc_server_sock(int sock, twin_file_op_t ops,
        return TWIN_TRUE;
 }
 
-int pboot_start_device_discovery(void)
+int pboot_start_device_discovery(int udev_trigger)
 {
        int sock;
        struct sockaddr_un addr;
@@ -268,6 +269,12 @@ int pboot_start_device_discovery(void)
 
        twin_set_file(pboot_proc_server_sock, sock, TWIN_READ, &_ctx);
 
+       if (udev_trigger) {
+               int rc = system("udevtrigger");
+               if (rc)
+                       LOG("udevtrigger failed, rc %d\n", rc);
+       }
+
        return TWIN_TRUE;
 }