From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: From: Ahmad Fatoum Date: Fri, 13 Nov 2020 20:08:56 +0100 Message-Id: <20201113190856.3197-1-a.fatoum@pengutronix.de> MIME-Version: 1.0 Subject: [OSS-Tools] [PATCH v2] barebox-state: have the --set option to avoid writes if possible List-Id: Pengutronix Public Open-Source-Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: oss-tools-bounces@pengutronix.de Sender: "OSS-Tools" To: oss-tools@pengutronix.de YmFyZWJveC1zdGF0ZSAtLXNldCBhbHdheXMgZGlydGllcyB0aGUgc3RhdGUgd2hlbiBzdWNjZXNz ZnVsLiBVc2VycwpzZWVraW5nIHRvIGNvbnNlcnZlIHdyaXRlIGN5Y2xlcyB0aHVzIGhhdmUgdG8g LS1nZXQgdGhlIHZhcmlhYmxlIGluCnF1ZXN0aW9uIGZpcnN0IHRvIGNoZWNrIHdoZXRoZXIgdG8g d3JpdGUgaXQuIE1ha2UgbGlmZSBvZiBzdWNoIHVzZXJzCmVhc2llciBieSBoYXZpbmcgYmFyZWJv eC1zdGF0ZSBzdXBwb3J0IHRoaXMgb3V0LW9mLXRoZS1ib3guCgpUaGlzIGFsbG93cyB1c2VycyB0 byBmaXJlIGFuZCBmb3JnZXQgZXhlY3V0ZSBiYXJlYm94LXN0YXRlLgoKVGhpcyBhcmd1YWJseSBz aG91bGQgaGF2ZSBiZWVuIHRoZSBiZWhhdmlvciBmcm9tIHRoZSBiZWdpbm5pbmcsCnRoZSBzdGF0 ZSBpbXBsZW1lbnRhdGlvbiBzaGFyZWQgYnkgYmFyZWJveCBhbmQgZHQtdXRpbHMgYWxyZWFkeQpt YXJrcyB0aGUgc3RhdGUgZGlydHkgaWYgYnVja2V0cyBhcHBlYXIgY29ycnVwdGVkIG9uIHByb2Jl LCBzbwp0aGVyZSBpcyBubyBleHRyYSBiZW5lZml0IGluIGFsd2F5cyBleGV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