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.85_2 #1 (Red Hat Linux)) id 1c6wtv-0002Nc-O0 for barebox@lists.infradead.org; Wed, 16 Nov 2016 09:53:08 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Wed, 16 Nov 2016 10:52:41 +0100 Message-Id: <20161116095244.14288-1-u.kleine-koenig@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 v2 1/4] scripts/kwbimage: fix handling of binary header To: barebox@lists.infradead.org QSBiaW5hcnkgaGVhZGVyIGlzIDEyIGJ5dGVzICsgKDQgYnl0ZXMgKiBOdW1iZXIgb2YgQXJndW1l bnRzKSBiaWdnZXIKdGhhbiB0aGUgYWN0dWFsIGJpbmFyeS4gQmVmb3JlIHRoaXMgY29tbWl0IGlt YWdlIGV4dHJhY3Rpb24gd2FzIHdyb25nIGFuCm1hZGUgYmluYXJ5LjAgdG9vIGJpZyBieSBmb3Vy IGJ5dGVzIGF0IHRoZSBlbmQgKHdoaWNoIHdlcmUgMCBpbiBhbGwgdXN1YWwKY2FzZXMpLiBJbWFn ZSBjcmVhdGlvbiBoYWQgdGhlIHNhbWUgcHJvYmxlbSB3aGljaCByZXN1bHRlZCBpbiBicm9rZW4K aW1hZ2VzIHdoZW4gdGhlIGJpbmFyeSBkb2Vzbid0IGVuZCBpbiA0IGJ5dGVzIGNvbnRhaW5pbmcg MC4KCkZ1cnRoZXIgaGFuZGxlIGJpbmFyaWVzIHdpdGggYSBsZW5ndGggdGhhdCBpcyBub3QgYWxp Z25lZCB0byA0IGJ5dGVzLgoKU2lnbmVkLW9mZi1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