From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=mmJuoTpw; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: quicinc.com, ip: 205.220.180.131, mailfrom: quic_tpilar@quicinc.com) 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=o4LPrJv+N0LlEFaDY4ZgeXToTeCPv8dBo7Az2q5m5OE=; b=mmJuoTpwBlgoyjP1+Vi5M7Sc76961lh8T17VsgIh8UwXvg0P8wEL9wFcbZ9xTmdNxNkI txrKugq3iydQfopTppLDSu1VIUjXW8PiXIy0JeyuuQ7GJtcH1UDLmlfV1kWMtdcs5GcT CsY5GqEmw2h8M+jXUVoO0HcsB2xgNdy0Xj+QRUQcvtAjgRoGdztKg1ZWJwccOffFkl3j M8aI/KsVn5XrUfHP63yoFZER6d5n1eHbhvTfEWp3BIwqlISgNMaFAsylQFHWLwypeExi ZksZjiNnvlzF6CkR6PLN0RKJoiN1uXHycszUl4EwbFua7gm7M5sFHwNJn33zyoVzxVsL fQ== 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 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 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: [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> X-Mailer: git-send-email 2.34.1 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-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: DN5acvoCiCybHHysdp6CrknNCmWOgCGA X-Proofpoint-GUID: DN5acvoCiCybHHysdp6CrknNCmWOgCGA X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-03_04,2023-01-03_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 mlxscore=0 mlxlogscore=999 lowpriorityscore=0 phishscore=0 spamscore=0 malwarescore=0 priorityscore=1501 clxscore=1011 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301030112 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain 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;= =0D ShellInfoObject.ShellInitSettings.BitUnion.Bits.Exit =3D FALSE;= =0D ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoNest =3D FALSE;= =0D - ShellInfoObject.ShellInitSettings.Delay =3D 5;=0D + ShellInfoObject.ShellInitSettings.Delay =3D PcdGet3= 2 (PcdShellDefaultDelay);=0D =0D //=0D // Start LoopVar at 0 to parse only optional arguments at Argv[0]=0D 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=0D gEfiShellPkgTokenSpaceGuid.PcdShellSupplier ## CONSUMES=0D gEfiShellPkgTokenSpaceGuid.PcdShellMaxHistoryCommandCount ## CONSUMES=0D + gEfiShellPkgTokenSpaceGuid.PcdShellDefaultDelay ## CONSUMES=0D 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=0D # (disabled).=0D gEfiShellPkgTokenSpaceGuid.PcdShellVendorExtendedDecode|0|UINT32|0x00000= 013=0D +=0D + ## Controls the default delay the shell will offer to the user at the=0D + # start to check if the user wishes to cancel the script autostart=0D + gEfiShellPkgTokenSpaceGuid.PcdShellDefaultDelay|5|UINT32|0x00000015=0D 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)=0D gEfiShellPkgTokenSpaceGuid.PcdShellProfileMask|0x00=0D !endif #$(NO_SHELL_PROFILES)=0D + gEfiShellPkgTokenSpaceGuid.PcdShellDefaultDelay|5=0D =0D [Components]=0D #=0D --=20 2.34.1