]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Create a homefilesystem environment variable
authorJim.Dailey@dell.com <Jim.Dailey@dell.com>
Wed, 3 Oct 2018 16:02:24 +0000 (09:02 -0700)
committerJaben Carsey <jaben.carsey@intel.com>
Wed, 3 Oct 2018 18:09:47 +0000 (11:09 -0700)
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>
ShellPkg/Application/Shell/Shell.c

index 3f3bcbb4b0ec6b9ae31c03df7b8387b137023794..6185b6ac80044e36a06977ed5f361bf9737add3b 100644 (file)
@@ -1169,6 +1169,8 @@ LocateStartupScript (
       *TempSpot = CHAR_NULL;\r
     }\r
 \r
+    InternalEfiShellSetEnv(L"homefilesystem", StartupScriptPath, TRUE);\r
+\r
     StartupScriptPath = StrnCatGrow (&StartupScriptPath, &Size, ((FILEPATH_DEVICE_PATH *)FileDevicePath)->PathName, 0);\r
     PathRemoveLastItem (StartupScriptPath);\r
     StartupScriptPath = StrnCatGrow (&StartupScriptPath, &Size, mStartupScript, 0);\r