| Age | Commit message (Collapse) | Author |
|
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: David Howells <dhowells@redhat.com>
|
|
Since module-init-tools (gzip) and kmod (gzip and xz) support compressed
modules, it could be useful to include a support for compressing modules
right after having them installed. Doing this in kbuild instead of per
distro can permit to make this kind of usage more generic.
This patch add a Kconfig entry to "Enable loadable module support" menu
and let you choose to compress using gzip (default) or xz.
Both gzip and xz does not used any extra -[1-9] option since Andi Kleen
and Rusty Russell prove no gain is made using them. gzip is called with -n
argument to avoid storing original filename inside compressed file, that
way we can save some more bytes.
On a v3.16 kernel, 'make allmodconfig' generated 4680 modules for a
total of 378MB (no strip, no sign, no compress), the following table
shows observed disk space gain based on the allmodconfig .config :
| time |
+-------------+-----------------+
| manual .ko | make | size | percent
| compression | modules_install | | gain
+-------------+-----------------+------+--------
- | | 18.61s | 378M |
GZIP | 3m16s | 3m37s | 102M | 73.41%
XZ | 5m22s | 5m39s | 77M | 79.83%
The gain for restricted environnement seems to be interesting while
uncompress can be time consuming but happens only while loading a module,
that is generally done only once.
This is fully compatible with signed modules while the signed module is
compressed. module-init-tools or kmod handles decompression
and provide to other layer the uncompressed but signed payload.
Reviewed-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Bertrand Jacquin <beber@meleeweb.net>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
Note: shouldn't we use 'install -D $(2)/$@ $@' instead of mkdir
and cp ?
Reviewed-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Bertrand Jacquin <beber@meleeweb.net>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
|
|
The script still spits out an error ("Can't read private key") but we
don't break modules_install.
Reported-by: Bruno Wolff III <bruno@wolff.to>
Original-patch-by: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
Linus deleted the old code and put signing on the install command,
I fixed it to extract the keyid and signer-name within sign-file
and cleaned up that script now it always signs in-place.
Some enthusiast should convert sign-key to perl and pull
x509keyid into it.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
|
This error may happen when the user's id or path includes .ko string.
For example, user's id is xxx.ko and building test.ko module,
the test.mod file lists ko name and all object files.
/home/xxx.ko/kernel_dev/device/drivers/test.ko
/home/xxx.ko/kernel_dev/device/drivers/test_main.o
/home/xxx.ko/kernel_dev/device/drivers/test_io.o ...
Current Makefile.modpost and Makefile.modinst find and list up not
only test.ko but also other object files.
because all of object file's path includes .ko string.
This is a patch to fix it.
Signed-off-by: Gunho Lee <gunho.lee@lge.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
|
|
This reverts commit ad7a953c522ceb496611d127e51e278bfe0ff483.
And commit: ("allow stripping of generated symbols under CONFIG_KALLSYMS_ALL")
9bb482476c6c9d1ae033306440c51ceac93ea80c
These stripping patches has caused a set of issues:
1) People have reported compatibility issues with binutils due to
lack of support for `--strip-unneeded-symbols' with objcopy 2.15.92.0.2
Reported by: Wenji
2) ccache and distcc no longer works as expeced
Reported by: Ted, Roland, + others
3) The installed modules increased a lot in size
Reported by: Ted, Davej + others
Reported-by: Wenji Huang <wenji.huang@oracle.com>
Reported-by: "Theodore Ts'o" <tytso@mit.edu>
Reported-by: Dave Jones <davej@redhat.com>
Reported-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
|
This patch changes the way __crc_ symbols are being resolved from
using ld to do so to using the assembler, thus allowing these symbols
to be marked local (the linker creates then as global ones) and hence
allow stripping (for modules) or ignoring (for vmlinux) them. While at
this, also strip other generated symbols during module installation.
One potentially debatable point is the handling of the flags passeed
to gcc when translating the intermediate assembly file into an object:
passing $(c_flags) unchanged doesn't work as gcc passes --gdwarf2 to
gas whenever is sees any -g* option, even for -g0, and despite the
fact that the compiler would have already produced all necessary debug
info in the C->assembly translation phase. I took the approach of just
filtering out all -g* options, but an alternative to such negative
filtering might be to have a positive filter which might, in the ideal
case allow just all the -Wa,* options to pass through.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
|
Eric Sandeen <sandeen@redhat.com> reported:
Installing external modules is supposed to put them in some path
under /lib/modules/<version>/extra/subdir/, but this change:
http://linux.bkbits.net:8080/linux-2.6/?PAGE=cset&REV=1.1982.9.23
makes them go under /lib/modules/<version>/extrasubdir
(for example, make M=fs/ext3 modules_install puts ext3.ko in
/lib/modules/<version>/extrafs/ext3.ko)
This was the case only when specifying a trailing slash to M=..
Fixed by removing trailing slash if present so
we correctly match dir part of target.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Eric Sandeen <sandeen@redhat.com>
|
|
Add option for stripping modules while installing them.
This function adds support for stripping modules while they are being
installed. CONFIG_DEBUG_KERNEL (which will probably become more
popular as developers use kdump) causes the size of the installed
modules to grow by a factor of 9 or so.
Some kernel package systems solve this problem by stripping the debug
information from /lib/modules after running "make modules_install",
but that may not work for people who are installing directly into
/lib/modules --- root partitions that were sized to handle 16 megs
worth of modules may not be quite so happy with 145 megs of modules,
so the "make modules_install" never succeeds.
This patch allows such users to request modules_install to strip the
modules as they are installed.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
|
The kbuild system takes advantage of an incorrect behavior in GNU make.
Once this behavior is fixed, all files in the kernel rebuild every time,
even if nothing has changed. This patch ensures kbuild works with both
the incorrect and correct behaviors of GNU make.
For more details on the incorrect behavior, see:
http://lists.gnu.org/archive/html/bug-make/2006-03/msg00003.html
Changes in this patch:
- Keep all targets that are to be marked .PHONY in a variable, PHONY.
- Add .PHONY: $(PHONY) to mark them properly.
- Remove any $(PHONY) files from the $? list when determining whether
targets are up-to-date or not.
Signed-off-by: Paul Smith <psmith@gnu.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
|
Kbuild.include is a placeholder for definitions originally present in
both the top-level Makefile and scripts/Makefile.build.
There were a slight difference in the filechk definition, so the most videly
used version was kept and usr/Makefile was adopted for this syntax.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
|
|
When an external module is being built in down in a directory structure
keep the relative directory when installing the module.
Example:
fs/ contains a Makefile used to build both modules:
obj-y := myfs/ oldfs/
Install directories
fs/myfs/myfs.ko => Will be installed in /lib/modules/<version>/extra/fs/myfs/
fs/oldfs/oldfs.o => Will be installed in /lib/modules/<version>/extra/fs/oldfs/
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
|
Currently, a ``make modules_install'' for an external module will
install that module into /lib/modules/$(uname -r)/extra. Allow to
override this default by specifying INSTALL_MOD_DIR.
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
|
modules_install failed for modules with 'ko' in their name.
Fixes this.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
|
Additional Makefile fixes for Solaris 2.8
On Solaris, 'head' doesn't take a -q argument. But we can use 'grep -h'
instead, so do that in Makefile.mod{inst,post}. The built-in test to
/bin/sh doesn't like 'if ! cmd' syntax, so when determining if we need
to do modversion stuff, invert the if/else cases. The built-in test
also doesn't understand -ef, so invoke a real version of test which does.
Signed-off-by: Tom Rini <trini@kernel.crashing.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
|
Process modules in sorted order during modpost and modules install.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Consolidate rules for installing internal and external modules.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
From: Sam Ravnborg <sam@ravnborg.org>
When building external modules the $PWD/.tmp_versions directory is used.
The .tmp_versions directory in the kernel tree cannot be used because this
would clutter up the kernel tree especially when more than one external
module is being build for the same kernel tree.
This patch make sure to create $PWD/.tmp_versions, and to delete it during
make clean. It also removes warning about 'messed with SUBDIRS', this is
no longer relevant when .tmp_versions is made outside the kernel tree.
|
|
From: Rusty Russell <rusty@au1.ibm.com>
The way it works is that the .mod file contains the name of the module (as
before), but succeeding lines are the constituent parts (assumed to be .c
files, which usually works: if they use MODULE_VERSION in a file for which
this isn't true we'll get a warning).
As we postprocess modules, we look in the .modinfo section for a
"version=", which is placed by the MODULE_VERSION() macro. This will be of
form "version=<macroarg>" "\0" [24 chars] "\0". The 24 chars are replaced
by the md4 sum of the .c files and any files they #include using '#include
"file"' which are found in the current directory. Whitespace is collapsed
outside strings, and comments are ignored for purposes of the sum.
The result is a .modinfo entry such as
version=1.16ac-rustytest B13E9451C4CA3B89577DEFF
At the kernel summit, various people asked for a MODULE_VERSION macro to
store module strings (for later access through sysfs). A simple md4 is
needed to identify changes in modules which, inevitably, do not update the
version. It skips whitespace and comments, and includes #includes which
are in the same dir.
The module versions should be set according to this definition, based on
the RPM one, or CVS Revision tags. Violators will be shot.
[<epoch>`:']<version>[`-'<extraversion>]
<epoch>: A (small) unsigned integer which allows you to start versions
anew. If not mentioned, it's zero. eg. "2:1.0" is after
"1:2.0".
<version>: The <version> may contain only alphanumerics.
<extraversion>: Like <version>, but inserted for local
customizations, eg "rh3" or "rusty1".
Comparison of two versions (assuming same epoch):
Split each into all-digit and all-alphabetical parts. Compare each one one
at a time: digit parts numerically, alphabetical in ASCII order. So 0.10
comes after 0.9.
|
|
|
|
I fixed scripts/Makefile.modpost to handle CONFIG_MODULES but no modules
selected, but forgot scripts/Makefile.modinst
(pointed out by akpm)
|
|
Since we rely on our list of all modules for building anyway, we
can as well use it to install the modules. So we don't need to
descend in that step anymore, speeding it up, though it's not
a particularly performance-critical area.
|
|
module-init-tools 0.9 and newer supply a replacement depmod, so
it's safe to run again.
Also, some external programs like PCMCIA and mkinitrd really want the
directory hierarchy in /lib/modules back again: it makes no difference
to the tools (since 0.9), so revert it.
|
|
|
|
This is an implementation of the in-kernel module loader extending
the try_inc_mod_count() primitive and making its use compulsory.
This has the benifit of simplicity, and similarity to the existing
scheme. To reduce the cost of the constant increments and
decrements, reference counters are lockless and per-cpu.
Eliminated (coming in following patches):
o Modversions
o Module parameters
o kallsyms
o EXPORT_SYMBOL_GPL and MODULE_LICENCE checks
o DEVICE_TABLE support.
New features:
o Typesafe symbol_get/symbol_put
o Single "insert this module" syscall interface allows trivial userspace.
o Raceless loading and unloading
You will need the trivial replacement module utilities from:
http://ozlabs.org/~rusty/module-init-tools-0.6.tar.gz
|
|
Most definitions required were present in Makefile.lib, so delete the
definitions and include Makefile.lib.
|
|
o Deleted subdir-n and subdir- handling in Makefile.build
o Deleted all host-progs related stuff in Makfile.modver
o In Makefile.modver also deleted everything related to composite objects
o Fixed an error when deleting a .ver file + .hdepend and then do make
- filter-out in Makefile.modver was faulty
|
|
Use the same way we came up with for "make clean" for
"make modules_install", gaining a nice speed-up.
Also, some cosmetics for scripts/Makefile.clean
|
|
Rules.make is used in 4 phases,
o generate modversions
o build
o install modules
o clean
split out the code specific to the phase and move it into
scripts/Makefile.<phase>
|