Message ID | 20200919183010.100367-1-bage@linutronix.de |
---|---|
State | Changes Requested |
Headers | show
Return-Path: <swupdate+bncBDPPPP7KYILBBT44TH5QKGQEMLK6BZA@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::440; helo=mail-wr1-x440.google.com; envelope-from=swupdate+bncbdpppp7kyilbbt44th5qkgqemlk6bza@googlegroups.com; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linutronix.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=Mum95Aqg; dkim-atps=neutral Received: from mail-wr1-x440.google.com (mail-wr1-x440.google.com [IPv6:2a00:1450:4864:20::440]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Btzm71bghz9sSC for <incoming@patchwork.ozlabs.org>; Sun, 20 Sep 2020 04:30:45 +1000 (AEST) Received: by mail-wr1-x440.google.com with SMTP id j7sf3728055wro.14 for <incoming@patchwork.ozlabs.org>; Sat, 19 Sep 2020 11:30:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1600540239; cv=pass; d=google.com; s=arc-20160816; b=Itn2LbRwyGP3Nl88AB2dFUwpLe1UqcO5/gWEprl9ilwbr5dmqW5bhAyjGLBpCDC63r aGLLIi2BVx/u6PZ8rkbeoDxYg4P7MdRDR7Hm6UEYIfLlYexmQPw1P0aevyh/PJES0O8s DDnAXgS9/ZS21YdxmMZBB5hIsnIZGPvOO9eMpdjf/+wnGLndfMY2prHjq71X/PMTwhkj ZWw/yBTPIXCrnGoI5APhb+Pa9pWWgMy75pRuLqGjIdbaFGKTVhngSe2F/dvkqM2dtB0r hQVLr/if7Wi3//msDUcEobuYCnIZPAuRn8SOhjQr5dNju7K4aXzHyDDHPw3jrJ8ZdL3R z0hw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=GRmP+x8V5RFdYCTxpuNQAV5oFPz97+RNrrHlnKKHdxY=; b=XUWxVe9WEQaTmAKE7A0VCsdtpymrvHxcpbOSXoRq6fiqm1g7dmsFHjQPhVMdi5GII5 aIJjCDnGORB+xGsD4aqi9Cryz6w/ilTtaayE+WC0c/cVcQlbe+uQ6r5o7tzWPtmiLmYN RymGFlQUXCTD+0GjzH/oNX70sW13k5XllLEjqTd7s6E1OCkju/PWQlOV2/Ih/Aj2ipyi 7kLPkR0pAvSVMr+KaJ8BdkveleWYROJzW7+esHDs0iRcBCWZnAIw0GV/KBNQfwgZH9eu P3vdos6e62IL1cu9O0LKeKggbQUxBLtGU1B+jEzPtYQgjuenrOp9j1w8sRBws0WCnD8Y x1sA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=2K3TfnR3; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of bage@linutronix.de designates 2a0a:51c0:0:12e:550::1 as permitted sender) smtp.mailfrom=bage@linutronix.de; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=GRmP+x8V5RFdYCTxpuNQAV5oFPz97+RNrrHlnKKHdxY=; b=Mum95Aqgl5q+NPH9VjlAPNsCiu2E0J78JoZLm6GJV5rke2onVlex9Z34qXguQDPk4+ C6m9UWVnlrYejg9Mx5hUwR3E/icC2ThRBBUmPe1h1r1Zve6kan0XexlYeRHBJmgFR4O9 llB9cZQ26WQrZCNPTQfjMt+N0Gy90YJVmCiXiMUi7zM79FhD9WHdykRzKQGGaRMd0sWr bo9emrZFCdisgoZ+cp7X7rhcqpRSqAwy2upgBD8deU/xYJ9GFMcc+eKxQvPDGIv1Q2WZ R1E6HPJXDtjPZgaHsDL1mAUdaSDFiH+CNlqmugNWP2rckZptIr6GgO4LHkcYhfxQKVDV kAig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=GRmP+x8V5RFdYCTxpuNQAV5oFPz97+RNrrHlnKKHdxY=; b=Qdkn5SwSHepV5rnPB87flEWdPMK4Wq0sAkUFvjBWm72radgCFH6HC+IwA68VpfQIZ0 MD5NIdu5ZEPu0twisj+IFdYse/p8+XTF2nNdwHes9QcSQ0ytvloSPQRrfnRqZDHOfhw5 +HRRFNiZXIQEgr5Of7qY8+DT+NytRJsl6jp3CG8SFJ+a75gVxMf5AwEPmHnqO1DF6qWz maTA9AnjcnK1MThQ3W4DH1e8HscylW1y9Knhh9v5AwCmh9/gX0nWli5RxB9iIDOqP1sq 27o+T4f8kvcwbMWhW3UIeXQzCWCYmjKadUNHoq0MmHnyTtgBWk+wXQRuzI7scBKS/3Ff P/EQ== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM533BOlPRG+SdTdgrgp4HBl+EVj6ONYRvKeasIfwgQ5nTp+9LQiN5 qyMMQqUR/XS1DKlCcMjTnFc= X-Google-Smtp-Source: ABdhPJyEiDTy0a8rO+FOFF3XJuKenOjFMYX8Nwe64S0YeRlXkvnzz1QtH4sKJfJnGE2kzRVNqatBVg== X-Received: by 2002:a1c:e256:: with SMTP id z83mr23249912wmg.137.1600540239509; Sat, 19 Sep 2020 11:30:39 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:600c:230d:: with SMTP id 13ls4456459wmo.0.canary-gmail; Sat, 19 Sep 2020 11:30:38 -0700 (PDT) X-Received: by 2002:a1c:9cd3:: with SMTP id f202mr21716706wme.148.1600540238364; Sat, 19 Sep 2020 11:30:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600540238; cv=none; d=google.com; s=arc-20160816; b=eJtjvmEyQLcnSjwztxa9m9X6Fs9GOTaqcL4KBlSgxJRTg/OleCv+noy/wQDvKpZSSJ iKIn43/kqGKNqYR4gPPJLcHeXrmcsvByAHRZ/gQv8TVzFU0xYnJeoT/3iV7rL5OyO6Tz x7yiMu6x11bl4q0ksevMmwiELBXZgvXp/46ctiEc5X0MIjL96/Ycf/fOFnJjSYD5yRxH lihVPvyJg4jSqRH8VOLG0Xg9zFvdmH9SuRSdvQBsyDvJ54mH19cSts3+tLTQXfWuH9HR cPC5/VOtdyllapEhWrlyQZgHRhF0RO3tVjEpB9IzGtHlFDv8MEJJRxclDd2diw/PL0WN ALww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dkim-signature:dkim-signature:from; bh=N7dQ5LK4LkXxVOUAsN/kdqpyCVPocFx17Px9HeB2BzY=; b=FDn3qlunQ0JEAxL65falFL+Ay58+t5VUc0QP4UJ3blDjLiCAp8han2P6m9avCZO8s5 axboPJJsN9/0Y1i6TBEHYXzY5a4crJLIdQCPTraf26yQyjlDai0SEkurUNr3kuV8kD3S 790tmny9OzBGplrglz5PuP2aUD3YqI9luVSJMAPaJhmh4odhg3zJ32tX3VcrnqL9coDF yeOfDNOZLo5CL4TTNGDBmwSFV0HtkidFzqs1n/1SW3yemGmQYvdJAdDuEBnG8s12YvFJ eDLS06zIF1dhlvyEV0BuPZ7+zoBeTYNefTFzOK/hrU8n1BkkfjVynDGqmBhh+kDMnccy mo0g== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=2K3TfnR3; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of bage@linutronix.de designates 2a0a:51c0:0:12e:550::1 as permitted sender) smtp.mailfrom=bage@linutronix.de; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from galois.linutronix.de (Galois.linutronix.de. [2a0a:51c0:0:12e:550::1]) by gmr-mx.google.com with ESMTPS id h2si56689wml.4.2020.09.19.11.30.38 for <swupdate@googlegroups.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2020 11:30:38 -0700 (PDT) Received-SPF: pass (google.com: domain of bage@linutronix.de designates 2a0a:51c0:0:12e:550::1 as permitted sender) client-ip=2a0a:51c0:0:12e:550::1; From: bage@linutronix.de To: swupdate@googlegroups.com Cc: Bastian Germann <bage@linutronix.de>, Matt <mattbeaumontgts@gmail.com> Subject: [swupdate] [PATCH 1/2] handles: ubivol: add property decompressed-size Date: Sat, 19 Sep 2020 20:30:09 +0200 Message-Id: <20200919183010.100367-1-bage@linutronix.de> In-Reply-To: <59cfcfc0-87e9-2923-4c7c-05fc189efec9@denx.de> References: <59cfcfc0-87e9-2923-4c7c-05fc189efec9@denx.de> MIME-Version: 1.0 X-Original-Sender: bage@linutronix.de X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=2K3TfnR3; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of bage@linutronix.de designates 2a0a:51c0:0:12e:550::1 as permitted sender) smtp.mailfrom=bage@linutronix.de; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
[1/2] handles: ubivol: add property decompressed-size
|
expand
|
diff --git a/handlers/ubivol_handler.c b/handlers/ubivol_handler.c index 5cfc0dd..ed3c08b 100644 --- a/handlers/ubivol_handler.c +++ b/handlers/ubivol_handler.c @@ -150,7 +150,7 @@ static int check_ubi_alwaysremove(struct img_type *img) static int update_volume(libubi_t libubi, struct img_type *img, struct ubi_vol_info *vol) { - long long bytes; + long long bytes, decompressed_bytes; int fdout; char node[64]; int err; @@ -219,7 +219,19 @@ static int update_volume(libubi_t libubi, struct img_type *img, ERROR("cannot open UBI volume \"%s\"", node); return -1; } - err = ubi_update_start(libubi, fdout, bytes); + + if (img->compressed) { + decompressed_bytes = strtoll(dict_get_value(&img->properties, "decompressed-size"), NULL, 10); + if (!decompressed_bytes) { + ERROR("UBIFS to be decompressed, but decompressed-size not found"); + return -EINVAL; + } + } + else { + decompressed_bytes = bytes; + } + + err = ubi_update_start(libubi, fdout, decompressed_bytes); if (err) { ERROR("cannot start volume \"%s\" update", node); return -1;