]> git.proxmox.com Git - mirror_zfs.git/commitdiff
remove pools without a bootfs from BOOTFS variable
authorMatthew Thode <mthode@mthode.org>
Tue, 30 Jan 2018 23:58:19 +0000 (23:58 +0000)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 30 Jan 2018 23:58:19 +0000 (15:58 -0800)
Use the same method used in zfs-load-key.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Llewelyn Trahaearn <WoefulDerelict@GMail.com>
Signed-off-by: Matthew Thode <mthode@mthode.org>
Closes #7089

etc/systemd/system/zfs-import-cache.service.in
etc/systemd/system/zfs-import-scan.service.in

index 3665b1eb417903813ed39ef5c4773e90b91dffca..308ced69decb13e52ec0831942ed2c10b305aefc 100644 (file)
@@ -14,7 +14,7 @@ Type=oneshot
 RemainAfterExit=yes
 ExecStartPre=/sbin/modprobe zfs
 ExecStart=@sbindir@/zpool import -c @sysconfdir@/zfs/zpool.cache -aN
-ExecStartPost=/bin/bash -c "/usr/bin/systemctl set-environment BOOTFS=$(@sbindir@/zpool list -H -o bootfs)"
+ExecStartPost=/bin/bash -c "/bin/systemctl set-environment BOOTFS=$(@sbindir@/zpool list -H -o bootfs | /bin/awk '$1 != \"-\" {print; exit}')"
 
 [Install]
 WantedBy=zfs-import.target
index 0a5951f4c078eac0ea12bf40dcc665a3e9106f0c..09eef175ea72095d15bb5f0d6e97d807d27ec94f 100644 (file)
@@ -13,7 +13,7 @@ Type=oneshot
 RemainAfterExit=yes
 ExecStartPre=/sbin/modprobe zfs
 ExecStart=@sbindir@/zpool import -aN -o cachefile=none
-ExecStartPost=/bin/bash -c "/usr/bin/systemctl set-environment BOOTFS=$(@sbindir@/zpool list -H -o bootfs)"
+ExecStartPost=/bin/bash -c "/bin/systemctl set-environment BOOTFS=$(@sbindir@/zpool list -H -o bootfs | /bin/awk '$1 != \"-\" {print; exit}')"
 
 [Install]
 WantedBy=zfs-import.target