contrib/debian: install files into merged /usr

This commit synchronizes the debian packaging files with the distro
version (also maintained by me) as much as possible.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Colm Buckley <colm@tuatha.org>
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
Closes #17712
This commit is contained in:
Shengqi Chen 2025-09-09 22:22:57 +08:00 committed by Brian Behlendorf
parent 717c57c834
commit ca4f7d6d49
16 changed files with 68 additions and 78 deletions

View File

@ -4,7 +4,7 @@ The detailed contributor information can be found in [2][3].
Files: contrib/debian/*
Copyright:
2013-2016, Aron Xu <aron@debian.org>
2013-2025, Aron Xu <aron@debian.org>
2016, Petter Reinholdtsen <pere@hungry.com>
2013, Carlos Alberto Lopez Perez <clopez@igalia.com>
2013, Turbo Fredriksson <turbo@bayour.com>
@ -12,6 +12,8 @@ Copyright:
2011-2013, Darik Horn <dajhorn@vanadac.com>
2018-2019, Mo Zhou <cdluminate@gmail.com>
2018-2020, Mo Zhou <lumin@debian.org>
2023-2024, Shengqi Chen <harry-chen@outlook.com>
2024-2025, Shengqi Chen <harry@debian.org>
License: GPL-2+
[1] https://tracker.debian.org/pkg/zfs-linux

View File

@ -9,4 +9,4 @@ etc/zfs/vdev_id.conf.sas_direct.example
etc/zfs/vdev_id.conf.sas_switch.example
etc/zfs/vdev_id.conf.scsi.example
etc/zfs/zfs-functions
lib/systemd/system/zfs-import.service
usr/lib/systemd/system/zfs-import.service

View File

@ -1 +1 @@
lib/@DEB_HOST_MULTIARCH@/libnvpair.so.*
usr/lib/@DEB_HOST_MULTIARCH@/libnvpair.so.*

View File

@ -1,2 +1,2 @@
lib/*/security/pam_zfs_key.so
usr/lib/*/security/pam_zfs_key.so
usr/share/pam-configs/zfs_key

View File

@ -1,7 +1,7 @@
#!/bin/sh
set -e
if ! $(ldd "/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/security/pam_zfs_key.so" | grep -q "libasan") ; then
if ! $(ldd "/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/security/pam_zfs_key.so" | grep -q "libasan") ; then
pam-auth-update --package
fi

View File

@ -1 +1 @@
lib/@DEB_HOST_MULTIARCH@/libuutil.so.*
usr/lib/@DEB_HOST_MULTIARCH@/libuutil.so.*

View File

@ -1,3 +1,5 @@
lib/@DEB_HOST_MULTIARCH@/*.a usr/lib/@DEB_HOST_MULTIARCH@
usr/lib/@DEB_HOST_MULTIARCH@/*.a
usr/lib/@DEB_HOST_MULTIARCH@/*.so
usr/lib/@DEB_HOST_MULTIARCH@/pkgconfig
usr/include
usr/lib/@DEB_HOST_MULTIARCH@

View File

@ -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.*

View File

@ -1 +1 @@
lib/@DEB_HOST_MULTIARCH@/libzfsbootenv.so.*
usr/lib/@DEB_HOST_MULTIARCH@/libzfsbootenv.so.*

View File

@ -1 +1 @@
lib/@DEB_HOST_MULTIARCH@/libzpool.so.*
usr/lib/@DEB_HOST_MULTIARCH@/libzpool.so.*

View File

@ -1,4 +1,4 @@
sbin/ztest
usr/sbin/ztest
usr/bin/raidz_test
usr/share/man/man1/raidz_test.1
usr/share/man/man1/test-runner.1

View File

@ -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

View File

@ -1,45 +1,45 @@
etc/default/zfs
etc/zfs/zfs-functions
etc/zfs/zpool.d/
lib/systemd/system-generators/
lib/systemd/system-preset/
lib/systemd/system/zfs-import-cache.service
lib/systemd/system/zfs-import-scan.service
lib/systemd/system/zfs-import.target
lib/systemd/system/zfs-load-key.service
lib/systemd/system/zfs-mount.service
lib/systemd/system/zfs-mount@.service
lib/systemd/system/zfs-scrub-monthly@.timer
lib/systemd/system/zfs-scrub-weekly@.timer
lib/systemd/system/zfs-scrub@.service
lib/systemd/system/zfs-trim-monthly@.timer
lib/systemd/system/zfs-trim-weekly@.timer
lib/systemd/system/zfs-trim@.service
lib/systemd/system/zfs-share.service
lib/systemd/system/zfs-volume-wait.service
lib/systemd/system/zfs-volumes.target
lib/systemd/system/zfs.target
lib/udev/
sbin/fsck.zfs
sbin/mount.zfs
sbin/zdb
sbin/zfs
sbin/zfs_ids_to_path
sbin/zgenhostid
sbin/zhack
sbin/zinject
sbin/zpool
sbin/zstream
sbin/zstreamdump
usr/lib/systemd/system-generators/
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.target
usr/lib/systemd/system/zfs-load-key.service
usr/lib/systemd/system/zfs-mount.service
usr/lib/systemd/system/zfs-mount@.service
usr/lib/systemd/system/zfs-scrub-monthly@.timer
usr/lib/systemd/system/zfs-scrub-weekly@.timer
usr/lib/systemd/system/zfs-scrub@.service
usr/lib/systemd/system/zfs-trim-monthly@.timer
usr/lib/systemd/system/zfs-trim-weekly@.timer
usr/lib/systemd/system/zfs-trim@.service
usr/lib/systemd/system/zfs-share.service
usr/lib/systemd/system/zfs-volume-wait.service
usr/lib/systemd/system/zfs-volumes.target
usr/lib/systemd/system/zfs.target
usr/lib/udev/
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/zinject
usr/sbin/zpool
usr/sbin/zstream
usr/sbin/zstreamdump
usr/bin/zvol_wait
usr/lib/modules-load.d/ lib/
usr/lib/modules-load.d/
usr/lib/zfs-linux/zpool.d/
usr/lib/zfs-linux/zpool_influxdb
usr/lib/zfs-linux/zfs_prepare_disk
usr/sbin/zarcsummary
usr/sbin/zarcstat
usr/sbin/dbufstat
usr/sbin/zilstat
usr/bin/zarcsummary
usr/bin/zarcstat
usr/bin/dbufstat usr/sbin
usr/bin/zilstat
usr/share/zfs/compatibility.d/
usr/share/bash-completion/completions
usr/share/man/man1/zarcstat.1

View File

@ -0,0 +1,3 @@
usr/sbin/zfs usr/bin/zfs
usr/sbin/zpool usr/bin/zpool
usr/lib/zfs-linux/zpool_influxdb usr/bin/zpool_influxdb

View File

@ -37,18 +37,19 @@ override_dh_auto_configure:
@# Build the userland, but don't build the kernel modules.
dh_auto_configure -- @CFGOPTS@ \
--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 \
@ -77,19 +78,6 @@ override_dh_auto_install:
@# Install the utilities.
$(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/zarcsummary' '$(CURDIR)/debian/tmp/usr/sbin/zarcsummary'
mv '$(CURDIR)/debian/tmp/usr/bin/zarcstat' '$(CURDIR)/debian/tmp/usr/sbin/zarcstat'
mv '$(CURDIR)/debian/tmp/usr/bin/dbufstat' '$(CURDIR)/debian/tmp/usr/sbin/dbufstat'
mv '$(CURDIR)/debian/tmp/usr/bin/zilstat' '$(CURDIR)/debian/tmp/usr/sbin/zilstat'
@# Zed has dependencies outside of the system root.
mv '$(CURDIR)/debian/tmp/sbin/zed' '$(CURDIR)/debian/tmp/usr/sbin/zed'
sed -i 's|ExecStart=/sbin/|ExecStart=/usr/sbin/|g' '$(CURDIR)/debian/tmp/lib/systemd/system/zfs-zed.service'
@# Install the DKMS source.
@# We only want the files needed to build the modules
install -D -t '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/scripts' \
@ -131,11 +119,6 @@ override_dh_auto_install:
cd '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)'; ./autogen.sh
rm -fr '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/autom4te.cache'
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'
@ -159,7 +142,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:
@ -173,8 +156,8 @@ override_dh_installinit:
dh_installinit -R --name zfs-zed
override_dh_installsystemd:
mkdir -p debian/openzfs-zfsutils/lib/systemd/system
ln -sr /dev/null debian/openzfs-zfsutils/lib/systemd/system/zfs-import.service
mkdir -p debian/openzfs-zfsutils/usr/lib/systemd/system
ln -sr /dev/null debian/openzfs-zfsutils/usr/lib/systemd/system/zfs-import.service
dh_installsystemd --no-stop-on-upgrade -X zfs-zed.service
dh_installsystemd --name zfs-zed

View File

@ -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