From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from 9.mo4.mail-out.ovh.net ([46.105.40.176] helo=mo4.mail-out.ovh.net) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U7jMb-0001Fm-GR for barebox@lists.infradead.org; Tue, 19 Feb 2013 09:19:50 +0000 Received: from mail433.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo4.mail-out.ovh.net (Postfix) with SMTP id D72DC104FB8F for ; Tue, 19 Feb 2013 10:28:03 +0100 (CET) From: =?UTF-8?q?Eric=20B=C3=A9nard?= Date: Tue, 19 Feb 2013 10:17:23 +0100 Message-Id: <1361265445-11731-1-git-send-email-eric@eukrea.com> In-Reply-To: <20130214193135.GA1906@pengutronix.de> References: <20130214193135.GA1906@pengutronix.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-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH v4 1/3] env: add register_persistent_environment To: barebox@lists.infradead.org Cc: Juergen Beisert LSBoZWF2aWx5IGNvcGllZCBmcm9tIHJlZ2lzdGVyX3BlcnNpc3RhbnRfZW52aXJvbm1lbnQgd2hp Y2ggd2FzClNpZ25lZC1vZmYtYnk6IEp1ZXJnZW4gQmVpc2VydCA8amJlQHBlbmd1dHJvbml4LmRl PgoKU2lnbmVkLW9mZi1ieTogRXJpYyBCw6luYXJkIDxlcmljQGV1a3JlYS5jb20+Ci0tLQp2NDog cmVuYW1lIGZ1bmN0aW9uIGFuZCBtb3ZlIHRvIGVudmZzLmgKdjM6IGFsc28gZml4IHRoZSB0eXBv IGluIHRoZSBwcmludGYKdjI6IGZpeCB0eXBvIGluIHBlcnNpc3RlbnQKIGNvbW1vbi9lbnZpcm9u bWVudC5jIHwgNDAgKysrKysrKysrKysrKysrKysrKysrKysrKysr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