[pve-devel] [PATCH zfsonlinux 3/5] debian: install files to /usr

Stoiko Ivanov s.ivanov at proxmox.com
Tue Aug 20 18:45:10 CEST 2024


follows commit 902967808693510631a198414dc57dc4ca564afe in debian
upstream [0], which was done to support usrmerge

[0] https://salsa.debian.org/zfsonlinux-team/zfs

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 debian/libnvpair3linux.install.in             |  2 +-
 debian/libpam-zfs.install                     |  2 -
 debian/libpam-zfs.install.in                  |  2 +
 debian/libuutil3linux.install.in              |  2 +-
 debian/libzfs4linux.install.in                |  4 +-
 debian/libzfsbootenv1linux.install.in         |  2 +-
 debian/libzfslinux-dev.install.in             |  6 +-
 debian/libzpool5linux.install.in              |  2 +-
 debian/rules                                  | 26 +++-----
 .../usr/share/initramfs-tools/hooks/zdev      | 10 ++--
 debian/zfs-test.install                       |  4 +-
 debian/zfs-zed.install                        |  2 +-
 debian/zfsutils-linux.install                 | 60 +++++++++----------
 debian/zfsutils-linux.links                   |  4 +-
 14 files changed, 60 insertions(+), 68 deletions(-)
 delete mode 100644 debian/libpam-zfs.install
 create mode 100644 debian/libpam-zfs.install.in

