diff options
author | Ryan Moeller <[email protected]> | 2021-08-13 16:37:46 -0400 |
---|---|---|
committer | Tony Hutter <[email protected]> | 2021-09-14 14:30:39 -0700 |
commit | cacc48702bbd9f9c42c9cf7275ff5d670e1a0c6a (patch) | |
tree | 795c7819eba7a9a3d03e6e240842fa81ccd63479 /scripts | |
parent | cc55271681293cabbef7dbfe3b70c68ff6d5ee9f (diff) |
Add zfs.sh -r flag to reload modules
zfs.sh already can load and unload, so why not both?
This is convenient when developing changes to the module and you want
to rapidly make some changes, rebuild the module, reload the module,
and test the changes.
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes #12450
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/zfs.sh | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/zfs.sh b/scripts/zfs.sh index 39c49d71e..7870b8930 100755 --- a/scripts/zfs.sh +++ b/scripts/zfs.sh @@ -14,6 +14,7 @@ fi PROG=zfs.sh VERBOSE="no" UNLOAD="no" +LOAD="yes" STACK_TRACER="no" ZED_PIDFILE=${ZED_PIDFILE:-/var/run/zed.pid} @@ -44,12 +45,13 @@ DESCRIPTION: OPTIONS: -h Show this message -v Verbose + -r Reload modules -u Unload modules -S Enable kernel stack tracer EOF } -while getopts 'hvuS' OPTION; do +while getopts 'hvruS' OPTION; do case $OPTION in h) usage @@ -58,8 +60,13 @@ while getopts 'hvuS' OPTION; do v) VERBOSE="yes" ;; + r) + UNLOAD="yes" + LOAD="yes" + ;; u) UNLOAD="yes" + LOAD="no" ;; S) STACK_TRACER="yes" @@ -262,7 +269,8 @@ if [ "$UNLOAD" = "yes" ]; then unload_modules_linux ;; esac -else +fi +if [ "$LOAD" = "yes" ]; then case $UNAME in FreeBSD) load_modules_freebsd |