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:
Josh Poimboeuf 2014-06-12 16:53:19 -05:00
parent 3ca8106987
commit e0416a3b42
1 changed files with 11 additions and 7 deletions

View File

@ -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 */