From 9f38fa5ae1df01673ad652f6bc92fffe78148ee4 Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Wed, 23 May 2018 22:15:46 +0200 Subject: ubi-utils-klibc: update from v. 1.5.2 to 2.0.2 Update to new version and drop accepted patches. Use autotools and packageconfig (for xattrs). Signed-off-by: Andrea Adami Signed-off-by: Khem Raj --- .../0005-common.h-replace-getline-with-fgets.patch | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc-2.0.2/0005-common.h-replace-getline-with-fgets.patch (limited to 'meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc-2.0.2/0005-common.h-replace-getline-with-fgets.patch') diff --git a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc-2.0.2/0005-common.h-replace-getline-with-fgets.patch b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc-2.0.2/0005-common.h-replace-getline-with-fgets.patch new file mode 100644 index 0000000000..adef377b89 --- /dev/null +++ b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc-2.0.2/0005-common.h-replace-getline-with-fgets.patch @@ -0,0 +1,56 @@ +From 2137eb1a6cd0326510bd3b9faf8037d9bf34ca3d Mon Sep 17 00:00:00 2001 +From: Andrea Adami +Date: Wed, 23 May 2018 15:52:34 +0200 +Subject: [PATCH 5/5] common.h: replace getline() with fgets + +There is an unofficial upstream patch adding a simple getline() +to libmissing.h. Unfortunately the patch creates issues if the +toolchain is using glibc (autotools cache?) so for the moment +keep the old hack and wait for commits upstream. + +Fix: + +| ubi-utils/ubiformat.o: In function `prompt.constprop.4': +| ubiformat.c:(.text+0x70): undefined reference to `getline' + +Upstrea-Status: Inappropriate [klibc specific] + +Signed-off-by: Andrea Adami +--- + include/common.h | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/include/common.h b/include/common.h +index a1d59d0..96b0bdb 100644 +--- a/include/common.h ++++ b/include/common.h +@@ -126,15 +126,26 @@ extern "C" { + */ + static inline bool prompt(const char *msg, bool def) + { ++ ++#ifndef __KLIBC__ + char *line = NULL; + size_t len; ++#else ++ char *line; ++ const int sizeof_line = 2; ++ line = malloc(sizeof_line); ++#endif + bool ret = def; + + do { + normsg_cont("%s (%c/%c) ", msg, def ? 'Y' : 'y', def ? 'n' : 'N'); + fflush(stdout); + ++#ifndef __KLIBC__ + while (getline(&line, &len, stdin) == -1) { ++#else ++ while (fgets(line, sizeof_line, stdin) == NULL) { ++#endif + printf("failed to read prompt; assuming '%s'\n", + def ? "yes" : "no"); + break; +-- +2.7.4 + -- cgit 1.2.3-korg