aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-11-20insmod: fix wron fallthrough of -fMarc-Antoine Perennou
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2015-11-17kmod 22Lucas De Marchi
2015-10-25insmod: do support -fPhilippe De Swert
The -f switch is accepted by insmod, but silently ignored. This causes the user to wonder why things don't work. As insmod is most often used with "evil" modules, -f is almost default and thus needs to work. Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
2015-09-30libkmod: export new kmod_get_dirname() functionLucas De Marchi
Make sure it gets exported and add documentation.
2015-09-30depmod: Don't fall back to uname on bad versionLaura Abbott
Currently, if a value that doesn't match a kernel version ("%u.%u") is passed in, depmod silently falls back to using uname. Rather than try and work around the caller passing bad data, just exit out instead.
2015-09-30depmod: Remove unprinted debug messagesLaura Abbott
In between the start of the program and the call to log_setup_kmod_log, the only messages that will be printed are the ones at or above the global default level. Debug messages in this range will never be printed so remove them.
2015-09-30Change default log levelLaura Abbott
The default log level is currently LOG_ERR. Tools can override this default but there is a non-trivial amount of setup that needs to happen before the log level can be changed. Since tools may want to use the warn level for things such as deprecated flags, change the default to LOG_WARNING to ensure messages get printed.
2015-09-30modprobe: Update error message when path is missingLaura Abbott
Currently, modprobe fails with no output by default if the search paths it tries are missing: $ modprobe -S notakernel dm-crypt $ $ modprobe -S notakernel lkjjweiojo $ This is fairly cryptic and not at all obvious there is a problem unless the error code is checked or verbose flags are used. Update the error message to indicate a problem and print out the directory that failed.
2015-09-30README: Indicate cython requirementsLaura Abbott
The recommended flags require cython be installed to compile successfully. Note this in the documentation.
2015-06-22build: let sed use posix ERE instead of GNU extensionNatanael Copa
Use POSIX Extended Regular Expression (ERE) instead of the GNU extension \| in the install-exec-hook. This makes it create the symlink properly with busybox sed built with musl libc. It will silently create a broken symlink otherwise. Lucas De Marchi: fix up added newline.
2015-06-13libkmod-module: fix return code in error pathLucas De Marchi
ENOSYS is the wrong errno to return when we don't find a module in kmod_module_insert_module(). Why is it there in the first place? This goes back to kmod v1 when we couldn't load modules by names, but we should give a path instead. 708624a ("ELF: initial support for modinfo and strip of modversions and vermagic.") changed that so we do a lazy-search by the module path in this function. Later f304afe ("Change error message to reflect reality") fixed the log message but the return coded remained the same.
2015-06-11Add README.md file with build detailsLucas De Marchi
Add the badges from semaphoreci and coverity and point people to the README file with more information.
2015-06-09kmod 21Lucas De Marchi
2015-06-09build: add cache to distributed filesLucas De Marchi
We were missing the cache directory on the distributed files.
2015-06-09build: silence stderr on coverity rulesLucas De Marchi
We try to execute git in order to get the dependencies for the coverity rules. And it gets executed even when we are not calling that specific rule. Later we may want to improve it, but for now let's just silence the errors of not being a git repository when executing this on a packaged version.
2015-06-08kmod: fix small typo in rmmod(8)Santiago Vila
This is how rmmod(8) looks like: SEE ALSO modprobe(8), insmod(8), lsmod(8)modinfo(8) The attached trivial patch fixes it: SEE ALSO modprobe(8), insmod(8), lsmod(8), modinfo(8)
2015-06-08tools: display features in --versionLucas De Marchi
Reviewed-by: Andreas Mohr <andim2@users.sf.net>
2015-06-08build: add relevant features to KMOD_FEATURES in config.hLucas De Marchi
Not all the features (i.e. those available in --enable-* or --with-*) are really relevant to the final user. Create a KMOD_FEATURES definition in config.h containing these features. Reviewed-by: Andreas Mohr <andim2@users.sf.net>
2015-06-08build: add function to build string of featuresLucas De Marchi
Add a CC_FEATURE_APPEND function that we can use to append the features that are enabled/disabled. This will generate a single string in the form "+FEATURE1 +FEATURE2 -FEATURE3". Reviewed-by: Andreas Mohr <andim2@users.sf.net>
2015-06-08tools: add PACKAGE definition in messageLucas De Marchi
Reported-by: Andreas Mohr <andim2@users.sf.net>
2015-06-06tools: Hide new commands behind experimental flagLucas De Marchi
Hide the commands behind a flag so we can continue doing releases while the commands aren't ready.
2015-05-31build: cache modules from playgroundLucas De Marchi
Now that we are able to build our own test modules, also allow to use cached modules so a) kernel headers are not required and b) distro maintainers are happy. It's still need a "--disable-test-modules" in the configure since the default is enabled. There's no license problems anymore since all modules come from our own repository, we ship the sources and the modules can be easily rebuilt.
2015-04-16Fix spurious spaces in lsmod outputSantiago Vila
While using "localyesconfig" to build a custom kernel I noticed that lsmod output now has trailing spaces when the list of "Used by" modules is empty. The following patch just delays the space to the point where we are sure that there are more things to print.
2015-03-23util: use UINT64_MAXLucas De Marchi
Since we are checking the size of long and long long, use UINT64_MAX in the fallback to be sure thre right size is being used.
2015-03-10build: sync dolt with upstreamLucas De Marchi
2015-03-07tools: add basic versions of insert and removeCaio Marcelo de Oliveira Filho
2015-03-05testsuite: update READMECaio Marcelo de Oliveira Filho
2015-03-05testsuite: remove .gitignore files when populating rootfsCaio Marcelo de Oliveira Filho
Usually this file is added to keep a directory existing in the repository but without any real content. In rootfs this can be problematic if a directory will have all its files inspected. This happens for kmod_module_get_holders(). Side-note: the 'test-loaded.c' is hit by this problem but doesn't "notice" because the invalid module returned by get_holders() is not checked. The modules in its loop are only used to get the name and generate an output, and NULL was a valid value to generate the name.
2015-03-05build: use doltLucas De Marchi
Drop-in replacement to libtool: http://dolt.freedesktop.org/. More details: http://marc.info/?l=freedesktop-xorg&m=120791871615872&w=3 kmod is relatively fast to compile, so it doesn't matter much. Nonetheless, less forks the better. Compilation time using ./bootstrap-configure --disable-manpages and make -j4 libtool real 0m6.453s user 0m21.067s sys 0m0.773s dolt real 0m4.792s user 0m15.920s sys 0m0.637s
2015-03-01kmod 20Lucas De Marchi
2015-03-01Update TODOLucas De Marchi
2015-02-28Check return of fseek while reading indexLucas De Marchi
2015-02-28Avoid sign-extension error on multiplicationLucas De Marchi
Do not promote "idx * elf->header.section.entry_size" to int. Explicitly cast the result to uint64_t so it's zero-extended.
2015-02-28depmod: add asserts to ensure positive return from ftell()Lucas De Marchi
Also ignore some errors that will later be returned by ferror().
2015-02-28testsuite: add test for modprobe -R <builtin-module>Lucas De Marchi
2015-02-28modprobe: stop checking initstate for builtin modulesLucas De Marchi
builtin modules are handled in libkmod by looking at the modules.builtin index. There's no need to check again for the module's initstate to decide if it's builtin.
2015-02-28testsuite: test builtin stateLucas De Marchi
The second test, that creates the module by name and then retrieves the initstate was broken before b95fa91 ('Fix race while loading modules'). We would check /sys and return either builtin (if the module has parameters) or give an error because we don't find the module (even if it's in the modules.builtin index)
2015-02-28Fix race while loading modulesHarish Jenny K N
usecase: two sd cards are being mounted in parallel at same time on dual core. example modules which are getting loaded is nls_cp437. While one module is being loaded , it starts creating sysfs files. meanwhile on other core, modprobe might return saying the module is KMOD_MODULE_BUILTIN, which might result in not mounting sd card. Experiments done to prove the issue in kmod. Added sleep in kernel module.c at the place of creation of sysfs files. Then tried `modprobe nls_cp437` from two different shells. While the first was still waiting for its completion , the second one returned saying the module is built-in. [ Lucas: The problem is that the creation of /sys/module/<name> and /sys/module/<name>/initstate are not atomic. There's a small window in which the directory exists but the initstate file was still not created. Built-in modules can be handled by searching the modules.builtin file. We actually lose some "modules" that create entries in /sys/modules (e.g. vt) and are not in modules.builtin file: only those that can be compiled as module are present in this file. We enforce mod->builtin to always be up-to-date when kmod_module_get_initstate() is called. This way if the directory exists but the initstate doesn't, we can be sure this is because the module is in the "coming" state, i.e. kernel didn't create the file yet, but since builtin modules were already handled by checking our index the only reason for that to happen is that we hit the race condition. I also added some tweaks to the patch, so we don't repeat the code for builtin lookup. ]
2015-02-27build: we are kmod, not systemdLucas De Marchi
Fix copy and paste mistake.
2015-02-26shared: avoid checking for __STDC_VERSION__Lucas De Marchi
Since we pass -std=gnu99 to the compiler __STDC_VERSION__ is defined to 199901. Even in this case we can use _Noreturn. Delegate the testing to the configure phase with a compile test. In future we want to stop using AC_PROG_CC_99 and start using the new AC_PROG_CC from autoconf 2.70, which tries to choose the most recent standard.
2015-02-26build: simplify and organize configureLucas De Marchi
- There's no need for the various AC_PROG_CC* macros - No need for AC_C_BIGENDIAN: the only place we care about endianness, we use __BYTE_ORDER - Organize calls to be in similar order as systemd - Disable --disable-largefile. We already had possible bugs in the index implementation if this were passed. It's now fixed, but it's never tested. Disable it. - Bump autoconf requirement to 2.64
2015-02-26depmod: fix leak in case of malloc(0)Lucas De Marchi
malloc(0) can return != NULL. We need to pass the pointer to free(). This happens if index__haschildren(node) returned true, but child_count is set to 0.
2015-02-25build: add helpers to upload coverity tarballLucas De Marchi
2015-02-25depmod: use cleanup attribute to simplify free on exitLucas De Marchi
Reusing the root variable was a bad idea. Doing so we could call free() on a variable that was not allocated. For example: "depmod -b / -h". Since we would jump to cmdline_failed, root would not be duplicated. Instead of fighting the order in the options, just used the cleanup attribute and remove the calls to free() on "config_paths" and "root".
2015-02-25depmod: Fix crash in previous commit if root is not setColin Walters
[This fixes http://build.gnome.org/continuous/buildmaster/builds/2015/02/25/31/build/output.txt ] The variable we're reading here is "root", not "optarg" which is only valid inside the getopt call.
2015-02-25depmod: fix leaking root on exitLucas De Marchi
2015-02-24from systemd: build: make sure to test for -Wflag instead of -Wno-flagDavid Herrmann
gcc does not support testing for negated warnings. See here for details: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63499 This patch changes CC_CHECK_FLAG_APPEND to always test for the non-negated warnings.
2015-02-24from systemd: build-sys: fix conftest.c to work on armZbigniew Jędrzejewski-Szmek
All tests for compiler support were failing with: /usr/bin/ld: /tmp/ccwnVc2A.o: relocation R_ARM_MOVW_ABS_NC against `a' can not be used when making a shared object; recompile with -fPIC
2015-02-24from systemd: build: check for build/link flags harderDavid Herrmann
Use AC_LINK_IFELSE instead of AC_COMPILE_IFELSE to test for flags that might succeed during compilation but not during linking. An example is gcc compiled with libssp support but gnu-ld without it. In this case -fstack-protector works fine during compilation but fails during linking as several internal helpers are missing.
2015-02-24from systemd: build: merge trivial changes backLucas De Marchi
These were trivial changes applied to systemd tree since the files were synchronized: - change some comments - replace tab with space - fix typo