public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] ShellPkg: Create a homefilesystem environment variable
@ 2018-10-03 16:02 Jim.Dailey
  2018-10-03 18:15 ` Carsey, Jaben
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Jim.Dailey @ 2018-10-03 16:02 UTC (permalink / raw)
  To: edk2-devel; +Cc: jaben.carsey, ruiyu.ni

Create a homefilesystem environment variable whose value is the file
system on which the executing shell is located. For example: "FS14:".

This eliminates the need for people to have to try and find the "boot"
file system in their startup script.  After this change they can simply
execute %homefilesystem% to set the cwd to the root of the file system
where the shell is located.

A future enhancement could be to add "homefilesystem" to the list of
predefined, read-only variables listed in the EfiShellSetEnv function of
file ShellProtocol.c

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jim Dailey <jim_dailey@dell.com>
---
 ShellPkg/Application/Shell/Shell.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shell/Shell.c
index 3f3bcbb4b0..6185b6ac80 100644
--- a/ShellPkg/Application/Shell/Shell.c
+++ b/ShellPkg/Application/Shell/Shell.c
@@ -1169,6 +1169,8 @@ LocateStartupScript (
       *TempSpot = CHAR_NULL;
     }
 
+    InternalEfiShellSetEnv(L"homefilesystem", StartupScriptPath, TRUE);
+
     StartupScriptPath = StrnCatGrow (&StartupScriptPath, &Size, ((FILEPATH_DEVICE_PATH *)FileDevicePath)->PathName, 0);
     PathRemoveLastItem (StartupScriptPath);
     StartupScriptPath = StrnCatGrow (&StartupScriptPath, &Size, mStartupScript, 0);
-- 
2.17.0.windows.1



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

end of thread, other threads:[~2018-10-09  4:32 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-03 16:02 [PATCH] ShellPkg: Create a homefilesystem environment variable Jim.Dailey
2018-10-03 18:15 ` Carsey, Jaben
2018-10-03 18:17 ` Carsey, Jaben
2018-10-04 17:07   ` Laszlo Ersek
2018-10-04 19:05     ` Jim.Dailey
2018-10-04 19:20       ` Laszlo Ersek
2018-10-04 19:19     ` Andrew Fish
2018-10-04 20:54       ` Carsey, Jaben
2018-10-05 11:32         ` Laszlo Ersek
2018-10-05 12:19           ` Tim Lewis
2018-10-09  4:33             ` Ni, Ruiyu
2018-10-05 15:00           ` Carsey, Jaben
2018-10-05 17:47             ` Laszlo Ersek
2018-10-08  6:42 ` Ni, Ruiyu
2018-10-08 13:58   ` Jim.Dailey

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