[PATCH] discover/udev.c: Added warning in system status log

Lulu Su Lulu_Su at wistron.com
Fri Jul 9 12:19:56 AEST 2021


From: LuluTHSu <Lulu_Su at wistron.com>

When the same iso files are installed at the same time,
the petitboot menu will only display the installed device first,
and will not notify the user that the same iso file has been installed,
so an alert is added to the system status log to remind the user that
they have mounted the same iso file.

Signed-off-by: LuluTHSu <Lulu_Su at wistron.com>
---
 discover/udev.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/discover/udev.c b/discover/udev.c
index 0c3da66..e6f67e6 100644
--- a/discover/udev.c
+++ b/discover/udev.c
@@ -20,6 +20,7 @@
 #include <waiter/waiter.h>
 #include <system/system.h>
 #include <process/process.h>
+#include <i18n/i18n.h>
 
 #include "event.h"
 #include "udev.h"
@@ -184,6 +185,11 @@ static int udev_handle_block_add(struct pb_udev *udev, struct udev_device *dev,
 		if (ddev) {
 			pb_log("SKIP: %s UUID [%s] already present (as %s)\n",
 					name, uuid, ddev->device->id);
+			if (strncmp(name, ddev->device->id, strlen(ddev->device->id))) {
+				ddev = discover_device_create(udev->handler, NULL, name);
+				device_handler_status_dev_info(udev->handler, ddev,
+				_("The list doesn't support displaying the same mount file"));
+			}
 			return 0;
 		}
 	}
-- 
2.7.4


---------------------------------------------------------------------------------------------------------------------------------------------------------------
This email contains confidential or legally privileged information and is for the sole use of its intended recipient. 
Any unauthorized review, use, copying or distribution of this email or the content of this email is strictly prohibited.
If you are not the intended recipient, you may reply to the sender and should delete this e-mail immediately.
---------------------------------------------------------------------------------------------------------------------------------------------------------------



More information about the Petitboot mailing list