diff --git a/pkg.info b/pkg.info index bae5357..a3203fe 100644 --- a/pkg.info +++ b/pkg.info @@ -1,8 +1,34 @@ name: lvm2 description: Logical Volume Manager 2 -version: 2.03.35 +version: 2.03.36 +revision: 1 url: https://sourceware.org/lvm2/ license: GPL2,LGPL2.1 architecture: any -depends: ["libaio"] type: source +make_depends: + - libaio + - readline + - thin-provisioning-tools + - util-linux + - udev +downloads: + - url: https://sourceware.org/ftp/lvm2/LVM2.${BPM_PKG_VERSION}.tgz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: 44db12df4b990ed2c910176279f70b257f79ee6fc7684c577afbf59c13cd2cca +split_packages: + - name: lvm2 + keep: + - etc/lvm/lvm.conf + - etc/lvm/lvmlocal.conf + depends: + - device-mapper + - libaio + - readline + - util-linux + - name: device-mapper + description: Device mapper userspace library and tools + depends: + - glibc + - udev diff --git a/source-files/11-dm-initramfs.rules b/source-files/11-dm-initramfs.rules new file mode 100644 index 0000000..d2c1673 --- /dev/null +++ b/source-files/11-dm-initramfs.rules @@ -0,0 +1,3 @@ +# needed with new udev/mkinitcpio and as implemented in dracut: +# +SUBSYSTEM=="block", KERNEL=="dm-[0-9]*", ACTION=="add|change", OPTIONS="db_persist" diff --git a/source-files/udev-activation-without-systemd.patch b/source-files/udev-activation-without-systemd.patch new file mode 100644 index 0000000..df15ced --- /dev/null +++ b/source-files/udev-activation-without-systemd.patch @@ -0,0 +1,26 @@ +commit 9f9924cab244b2065ebf6de869f434cc1f336469 +Author: Daniel Kolesa +Date: Wed Nov 16 12:26:51 2022 +0100 + + support new udev activation without systemd + + Debian import: https://salsa.debian.org/lvm-team/lvm2/-/commit/2340adad4b3875331be1ba7abba881cc1b6e6738 + +diff --git a/udev/69-dm-lvm.rules.in b/udev/69-dm-lvm.rules.in +index 14e7dd2..b32b94a 100644 +--- a/udev/69-dm-lvm.rules.in ++++ b/udev/69-dm-lvm.rules.in +@@ -76,8 +76,14 @@ LABEL="lvm_scan" + # 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}" ++TEST!="/run/systemd/system", GOTO="lvm_direct_vgchange" ++ + ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="(SYSTEMDRUN) --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}" + GOTO="lvm_end" + ++LABEL="lvm_direct_vgchange" ++ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="(LVM_EXEC)/lvm vgchange -aay --autoactivation event $env{LVM_VG_NAME_COMPLETE}" ++GOTO="lvm_end" ++ + LABEL="lvm_end" diff --git a/source.sh b/source.sh index 8fb974b..bce52fe 100644 --- a/source.sh +++ b/source.sh @@ -2,31 +2,45 @@ # BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE # BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT -DOWNLOAD="https://sourceware.org/ftp/lvm2/LVM2.${BPM_PKG_VERSION}.tgz" -FILENAME="${DOWNLOAD##*/}" - -# The prepare function is executed in the root of the temp directory -# This function is used for downloading files and putting them into the correct location prepare() { - wget "$DOWNLOAD" - tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" + cd "$BPM_SOURCE" + patch -Np1 -i "$BPM_WORKDIR"/udev-activation-without-systemd.patch } # The build function is executed in the source directory # This function is used to compile the source code build() { - ./configure --prefix=/usr \ - --enable-cmdlib \ - --enable-pkgconfig \ - --enable-udev_sync + ./configure --prefix=/usr \ + --enable-cmdlib \ + --enable-dmeventd \ + --enable-fsadm \ + --enable-pkgconfig \ + --enable-readline \ + --enable-udev_sync \ + --enable-udev_rules \ + --without-systemd-run \ + --with-default-pid-dir=/run \ + --with-default-dm-run-dir=/run \ + --with-default-run-dir=/run/lvm \ + --with-default-locking-dir=/run/lock/lvm make } # The package function is executed in the source directory # This function is used to move the compiled files into the output directory -package() { - make DESTDIR="$BPM_OUTPUT" install +package_lvm2() { + make DESTDIR="$BPM_OUTPUT" install_lvm2 + # Install package license + install -Dm644 "$BPM_SOURCE"/COPYING.BSD "$BPM_OUTPUT"/usr/share/licenses/lvm2/COPYING.BSD + install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/lvm2/COPYING + install -Dm644 "$BPM_SOURCE"/COPYING.LIB "$BPM_OUTPUT"/usr/share/licenses/lvm2/COPYING.LIB +} + +package_device-mapper() { + make DESTDIR="$BPM_OUTPUT" install_device-mapper + + # Install package license install -Dm644 "$BPM_SOURCE"/COPYING.BSD "$BPM_OUTPUT"/usr/share/licenses/lvm2/COPYING.BSD install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/lvm2/COPYING install -Dm644 "$BPM_SOURCE"/COPYING.LIB "$BPM_OUTPUT"/usr/share/licenses/lvm2/COPYING.LIB