Commit Graph

487 Commits

Author SHA1 Message Date
Andy Grover
57a8efdf92 python: update version to 0.9.1 2014-03-25 00:34:16 -03:00
Guy Rozendorn
17b69ada6f python: Issue #13 skipping building extensions on non-Linux platforms 2014-03-25 00:34:16 -03:00
Andy Grover
e4a57f6828 python: Make kmod.modprobe() raise an error if no modules found
Add 'quiet' option to override.

Add docstring.
2014-03-25 00:34:16 -03:00
Andy Grover
891e0756e7 python: Add self as maintainer to setup.py 2014-03-25 00:34:16 -03:00
Andy Grover
8e73a86d6e python: Correct building for python 2.6
Reported-by: Oz Nahum Tiram <nahumoz@gmail.com>
2014-03-25 00:34:16 -03:00
Oz
f0d6f3701a python: add docstring to insert and remove methods 2014-03-25 00:34:16 -03:00
Oz
240c0f4694 python: add docstring to rmmod 2014-03-25 00:34:16 -03:00
Andy Grover
b32900f4e8 python: update version to 0.9 2014-03-25 00:34:16 -03:00
Andy Grover
9ebfb9c198 python: Update README
Last update changed API slightly:
* loaded_modules renamed to modules
* returns a module object instead of (name, size)
2014-03-25 00:34:16 -03:00
W. Trevor King
26105c168f python: MANIFEST.in: add AUTHORS to distibuted source files. 2014-03-25 00:34:16 -03:00
W. Trevor King
c8b5c51ed6 python: Ran update-copyright.py. 2014-03-25 00:34:16 -03:00
W. Trevor King
64f9a6a630 python: .update-copyright.conf: update to pipe separators.
This brings the config file up to speed with the following
update-copyright commit:

  commit 3c68a1a48419d8b2bbc2ce0e7f1700b996ec30e9
  Author: W. Trevor King <wking@tremily.us>
  Date:   Fri Oct 19 21:52:48 2012 -0400

    project: for consistency, also separate ignored paths with pipes.
2014-03-25 00:34:16 -03:00
W. Trevor King
8e8e24bcbd python: .update-copyright.conf: add MANIFEST.in to ignored files. 2014-03-25 00:34:16 -03:00
W. Trevor King
ac24814360 python: .update-copyright.conf: add Red Hat alias for Andy Grover.
He seems to be assigning copyright of files he writes to Red Hat.
Avoiding .mailmap so the git log will still attribute changes to him.
I'm not sure which name should go in the AUTHORS file.
2014-03-25 00:34:16 -03:00
W. Trevor King
5a39a9d988 python: .update-copyright.conf: add README.rst to ignored files. 2014-03-25 00:34:16 -03:00
W. Trevor King
3c65e333f7 python: .mailmap: consolidate Andy Grover email addresses. 2014-03-25 00:34:15 -03:00
W. Trevor King
6745a4a7da python: .update-copyright.conf: add copyright configuration.
Use my external update-copyright package to maintain copyright blurbs.

