[arch-commits] Commit in lvm2/repos (5 files)

Christian Hesse eworm at gemini.archlinux.org
Wed May 18 19:10:08 UTC 2022


    Date: Wednesday, May 18, 2022 @ 19:10:08
  Author: eworm
Revision: 445996

archrelease: copy trunk to testing-x86_64

Added:
  lvm2/repos/testing-x86_64/
  lvm2/repos/testing-x86_64/0001-udev-initcpio.patch
    (from rev 445995, lvm2/trunk/0001-udev-initcpio.patch)
  lvm2/repos/testing-x86_64/11-dm-initramfs.rules
    (from rev 445995, lvm2/trunk/11-dm-initramfs.rules)
  lvm2/repos/testing-x86_64/PKGBUILD
    (from rev 445995, lvm2/trunk/PKGBUILD)
  lvm2/repos/testing-x86_64/lvm2_install
    (from rev 445995, lvm2/trunk/lvm2_install)

--------------------------+
 0001-udev-initcpio.patch |   50 ++++++++++++++++++
 11-dm-initramfs.rules    |    3 +
 PKGBUILD                 |  125 +++++++++++++++++++++++++++++++++++++++++++++
 lvm2_install             |   45 ++++++++++++++++
 4 files changed, 223 insertions(+)

Copied: lvm2/repos/testing-x86_64/0001-udev-initcpio.patch (from rev 445995, lvm2/trunk/0001-udev-initcpio.patch)
===================================================================
--- testing-x86_64/0001-udev-initcpio.patch	                        (rev 0)
+++ testing-x86_64/0001-udev-initcpio.patch	2022-05-18 19:10:08 UTC (rev 445996)
@@ -0,0 +1,50 @@
+From 4df121ed7d820f5b3d3a87a2c81dbce0801d4fd3 Mon Sep 17 00:00:00 2001
+From: Christian Hesse <mail at eworm.de>
+Date: Mon, 7 Feb 2022 21:12:20 +0100
+Subject: [PATCH 1/1] udev initcpio
+
+apply with:
+patch -Np1 --output='udev/69-dm-lvm-initcpio.rules.in' < ../0001-udev-initcpio.patch
+---
+ udev/69-dm-lvm.rules.in | 28 +---------------------------
+ 1 file changed, 1 insertion(+), 27 deletions(-)
+
+diff --git a/udev/69-dm-lvm.rules.in b/udev/69-dm-lvm.rules.in
+index 14e7dd26d..2dec88c34 100644
+--- a/udev/69-dm-lvm.rules.in
++++ b/udev/69-dm-lvm.rules.in
+@@ -54,33 +54,7 @@ ACTION!="add", GOTO="lvm_end"
+ 
+ LABEL="lvm_scan"
+ 
+-ENV{SYSTEMD_READY}="1"
+-
+-# pvscan will check if this device completes a VG,
+-# i.e. all PVs in the VG are now present with the
+-# arrival of this PV.  If so, it prints to stdout:
+-# LVM_VG_NAME_COMPLETE='foo'
+-#
+-# When the VG is complete it can be activated, so
+-# vgchange -aay <vgname> is run.  It is run via
+-# systemd since it can take longer to run than
+-# udev wants to block when processing rules.
+-# (if there are hundreds of LVs to activate,
+-# the vgchange can take many seconds.)
+-#
+-# pvscan only reads the single device specified,
+-# and uses temp files under /run/lvm to check if
+-# other PVs in the VG are present.
+-#
+-# If event_activation=0 in lvm.conf, this pvscan
+-# (using checkcomplete) will do nothing, so that
+-# no event-based autoactivation will be happen.
+-#
+-# TODO: adjust the output of vgchange -aay so that
+-# it's better suited to appearing in the journal.
+-
+-IMPORT{program}="(LVM_EXEC)/lvm pvscan --cache --listvg --checkcomplete --vgonline --autoactivation event --udevoutput --journal=output $env{DEVNAME}"
+-ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="/usr/bin/systemd-run --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} (LVM_EXEC)/lvm vgchange -aay --autoactivation event $env{LVM_VG_NAME_COMPLETE}"
++RUN+="(LVM_EXEC)/lvm pvscan --background --cache --activate ay --major $major --minor $minor", ENV{LVM_SCANNED}="1"
+ GOTO="lvm_end"
+ 
+ LABEL="lvm_end"

