From patchwork Sun Jan 24 19:09:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1430970 Return-Path: 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::53d; helo=mail-ed1-x53d.google.com; envelope-from=swupdate+bncbcxploxj6ikrbzelw6aamgqeix2jgia@googlegroups.com; receiver=) 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=j0Bh2ze/; dkim-atps=neutral Received: from mail-ed1-x53d.google.com (mail-ed1-x53d.google.com [IPv6:2a00:1450:4864:20::53d]) (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 4DP2cH5Ctsz9s2g for ; Mon, 25 Jan 2021 06:09:32 +1100 (AEDT) Received: by mail-ed1-x53d.google.com with SMTP id j11sf5369274edy.20 for ; Sun, 24 Jan 2021 11:09:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1611515365; cv=pass; d=google.com; s=arc-20160816; b=aD/fLyW8d/5BggKWaCa1gZ0R3Ie/eHy42dlaqnsP0cyGb/v1iozS7CJy3hhoUtqn9i qKS5r2+0I6XvwYxPB7x/fbQFx2AZ/cnSTwec3HsVkto/r83AX9wx0RvGcNOCbH3FTZE/ 9ILVga8hpUfCxT/hD0pULNiARlF/0EzBF13hOF8I0UXmU5u6E1Mqbh+/OPSpbj4NU4iG P2xmlnDhUmf8jZ144dhZ+QTpFUPp7j3dJ/hoZXEp8sgGcgNNO+samlRX6rs6pGHQ1t2p 843tPwaH+C+GY7WPxps+JtGHrPZ0CdQe1jFOpJgidhSBdEApU51mdRGg+tuypXBoEDTK PT3A== 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:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=fB9sUpKKiPgs3CobLx89yMJS7Jd+bhh0P8bRZzdtskY=; b=zOcKURTc2mTJ//SJXKs/WiHJOg9E6V4qqKDO5pdxODOS5CRc0coIqpyh4wZxwtLx8Q MXglgc+bb9eYUeUfMr8ek0T5uL67NOQtu02zbBnI1UiPzq4QMNYeyOKbJPHTH22d7Byg N/6aNNbPDcw6XdixsGC5Om0YWxDsp7qlEQSQItk+zNZut6VTAQXXBISpA49dkapulfyU AaEj3yulOO4dSpim4n2KG00f1uwXOTvSFpM+BVKSbbdPrLjrtt8H711EJI9pHh+KxRKJ NoUdEUpuvWTua8NgoGOjV0sct7lbG/7CV6UxO7EvIgzh4ReV7XFdY5aB27aiDqGeUK5M n0Fg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.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: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=fB9sUpKKiPgs3CobLx89yMJS7Jd+bhh0P8bRZzdtskY=; b=j0Bh2ze/b6qAct33bKJvwYnAN6UAo+jJSrtFqAmFBzLWTFSJWClrEnFqi0Crk3Ohi+ kJwzmnBPi371jVUPTD5wKA4zhpQCis9rsEYrnO6rY0S/NbSDXd7n644TmkgS0ReBUBBg 64ZTB3V+ikN2jNxCSD42VE9FKD+e40Y6IhyjQp9L+YgPCs1CYkRvrq0bWBoXQsJlnahI /8H8itXlUjLZD1GUWSfEUHU+84SsoeaJbn04SZXacpEkJIj9+Lus0MtcmkOMYxhu7eVO 5o21HOqDanaYOEY1X2YRsSHT2WCxbNeAGxSsFe43b7wLiLlxJ41sNrQziDAaIuoM7nqz SBRA== 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 :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=fB9sUpKKiPgs3CobLx89yMJS7Jd+bhh0P8bRZzdtskY=; b=L51WxYUabNrF5D/8ylUp8SLz8ic4TnixrBYdf9Ee3SrLFPDfmMbe/z/Kfhb/3Doezx 85NAjPhwHX6iqry9it+czeYqs0PaNxolJrHoc+/F6pbDr8ZN/9A9oMMnzP3zrZ0rUNpk cQSagt/HIDkC5ifrU9QBE9Uu9QxJkQr+8rWdwguXHC1QpJ7/ek1PHrhR7DVt4QMohgdh V1sDaofsqkcL/cxJ5rCvzop+yjlDtCvL7RFjnjxoGPtUOMoNf2V68LI5ZFDGxP3+Hd7U BDYfuyJPWLw4LNMxVVtg1ImXuYNUDvMvBYy6+hDyu5ttBj/3G1sEkyvKXCb98BeZBQFQ cZIA== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM532BkJS/p92vAy3RW2qiHp7eImeQvLcNoWcGCQ/9vI2lZ6xqMI4+ KJo3+DySsCZCGDYDyCj7Z2E= X-Google-Smtp-Source: ABdhPJz1ug/uUcHC6YRdIseXOS4yt9WCXs65fV85dDoJgD8O5rLHqlmkrxXuPPSJgvsnC44avCMBQw== X-Received: by 2002:a05:6402:1151:: with SMTP id g17mr80216edw.48.1611515365055; Sun, 24 Jan 2021 11:09:25 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6402:1432:: with SMTP id c18ls14025649edx.0.gmail; Sun, 24 Jan 2021 11:09:24 -0800 (PST) X-Received: by 2002:aa7:c719:: with SMTP id i25mr498461edq.197.1611515364121; Sun, 24 Jan 2021 11:09:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611515364; cv=none; d=google.com; s=arc-20160816; b=ltreYXtG5nEw7wGIy9SZBm/CXSRxDYzu95ejmfyAlwvQEQAnlah45iuhYNsbYdn1ML EdzAu6KApw1RWs9yNEbTuQdaxA6OUKVq/Q6E/JP0+vc9sVBOMB1cDcHpoklESW7Pbkde qRa7wN4QGRVvp0OweWx4iIDe+8L1S7q8rPcm+iW/IvtjoIzBe2oPrVZc+NfTWfAga+ZZ QRUMPPTXA6WLHAS7BS46WkrvaMoPcEPioQPUf0REAoxPW+eqLFQba6XtGXc67nhlxiZ4 ZBh7VtaPUBvart7ebq8rG7iBptcOMl+3av/58nAgrqIVLJlOgC/ws1q24XEoqCkMjRPv yE/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=LTbH8WKfXEx9tjaSUxe2Qa2Drddjpb67VzVVfkhIHnw=; b=CgoByx2mKaNbvh5nSrj4LVfcfdTmFkWlpyu5F0nxsa+yE10ys6JlR6F+2rzN+6LumJ aA4i2W2XvEZxzT0JqOKnnSPW5XQwsMrlxXTO86+Rm7C70OacgE49SgdGkD7S4fQRp1Zw 3VyLAmzybW96ab3IV5tmwYAvboNqhKaTArzZ6GWprvoZnHssZa2nyhpkT7sybbIl+Cqp zgvT0dCJ4Bx/2ncIXsbHVeFf+T1MgYdHYScqoQ8hST7ljuVF6WeLKXDDitxJFO0xNg20 AygaJoASfLLxTbrW5pGroAIeAZio+geADfqBuiNXoSZp6/nTNxcAaj8DGwtwO7YxTPYr X+sQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id mm17si675262ejb.1.2021.01.24.11.09.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Jan 2021 11:09:24 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=212.18.0.9; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4DP2c36HTfz1qt4L; Sun, 24 Jan 2021 20:09:23 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4DP2c35yKxz1tSPt; Sun, 24 Jan 2021 20:09:23 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id PcjpHuzFtASn; Sun, 24 Jan 2021 20:09:22 +0100 (CET) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Sun, 24 Jan 2021 20:09:22 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 586474540C32; Sun, 24 Jan 2021 20:09:22 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([IPv6:::1]) by localhost (mail.babic.homelinux.org [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id B-FZgC-UYNWQ; Sun, 24 Jan 2021 20:09:20 +0100 (CET) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.64]) by babic.homelinux.org (Postfix) with ESMTP id 01A694540C15; Sun, 24 Jan 2021 20:09:19 +0100 (CET) From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH] parser: add hook to partitions Date: Sun, 24 Jan 2021 20:09:18 +0100 Message-Id: <20210124190918.102966-1-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Hook was not supported for partitions. Signed-off-by: Stefano Babic --- parser/parser.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/parser/parser.c b/parser/parser.c index 6945480..3920a3a 100644 --- a/parser/parser.c +++ b/parser/parser.c @@ -434,7 +434,7 @@ static int parse_common_attributes(parsertype p, void *elem, struct img_type *im static int _parse_partitions(parsertype p, void *cfg, void *setting, const char **nodes, struct swupdate_cfg *swcfg, lua_State *L) { void *elem; - int count, i, err; + int count, i, skip, err; struct img_type *partition; if (setting == NULL) @@ -486,6 +486,11 @@ static int _parse_partitions(parsertype p, void *cfg, void *setting, const char add_properties(p, elem, partition); + skip = run_embscript(p, elem, partition, L, swcfg->embscript); + if (skip < 0) { + free_image(partition); + return -1; + } TRACE("Partition: %s new size %lld bytes", !strcmp(partition->type, "ubipartition") ? partition->volname : partition->device, partition->partsize);