remove tools binaries from repo

Signed-off-by: Seth Jennings <sjenning@redhat.com>
add tools binaries to gitignore

Signed-off-by: Seth Jennings <sjenning@redhat.com>
Merge pull request #3 from spartacus06/removebins

remove binaries from repo and add to gitignore
fix bash shebang
add build caching
first pass at a decent user interface

This makes it somewhat easy to use.  From the root git dir, just:

  sudo scripts/kpatch-build ~/foo.patch

and it'll take care of everything, eventually spitting out the base
module (kpatch.ko) and the hotpatch module kpatch-foo.ko.

This is still all very crude, but a better user interface is coming
soon.
functional reorganization

Organize the files functionally:
- kmod/core: core kmod source
- kmod/patch: patch kmod source
- kpatch: kpatch script
- kpatch-build: kpatch build script and supporting tools
- contrib: distro-related files
compressed cache

Saves about 2G disk space per kernel version
clarify that kpatch should work on non-Fedora
use consistent naming for core and patch modules
Merge pull request #4 from jpoimboe/usability

Interface improvements
check for one-to-one section-symbol relationship

There are cases in which the compiler will create symbols with NOTYPE
that map to a non-zero offset inside an .rodata section.  In that case, there
may not be a one-to-one relationship between that symbol and section as
the section may contains the data for multiple NOTYPE symbols.

This commit checks for this case and does not assign the symbol pointer of the
section that contains its data to avoid multiple symbols referring to the same
section from overwriting one another.  It also adds a check ensuring that all
symbols whose type is !NOTYPE start at offset 0 within the section.  This
should be guarenteed by the -ffunction-sections and -fdata-sections options
compiler options.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
don't compare data on NOBITS sections

NOBITS section may have a non-zero size, however, the have no data and
the data descriptor will have d_buf set to NULL.

This commit fixes as segfault that occurs from trying to compare the
data of such sections.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
Merge pull request #5 from spartacus06/fixes

Fixes
proper makefile support

- setup the makefiles to support "make" and "make install", which builds
  the kpatch-build tools and installs everything in /usr/local.
- update kpatch-build to support new paths
- add "kpatch build" wrapper around kpatch-build
Merge pull request #6 from jpoimboe/makefiles

proper makefile support
bash style standardization

Before adding any more features to the scripts, standardize the bash
style.  I prefer something close to the google shell style guidelines:

  http://google-styleguide.googlecode.com/svn/trunk/shell.xml

- change [[ to [ (more robust)
- put variable references in quotes (more robust)
- put "then" on same line as "if" (more C-like, readable)
- print error messages on stdout
- avoid using external utilities like ls

Also added a few error handling improvements, including using a die
function where appropriate.
Merge pull request #8 from jpoimboe/bash-style

bash style standardization
kpatch: single enabled dir

Programs aren't supposed to touch /usr/lib, so use a new backend
directory scheme:
- /var/lib/kpatch/<version>/enabled for all symlinks
- /var/lib/kpatch/<version> for user installed
- /usr/lib/kpatch/<version> for system installed
kpatch: remove unload --all

A proper implementation would be trickier and I'm not sure this is a
useful command anyway.