From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=68.232.149.218; helo=esa8.dell-outbound.iphmx.com; envelope-from=jim.dailey@dell.com; receiver=edk2-devel@lists.01.org Received: from esa8.dell-outbound.iphmx.com (esa8.dell-outbound.iphmx.com [68.232.149.218]) (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 754DD210FCF7F for ; Wed, 3 Oct 2018 09:02:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1538582554; x=1570118554; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=sQJcdoIXSoGyPe/J+kara0ayQcuEfgpZiakkyQm8PZo=; b=EjkB/4/CwqLiznhVhfc1V0npPruzylxicjMLVhGmtWZjhDrSBXVKRPN4 QiCO3WQnWp/+WyxUmGS/AXjjRDxUYEi1THdwYB+zSZLWs1jXx6MK+z76X yke+LP/bKnUsVdbJe2WsW7yMKGbvKbQdXIgwIwByrkFx3IarjhIg8c34m A=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2EYAAC857RbhyWd50NcHAEBAQQBAQc?= =?us-ascii?q?EAQGBUYNzKAqLf1+PPpRngXoLhGyEIyE0GAEDAQECAQECAQECEAEBARUJCCk?= =?us-ascii?q?vgjUigmUWFRM/EgE+aAEEDgUIGoJ/ggKacolXAQEBgWgzihKLIYIXiW+EaSI?= =?us-ascii?q?CnH1QBwKQNh+BSodthiuVKgIEAgQFAhSBQjeBV3BQgmyCM44hb4x2gR8BAQ?= X-IPAS-Result: =?us-ascii?q?A2EYAAC857RbhyWd50NcHAEBAQQBAQcEAQGBUYNzKAqLf?= =?us-ascii?q?1+PPpRngXoLhGyEIyE0GAEDAQECAQECAQECEAEBARUJCCkvgjUigmUWFRM/E?= =?us-ascii?q?gE+aAEEDgUIGoJ/ggKacolXAQEBgWgzihKLIYIXiW+EaSICnH1QBwKQNh+BS?= =?us-ascii?q?odthiuVKgIEAgQFAhSBQjeBV3BQgmyCM44hb4x2gR8BAQ?= Received: from mx0b-00154901.pphosted.com ([67.231.157.37]) by esa8.dell-outbound.iphmx.com with ESMTP/TLS/AES256-SHA256; 03 Oct 2018 11:02:33 -0500 Received: from pps.filterd (m0144103.ppops.net [127.0.0.1]) by mx0b-00154901.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w93FwMxl096305 for ; Wed, 3 Oct 2018 12:02:32 -0400 Received: from esa5.dell-outbound2.iphmx.com (esa5.dell-outbound2.iphmx.com [68.232.153.203]) by mx0b-00154901.pphosted.com with ESMTP id 2mvxq78wxw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 03 Oct 2018 12:02:32 -0400 From: Received: from ausc60pc101.us.dell.com ([143.166.85.206]) by esa5.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA256; 03 Oct 2018 22:01:24 +0600 X-LoopCount0: from 10.166.136.212 X-IronPort-AV: E=Sophos;i="5.54,336,1534827600"; d="scan'208";a="1307372497" To: CC: , Thread-Topic: [edk2] [PATCH] ShellPkg: Create a homefilesystem environment variable Thread-Index: AdRbMjJ4cc1XSlJiRZyfjsjE3w8hwg== Date: Wed, 3 Oct 2018 16:02:24 +0000 Message-ID: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Enabled=True; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_SiteId=945c199a-83a2-4e80-9f8c-5a91be5752dd; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Owner=Jim_Dailey@Dell.com; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_SetDate=2018-10-03T15:57:57.8149293Z; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Name=External Public; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Application=Microsoft Azure Information Protection; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Extended_MSFT_Method=Manual; Sensitivity=External Public x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.143.242.75] MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-10-03_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=884 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810030154 Subject: [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 16:02:34 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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/Shel= l/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, ((FILEPA= TH_DEVICE_PATH *)FileDevicePath)->PathName, 0); PathRemoveLastItem (StartupScriptPath); StartupScriptPath =3D StrnCatGrow (&StartupScriptPath, &Size, mStartup= Script, 0); --=20 2.17.0.windows.1