]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Export default shell delay as PCD
authorTomas Pilar <quic_tpilar@quicinc.com>
Tue, 3 Jan 2023 17:02:29 +0000 (09:02 -0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 20 Jan 2023 16:43:51 +0000 (16:43 +0000)
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 configured by the developer
either at build time, or even at runtime.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Tomas Pilar <tomas@quicinc.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
ShellPkg/Application/Shell/Shell.c
ShellPkg/Application/Shell/Shell.inf
ShellPkg/ShellPkg.dec

index df00adfdfa5b38f00867256720389df9b3b4d249..0ae6e14a34bfcb65936516913acf9088c5e7b3fe 100644 (file)
@@ -990,7 +990,7 @@ ProcessCommandLine (
   ShellInfoObject.ShellInitSettings.BitUnion.Bits.Delay        = FALSE;\r
   ShellInfoObject.ShellInitSettings.BitUnion.Bits.Exit         = FALSE;\r
   ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoNest       = FALSE;\r
-  ShellInfoObject.ShellInitSettings.Delay                      = 5;\r
+  ShellInfoObject.ShellInitSettings.Delay                      = PcdGet32 (PcdShellDefaultDelay);\r
 \r
   //\r
   // Start LoopVar at 0 to parse only optional arguments at Argv[0]\r
index 4c32960a968704fc979acd80d65ad3c16443db68..f1e41de133d14973b3f4e526e79c201693e57799 100644 (file)
   gEfiShellPkgTokenSpaceGuid.PcdShellForceConsole           ## CONSUMES\r
   gEfiShellPkgTokenSpaceGuid.PcdShellSupplier               ## CONSUMES\r
   gEfiShellPkgTokenSpaceGuid.PcdShellMaxHistoryCommandCount ## CONSUMES\r
+  gEfiShellPkgTokenSpaceGuid.PcdShellDefaultDelay           ## CONSUMES\r
index 7b2d1230bd2cc13bbf4f325dad67b7717988c1df..2ebea0a2615f93f08d3e5c6f6e2dc13fc0e62db4 100644 (file)
   # Up to this many bytes of vendor specific data will be used. Default is 0\r
   # (disabled).\r
   gEfiShellPkgTokenSpaceGuid.PcdShellVendorExtendedDecode|0|UINT32|0x00000013\r
+\r
+  ## Controls the default delay the shell will offer to the user at the\r
+  # start to check if the user wishes to cancel the script autostart\r
+  gEfiShellPkgTokenSpaceGuid.PcdShellDefaultDelay|5|UINT32|0x00000015\r