From f1434da508e69406fff3078019fc8a6bc8b9f663 Mon Sep 17 00:00:00 2001 From: Markham Date: Fri, 10 Jun 2022 08:02:11 +0200 Subject: [PATCH] rework djmount target and patches --- ...h.patch => 0001-djmount-fixed-crash.patch} | 0 ...ixed-crash-when-using-UTF-8-charset.patch} | 0 ...03-djmount-fix-hang-with-asset-upnp.patch} | 0 ...ge-when-retrieving-content-via-HTTP.patch} | 0 ...ount-Fix-for-new-autotools-versions.patch} | 0 ...patch => 0006-djmount-fix-newer-gcc.patch} | 0 ...0007-djmount-support-fstab-mounting.patch} | 0 ...-support-seeking-in-large-2gb-files.patch} | 0 ...x.patch => 0009-djmount-pthread-fix.patch} | 0 ...mount-fix-build-with-gettext-0.20.x.patch} | 0 .../djmount/0011-djmount-libupnp-1.6.6.patch | 39 +++++++++++++++++++ .../djmount/0012-djmount-libupnp-1.6.13.patch | 25 ++++++++++++ ...-djmount-avoid-crash-by-using-size_t.patch | 25 ++++++++++++ .../0014-djmount-enable-bigfiles.patch | 38 ++++++++++++++++++ ...ch => djmount-upnp_util.h-fix-build.patch} | 9 ----- make/applications.mk | 28 +++++++------ 16 files changed, 143 insertions(+), 21 deletions(-) rename archive-patches/djmount/{djmount-fixed-crash.patch => 0001-djmount-fixed-crash.patch} (100%) rename archive-patches/djmount/{djmount-fixed-crash-when-using-UTF-8-charset.patch => 0002-djmount-fixed-crash-when-using-UTF-8-charset.patch} (100%) rename archive-patches/djmount/{djmount-fix-hang-with-asset-upnp.patch => 0003-djmount-fix-hang-with-asset-upnp.patch} (100%) rename archive-patches/djmount/{djmount-fix-incorrect-range-when-retrieving-content-via-HTTP.patch => 0004-djmount-fix-incorrect-range-when-retrieving-content-via-HTTP.patch} (100%) rename archive-patches/djmount/{djmount-fix-new-autotools.patch => 0005-djmount-Fix-for-new-autotools-versions.patch} (100%) rename archive-patches/djmount/{djmount-fix-newer-gcc.patch => 0006-djmount-fix-newer-gcc.patch} (100%) rename archive-patches/djmount/{djmount-support-fstab-mounting.patch => 0007-djmount-support-fstab-mounting.patch} (100%) rename archive-patches/djmount/{djmount-support-seeking-in-large-2gb-files.patch => 0008-djmount-support-seeking-in-large-2gb-files.patch} (100%) rename archive-patches/djmount/{djmount-pthread-fix.patch => 0009-djmount-pthread-fix.patch} (100%) rename archive-patches/djmount/{0011-fix-build-with-gettext-0.20.x.patch => 0010-djmount-fix-build-with-gettext-0.20.x.patch} (100%) create mode 100644 archive-patches/djmount/0011-djmount-libupnp-1.6.6.patch create mode 100644 archive-patches/djmount/0012-djmount-libupnp-1.6.13.patch create mode 100644 archive-patches/djmount/0013-djmount-avoid-crash-by-using-size_t.patch create mode 100644 archive-patches/djmount/0014-djmount-enable-bigfiles.patch rename archive-patches/djmount/{0001-upnp_util.h-fix-build.patch => djmount-upnp_util.h-fix-build.patch} (89%) diff --git a/archive-patches/djmount/djmount-fixed-crash.patch b/archive-patches/djmount/0001-djmount-fixed-crash.patch similarity index 100% rename from archive-patches/djmount/djmount-fixed-crash.patch rename to archive-patches/djmount/0001-djmount-fixed-crash.patch diff --git a/archive-patches/djmount/djmount-fixed-crash-when-using-UTF-8-charset.patch b/archive-patches/djmount/0002-djmount-fixed-crash-when-using-UTF-8-charset.patch similarity index 100% rename from archive-patches/djmount/djmount-fixed-crash-when-using-UTF-8-charset.patch rename to archive-patches/djmount/0002-djmount-fixed-crash-when-using-UTF-8-charset.patch diff --git a/archive-patches/djmount/djmount-fix-hang-with-asset-upnp.patch b/archive-patches/djmount/0003-djmount-fix-hang-with-asset-upnp.patch similarity index 100% rename from archive-patches/djmount/djmount-fix-hang-with-asset-upnp.patch rename to archive-patches/djmount/0003-djmount-fix-hang-with-asset-upnp.patch diff --git a/archive-patches/djmount/djmount-fix-incorrect-range-when-retrieving-content-via-HTTP.patch b/archive-patches/djmount/0004-djmount-fix-incorrect-range-when-retrieving-content-via-HTTP.patch similarity index 100% rename from archive-patches/djmount/djmount-fix-incorrect-range-when-retrieving-content-via-HTTP.patch rename to archive-patches/djmount/0004-djmount-fix-incorrect-range-when-retrieving-content-via-HTTP.patch diff --git a/archive-patches/djmount/djmount-fix-new-autotools.patch b/archive-patches/djmount/0005-djmount-Fix-for-new-autotools-versions.patch similarity index 100% rename from archive-patches/djmount/djmount-fix-new-autotools.patch rename to archive-patches/djmount/0005-djmount-Fix-for-new-autotools-versions.patch diff --git a/archive-patches/djmount/djmount-fix-newer-gcc.patch b/archive-patches/djmount/0006-djmount-fix-newer-gcc.patch similarity index 100% rename from archive-patches/djmount/djmount-fix-newer-gcc.patch rename to archive-patches/djmount/0006-djmount-fix-newer-gcc.patch diff --git a/archive-patches/djmount/djmount-support-fstab-mounting.patch b/archive-patches/djmount/0007-djmount-support-fstab-mounting.patch similarity index 100% rename from archive-patches/djmount/djmount-support-fstab-mounting.patch rename to archive-patches/djmount/0007-djmount-support-fstab-mounting.patch diff --git a/archive-patches/djmount/djmount-support-seeking-in-large-2gb-files.patch b/archive-patches/djmount/0008-djmount-support-seeking-in-large-2gb-files.patch similarity index 100% rename from archive-patches/djmount/djmount-support-seeking-in-large-2gb-files.patch rename to archive-patches/djmount/0008-djmount-support-seeking-in-large-2gb-files.patch diff --git a/archive-patches/djmount/djmount-pthread-fix.patch b/archive-patches/djmount/0009-djmount-pthread-fix.patch similarity index 100% rename from archive-patches/djmount/djmount-pthread-fix.patch rename to archive-patches/djmount/0009-djmount-pthread-fix.patch diff --git a/archive-patches/djmount/0011-fix-build-with-gettext-0.20.x.patch b/archive-patches/djmount/0010-djmount-fix-build-with-gettext-0.20.x.patch similarity index 100% rename from archive-patches/djmount/0011-fix-build-with-gettext-0.20.x.patch rename to archive-patches/djmount/0010-djmount-fix-build-with-gettext-0.20.x.patch diff --git a/archive-patches/djmount/0011-djmount-libupnp-1.6.6.patch b/archive-patches/djmount/0011-djmount-libupnp-1.6.6.patch new file mode 100644 index 0000000..d997d78 --- /dev/null +++ b/archive-patches/djmount/0011-djmount-libupnp-1.6.6.patch @@ -0,0 +1,39 @@ +From e955996e3f0eae9c518d4e6e036ba3e1636a4698 Mon Sep 17 00:00:00 2001 +From: Unknown User +Date: Thu, 9 Jun 2022 20:42:09 +0200 +Subject: [PATCH 11/14] djmount: libupnp-1.6.6 + +Signed-off-by: Thilo Graf +--- + djmount/fuse_main.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/djmount/fuse_main.c b/djmount/fuse_main.c +index f47a6e8..ae74cb3 100644 +--- a/djmount/fuse_main.c ++++ b/djmount/fuse_main.c +@@ -618,7 +618,7 @@ main (int argc, char *argv[]) + } + Log_Colorize (true); + #if UPNP_HAVE_DEBUG +- SetLogFileNames ("/dev/null", "/dev/null"); ++ UpnpSetLogFileNames ("/dev/null", "/dev/null"); + #endif + + /* +@@ -745,10 +745,10 @@ main (int argc, char *argv[]) + Log_SetMaxLevel (LOG_ERROR); + #if UPNP_HAVE_DEBUG + } else if (strcmp (s, "upnperr") == 0) { +- SetLogFileNames ("/dev/stdout", ++ UpnpSetLogFileNames ("/dev/stdout", + "/dev/null"); + } else if (strcmp (s, "upnpall") == 0) { +- SetLogFileNames ("/dev/stdout", ++ UpnpSetLogFileNames ("/dev/stdout", + "/dev/stdout"); + #endif + } else { +-- +2.35.1 + diff --git a/archive-patches/djmount/0012-djmount-libupnp-1.6.13.patch b/archive-patches/djmount/0012-djmount-libupnp-1.6.13.patch new file mode 100644 index 0000000..63e21b5 --- /dev/null +++ b/archive-patches/djmount/0012-djmount-libupnp-1.6.13.patch @@ -0,0 +1,25 @@ +From 946b88a69a57c59231aeda2394dcb7a463360412 Mon Sep 17 00:00:00 2001 +From: Unknown User +Date: Thu, 9 Jun 2022 20:43:45 +0200 +Subject: [PATCH 12/14] djmount: libupnp-1.6.13 + +Signed-off-by: Thilo Graf +--- + djmount/upnp_util.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/djmount/upnp_util.h b/djmount/upnp_util.h +index 93b85eb..f3703f9 100644 +--- a/djmount/upnp_util.h ++++ b/djmount/upnp_util.h +@@ -28,6 +28,7 @@ + + + #include ++#include + + + #ifdef __cplusplus +-- +2.35.1 + diff --git a/archive-patches/djmount/0013-djmount-avoid-crash-by-using-size_t.patch b/archive-patches/djmount/0013-djmount-avoid-crash-by-using-size_t.patch new file mode 100644 index 0000000..0450578 --- /dev/null +++ b/archive-patches/djmount/0013-djmount-avoid-crash-by-using-size_t.patch @@ -0,0 +1,25 @@ +From 520eecce9c13d5310aee5d4033feb1a6053235f3 Mon Sep 17 00:00:00 2001 +From: Thilo Graf +Date: Thu, 9 Jun 2022 20:47:30 +0200 +Subject: [PATCH 13/14] djmount: avoid crash-by using size_t + +--- + djmount/file_buffer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/djmount/file_buffer.c b/djmount/file_buffer.c +index 9d3e8ae..4a927ac 100644 +--- a/djmount/file_buffer.c ++++ b/djmount/file_buffer.c +@@ -212,7 +212,7 @@ FileBuffer_Read (FileBuffer* file, char* buffer, + * to return the exact number of bytes requested. + */ + do { +- unsigned int read_size = size - n; ++ size_t read_size = size - n; + if (n > 0) { + Log_Printf (LOG_DEBUG, + "UpnpReadHttpGet loop ! url '%s' " +-- +2.35.1 + diff --git a/archive-patches/djmount/0014-djmount-enable-bigfiles.patch b/archive-patches/djmount/0014-djmount-enable-bigfiles.patch new file mode 100644 index 0000000..b08e494 --- /dev/null +++ b/archive-patches/djmount/0014-djmount-enable-bigfiles.patch @@ -0,0 +1,38 @@ +From 24d4d43702a76f2bae72200a96e1527faa149afc Mon Sep 17 00:00:00 2001 +From: Thilo Graf +Date: Thu, 9 Jun 2022 20:49:11 +0200 +Subject: [PATCH 14/14] djmount: enable bigfiles + +--- + djmount/media_file.c | 2 +- + libupnp/upnp/src/genlib/net/http/httpreadwrite.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/djmount/media_file.c b/djmount/media_file.c +index 3352763..65394c7 100644 +--- a/djmount/media_file.c ++++ b/djmount/media_file.c +@@ -282,7 +282,7 @@ MediaFile_GetResSize (const MediaFile* const file) + { + const char* const str = ixmlElement_getAttribute (file->res, "size"); + off_t res; +- STRING_TO_INT (str, res, 8ULL * 1024 * 1024 * 1024); ++ STRING_TO_INT (str, res, 8ULL << 30); + return res; + } + +diff --git a/libupnp/upnp/src/genlib/net/http/httpreadwrite.c b/libupnp/upnp/src/genlib/net/http/httpreadwrite.c +index bb03419..4fbb186 100644 +--- a/libupnp/upnp/src/genlib/net/http/httpreadwrite.c ++++ b/libupnp/upnp/src/genlib/net/http/httpreadwrite.c +@@ -2107,7 +2107,7 @@ http_OpenHttpGetEx( IN const char *url_str, + } + + memset( &rangeBuf, 0, sizeof( rangeBuf ) ); +- sprintf( rangeBuf.RangeHeader, "Range: bytes=%llu-%llu\r\n", ++ sprintf( rangeBuf.RangeHeader, "Range: bytes=%llu-%llu\r\n", + lowRange, highRange ); + + membuffer_init( &request ); +-- +2.35.1 diff --git a/archive-patches/djmount/0001-upnp_util.h-fix-build.patch b/archive-patches/djmount/djmount-upnp_util.h-fix-build.patch similarity index 89% rename from archive-patches/djmount/0001-upnp_util.h-fix-build.patch rename to archive-patches/djmount/djmount-upnp_util.h-fix-build.patch index a4b6835..13691bd 100755 --- a/archive-patches/djmount/0001-upnp_util.h-fix-build.patch +++ b/archive-patches/djmount/djmount-upnp_util.h-fix-build.patch @@ -12,15 +12,6 @@ diff --git a/djmount/upnp_util.h b/djmount/upnp_util.h index 93b85eb..ba20287 100644 --- a/djmount/upnp_util.h +++ b/djmount/upnp_util.h -@@ -26,7 +26,7 @@ - #ifndef UPNP_UTIL_H_INCLUDED - #define UPNP_UTIL_H_INCLUDED - -- -+#include - #include - - @@ -46,8 +46,8 @@ extern "C" { *****************************************************************************/ char* diff --git a/make/applications.mk b/make/applications.mk index e097fa8..452ec4f 100755 --- a/make/applications.mk +++ b/make/applications.mk @@ -667,24 +667,28 @@ $(D)/motion: $(ARCHIVE)/motion-3.2.12.tar.gz | $(TARGETPREFIX) $(REMOVE)/motion-3.2.12 $(TOUCH) -DJMOUNT_PATCH = 0001-upnp_util.h-fix-build.patch -DJMOUNT_PATCH += djmount-fixed-crash.patch -DJMOUNT_PATCH += djmount-fixed-crash-when-using-UTF-8-charset.patch -DJMOUNT_PATCH += djmount-fix-hang-with-asset-upnp.patch -DJMOUNT_PATCH += djmount-fix-incorrect-range-when-retrieving-content-via-HTTP.patch -DJMOUNT_PATCH += djmount-fix-new-autotools.patch -DJMOUNT_PATCH += djmount-fix-newer-gcc.patch -DJMOUNT_PATCH += djmount-support-fstab-mounting.patch -DJMOUNT_PATCH += djmount-support-seeking-in-large-2gb-files.patch -DJMOUNT_PATCH += djmount-pthread-fix.patch +DJMOUNT_PATCH = 0001-djmount-fixed-crash.patch +DJMOUNT_PATCH += 0002-djmount-fixed-crash-when-using-UTF-8-charset.patch +DJMOUNT_PATCH += 0003-djmount-fix-hang-with-asset-upnp.patch +DJMOUNT_PATCH += 0004-djmount-fix-incorrect-range-when-retrieving-content-via-HTTP.patch +DJMOUNT_PATCH += 0005-djmount-Fix-for-new-autotools-versions.patch +DJMOUNT_PATCH += 0006-djmount-fix-newer-gcc.patch +DJMOUNT_PATCH += 0007-djmount-support-fstab-mounting.patch +DJMOUNT_PATCH += 0008-djmount-support-seeking-in-large-2gb-files.patch +DJMOUNT_PATCH += 0009-djmount-pthread-fix.patch +DJMOUNT_PATCH += 0010-djmount-fix-build-with-gettext-0.20.x.patch +DJMOUNT_PATCH += 0011-djmount-libupnp-1.6.6.patch +DJMOUNT_PATCH += 0012-djmount-libupnp-1.6.13.patch +DJMOUNT_PATCH += 0013-djmount-avoid-crash-by-using-size_t.patch +DJMOUNT_PATCH += 0014-djmount-enable-bigfiles.patch DJMOUNT_PATCH += djmount-codeset.patch -DJMOUNT_PATCH += 0011-fix-build-with-gettext-0.20.x.patch +DJMOUNT_PATCH += djmount-upnp_util.h-fix-build.patch # works with libupnp 1.6.25, laters maybe! $(D)/djmount: $(D)/libfuse $(ARCHIVE)/djmount-0.71.tar.gz | $(TARGETPREFIX) $(START_BUILD) $(REMOVE)/djmount-0.71 - cp -fr $(ARCHIVE)/djmount-0.71 $(BUILD_TMP) + $(UNTAR)/djmount-0.71.tar.gz pushd $(BUILD_TMP)/djmount-0.71 && \ $(call apply_patches, $(addprefix djmount/, $(DJMOUNT_PATCH))); \ touch libupnp/config.aux/config.rpath; \ -- 2.39.5