2020-07-11 23:35:58 +00:00
|
|
|
include $(top_srcdir)/config/Substfiles.am
|
2021-05-21 21:43:38 +00:00
|
|
|
include $(top_srcdir)/config/Shellcheck.am
|
2020-07-11 23:35:58 +00:00
|
|
|
|
2015-07-09 18:41:14 +00:00
|
|
|
pkgdracutdir = $(dracutdir)/modules.d/90zfs
|
|
|
|
pkgdracut_SCRIPTS = \
|
2014-06-09 21:55:31 +00:00
|
|
|
export-zfs.sh \
|
|
|
|
module-setup.sh \
|
|
|
|
mount-zfs.sh \
|
|
|
|
parse-zfs.sh \
|
2016-03-30 23:59:15 +00:00
|
|
|
zfs-generator.sh \
|
2018-01-18 18:20:34 +00:00
|
|
|
zfs-load-key.sh \
|
2016-10-17 18:51:15 +00:00
|
|
|
zfs-needshutdown.sh \
|
2021-06-10 16:26:37 +00:00
|
|
|
zfs-lib.sh \
|
|
|
|
import-opts-generator.sh
|
2015-07-09 18:41:14 +00:00
|
|
|
|
2019-04-03 00:14:39 +00:00
|
|
|
pkgdracut_DATA = \
|
2020-05-30 04:16:08 +00:00
|
|
|
zfs-env-bootfs.service \
|
contrib: dracut: fix race with root=zfs:dset when necessities required
This had always worked in my testing, but a user on hardware reported
this to happen 100%, and I reproduced it once with cold VM host caches.
dracut-zfs-generator runs as a systemd generator, i.e. at Some
Relatively Early Time; if root= is a fixed dataset, it tries to
"solve [necessities] statically at generation time".
If by that point zfs-import.target hasn't popped (because the import is
taking a non-negligible amount of time for whatever reason), it'll see
no children for the root datase, and as such generate no mounts.
This has never had any right to work. No-one caught this earlier because
it's just that much more convenient to have root=zfs:AUTO, which orders
itself properly.
To fix this, always run zfs-nonroot-necessities.service;
this additionally simplifies the implementation by:
* making BOOTFS from zfs-env-bootfs.service be the real, canonical,
root dataset name, not just "whatever the first bootfs is",
and only set it if we're ZFS-booting
* zfs-{rollback,snapshot}-bootfs.service can use this instead of
re-implementing it
* having zfs-env-bootfs.service also set BOOTFSFLAGS
* this means the sysroot.mount drop-in can be fixed text
* zfs-nonroot-necessities.service can also be constant and always
enabled, because it's conditioned on BOOTFS being set
There is no longer any code generated at run-time
(the sysroot.mount drop-in is an unavoidable gratuitous cp).
The flow of BOOTFS{,FLAGS} from zfs-env-bootfs.service to sysroot.mount
is not noted explicitly in dracut.zfs(7), because (a) at some point it's
just visual noise and (b) it's already ordered via d-p-m.s from z-i.t.
Backport-of: 3399a30ee02d0d31ba2d43d0ce0a2fd90d5c575d
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
2023-03-28 20:49:50 +00:00
|
|
|
zfs-nonroot-necessities.service \
|
2020-05-30 04:16:08 +00:00
|
|
|
zfs-snapshot-bootfs.service \
|
|
|
|
zfs-rollback-bootfs.service
|
2019-04-03 00:14:39 +00:00
|
|
|
|
2020-07-11 23:35:58 +00:00
|
|
|
SUBSTFILES += $(pkgdracut_SCRIPTS) $(pkgdracut_DATA)
|
2021-05-21 23:45:40 +00:00
|
|
|
|
|
|
|
# Provided by /bin/sleep, and, again, every implementation of that supports this
|
|
|
|
CHECKBASHISMS_IGNORE = -e 'sleep only takes one integer' -e 'sleep 0.'
|