diff options
author | Jim.Dailey@dell.com <Jim.Dailey@dell.com> | 2018-10-03 09:02:24 -0700 |
---|---|---|
committer | Jaben Carsey <jaben.carsey@intel.com> | 2018-10-03 11:09:47 -0700 |
commit | c0b1f749ef1304810ed4ea58ded65b7f41d79d3e (patch) | |
tree | 334f9cee9be4f1b942ae6f874dd71ff10290148d /ShellPkg/Application/Shell | |
parent | c526dcd40f3a0f3a091684481f9c85f03f6a70a7 (diff) | |
download | edk2-c0b1f749ef1304810ed4ea58ded65b7f41d79d3e.zip edk2-c0b1f749ef1304810ed4ea58ded65b7f41d79d3e.tar.gz edk2-c0b1f749ef1304810ed4ea58ded65b7f41d79d3e.tar.bz2 |
ShellPkg: Create a homefilesystem environment variable
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>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Diffstat (limited to 'ShellPkg/Application/Shell')
-rw-r--r-- | ShellPkg/Application/Shell/Shell.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shell/Shell.c index 3f3bcbb..6185b6a 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);
|