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.web10.65198.1672756926056020054 for ; Tue, 03 Jan 2023 06:42:06 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=jIptJ7Gm; 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 (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 303DFcLp029541; Tue, 3 Jan 2023 14:42:05 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=lWSJWQiNpciJl22hh8170nLzmBM+Vx9Gdq+6r/fbizo=; b=jIptJ7Gm2qSeiZ0h6sRB9jVFw15oYELOHrWaM0MpvafM5Hm4ye0JfJD/Te6+EuDjW6Pv BFV9TY5zvd6HZWlPSW4+L/vtv1LfABdjNcu/VlywG8tktW2Gg4c1I5zme5phARHtD+v3 IPaMU5dPWZn0h4nhMfWWv5Jon6OmS4xGxl4l1n5qbnXqUrpmRXnQPSsiO/JUl9tkhbOA V9nEdNuItyaKFr3aoMTwX0WFlCzaLLkLtbUe8zPS/sPuDQ/RYsNG2G34i0gQUO4oPwUh 8PaqMsh8qJHi5c40PDLA2xgN4ITjSAx+wz0TJJxSPd7TI4bOrvBRMyg6eF11vUNXRCwH Cw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mtd61cxs6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 03 Jan 2023 14:42:05 +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 303Eg3gs004110 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 3 Jan 2023 14:42:03 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 06:42:02 -0800 From: "Tomas Pilar (tpilar)" To: CC: Ray Ni , Zhichao Gao Subject: [PATCH v2 1/1] ShellPkg: Export default shell delay as PCD Date: Tue, 3 Jan 2023 14:41:55 +0000 Message-ID: <20230103144155.321703-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: PcrFVgxc91UYCCGrZd11ZoaPbtRy3yQL X-Proofpoint-ORIG-GUID: PcrFVgxc91UYCCGrZd11ZoaPbtRy3yQL 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 impostorscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 mlxlogscore=999 clxscore=1015 suspectscore=0 phishscore=0 spamscore=0 adultscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301030127 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/ShellPkg.dsc | 1 + ShellPkg/Application/Shell/Shell.inf | 1 + ShellPkg/Application/Shell/Shell.c | 2 +- 4 files changed, 7 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/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc index dd0d88603f11..1a4e970ce746 100644 --- a/ShellPkg/ShellPkg.dsc +++ b/ShellPkg/ShellPkg.dsc @@ -82,6 +82,7 @@ [PcdsFixedAtBuild] !ifdef $(NO_SHELL_PROFILES) gEfiShellPkgTokenSpaceGuid.PcdShellProfileMask|0x00 !endif #$(NO_SHELL_PROFILES) + gEfiShellPkgTokenSpaceGuid.PcdShellDefaultDelay|5 [Components] # 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