File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -234,17 +234,20 @@ function try_module_insert {
234234 # backup the existing module (if available) for recovery
235235 if [ -f ${tgt_ko} .zst ];
236236 then
237- sudo cp ${tgt_ko} .zst ${tgt_ko} .zst.bckup
237+ sudo mv ${tgt_ko} .zst ${tgt_ko} .zst.bckup
238238 elif [ -f ${tgt_ko} ];
239239 then
240- sudo cp ${tgt_ko} ${tgt_ko} .bckup
240+ sudo mv ${tgt_ko} ${tgt_ko} .bckup
241241 else
242242 backup_available=0
243243 fi
244244
245245 # copy the patched module to target location
246246 sudo cp ${src_ko} ${tgt_ko}
247247
248+ # Run 'depmod' command, so that, it will update the 'modinfo' if incase filename or other details got changed.
249+ sudo depmod
250+
248251 # try to load the new module
249252 modprobe_failed=0
250253 printf " \e[32m\tApplying the patched module ... \e[0m"
@@ -259,9 +262,9 @@ function try_module_insert {
259262 then
260263 if [ -f ${tgt_ko} .zst.bckup ];
261264 then
262- sudo cp ${tgt_ko} .zst.bckup ${tgt_ko} .zst
265+ sudo mv ${tgt_ko} .zst.bckup ${tgt_ko} .zst
263266 else
264- sudo cp ${tgt_ko} .bckup ${tgt_ko}
267+ sudo mv ${tgt_ko} .bckup ${tgt_ko}
265268 fi
266269 sudo modprobe ${module_name}
267270 printf " \e[34mThe original \e[33m %s \e[34m module was reloaded\n\e[0m" ${module_name}
You can’t perform that action at this time.
0 commit comments