From nobody Sun May 19 06:50:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+97870+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+97870+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1672750615; cv=none; d=zohomail.com; s=zohoarc; b=n3ocaFuamRIMvVjnYPQmYm1dliDrLC+016EoImdorTI/erp2/zwqbe+OWoinx+ros0wfgz6Dgc7zU4cVprpbjogDurCwzeFH3/KAjLyqHIVwijbWGz/3JPpnHQGnisBJPCGNfdx5U6WwC4hIjCQ4czsj4nAIBB07DxQjLqop2UM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672750615; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=igNfO6o/LlSoHi8jxE7fxnVK+ubiuMXngUtLp1yXaQo=; b=f/dVSUkLW32VG4xdiiTk1r68q0Lr5iRNXG8TbTPxwscNRrK1ZSHwf0aCX28qsfbxAH4onXdjs7jbnaqsQWa+/QL1zLRm+Ja8o2wn4KD13Hn3AuPu3sjcORpHFIdhL1iW01FimIdKaCCnmSYtBSQ0HfW/j3lIZo7CEELDXlqUu0M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+97870+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 167275061572840.023778285596336; Tue, 3 Jan 2023 04:56:55 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 2pAUYY1788612xbdom42ZIvR; Tue, 03 Jan 2023 04:56:55 -0800 X-Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by mx.groups.io with SMTP id smtpd.web11.62519.1672750614340971424 for ; Tue, 03 Jan 2023 04:56:54 -0800 X-Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 303Bh4OW031784; Tue, 3 Jan 2023 12:56:53 GMT X-Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mtdfevqya-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 03 Jan 2023 12:56:53 +0000 X-Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 303CuqM1024561 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 3 Jan 2023 12:56:52 GMT X-Received: from krabica.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Tue, 3 Jan 2023 04:56:51 -0800 From: "Tomas Pilar (tpilar)" To: CC: Ray Ni , Zhichao Gao Subject: [edk2-devel] [PATCH] ShellPkg: Export default shell delay as PCD Date: Tue, 3 Jan 2023 12:56:38 +0000 Message-ID: <20230103125638.310794-1-tomas@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-ORIG-GUID: DN5acvoCiCybHHysdp6CrknNCmWOgCGA X-Proofpoint-GUID: DN5acvoCiCybHHysdp6CrknNCmWOgCGA Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,quic_tpilar@quicinc.com X-Gm-Message-State: C3RHEyFVPSTOvOESDctZKzkYx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1672750615; bh=fhF7HCKMVnc9mmMkYoUecOw6phqmDs+/US0sd9QipUk=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=VbTM0rT8Zep7wR0nU5uADVbdumPnq07mkAAzhgbZVtf8/zIy/3FLXU6sfSyC8Gmzsl4 lpZgEGU1id7byCkRdKKpBr0ZqwKeqIz2gM9e21jHte95gc0Gg+7zHKkt0pnLnnIf/BWvk HsCktfzSO2HoCVMjvqlWFcT8eoIx+RLjxmU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1672750617805100002 Content-Type: text/plain; charset="utf-8" From: Tomas Pilar Create PcdShellDefaultDelay to configure the default delay the shell provides for the user at the start time if the user wishes to cancel the execution of a potential startup script. The shell application already allows the user to override the delay default value by specifying the -delay cmdline argument. This however cannot be used when loading the shell application using direct boot or when integrating the shell into the platform firmware build. Thus, a PCD can be easily configurerd by the developer either at build time, or even at runtime. Cc: Ray Ni Cc: Zhichao Gao Signed-off-by: Tomas Pilar --- ShellPkg/Application/Shell/Shell.c | 2 +- ShellPkg/Application/Shell/Shell.inf | 1 + ShellPkg/ShellPkg.dec | 4 ++++ ShellPkg/ShellPkg.dsc | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shel= l/Shell.c index df00adfdfa..0ae6e14a34 100644 --- a/ShellPkg/Application/Shell/Shell.c +++ b/ShellPkg/Application/Shell/Shell.c @@ -990,7 +990,7 @@ ProcessCommandLine ( ShellInfoObject.ShellInitSettings.BitUnion.Bits.Delay =3D FALSE; ShellInfoObject.ShellInitSettings.BitUnion.Bits.Exit =3D FALSE; ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoNest =3D FALSE; - ShellInfoObject.ShellInitSettings.Delay =3D 5; + ShellInfoObject.ShellInitSettings.Delay =3D PcdGet3= 2 (PcdShellDefaultDelay); =20 // // Start LoopVar at 0 to parse only optional arguments at Argv[0] diff --git a/ShellPkg/Application/Shell/Shell.inf b/ShellPkg/Application/Sh= ell/Shell.inf index 4c32960a96..f1e41de133 100644 --- a/ShellPkg/Application/Shell/Shell.inf +++ b/ShellPkg/Application/Shell/Shell.inf @@ -103,3 +103,4 @@ gEfiShellPkgTokenSpaceGuid.PcdShellForceConsole ## CONSUMES gEfiShellPkgTokenSpaceGuid.PcdShellSupplier ## CONSUMES gEfiShellPkgTokenSpaceGuid.PcdShellMaxHistoryCommandCount ## CONSUMES + gEfiShellPkgTokenSpaceGuid.PcdShellDefaultDelay ## CONSUMES diff --git a/ShellPkg/ShellPkg.dec b/ShellPkg/ShellPkg.dec index 7b2d1230bd..2ebea0a261 100644 --- a/ShellPkg/ShellPkg.dec +++ b/ShellPkg/ShellPkg.dec @@ -136,3 +136,7 @@ # Up to this many bytes of vendor specific data will be used. Default is= 0 # (disabled). gEfiShellPkgTokenSpaceGuid.PcdShellVendorExtendedDecode|0|UINT32|0x00000= 013 + + ## Controls the default delay the shell will offer to the user at the + # start to check if the user wishes to cancel the script autostart + gEfiShellPkgTokenSpaceGuid.PcdShellDefaultDelay|5|UINT32|0x00000015 diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc index dd0d88603f..1a4e970ce7 100644 --- a/ShellPkg/ShellPkg.dsc +++ b/ShellPkg/ShellPkg.dsc @@ -82,6 +82,7 @@ !ifdef $(NO_SHELL_PROFILES) gEfiShellPkgTokenSpaceGuid.PcdShellProfileMask|0x00 !endif #$(NO_SHELL_PROFILES) + gEfiShellPkgTokenSpaceGuid.PcdShellDefaultDelay|5 =20 [Components] # --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#97870): https://edk2.groups.io/g/devel/message/97870 Mute This Topic: https://groups.io/mt/96027198/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-