public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: <Jim.Dailey@dell.com>
To: <edk2-devel@lists.01.org>
Cc: <jaben.carsey@intel.com>, <ruiyu.ni@intel.com>
Subject: [PATCH] ShellPkg: Create a homefilesystem environment variable
Date: Wed, 3 Oct 2018 16:02:24 +0000	[thread overview]
Message-ID: <ae7ca27cc6ff410586d9065a9b2c43f3@ausx13mps335.AMER.DELL.COM> (raw)

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



             reply	other threads:[~2018-10-03 16:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-03 16:02 Jim.Dailey [this message]
2018-10-03 18:15 ` [PATCH] ShellPkg: Create a homefilesystem environment variable 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ae7ca27cc6ff410586d9065a9b2c43f3@ausx13mps335.AMER.DELL.COM \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox