libmtp: upgrade 1.1.21 -> 1.1.23

1.1.23 gained --enable-crossbuilddir, which uses the native mtp-hotplug
to generate udev rules. Use it and drop the local
0001-Use-native-mtp-hotplug and 0002-util-mtp-hotplug patches.

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
This commit is contained in:
Khem Raj
2026-06-09 21:17:26 -07:00
parent e49e41b4e6
commit 009cff1a8a
3 changed files with 7 additions and 79 deletions
@@ -1,43 +0,0 @@
From 4e8eab047a43e48bd541f2887104299fcfb99b0d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
Date: Tue, 27 Nov 2018 12:03:20 +0100
Subject: [PATCH] Use native mtp-hotplug
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Upstream-Status: Inappropriate [OE-specific]
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
Makefile.am | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 7b7e06b..083e1c6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -16,16 +16,16 @@ hwdb_DATA=69-libmtp.hwdb
noinst_DATA=libmtp.usermap libmtp.fdi
libmtp.usermap: util/mtp-hotplug
- util/mtp-hotplug > libmtp.usermap
+ mtp-hotplug > libmtp.usermap
@UDEV_RULES@: util/mtp-hotplug
- util/mtp-hotplug -u -p"@UDEV@" @UDEV_GROUP@ @UDEV_MODE@ > @UDEV_RULES@
+ mtp-hotplug -u -p"@UDEV@" @UDEV_GROUP@ @UDEV_MODE@ > @UDEV_RULES@
libmtp.fdi: util/mtp-hotplug
- util/mtp-hotplug -H > libmtp.fdi
+ mtp-hotplug -H > libmtp.fdi
$(hwdb_DATA): util/mtp-hotplug
- util/mtp-hotplug -w > $(hwdb_DATA)
+ mtp-hotplug -w > $(hwdb_DATA)
CLEANFILES = libmtp.usermap @UDEV_RULES@ libmtp.fdi libmtp.hwdb
endif
--
2.14.5
@@ -1,33 +0,0 @@
From 0644188a537a06bc6d04483b21e23b80987eb497 Mon Sep 17 00:00:00 2001
From: Hieu Van Nguyen <hieu2.nguyen@lge.com>
Date: Fri, 11 Oct 2024 04:21:21 +0000
Subject: [PATCH] util/mtp-hotplug.c: Enable stack memory protection
Use "return 0" instead of "exit(0)" at the end of main()
function to enable checking for Stack Overflow at Runtime.
Use "return 0" to let the program exit normally by returning from
the main function. This allows the compiler to perform necessary
cleanup operations, including stack canary checks.
__stack_chk_fail function isn't being invoked when using exit(0) at
the end of the main function
$ objdump -T ./util/.libs/mtp-hotplug | grep __stack_chk_fail
This return empty.
---
Upstream-Status: Backport [https://github.com/libmtp/libmtp/commit/e89dbb6ecf244936acc9a52aa4af9635bda5926a]
util/mtp-hotplug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/mtp-hotplug.c b/util/mtp-hotplug.c
index b5bc6da40f..db75cb38a1 100644
--- a/util/mtp-hotplug.c
+++ b/util/mtp-hotplug.c
@@ -301,5 +301,5 @@ int main (int argc, char **argv)
printf("\n");
}
- exit (0);
+ return 0;
}
@@ -18,9 +18,7 @@ DEPENDS = "libusb1 gettext-native"
DEPENDS:append:class-target = " ${BPN}-native"
SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/v${PV}/${BP}.tar.gz"
SRC_URI:append:class-target = " file://0001-Use-native-mtp-hotplug.patch \
file://0002-util-mtp-hotplug.c-Enable-stack-memory-protection.patch"
SRC_URI[sha256sum] = "f4c1ceb3df020a6cb851110f620c14fe399518c494ed252039cbfb4e34335135"
SRC_URI[sha256sum] = "74a2b6e8cb4a0304e95b995496ea3ac644c29371649b892b856e22f12a0bdeed"
UPSTREAM_CHECK_URI = "https://github.com/libmtp/libmtp/releases"
UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)"
@@ -33,6 +31,12 @@ EXTRA_OECONF += " \
--with-udev=${nonarch_base_libdir}/udev \
"
# Upstream 1.1.23 gained native crossbuild support: with this enabled the
# build uses the host (native) mtp-hotplug (HOST_MTP_HOTPLUG) instead of the
# just-built target binary to generate the udev rules/hwdb. libmtp-native
# provides mtp-hotplug on PATH.
EXTRA_OECONF:append:class-target = " --enable-crossbuilddir=${nonarch_base_libdir}/udev"
PACKAGECONFIG ?= ""
PACKAGECONFIG[doxygen] = "--enable-doxygen,--disable-doxygen,doxygen-native"
PACKAGECONFIG[mtpz] = "--enable-mtpz,--disable-mtpz,libgcrypt"