From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.web11.69032.1672765359611160405 for ; Tue, 03 Jan 2023 09:02:39 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=REV7HBH6; 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.168.131, mailfrom: quic_tpilar@quicinc.com) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 303GHBRM013181; Tue, 3 Jan 2023 17:02:39 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=oYhEl3yKeC1AHInlFBvOoBENG5B5rdLkIoyPD5qDfGQ=; b=REV7HBH6RlfnYTjO7UGcExdSsN7Ria0eZywUqJchYOGxFHQj6pD70jlXUXQFyP9Clf7t FW/rEN5NiX5350NS/GmnN07nhKjN3s7GMNQCQQN5n85dAJX2YXAixKYa3SXRicVgwUlx En0isHIe1s25LzEy11kDlzqiYzh0WrScJMK6bnPzoMHemjA5+s6LvzfZ9uluB12o+oLR cKFqkiDj5aNDPE335r6Vpree+3rvF3rV9hHcEYupObFzhGwxO8JAZfTlsJUpI41Nwk0Z gP4K5V3324ZmHYHGCyL0K20rFXc3AjTGS+LQGv3H7hXfFnmxaz8JsCVX6jlDkoZ6ilcC sg== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mvqr782vs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 03 Jan 2023 17:02:39 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 303H2cbY031418 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 3 Jan 2023 17:02:38 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 09:02:37 -0800 From: "Tomas Pilar (tpilar)" To: CC: Ray Ni , Zhichao Gao Subject: [PATCH v3 1/1] ShellPkg: Export default shell delay as PCD Date: Tue, 3 Jan 2023 17:02:29 +0000 Message-ID: <20230103170229.328712-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: nasanex01a.na.qualcomm.com (10.52.223.231) 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-GUID: Ct209uyiOVL9SL2KtwVI-m4MYU9SKHV0 X-Proofpoint-ORIG-GUID: Ct209uyiOVL9SL2KtwVI-m4MYU9SKHV0 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_05,2023-01-03_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 mlxscore=0 spamscore=0 clxscore=1015 suspectscore=0 mlxlogscore=999 lowpriorityscore=0 malwarescore=0 adultscore=0 priorityscore=1501 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301030145 Content-Transfer-Encoding: 8bit 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/ShellPkg.dec | 4 ++++ ShellPkg/Application/Shell/Shell.inf | 1 + ShellPkg/Application/Shell/Shell.c | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ShellPkg/ShellPkg.dec b/ShellPkg/ShellPkg.dec index 7b2d1230bd2c..2ebea0a2615f 100644 --- a/ShellPkg/ShellPkg.dec +++ b/ShellPkg/ShellPkg.dec @@ -136,3 +136,7 @@ [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] # Up to this many bytes of vendor specific data will be used. Default is 0 # (disabled). gEfiShellPkgTokenSpaceGuid.PcdShellVendorExtendedDecode|0|UINT32|0x00000013 + + ## 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/Application/Shell/Shell.inf b/ShellPkg/Application/Shell/Shell.inf index 4c32960a9687..f1e41de133d1 100644 --- a/ShellPkg/Application/Shell/Shell.inf +++ b/ShellPkg/Application/Shell/Shell.inf @@ -103,3 +103,4 @@ [Pcd] gEfiShellPkgTokenSpaceGuid.PcdShellForceConsole ## CONSUMES gEfiShellPkgTokenSpaceGuid.PcdShellSupplier ## CONSUMES gEfiShellPkgTokenSpaceGuid.PcdShellMaxHistoryCommandCount ## CONSUMES + gEfiShellPkgTokenSpaceGuid.PcdShellDefaultDelay ## CONSUMES diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shell/Shell.c index df00adfdfa5b..0ae6e14a34bf 100644 --- a/ShellPkg/Application/Shell/Shell.c +++ b/ShellPkg/Application/Shell/Shell.c @@ -990,7 +990,7 @@ ProcessCommandLine ( ShellInfoObject.ShellInitSettings.BitUnion.Bits.Delay = FALSE; ShellInfoObject.ShellInitSettings.BitUnion.Bits.Exit = FALSE; ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoNest = FALSE; - ShellInfoObject.ShellInitSettings.Delay = 5; + ShellInfoObject.ShellInitSettings.Delay = PcdGet32 (PcdShellDefaultDelay); // // Start LoopVar at 0 to parse only optional arguments at Argv[0] -- 2.34.1