From patchwork Fri Jun 7 04:24:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhihao Cheng X-Patchwork-Id: 1944822 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (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 4VwSpP6nWFz20fC for ; Fri, 7 Jun 2024 14:27:06 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OlSpzEFPzUyaknc9adIZIcO61hy3AcSgFih41YhWT8s=; b=zCdiUxEUJJZhpy bcAlA8G4U5N3oIqS/UUqHueMSTNRf7L4R8FwWMKsM7Qix9Af3cFWNVc8EuvY6dPp75sarFK8ZpWFp Ip+eBc6Vviz9sgipgh+mbG4CAe94SVHXjP8c44Pju5mVbb4t+RG460kTMqOV5TsW/ZMLLZsThNtUx MxwPoWrBeCRXopvufHXnlI8i3TPp+NH2NVh3+X9/PExelD37AhxpTndOZ85jkdG4fItQBFMSgdL8i 5ztNzNgqTT6gIut1JTJxME7NASs6EQMEyDwch5DCV6PDi04800WH3ZiLb93BJzcuihDqe1xluoww2 v9H9eOt7itWg8sEbYPPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sFRBj-0000000CG9l-40z4; Fri, 07 Jun 2024 04:26:51 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sFRBc-0000000CG3l-1gCY for linux-mtd@lists.infradead.org; Fri, 07 Jun 2024 04:26:47 +0000 Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4VwShK3nCLzmYL0; Fri, 7 Jun 2024 12:21:53 +0800 (CST) Received: from kwepemm600013.china.huawei.com (unknown [7.193.23.68]) by mail.maildlp.com (Postfix) with ESMTPS id 5B24D140427; Fri, 7 Jun 2024 12:26:29 +0800 (CST) Received: from huawei.com (10.175.104.67) by kwepemm600013.china.huawei.com (7.193.23.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Fri, 7 Jun 2024 12:26:28 +0800 From: Zhihao Cheng To: , , , , , CC: , Subject: [RFC PATCH mtd-utils 003/110] ubifs-utils: Split common source files from mkfs.ubifs Date: Fri, 7 Jun 2024 12:24:28 +0800 Message-ID: <20240607042615.2069840-4-chengzhihao1@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240607042615.2069840-1-chengzhihao1@huawei.com> References: <20240607042615.2069840-1-chengzhihao1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.104.67] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600013.china.huawei.com (7.193.23.68) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240606_212644_906160_FBE16589 X-CRM114-Status: UNSURE ( 8.75 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Split common source files into common dir from mkfs.ubifs, this is a preparation for importing libubifs(from linux kernel) to replace current UBIFS libs. Signed-off-by: Zhihao Cheng --- ubifs-utils/Makemodule.am | 57 ++++++++++++ ubifs-utils/{mkfs.ubifs => common}/README | 2 +- ubifs-utils/{mkfs.ubifs => common}/comp [...] Content analysis details: (-2.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [45.249.212.188 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [45.249.212.188 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Split common source files into common dir from mkfs.ubifs, this is a preparation for importing libubifs(from linux kernel) to replace current UBIFS libs. Signed-off-by: Zhihao Cheng --- ubifs-utils/Makemodule.am | 57 ++++++++++++---------- ubifs-utils/{mkfs.ubifs => common}/README | 2 +- ubifs-utils/{mkfs.ubifs => common}/compr.c | 0 ubifs-utils/{mkfs.ubifs => common}/compr.h | 0 ubifs-utils/{mkfs.ubifs => common}/crc16.c | 0 ubifs-utils/{mkfs.ubifs => common}/crc16.h | 0 ubifs-utils/{mkfs.ubifs => common}/crypto.c | 0 ubifs-utils/{mkfs.ubifs => common}/crypto.h | 0 ubifs-utils/{mkfs.ubifs => common}/defs.h | 0 ubifs-utils/{mkfs.ubifs => common}/devtable.c | 0 ubifs-utils/{mkfs.ubifs => common}/fscrypt.c | 0 ubifs-utils/{mkfs.ubifs => common}/fscrypt.h | 0 .../{mkfs.ubifs => common}/hashtable/hashtable.c | 0 .../{mkfs.ubifs => common}/hashtable/hashtable.h | 0 .../hashtable/hashtable_itr.c | 0 .../hashtable/hashtable_itr.h | 0 .../hashtable/hashtable_private.h | 0 ubifs-utils/{mkfs.ubifs => common}/key.h | 0 ubifs-utils/{mkfs.ubifs => common}/lpt.c | 0 ubifs-utils/{mkfs.ubifs => common}/lpt.h | 0 ubifs-utils/{mkfs.ubifs => common}/sign.c | 0 ubifs-utils/{mkfs.ubifs => common}/sign.h | 0 ubifs-utils/{mkfs.ubifs => common}/ubifs.h | 0 23 files changed, 31 insertions(+), 28 deletions(-) rename ubifs-utils/{mkfs.ubifs => common}/README (91%) rename ubifs-utils/{mkfs.ubifs => common}/compr.c (100%) rename ubifs-utils/{mkfs.ubifs => common}/compr.h (100%) rename ubifs-utils/{mkfs.ubifs => common}/crc16.c (100%) rename ubifs-utils/{mkfs.ubifs => common}/crc16.h (100%) rename ubifs-utils/{mkfs.ubifs => common}/crypto.c (100%) rename ubifs-utils/{mkfs.ubifs => common}/crypto.h (100%) rename ubifs-utils/{mkfs.ubifs => common}/defs.h (100%) rename ubifs-utils/{mkfs.ubifs => common}/devtable.c (100%) rename ubifs-utils/{mkfs.ubifs => common}/fscrypt.c (100%) rename ubifs-utils/{mkfs.ubifs => common}/fscrypt.h (100%) rename ubifs-utils/{mkfs.ubifs => common}/hashtable/hashtable.c (100%) rename ubifs-utils/{mkfs.ubifs => common}/hashtable/hashtable.h (100%) rename ubifs-utils/{mkfs.ubifs => common}/hashtable/hashtable_itr.c (100%) rename ubifs-utils/{mkfs.ubifs => common}/hashtable/hashtable_itr.h (100%) rename ubifs-utils/{mkfs.ubifs => common}/hashtable/hashtable_private.h (100%) rename ubifs-utils/{mkfs.ubifs => common}/key.h (100%) rename ubifs-utils/{mkfs.ubifs => common}/lpt.c (100%) rename ubifs-utils/{mkfs.ubifs => common}/lpt.h (100%) rename ubifs-utils/{mkfs.ubifs => common}/sign.c (100%) rename ubifs-utils/{mkfs.ubifs => common}/sign.h (100%) rename ubifs-utils/{mkfs.ubifs => common}/ubifs.h (100%) diff --git a/ubifs-utils/Makemodule.am b/ubifs-utils/Makemodule.am index 6814d47b..4a617c19 100644 --- a/ubifs-utils/Makemodule.am +++ b/ubifs-utils/Makemodule.am @@ -1,37 +1,40 @@ -mkfs_ubifs_SOURCES = \ - ubifs-utils/mkfs.ubifs/mkfs.ubifs.c \ - ubifs-utils/mkfs.ubifs/defs.h \ - ubifs-utils/mkfs.ubifs/lpt.h \ - ubifs-utils/mkfs.ubifs/mkfs.ubifs.h \ - ubifs-utils/mkfs.ubifs/crc16.h \ - ubifs-utils/mkfs.ubifs/key.h \ - ubifs-utils/mkfs.ubifs/compr.h \ - ubifs-utils/mkfs.ubifs/ubifs.h \ - ubifs-utils/mkfs.ubifs/sign.h \ - ubifs-utils/mkfs.ubifs/crc16.c \ - ubifs-utils/mkfs.ubifs/lpt.c \ - ubifs-utils/mkfs.ubifs/compr.c \ - ubifs-utils/mkfs.ubifs/hashtable/hashtable.h \ - ubifs-utils/mkfs.ubifs/hashtable/hashtable_itr.h \ - ubifs-utils/mkfs.ubifs/hashtable/hashtable_private.h \ - ubifs-utils/mkfs.ubifs/hashtable/hashtable.c \ - ubifs-utils/mkfs.ubifs/hashtable/hashtable_itr.c \ - ubifs-utils/mkfs.ubifs/devtable.c \ +common_SOURCES = \ + ubifs-utils/common/defs.h \ + ubifs-utils/common/crc16.h \ + ubifs-utils/common/crc16.c \ + ubifs-utils/common/compr.h \ + ubifs-utils/common/compr.c \ + ubifs-utils/common/hashtable/hashtable.h \ + ubifs-utils/common/hashtable/hashtable_itr.h \ + ubifs-utils/common/hashtable/hashtable_private.h \ + ubifs-utils/common/hashtable/hashtable.c \ + ubifs-utils/common/hashtable/hashtable_itr.c \ + ubifs-utils/common/devtable.c \ + ubifs-utils/common/ubifs.h \ + ubifs-utils/common/key.h \ + ubifs-utils/common/lpt.h \ + ubifs-utils/common/lpt.c \ + ubifs-utils/common/sign.h \ include/mtd/ubifs-media.h if WITH_CRYPTO -mkfs_ubifs_SOURCES += ubifs-utils/mkfs.ubifs/crypto.c \ - ubifs-utils/mkfs.ubifs/crypto.h \ - ubifs-utils/mkfs.ubifs/fscrypt.c \ - ubifs-utils/mkfs.ubifs/fscrypt.h \ - ubifs-utils/mkfs.ubifs/sign.c +common_SOURCES += ubifs-utils/common/crypto.c \ + ubifs-utils/common/crypto.h \ + ubifs-utils/common/fscrypt.c \ + ubifs-utils/common/fscrypt.h \ + ubifs-utils/common/sign.c endif +mkfs_ubifs_SOURCES = \ + $(common_SOURCES) \ + ubifs-utils/mkfs.ubifs/mkfs.ubifs.h \ + ubifs-utils/mkfs.ubifs/mkfs.ubifs.c + mkfs_ubifs_LDADD = libmtd.a libubi.a $(ZLIB_LIBS) $(LZO_LIBS) $(ZSTD_LIBS) $(UUID_LIBS) $(LIBSELINUX_LIBS) $(OPENSSL_LIBS) -lm -mkfs_ubifs_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CFLAGS) $(LZO_CFLAGS) $(ZSTD_CFLAGS) $(UUID_CFLAGS) $(LIBSELINUX_CFLAGS)\ - -I$(top_srcdir)/ubi-utils/include -I$(top_srcdir)/ubifs-utils/mkfs.ubifs/ +mkfs_ubifs_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CFLAGS) $(LZO_CFLAGS) $(ZSTD_CFLAGS) $(UUID_CFLAGS) $(LIBSELINUX_CFLAGS) \ + -I$(top_srcdir)/ubi-utils/include -I$(top_srcdir)/ubifs-utils/mkfs.ubifs/ -I$(top_srcdir)/ubifs-utils/common -EXTRA_DIST += ubifs-utils/mkfs.ubifs/README +EXTRA_DIST += ubifs-utils/common/README dist_sbin_SCRIPTS = ubifs-utils/mount.ubifs diff --git a/ubifs-utils/mkfs.ubifs/README b/ubifs-utils/common/README similarity index 91% rename from ubifs-utils/mkfs.ubifs/README rename to ubifs-utils/common/README index 7e199390..8c10fd4b 100644 --- a/ubifs-utils/mkfs.ubifs/README +++ b/ubifs-utils/common/README @@ -1,4 +1,4 @@ -UBIFS File System - Make File System program +Common Library * crc16.h and crc16.c were copied from the linux kernel. * crc32.h and crc32.c were copied from mtd-utils and amended. diff --git a/ubifs-utils/mkfs.ubifs/compr.c b/ubifs-utils/common/compr.c similarity index 100% rename from ubifs-utils/mkfs.ubifs/compr.c rename to ubifs-utils/common/compr.c diff --git a/ubifs-utils/mkfs.ubifs/compr.h b/ubifs-utils/common/compr.h similarity index 100% rename from ubifs-utils/mkfs.ubifs/compr.h rename to ubifs-utils/common/compr.h diff --git a/ubifs-utils/mkfs.ubifs/crc16.c b/ubifs-utils/common/crc16.c similarity index 100% rename from ubifs-utils/mkfs.ubifs/crc16.c rename to ubifs-utils/common/crc16.c diff --git a/ubifs-utils/mkfs.ubifs/crc16.h b/ubifs-utils/common/crc16.h similarity index 100% rename from ubifs-utils/mkfs.ubifs/crc16.h rename to ubifs-utils/common/crc16.h diff --git a/ubifs-utils/mkfs.ubifs/crypto.c b/ubifs-utils/common/crypto.c similarity index 100% rename from ubifs-utils/mkfs.ubifs/crypto.c rename to ubifs-utils/common/crypto.c diff --git a/ubifs-utils/mkfs.ubifs/crypto.h b/ubifs-utils/common/crypto.h similarity index 100% rename from ubifs-utils/mkfs.ubifs/crypto.h rename to ubifs-utils/common/crypto.h diff --git a/ubifs-utils/mkfs.ubifs/defs.h b/ubifs-utils/common/defs.h similarity index 100% rename from ubifs-utils/mkfs.ubifs/defs.h rename to ubifs-utils/common/defs.h diff --git a/ubifs-utils/mkfs.ubifs/devtable.c b/ubifs-utils/common/devtable.c similarity index 100% rename from ubifs-utils/mkfs.ubifs/devtable.c rename to ubifs-utils/common/devtable.c diff --git a/ubifs-utils/mkfs.ubifs/fscrypt.c b/ubifs-utils/common/fscrypt.c similarity index 100% rename from ubifs-utils/mkfs.ubifs/fscrypt.c rename to ubifs-utils/common/fscrypt.c diff --git a/ubifs-utils/mkfs.ubifs/fscrypt.h b/ubifs-utils/common/fscrypt.h similarity index 100% rename from ubifs-utils/mkfs.ubifs/fscrypt.h rename to ubifs-utils/common/fscrypt.h diff --git a/ubifs-utils/mkfs.ubifs/hashtable/hashtable.c b/ubifs-utils/common/hashtable/hashtable.c similarity index 100% rename from ubifs-utils/mkfs.ubifs/hashtable/hashtable.c rename to ubifs-utils/common/hashtable/hashtable.c diff --git a/ubifs-utils/mkfs.ubifs/hashtable/hashtable.h b/ubifs-utils/common/hashtable/hashtable.h similarity index 100% rename from ubifs-utils/mkfs.ubifs/hashtable/hashtable.h rename to ubifs-utils/common/hashtable/hashtable.h diff --git a/ubifs-utils/mkfs.ubifs/hashtable/hashtable_itr.c b/ubifs-utils/common/hashtable/hashtable_itr.c similarity index 100% rename from ubifs-utils/mkfs.ubifs/hashtable/hashtable_itr.c rename to ubifs-utils/common/hashtable/hashtable_itr.c diff --git a/ubifs-utils/mkfs.ubifs/hashtable/hashtable_itr.h b/ubifs-utils/common/hashtable/hashtable_itr.h similarity index 100% rename from ubifs-utils/mkfs.ubifs/hashtable/hashtable_itr.h rename to ubifs-utils/common/hashtable/hashtable_itr.h diff --git a/ubifs-utils/mkfs.ubifs/hashtable/hashtable_private.h b/ubifs-utils/common/hashtable/hashtable_private.h similarity index 100% rename from ubifs-utils/mkfs.ubifs/hashtable/hashtable_private.h rename to ubifs-utils/common/hashtable/hashtable_private.h diff --git a/ubifs-utils/mkfs.ubifs/key.h b/ubifs-utils/common/key.h similarity index 100% rename from ubifs-utils/mkfs.ubifs/key.h rename to ubifs-utils/common/key.h diff --git a/ubifs-utils/mkfs.ubifs/lpt.c b/ubifs-utils/common/lpt.c similarity index 100% rename from ubifs-utils/mkfs.ubifs/lpt.c rename to ubifs-utils/common/lpt.c diff --git a/ubifs-utils/mkfs.ubifs/lpt.h b/ubifs-utils/common/lpt.h similarity index 100% rename from ubifs-utils/mkfs.ubifs/lpt.h rename to ubifs-utils/common/lpt.h diff --git a/ubifs-utils/mkfs.ubifs/sign.c b/ubifs-utils/common/sign.c similarity index 100% rename from ubifs-utils/mkfs.ubifs/sign.c rename to ubifs-utils/common/sign.c diff --git a/ubifs-utils/mkfs.ubifs/sign.h b/ubifs-utils/common/sign.h similarity index 100% rename from ubifs-utils/mkfs.ubifs/sign.h rename to ubifs-utils/common/sign.h diff --git a/ubifs-utils/mkfs.ubifs/ubifs.h b/ubifs-utils/common/ubifs.h similarity index 100% rename from ubifs-utils/mkfs.ubifs/ubifs.h rename to ubifs-utils/common/ubifs.h