From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0D1E321160A2E for ; Sun, 7 Oct 2018 23:41:18 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Oct 2018 23:41:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,355,1534834800"; d="scan'208";a="79578469" Received: from ray-dev.ccr.corp.intel.com (HELO [10.239.9.11]) ([10.239.9.11]) by orsmga008.jf.intel.com with ESMTP; 07 Oct 2018 23:41:16 -0700 To: Jim.Dailey@dell.com, edk2-devel@lists.01.org Cc: jaben.carsey@intel.com References: From: "Ni, Ruiyu" Message-ID: <3f099bb0-8686-1daf-d283-c2910ada825e@Intel.com> Date: Mon, 8 Oct 2018 14:42:24 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Subject: Re: [PATCH] ShellPkg: Create a homefilesystem environment variable X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Oct 2018 06:41:18 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 10/4/2018 12:02 AM, Jim.Dailey@dell.com wrote: > 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 > --- > 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); > Jim, Creating spec-undefined "homefilesystem" ENV variable is not a good idea in my opinion. Can you submit a Shell Spec change and change the implementation once the spec change is approved? -- Thanks, Ray