Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1539476iog; Thu, 16 Jun 2022 08:24:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ufON92IoGReHWZ30sQzHZcD08FZ1cgNcHyy/rxn2/6OO0T5p0Ww+kSCk3V0KHEC06MJos1 X-Received: by 2002:a05:6402:510d:b0:42d:e266:e02f with SMTP id m13-20020a056402510d00b0042de266e02fmr7258546edd.277.1655393064240; Thu, 16 Jun 2022 08:24:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655393064; cv=none; d=google.com; s=arc-20160816; b=V8IyMwmLKWqbj5aTWGJMABSYX57MN3nVjCP4qARhnWWydZqyNNEj/mz3/ap0leLaZE omxIW9ZElqrWNscR6zp/annOhMOuKkQHi089dvlsKvnBL/yt1iGzgAvyran7TOszMZtQ mwR8JKJq82aJDFR1YQPp4CRaIcYCYlZqVL0eKpbC+wNzLqEkDYY/HCnG3qoxta0OnJ8I ICbvFspk5gkfqgNRmBvO4u4G5QiDMVwb+kuz6f9GZezJtT4RovgUYFX4JOhQyaMQyFTl vzxJNLkt/qrhWilO4qJVUM8fZk+K3wdd1uwdib9s+8SvBcFtSRBcK41rz73uxnzfnHiS USQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Ey9kdJ5w78zOXGJR+B0GYRR/DlEuHOBYl4KkbT3gmkE=; b=Ht1uGu+wo2AOS4txgdfR7HP5L9f7i3n8IUuuP7J5omNThRI6N5gD0R50sv5NBh9GYr HjnX9c6BLwymxDi/3IT19OPzsopXRc90fSi3tCeydS4xmYfd+6TTEXhuRRxN0dNZpVvu 1BSLffZAQd8kLjOqde9O0Mbw8NN9ojmCzRKISFkFbUf/TEPhRctI6nCMk3uiAx6UW4BR c4O+GJNrAT9QoXwUw7stixnWMu/fBpx3rmQ8A8WH8wEB+/wjLGef4E31ASk7D9yragFy BMU0QdmqVU03Gmp4jsUlDZpOn9dUZB0nQzHsPE+5IauKnzq22Z1M2ZSAUeUbuXrjxNTS mfbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gn15-20020a1709070d0f00b006febc8696acsi2478002ejc.770.2022.06.16.08.23.58; Thu, 16 Jun 2022 08:24:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376997AbiFPOsa (ORCPT + 99 others); Thu, 16 Jun 2022 10:48:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376708AbiFPOsL (ORCPT ); Thu, 16 Jun 2022 10:48:11 -0400 Received: from hi1smtp01.de.adit-jv.com (smtp1.de.adit-jv.com [93.241.18.167]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 852342983E; Thu, 16 Jun 2022 07:48:09 -0700 (PDT) Received: from hi2exch02.adit-jv.com (hi2exch02.adit-jv.com [10.72.92.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hi1smtp01.de.adit-jv.com (Postfix) with ESMTPS id C22C9520290; Thu, 16 Jun 2022 16:48:07 +0200 (CEST) Received: from lxhi-065 (10.72.94.5) by hi2exch02.adit-jv.com (10.72.92.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Thu, 16 Jun 2022 16:48:07 +0200 Date: Thu, 16 Jun 2022 16:47:59 +0200 From: Eugeniu Rosca To: Roberto Sassu CC: , , , , , , , , , , , , , , , , , , Eugeniu Rosca , Eugeniu Rosca Subject: Re: [PATCH v4 3/3] gen_init_cpio: add support for file metadata Message-ID: <20220616144759.GA3967@lxhi-065> References: <20190523121803.21638-1-roberto.sassu@huawei.com> <20190523121803.21638-4-roberto.sassu@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20190523121803.21638-4-roberto.sassu@huawei.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.72.94.5] X-ClientProxiedBy: hi2exch02.adit-jv.com (10.72.92.28) To hi2exch02.adit-jv.com (10.72.92.28) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Roberto, On Do, Mai 23, 2019 at 02:18:03 +0200, Roberto Sassu wrote: > This patch adds support for file metadata (only TYPE_XATTR metadata type). > gen_init_cpio has been modified to read xattrs from files that will be > added to the image and to include file metadata as separate files with the > special name 'METADATA!!!'. > > This behavior can be selected by setting the desired file metadata type as > value for CONFIG_INITRAMFS_FILE_METADATA. > > Signed-off-by: Roberto Sassu > --- > usr/Kconfig | 8 +++ > usr/Makefile | 4 +- > usr/gen_init_cpio.c | 137 ++++++++++++++++++++++++++++++++++++-- > usr/gen_initramfs_list.sh | 10 ++- > 4 files changed, 150 insertions(+), 9 deletions(-) > > diff --git a/usr/gen_init_cpio.c b/usr/gen_init_cpio.c > index 03b21189d58b..e93cb1093e77 100644 > --- a/usr/gen_init_cpio.c > +++ b/usr/gen_init_cpio.c [..] > +static int write_xattrs(const char *path) > +{ [..] > + > + snprintf(str, sizeof(str), "%.8lx", > + sizeof(hdr) + name_len + 1 + value_len); Cppcheck 2.7 reports at this line: usr/gen_init_cpio.c:107,portability,invalidPrintfArgType_uint,%lx in format string (no. 1) requires 'unsigned long' but the argument type is 'size_t {aka unsigned long}'. This can be addressed via 's/lx/zx/', according to https://www.kernel.org/doc/Documentation/printk-formats.txt . BR, Eugeniu