Skip to content

Commit 135b438

Browse files
committed
Merge pull request #175 from jpoimboe/kpatch-list
kpatch: show loaded modules in list command
2 parents 74fb803 + 49f832c commit 135b438

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

kpatch/kpatch

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,18 +202,24 @@ case "$1" in
202202

203203
"list")
204204
[[ "$#" -ne 1 ]] && usage
205-
echo "System installed patches:"
205+
echo "Loaded patch modules:"
206+
for module in /sys/kernel/kpatch/patches/*; do
207+
if [[ -e $module ]] && [[ $(cat $module/enabled) -eq 1 ]]; then
208+
echo_patch_name $module
209+
fi
210+
done
211+
echo ""
212+
echo "System installed patch modules:"
206213
for i in "$SYSDIR"/*.ko; do
207214
[[ -e "$i" ]] || continue
208215
echo_patch_name $i
209216
done
210217
echo ""
211-
echo "User installed patches:"
218+
echo "User installed patch modules:"
212219
for i in "$USERDIR"/*.ko; do
213220
[[ -e "$i" ]] || continue
214221
echo_patch_name $i
215222
done
216-
echo ""
217223
;;
218224

219225
"info")

0 commit comments

Comments
 (0)