Mercurial > vanilla
changeset 98:11b453a08c70
core/lvm2: initial import, closes #1034
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sat, 09 Mar 2019 10:43:48 +0100 |
parents | 63514fe57d33 |
children | a5a86735e60c |
files | core/lilo/lilo.info core/lvm2/lvm2.info core/lvm2/lvm2.sh core/lvm2/musl.patch |
diffstat | 4 files changed, 155 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/core/lilo/lilo.info Fri Mar 08 22:30:48 2019 +0100 +++ b/core/lilo/lilo.info Sat Mar 09 10:43:48 2019 +0100 @@ -21,3 +21,4 @@ PKGLICENSE="BSD3CLAUSE" PKGSUMMARY="Simple Linux Loader" PKGDOWNLOAD="http://www.joonet.de/lilo/ftp/sources/$PKGNAME-$PKGVERSION.tar.gz" +PKGDEPENDS="core/lvm2"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/lvm2/lvm2.info Sat Mar 09 10:43:48 2019 +0100 @@ -0,0 +1,30 @@ +#!/bin/sh +# +# Copyright (c) 2019 David Demelier <markand@malikania.fr> +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# + +PKGNAME=lvm2 +PKGVERSION=2.02.183 +PKGREVISION=1 +PKGLICENSE="GPLv2 LGPLv21" +PKGSUMMARY="LVM utilities" +PKGDOWNLOAD="https://mirrors.kernel.org/sourceware/$PKGNAME/LVM2.$PKGVERSION.tgz" +PKGOPTIONS="NLS" + +: ${NLS:=yes} + +if [ "$NLS" = "yes" ]; then + PKGDEPENDS="core/gettext $PKGDEPENDS" +fi
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/lvm2/lvm2.sh Sat Mar 09 10:43:48 2019 +0100 @@ -0,0 +1,53 @@ +#!/bin/sh +# +# Copyright (c) 2019 David Demelier <markand@malikania.fr> +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# + +: ${CHOST:=$(uname -m)-linux-musl} +: ${CBUILD:=$(uname -m)-linux-musl} +: ${CC:=gcc} +: ${CFLAGS:=-O2} + +source ./lvm2.info + +set -ex + +rm -rf LVM2.$PKGVERSION +tar xvaf LVM2.$PKGVERSION.tgz +pushd LVM2.$PKGVERSION + +if [ "$NLS" = "yes" ]; then + with_nls="--enable-nls" +else + with_nls="--disable-nls" +fi + +patch -p0 < ../musl.patch +CC="$CC" \ +CFLAGS="$CFLAGS" \ +./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --disable-readline \ + --enable-pkgconfig \ + --enable-udev_rules \ + --enable-udev_sync \ + ${with_nls} +make +make install DESTDIR=$DESTDIR + +popd +rm -rf LVM2.$PKGVERSION
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/lvm2/musl.patch Sat Mar 09 10:43:48 2019 +0100 @@ -0,0 +1,71 @@ +--- 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) &&