summaryrefslogtreecommitdiff
path: root/package/lvm
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2014-05-29 17:58:20 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2014-05-29 17:58:51 +0200
commit014f5aac68d56ef7a29bcd07621b34992a0a3267 (patch)
tree6f7b7a92a91c0615f34924d22a6af1475a6d5995 /package/lvm
parentbc4259ca5f7e21185db6566c1ef55f9e099c446c (diff)
fix musl compile, patch from sabotage linux
Diffstat (limited to 'package/lvm')
-rw-r--r--package/lvm/Makefile3
-rw-r--r--package/lvm/patches/patch-lib_commands_toolcontext_c74
-rw-r--r--package/lvm/patches/patch-tools_lvmcmdline_c34
3 files changed, 110 insertions, 1 deletions
diff --git a/package/lvm/Makefile b/package/lvm/Makefile
index aa3f5eca8..6355f191a 100644
--- a/package/lvm/Makefile
+++ b/package/lvm/Makefile
@@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk
PKG_NAME:= lvm
PKG_VERSION:= 2.02.106
-PKG_RELEASE:= 2
+PKG_RELEASE:= 3
PKG_MD5SUM:= 77f84279fb649b3dc4edad1c6d1a1b0e
PKG_DESCR:= logical volume management
PKG_SECTION:= fs
@@ -39,6 +39,7 @@ CONFIGURE_ARGS+= --with-user="" --with-group="" \
--with-optimisation="" \
--disable-testing \
--with-lvm1=none
+CONFIGURE_ENV+= ac_cv_flag_HAVE_PIE=no
lvm-install:
${INSTALL_DIR} ${IDIR_LVM}/usr/sbin
diff --git a/package/lvm/patches/patch-lib_commands_toolcontext_c b/package/lvm/patches/patch-lib_commands_toolcontext_c
new file mode 100644
index 000000000..397576c9b
--- /dev/null
+++ b/package/lvm/patches/patch-lib_commands_toolcontext_c
@@ -0,0 +1,74 @@
+--- LVM2.2.02.106.orig/lib/commands/toolcontext.c 2014-04-10 17:38:44.000000000 +0200
++++ LVM2.2.02.106/lib/commands/toolcontext.c 2014-05-29 17:55:05.101305501 +0200
+@@ -1334,6 +1334,8 @@ struct cmd_context *create_toolcontext(u
+ {
+ struct cmd_context *cmd;
+ FILE *new_stream;
++ FILE *stdin_stream = stdin;
++ FILE *stdout_stream = stdout;
+ int flags;
+
+ #ifdef M_MMAP_MAX
+@@ -1383,10 +1385,10 @@ struct cmd_context *create_toolcontext(u
+ if (is_valid_fd(STDIN_FILENO) &&
+ ((flags = fcntl(STDIN_FILENO, F_GETFL)) > 0) &&
+ (flags & O_ACCMODE) != O_WRONLY) {
+- if (!_reopen_stream(stdin, STDIN_FILENO, "r", "stdin", &new_stream))
++ if (!_reopen_stream(stdin_stream, STDIN_FILENO, "r", "stdin", &new_stream))
+ goto_out;
+- stdin = new_stream;
+- if (setvbuf(stdin, cmd->linebuffer, _IOLBF, linebuffer_size)) {
++ stdin_stream = new_stream;
++ if (setvbuf(stdin_stream, cmd->linebuffer, _IOLBF, linebuffer_size)) {
+ log_sys_error("setvbuf", "");
+ goto out;
+ }
+@@ -1395,10 +1397,10 @@ struct cmd_context *create_toolcontext(u
+ if (is_valid_fd(STDOUT_FILENO) &&
+ ((flags = fcntl(STDOUT_FILENO, F_GETFL)) > 0) &&
+ (flags & O_ACCMODE) != O_RDONLY) {
+- if (!_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout", &new_stream))
++ if (!_reopen_stream(stdout_stream, STDOUT_FILENO, "w", "stdout", &new_stream))
+ goto_out;
+- stdout = new_stream;
+- if (setvbuf(stdout, cmd->linebuffer + linebuffer_size,
++ stdout_stream = new_stream;
++ if (setvbuf(stdout_stream, cmd->linebuffer + linebuffer_size,
+ _IOLBF, linebuffer_size)) {
+ log_sys_error("setvbuf", "");
+ goto out;
+@@ -1681,6 +1683,8 @@ void destroy_toolcontext(struct cmd_cont
+ {
+ struct dm_config_tree *cft_cmdline;
+ FILE *new_stream;
++ FILE *stdin_stream = stdin;
++ FILE *stdout_stream = stdout;
+ int flags;
+
+ if (cmd->dump_filter && cmd->filter && cmd->filter->dump &&
+@@ -1717,9 +1721,9 @@ void destroy_toolcontext(struct cmd_cont
+ if (is_valid_fd(STDIN_FILENO) &&
+ ((flags = fcntl(STDIN_FILENO, F_GETFL)) > 0) &&
+ (flags & O_ACCMODE) != O_WRONLY) {
+- if (_reopen_stream(stdin, STDIN_FILENO, "r", "stdin", &new_stream)) {
+- stdin = new_stream;
+- setlinebuf(stdin);
++ if (_reopen_stream(stdin_stream, STDIN_FILENO, "r", "stdin", &new_stream)) {
++ stdin_stream = new_stream;
++ setlinebuf(stdin_stream);
+ } else
+ cmd->linebuffer = NULL; /* Leave buffer in place (deliberate leak) */
+ }
+@@ -1727,9 +1731,9 @@ void destroy_toolcontext(struct cmd_cont
+ if (is_valid_fd(STDOUT_FILENO) &&
+ ((flags = fcntl(STDOUT_FILENO, F_GETFL)) > 0) &&
+ (flags & O_ACCMODE) != O_RDONLY) {
+- if (_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout", &new_stream)) {
+- stdout = new_stream;
+- setlinebuf(stdout);
++ if (_reopen_stream(stdout_stream, STDOUT_FILENO, "w", "stdout", &new_stream)) {
++ stdout_stream = new_stream;
++ setlinebuf(stdout_stream);
+ } else
+ cmd->linebuffer = NULL; /* Leave buffer in place (deliberate leak) */
+ }
diff --git a/package/lvm/patches/patch-tools_lvmcmdline_c b/package/lvm/patches/patch-tools_lvmcmdline_c
new file mode 100644
index 000000000..13124f32d
--- /dev/null
+++ b/package/lvm/patches/patch-tools_lvmcmdline_c
@@ -0,0 +1,34 @@
+--- LVM2.2.02.106.orig/tools/lvmcmdline.c 2014-04-10 17:38:46.000000000 +0200
++++ LVM2.2.02.106/tools/lvmcmdline.c 2014-05-29 16:57:14.221581766 +0200
+@@ -1252,9 +1252,12 @@ int lvm_split(char *str, int *argc, char
+ static int _check_standard_fds(void)
+ {
+ int err = is_valid_fd(STDERR_FILENO);
++ FILE *stdin_stream = stdin;
++ FILE *stdout_stream = stdout;
++ FILE *stderr_stream = stderr;
+
+ if (!is_valid_fd(STDIN_FILENO) &&
+- !(stdin = fopen(_PATH_DEVNULL, "r"))) {
++ !(stdin_stream = fopen(_PATH_DEVNULL, "r"))) {
+ if (err)
+ perror("stdin stream open");
+ else
+@@ -1264,7 +1267,7 @@ static int _check_standard_fds(void)
+ }
+
+ if (!is_valid_fd(STDOUT_FILENO) &&
+- !(stdout = fopen(_PATH_DEVNULL, "w"))) {
++ !(stdout_stream = fopen(_PATH_DEVNULL, "w"))) {
+ if (err)
+ perror("stdout stream open");
+ /* else no stdout */
+@@ -1272,7 +1275,7 @@ static int _check_standard_fds(void)
+ }
+
+ if (!is_valid_fd(STDERR_FILENO) &&
+- !(stderr = fopen(_PATH_DEVNULL, "w"))) {
++ !(stderr_stream = fopen(_PATH_DEVNULL, "w"))) {
+ printf("stderr stream open: %s\n",
+ strerror(errno));
+ return 0;