zfs-needshutdown.sh \
zfs-lib.sh
+pkgdracut_DATA = \
+ zfs-env-bootfs.service
+
EXTRA_DIST = \
$(top_srcdir)/contrib/dracut/90zfs/export-zfs.sh.in \
$(top_srcdir)/contrib/dracut/90zfs/module-setup.sh.in \
$(top_srcdir)/contrib/dracut/90zfs/zfs-generator.sh.in \
$(top_srcdir)/contrib/dracut/90zfs/zfs-load-key.sh.in \
$(top_srcdir)/contrib/dracut/90zfs/zfs-needshutdown.sh.in \
- $(top_srcdir)/contrib/dracut/90zfs/zfs-lib.sh.in
+ $(top_srcdir)/contrib/dracut/90zfs/zfs-lib.sh.in \
+ $(top_srcdir)/contrib/dracut/90zfs/zfs-env-bootfs.service.in
-$(pkgdracut_SCRIPTS):%:%.in
+$(pkgdracut_SCRIPTS) $(pkgdracut_DATA) :%:%.in
-$(SED) -e 's,@bindir\@,$(bindir),g' \
-e 's,@sbindir\@,$(sbindir),g' \
-e 's,@udevdir\@,$(udevdir),g' \
$< >'$@'
distclean-local::
- -$(RM) $(pkgdracut_SCRIPTS)
+ -$(RM) $(pkgdracut_SCRIPTS) $(pkgdracut_DATA)
type mark_hostonly >/dev/null 2>&1 && mark_hostonly @systemdunitdir@/zfs-import-$_item.service
fi
done
+ inst "${moddir}"/zfs-env-bootfs.service "${systemdsystemunitdir}"/zfs-env-bootfs.service
+ ln -s ../zfs-env-bootfs.service "${initdir}/${systemdsystemunitdir}/zfs-import.target.wants"/zfs-env-bootfs.service
+ type mark_hostonly >/dev/null 2>&1 && mark_hostonly @systemdunitdir@/zfs-env-bootfs.service
dracut_install systemd-ask-password
dracut_install systemd-tty-ask-password-agent
mkdir -p "${initdir}/$systemdsystemunitdir/initrd.target.wants"
--- /dev/null
+[Unit]
+Description=Set BOOTFS environment for dracut
+Documentation=man:zpool(8)
+DefaultDependencies=no
+After=zfs-import-cache.service
+After=zfs-import-scan.service
+Before=zfs-import.target
+
+[Service]
+Type=oneshot
+ExecStart=/bin/sh -c "/bin/systemctl set-environment BOOTFS=$(@sbindir@/zpool list -H -o bootfs | grep -m1 -v '^-$')"
+
+[Install]
+WantedBy=zfs-import.target