remove pools without a bootfs from BOOTFS variable

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
This commit is contained in:
Matthew Thode 2018-01-30 23:58:19 +00:00 committed by Brian Behlendorf
parent bee7e4ff12
commit 1d8a71b603
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ Type=oneshot
RemainAfterExit=yes RemainAfterExit=yes
ExecStartPre=/sbin/modprobe zfs ExecStartPre=/sbin/modprobe zfs
ExecStart=@sbindir@/zpool import -c @sysconfdir@/zfs/zpool.cache -aN 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] [Install]
WantedBy=zfs-import.target WantedBy=zfs-import.target

View File

@ -13,7 +13,7 @@ Type=oneshot
RemainAfterExit=yes RemainAfterExit=yes
ExecStartPre=/sbin/modprobe zfs ExecStartPre=/sbin/modprobe zfs
ExecStart=@sbindir@/zpool import -aN -o cachefile=none 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] [Install]
WantedBy=zfs-import.target WantedBy=zfs-import.target