2020-03-26 18:47:16 +03:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Antonio Russo <antonio.e.russo@gmail.com>
|
|
|
|
Date: Fri, 20 Mar 2020 17:28:43 +0100
|
|
|
|
Subject: [PATCH] dont symlink zed scripts
|
|
|
|
|
2023-10-15 14:06:15 +03:00
|
|
|
Of the zedlet scripts shipped by upstream, a subset are enabled by
|
|
|
|
default, by creating symlinks in /etc/zfs/zed.d. These symlinks are
|
|
|
|
shipped in the zfs-zed package. dpkg, however, does not support
|
|
|
|
conffile handling of symlinks, and therefore any changes (removals) to
|
|
|
|
the symlinks are not preserved on package upgrade.
|
2020-03-26 18:47:16 +03:00
|
|
|
|
2023-10-15 14:06:15 +03:00
|
|
|
To address this policy violation, we:
|
2020-03-26 18:47:16 +03:00
|
|
|
|
2023-10-15 14:06:15 +03:00
|
|
|
1. During package build, create a list of enabled-by-default zedlets,
|
|
|
|
instead of creating symlinks.
|
|
|
|
2. On package removal, identify all enabled-by-default zedlets whose
|
|
|
|
symlinks do not exist (i.e., were removed by the user). This is done
|
|
|
|
by creating "whiteout" links to /dev/null in their place).
|
|
|
|
3. On package installation, create links to enabled-by-default zedlets
|
|
|
|
UNLESS there is already a file there (i.e., abort if there is a
|
|
|
|
whiteout link).
|
|
|
|
4. We also clean up broken symlinks to removed zedlets at package
|
|
|
|
postinst.
|
2020-03-26 18:47:16 +03:00
|
|
|
|
Preserve /etc/zfs/zed.d configuration on upgrade
Of the zedlet scripts shipped by upstream, a subset are enabled by
default, by creating symlinks in /etc/zfs/zed.d. These symlinks are
shipped in the zfs-zed package. dpkg, however, does not support
conffile handling of symlinks, and therefore any changes (removals) to
the symlinks are not preserved on package upgrade.
To address this policy violation, we:
1. During package build, create a list of enabled-by-default zedlets,
instead of creating symlinks.
2. On package removal, identify all enabled-by-default zedlets whose
symlinks do not exist (i.e., were removed by the user). This is done
by creating "whiteout" links to /dev/null in their place).
3. On package installation, create links to enabled-by-default zedlets
UNLESS there is already a file there (i.e., abort if there is a
whiteout link).
4. We also clean up broken symlinks to removed zedlets at package
postinst.
(cherry picked and adapted from 5cee380324d74e640d5dd7a360faba3994c8007f [0])
[0] https://salsa.debian.org/zfsonlinux-team/zfs.git
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2020-03-20 19:28:43 +03:00
|
|
|
Description: track default symlinks, instead of symlinking
|
|
|
|
Forwarded: no need
|
2023-10-15 14:06:15 +03:00
|
|
|
(cherry picked from https://salsa.debian.org/zfsonlinux-team/zfs/-/commit/5cee380324d7)
|
|
|
|
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
|
2023-04-20 10:26:09 +03:00
|
|
|
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
2020-03-26 18:47:16 +03:00
|
|
|
---
|
|
|
|
cmd/zed/zed.d/Makefile.am | 2 +-
|
|
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
|
|
|
|
diff --git a/cmd/zed/zed.d/Makefile.am b/cmd/zed/zed.d/Makefile.am
|
2023-10-15 13:08:06 +03:00
|
|
|
index 812558cf6..f802cf140 100644
|
Preserve /etc/zfs/zed.d configuration on upgrade
Of the zedlet scripts shipped by upstream, a subset are enabled by
default, by creating symlinks in /etc/zfs/zed.d. These symlinks are
shipped in the zfs-zed package. dpkg, however, does not support
conffile handling of symlinks, and therefore any changes (removals) to
the symlinks are not preserved on package upgrade.
To address this policy violation, we:
1. During package build, create a list of enabled-by-default zedlets,
instead of creating symlinks.
2. On package removal, identify all enabled-by-default zedlets whose
symlinks do not exist (i.e., were removed by the user). This is done
by creating "whiteout" links to /dev/null in their place).
3. On package installation, create links to enabled-by-default zedlets
UNLESS there is already a file there (i.e., abort if there is a
whiteout link).
4. We also clean up broken symlinks to removed zedlets at package
postinst.
(cherry picked and adapted from 5cee380324d74e640d5dd7a360faba3994c8007f [0])
[0] https://salsa.debian.org/zfsonlinux-team/zfs.git
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2020-03-20 19:28:43 +03:00
|
|
|
--- a/cmd/zed/zed.d/Makefile.am
|
|
|
|
+++ b/cmd/zed/zed.d/Makefile.am
|
2023-10-15 13:08:06 +03:00
|
|
|
@@ -48,7 +48,7 @@ zed-install-data-hook:
|
|
|
|
set -x; for f in $(zedconfdefaults); do \
|
|
|
|
[ -f "$(DESTDIR)$(zedconfdir)/$${f}" ] ||\
|
|
|
|
[ -L "$(DESTDIR)$(zedconfdir)/$${f}" ] || \
|
|
|
|
- $(LN_S) "$(zedexecdir)/$${f}" "$(DESTDIR)$(zedconfdir)"; \
|
Preserve /etc/zfs/zed.d configuration on upgrade
Of the zedlet scripts shipped by upstream, a subset are enabled by
default, by creating symlinks in /etc/zfs/zed.d. These symlinks are
shipped in the zfs-zed package. dpkg, however, does not support
conffile handling of symlinks, and therefore any changes (removals) to
the symlinks are not preserved on package upgrade.
To address this policy violation, we:
1. During package build, create a list of enabled-by-default zedlets,
instead of creating symlinks.
2. On package removal, identify all enabled-by-default zedlets whose
symlinks do not exist (i.e., were removed by the user). This is done
by creating "whiteout" links to /dev/null in their place).
3. On package installation, create links to enabled-by-default zedlets
UNLESS there is already a file there (i.e., abort if there is a
whiteout link).
4. We also clean up broken symlinks to removed zedlets at package
postinst.
(cherry picked and adapted from 5cee380324d74e640d5dd7a360faba3994c8007f [0])
[0] https://salsa.debian.org/zfsonlinux-team/zfs.git
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2020-03-20 19:28:43 +03:00
|
|
|
+ echo "$${f}" >> "$(DESTDIR)$(zedexecdir)/DEFAULT-ENABLED" ; \
|
|
|
|
done
|
2021-09-27 21:07:04 +03:00
|
|
|
|
2023-10-15 13:08:06 +03:00
|
|
|
SHELLCHECKSCRIPTS += $(dist_zedconf_DATA) $(dist_zedexec_SCRIPTS) $(nodist_zedexec_SCRIPTS)
|