aboutsummaryrefslogtreecommitdiff
path: root/system/openzfs/doinst.sh
diff options
context:
space:
mode:
authorMarkus Reichelt <slackbuilds@mareichelt.de>2022-10-14 01:55:48 +0100
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2022-10-15 10:47:33 +0700
commitc22cd83704609b45e5de2deaa40ead1ec69b60fa (patch)
tree7879aca026ee6d28a20cd2ce7dead1afb8cd3593 /system/openzfs/doinst.sh
parent428ab0a946825d2f80d614a520e5f9822c1507b7 (diff)
downloadslackbuilds-c22cd83704609b45e5de2deaa40ead1ec69b60fa.tar.xz
system/openzfs: Added (ZFS support for Linux)
Renamed from zfs-on-linux. Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/openzfs/doinst.sh')
-rw-r--r--system/openzfs/doinst.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/system/openzfs/doinst.sh b/system/openzfs/doinst.sh
new file mode 100644
index 000000000000..abc716422573
--- /dev/null
+++ b/system/openzfs/doinst.sh
@@ -0,0 +1,29 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ -e $OLD ]; then
+ cp -a $OLD ${NEW}.incoming
+ cat $NEW > ${NEW}.incoming
+ mv ${NEW}.incoming $NEW
+ fi
+ config $NEW
+}
+
+preserve_perms etc/rc.d/rc.zfs.new
+
+if [ -x /sbin/depmod ]; then
+ chroot . /sbin/depmod -a >/dev/null 2>&1
+fi