From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a47mQ-0001JR-Nx for barebox@lists.infradead.org; Wed, 02 Dec 2015 13:49:33 +0000 From: Markus Pargmann Date: Wed, 2 Dec 2015 14:48:51 +0100 Message-Id: <1449064131-12659-10-git-send-email-mpa@pengutronix.de> In-Reply-To: <1449064131-12659-1-git-send-email-mpa@pengutronix.de> References: <1449064131-12659-1-git-send-email-mpa@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" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 9/9] fs: Add pstore filesystem To: barebox@lists.infradead.org cHN0b3JlIGlzIGEgcGVyc2lzdGVudCBzdG9yYWdlIGZpbGVzeXN0ZW0gdXNlZCBmb3IgUkFNT09Q Uy4gSXQgaXMgdXNlZAp0byBzdG9yZSBjb25zb2xlIGxvZ3MsIHBhbmljcywgZnRyYWNlIGFuZCBv dGhlciBpbmZvcm1hdGlvbiBpbiBjYXNlIG9mIGEKY3Jhc2gvcGFuaWMvb29wcy9yZWJvb3QuCgpw c3RvcmUgaXMgaW1wbGVtZW50ZWQgZm9yIGJhcmVib3ggYXMgYSByZWFkLW9ubHkgZmlsZXN5c3Rl bSBhdCB0aGUKbW9tZW50LiBJdCBtYXkgYmUgZXh0ZW5kZWQgbGF0ZXIgb24uIFRoZSBpZGVhIGlz IHRvIHByb3ZpZGUgYSB3YXkgdG8KZXh0cmFjdCBlc3NlbnRpYWwgZGF0YSBmcm9tIHRoZSBsYXN0 IHJ1bm5pbmcga2VybmVsLgoKTW9zdCBvZiB0aGUgY29kZSBpcyBjb3BpZWQgZnJvbSB0aGUga2Vy bmVsLiBIb3dldmVyIHRoaXMgaXMgb25seSBhCmxpZ2h0d2VpZ2h0IGltcGxlbWVudGF0aW9uIHdp dGhvdXQgcmVhbCB3cml0ZSBzdXBwb3J0IHlldC4KClNpZ25lZC1vZmYtYnk6IE1hcmt1cyBQYXJn bWFubiA8bXBhQHBlbmd1dHJvbml4LmRlPgotLS0KIGNvbW1vbi9zdGFydHVwLmMgICAgICAgICAg IHwgICA1ICsKIGZzL0tjb25maWcgICAgICAgICAgICAgICAgIHwgICAyICsKIGZzL01ha2VmaWxl ICAgICAgICAgICAgICAgIHwgICAxICsKIGZzL3BzdG9yZS9LY29uZmlnICAgICAgICAgIHwgIDg4 ICsrKysrKysrCiBmcy9wc3RvcmUvTWFrZWZpbGUgICAgICAgICB8ICAxMCArCiBmcy9wc3RvcmUv ZnMuYyAgICAgICAgICAgICB8IDI4MCArKysrKysrKysrKysrKysrKysrKysrKysrCiBmcy9wc3Rv cmUvaW50ZXJuYWwuaCAgICAgICB8ICAxOSArKwogZnMvcHN0b3JlL3BsYXRmb3JtLmMgICAgICAg fCAxMzggKysrKysrKysrKysrCiBmcy9wc3RvcmUvcmFtLmMgICAgICAgICAgICB8IDUwNyArKysr KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysKIGZzL3BzdG9yZS9yYW1f Y29yZS5jICAgICAgIHwgNDI2ICsrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysK IGluY2x1ZGUvbGludXgvcHN0b3JlLmggICAgIHwgIDkwICsrKysrKysrCiBpbmNsdWRlL2xpbnV4 L3BzdG9yZV9yYW0uaCB8ICA4NyArKysrKysrKwogMTIgZmlsZXMgY2hhbmdlZCwgMTY1MyBpbnNl cnRpb25zKCspCiBjcmVhdGUgbW9kZSAxMDA2NDQgZnMvcHN0b3JlL0tjb25maWcKIGNyZWF0ZSBt b2RlIDEwMDY0NCBmcy9wc3RvcmUvTWFrZWZpbGUKIGNyZWF0ZSBtb2RlIDEwMDY0NCBmcy9wc3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