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=jaben.carsey@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 07A9221161209 for ; Wed, 3 Oct 2018 11:18:20 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Oct 2018 11:18:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,336,1534834800"; d="scan'208";a="262593243" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga005.jf.intel.com with ESMTP; 03 Oct 2018 11:15:21 -0700 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 3 Oct 2018 11:15:20 -0700 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.16]) by fmsmsx121.amr.corp.intel.com ([169.254.6.136]) with mapi id 14.03.0319.002; Wed, 3 Oct 2018 11:15:20 -0700 From: "Carsey, Jaben" To: "Jim.Dailey@dell.com" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH] ShellPkg: Create a homefilesystem environment variable Thread-Index: AdRbMjJ4cc1XSlJiRZyfjsjE3w8hwgAEhxQA Date: Wed, 3 Oct 2018 18:15:20 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjJkZTU2NmUtNTE2YS00NDYzLTk5ZGEtNjljOGE0M2Q1M2ZkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibEFXMHVhK1NiZ0FKK25zMDhRK05lZ0ZUaTFCNG9NenFBWmxSN0tnU2ljKzRqcWl4TWpDVytKc1kzdTdudlJCMyJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.1.200.107] MIME-Version: 1.0 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: Wed, 03 Oct 2018 18:18:20 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jaben Carsey > -----Original Message----- > From: Jim.Dailey@dell.com [mailto:Jim.Dailey@dell.com] > Sent: Wednesday, October 03, 2018 9:02 AM > To: edk2-devel@lists.01.org > Cc: Carsey, Jaben ; Ni, Ruiyu > Subject: [edk2] [PATCH] ShellPkg: Create a homefilesystem environment > variable > Importance: High >=20 > Create a homefilesystem environment variable whose value is the file > system on which the executing shell is located. For example: "FS14:". >=20 > 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. >=20 > 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 >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Jim Dailey > --- > ShellPkg/Application/Shell/Shell.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > 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 =3D CHAR_NULL; > } >=20 > + InternalEfiShellSetEnv(L"homefilesystem", StartupScriptPath, TRUE); > + > StartupScriptPath =3D StrnCatGrow (&StartupScriptPath, &Size, > ((FILEPATH_DEVICE_PATH *)FileDevicePath)->PathName, 0); > PathRemoveLastItem (StartupScriptPath); > StartupScriptPath =3D StrnCatGrow (&StartupScriptPath, &Size, > mStartupScript, 0); > -- > 2.17.0.windows.1