diff --git a/debian/libnvpair3linux.install.in b/debian/libnvpair3linux.install.in
index ed7b541e..fce54227 100644
--- a/debian/libnvpair3linux.install.in
+++ b/debian/libnvpair3linux.install.in
@@ -1 +1 @@
-lib/@DEB_HOST_MULTIARCH@/libnvpair.so.*
+usr/lib/@DEB_HOST_MULTIARCH@/libnvpair.so.*
diff --git a/debian/libpam-zfs.install b/debian/libpam-zfs.install
deleted file mode 100644
index c33123f6..00000000
--- a/debian/libpam-zfs.install
+++ /dev/null
@@ -1,2 +0,0 @@
-lib/*/security/pam_zfs_key.so
-usr/share/pam-configs/zfs_key
diff --git a/debian/libpam-zfs.install.in b/debian/libpam-zfs.install.in
new file mode 100644
index 00000000..036b2e8b
--- /dev/null
+++ b/debian/libpam-zfs.install.in
@@ -0,0 +1,2 @@
+usr/lib/@DEB_HOST_MULTIARCH@/security/pam_zfs_key.so
+usr/share/pam-configs/zfs_key
diff --git a/debian/libuutil3linux.install.in b/debian/libuutil3linux.install.in
index a197d030..bb333867 100644
--- a/debian/libuutil3linux.install.in
+++ b/debian/libuutil3linux.install.in
@@ -1 +1 @@
-lib/@DEB_HOST_MULTIARCH@/libuutil.so.*
+usr/lib/@DEB_HOST_MULTIARCH@/libuutil.so.*
diff --git a/debian/libzfs4linux.install.in b/debian/libzfs4linux.install.in
index 6765aaee..a9054c14 100644
--- a/debian/libzfs4linux.install.in
+++ b/debian/libzfs4linux.install.in
@@ -1,2 +1,2 @@
-lib/@DEB_HOST_MULTIARCH@/libzfs.so.*
-lib/@DEB_HOST_MULTIARCH@/libzfs_core.so.*
+usr/lib/@DEB_HOST_MULTIARCH@/libzfs.so.*
+usr/lib/@DEB_HOST_MULTIARCH@/libzfs_core.so.*
diff --git a/debian/libzfsbootenv1linux.install.in b/debian/libzfsbootenv1linux.install.in
index 49216742..b61b8ab6 100644
--- a/debian/libzfsbootenv1linux.install.in
+++ b/debian/libzfsbootenv1linux.install.in
@@ -1 +1 @@
-lib/@DEB_HOST_MULTIARCH@/libzfsbootenv.so.*
+usr/lib/@DEB_HOST_MULTIARCH@/libzfsbootenv.so.*
diff --git a/debian/libzfslinux-dev.install.in b/debian/libzfslinux-dev.install.in
index e515ddb8..7605b4db 100644
--- a/debian/libzfslinux-dev.install.in
+++ b/debian/libzfslinux-dev.install.in
@@ -1,4 +1,4 @@
-lib/@DEB_HOST_MULTIARCH@/*.a usr/lib/@DEB_HOST_MULTIARCH@/
-usr/include
+usr/lib/@DEB_HOST_MULTIARCH@/*.a
 usr/lib/@DEB_HOST_MULTIARCH@/*.so
-/usr/lib/@DEB_HOST_MULTIARCH@/pkgconfig/*.pc
+usr/lib/@DEB_HOST_MULTIARCH@/pkgconfig
+usr/include
diff --git a/debian/libzpool5linux.install.in b/debian/libzpool5linux.install.in
index b9e872df..0e087a27 100644
--- a/debian/libzpool5linux.install.in
+++ b/debian/libzpool5linux.install.in
@@ -1 +1 @@
-lib/@DEB_HOST_MULTIARCH@/libzpool.so.*
+usr/lib/@DEB_HOST_MULTIARCH@/libzpool.so.*
diff --git a/debian/rules b/debian/rules
index dc1c1c51..9299985a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -27,18 +27,19 @@ override_dh_auto_configure:
 	@# Build the userland, but don't build the kernel modules.
 	dh_auto_configure -- \
 	  --bindir=/usr/bin \
-	  --sbindir=/sbin \
-	  --libdir=/lib/"$(DEB_HOST_MULTIARCH)" \
-	  --with-udevdir=/lib/udev \
+	  --sbindir=/usr/sbin \
+	  --with-mounthelperdir=/usr/sbin \
+	  --libdir=/usr/lib/"$(DEB_HOST_MULTIARCH)" \
+	  --with-udevdir=/usr/lib/udev \
 	  --with-zfsexecdir=/usr/lib/zfs-linux \
 	  --enable-systemd \
 	  --enable-pyzfs \
 	  --with-python=python3 \
-	  --with-pammoduledir='/lib/$(DEB_HOST_MULTIARCH)/security' \
+	  --with-pammoduledir='/usr/lib/$(DEB_HOST_MULTIARCH)/security' \
 	  --with-pkgconfigdir='/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig' \
-	  --with-systemdunitdir=/lib/systemd/system \
-	  --with-systemdpresetdir=/lib/systemd/system-preset \
-	  --with-systemdgeneratordir=/lib/systemd/system-generators \
+	  --with-systemdunitdir=/usr/lib/systemd/system \
+	  --with-systemdpresetdir=/usr/lib/systemd/system-preset \
+	  --with-systemdgeneratordir=/usr/lib/systemd/system-generators \
 	  --with-config=user
 
 	for i in $(wildcard $(CURDIR)/debian/*.install.in) ; do \
@@ -61,21 +62,12 @@ override_dh_auto_install:
 	$(MAKE) install DESTDIR='$(CURDIR)/debian/tmp'
 
 	# Move from bin_dir to /usr/sbin
-	# Remove suffix (.py) as per policy 10.4 - Scripts
-	# https://www.debian.org/doc/debian-policy/ch-files.html#s-scripts
 	mkdir -p '$(CURDIR)/debian/tmp/usr/sbin/'
 	mv '$(CURDIR)/debian/tmp/usr/bin/arc_summary' '$(CURDIR)/debian/tmp/usr/sbin/arc_summary'
 	mv '$(CURDIR)/debian/tmp/usr/bin/arcstat' '$(CURDIR)/debian/tmp/usr/sbin/arcstat'
 	mv '$(CURDIR)/debian/tmp/usr/bin/dbufstat' '$(CURDIR)/debian/tmp/usr/sbin/dbufstat'
 
-	@# Zed has dependencies outside of the system root.
-	mv '$(CURDIR)/debian/tmp/sbin/zed' '$(CURDIR)/debian/tmp/usr/sbin/zed'
-
 	mkdir -p $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)
-	for i in `ls $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/*.so`; do \
-		ln -s /lib/$(DEB_HOST_MULTIARCH)/`readlink $${i}` $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/`basename $${i}`; \
-		rm $${i}; \
-	done
 
 	chmod a-x '$(CURDIR)/debian/tmp/etc/zfs/zfs-functions'
 	chmod a-x '$(CURDIR)/debian/tmp/etc/default/zfs'
@@ -93,7 +85,7 @@ override_dh_auto_clean:
 	@if test -e META.orig; then mv META.orig META; fi
 
 override_dh_install:
-	find debian/tmp/lib -name '*.la' -delete
+	find debian/tmp/usr/lib -name '*.la' -delete
 	dh_install
 
 override_dh_missing:
diff --git a/debian/tree/zfs-initramfs/usr/share/initramfs-tools/hooks/zdev b/debian/tree/zfs-initramfs/usr/share/initramfs-tools/hooks/zdev
index 0cf21a42..36c4bbbf 100755
--- a/debian/tree/zfs-initramfs/usr/share/initramfs-tools/hooks/zdev
+++ b/debian/tree/zfs-initramfs/usr/share/initramfs-tools/hooks/zdev
@@ -5,7 +5,7 @@
 
 PREREQ="udev"
 PREREQ_UDEV_RULES="60-zvol.rules 69-vdev.rules"
-COPY_EXEC_LIST="/lib/udev/zvol_id /lib/udev/vdev_id"
+COPY_EXEC_LIST="/usr/lib/udev/zvol_id /usr/lib/udev/vdev_id"
 
 # Generic result code.
 RC=0
@@ -33,18 +33,18 @@ fi
 
 . /usr/share/initramfs-tools/hook-functions
 
-mkdir -p "$DESTDIR/lib/udev/rules.d/"
+mkdir -p "$DESTDIR/usr/lib/udev/rules.d/"
 for ii in $PREREQ_UDEV_RULES
 do
 	if [ -e "/etc/udev/rules.d/$ii" ]
 	then
-		cp -p "/etc/udev/rules.d/$ii" "$DESTDIR/lib/udev/rules.d/"
+		cp -p "/etc/udev/rules.d/$ii" "$DESTDIR/usr/lib/udev/rules.d/"
 	elif [ -e "/lib/udev/rules.d/$ii" ]
 	then
-		cp -p "/lib/udev/rules.d/$ii" "$DESTDIR/lib/udev/rules.d/"
+		cp -p "/lib/udev/rules.d/$ii" "$DESTDIR/usr/lib/udev/rules.d/"
 	else
 		echo "Error: Missing udev rule: $ii"
-		echo "       This file must be in the /etc/udev/rules.d or /lib/udev/rules.d directory."
+		echo "       This file must be in the /etc/udev/rules.d or /usr/lib/udev/rules.d directory."
 		exit 1
 	fi
 done
diff --git a/debian/zfs-test.install b/debian/zfs-test.install
index cafcfdc0..1ac2c00b 100644
--- a/debian/zfs-test.install
+++ b/debian/zfs-test.install
@@ -1,5 +1,5 @@
-sbin/zinject
-sbin/ztest
+usr/sbin/zinject
+usr/sbin/ztest
 usr/bin/raidz_test
 usr/share/man/man1/raidz_test.1
 usr/share/man/man1/test-runner.1
diff --git a/debian/zfs-zed.install b/debian/zfs-zed.install
index a348ba82..30699a8a 100644
--- a/debian/zfs-zed.install
+++ b/debian/zfs-zed.install
@@ -1,5 +1,5 @@
 etc/zfs/zed.d/*
-lib/systemd/system/zfs-zed.service
+usr/lib/systemd/system/zfs-zed.service
 usr/lib/zfs-linux/zed.d/*
 usr/sbin/zed
 usr/share/man/man8/zed.8
diff --git a/debian/zfsutils-linux.install b/debian/zfsutils-linux.install
index 2fd7aefe..c6a97ce1 100644
--- a/debian/zfsutils-linux.install
+++ b/debian/zfsutils-linux.install
@@ -2,45 +2,45 @@
 etc/default/zfs
 etc/zfs/zfs-functions
 etc/zfs/zpool.d/
-lib/systemd/system-preset/
-lib/systemd/system/zfs-import-cache.service
-lib/systemd/system/zfs-import-scan.service
-lib/systemd/system/zfs-import at .service
-lib/systemd/system/zfs-import.target
-lib/systemd/system/zfs-import.service
-lib/systemd/system/zfs-load-key.service
-lib/systemd/system/zfs-mount.service
-lib/systemd/system/zfs-scrub-monthly at .timer
-lib/systemd/system/zfs-scrub-weekly at .timer
-lib/systemd/system/zfs-scrub at .service
-lib/systemd/system/zfs-share.service
-lib/systemd/system/zfs-trim-monthly at .timer
-lib/systemd/system/zfs-trim-weekly at .timer
-lib/systemd/system/zfs-trim at .service
-lib/systemd/system/zfs-volume-wait.service
-lib/systemd/system/zfs-volumes.target
-lib/systemd/system/zfs.target
-lib/systemd/system-generators/zfs-mount-generator
-lib/udev/
-sbin/fsck.zfs
-sbin/mount.zfs
-sbin/zdb
-sbin/zfs
-sbin/zfs_ids_to_path
-sbin/zgenhostid
-sbin/zhack
-sbin/zpool
-sbin/zstream
-sbin/zstreamdump
 usr/bin/zvol_wait
 usr/bin/zilstat
 usr/lib/modules-load.d/ lib/
+usr/lib/systemd/system-preset/
+usr/lib/systemd/system/zfs-import-cache.service
+usr/lib/systemd/system/zfs-import-scan.service
+usr/lib/systemd/system/zfs-import at .service
+usr/lib/systemd/system/zfs-import.target
+usr/lib/systemd/system/zfs-import.service
+usr/lib/systemd/system/zfs-load-key.service
+usr/lib/systemd/system/zfs-mount.service
+usr/lib/systemd/system/zfs-scrub-monthly at .timer
+usr/lib/systemd/system/zfs-scrub-weekly at .timer
+usr/lib/systemd/system/zfs-scrub at .service
+usr/lib/systemd/system/zfs-share.service
+usr/lib/systemd/system/zfs-trim-monthly at .timer
+usr/lib/systemd/system/zfs-trim-weekly at .timer
+usr/lib/systemd/system/zfs-trim at .service
+usr/lib/systemd/system/zfs-volume-wait.service
+usr/lib/systemd/system/zfs-volumes.target
+usr/lib/systemd/system/zfs.target
+usr/lib/systemd/system-generators/zfs-mount-generator
+usr/lib/udev/
 usr/lib/zfs-linux/zfs_prepare_disk
 usr/lib/zfs-linux/zpool.d/
 usr/lib/zfs-linux/zpool_influxdb
 usr/sbin/arc_summary
 usr/sbin/arcstat
 usr/sbin/dbufstat
+usr/sbin/fsck.zfs
+usr/sbin/mount.zfs
+usr/sbin/zdb
+usr/sbin/zfs
+usr/sbin/zfs_ids_to_path
+usr/sbin/zgenhostid
+usr/sbin/zhack
+usr/sbin/zpool
+usr/sbin/zstream
+usr/sbin/zstreamdump
 usr/share/bash-completion/completions
 usr/share/man/man8/arcstat.8
 usr/share/man/man1/zhack.1
diff --git a/debian/zfsutils-linux.links b/debian/zfsutils-linux.links
index adb63c18..faa031bb 100644
--- a/debian/zfsutils-linux.links
+++ b/debian/zfsutils-linux.links
@@ -1,3 +1,3 @@
-sbin/zfs      bin/zfs
-sbin/zpool    bin/zpool
+usr/sbin/zfs      usr/bin/zfs
+usr/sbin/zpool    usr/bin/zpool
 usr/lib/zfs-linux/zpool_influxdb  bin/zpool_influxdb
-- 
2.39.2





More information about the pve-devel mailing list