New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes to make packaging easier #575
Conversation
When building binaries such as create-diff-object it would be useful to be able to pass LDFLAGS when running make from the command line.
Some distributions prefer not to use /usr/libexec. To make things easier for packaging, allow this directory to be set easily via environment variables. Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
| $(INSTALL_DIRS): | ||
| $(MAKE) -C $(@:install-%=%) install | ||
|
|
||
| ninstall: $(UNINSTALL_DIRS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You meant uninstall: right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct! Already pushed a fix.
| $(INSTALL) -d $(MODULESDIR)/$(shell uname -r) | ||
| $(INSTALL) -m 644 core/kpatch.ko $(MODULESDIR)/$(shell uname -r) | ||
| $(INSTALL) -m 644 core/Module.symvers $(MODULESDIR)/$(shell uname -r) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to define INSTALL somewhere, or include Makefile.inc
EDIT: It appears MODULESDIR is undefined too, so best to just include Makefile.inc :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to specify core/ in the path, since we would already be in the core/ directory when this target is called. So it'd just be $(INSTALL) -m 644 kpatch.ko
|
@arges Thanks for the PR! And thanks for your patience :-) Other than the comments I already made, everything else looks good on my side. |
Don't assume we are building for the current kernel. In addition print out a proper package necessary for building the module. Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
In some cases when packaging it may not be useful to build kmod/core at package build time (for example if using DKMS). Add a parameter 'BUILDMOD' that when set to 'yes' will build kmod/core. Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
|
I thought about this a bit more, and pushed an earlier approach to just add conditionals to kmod/Makefile. This is a bit more simple than moving makefile logic around and having to worry about including sub makefiles. Thanks for the reviews. |
|
👍 |
|
Looks good to me, thanks. |
Changes to make packaging easier
Here are a series of commits that will make packaging kpatch in distributions such as Debian and Ubuntu a bit easier.