diff options
| author | Changqing Li <changqing.li@windriver.com> | 2024-06-18 18:52:25 +0800 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-07-12 05:47:20 -0700 |
| commit | b02ed677ce262e46ea46c41e562d2b9614147bda (patch) | |
| tree | e99d8f45896fd8edc4570f0292718152c251eadb | |
| parent | 5c6ffbcfa13615b6f0057fa5344bf1607336e526 (diff) | |
| download | poky-b02ed677ce262e46ea46c41e562d2b9614147bda.tar.gz | |
apt: runtime error: filename too long (tmpdir length)
when the tmpdir dir is longer than 220, there is no files saved in
tmp/sysroots/x86_64-linux/var/lib/apt/lists/ after run apt-get update,
this is because apt-get uses the path as the file name, but the file
name can't be longer than 255 according to /usr/include/linux/limits.h.
[YOCTO #2688]
(From OE-Core rev: dafdf9bb9e9d944b9f455c2be8cf698496200717)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Take back from https://git.openembedded.org/openembedded-core/commit/?id=9a0c0393871eda4bbcecfdd4b595f0c1b8e42edf
Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
| -rw-r--r-- | meta/recipes-devtools/apt/apt/0001-strutl.cc-the-filename-can-t-be-longer-than-255.patch | 40 | ||||
| -rw-r--r-- | meta/recipes-devtools/apt/apt_2.6.1.bb | 1 |
2 files changed, 41 insertions, 0 deletions
diff --git a/meta/recipes-devtools/apt/apt/0001-strutl.cc-the-filename-can-t-be-longer-than-255.patch b/meta/recipes-devtools/apt/apt/0001-strutl.cc-the-filename-can-t-be-longer-than-255.patch new file mode 100644 index 0000000000..311c3664ad --- /dev/null +++ b/meta/recipes-devtools/apt/apt/0001-strutl.cc-the-filename-can-t-be-longer-than-255.patch | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | From 918295aa1320718d342116f76c98d2289d377800 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Changqing Li <changqing.li@windriver.com> | ||
| 3 | Date: Tue, 18 Jun 2024 10:32:55 +0800 | ||
| 4 | Subject: [PATCH] strutl.cc: the filename can't be longer than 255 | ||
| 5 | |||
| 6 | The URItoFileName translates the path into the filename, but the | ||
| 7 | filename can't be longer than 255 according to | ||
| 8 | /usr/include/linux/limits.h. | ||
| 9 | |||
| 10 | Truncate it when it is longer than 240 (leave some spaces for | ||
| 11 | ".Packages" and "._Release" suffix) | ||
| 12 | |||
| 13 | Upstream-Status: Submitted [https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1073591] | ||
| 14 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
| 15 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
| 16 | --- | ||
| 17 | apt-pkg/contrib/strutl.cc | 7 ++++++- | ||
| 18 | 1 file changed, 6 insertions(+), 1 deletion(-) | ||
| 19 | |||
| 20 | diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc | ||
| 21 | index 67100f1..5076b35 100644 | ||
| 22 | --- a/apt-pkg/contrib/strutl.cc | ||
| 23 | +++ b/apt-pkg/contrib/strutl.cc | ||
| 24 | @@ -565,7 +565,12 @@ string URItoFileName(const string &URI) | ||
| 25 | // "\x00-\x20{}|\\\\^\\[\\]<>\"\x7F-\xFF"; | ||
| 26 | string NewURI = QuoteString(U,"\\|{}[]<>\"^~_=!@#$%^&*"); | ||
| 27 | replace(NewURI.begin(),NewURI.end(),'/','_'); | ||
| 28 | - return NewURI; | ||
| 29 | + | ||
| 30 | + // Truncate from the head when it is longer than 240 | ||
| 31 | + if(NewURI.length() > 240) | ||
| 32 | + return NewURI.substr(NewURI.length() - 240, NewURI.length() - 1); | ||
| 33 | + else | ||
| 34 | + return NewURI; | ||
| 35 | } | ||
| 36 | /*}}}*/ | ||
| 37 | // Base64Encode - Base64 Encoding routine for short strings /*{{{*/ | ||
| 38 | -- | ||
| 39 | 2.25.1 | ||
| 40 | |||
diff --git a/meta/recipes-devtools/apt/apt_2.6.1.bb b/meta/recipes-devtools/apt/apt_2.6.1.bb index e688d30cae..1eec7fe7a6 100644 --- a/meta/recipes-devtools/apt/apt_2.6.1.bb +++ b/meta/recipes-devtools/apt/apt_2.6.1.bb | |||
| @@ -14,6 +14,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/a/apt/${BPN}_${PV}.tar.xz \ | |||
| 14 | file://0001-Hide-fstatat64-and-prlimit64-defines-on-musl.patch \ | 14 | file://0001-Hide-fstatat64-and-prlimit64-defines-on-musl.patch \ |
| 15 | file://0001-aptwebserver.cc-Include-array.patch \ | 15 | file://0001-aptwebserver.cc-Include-array.patch \ |
| 16 | file://0001-Remove-using-std-binary_function.patch \ | 16 | file://0001-Remove-using-std-binary_function.patch \ |
| 17 | file://0001-strutl.cc-the-filename-can-t-be-longer-than-255.patch \ | ||
| 17 | " | 18 | " |
| 18 | 19 | ||
| 19 | SRC_URI:append:class-native = " \ | 20 | SRC_URI:append:class-native = " \ |
