From 32024dbcaa52cdd9ea9c4fc1bfd8789197979b30 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Thu, 3 Oct 2024 17:57:37 +0200 Subject: [PATCH] tools: mtd-utils: update to 2.2.1 Release notes: https://lists.infradead.org/pipermail/linux-mtd/2024-September/106193.html The rbtree implementation was moved, adapted the patches manually. Link: https://github.com/openwrt/openwrt/pull/16594 Signed-off-by: Hauke Mehrtens --- tools/mtd-utils/Makefile | 6 ++--- tools/mtd-utils/patches/110-portability.patch | 16 +++++++------- tools/mtd-utils/patches/130-lzma_jffs2.patch | 22 +++++++++---------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/tools/mtd-utils/Makefile b/tools/mtd-utils/Makefile index 3bcfabc3ad58..cf7081fb5a93 100644 --- a/tools/mtd-utils/Makefile +++ b/tools/mtd-utils/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mtd-utils -PKG_VERSION:=2.2.0 -PKG_RELEASE:=2 +PKG_VERSION:=2.2.1 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://infraroot.at/pub/mtd/ -PKG_HASH:=250d082f67375ca8451b5fcfc9a23a53ced3ebebd8312c288daf2507bbab1324 +PKG_HASH:=f7ae20b2eb79ee83441468f0b99d897024cd96ff853eea59106fb1952065c803 PKG_CPE_ID:=cpe:/a:mtd-utils_project:mtd-utils PKG_FIXUP:=autoreconf diff --git a/tools/mtd-utils/patches/110-portability.patch b/tools/mtd-utils/patches/110-portability.patch index 7e17f807365a..cf5f0c8d8e54 100644 --- a/tools/mtd-utils/patches/110-portability.patch +++ b/tools/mtd-utils/patches/110-portability.patch @@ -18,8 +18,8 @@ #include #include "common.h" #include "compr.h" ---- a/jffsX-utils/rbtree.h -+++ b/jffsX-utils/rbtree.h +--- a/include/rbtree.h ++++ b/include/rbtree.h @@ -94,8 +94,7 @@ static inline struct page * rb_insert_pa #ifndef _LINUX_RBTREE_H #define _LINUX_RBTREE_H @@ -70,7 +70,7 @@ #include --- a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c +++ b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c -@@ -1554,6 +1554,7 @@ static int add_inode(struct stat *st, in +@@ -1568,6 +1568,7 @@ static int add_inode(struct stat *st, in if (c->default_compr != UBIFS_COMPR_NONE) use_flags |= UBIFS_COMPR_FL; @@ -78,7 +78,7 @@ if (flags & FS_COMPR_FL) use_flags |= UBIFS_COMPR_FL; if (flags & FS_SYNC_FL) -@@ -1566,6 +1567,7 @@ static int add_inode(struct stat *st, in +@@ -1580,6 +1581,7 @@ static int add_inode(struct stat *st, in use_flags |= UBIFS_DIRSYNC_FL; if (fctx) use_flags |= UBIFS_CRYPT_FL; @@ -86,7 +86,7 @@ memset(ino, 0, UBIFS_INO_NODE_SZ); ino_key_init(&key, inum); -@@ -1651,7 +1653,9 @@ static int add_dir_inode(const char *pat +@@ -1665,7 +1667,9 @@ static int add_dir_inode(const char *pat fd = dirfd(dir); if (fd == -1) return sys_err_msg("dirfd failed"); @@ -96,7 +96,7 @@ flags = 0; } -@@ -1862,6 +1866,7 @@ static int add_file(const char *path_nam +@@ -1878,6 +1882,7 @@ static int add_file(const char *path_nam dn->ch.node_type = UBIFS_DATA_NODE; key_write(&key, &dn->key); out_len = NODE_BUFFER_SIZE - UBIFS_DATA_NODE_SZ; @@ -104,7 +104,7 @@ if (c->default_compr == UBIFS_COMPR_NONE && !c->encrypted && (flags & FS_COMPR_FL)) #ifdef WITH_LZO -@@ -1872,6 +1877,7 @@ static int add_file(const char *path_nam +@@ -1888,6 +1893,7 @@ static int add_file(const char *path_nam use_compr = UBIFS_COMPR_NONE; #endif else @@ -112,7 +112,7 @@ use_compr = c->default_compr; compr_type = compress_data(buf, bytes_read, &dn->data, &out_len, use_compr); -@@ -1931,7 +1937,9 @@ static int add_non_dir(const char *path_ +@@ -1947,7 +1953,9 @@ static int add_non_dir(const char *path_ if (fd == -1) return sys_err_msg("failed to open file '%s'", path_name); diff --git a/tools/mtd-utils/patches/130-lzma_jffs2.patch b/tools/mtd-utils/patches/130-lzma_jffs2.patch index 32b7d6c72568..b03265a38047 100644 --- a/tools/mtd-utils/patches/130-lzma_jffs2.patch +++ b/tools/mtd-utils/patches/130-lzma_jffs2.patch @@ -1,9 +1,9 @@ --- a/jffsX-utils/Makemodule.am +++ b/jffsX-utils/Makemodule.am -@@ -10,8 +10,9 @@ mkfs_jffs2_SOURCES = \ - jffsX-utils/summary.h \ - include/linux/jffs2.h \ - include/mtd/jffs2-user.h +@@ -9,8 +9,9 @@ mkfs_jffs2_SOURCES = \ + include/mtd/jffs2-user.h \ + include/list.h \ + include/rbtree.h + mkfs_jffs2_LDADD = libmtd.a $(ZLIB_LIBS) $(LZO_LIBS) -mkfs_jffs2_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CFLAGS) $(LZO_CFLAGS) @@ -11,7 +11,7 @@ jffs2reader_SOURCES = jffsX-utils/jffs2reader.c include/mtd/jffs2-user.h jffs2reader_LDADD = libmtd.a $(ZLIB_LIBS) $(LZO_LIBS) -@@ -33,6 +34,14 @@ if WITH_ZLIB +@@ -32,6 +33,14 @@ if WITH_ZLIB mkfs_jffs2_SOURCES += jffsX-utils/compr_zlib.c endif @@ -28,7 +28,7 @@ dist_man1_MANS += jffsX-utils/mkfs.jffs2.1 --- a/jffsX-utils/compr.c +++ b/jffsX-utils/compr.c -@@ -520,6 +520,9 @@ int jffs2_compressors_init(void) +@@ -471,6 +471,9 @@ int jffs2_compressors_init(void) #ifdef WITH_LZO jffs2_lzo_init(); #endif @@ -38,7 +38,7 @@ return 0; } -@@ -534,5 +537,8 @@ int jffs2_compressors_exit(void) +@@ -485,5 +488,8 @@ int jffs2_compressors_exit(void) #ifdef WITH_LZO jffs2_lzo_exit(); #endif @@ -49,7 +49,7 @@ } --- a/jffsX-utils/compr.h +++ b/jffsX-utils/compr.h -@@ -21,8 +21,9 @@ +@@ -22,8 +22,9 @@ #define JFFS2_RUBINMIPS_PRIORITY 10 #define JFFS2_DYNRUBIN_PRIORITY 20 #define JFFS2_RTIME_PRIORITY 50 @@ -61,7 +61,7 @@ #define JFFS2_COMPR_MODE_NONE 0 #define JFFS2_COMPR_MODE_PRIORITY 1 -@@ -113,5 +114,10 @@ void jffs2_rtime_exit(void); +@@ -110,5 +111,10 @@ void jffs2_rtime_exit(void); int jffs2_lzo_init(void); void jffs2_lzo_exit(void); #endif @@ -5055,7 +5055,7 @@ AC_ARG_WITH([selinux], [AS_HELP_STRING([--with-selinux], [Support for selinux extended attributes])], -@@ -268,6 +272,7 @@ fi +@@ -269,6 +273,7 @@ fi AM_CONDITIONAL([WITH_LZO], [test "x$with_lzo" = "xyes"]) AM_CONDITIONAL([WITH_ZLIB], [test "x$with_zlib" = "xyes"]) AM_CONDITIONAL([WITH_ZSTD], [test "x$with_zstd" = "xyes"]) @@ -5063,7 +5063,7 @@ AM_CONDITIONAL([WITH_XATTR], [test "x$with_xattr" = "xyes"]) AM_CONDITIONAL([WITH_SELINUX], [test "x$with_selinux" = "xyes"]) AM_CONDITIONAL([WITH_CRYPTO], [test "x$with_crypto" = "xyes"]) -@@ -312,6 +317,7 @@ AC_MSG_RESULT([ +@@ -313,6 +318,7 @@ AC_MSG_RESULT([ lzo support: ${with_lzo} zlib support: ${with_zlib} zstd support: ${with_zstd}