Message ID | 20241106181036.407648-1-stefano.babic@swupdate.org |
---|---|
State | New |
Headers | show
Return-Path: <swupdate+bncBD2ZDGN6SEKRBLHCV24QMGQESFJQIAI@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=Qda5rqlt; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::339; helo=mail-wm1-x339.google.com; envelope-from=swupdate+bncbd2zdgn6sekrblhcv24qmgqesfjqiai@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-wm1-x339.google.com (mail-wm1-x339.google.com [IPv6:2a00:1450:4864:20::339]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XkCtp6ttyz1xyM for <incoming@patchwork.ozlabs.org>; Thu, 7 Nov 2024 05:10:57 +1100 (AEDT) Received: by mail-wm1-x339.google.com with SMTP id 5b1f17b1804b1-4314c6ca114sf664515e9.1 for <incoming@patchwork.ozlabs.org>; Wed, 06 Nov 2024 10:10:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1730916654; cv=pass; d=google.com; s=arc-20240605; b=QAefiJpU2VXwePoAe5a8sCEL993C9dbk3c9ul4tzjovlSKGt0+CKtaJOT3XHpiYauf J2iksteJAbfwksc9tSR6iy8xGp2mt+gGLVnUIHQnprgirhv1JoeIGEx5F/vApS+vpM6u toUq6ZHCKr4UO+WJko+O/m1gRZK6t2akhWxvWpPw18ZQ8+lAtjoANHgKiOFEqwh36C3A XBL8P7UU9Xv3HFOiBVXBIn46d2B01p2sO3IoR/KDDXvxpn3vbgxK1BTX19z1roM520Ry /7ArZCFWPbSA9kxzWuGAicLdvXTzBZgEjewuv8D6O21Et8Ji4dkLHFDJe7Ap5oz+gVAA 7O3g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:ui-outboundreport:mime-version :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=TZ61LCsDRUe0xDeVEUl6t95PLU2UiuEPaWEelhfdWdA=; fh=0RDTZAzR48qzcPqBU59mugnKoau77FXNjZYHhhwXbsY=; b=ieBBrDH5/U2grTFz6Gp3SyrhFWhPCTLPIbnukdzwGDwuUB+3/b6M883Yam0y+hhbZr FjzLtIypBtZ29ydv2a97qXS1XXNLpb/F9qmekR+QBU00wvvlA6P9o9SUMiAPnJKOlIG/ 4Pwn+IVqUHGcj1COGQ2QkcU+IYfYFm2a7m0kEx55Oc7YrJKOwZBLj/okkqvyb3ZJSJet rDOldCBkMrslQrTW3fRhyIPQaXov/qZ3maaFz0etVodJD4YjZRLTLN+91NRSULCe4fBL DT4PjlCol5XwJVGJZXz0LHNFmojoOaby8W21uIDqOQKrSa9K7t4NvbwxAkXMj4bpoXKd KRxQ==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=rsuCW6CW; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.73 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1730916654; x=1731521454; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:ui-outboundreport:mime-version:message-id:date :subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=TZ61LCsDRUe0xDeVEUl6t95PLU2UiuEPaWEelhfdWdA=; b=Qda5rqltvJvOcTSfPhK4yP9Sl84E7rZNZoYZjo4Ox22cG3C3XPh11GTk9QomjrGNsX Q2sb/maSbBcoCLXknWRreh12b1pcliTmnbrwRjqlFnwNikUfFk3lI4n2B+FRE7CLSDis AECz01UCEJHfk+yTzTU41w9Swed9m8UqHhEs3EI8USYY5Xr98iiSyk/mH/1Emb839HKI ymOrb7pIQym/AlyR5nXQUK6+eH9O131ZBZFUM9K5l86MQVjRIGEJ54QV7zWXMqC2/9Zn 83Oz7hZM9l2lJI6cKNIQDD0Doc2Cy0B9DDy/2in6bTutZncVXp4Y0Xx87Jn9AobImwrA psNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730916654; x=1731521454; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :ui-outboundreport:mime-version:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=TZ61LCsDRUe0xDeVEUl6t95PLU2UiuEPaWEelhfdWdA=; b=GVEzB+AVjgVArFD6OfwdQJkmmqB7VP+Hu+TUk3LiObl2qm0XiuzC8UCbcySJgOOB+M RjWeaxE0kg/J0VSzc2Ynjk/qGFsq3n1uXlQXPAb00BsgVbfRGCWjDceO164rRXHb7XE2 RcOd4qgVtfirZywJS632bH0A0w+jxrVvL9bflOqnYevwrHYoH8njMcZN4cii7H/QllwM G3TZteVrEkYDj3KzgrnURY7BzlhdrOzuJFtYSrn/o+nt+fkIFnNGXbztrIArRxgp9yiQ W8963/ciWyCV7a6R60qVD2KPPat+xTTo8tU2gYS0YhgR5lj2vFo4fNru4yL/Pdd+M7fL kzaQ== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCWeEPTfVdS3QCmrCufX/NjW7Xbtb2o0kRhMANFi+8mnGkCGEzP0DUi3UFKOpGlQD3nGsS6tsj7ryQ==@patchwork.ozlabs.org X-Gm-Message-State: AOJu0YxfprW0/KBbfw7wCCtORytm5nTH3WDo6TnDFU9vQ+gUrUjE3+X6 OwlSZ9IdYjhQikYMFXmCecqUwsXFb+ce+de3rCy55XAAjIqNMRx6 X-Google-Smtp-Source: AGHT+IFdeTWJjVFyfBRtygsCWoWEvIMub3hePQIZRAoLNfkFr/+xfcAUrl3nqKL4Izcj2NpeK3ULeg== X-Received: by 2002:a05:600c:3ca8:b0:431:52b7:a499 with SMTP id 5b1f17b1804b1-4327b7019ddmr199506245e9.20.1730916653461; Wed, 06 Nov 2024 10:10:53 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:600c:a49:b0:42c:b1b4:db22 with SMTP id 5b1f17b1804b1-432af02d164ls324005e9.2.-pod-prod-02-eu; Wed, 06 Nov 2024 10:10:48 -0800 (PST) X-Received: by 2002:a05:600c:1396:b0:430:582f:3a9d with SMTP id 5b1f17b1804b1-4327b80d1a9mr228207045e9.26.1730916647807; Wed, 06 Nov 2024 10:10:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730916647; cv=none; d=google.com; s=arc-20240605; b=F8dWpDkB0hGsfLoiGmdxw7NLmjmyCvWgqfQ7y4PB9NQVuNvvr7/D4gvFjlwMtr5Awc GGmwQbYucF7rbYJArrqfCl3Nz3BsbAv38+7AVQjyazKwcVJEV3Xlo+lA8s8MAI1/+Dfj SHcYq+vfiDAlhq1ipJplK7iMDGyAZaV9HxV89VLSaINFSQDWqb9nEKaLByngNgTum/Ra jw8qN9kPqr4tn6PiSYooOnkKyTPG8ru0Z/WyN6BhSFKov1bSlYZip40Axo/8wZ/979OA 9LsLkcKvgIQ3w3vjYu2wG4Tu/YzV48mTanxNjwrkCRp1sjK/SRVt7jH6svvZbN1+0jXm U0eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=ui-outboundreport:content-transfer-encoding:mime-version:message-id :date:subject:cc:to:from:dkim-signature; bh=MasvPOh6W+e2cLMWKAL5B9So+L47lGiYzPop6s4kTio=; fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=; b=XruDQJ7eX7azgG6VBhv4t0zfHb7y6nQ6Pj3ksG2MqUhQhIni5VufDWibSEgbPnyHZv V6QVch+qQQv1fWGHKFvu3+Fdr+Z85LzYemjU0Wc705f2BwtyAD8Jh+pMLxNbiS33bJKn q+oV6UmhyHBsVkfV2o9u+F4UQnn3ISjM+U1884OU/9TIr7/5HsC0mwBNioMbYZBZ3zco oEhBcUYgbk41MfMySXEu1h2qHIZRATlAnfXIeeeOYx+o2U8em535HfDGUw8rfNcGHl5G ScSmrHyxaUuKAwwxWuiGkcc3ZEe1MMRp6C4X0RfMBvjdV2bWt9HTBkrf+bnuqQKA6wWZ hn6g==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=rsuCW6CW; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.73 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Received: from mout.kundenserver.de (mout.kundenserver.de. [217.72.192.73]) by gmr-mx.google.com with ESMTPS id 5b1f17b1804b1-432aa52b94esi422375e9.0.2024.11.06.10.10.47 for <swupdate@googlegroups.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 10:10:47 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.73 as permitted sender) client-ip=217.72.192.73; X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from paperello.fritz.box ([88.217.136.221]) by mrelayeu.kundenserver.de (mreue108 [213.165.67.113]) with ESMTPSA (Nemesis) id 1M1Hi8-1t60fV0CK2-007qbG; Wed, 06 Nov 2024 19:10:47 +0100 From: Stefano Babic <stefano.babic@swupdate.org> To: swupdate@googlegroups.com Cc: Stefano Babic <stefano.babic@swupdate.org> Subject: [swupdate] [PATCH] parser: check consistency for partition after running embscript Date: Wed, 6 Nov 2024 19:10:36 +0100 Message-ID: <20241106181036.407648-1-stefano.babic@swupdate.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:+Gvk5EdLhWD8d0O2G//zJCj6Q1fR3vJ1QXzyzHdlC/GzsRjPmel zPhrYzGhZXe178zkZE1nNRWdxD3d247iIlDWdgehIU5+WyyLSLyg4lpRNuA3/S2OAoG4qHx 7f9a0Xqapvz4HyMUFUeqrO9m/Qvu78QtYU2BbV/bS4RFrQxNaBAGcz3fzefe1AVECRDOfAu tP1m9m4SiV86mFxy2Ws7w== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:vYyOMjakpSI=;dHQ+U8n1YeRz14IRQ4lY9wOYbLo rVnys4/LooRTrjIweX6cOQbX7DrXKHJTIrLCMhwb266GcYSlnBqSBae81DcztCMtNYfs5e77l rRr6agg6xqSSt/9mTADE+QiCR/xOR7X5Tv/LqlaysEic1qJd6pNN8hH/5+sHk7Pi4TLiduVse guCTyV+RlXKxm0fsShP6zTWR4HUqzhT8GVAIyqe6Ua7tptmgDRzCjYDAK9wtqF5EaGpbVMqS4 Uj/5DWa9LEuqo/TJQ4+fAB6yeb8vYV9mMp4bJKl8keQB3E+p2BKHMqyTLAvAlzXRTUQlFHImi cfopiGa9IjJrRHhQpYOiKnPAVC2Vi15/SeluQQuXDDZVJGjoK9BB2ge55bKIMio675UuFDYBk htKrl4ij8+OScFGNzqd83q58lVBGzZQzzqbX5VVK6QkySMHlAB2bh1606rSo8AFAhuFzQERqr IH0J03uS79FSejjtN1TueeLZwrVk4pR0BIFBGNL/uPunxnXWwC83KfAoHEYqN/8ZDMXXWbIrk YZt1syVcSHmk/A0pEByGkDf0LStDaOuM9BHWCUGxljzHmmUHyBVrq9lBzlxBJKdF8WR0IZP3W g1kEC1gaIrbLiXyZxhnEMt0CgEcPCl8NZQtfspWnzhzdBF9qCUqr5Ch47x6i2j4ja8tiSeIr/ QJG/beYpu45OtaSaeK6+kGKb20S7f5/2zAkJnHkljJpcxuPUFQ0Lcfdo6q0HNN+vvCGV1k7Ot XoTJRBWamSFuJNjeOMwcI4FzNbRcDL4EA== X-Original-Sender: stefano.babic@swupdate.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=rsuCW6CW; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.73 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org 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 |
parser: check consistency for partition after running embscript
|
expand
|
diff --git a/parser/parser.c b/parser/parser.c index f5113f94..3ef7fe4a 100644 --- a/parser/parser.c +++ b/parser/parser.c @@ -515,13 +515,6 @@ static int _parse_partitions(parsertype p, void *cfg, void *setting, const char partition->provided = 1; - if ((!strlen(partition->volname) && !strcmp(partition->type, "ubipartition")) || - !strlen(partition->device)) { - ERROR("Partition incompleted in description file"); - free_image(partition); - return -1; - } - GET_FIELD_INT64(p, elem, "size", &partition->partsize); add_properties(p, elem, partition); @@ -535,6 +528,14 @@ static int _parse_partitions(parsertype p, void *cfg, void *setting, const char free_image(partition); continue; } + + if ((!strlen(partition->volname) && !strcmp(partition->type, "ubipartition")) || + !strlen(partition->device)) { + ERROR("Partition incompleted in description file"); + free_image(partition); + return -1; + } + TRACE("Partition: %s new size %lld bytes", !strcmp(partition->type, "ubipartition") ? partition->volname : partition->device, partition->partsize);
It should be possible to leave empty some fields if they are filled by a Lua function in the embedded script. Check for consistency of a partition entry should be done after running a hook if present. Signed-off-by: Stefano Babic <stefano.babic@swupdate.org> --- parser/parser.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- 2.43.0