mirror of https://github.com/dynup/kpatch
kpatch-build: ubuntu fix for vmlinux_3 error
kpatch load fails on Ubuntu with: kpatch: unable to find module 'vmlinux_3' The root cause is that the vmlinux file on Ubuntu is named vmlinux-3.13.0-24-generic instead of just vmlinux. Let's just call it "vmlinux" in the objname field.
This commit is contained in:
parent
3ca8106987
commit
e0416a3b42
|
@ -2125,13 +2125,17 @@ int main(int argc, char *argv[])
|
|||
|
||||
/* extract module name (destructive to arguments.modulefile) */
|
||||
name = basename(arguments.args[2]);
|
||||
pos = strchr(name,'.');
|
||||
if (pos) {
|
||||
/* kernel module */
|
||||
*pos = '\0';
|
||||
pos = name;
|
||||
while ((pos = strchr(pos, '-')))
|
||||
*pos++ = '_';
|
||||
if (!strncmp(name, "vmlinux-", 8))
|
||||
name = "vmlinux";
|
||||
else {
|
||||
pos = strchr(name,'.');
|
||||
if (pos) {
|
||||
/* kernel module */
|
||||
*pos = '\0';
|
||||
pos = name;
|
||||
while ((pos = strchr(pos, '-')))
|
||||
*pos++ = '_';
|
||||
}
|
||||
}
|
||||
|
||||
/* create strings, patches, and dynrelas sections */
|
||||
|
|
Loading…
Reference in New Issue