From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mickerik.phytec.de ([195.145.39.210]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k56mf-00018f-Rd for barebox@lists.infradead.org; Mon, 10 Aug 2020 12:20:11 +0000 From: Robert Karszniewicz Date: Mon, 10 Aug 2020 14:20:08 +0200 Message-Id: <1597062008-184305-1-git-send-email-r.karszniewicz@phytec.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH v3] bootm: add global.bootm.root_dev env var for booting via PARTUUID To: barebox@lists.infradead.org SW50cm9kdWNlcyBhIG5ldyBlbnYgdmFyIHdoaWNoIHNwZWNpZmllcyB3aGljaCBkZXZpY2UgaXMg dGhlIHJvb3RmcwpkZXZpY2UgdG8gYmUgdXNlZCBpbiBMaW51eCwgcGFzc2VkIHRvIExpbnV4IHZp YSBib290YXJncywgaWRlbnRpZmllZCBieQp0aGUgcm9vdGZzIHBhcnRpdGlvbidzIFBBUlRVVUlE LgoKZ2xvYmFsLmJvb3RtLnJvb3RfZGV2IHN1cHBsZW1lbnRzIGdsb2JhbC5ib290bS5hcHBlbmRy b290LCBpbiB0aGF0IGl0Cm92ZXJyaWRlcyBhcHBlbmRyb290J3MgbmHDr3ZlIGRlZmF1bHQsIHdo aWNoIHBpY2tzIHRoZSBwYXJ0aXRpb24gdGhhdCB0aGUKa2VybmVsIHJlc2lkZXMgb24gKGdsb2Jh bC5ib290bS5pbWFnZSkuCgpFeGFtcGxlOgpkZXRlY3QgbW1jMgpnbG9iYWwuYm9vdG0uaW1hZ2U9 Jy9tbnQvbW1jMi4wL3pJbWFnZScKZ2xvYmFsLmJvb3RtLmFwcGVuZHJvb3Q9MQpnbG9iYWwuYm9v dG0ucm9vdF9kZXY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