Copied: lvm2/repos/testing-x86_64/11-dm-initramfs.rules (from rev 445995, lvm2/trunk/11-dm-initramfs.rules)
===================================================================
--- testing-x86_64/11-dm-initramfs.rules	                        (rev 0)
+++ testing-x86_64/11-dm-initramfs.rules	2022-05-18 19:10:08 UTC (rev 445996)
@@ -0,0 +1,3 @@
+# needed with new udev/mkinitcpio and as implemented in dracut:
+# <http://git.kernel.org/?p=boot/dracut/dracut.git;a=commitdiff;h=12b9736228f2b34c15a9cb63be79cf7b6e865b54>
+SUBSYSTEM=="block", KERNEL=="dm-[0-9]*", ACTION=="add|change", OPTIONS="db_persist"

Copied: lvm2/repos/testing-x86_64/PKGBUILD (from rev 445995, lvm2/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD	                        (rev 0)
+++ testing-x86_64/PKGBUILD	2022-05-18 19:10:08 UTC (rev 445996)
@@ -0,0 +1,125 @@
+# Maintainer: Eric Bélanger <eric at archlinux.org>
+# Maintainer: Thomas Bächler <thomas at archlinux.org>
+
+pkgbase=lvm2
+pkgname=('lvm2' 'device-mapper')
+_tag='82b36d78165764dda7d44d104737a95054348a02' # git rev-parse v${pkgver//./_}
+pkgver=2.03.16
+pkgrel=1
+arch=('x86_64')
+url='https://sourceware.org/lvm2/'
+license=('GPL2' 'LGPL2.1')
+makedepends=('git' 'systemd' 'thin-provisioning-tools')
+validpgpkeys=('88437EF5C077BD113D3B7224228191C1567E2C17'  # Alasdair G Kergon <agk at redhat.com>
+              'D501A478440AE2FD130A1BE8B9112431E509039F') # Marian Csontos <marian.csontos at gmail.com>
+source=("git+https://sourceware.org/git/lvm2.git#tag=${_tag}?signed"
+        '0001-udev-initcpio.patch'
+        'lvm2_install'
+        '11-dm-initramfs.rules')
+sha256sums=('SKIP'
+            'e9ab9207b805cab702a666a2deb754583e6acd4c46973898ebb4170b563f0eec'
+            '00228d69679d5db15860bdf6b92746a146d0952f0d1bd27c74886ce6f22bf216'
+            'e10f24b57582d6e2da71f7c80732a62e0ee2e3b867fe84591ccdb53e80fa92e0')
+
+_backports=(
+)
+
+prepare() {
+  cd lvm2/
+
+  local _c
+  for _c in "${_backports[@]}"; do
+    git log --oneline -1 "${_c}"
+    git show "${_c}" -- ':(exclude)WHATS_NEW' | git apply
+  done
+
+  # prepare for non-systemd initcpio
+  patch -Np1 --output='udev/69-dm-lvm-initcpio.rules.in' < ../0001-udev-initcpio.patch
+
+  # remove install section from systemd units that are enabled by default
+  sed -i -e '/^\[Install\]$/,$d' \
+    scripts/dm_event_systemd_red_hat.socket.in \
+    scripts/lvm2_lvmpolld_systemd_red_hat.socket.in \
+    scripts/lvm2_monitoring_systemd_red_hat.service.in
+}
+
+build() {
+  # build system requires bash:
+  # https://www.redhat.com/archives/linux-lvm/2020-January/msg00004.html
+  # https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Defining-Variables.html
+  export CONFIG_SHELL=/bin/bash
+
+  cd lvm2/
+
+  ./configure \
+    CONFIG_SHELL=/bin/bash \
+    --prefix=/usr \
+    --sbindir=/usr/bin \
+    --sysconfdir=/etc \
+    --localstatedir=/var \
+    --enable-cmdlib \
+    --enable-dmeventd \
+    --enable-lvmpolld \
+    --enable-pkgconfig \
+    --enable-readline \
+    --enable-udev_rules \
+    --enable-udev_sync \
+    --with-cache=internal \
+    --with-default-dm-run-dir=/run \
+    --with-default-locking-dir=/run/lock/lvm \
+    --with-default-pid-dir=/run \
+    --with-default-run-dir=/run/lvm \
+    --with-systemdsystemunitdir=/usr/lib/systemd/system \
+    --with-thin=internal \
+    --with-udev-prefix=/usr
+  make
+
+  make -C udev/ 69-dm-lvm-initcpio.rules
+}
+
+package_device-mapper() {
+  pkgdesc="Device mapper userspace library and tools"
+  url="http://sourceware.org/dm/"
+  depends=('glibc' 'systemd-libs' 'libudev.so')
+  provides=('libdevmapper.so'
+    'libdevmapper-event.so')
+
+  cd lvm2/
+
+  make DESTDIR="${pkgdir}" install_device-mapper
+  # extra udev rule for device-mapper in initramfs
+  install -D -m0644 "${srcdir}/11-dm-initramfs.rules" "${pkgdir}/usr/lib/initcpio/udev/11-dm-initramfs.rules"
+  # Install dmeventd socket and service
+  make DESTDIR="${pkgdir}" install_systemd_units
+  rm -f "${pkgdir}/usr/lib/systemd/system/"{blk-availability.service,lvm2-*}
+  install -d -m0755 "${pkgdir}/usr/lib/systemd/system/sockets.target.wants"
+  ln -sf ../dm-event.socket "${pkgdir}/usr/lib/systemd/system/sockets.target.wants/dm-event.socket"
+}
+
+package_lvm2() {
+  pkgdesc="Logical Volume Manager 2 utilities"
+  depends=('bash' "device-mapper>=${pkgver}" 'systemd-libs'
+    'libudev.so' 'util-linux-libs' 'libblkid.so' 'readline' 'libreadline.so'
+    'thin-provisioning-tools')
+  conflicts=('lvm' 'mkinitcpio<0.7')
+  backup=('etc/lvm/lvm.conf'
+    'etc/lvm/lvmlocal.conf')
+
+  cd lvm2/
+
+  make DESTDIR="${pkgdir}" install_lvm2
+  # /etc directories
+  install -d "${pkgdir}"/etc/lvm/{archive,backup}
+  # mkinitcpio hook
+  install -D -m0644 "${srcdir}/lvm2_install" "${pkgdir}/usr/lib/initcpio/install/lvm2"
+  ln -s lvm2 "${pkgdir}/usr/lib/initcpio/install/sd-lvm2"
+  # extra udev rule for non-systemd initramfs
+  install -D -m0644 udev/69-dm-lvm-initcpio.rules "${pkgdir}/usr/lib/initcpio/udev/69-dm-lvm.rules"
+  # systemd support
+  make DESTDIR="${pkgdir}" install_systemd_units
+  rm -f "${pkgdir}/usr/lib/systemd/system/"dm-*
+  install -d -m0755 "${pkgdir}/usr/lib/systemd/system/sysinit.target.wants"
+  ln -sf ../lvm2-lvmpolld.socket "${pkgdir}/usr/lib/systemd/system/sysinit.target.wants/lvm2-lvmpolld.socket"
+  ln -sf ../lvm2-monitor.service "${pkgdir}/usr/lib/systemd/system/sysinit.target.wants/lvm2-monitor.service"
+  make DESTDIR="${pkgdir}" install_systemd_generators
+}

Copied: lvm2/repos/testing-x86_64/lvm2_install (from rev 445995, lvm2/trunk/lvm2_install)
===================================================================
--- testing-x86_64/lvm2_install	                        (rev 0)
+++ testing-x86_64/lvm2_install	2022-05-18 19:10:08 UTC (rev 445996)
@@ -0,0 +1,45 @@
+#!/usr/bin/bash
+
+build() {
+    local symlink
+
+    # device mapper modules
+    map add_module \
+        'dm-mod' \
+        'dm-snapshot' \
+        'dm-mirror' \
+        'dm-cache' \
+        'dm-cache-smq' \
+        'dm-thin-pool'
+
+    # from thin-provisioning-tools
+    add_binary 'pdata_tools'
+    for symlink in cache_{check,dump,metadata_size,repair,restore} thin_{check,delta,dump,ls,metadata_size,repair,restore,rmap,trim}; do
+        add_symlink "/usr/bin/${symlink}" 'pdata_tools'
+    done
+
+    # udev rules and lvm configuration
+    map add_udev_rule \
+        '10-dm.rules' \
+        '11-dm-lvm.rules' \
+        '13-dm-disk.rules' \
+        '95-dm-notify.rules' \
+        '/usr/lib/initcpio/udev/11-dm-initramfs.rules'
+
+    # this udev rule is specific for systemd and non-systemd systems
+    if command -v add_systemd_unit >/dev/null; then
+        add_udev_rule '69-dm-lvm.rules'
+    else
+        add_udev_rule '/usr/lib/initcpio/udev/69-dm-lvm.rules'
+    fi
+
+    # config file
+    add_file '/etc/lvm/lvm.conf'
+    sed -i '/^\smonitoring =/s/1/0/' "${BUILDROOT}/etc/lvm/lvm.conf"
+}
+
+help() {
+  cat <<HELPEOF
+This hook enables LVM2 volumes in initramfs.
+HELPEOF
+}



More information about the arch-commits mailing list