lvm2, mkinitcpio, man-pages rebuild

This commit is contained in:
Berk Çakar
2021-09-14 23:48:31 +03:00
parent b2f35a7320
commit c88492ad79
16 changed files with 318 additions and 170 deletions
+20 -91
View File
@@ -9,111 +9,38 @@ from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import shelltools
def builddiet():
pisitools.flags.add("-fno-lto")
shelltools.export("LIBS","-lpthread -luuid")
#dietCC = "diet %s %s %s -Os -static" % (get.CC(), get.CFLAGS(), get.LDFLAGS())
dietCC = "%s %s %s -Os -static" % (get.CC(), get.CFLAGS(), get.LDFLAGS())
shelltools.export("CC", dietCC)
autotools.make("distclean")
autotools.autoreconf("-fi")
autotools.configure('--with-thin-check= \
--with-thin-dump= \
--with-thin-repair= \
--with-thin-restore= \
--with-cache-check= \
--with-cache-dump= \
--with-cache-repair= \
--with-cache-restore= \
ac_cv_lib_dl_dlopen=no \
--with-staticdir="/sbin" \
--enable-debug \
--with-optimisation=\"%s -Os\" \
--enable-static_link \
--with-lvm1=internal \
--disable-readline \
--disable-nls \
--disable-selinux \
--with-confdir=/etc \
--enable-applib \
--enable-cmdlib \
--enable-pkgconfig \
--enable-udev_rules \
--with-systemdsystemunitdir=no \
--enable-udev_sync' % get.CFLAGS())
#pisitools.dosed("lib/misc/configure.h","rpl_malloc","malloc")
#pisitools.dosed("lib/misc/configure.h","rpl_realloc","realloc")
autotools.make("-j1 -C include")
autotools.make("-j1 -C lib LIB_SHARED= VERSIONED_SHLIB=")
autotools.make("-j1 -C libdm LIB_SHARED= VERSIONED_SHLIB=")
autotools.make("-j1 -C libdaemon LIB_SHARED= VERSIONED_SHLIB=")
autotools.make("-j1 -C tools dmsetup.static lvm.static DIETLIBC_LIBS=\"-lcompat\"")
pisitools.insinto("/usr/lib/dietlibc/lib-i386", "libdm/ioctl/libdevmapper.a")
pisitools.insinto("/sbin/", "tools/lvm.static")
pisitools.insinto("/sbin/", "tools/dmsetup.static")
def setup():
# Breaks linking when sandbox is disabled
shelltools.export("CLDFLAGS", "%s -lpthread" %get.LDFLAGS())
shelltools.export("LIB_PTHREAD", "-lpthread")
pisitools.dosed("conf/example.conf.in", "use_lvmetad = 0", "use_lvmetad = 1")
#shelltools.system(""" sed -i -e "1iAR = $(tc-getAR)" -e "s:CC ?= @CC@:CC = $(tc-getCC):" make.tmpl.in || die """)
shelltools.system(""" sed -i -e '/FLAG/s:-O2::' configure || die """)
shelltools.system(""" sed -i -e '/FLAG/s:-O2::' configure.ac || die """)
autotools.autoreconf("-fi")
autotools.configure("--with-thin-check= \
--with-thin-dump= \
--with-thin-repair= \
--with-thin-restore= \
--with-cache-check= \
--with-cache-dump= \
--with-cache-repair= \
--with-cache-restore= \
--enable-lvm1_fallback \
shelltools.export("CONFIG_SHELL", "/bin/bash")
autotools.configure("--with-usrlibdir=/usr/lib \
--with-usrsbindir=%s \
--with-confdir=/etc \
--with-udevdir=/lib/udev/rules.d \
--with-default-pid-dir=/run \
--with-default-run-dir=/run/lvm \
--with-default-locking-dir=/run/lock/lvm \
--with-dmeventd-path=/sbin/dmeventd \
--enable-fsadm \
--with-pool=internal \
--with-user= \
--with-group= \
--with-usrlibdir=/usr/lib \
--with-usrsbindir=%s \
--with-udevdir=/lib/udev/rules.d \
--with-device-uid=0 \
--with-device-gid=6 \
--with-device-mode=0660 \
--enable-dmeventd \
--enable-udev_rules \
--enable-udev_sync \
--with-cache=internal \
--with-snapshots=internal \
--with-mirrors=internal \
--with-thin=internal \
--with-interface=ioctl \
--enable-static_link=no \
--disable-readline \
--disable-realtime \
--enable-udev_rules \
--enable-udev_sync \
--disable-selinux \
--with-confdir=/etc \
--enable-readline \
--enable-fsadm \
--enable-applib \
--enable-cmdlib \
--enable-pkgconfig " % get.sbinDIR())
--enable-pkgconfig \
--enable-dmeventd \
--enable-lvmetad \
--enable-lvmpolld" % get.sbinDIR())
# pisitools.dosed("make.tmpl","-lm","")
def build():
autotools.make("-C include")
#autotools.make("-C libdm")
#autotools.make("-C lib")
autotools.make()
def install():
@@ -121,9 +48,11 @@ def install():
for dir in ["archive", "backup", "cache"]:
pisitools.dodir("/etc/lvm/%s" % dir)
shelltools.chmod(get.installDIR() + "/etc/lvm/%s" % dir, 0700)
shelltools.chmod(get.installDIR() + "/etc/lvm/%s" % dir, 0755)
shelltools.chown(get.installDIR() + "/etc/lvm/%s" % dir, uid = 'root', gid = 'root')
shelltools.system("sed -i 's,use_lvmetad = 1,use_lvmetad = 1,' %s/etc/lvm/lvm.conf" % get.installDIR())
#pisitools.move("/sbin/lvmconf","scripts/lvmconf.sh")
builddiet()
pisitools.dodoc("COPYING", "COPYING.LIB", "README", "VERSION", "VERSION_DM", "WHATS_NEW", "WHATS_NEW_DM")
pisitools.dodoc("COPYING", "COPYING.LIB", "README", "VERSION", "WHATS_NEW") # "VERSION_DM", "WHATS_NEW_DM"
+11 -1
View File
@@ -3,4 +3,14 @@
import os
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
os.system("/sbin/mudur_tmpfiles.py /usr/lib/tmpfiles.d/lvm2.conf")
if os.path.exists("/etc/lvm/lvm.conf"):
with open("/etc/lvm/lvm.conf", 'r') as file:
fileContent = file.readlines()
for lineIndex in range(len(fileContent)):
if ('use_lvmetad =' in fileContent[lineIndex]):
fileContent[lineIndex] = ' use_lvmetad = 1\n'
with open("/etc/lvm/lvm.conf", 'w') as tableFile:
tableFile.writelines(fileContent)
break
os.system("/sbin/mudur_tmpfiles.py /usr/lib/tmpfiles.d/lvm2.conf")
@@ -0,0 +1,49 @@
--- ./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
+++ ./lib/commands/toolcontext.c
@@ -1869,7 +1869,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
@@ -2274,7 +2274,7 @@
if (cmd->pending_delete_mem)
dm_pool_destroy(cmd->pending_delete_mem);
-#ifndef VALGRIND_POOL
+#if !defined(VALGRIND_POOL) && defined(__GLIBC__)
if (cmd->linebuffer) {
/* Reset stream buffering to defaults */
if (is_valid_fd(STDIN_FILENO) &&
@@ -0,0 +1,14 @@
--- ./lib/config/defaults.h.orig 2017-04-27 18:16:05.879936377 +0200
+++ ./lib/config/defaults.h 2017-04-27 18:16:35.141849047 +0200
@@ -55,7 +55,11 @@
#define DEFAULT_LVMLOCKD_LOCK_RETRIES 3
#define DEFAULT_LVMETAD_UPDATE_WAIT_TIME 10
#define DEFAULT_PRIORITISE_WRITE_LOCKS 1
+#ifdef __GLIBC__
#define DEFAULT_USE_MLOCKALL 0
+#else
+#define DEFAULT_USE_MLOCKALL 1
+#endif
#define DEFAULT_METADATA_READ_ONLY 0
#define DEFAULT_LVDISPLAY_SHOWS_FULL_DEVICE_PATH 0
#define DEFAULT_UNKNOWN_DEVICE_NAME "[unknown]"
@@ -0,0 +1,21 @@
--- a/lib/mm/memlock.c
+++ b/lib/mm/memlock.c
@@ -159,7 +159,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;
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -18,6 +18,7 @@
#include "daemon-server.h"
#include "daemon-log.h"
+#include <fcntl.h>
#include <dlfcn.h>
#include <errno.h>
#include <pthread.h>
+37 -50
View File
@@ -16,18 +16,18 @@
<BuildDependencies>
<Dependency>libutil-linux-devel</Dependency>
<Dependency>eudev-devel</Dependency>
<Dependency>autoconf-archive</Dependency>
<Dependency>libaio-devel</Dependency>
<!-- <Dependency>thin-provisioning-tools</Dependency> -->
<Dependency>readline-devel</Dependency>
<Dependency>thin-provisioning-tools</Dependency>
</BuildDependencies>
<Patches>
<!--<Patch level="1">lvm2-2.02.63-always-make-static-libdm.patch</Patch>
<!--Patch level="1">lvm2-2.02.63-always-make-static-libdm.patch</Patch>
<Patch level="1">lvm2-2.02.92-dynamic-static-ldflags.patch</Patch>
<Patch level="1">lvm2-2.02.105-pthread-pkgconfig.patch</Patch>
<Patch>lvm2-2.02.106-static-pkgconfig-libs.patch</Patch>-->
<!-- <Patch level="1">lvm2-2.03.05-pthread-pkgconfig.patch</Patch> -->
<!-- <Patch level="1">lvm2-2.03.05-dynamic-static-ldflags.patch</Patch> -->
<!-- <Patch level="1">lvm2-2.03.05-dmeventd-no-idle-exit.patch</Patch> -->
<Patch>lvm2-2.02.106-static-pkgconfig-libs.patch</Patch>
<Patch level="1">lvm2-2.03.05-pthread-pkgconfig.patch</Patch>
<Patch level="1">lvm2-2.03.05-dynamic-static-ldflags.patch</Patch>
<Patch level="1">lvm2-2.03.05-dmeventd-no-idle-exit.patch</Patch>
<Patch level="1">lvm2-2.02.178-static-pkgconfig-libs.patch</Patch>
<Patch level="1">lvm2-2.02.56-lvm2create_initrd.patch</Patch>
<Patch level="1">lvm2-2.02.67-createinitrd.patch</Patch>
@@ -35,8 +35,10 @@
<Patch level="1">lvm2-2.02.171-static-libm.patch</Patch>
<Patch level="1">lvm2-2.02.166-HPPA-no-O_DIRECT.patch</Patch>
<Patch level="1">lvm2-2.02.184-mksh_build.patch</Patch>
<Patch level="1">lvm2-2.02.186-udev_remove_unsupported_option.patch</Patch>
<Patch level="1">lvm2-2.02.186-udev_remove_unsupported_option.patch</Patch-->
<Patch level="1">fix-stdio-usage.patch</Patch>
<Patch level="1">mlockall-default-config.patch</Patch>
<Patch level="1">portability.patch</Patch>
</Patches>
</Source>
@@ -55,8 +57,8 @@
<Path fileType="data">/lib/udev/rules.d/10-dm.rules</Path>
<Path fileType="data">/lib/udev/rules.d/13-dm-disk.rules</Path>
<Path fileType="data">/lib/udev/rules.d/95-dm-notify.rules</Path>
<Path fileType="doc">/usr/share/doc/VERSION_DM</Path>
<Path fileType="doc">/usr/share/doc/WHATS_NEW_DM</Path>
<!--Path fileType="doc">/usr/share/doc/lvm2/VERSION_DM</Path>
<Path fileType="doc">/usr/share/doc/lvm2/WHATS_NEW_DM</Path-->
<Path fileType="man">/usr/share/man/man8/dmsetup.8</Path>
<Path fileType="man">/usr/share/man/man8/dmstats.8</Path>
</Files>
@@ -67,7 +69,7 @@
<Summary>Development libraries and headers for device-mapper</Summary>
<Description>Device-mapper-devel contains files needed to develop applications that use the device-mapper libraries.</Description>
<RuntimeDependencies>
<Dependency release="current" >device-mapper</Dependency>
<Dependency release="current">device-mapper</Dependency>
<Dependency>eudev-devel</Dependency>
</RuntimeDependencies>
<Files>
@@ -81,13 +83,12 @@
<Summary>Device-mapper event daemon</Summary>
<Description>This package contains the dmeventd daemon for monitoring the state of device-mapper devices.</Description>
<RuntimeDependencies>
<Dependency release="current" >device-mapper</Dependency>
<Dependency release="current">device-mapper</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="executable">/usr/sbin/dmeventd</Path>
<Path fileType="library">/usr/lib/libdevmapper-event.a</Path>
<Path fileType="library">/usr/lib/libdevmapper-event.so*</Path>
<Path fileType="library">/usr/lib/libdevmapper-event-lvm2vdo.so</Path>
<Path fileType="library">/usr/lib/device-mapper/libdevmapper-event-lvm2vdo.so</Path>
<Path fileType="library">/usr/lib/libdevmapper-event-lvm2thin.so</Path>
@@ -101,7 +102,7 @@
<Summary>Development libraries and headers for the device-mapper event daemon</Summary>
<Description>This contains contains files needed to develop applications that use the device-mapper event library.</Description>
<RuntimeDependencies>
<Dependency release="current" >device-mapper-event</Dependency>
<Dependency release="current">device-mapper-event</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="header">/usr/include/libdevmapper-event.h</Path>
@@ -116,11 +117,13 @@
<RuntimeDependencies>
<Dependency release="current">device-mapper</Dependency>
<Dependency release="current">device-mapper-event</Dependency>
<Dependency>libutil-linux</Dependency>
<Dependency>libaio</Dependency>
<Dependency>eudev</Dependency>
<Dependency>libutil-linux</Dependency>
<Dependency>readline</Dependency>
<Dependency>thin-provisioning-tools</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="executable">/sbin/lvmconf</Path>
<Path fileType="executable">/usr/sbin/blkdeactivate</Path>
<Path fileType="executable">/usr/sbin/fsadm</Path>
<Path fileType="executable">/usr/sbin/lv*</Path>
@@ -135,14 +138,20 @@
<Path fileType="library">/usr/lib/libdevmapper-event-lvm2snapshot.so</Path>
<Path fileType="library">/usr/lib/libdevmapper-event-lvm2raid.so</Path>
<Path fileType="library">/usr/lib/device-mapper/libdevmapper-event-lvm2raid.so</Path>
<Path fileType="config">/etc/lvm</Path>
<Path fileType="config">/etc/lvm/lvm.conf</Path>
<Path fileType="config">/etc/lvm/lvmlocal.conf</Path>
<Path fileType="data">/etc/lvm/archive</Path>
<Path fileType="data">/etc/lvm/backup</Path>
<Path fileType="data">/etc/lvm/cache</Path>
<Path fileType="data">/var/lock/lvm</Path>
<Path fileType="data">/etc/lvm/profile</Path>
<Path fileType="data">/lib/udev/rules.d/11-dm-lvm.rules</Path>
<Path fileType="data">/lib/udev/rules.d/69-dm-lvm-metad.rules</Path>
<Path fileType="data">/usr/lib/tmpfiles.d/lvm2.conf</Path>
<Path fileType="doc">/usr/share/doc</Path>
<Path fileType="doc">/usr/share/doc/lvm2/COPYING</Path>
<Path fileType="doc">/usr/share/doc/lvm2/COPYING.LIB</Path>
<Path fileType="doc">/usr/share/doc/lvm2/README</Path>
<Path fileType="doc">/usr/share/doc/lvm2/VERSION</Path>
<Path fileType="doc">/usr/share/doc/lvm2/WHATS_NEW</Path>
<Path fileType="man">/usr/share/man/man5/lvm.conf.5</Path>
<Path fileType="man">/usr/share/man/man7</Path>
<Path fileType="man">/usr/share/man/man8/fsadm.8</Path>
@@ -164,10 +173,10 @@
<Summary>Development libraries and headers</Summary>
<Description>This package contains files needed to develop applications that use the lvm2 libraries.</Description>
<RuntimeDependencies>
<Dependency>libutil-linux-devel</Dependency>
<Dependency release="current">lvm2</Dependency>
<Dependency release="current">device-mapper-devel</Dependency>
<Dependency release="current">device-mapper-event-devel</Dependency>
<Dependency>libutil-linux-devel</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="header">/usr/include/lvm2cmd.h</Path>
@@ -176,36 +185,14 @@
</Files>
</Package>
<Package>
<Name>dietlibc-libdevmapper</Name>
<Summary>Static devmapper library built with dietlibc</Summary>
<Description>device mapper contains ioctl library and utilities for use with logical volume management (LVM2) built with dietlibc</Description>
<Files>
<Path fileType="library">/usr/lib/dietlibc/lib-i386/libdevmapper.a</Path>
</Files>
</Package>
<Package>
<Name>device-mapper-static</Name>
<Summary>Staticaly linked Device-mapper library and utility</Summary>
<Description>device mapper contains statically linked libraries and utility for initramfs.</Description>
<Files>
<Path fileType="executable">/sbin/dmsetup.static</Path>
</Files>
</Package>
<Package>
<Name>lvm2-static</Name>
<Summary>Staticaly linked Logical Volume Management utilities</Summary>
<Description>Number of utilities for creating, checking, and repairing logical volumes - statically linked for initramfs.</Description>
<Files>
<Path fileType="executable">/sbin/lvm.static</Path>
<Path fileType="library">/usr/lib/liblvm2app.a</Path>
<Path fileType="library">/usr/lib/liblvm2cmd.a</Path>
</Files>
</Package>
<History>
<Update release="8">
<Date>2021-09-14</Date>
<Version>2.02.186</Version>
<Comment>Rebuild.</Comment>
<Name>Berk Çakar</Name>
<Email>berk2238@hotmail.com</Email>
</Update>
<Update release="7">
<Date>2020-12-09</Date>
<Version>2.02.186</Version>