http://pypi.python.org/pypi/update-copyright/
2014-03-25 00:34:15 -03:00
W. Trevor King
0a2fab2b32 python: module: fix versions -> info typo in Module._info_get() error message. 2014-03-25 00:34:15 -03:00
W. Trevor King
d9c0c63eb7 python: Initialize Kmod.mod_dir to None in __cinit__(). 2014-03-25 00:34:15 -03:00
W. Trevor King
caee9c10c5 python: Use an OrderedDict for Module.info (preserving modinfo ordering). 2014-03-25 00:34:15 -03:00
W. Trevor King
81c1a4e840 python: Add Module.info attribute. 2014-03-25 00:34:15 -03:00
W. Trevor King
e0ff45a048 python: Use Cython's libc.errno for EEXIST. 2014-03-25 00:34:15 -03:00
W. Trevor King
0dd3047efb python: Add Module.versions attribute. 2014-03-25 00:34:15 -03:00
W. Trevor King
76d34f40e1 python: README.rst: add .rst symlink for GitHub. 2014-03-25 00:34:15 -03:00
W. Trevor King
161576d420 python: README: mention Cython dependency. 2014-03-25 00:34:15 -03:00
W. Trevor King
028fc127b6 python: README: cleanup reStructuredText syntax. 2014-03-25 00:34:15 -03:00
W. Trevor King
075f4ea0e2 python: Add missing copyright blurbs. 2014-03-25 00:34:15 -03:00
W. Trevor King
c737198936 python: Add docstrings to kmod.kmod and kmod.kmod.Kmod. 2014-03-25 00:34:15 -03:00
W. Trevor King
3cc8a66078 python: MANIFEST.in: add missing source to the sdist tarball. 2014-03-25 00:34:15 -03:00
W. Trevor King
113b46bc1e python: Add additional out Module attributes (path, refcnt, ...). 2014-03-25 00:34:15 -03:00
W. Trevor King
f7c62154ec python: Convert to Cython.
With Cython we get easier memory handling and Python 3 compatibility.
2014-03-25 00:34:15 -03:00
Andy Grover
cd4df5accd python: update FSF address in COPYING and COPYING.LESSER
Please FSF, never move again.
2014-03-25 00:34:15 -03:00
Andy Grover
6cdc22b36b python: whitespace 2014-03-25 00:34:15 -03:00
Andy Grover
705187f17b python: add proper error handling to loaded_modules()
We need to check the result of basically all Py* calls and cleanup
properly if they fail.
2014-03-25 00:34:14 -03:00
Andy Grover
31aa6834ba python: Improve README's description of kmod
Based on text from kmod's README.
2014-03-25 00:34:14 -03:00
Andy Grover
c73ffc51e5 python: Make setup.py version match version in .c 2014-03-25 00:34:14 -03:00
Andy Grover
3aa27ba988 python: Add README 2014-03-25 00:34:14 -03:00
Andy Grover
8a4d09336e python: More cleanup and renaming of stuff. Add docstrings. 2014-03-25 00:34:14 -03:00
Andy Grover
1e688f86a7 python: Add support for listing loaded modules, modprobe, rmmod
And other misc. cleanups and changes.
2014-03-25 00:34:14 -03:00
Andy Grover
d2042ca0c7 python: use c99 init for struct init
move casts of pyobject -> kmodobject to the functions from the struct
init.
2014-03-25 00:34:14 -03:00
Andy Grover
a942131e7b python: a skeleton that compiles 2014-03-25 00:34:14 -03:00
Andy Grover
cc688e6722 python: initial checkin 2014-03-25 00:34:14 -03:00
Lucas De Marchi
f87dc57a71 libkmod: Fix unaligned access
From Jan Engelhardt:

	Program received signal SIGBUS, Bus error.
	[Switching to process 11100]
	0x00035278 in kmod_module_signature_info (file=0x4eeb8, sig_info=0xffffc254)
	    at libkmod/libkmod-signature.c:124
	124             sig_len = be32toh(modsig->sig_len);
	(gdb) p modsig
	$1 = (const struct module_signature *) 0xf7dfe143

modsig->sig_len can be unaligned if modsig is unaligned, so the padding
in the struct has no effect since we are mapping it to the mem buffer.
2014-03-24 23:47:31 -03:00
Lucas De Marchi
fea655dcb3 libkmod-elf: Fix check by class in get_modversions()
Commit 51c409b ("Cache the offset of crc") unintentinally changed the
comparison "if (elf->class & KMOD_ELF_32)" to
"if (elf->class == KMOD_ELF_32)".

This has been reported by Serge Voilokov <serge0x76@gmail.com>:

	On Raspberry PI elf->class equals KMOD_ELF_32|KMOD_ELF_LSB so
	valid condition should be (elf->class & KMOD_ELF_32) instead of
	(elf->class == KMOD_ELF_32).

This fixes "modprobe --dump-modversions" failing on 32b systems.
2014-03-07 01:24:39 -03:00
Lucas De Marchi
06eb29e117 build-sys: add small redirecting Makefiles
These redirecting makefiles simplifies compiling from some editors and
when CWD is not the root of the source tree. This is similar to what was
introduced in systemd in 340d89e ("build-sys: add small redirecting
Makefiles to simplify compilation from within emacs")
2014-03-06 01:59:58 -03:00
Michal Marek
aa878540e6 libkmod-config: Only match dot before '=' in /proc/cmdline
Otherwise, we also parse strings like

  BOOT_IMAGE=/boot/vmlinuz-3.12.12-57.g5f654cf-default

In practice, this is not a problem, because there is no module named
BOOT_IMAGE=/boot/vmlinuz-3. It just disturbs in modprobe -c output.
2014-03-05 12:30:52 -03:00
Michal Marek
519d27de5a libkmod-config,depmod: Accept special files as configuration files, too
If we can open it and read it, it's good enough for us. Otherwise, we
cannot use -C /dev/null to skip the system configuration for instance:

$ ./tools/modprobe -C /dev/null -c
libkmod: ERROR libkmod/libkmod-config.c:821 conf_files_list: unsupported
file mode /dev/null: 0x21b6
...
2014-03-05 12:27:24 -03:00
Michal Marek
c2f4d85a9a libkmod-module: Simplify kmod_module_insert_module()
Store the file and elf pointer in the kmod_module structure and have it
freed together with the module.
2014-03-05 12:22:37 -03:00
Lucas De Marchi
366e2ed791 Remove duplicate includes
Found by
https://raw.github.com/karelzak/util-linux/master/tools/checkincludes.pl
2014-01-21 14:03:02 -02:00
Lucas De Marchi
d96ca9c429 Use C11's noreturn
Also define noreturn w/o <stdnoreturn.h> and move it to macro.h instead
of in the testsuite.

Based on similar commit on systemd by Shawn Landden
<shawn@churchofgit.com>.
2013-12-17 19:10:16 -02:00