diff options
author | Jiri Kosina <jkosina@suse.cz> | 2019-03-05 15:56:59 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2019-03-05 15:56:59 +0100 |
commit | f9d138145686b52b48ccb36557d6842076e2b9dd (patch) | |
tree | 95f5c8952a06616ddf4e7ed0288b82bfdb3aea72 /tools | |
parent | 7185a96981a2f8bb523dd87cad20a6b96c721ad5 (diff) | |
parent | fbb76d579dff4a2e332566dcd1d5979ac92bc34b (diff) |
Merge branch 'for-5.1/atomic-replace' into for-linus
The atomic replace allows to create cumulative patches. They are useful when
you maintain many livepatches and want to remove one that is lower on the
stack. In addition it is very useful when more patches touch the same function
and there are dependencies between them.
It's also a feature some of the distros are using already to distribute
their patches.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/livepatch/functions.sh | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/tools/testing/selftests/livepatch/functions.sh b/tools/testing/selftests/livepatch/functions.sh index c7b9fb45d7c9..30195449c63c 100644 --- a/tools/testing/selftests/livepatch/functions.sh +++ b/tools/testing/selftests/livepatch/functions.sh @@ -55,11 +55,10 @@ function is_livepatch_mod() { function __load_mod() { local mod="$1"; shift - local args="$*" - local msg="% modprobe $mod $args" + local msg="% modprobe $mod $*" log "${msg%% }" - ret=$(modprobe "$mod" "$args" 2>&1) + ret=$(modprobe "$mod" "$@" 2>&1) if [[ "$ret" != "" ]]; then die "$ret" fi @@ -75,12 +74,11 @@ function __load_mod() { # params - module parameters to pass to modprobe function load_mod() { local mod="$1"; shift - local args="$*" is_livepatch_mod "$mod" && die "use load_lp() to load the livepatch module $mod" - __load_mod "$mod" "$args" + __load_mod "$mod" "$@" } # load_lp_nowait(modname, params) - load a kernel module with a livepatch @@ -89,12 +87,11 @@ function load_mod() { # params - module parameters to pass to modprobe function load_lp_nowait() { local mod="$1"; shift - local args="$*" is_livepatch_mod "$mod" || die "module $mod is not a livepatch" - __load_mod "$mod" "$args" + __load_mod "$mod" "$@" # Wait for livepatch in sysfs ... loop_until '[[ -e "/sys/kernel/livepatch/$mod" ]]' || @@ -106,9 +103,8 @@ function load_lp_nowait() { # params - module parameters to pass to modprobe function load_lp() { local mod="$1"; shift - local args="$*" - load_lp_nowait "$mod" "$args" + load_lp_nowait "$mod" "$@" # Wait until the transition finishes ... loop_until 'grep -q '^0$' /sys/kernel/livepatch/$mod/transition' || @@ -120,11 +116,10 @@ function load_lp() { # params - module parameters to pass to modprobe function load_failing_mod() { local mod="$1"; shift - local args="$*" - local msg="% modprobe $mod $args" + local msg="% modprobe $mod $*" log "${msg%% }" - ret=$(modprobe "$mod" "$args" 2>&1) + ret=$(modprobe "$mod" "$@" 2>&1) if [[ "$ret" == "" ]]; then die "$mod unexpectedly loaded" fi |