public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v3 1/1] ShellPkg: Export default shell delay as PCD
@ 2023-01-03 17:02 Tomas Pilar (tpilar)
  2023-01-10 12:09 ` [edk2-devel] " Tomas Pilar (tpilar)
  2023-01-20 15:55 ` Michael D Kinney
  0 siblings, 2 replies; 5+ messages in thread
From: Tomas Pilar (tpilar) @ 2023-01-03 17:02 UTC (permalink / raw)
  To: devel; +Cc: Ray Ni, Zhichao Gao

From: Tomas Pilar <quic_tpilar@quicinc.com>

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 <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Tomas Pilar <tomas@quicinc.com>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [PATCH v3 1/1] ShellPkg: Export default shell delay as PCD
  2023-01-03 17:02 [PATCH v3 1/1] ShellPkg: Export default shell delay as PCD Tomas Pilar (tpilar)
@ 2023-01-10 12:09 ` Tomas Pilar (tpilar)
  2023-01-20  2:25   ` Rebecca Cran
  2023-01-20 15:55 ` Michael D Kinney
  1 sibling, 1 reply; 5+ messages in thread
From: Tomas Pilar (tpilar) @ 2023-01-10 12:09 UTC (permalink / raw)
  To: devel; +Cc: Ray Ni, Zhichao Gao

Hi,

Any chance you could review this change? It's fairly simple.

Cheers,
Tom

On 03/01/2023 17:02, Tomas Pilar (tpilar) wrote:
> From: Tomas Pilar <quic_tpilar@quicinc.com>
>
> 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 <ray.ni@intel.com>
> Cc: Zhichao Gao <zhichao.gao@intel.com>
> Signed-off-by: Tomas Pilar <tomas@quicinc.com>
> ---
>   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]


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [PATCH v3 1/1] ShellPkg: Export default shell delay as PCD
  2023-01-10 12:09 ` [edk2-devel] " Tomas Pilar (tpilar)
@ 2023-01-20  2:25   ` Rebecca Cran
  0 siblings, 0 replies; 5+ messages in thread
From: Rebecca Cran @ 2023-01-20  2:25 UTC (permalink / raw)
  To: devel, quic_tpilar; +Cc: Ray Ni, Zhichao Gao

Could someone review this please?


--

Rebecca Cran


On 1/10/23 05:09, Tomas Pilar (tpilar) wrote:
> Hi,
>
> Any chance you could review this change? It's fairly simple.
>
> Cheers,
> Tom
>
> On 03/01/2023 17:02, Tomas Pilar (tpilar) wrote:
>> From: Tomas Pilar <quic_tpilar@quicinc.com>
>>
>> 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 <ray.ni@intel.com>
>> Cc: Zhichao Gao <zhichao.gao@intel.com>
>> Signed-off-by: Tomas Pilar <tomas@quicinc.com>
>> ---
>>   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]
>
>
>
> 
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [PATCH v3 1/1] ShellPkg: Export default shell delay as PCD
  2023-01-03 17:02 [PATCH v3 1/1] ShellPkg: Export default shell delay as PCD Tomas Pilar (tpilar)
  2023-01-10 12:09 ` [edk2-devel] " Tomas Pilar (tpilar)
@ 2023-01-20 15:55 ` Michael D Kinney
  2023-01-20 16:44   ` Michael D Kinney
  1 sibling, 1 reply; 5+ messages in thread
From: Michael D Kinney @ 2023-01-20 15:55 UTC (permalink / raw)
  To: devel@edk2.groups.io, quic_tpilar@quicinc.com
  Cc: Ni, Ray, Gao, Zhichao, Kinney, Michael D

Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>

Mike

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Tomas Pilar (tpilar)
> Sent: Tuesday, January 3, 2023 9:02 AM
> To: devel@edk2.groups.io
> Cc: Ni, Ray <ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>
> Subject: [edk2-devel] [PATCH v3 1/1] ShellPkg: Export default shell delay as PCD
> 
> From: Tomas Pilar <quic_tpilar@quicinc.com>
> 
> 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 <ray.ni@intel.com>
> Cc: Zhichao Gao <zhichao.gao@intel.com>
> Signed-off-by: Tomas Pilar <tomas@quicinc.com>
> ---
>  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
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [PATCH v3 1/1] ShellPkg: Export default shell delay as PCD
  2023-01-20 15:55 ` Michael D Kinney
@ 2023-01-20 16:44   ` Michael D Kinney
  0 siblings, 0 replies; 5+ messages in thread
From: Michael D Kinney @ 2023-01-20 16:44 UTC (permalink / raw)
  To: devel@edk2.groups.io, quic_tpilar@quicinc.com
  Cc: Ni, Ray, Gao, Zhichao, Kinney, Michael D

Merged

PR: https://github.com/tianocore/edk2/pull/3937
Commit: https://github.com/tianocore/edk2/commit/e96a5734f6b1b1d38a60d9ecf77a453ae2fc8303

Mike


> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Friday, January 20, 2023 7:56 AM
> To: devel@edk2.groups.io; quic_tpilar@quicinc.com
> Cc: Ni, Ray <ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>
> Subject: RE: [edk2-devel] [PATCH v3 1/1] ShellPkg: Export default shell delay as PCD
> 
> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
> 
> Mike
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Tomas Pilar (tpilar)
> > Sent: Tuesday, January 3, 2023 9:02 AM
> > To: devel@edk2.groups.io
> > Cc: Ni, Ray <ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>
> > Subject: [edk2-devel] [PATCH v3 1/1] ShellPkg: Export default shell delay as PCD
> >
> > From: Tomas Pilar <quic_tpilar@quicinc.com>
> >
> > 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 <ray.ni@intel.com>
> > Cc: Zhichao Gao <zhichao.gao@intel.com>
> > Signed-off-by: Tomas Pilar <tomas@quicinc.com>
> > ---
> >  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
> >
> >
> >
> > 
> >


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-01-20 16:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-03 17:02 [PATCH v3 1/1] ShellPkg: Export default shell delay as PCD Tomas Pilar (tpilar)
2023-01-10 12:09 ` [edk2-devel] " Tomas Pilar (tpilar)
2023-01-20  2:25   ` Rebecca Cran
2023-01-20 15:55 ` Michael D Kinney
2023-01-20 16:44   ` Michael D Kinney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox