From patchwork Tue Sep 28 02:57:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lulu Su X-Patchwork-Id: 1533676 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=DOdTN+gB; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HJPXG6Vt7z9t2p for ; Tue, 28 Sep 2021 13:05:50 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HJPXG4zsCz2yPT for ; Tue, 28 Sep 2021 13:05:50 +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=DOdTN+gB; 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.18; helo=segapp02.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=DOdTN+gB; dkim-atps=neutral X-Greylist: delayed 462 seconds by postgrey-1.36 at boromir; Tue, 28 Sep 2021 13:05:43 AEST Received: from segapp02.wistron.com (segapp01.wistron.com [103.200.3.18]) (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 4HJPX7659xz2xr5 for ; Tue, 28 Sep 2021 13:05:42 +1000 (AEST) Received: from EXCHAPP03.whq.wistron (unknown [10.37.38.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by segapp02.wistron.com (MTA) with ESMTPS id 4HJPM75dwGzMqG9W; Tue, 28 Sep 2021 10:57:55 +0800 (CST) Received: from EXCHAPP03.whq.wistron (10.37.38.26) by EXCHAPP03.whq.wistron (10.37.38.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 28 Sep 2021 10:57:54 +0800 Received: from gitserver.wistron.com (10.37.38.233) by EXCHAPP03.whq.wistron (10.37.38.26) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 28 Sep 2021 10:57:54 +0800 From: Lulu Su To: Subject: [PATCH] discover/udev.c: Added warning in system status log Date: Tue, 28 Sep 2021 10:57:30 +0800 Message-ID: <20210928025730.9706-1-Lulu_Su@wistron.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-TM-SNTS-SMTP: AD71F96FD8AA62C7572ADB5E509F68C4E2FE7AA88D3AF0E547B2B32243B748F42000:8 x-msw-jemd-newsletter: false DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wistron.com; s=security; t=1632797877; bh=/CRWOwSkT0Iv7qljbupHZnBpRgBcDPsx41lS29zkzv4=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=DOdTN+gBkynL4kyT1rm9xiMTqWJG0EFjFTX3Z6uTqq+Q2O20sTwHg7WHZV+ca9jPO Z7sgWuWmb4KZyCkecboB7CB+yJAVcdb/5ux/+Bj+7jRn+xW/aB9GrO2qSg0/Y0pA4t Ek2CrsR7D4d1y22S8qiWfgud4naKCjvvw8Z48aqY= 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 , Claire_Ku 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/discover/udev.c b/discover/udev.c index 0c3da66..4d7dcc2 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,13 @@ 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)) && (strlen(name) > strlen(ddev->device->id))) { + char temp[] = "sdx"; + strncpy(temp, name, strlen(ddev->device->id)); + device_handler_status_info(udev->handler, + _("[%s] Duplicate filesystem has been detected (as %s); only listing the first"), + temp, ddev->device->id); + } return 0; } }