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>
This commit is contained in:
Jim.Dailey@dell.com 2018-10-03 09:02:24 -07:00 committed by Jaben Carsey
parent c526dcd40f
commit c0b1f749ef
1 changed files with 2 additions and 0 deletions

View File

@ -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);