From patchwork Fri Jul 9 02:19:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lulu Su X-Patchwork-Id: 1503159 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=wistron.com header.i=@wistron.com header.a=rsa-sha256 header.s=security header.b=WoIZSWNQ; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GLvCK5Jt2z9sWS for ; Fri, 9 Jul 2021 23:29:33 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GLvCK06HCz30DN for ; Fri, 9 Jul 2021 23:29:33 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=wistron.com header.i=@wistron.com header.a=rsa-sha256 header.s=security header.b=WoIZSWNQ; dkim-atps=neutral X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=wistron.com (client-ip=103.200.3.20; helo=segapp03.wistron.com; envelope-from=lulu_su@wistron.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=wistron.com header.i=@wistron.com header.a=rsa-sha256 header.s=security header.b=WoIZSWNQ; dkim-atps=neutral Received: from segapp03.wistron.com (segapp03.wistron.com [103.200.3.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4GLcNM50RVz303h for ; Fri, 9 Jul 2021 12:21:22 +1000 (AEST) Received: from EXCHAPP02.whq.wistron (unknown [10.37.38.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by segapp03.wistron.com (MTA) with ESMTPS id 4GLcM36rwTz51kCt; Fri, 9 Jul 2021 10:20:15 +0800 (CST) Received: from EXCHAPP04.whq.wistron (10.37.38.27) by EXCHAPP02.whq.wistron (10.37.38.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 9 Jul 2021 10:20:14 +0800 Received: from gitserver.wistron.com (10.37.38.233) by EXCHAPP04.whq.wistron (10.37.38.27) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Fri, 9 Jul 2021 10:20:14 +0800 From: Lulu Su To: Subject: [PATCH] discover/udev.c: Added warning in system status log Date: Fri, 9 Jul 2021 10:19:56 +0800 Message-ID: <20210709021956.21244-1-Lulu_Su@wistron.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-TM-SNTS-SMTP: CEC52F624112CCA069FFE2E03E2550768CF0F0DB788862C634CDC3A6721A8F522000:8 x-msw-jemd-newsletter: false DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wistron.com; s=security; t=1625797279; bh=4HHc6KPYFMIwSrE+psn89cvrU8jc9bcEJuSF8AQK4Pk=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=WoIZSWNQ/4/YUTM9ZoHwfHhu8j5GwuqewDXETBCmuu44IqwmgZ0tKXa5pYBZ6LOIS N9ILV8XrSA14prd7ms0xEi8NRMlSu+k9T+WaFnUeHXNRRMY4J96GzXxt1rehMDJ7xE jzti9lseMjNBeD4RtmAQacMwwVe9K1AJO6My6aIk= X-Mailman-Approved-At: Fri, 09 Jul 2021 23:29:30 +1000 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Erich J Hauptli , Ryan Grimm , Claire_Ku , LuluTHSu Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" From: LuluTHSu 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 --- 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 #include #include +#include #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; } }