Mercurial > vanilla
changeset 667:1e35a4ddd0f4
core/lvm2: fix build with busybox patch
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 31 Jul 2019 20:00:00 +0200 |
parents | e18142de802d |
children | 0446aa20458f |
files | core/lvm2/lld.patch core/lvm2/lvm2.sh core/lvm2/musl.patch core/lvm2/patch-lld.patch core/lvm2/patch-musl.patch |
diffstat | 5 files changed, 96 insertions(+), 95 deletions(-) [+] |
line wrap: on
line diff
--- a/core/lvm2/lld.patch Tue Jul 30 21:15:00 2019 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -diff --git a/libdm/.exported_symbols.DM_1_02_107 b/libdm/.exported_symbols.DM_1_02_107 -index 89d3464ac..258883c14 100644 ---- a/libdm/.exported_symbols.DM_1_02_107 -+++ b/libdm/.exported_symbols.DM_1_02_107 -@@ -9,7 +9,6 @@ dm_histogram_get_bin_width - dm_histogram_get_nr_bins - dm_histogram_get_sum - dm_histogram_to_string --dm_stats_create_region - dm_stats_driver_supports_histogram - dm_stats_get_histogram - dm_stats_get_region_nr_histogram_bins -diff --git a/libdm/.exported_symbols.DM_1_02_129 b/libdm/.exported_symbols.DM_1_02_129 -index 88d3f1b6b..6ae173a83 100644 ---- a/libdm/.exported_symbols.DM_1_02_129 -+++ b/libdm/.exported_symbols.DM_1_02_129 -@@ -1,4 +1,3 @@ --dm_bitset_parse_list - dm_stats_create_group - dm_stats_current_object_type - dm_stats_delete_group
--- a/core/lvm2/lvm2.sh Tue Jul 30 21:15:00 2019 +0200 +++ b/core/lvm2/lvm2.sh Wed Jul 31 20:00:00 2019 +0200 @@ -21,6 +21,7 @@ PKGLICENSE="GPLv2 LGPLv21" PKGSUMMARY="LVM utilities" PKGDOWNLOAD="https://mirrors.kernel.org/sourceware/$PKGNAME/LVM2.$PKGVERSION.tgz" +PKGDEPENDS="lib/libaio" PKGOPTIONS="READLINE" : ${CHOST:=$(uname -m)-linux-musl} @@ -44,10 +45,10 @@ tar xvf LVM2.$PKGVERSION.tgz cd LVM2.$PKGVERSION + # https://bugzilla.redhat.com/show_bug.cgi?id=1697870 + patch -p1 < ../patch-lld.patch # --disable-nls: does not build with --enable-nls - patch -p1 < ../lld.patch - # https://bugzilla.redhat.com/show_bug.cgi?id=1697870 - patch -p0 < ../musl.patch + patch -p0 < ../patch-musl.patch CC="$CC" \ CFLAGS="$CFLAGS" \ LDFLAGS="$LDFLAGS" \
--- a/core/lvm2/musl.patch Tue Jul 30 21:15:00 2019 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ ---- libdaemon/server/daemon-server.c 2014-11-29 00:07:42.000000000 +0100 -+++ libdaemon/server/daemon-server.c 2014-12-28 08:22:40.985928408 +0100 -@@ -14,6 +14,7 @@ - #include "daemon-server.h" - #include "daemon-log.h" - -+#include <fcntl.h> - #include <dlfcn.h> - #include <errno.h> - #include <pthread.h> - ---- lib/mm/memlock.c.orig 2016-06-07 08:00:46.557058318 +0200 -+++ lib/mm/memlock.c 2016-06-07 08:01:25.453505793 +0200 -@@ -150,7 +150,7 @@ static void _touch_memory(void *mem, siz - - static void _allocate_memory(void) - { --#ifndef VALGRIND_POOL -+#if !defined(VALGRIND_POOL) && defined(__GLIBC__) - void *stack_mem; - struct rlimit limit; - int i, area = 0, missing = _size_malloc_tmp, max_areas = 32, hblks; ---- tools/lvmcmdline.c -+++ tools/lvmcmdline.c -@@ -1252,7 +1252,7 @@ - int err = is_valid_fd(STDERR_FILENO); - - if (!is_valid_fd(STDIN_FILENO) && -- !(stdin = fopen(_PATH_DEVNULL, "r"))) { -+ !freopen(_PATH_DEVNULL, "r", stdin)) { - if (err) - perror("stdin stream open"); - else -@@ -1262,7 +1262,7 @@ - } - - if (!is_valid_fd(STDOUT_FILENO) && -- !(stdout = fopen(_PATH_DEVNULL, "w"))) { -+ !freopen(_PATH_DEVNULL, "w", stdout)) { - if (err) - perror("stdout stream open"); - /* else no stdout */ -@@ -1270,7 +1270,7 @@ - } - - if (!is_valid_fd(STDERR_FILENO) && -- !(stderr = fopen(_PATH_DEVNULL, "w"))) { -+ !freopen(_PATH_DEVNULL, "w", stderr)) { - printf("stderr stream open: %s\n", - strerror(errno)); - return 0; ---- lib/commands/toolcontext.c.orig -+++ lib/commands/toolcontext.c -@@ -1860,7 +1860,7 @@ - /* FIXME Make this configurable? */ - reset_lvm_errno(1); - --#ifndef VALGRIND_POOL -+#if !defined(VALGRIND_POOL) && defined(__GLIBC__) - /* Set in/out stream buffering before glibc */ - if (set_buffering) { - /* Allocate 2 buffers */ -@@ -2241,7 +2241,7 @@ - if (cmd->libmem) - dm_pool_destroy(cmd->libmem); - --#ifndef VALGRIND_POOL -+#if !defined(VALGRIND_POOL) && defined(__GLIBC__) - if (cmd->linebuffer) { - /* Reset stream buffering to defaults */ - if (is_valid_fd(STDIN_FILENO) &&
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/lvm2/patch-lld.patch Wed Jul 31 20:00:00 2019 +0200 @@ -0,0 +1,21 @@ +diff --git a/libdm/.exported_symbols.DM_1_02_107 b/libdm/.exported_symbols.DM_1_02_107 +index 89d3464ac..258883c14 100644 +--- a/libdm/.exported_symbols.DM_1_02_107 ++++ b/libdm/.exported_symbols.DM_1_02_107 +@@ -9,7 +9,6 @@ dm_histogram_get_bin_width + dm_histogram_get_nr_bins + dm_histogram_get_sum + dm_histogram_to_string +-dm_stats_create_region + dm_stats_driver_supports_histogram + dm_stats_get_histogram + dm_stats_get_region_nr_histogram_bins +diff --git a/libdm/.exported_symbols.DM_1_02_129 b/libdm/.exported_symbols.DM_1_02_129 +index 88d3f1b6b..6ae173a83 100644 +--- a/libdm/.exported_symbols.DM_1_02_129 ++++ b/libdm/.exported_symbols.DM_1_02_129 +@@ -1,4 +1,3 @@ +-dm_bitset_parse_list + dm_stats_create_group + dm_stats_current_object_type + dm_stats_delete_group
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/lvm2/patch-musl.patch Wed Jul 31 20:00:00 2019 +0200 @@ -0,0 +1,71 @@ +--- libdaemon/server/daemon-server.c.orig ++++ libdaemon/server/daemon-server.c +@@ -14,6 +14,7 @@ + #include "daemon-server.h" + #include "daemon-log.h" + ++#include <fcntl.h> + #include <dlfcn.h> + #include <errno.h> + #include <pthread.h> + +--- lib/mm/memlock.c.orig ++++ lib/mm/memlock.c +@@ -150,7 +150,7 @@ static void _touch_memory(void *mem, siz + + static void _allocate_memory(void) + { +-#ifndef VALGRIND_POOL ++#if !defined(VALGRIND_POOL) && defined(__GLIBC__) + void *stack_mem; + struct rlimit limit; + int i, area = 0, missing = _size_malloc_tmp, max_areas = 32, hblks; +--- tools/lvmcmdline.c ++++ tools/lvmcmdline.c +@@ -1252,7 +1252,7 @@ + int err = is_valid_fd(STDERR_FILENO); + + if (!is_valid_fd(STDIN_FILENO) && +- !(stdin = fopen(_PATH_DEVNULL, "r"))) { ++ !freopen(_PATH_DEVNULL, "r", stdin)) { + if (err) + perror("stdin stream open"); + else +@@ -1262,7 +1262,7 @@ + } + + if (!is_valid_fd(STDOUT_FILENO) && +- !(stdout = fopen(_PATH_DEVNULL, "w"))) { ++ !freopen(_PATH_DEVNULL, "w", stdout)) { + if (err) + perror("stdout stream open"); + /* else no stdout */ +@@ -1270,7 +1270,7 @@ + } + + if (!is_valid_fd(STDERR_FILENO) && +- !(stderr = fopen(_PATH_DEVNULL, "w"))) { ++ !freopen(_PATH_DEVNULL, "w", stderr)) { + printf("stderr stream open: %s\n", + strerror(errno)); + return 0; +--- lib/commands/toolcontext.c.orig 2019-07-31 05:55:55.308887587 +0000 ++++ lib/commands/toolcontext.c 2019-07-31 05:56:42.860889048 +0000 +@@ -1862,7 +1862,7 @@ + /* FIXME Make this configurable? */ + reset_lvm_errno(1); + +-#ifndef VALGRIND_POOL ++#if defined(VALGRIND_POOL) && defined(__GLIBC__) + /* Set in/out stream buffering before glibc */ + if (set_buffering + #ifdef SYS_gettid +@@ -2256,7 +2256,7 @@ + if (cmd->libmem) + dm_pool_destroy(cmd->libmem); + +-#ifndef VALGRIND_POOL ++#if defined(VALGRIND_POOL) && defined(__GLIBC__) + if (cmd->linebuffer) { + /* Reset stream buffering to defaults */ + if (is_valid_fd(STDIN_FILENO) &&