Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp346993pxv; Thu, 24 Jun 2021 09:10:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQR61TTM3OWBIW+8xbK5wUzhDZC+e5s7qOUKYO1w+6WIr1kQkyawBK4TzIVSbTSGHkkDsa X-Received: by 2002:a05:6602:3351:: with SMTP id c17mr4759626ioz.173.1624551042097; Thu, 24 Jun 2021 09:10:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624551042; cv=none; d=google.com; s=arc-20160816; b=CsIzoSCOI0Pq2QvHUZZuAo+PkxmcN3QLiKfwIci1tyRKtGviz2w5/00l2Qtpfhyuc2 TZl7VaecryftG1ZQC4mWh8IW5JSmj5TgTybMUpSkJumb4xE94YC/w0QQd1TeFWHDCbzY riRh2IJ6AkJ0tqpLXcckj24SlhPg4AyStZbeUzQNwU4BMyh0oh1wja61rk0XOsYxteph XYJnK00ki/n/3XAj9XBtNZSTjHOAvlnvyXZi/noKXhdyaj/qu4+llnoUNB45jVKkvo5H 5TdUKayeZFhI4eR5GXKmFcD1MUWSI5vgXIQ7KW5a8DkVJe7RWBputd1typUzdAfrjiIk qH8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=NhXbcWrm933uql/n/aBmpwjEP8OaVS7r8CFi6W764Qg=; b=FkmPxylc3WgGAPyrVFBj5guaXPLjAhWmhWSGBRXcSkaRf/5pXasBf8DrfSL0CLoIFd gadZqvYcQY41HE5SYI6gL8x8GbrJ7jA5fKr8TXce1X923zsQQHWi+kdp638r1f/aKWsT ulL7r/0R99sW87w7RBZ6FYYFl6F4wPwXzsXCZ5kLg6y5VSGtmlD1zYRsLNZONFCA+gC2 osjlVESN/2FjDRE7nMRv9ofQPgC2w8Qp6rVs54D1K0Ol2+vFbzrEwh8IW+dFKGwmJk+Z zUutuOAPSegCUuRxBXXjS61HksCOMFMNYhBt7JBGiYfRgLRtzMx1RisbSvw7FSjQj1aT 9cog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VZiCjLIC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l14si3605700jah.73.2021.06.24.09.10.28; Thu, 24 Jun 2021 09:10:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VZiCjLIC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229831AbhFXQLk (ORCPT + 99 others); Thu, 24 Jun 2021 12:11:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbhFXQLj (ORCPT ); Thu, 24 Jun 2021 12:11:39 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 918AEC061574; Thu, 24 Jun 2021 09:09:19 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id c7so9305857edn.6; Thu, 24 Jun 2021 09:09:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=NhXbcWrm933uql/n/aBmpwjEP8OaVS7r8CFi6W764Qg=; b=VZiCjLICEcJDJap5vKQBCc3Qflk3UIzrL5NRG54tE6sEHHyIiEORHnWYQYhGU6WWgu aDwFIjguK7HxzaRzxMfkfGl6u2zrQnJdYMcYVUYlBFazUWm+IhZ1JCHXihG9BALmb35U ujz1VYjEuxriiyZ2iospFGwSKru0bD9+yxd3VvARVFx4autzgPtdPDt6HukzuM+veJR7 KVqUYu6JBAQbPga4okVnH8aRrY7y5fgGbDgDKVA+6w050uaFWaFrxBSUdPNOJli6tOFc iotb3wOzRbQY1edGOqvlMQ48ZSca2nV6jzs2IL+GMIu9i4ENHM1Au2N9JzIED4Lmj7Kx I2CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=NhXbcWrm933uql/n/aBmpwjEP8OaVS7r8CFi6W764Qg=; b=TorDZ32eSS1SGhzzKaR5/d6jjCK/K85AIIl9PeNuXL4lysnl9Ieviw3VJj/k0edKB7 ccNP51Z1Og/cKOPn6/ilzFg9bbdZTFdzkIB5RhL4FWWjtSSGsuncj8Ol5XAi6YI1y4Hr BeREYRZvOTcSu+GXs6TbpZetuYqpb2yIAoZm1qDpTg6wcximB36+C/Bpz8t3p9/Vyo83 zzU13C7JqeDeFpPjpUDvqKflYPwPO9nU+IFovugvPuQPtJ4aEgzDXv9k3KZyIhvr8LVp 350RnxyBJ/HHsLXOeMRbeiL952AVYtArmofOWlNQ1AWTWWsTQLOMesJqvvnwm07qznsb jhLw== X-Gm-Message-State: AOAM532mx1WNCE3IV7eLdX+VoTowg4PTKczpWPrL1U1r/xk7k6kBml2V Hq6GJbOXxsyGQ3xrdef4dH4mywKvfpMQ0enO12tGthV6VCeyYw== X-Received: by 2002:a05:6402:3507:: with SMTP id b7mr8403605edd.66.1624550957782; Thu, 24 Jun 2021 09:09:17 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Pintu Agarwal Date: Thu, 24 Jun 2021 21:39:06 +0530 Message-ID: Subject: Re: Query: UBIFS: How to detect empty volumes To: open list , linux-mtd , Richard Weinberger , linux-fsdevel , Phillip Lougher , Sean Nyekjaer , Kernelnewbies Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I have one basic query related to UBIFS volumes on a system with NAND partition. In short, how to detect a particular empty volume inside a system partition while flashing the partition image? Suppose I have one big system partition that consists of 4-5 ubi volumes inside it with varying sizes. Lets say: -- System Partition (ubi image) - rootfs volume (ro, squashfs) - data volume (rw, ubifs) - firmware volume (ro, ubifs) - some-other volume (ro, squashfs) Consider that all these could be flashed together as part of system.ubi image in a single shot from the bootloader. Now, suppose, one of the volume image (say firmware) is missing or remains empty (as you know we can have empty volumes). So, during system image flashing, we wanted to detect if one of the volume (firmware) is empty. Since this is an important volume, so we wanted to detect if this volume is empty/missing we will abort flashing the system partition. As there is no point in booting the system without this partition. So, I am exploring options, how can this be detected ? I mean is there any kind of magic number or header information which we can read to detect a particular empty volume ? Can we get any information from just "system.ubi" image to indicate about the volume information ? Also it could be possible that 2 or more volumes are empty, but we are only concerned about one particular volume (firmware), so how to detect particular volume ? If anyone has any thoughts about this requirement, please share your opinion. Thanks, Pintu