Message ID | 20200121130336.16724-1-sbabic@denx.de |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBCXPLOXJ6IKRBK7OTPYQKGQEZUJFMWA@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::140; helo=mail-lf1-x140.google.com; envelope-from=swupdate+bncbcxploxj6ikrbk7otpyqkgqezujfmwa@googlegroups.com; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.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=qnpI3/wi; dkim-atps=neutral Received: from mail-lf1-x140.google.com (mail-lf1-x140.google.com [IPv6:2a00:1450:4864:20::140]) (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 4828135YRwz9sR0 for <incoming@patchwork.ozlabs.org>; Wed, 22 Jan 2020 00:05:52 +1100 (AEDT) Received: by mail-lf1-x140.google.com with SMTP id y4sf861587lfg.1 for <incoming@patchwork.ozlabs.org>; Tue, 21 Jan 2020 05:05:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1579611948; cv=pass; d=google.com; s=arc-20160816; b=IDOWJorwlxEyDiKYJUw2wg7ZXDOn9t/e7qSy4CGN01hbwfa5taf25yMxiHHp9H2aR7 FsUsfoxPY60r5MR2GWMVhFw+SK7qt2cenIy12tff1/Ax2LWwAnQPbV8A9HcJpCLDDotf IqLB99OcXz/elbCK+P+NTN9Ae5d9c3lZyGOrZZnmuLbhxkVsSef/owrklDer536GI9QY DJxaVDZRLSfnnQmFGeE+SdlighnKZ6aHHXFrxwXIKaqWw1Pt1pk16BTQvsm76cuhF0Je mHUicyylUK94CZoysCVvDq3/zQmR6J+XpO8+053E48fxwWXGofDFkJPf3S/bUqCaGIFk D6+w== 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:message-id:date:subject:cc:to:from :mime-version:sender:dkim-signature; bh=ag8jjUAwjrbpuCwdDd1TvalYIP/vqe4ZRyhhzITHY8c=; b=zTX4TFNnG0Bf9G2el88DqGcbY1gYzxrnEpItyCj5GxU1ZxAj9kGW5f4rDTfURZec// b9Tfk3y6YYIFA8HSudx463VB7xmqxsUYntiub4e6uZdm2iDhB8OJyZgwKQMpfoxYi2Ar 2PPjW0Ih0RFH2wgqg+iNgTnroCR5CIwwiPp5xg9O96XCDQaGXoQkxZ2lfl2SwgUv+FO0 kVl29oHWnn4GzYf7pjgNzU7yaUlFubVdfeXpumzda6/AzWvJn5A7EpYy5+qoNtXjPPDC upPa5Q0sZv7ucDYfZLz+O37Hwv0/BVna9Br21AUJ9iT9Fv04CT7c4Fyr50M+qOSiG1St kc7Q== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 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:mime-version:from:to:cc:subject:date:message-id :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=ag8jjUAwjrbpuCwdDd1TvalYIP/vqe4ZRyhhzITHY8c=; b=qnpI3/witrhiaiZaocf9OfltR7cGd+epU0tbGEx63EZ2tY5b3JNW+ND74Sj6E0Nmvn sC9S6KDsUgyWcZAVrmXVBlhS7ImHNuv5nWQw1ZrGeMOMXg6pV9pvsKxaS0+fRd2B51/W SvD5qSdXDU8UwNcu+6eVpcQFU6vXD/21O6qFf9kDpdEf4zNNnA9wsTWi+bIhqrsnnOVk tfu/hz8nQm9h+kyIOAzvWzgFWhQWGiVtMdw4xqq0NfRM1FqG3TKeh1oJK9aVFafZtWVT IN+HlRysP0EFC6hpVS1ROhwkpWNchgrhzr8hOgW4aY/xNw749AckIQPxavLY4k3f1HKX HQvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id: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=ag8jjUAwjrbpuCwdDd1TvalYIP/vqe4ZRyhhzITHY8c=; b=Iv+re5lZs+yG6vA1VCQMJx+GlzUiiNckzUCgG1atcMifUuKSBurybqHdyscmJ9qX0f dFSP4h9MQiyiGF66Knr05X16sqKf6pOdZYYqGgHl7yXhnvbjh7dr7LCkLUeLK8lyqOTI 5vomh4Yh6RrEPoEjIH7PXrmu7l8W6eUdW1wYvXYpRqvoAHozHB1slVFo6JmKZD7xVd58 hPsstjiEGswaqNstoHmSdX1KV+D1I5+DG0epsZg+rZ3tZ2AMIbjbm74pE7I5bYr5fNfG /0xuj+E5I+MoJmprNvk7KrX/BiavPpotmwrUtZlpvRp814Ve7OqXAo/+gkFKfg9m4XgM 70nw== Sender: swupdate@googlegroups.com X-Gm-Message-State: APjAAAW8rExas/DNgUmNUZwwHxKkC+pxpPcozcVz5JFEwRIcb8GSRJbS FfKDmPd3NNVi+PYb8ShX0YQ= X-Google-Smtp-Source: APXvYqz4xbRFImIGeiLWfX9tiIoXp7ypGFb8z4uV6zcQg4CEJc2HqFbXEWtDsyFGtT8STwL0HFH7ig== X-Received: by 2002:a2e:b007:: with SMTP id y7mr16304863ljk.215.1579611948373; Tue, 21 Jan 2020 05:05:48 -0800 (PST) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 2002:a2e:1608:: with SMTP id w8ls4728608ljd.5.gmail; Tue, 21 Jan 2020 05:05:47 -0800 (PST) X-Received: by 2002:a05:651c:1a8:: with SMTP id c8mr16324604ljn.207.1579611947499; Tue, 21 Jan 2020 05:05:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579611947; cv=none; d=google.com; s=arc-20160816; b=Y4VfTVgTucATmXp55fStwGEHNsEFiCNUBbDO7cc3PGvmWh/aoqWxTZoH+kkwK2DBA0 0WJgnfZvjyTerJ5brJ1Yf13ilhOmGtHTqYIsN3MCunZfE+N+GEMPq+fIuaFz7F75KCct wNbOOeZvNz7T42k74DBDhJv660LJRJgUDxL0Qmga/aZI5CmdpQN2kISvaDCBzOcAgIHs H8dRqa7AadK8aqeTExUB3XanSpCV974hr28Tuc3Yi8dVhBz8EiMHIDAhaxI2DHxYpAW6 2oz0BTEgKXKTSJBh+273eLD6XhWvNfWUTpHS9k8l5EUdsj0FDAOyMFSePf+4ZQDUMDpJ DFEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from; bh=8yzOXdyNb2YgI0y0b8GQP8Dp+q3Wy+MOtY4ZPc3YyFQ=; b=B02mfZvbL66oVtYVjoTOLJPiJ1AGFQSLD2WiYQtzfXCoLi8IwO1hEx22KTHO84y83H J0nsfsA8sXurW5agXxhEM2D0x05VR9vL6Z3GfosF13ZVjVL9iPbyONa0XvjK0VSlrclv g6zXwXGjIdBo14/25hyGrn09UfNWayCiLJYqeOh9ugwYb4sNJxDcVx8GHzjJ8VtNQjtB yuxFWIA9gZ9phuP2UqAMNPNrfUT23NoMlf5bDf6m9HUkFyGM/h4qMDFZR/Z8dGkLEEx2 O3NMRoZoqW4tEkKk/Y/7TQHCzecy1O5xfgYHxYscpXcAGU8lKpuQnRWTJG++4f8BKTAO nnjg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 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.10]) by gmr-mx.google.com with ESMTPS id b29si221299lfo.2.2020.01.21.05.05.47 for <swupdate@googlegroups.com> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jan 2020 05:05:47 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=212.18.0.10; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 48280p6n32z1rlwb; Tue, 21 Jan 2020 14:05:46 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 48280p6Z6Qz1qrmq; Tue, 21 Jan 2020 14:05:46 +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 9hGchPs7Ixbw; Tue, 21 Jan 2020 14:05:41 +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; Tue, 21 Jan 2020 14:05:41 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id E55EF4540557; Tue, 21 Jan 2020 14:05:41 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2iarlrkhEx0T; Tue, 21 Jan 2020 14:05:39 +0100 (CET) Received: from localhost.localdomain (papero.fritz.box [192.168.178.132]) by babic.homelinux.org (Postfix) with ESMTP id 471E64540404; Tue, 21 Jan 2020 14:05:39 +0100 (CET) From: Stefano Babic <sbabic@denx.de> To: swupdate@googlegroups.com Cc: Stefano Babic <sbabic@denx.de> Subject: [swupdate] [PATCH 1/2] parser: relax partition check Date: Tue, 21 Jan 2020 14:03:35 +0100 Message-Id: <20200121130336.16724-1-sbabic@denx.de> X-Mailer: git-send-email 2.17.1 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.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] parser: relax partition check
|
expand
|
diff --git a/parser/parser.c b/parser/parser.c index 67a56f7..a7c8dc2 100644 --- a/parser/parser.c +++ b/parser/parser.c @@ -351,7 +351,8 @@ static int parse_partitions(parsertype p, void *cfg, struct swupdate_cfg *swcfg) partition->provided = 1; - if (!strlen(partition->volname) || !strlen(partition->device)) { + if ((!strlen(partition->volname) && !strcmp(partition->type, "ubipartition")) || + !strlen(partition->device)) { ERROR("Partition incompleted in description file"); free_image(partition); return -1; @@ -359,8 +360,10 @@ static int parse_partitions(parsertype p, void *cfg, struct swupdate_cfg *swcfg) get_field(p, elem, "size", &partition->partsize); + add_properties(p, elem, partition); + TRACE("Partition: %s new size %lld bytes", - partition->volname, + !strcmp(partition->type, "ubipartition") ? partition->volname : partition->device, partition->partsize); LIST_INSERT_HEAD(&swcfg->images, partition, next);
The check on partition entry is suitable for an UBI volume because it verifies that a volume name is set. In case of disk partitions there is no volume. Signed-off-by: Stefano Babic <sbabic@denx.de> --- parser/parser.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)