Skip to content

Commit

Permalink
tools: mtd-utils: update to 2.2.1
Browse files Browse the repository at this point in the history
Release notes:
https://lists.infradead.org/pipermail/linux-mtd/2024-September/106193.html

The rbtree implementation was moved, adapted the patches manually.

Link: openwrt/openwrt#16594
Signed-off-by: Hauke Mehrtens <[email protected]>
  • Loading branch information
hauke committed Oct 5, 2024
1 parent 1288852 commit 32024db
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions tools/mtd-utils/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions tools/mtd-utils/patches/110-portability.patch
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#include <linux/jffs2.h>
#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
Expand Down Expand Up @@ -70,23 +70,23 @@
#include <sys/types.h>
--- 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;
+#ifndef NO_NATIVE_SUPPORT
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;
+#endif
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");
Expand All @@ -96,23 +96,23 @@
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;
+#ifndef NO_NATIVE_SUPPORT
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
+#endif
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);
Expand Down
22 changes: 11 additions & 11 deletions tools/mtd-utils/patches/130-lzma_jffs2.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
--- 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)
+mkfs_jffs2_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CFLAGS) $(LZO_CFLAGS) -I./include/linux/lzma

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

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -5055,15 +5055,15 @@
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"])
+AM_CONDITIONAL([WITH_LZMA], [test "x$with_lzma" = "xyes"])
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}
Expand Down

0 comments on commit 32024db

Please sign in to comment.