Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
zfs-initramfs: Re-architect scripts/zfs
This has the following changes:
1) ZFS_INITRD_PRE_MOUNTROOT_SLEEP is replaced by honoring the standard
parameter "rootdelay" in the following way: the pool is repeatedly
imported read-only until it has a health status of ONLINE or
rootdelay expires. In this way, the script will wait for missing
drives until rootdelay expires. But in all cases, it tries a
read-write import of the pool eventually.
Using a standard parameter is more consistent than a ZFS-specific
option. Also, this establishes a maximum delay (well, not counting
the `zpool import` and `zpool export` time) rather than a minimum
delay, so if the drives are available sooner, the boot is faster.
This also allows one to set the option with a reasonable margin of
safety (so if one day the drives are just a little slower, the
system still boots) without unnecessarily delaying boots.
The condition of the pool needing to be ONLINE could probably be
tightened to looking at `zpool status` for some combination of
conditions (probably UNAVAIL, MISSING, FAULTED), but this is a safe
starting point. The only downside of this approach is that
offlining a drive and rebooting will require enduring the full
rootdelay unnecessarily. But given that rootdelay defaults to zero,
some portion of that is expected, and the maximum is still a value
the administrator has explicitly chosen as something they accept.
2) Direct error echos and /bin/sh calls are replaced by the standard
panic function. This achieves a nearly identical result, but:
A) is consistent with the standard behavior, including...
B) honors the standard "panic=" option to disable the debug shell
for security reasons. I'm not sure how important this is, but
it is standard behavior.
C) it requires less code; it eliminates the code to disable plymouth
directly.
3) Automatic pool imports are disabled. This is the default in 0.6.4
anyway.
4) Forced pool importing is eliminated. This should not be necessary.
5) Only the upstream root=ZFS= syntax is supported for specifying the
root pool and bootfs.
6) All environment variables that are set are unset to avoid polluting
the init environment. This is an explicit goal of the upstream
scripts. Again, I'm not sure how important it is.- Loading branch information
Showing
3 changed files
with
75 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # ZoL userland configuration. | ||
|
|
||
| # Wait this many seconds during system start for pool member devices to appear | ||
| # before attempting import and starting mountall. | ||
| ZFS_AUTOIMPORT_TIMEOUT='30' | ||
|
|
||
| # Run `zfs share -a` during system start? | ||
| # nb: The shareiscsi, sharenfs, and sharesmb dataset properties. | ||
| ZFS_SHARE='no' | ||
|
|
||
| # Run `zfs unshare -a` during system stop? | ||
| ZFS_UNSHARE='no' | ||
|
|
||
| # Build kernel modules with the --enable-debug switch? | ||
| ZFS_DKMS_ENABLE_DEBUG='no' | ||
|
|
||
| # Build kernel modules with the --enable-debug-dmu-tx switch? | ||
| ZFS_DKMS_ENABLE_DEBUG_DMU_TX='no' | ||
|
|
||
| # Keep debugging symbols in kernel modules? | ||
| ZFS_DKMS_DISABLE_STRIP='no' | ||
|
|
||
| # Wait for this many seconds in the initrd pre_mountroot? | ||
| # This delays startup and should be '0' on most systems. | ||
| ZFS_INITRD_PRE_MOUNTROOT_SLEEP='0' |