Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
RUT9xx SDK patch, to build on recent systems
diff -Naur RUT9XX_R_GPL_orig/package/kernel/linux/modules/crypto.mk RUT9XX_R_GPL/package/kernel/linux/modules/crypto.mk
--- RUT9XX_R_GPL_orig/package/kernel/linux/modules/crypto.mk 2020-03-04 13:19:43.000000000 +0100
+++ RUT9XX_R_GPL/package/kernel/linux/modules/crypto.mk2020-07-17 14:04:12.219236947 +0200
@@ -281,7 +281,7 @@
TITLE:=CRC32c CRC module
DEPENDS:=+kmod-crypto-hash
KCONFIG:=CONFIG_CRYPTO_CRC32C
- FILES:=$(LINUX_DIR)/crypto/crc32c.ko
+ FILES:=$(LINUX_DIR)/crypto/crc32c_generic.ko
AUTOLOAD:=$(call AutoLoad,04,crc32c,1)
$(call AddDepends/crypto)
endef
diff -Naur RUT9XX_R_GPL_orig/package/kernel/linux/modules/fs.mk RUT9XX_R_GPL/package/kernel/linux/modules/fs.mk
--- RUT9XX_R_GPL_orig/package/kernel/linux/modules/fs.mk 2020-03-04 13:19:43.000000000 +0100
+++ RUT9XX_R_GPL/package/kernel/linux/modules/fs.mk 2020-07-17 13:59:15.769224762 +0200
@@ -111,6 +111,7 @@
$(LINUX_DIR)/fs/jbd2/jbd2.ko \
$(LINUX_DIR)/fs/mbcache.ko
AUTOLOAD:=$(call AutoLoad,30,mbcache jbd2 ext4,1)
+ DEPENDS:= +kmod-lib-crc32c
$(call AddDepends/crc16, +!LINUX_3_3:kmod-crypto-hash)
endef
--- RUT9XX_R_GPL_orig/.config 2020-03-13 10:48:50.000000000 +0100
+++ RUT9XX_R_GPL/.config 2020-07-17 13:50:15.409202558 +0200
@@ -2517,7 +2517,7 @@
CONFIG_PACKAGE_kmod-crypto-authenc=y
CONFIG_PACKAGE_kmod-crypto-cbc=y
CONFIG_PACKAGE_kmod-crypto-core=y
-# CONFIG_PACKAGE_kmod-crypto-crc32c is not set
+CONFIG_PACKAGE_kmod-crypto-crc32c=y
CONFIG_PACKAGE_kmod-crypto-deflate=y
CONFIG_PACKAGE_kmod-crypto-des=y
CONFIG_PACKAGE_kmod-crypto-ecb=y
diff -Naur RUT9XX_R_GPL_orig/tools/bison/patches/101-iohmissing.patch RUT9XX_R_GPL/tools/bison/patches/101-iohmissing.patch
--- RUT9XX_R_GPL_orig/tools/bison/patches/101-iohmissing.patch 1970-01-01 01:00:00.000000000 +0100
+++ RUT9XX_R_GPL/tools/bison/patches/101-iohmissing.patch 2020-07-17 12:22:42.222319970 +0200
@@ -0,0 +1,13 @@
+Index: bison-3.0.4/lib/fseterr.c
+===================================================================
+--- bison-3.0.4.orig/lib/fseterr.c
++++ bison-3.0.4/lib/fseterr.c
+@@ -29,7 +29,7 @@ fseterr (FILE *fp)
+ /* Most systems provide FILE as a struct and the necessary bitmask in
+ <stdio.h>, because they need it for implementing getc() and putc() as
+ fast macros. */
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+ fp->_flags |= _IO_ERR_SEEN;
+ #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
+ fp_->_flags |= __SERR;
diff -Naur RUT9XX_R_GPL_orig/tools/e2fsprogs/Makefile RUT9XX_R_GPL/tools/e2fsprogs/Makefile
--- RUT9XX_R_GPL_orig/tools/e2fsprogs/Makefile 2020-03-04 13:19:45.000000000 +0100
+++ RUT9XX_R_GPL/tools/e2fsprogs/Makefile 2020-07-17 12:29:46.552337415 +0200
@@ -8,8 +8,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=e2fsprogs
-PKG_VERSION:=1.42.8
-PKG_MD5SUM:=8ef664b6eb698aa6b733df59b17b9ed4
+PKG_VERSION:=1.43.8
+PKG_MD5SUM:=af4f9aeba1a3b875c2ef1c58e995578d
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
diff -Naur RUT9XX_R_GPL_orig/tools/e2fsprogs/patches/003-openbsd-compat.patch RUT9XX_R_GPL/tools/e2fsprogs/patches/003-openbsd-compat.patch
--- RUT9XX_R_GPL_orig/tools/e2fsprogs/patches/003-openbsd-compat.patch 2020-03-04 13:19:45.000000000 +0100
+++ RUT9XX_R_GPL/tools/e2fsprogs/patches/003-openbsd-compat.patch 2020-07-17 12:32:41.982344627 +0200
@@ -11,14 +11,4 @@
#endif
#ifdef HAVE_LINUX_FD_H
#include <linux/fd.h>
-diff -Nur e2fsprogs-1.42.7.orig/lib/quota/mkquota.c e2fsprogs-1.42.7/lib/quota/mkquota.c
---- e2fsprogs-1.42.7.orig/lib/quota/mkquota.c Wed Jan 2 01:47:20 2013
-+++ e2fsprogs-1.42.7/lib/quota/mkquota.c Thu Mar 7 14:21:59 2013
-@@ -8,6 +8,7 @@
- #include <sys/stat.h>
- #include <unistd.h>
- #include <errno.h>
-+#include <stdint.h>
- #include <string.h>
- #include <fcntl.h>
diff -Naur RUT9XX_R_GPL_orig/tools/findutils/patches/1.patch RUT9XX_R_GPL/tools/findutils/patches/1.patch
--- RUT9XX_R_GPL_orig/tools/findutils/patches/1.patch 1970-01-01 01:00:00.000000000 +0100
+++ RUT9XX_R_GPL/tools/findutils/patches/1.patch 2020-07-17 13:07:08.065762875 +0200
@@ -0,0 +1,18 @@
+diff -Naur findutils-4.4.2.orig/gnulib/lib/freadahead.c findutils-4.4.2/gnulib/lib/freadahead.c
+--- findutils-4.4.2.orig/gnulib/lib/freadahead.c 2009-05-10 21:23:57.000000000 +0000
++++ findutils-4.4.2/gnulib/lib/freadahead.c 2013-07-06 01:54:25.443043832 +0000
+@@ -22,6 +22,7 @@
+ size_t
+ freadahead (FILE *fp)
+ {
++#if 0
+ #if defined _IO_ferror_unlocked /* GNU libc, BeOS */
+ if (fp->_IO_write_ptr > fp->_IO_write_base)
+ return 0;
+@@ -63,4 +64,6 @@
+ #else
+ #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread on your system, then report this to bug-gnulib."
+ #endif
++#endif
++ return 0;
+ }
diff -Naur RUT9XX_R_GPL_orig/tools/m4/patches/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch RUT9XX_R_GPL/tools/m4/patches/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
--- RUT9XX_R_GPL_orig/tools/m4/patches/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch 1970-01-01 01:00:00.000000000 +0100
+++ RUT9XX_R_GPL/tools/m4/patches/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch 2020-07-17 12:12:14.512294170 +0200
@@ -0,0 +1,154 @@
+rom 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Mon, 5 Mar 2018 10:56:29 -0800
+Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Problem reported by Daniel P. Berrangé in:
+https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
+* lib/fbufmode.c (fbufmode):
+* lib/fflush.c (clear_ungetc_buffer_preserving_position)
+(disable_seek_optimization, rpl_fflush):
+* lib/fpending.c (__fpending):
+* lib/fpurge.c (fpurge):
+* lib/freadable.c (freadable):
+* lib/freadahead.c (freadahead):
+* lib/freading.c (freading):
+* lib/freadptr.c (freadptr):
+* lib/freadseek.c (freadptrinc):
+* lib/fseeko.c (fseeko):
+* lib/fseterr.c (fseterr):
+* lib/fwritable.c (fwritable):
+* lib/fwriting.c (fwriting):
+Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
+* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
+Define if not already defined.
+
+[yann.morin.1998@free.fr: partially backport from upstream gnulib]
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+
+---
+ lib/fflush.c | 6 +++---
+ lib/fpending.c | 2 +-
+ lib/fpurge.c | 2 +-
+ lib/freadahead.c | 2 +-
+ lib/freading.c | 2 +-
+ lib/fseeko.c | 4 ++--
+ lib/stdio-impl.h | 6 ++++++
+ 7 files changed, 15 insertions(+), 9 deletions(-)
+
+diff --git a/lib/fflush.c b/build-aux/gnulib/lib/fflush.c
+index 983ade0ff..a6edfa105 100644
+--- a/lib/fflush.c
++++ b/lib/fflush.c
+@@ -33,7 +33,7 @@
+ #undef fflush
+
+
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+
+ /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */
+ static void
+@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
+
+ #endif
+
+-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
++#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
+
+ # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
+ if (stream == NULL || ! freading (stream))
+ return fflush (stream);
+
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+
+ clear_ungetc_buffer_preserving_position (stream);
+
+diff --git a/lib/fpurge.c b/build-aux/gnulib/lib/fpurge.c
+index b1d417c7a..3aedcc373 100644
+--- a/lib/fpurge.c
++++ b/lib/fpurge.c
+@@ -62,7 +62,7 @@ fpurge (FILE *fp)
+ /* Most systems provide FILE as a struct and the necessary bitmask in
+ <stdio.h>, because they need it for implementing getc() and putc() as
+ fast macros. */
+-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+ fp->_IO_read_end = fp->_IO_read_ptr;
+ fp->_IO_write_ptr = fp->_IO_write_base;
+ /* Avoid memory leak when there is an active ungetc buffer. */
+diff --git a/lib/freadahead.c b/build-aux/gnulib/lib/freadahead.c
+index c2ecb5b28..23ec76ee5 100644
+--- a/lib/freadahead.c
++++ b/lib/freadahead.c
+@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
+ size_t
+ freadahead (FILE *fp)
+ {
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+ if (fp->_IO_write_ptr > fp->_IO_write_base)
+ return 0;
+ return (fp->_IO_read_end - fp->_IO_read_ptr)
+diff --git a/lib/freading.c b/build-aux/gnulib/lib/freading.c
+index 73c28acdd..c24d0c88a 100644
+--- a/lib/freading.c
++++ b/lib/freading.c
+@@ -31,7 +31,7 @@ freading (FILE *fp)
+ /* Most systems provide FILE as a struct and the necessary bitmask in
+ <stdio.h>, because they need it for implementing getc() and putc() as
+ fast macros. */
+-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+ return ((fp->_flags & _IO_NO_WRITES) != 0
+ || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
+ && fp->_IO_read_base != NULL));
+diff --git a/lib/fseeko.c b/build-aux/gnulib/lib/fseeko.c
+index 0101ab55f..193f4e8ce 100644
+--- a/lib/fseeko.c
++++ b/lib/fseeko.c
+@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
+ #endif
+
+ /* These tests are based on fpurge.c. */
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+ if (fp->_IO_read_end == fp->_IO_read_ptr
+ && fp->_IO_write_ptr == fp->_IO_write_base
+ && fp->_IO_save_base == NULL)
+@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
+ return -1;
+ }
+
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+ fp->_flags &= ~_IO_EOF_SEEN;
+ fp->_offset = pos;
+ #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+diff --git a/lib/stdio-impl.h b/build-aux/gnulib/lib/stdio-impl.h
+index 78d896e9f..05c5752a2 100644
+--- a/lib/stdio-impl.h
++++ b/lib/stdio-impl.h
+@@ -18,6 +18,12 @@
+ the same implementation of stdio extension API, except that some fields
+ have different naming conventions, or their access requires some casts. */
+
++/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
++ problem by defining it ourselves. FIXME: Do not rely on glibc
++ internals. */
++#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
++# define _IO_IN_BACKUP 0x100
++#endif
+
+ /* BSD stdio derived implementations. */
+
+--
+2.14.1
+
+
diff -Naur RUT9XX_R_GPL_orig/tools/mtd-utils/patches/999-fixmajorminor.patch RUT9XX_R_GPL/tools/mtd-utils/patches/999-fixmajorminor.patch
--- RUT9XX_R_GPL_orig/tools/mtd-utils/patches/999-fixmajorminor.patch 1970-01-01 01:00:00.000000000 +0100
+++ RUT9XX_R_GPL/tools/mtd-utils/patches/999-fixmajorminor.patch 2020-07-17 13:05:12.745758143 +0200
@@ -0,0 +1,64 @@
+--- a/lib/libmtd.c 2020-03-13 10:25:36.000000000 +0100
++++ b/lib/aa.c2020-07-17 12:49:00.992384870 +0200
+@@ -28,6 +28,7 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <dirent.h>
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/ioctl.h>
+--- a/mkfs.jffs2.c 2020-07-17 12:50:19.262388087 +0200
++++ b/a.c 2020-07-17 12:53:29.445729235 +0200
+@@ -65,6 +65,7 @@
+ #include <libgen.h>
+ #include <ctype.h>
+ #include <time.h>
++#include <sys/sysmacros.h>
+ #include <getopt.h>
+ #ifndef WITHOUT_XATTR
+ #include <sys/xattr.h>
+--- a/ubi-utils/src/libubi.c 2020-07-17 12:54:18.635731257 +0200
++++ b/ubi-utils/src/a.c 2020-07-17 12:55:33.815734344 +0200
+@@ -30,6 +30,7 @@
+ #include <unistd.h>
+ #include <limits.h>
+ #include <sys/ioctl.h>
++#include <sys/sysmacros.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #ifdef __CYGWIN__
+
+diff -Naur ./mtd-utils-1.4.5/mkfs.ubifs/devtable.c mtf-utild-test/mkfs.ubifs/devtable.c
+--- ./mtd-utils-1.4.5/mkfs.ubifs/devtable.c 2020-07-17 12:57:12.812405076 +0200
++++ mtf-utild-test/mkfs.ubifs/devtable.c 2020-07-17 12:58:03.385740490 +0200
+@@ -47,6 +47,7 @@
+ #include "mkfs.ubifs.h"
+ #include "hashtable/hashtable.h"
+ #include "hashtable/hashtable_itr.h"
++#include <sys/sysmacros.h>
+
+ /*
+ * The hash table which contains paths to files/directories/device nodes
+diff -Naur ./mtd-utils-1.4.5/mkfs.ubifs/mkfs.ubifs.c mtf-utild-test/mkfs.ubifs/mkfs.ubifs.c
+--- ./mtd-utils-1.4.5/mkfs.ubifs/mkfs.ubifs.c 2020-07-17 12:57:12.832405077 +0200
++++ mtf-utild-test/mkfs.ubifs/mkfs.ubifs.c 2020-07-17 12:58:17.855741082 +0200
+@@ -22,6 +22,7 @@
+
+ #include "mkfs.ubifs.h"
+ #include <crc32.h>
++#include <sys/sysmacros.h>
+
+ #define PROGRAM_VERSION "1.5"
+
+diff -Naur ./mtd-utils-1.4.5/mkfs.ubifs/mkfs.ubifs.h mtd-utils/mkfs.ubifs/mkfs.ubifs.h
+--- ./mtd-utils-1.4.5/mkfs.ubifs/mkfs.ubifs.h 2020-07-17 13:04:31.039089760 +0200
++++ mtd-utils/mkfs.ubifs/mkfs.ubifs.h 2020-07-17 13:04:19.382422615 +0200
+@@ -36,6 +36,7 @@
+ #include <linux/types.h>
+ #ifdef __linux__
+ #include <linux/fs.h>
++# define llseek lseek
+ #else
+ # ifndef O_LARGEFILE
+ # define O_LARGEFILE 0
diff -Naur RUT9XX_R_GPL_orig/tools/squashfs/patches/111-majorminor.patch RUT9XX_R_GPL/tools/squashfs/patches/111-majorminor.patch
--- RUT9XX_R_GPL_orig/tools/squashfs/patches/111-majorminor.patch 1970-01-01 01:00:00.000000000 +0100
+++ RUT9XX_R_GPL/tools/squashfs/patches/111-majorminor.patch 2020-07-17 13:11:51.249107852 +0200
@@ -0,0 +1,22 @@
+diff -Naur squashfs3.0/squashfs-tools/mksquashfs.c sq/squashfs-tools/mksquashfs.c
+--- squashfs3.0/squashfs-tools/mksquashfs.c 2020-07-17 13:07:48.662431211 +0200
++++ sq/squashfs-tools/mksquashfs.c 2020-07-17 13:08:51.489100465 +0200
+@@ -40,6 +40,7 @@
+ #include <signal.h>
+ #include <setjmp.h>
+ #include <sys/mman.h>
++#include <sys/sysmacros.h>
+
+ #ifndef linux
+ #define __BYTE_ORDER BYTE_ORDER
+
+--- squashfs3.0/squashfs-tools/unsquashfs.c 2006-03-15 22:36:21.000000000 +0100
++++ sq/squashfs-tools/unsquashfs.c 2020-07-17 13:11:08.552439428 +0200
+@@ -32,6 +32,7 @@
+ #include <zlib.h>
+ #include <sys/mman.h>
+ #include <utime.h>
++#include <sys/sysmacros.h>
+
+ #ifndef linux
+ #define __BYTE_ORDER BYTE_ORDER
diff -Naur RUT9XX_R_GPL_orig/tools/squashfs4/patches/200-majorminor.patch RUT9XX_R_GPL/tools/squashfs4/patches/200-majorminor.patch
--- RUT9XX_R_GPL_orig/tools/squashfs4/patches/200-majorminor.patch 1970-01-01 01:00:00.000000000 +0100
+++ RUT9XX_R_GPL/tools/squashfs4/patches/200-majorminor.patch 2020-07-17 13:14:12.825780337 +0200
@@ -0,0 +1,21 @@
+diff -Naur squashfs4.2/squashfs-tools/mksquashfs.c sq/squashfs-tools/mksquashfs.c
+--- squashfs4.2/squashfs-tools/mksquashfs.c 2020-07-17 13:13:01.049110721 +0200
++++ sq/squashfs-tools/mksquashfs.c 2020-07-17 13:13:34.312445415 +0200
+@@ -52,6 +52,7 @@
+ #include <regex.h>
+ #include <fnmatch.h>
+ #include <sys/wait.h>
++#include <sys/sysmacros.h>
+
+ #ifndef linux
+ #ifndef __CYGWIN__
+diff -Naur squashfs4.2/squashfs-tools/unsquashfs.c sq/squashfs-tools/unsquashfs.c
+--- squashfs4.2/squashfs-tools/unsquashfs.c 2020-07-17 13:13:01.039110721 +0200
++++ sq/squashfs-tools/unsquashfs.c 2020-07-17 13:13:43.169112448 +0200
+@@ -28,6 +28,7 @@
+ #include "read_fs.h"
+ #include "compressor.h"
+ #include "xattr.h"
++#include <sys/sysmacros.h>
+
+ #include <sys/types.h>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment