platform/upstream/kmod.git
21 months agoAdd /lib/modules/modprobe.d to configuration search path accepted/tizen_7.0_base accepted/tizen_7.0_base_hotfix accepted/tizen_8.0_base accepted/tizen_base_dev old/tizen_base-20231107 tizen_7.0_base tizen_7.0_base_hotfix tizen_8.0_base accepted/tizen/7.0/base/20221116.025857 accepted/tizen/7.0/base/hotfix/20221116.055306 accepted/tizen/8.0/base/20231005.044822 accepted/tizen/base/20220803.043309 accepted/tizen/base/20220804.052410 accepted/tizen/base/20221115.103734 accepted/tizen/base/dev/20230602.080819 submit/tizen_base/20220802.051611 tizen_7.0_m2_release tizen_8.0_m2_release
Karol Lewandowski [Thu, 8 Jul 2021 10:35:38 +0000 (12:35 +0200)]
Add /lib/modules/modprobe.d to configuration search path

This commit adds additional tizen-specific /lib/modules/modprobe.d
to kmod search path to allow for packages providing modules to also
provide its configuration.

In Tizen kernel and modules images are build separately from "platform"
image, meaning only limited paths can be used (/lib/modules, /hal) for
its files to be accessible from the system.

Change-Id: I6985339abd1234aecfb5802484bd57f36a64bab2
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
21 months agoadd packaging for kmod
Seung-Woo Kim [Mon, 24 Feb 2020 00:51:57 +0000 (09:51 +0900)]
add packaging for kmod

Add kmod v30 package to Tizen for supporting program to manage
Linux Kernel modules.

Note: Change history for previous Tizen package release is below:

kmod is packaged into Tizen with manifest domain of floor.
v15 is a required dependency for systemd v208 (see TIVI-2197).

Bump to v18 using upstream git repo instead of pristin-tar.
Bug-Tizen: TC-1921

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Alexandru Cornea <alexandru.cornea@intel.com>
Signed-off-by: Patrick McCarty <patrick.mccarty@linux.intel.com>
Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>
Applied ASLR (CFLAG=-fPIE LDFLAG=-pie) and license file wsa added to
/usr/share/licenses/kmod-compat and /usr/share/licneses/libkmod.

All packaging modifications are squashed into one commit and
bump to v24.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
[yj99.shin@samsung.com: packaging : disable %check section
  Currently, all tizen OBS projects don't run the %check section.
  I think the %check section is very good for reinforcing unit tests.
  But, there are some hurdles because of the qemu.
  For starting of enabling the %check section, I disable the %check section in the failed packages.]
Change-Id: Icdbea83b1625446abe492625ee424f25e377c476
Signed-off-by: Youngjae Shin <yj99.shin@samsung.com>
[sw0312.kim: Add kmod v29 package to Tizen 7.0 M1
  bump version to v27 for Tizen 6.5
  packaging: remove not really necessary kmod own includedir
  bump version to v27 for Tizen 6.0
  packaging: add -Wno-maybe-uninitialized to cflags and bump to v26
    The GCC has false positive warning about maybe-uninitialized with
    -O2 and -fexeceptions. Add -Wno-maybe-uninitialized to cflags to
    remove the false positive warnings.
]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
22 months agomodprobe: Write error messages to syslog if stderr is unavailable
Quentin Armitage [Fri, 19 Nov 2021 18:33:49 +0000 (18:33 +0000)]
modprobe: Write error messages to syslog if stderr is unavailable

The man page modprobe(8) states for the --syslog option:
"This is also automatically enabled when stderr is unavailable."
but it wasn't happening.

This commit now makes modprobe write to syslog if stderr is closed.

22 months agobuild: enable building & running tests from a subdir
Dimitri John Ledkov [Thu, 24 Jun 2021 13:53:56 +0000 (14:53 +0100)]
build: enable building & running tests from a subdir

During dpkg build, in a subdir, it is currently not possible to run
tests. Building testsuite/modules due to non-existance of the
testsuite directory under the build dir. Thus create it, when it is
not there.

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
22 months agotestsuite: repair read of uninitialized memory
Jan Engelhardt [Thu, 30 Jun 2022 16:47:25 +0000 (18:47 +0200)]
testsuite: repair read of uninitialized memory

Function ``test_backoff_time`` does not initialize ``delta``, and
``get_backoff_delta_msec`` then performs a read from uninitialized
memory with the ``!*delta`` expression.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
22 months agokmod 30 v30
Lucas De Marchi [Thu, 30 Jun 2022 15:19:17 +0000 (08:19 -0700)]
kmod 30

22 months agolibkmod: Support SM3 hash algorithm
HuaxinLu [Thu, 30 Jun 2022 06:36:05 +0000 (14:36 +0800)]
libkmod: Support SM3 hash algorithm

SM3 has been supported in kernel and cryptographic libraries like openssl.
This patch adds support for the SM3 algorithm of kmod.

Signed-off-by: HuaxinLu <luhuaxin1@huawei.com>
22 months agoREADME: Update optional dependencies
Lucas De Marchi [Wed, 29 Jun 2022 05:24:41 +0000 (22:24 -0700)]
README: Update optional dependencies

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
22 months agoKeep only one readme
Lucas De Marchi [Wed, 29 Jun 2022 05:23:34 +0000 (22:23 -0700)]
Keep only one readme

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
22 months agomodprobe: Add --wait
Lucas De Marchi [Fri, 3 Jun 2022 21:50:47 +0000 (14:50 -0700)]
modprobe: Add --wait

Retry module removal if it fails due to EAGAIN. This allows user to pass
--wait <timeout>, during which `modprobe -r` will keep trying to remove
the module.

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
22 months agotestsuite: Add tests for sleep calculation
Lucas De Marchi [Fri, 3 Jun 2022 21:50:46 +0000 (14:50 -0700)]
testsuite: Add tests for sleep calculation

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
22 months agoutil: Add exponential backoff sleep
Lucas De Marchi [Fri, 3 Jun 2022 21:50:45 +0000 (14:50 -0700)]
util: Add exponential backoff sleep

Add simple functions to put the current thread to sleep using
exponential backoff to split the interval in smaller pieces.

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
22 months agoutil: Add msec variants for time-related functions
Lucas De Marchi [Fri, 3 Jun 2022 21:50:44 +0000 (14:50 -0700)]
util: Add msec variants for time-related functions

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
22 months agoutil: Add time-related functions from testsuite
Lucas De Marchi [Fri, 3 Jun 2022 21:50:43 +0000 (14:50 -0700)]
util: Add time-related functions from testsuite

This will be useful in future not only to testsuite, but also to tools
and library.

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
22 months agomodule-playground: Add debugfs entry in mod-simple
Lucas De Marchi [Fri, 3 Jun 2022 21:50:42 +0000 (14:50 -0700)]
module-playground: Add debugfs entry in mod-simple

Add a debugfs file in mod-simple for manual tests: insert the module and
open the file to have its refcount increased.

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
22 months agolibkmod: Allow to ignore log message on module removal
Lucas De Marchi [Fri, 3 Jun 2022 21:50:41 +0000 (14:50 -0700)]
libkmod: Allow to ignore log message on module removal

Caller may want to handle retries, in which case the log message is not
appropriate.

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
22 months agomodprobe: Move -R to "Query options"
Lucas De Marchi [Fri, 3 Jun 2022 21:50:40 +0000 (14:50 -0700)]
modprobe: Move -R to "Query options"

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
22 months agomodprobe: re-use modname variable
Lucas De Marchi [Fri, 3 Jun 2022 20:49:02 +0000 (13:49 -0700)]
modprobe: re-use modname variable

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
22 months agodepmod: Fix writing over array length
Lucas De Marchi [Fri, 3 Jun 2022 20:49:01 +0000 (13:49 -0700)]
depmod: Fix writing over array length

Make sure return value in flush_stream_to() is the length written
if the value didn't the size. Fix warning on gcc 12.1:

tools/depmod.c: In function ‘output_builtin_alias_bin’:
tools/depmod.c:2465:24: warning: array subscript 4096 is above array bounds of ‘char[4096]’ [-Warray-bounds]
 2465 |                 modname[len] = '\0';
      |                 ~~~~~~~^~~~~
tools/depmod.c:2460:22: note: while referencing ‘modname’
 2460 |                 char modname[PATH_MAX];
      |                      ^~~~~~~
tools/depmod.c:2477:22: warning: array subscript 4096 is above array bounds of ‘char[4096]’ [-Warray-bounds]
 2477 |                 value[len] = '\0';
      |                 ~~~~~^~~~~
tools/depmod.c:2461:22: note: while referencing ‘value’
 2461 |                 char value[PATH_MAX];
      |                      ^~~~~

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
2 years agomodprobe: Make rmmod_do_module() contain all the removal sequence
Lucas De Marchi [Tue, 29 Mar 2022 09:05:40 +0000 (02:05 -0700)]
modprobe: Make rmmod_do_module() contain all the removal sequence

Move the remaining part of the removal sequence dangling in
rmmod_do_remove_module() to rmmod_do_module() so we can consider this
function is the one controlling all the module removals.

While at it, add some comments about the removal order and normalize
coding style in this function.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
2 years agomodprobe: move check for remove_holders to caller
Lucas De Marchi [Tue, 29 Mar 2022 09:05:39 +0000 (02:05 -0700)]
modprobe: move check for remove_holders to caller

Do not mix the flags with and additional boolean from arguments.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
2 years agomodprobe: Fix holders removal
Lucas De Marchi [Tue, 29 Mar 2022 09:05:37 +0000 (02:05 -0700)]
modprobe: Fix holders removal

The idea behind --remove-dependencies was to remove other modules that
depend on the current module being removed. It's the reverse
dependency list, not the dependency list of the current module: that
never works since the current module would still hold a ref on it.

Fix it by replacing the call to kmod_module_get_dependencies() with
kmod_module_get_holders() when using that option. Also try to cleanup
the confusion by renaming the option to --remove-holders: "holder" is
the name used in sysfs and by libkmod to refer to a "live" reverse
dependency like what we are interested in.

Before:
./tools/modprobe -D -r --remove-dependencies video
rmmod video

After:
./tools/modprobe -D -r --remove-holders video
rmmod i915
rmmod thinkpad_acpi
rmmod video

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
2 years agomodprobe: remove unneeded variable str_start
Masahiro Yamada [Thu, 10 Feb 2022 02:14:23 +0000 (11:14 +0900)]
modprobe: remove unneeded variable str_start

The variable 'str_start' is not useful here.

Replace it with 'str'.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
2 years agomodprobe: fix the NULL-termination of new_argv
Masahiro Yamada [Thu, 10 Feb 2022 02:14:22 +0000 (11:14 +0900)]
modprobe: fix the NULL-termination of new_argv

The number of new arguments is (i + argc - 1) as it is set to *p_argc
one line below.

The correct location of NULL termination is new_argv[i + argc - 1].

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
2 years agodepmod: Add support for excluding a directory
Saul Wold [Thu, 31 Mar 2022 21:56:28 +0000 (14:56 -0700)]
depmod: Add support for excluding a directory

This adds support to depmod to enable a new exclude directive in
the depmod.d/*.conf configuration file. Currently depmod
already excludes directories named source or build. This change
will allow additional directories like .debug to be excluded also
via a new exclude directive.

depmod.d/exclude.conf example:
exclude .debug

Signed-off-by: Saul Wold <saul.wold@windriver.com>
[ Fix warnings and make should_exclude_dir() return bool ]
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
2 years agomodprobe: Rename rmmod_do_deps_list
Lucas De Marchi [Tue, 29 Mar 2022 06:55:03 +0000 (23:55 -0700)]
modprobe: Rename rmmod_do_deps_list

It's used not only for dependencies, but also for pre and post softdep.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
2 years agodocs: Add missing functions to documentation
Lucas De Marchi [Thu, 3 Mar 2022 08:57:10 +0000 (00:57 -0800)]
docs: Add missing functions to documentation

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
2 years agolibkmod: Fix use of sizeof instead of ARRAY_SIZE
Lucas De Marchi [Wed, 23 Feb 2022 18:19:13 +0000 (10:19 -0800)]
libkmod: Fix use of sizeof instead of ARRAY_SIZE

Link: https://github.com/kmod-project/kmod/issues/12
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
2 years agomodinfo: Allow to force arg as module name
Lucas De Marchi [Wed, 16 Feb 2022 07:36:49 +0000 (23:36 -0800)]
modinfo: Allow to force arg as module name

If the Linux kernel or userspace sets an alias with the same name as a
module, they force the tools to use that. However in some situations it
may be desired to query the module itself. Getting the module
information through modinfo is one such situation. So, add a option to
modinfo to explicitly instruct it to handle the argument as a module
name.

Example, when trying to output information about the crc32 module that
is builtin:

$ modinfo crc32
filename:       /lib/modules/5.15.19-1-MANJARO/kernel/arch/x86/crypto/crc32-pclmul.ko.zst
alias:          crypto-crc32-pclmul
alias:          crc32-pclmul
alias:          crypto-crc32
alias:          crc32
license:        GPL
author:         Alexander Boyko <alexander_boyko@xyratex.com>
srcversion:     B6B2FF9236731E69418A2E5
alias:          cpu:type:x86,ven*fam*mod*:feature:*0081*
depends:
retpoline:      Y
intree:         Y
name:           crc32_pclmul
vermagic:       5.15.19-1-MANJARO SMP preempt mod_unload
sig_id:         PKCS#7
signer:         Build time autogenerated kernel key
sig_key:        77:FB:AA:BD:48:78:A4:C6:56:18:9A:7E:A6:F3:29:3E:C5:6B:E9:37
sig_hashalgo:   sha512
signature:      30:65:02:31:00:B0:D4:49:9D:1D:F1:71:4C:3C:BB:70:B2:3E:46:5D:
38:5A:F1:00:95:FD:7A:96:C4:2C:24:35:A2:1B:0B:A8:1C:29:6F:02:
7A:68:EE:BA:A4:1C:01:4B:86:39:15:3E:66:02:30:7F:7A:66:5E:F2:
2F:98:73:3D:AD:96:66:81:8B:94:6E:F3:3F:44:0F:85:E1:73:3A:9E:
F9:C4:BE:9B:88:02:BD:83:04:B9:2E:72:0B:93:BC:82:B6:A1:1B:6A:
C2:ED:8C
filename:       /lib/modules/5.15.19-1-MANJARO/kernel/crypto/crc32_generic.ko.zst
alias:          crypto-crc32-generic
alias:          crc32-generic
alias:          crypto-crc32
alias:          crc32
license:        GPL
description:    CRC32 calculations wrapper for lib/crc32
author:         Alexander Boyko <alexander_boyko@xyratex.com>
srcversion:     F08036C38DDB06BCD1E6091
depends:
retpoline:      Y
intree:         Y
name:           crc32_generic
vermagic:       5.15.19-1-MANJARO SMP preempt mod_unload
sig_id:         PKCS#7
signer:         Build time autogenerated kernel key
sig_key:        77:FB:AA:BD:48:78:A4:C6:56:18:9A:7E:A6:F3:29:3E:C5:6B:E9:37
sig_hashalgo:   sha512
signature:      30:65:02:31:00:E3:9E:C8:80:15:0E:D7:74:96:B5:25:EA:32:F7:DF:
E9:FC:3C:82:D9:B9:B9:37:C5:20:8D:06:31:02:62:B3:54:E8:DF:F2:
7E:E2:7C:A4:CF:49:17:CB:75:DF:2C:7A:2F:02:30:25:DE:7C:2A:2C:
97:3F:65:16:76:B3:71:FB:62:DB:8F:F3:33:65:77:98:F3:57:ED:D7:
87:78:FF:C2:04:55:70:00:10:63:1E:B2:FE:22:D8:E5:6D:5F:95:4E:
7D:2C:6B

That is because the Linux kernel exports "crc32" as an alias to those modules,
besides being a module itself:

$ grep crc32 /lib/modules/$(uname -r)/modules.builtin
kernel/lib/crc32.ko
$ $ grep "alias crc32 " /lib/modules/$(uname -r)/modules.alias
alias crc32 crc32_pclmul
alias crc32 crc32_generic

With the new -m|--modname option it's possible to query the information about this (builtin)
module explicitly:

$ modinfo --modname crc32
name:           crc32
filename:       (builtin)
license:        GPL
file:           lib/crc32
description:    Various CRC32 calculations
author:         Matt Domsch <Matt_Domsch@dell.com>

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
2 years agomodinfo: Update help message with "modulename"
Lucas De Marchi [Wed, 16 Feb 2022 07:16:33 +0000 (23:16 -0800)]
modinfo: Update help message with "modulename"

man page correctly states the a module name can be used in place of a
file name:

modinfo [-0] [-F field] [-k kernel] [modulename|filename...]

Update the help message accordingly.

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
2 years agolibkmod: Add lookup from module name
Lucas De Marchi [Wed, 16 Feb 2022 07:10:58 +0000 (23:10 -0800)]
libkmod: Add lookup from module name

Slightly different than kmod_module_new_from_lookup(): it doesn't
consider aliases, only module names. This is useful for cases we want to
force a tool to handle something as the module name, without trying to
interpret it as an alias.

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
2 years agolibkmod: Update docs about indexes order
Lucas De Marchi [Wed, 16 Feb 2022 06:47:06 +0000 (22:47 -0800)]
libkmod: Update docs about indexes order

New indexes were created without updating the documentation about the
order in kmod_module_new_from_lookup(). Add them to the documentation.

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
2 years agolibkmod: Add helper function to iterate lookup options
Lucas De Marchi [Wed, 16 Feb 2022 03:12:05 +0000 (19:12 -0800)]
libkmod: Add helper function to iterate lookup options

The CHECK_ERR_AND_FINISH macro with conditional code flow changes has
been a source of bugs. Get rid of it replacing with a helper function
to iterate an array of lookup functions. This helper may also be useful
in future to create different lookup APIs in libkmod.

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
2 years agogitignore: ignore gtk-doc.make
Lucas De Marchi [Wed, 16 Feb 2022 01:28:53 +0000 (17:28 -0800)]
gitignore: ignore gtk-doc.make

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
2 years agolibkmod-module: Fix return code for kmod_module_new_from_lookup()
Lucas De Marchi [Tue, 15 Feb 2022 22:09:14 +0000 (14:09 -0800)]
libkmod-module: Fix return code for kmod_module_new_from_lookup()

When kmod_module_new_from_lookup() resolves to an alias, `err` will be
set to a positive value from the lookup function. Do not return a
positive value to follow the behavior when it matches a module name
and the documentation.

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
2 years agotest-initstate: Check for negative value on error
Lucas De Marchi [Tue, 15 Feb 2022 22:05:13 +0000 (14:05 -0800)]
test-initstate: Check for negative value on error

Documentation says kmod_module_new_from_lookup() returns < 0 on error
and 0 otherwise. There are bugs in libkmod however making it return
a positive value in some situations, that need to be fixed. However
it's best to check for the error explicitly like is done in the rest
of the library to avoid this kind of issues.

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
2 years agodepmod: Stop opening modules.modinfo once per module
Lucas De Marchi [Thu, 10 Feb 2022 02:07:03 +0000 (18:07 -0800)]
depmod: Stop opening modules.modinfo once per module

Since the addition of modules.aliases.bin, depmod has to open that
index multiple times and parse it over and over again:

$ sudo strace -e openat  ./tools/depmod 2>&1 | grep modules.builtin.modinfo  | wc -l
299
$ time sudo  ./tools/depmod
real    0m7.814s
user    0m7.571s
sys     0m0.237s

Rework the logic in depmod so it does everything: open, read and parse. The
format is very straightforward and we don't need to keep it in a data structure
since we only want to add the result to a index. New output:

$ sudo strace -e openat  ./tools/depmod 2>&1 | grep modules.builtin.modinfo  | wc -l
1
$ time sudo  ./tools/depmod
real    0m7.663s
user    0m7.516s
sys     0m0.139s

Indexes still match:

$ cmp /tmp/modules.builtin.alias.bin.new
/tmp/modules.builtin.alias.bin.old; echo $?
0

Fix: https://github.com/kmod-project/kmod/issues/11

2 years agodepmod: Do not duplicate builtin index
Lucas De Marchi [Thu, 10 Feb 2022 02:46:34 +0000 (18:46 -0800)]
depmod: Do not duplicate builtin index

Now that libkmod uses modules.builtin.bin again, we don't need to add
the module names in modules.builtin.alias.bin and just add the aliases.

After this change, here are the new sizes for the indexes:

Before After index
21k 6.4K modules.builtin.alias.bin
11k  11K modules.builtin.bin

2 years agolibkmod: Prefer builtin index over builtin.alias
Lucas De Marchi [Thu, 10 Feb 2022 02:21:03 +0000 (18:21 -0800)]
libkmod: Prefer builtin index over builtin.alias

The modules.builtin.alias.bin is way larger than the
modules.builtin.bin.  On a normal "distro kernel":

21k modules.builtin.alias.bin
11k modules.builtin.bin

From the kernel we get both modules.builtin and modules.builtin.modinfo.
depmod generates modules.builtin.bin and modules.builtin.alias.bin
from them respectively. modules.bultin is not going away: it's not
deprecated by the new index added. So, let's just stop duplicating the
information inside modules.builtin.alias.bin and just use the other
index.

2 years agolibkmod: Set builtin to no when module is created from path.
Michal Suchanek [Wed, 18 Aug 2021 20:52:00 +0000 (22:52 +0200)]
libkmod: Set builtin to no when module is created from path.

A recent bug report showed that modinfo doesn't give the signature
information for certain modules, and it turned out to happen only on
the modules that are built-in on the running kernel; then modinfo
skips the signature check, as if the target module file never exists.
The behavior is, however, inconsistent when modinfo is performed for
external modules (no matter which kernel version is) and the module
file path is explicitly given by a command-line argument, which
guarantees the presence of the module file itself.

Fixes: e7e2cb61fa9f ("modinfo: Show information about built-in modules")
Link: https://lore.kernel.org/linux-modules/CAKi4VAJVvY3=JdSZm-GD1hJqyCPYaYz-jBJ_REeY5BakVb6_ww@mail.gmail.com/
BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1189537
Suggested-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
2 years agolibkmod: add a library notice log level print
Luis Chamberlain [Tue, 10 Aug 2021 05:16:00 +0000 (22:16 -0700)]
libkmod: add a library notice log level print

When you use pass the -v argument to modprobe we bump
the log level from the default modprobe log level of
LOG_WARNING (4) to LOG_NOTICE (5), however the library
only has avaiable to print:

 #define DBG(ctx, arg...) kmod_log_cond(ctx, LOG_DEBUG, ## arg)
 #define INFO(ctx, arg...) kmod_log_cond(ctx, LOG_INFO, ## arg)
 #define ERR(ctx, arg...) kmod_log_cond(ctx, LOG_ERR, ## arg)

LOG_INFO (6) however is too high of a level for it to be
effective at printing anything when modprobe -v is passed.
And so the only way in which modprobe -v can trigger the
library to print a verbose message is to use ERR() but that
always prints something and we don't want that in some
situations.

We need to add a new log level macro which uses LOG_NOTICE (5)
for a "normal but significant condition" which users and developers
can use to look underneath the hood to confirm if a situation is
happening.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
2 years agolibkmod-module: check "new_from_name" return value in get_builtin
Yauheni Kaliuta [Tue, 8 Jun 2021 06:29:22 +0000 (09:29 +0300)]
libkmod-module: check "new_from_name" return value in get_builtin

kmod_module_new_from_name() may fail and return error value. It is
handled properly across the code, but in this particular place the
check is missing.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>
2 years agokmod 29 v29
Lucas De Marchi [Thu, 20 May 2021 23:02:57 +0000 (16:02 -0700)]
kmod 29

2 years agotestsuite: update gitignore
Lucas De Marchi [Tue, 11 May 2021 16:57:10 +0000 (09:57 -0700)]
testsuite: update gitignore

2 years agodepmod: fix modules.builtin.alias.bin output
Lucas De Marchi [Tue, 11 May 2021 16:48:04 +0000 (09:48 -0700)]
depmod: fix modules.builtin.alias.bin output

Due to wrong documentation on kmod_module_get_info() we ended up
checking for 0 as return. Check for > 0 to decided if we want to write
the index to the file, otherwise we would output a 0-sized index on
success.

2 years agoFix return value doc for kmod_module_get_info()
Lucas De Marchi [Tue, 11 May 2021 16:47:09 +0000 (09:47 -0700)]
Fix return value doc for kmod_module_get_info()

We don't return 0 on success, we return the number of elements we added
to the list.

3 years agolibkmod: fix possible double free with wrong modules.builtin.modinfo
Seung-Woo Kim [Tue, 13 Apr 2021 11:23:15 +0000 (20:23 +0900)]
libkmod: fix possible double free with wrong modules.builtin.modinfo

Fix double free for *modinfo with non '\0' terminated wrong
modules.builtin.modinfo, which is because EOF is minus value.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agolibkmod: fix an overflow with wrong modules.builtin.modinfo
Seung-Woo Kim [Tue, 13 Apr 2021 11:23:14 +0000 (20:23 +0900)]
libkmod: fix an overflow with wrong modules.builtin.modinfo

Fix a possbile overflow with exact PATH_MAX length modname
in wrong modules.builtin.modinfo.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agogitignore: ignore .mbx and .cover for b4 integration
Lucas De Marchi [Sat, 17 Apr 2021 20:39:12 +0000 (13:39 -0700)]
gitignore: ignore .mbx and .cover for b4 integration

Lately I'm using b4 to work with the patches in the mailing list. Better
to start ignoring .cover and .mbx files since they get created by b4.

3 years agolibkmod-config: fix a memory leak when kmod_list_append() fails
Seung-Woo Kim [Fri, 9 Apr 2021 09:44:23 +0000 (18:44 +0900)]
libkmod-config: fix a memory leak when kmod_list_append() fails

From kmod_config_new(), when kmod_list_append() fails,
fix not list-appended kmod_config_path leak.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agolibkmod-config: more chars allowed as space
Lucas De Marchi [Wed, 10 Mar 2021 16:33:01 +0000 (08:33 -0800)]
libkmod-config: more chars allowed as space

Recently in a discussion I noticed that kernel allows more chars to be
considered as space in the kernel command line. Switch to the equivalent
of isspace() instead of considering only ' '.

3 years agotest-modprobe: share single function for kcmdline tests
Lucas De Marchi [Fri, 12 Feb 2021 09:45:24 +0000 (01:45 -0800)]
test-modprobe: share single function for kcmdline tests

3 years agotestsuite: allow to re-use single function for tests
Lucas De Marchi [Fri, 12 Feb 2021 09:45:23 +0000 (01:45 -0800)]
testsuite: allow to re-use single function for tests

Add a new DEFINE_TEST_WITH_FUNC() that accepts the function
alongside the test name. This will allow us to share a single function
for different tests.

3 years agolibkmod-config: re-quote option from kernel cmdline
Lucas De Marchi [Fri, 12 Feb 2021 09:45:22 +0000 (01:45 -0800)]
libkmod-config: re-quote option from kernel cmdline

It was reported that grub mangles the kernel cmdline. It turns

acpi_cpufreq.dyndbg="file drivers/cpufreq/acpi-cpufreq.c +mpf"

into

"acpi_cpufreq.dyndbg=file drivers/cpufreq/acpi-cpufreq.c +mpf"

However, even though we could blame grub for doing that, the kernel
happily accepts and re-quotes it when the module is built-in.
So, it's better if kmod also understands it this way and does the same.

Here we basically add additional code to un-mangle it, moving the quote
in way that is acceptable to pass through init_module(). Note that the
interface [f]init_module() gives us mandates the quote to be part of the
value: the module name is not passed and the options are separated by
space.

Reported-by: Jiri Slaby <jirislaby@kernel.org>
Tested-by: Jessica Yu <jeyu@kernel.org>
Link: https://bugzilla.suse.com/show_bug.cgi?id=1181111#c10
3 years agolibkmod-config: revamp kcmdline parsing into a state machine
Lucas De Marchi [Fri, 12 Feb 2021 09:45:21 +0000 (01:45 -0800)]
libkmod-config: revamp kcmdline parsing into a state machine

The handling of spaces and quotes is becoming hard to maintain. Convert
the parser into a state machine so we can check all the states. This
should make it easier to fix a corner case we have right now:
The kernel also accepts a quote before the module name instead of the
value. But this additional is left for later. This is purely an
algorithm change with no behavior change.

Tested-by: Jessica Yu <jeyu@kernel.org>
3 years agotestsuite: also test xz compression
Lucas De Marchi [Sat, 30 Jan 2021 02:34:30 +0000 (18:34 -0800)]
testsuite: also test xz compression

Reviewed-by: Petr Vorel <pvorel@suse.cz>
3 years agotestsuite: compress modules if feature is enabled
Lucas De Marchi [Sat, 30 Jan 2021 02:28:38 +0000 (18:28 -0800)]
testsuite: compress modules if feature is enabled

Since the output needs to be the same, regardless if the module is
compressed, change populate-modules.sh to conditionally compress the
module if that feature is enabled.

This way we can execute the tests with any build-time configuration and
it should still pass.

Suggested-by: Michal Suchánek <msuchanek@suse.de>
Reviewed-by: Michal Suchánek <msuchanek@suse.de>
Tested-by: Michal Suchánek <msuchanek@suse.de>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
3 years agopopulate-modules: Use more bash, more quotes
Dave Reisner [Wed, 25 Mar 2020 15:03:58 +0000 (11:03 -0400)]
populate-modules: Use more bash, more quotes

We're already using associatives arrays, so there's no reason we should
be using 'test'.

3 years agoREADME: make github mirror official
Lucas De Marchi [Thu, 21 Jan 2021 02:50:33 +0000 (18:50 -0800)]
README: make github mirror official

For some time I've been maintaining a read-only mirror on github.
I think it's time to allow patches flowing from there besides the
mailing list: I created a new org to host the project:

https://github.com/kmod-project/kmod

3 years agoSupport /usr/local for configuration files
Lucas De Marchi [Tue, 19 Jan 2021 02:22:31 +0000 (18:22 -0800)]
Support /usr/local for configuration files

Add /usr/local to the search path for configuration files. These are
intended for local installs, provided /usr/local is given as prefix.

3 years agodepmod: fix precedence order
Lucas De Marchi [Tue, 19 Jan 2021 02:13:25 +0000 (18:13 -0800)]
depmod: fix precedence order

Configuration in /etc should have higher prio than /run.
Given how rarely configuration in /run is used with depmod, this is
likely not to cause any problems, even if it's a change in behavior.

3 years agolibkmod: Fix documentation on config precedence order
Lucas De Marchi [Tue, 19 Jan 2021 02:05:09 +0000 (18:05 -0800)]
libkmod: Fix documentation on config precedence order

/etc is has higher priority than /run.

3 years agoFix "modinfo -F always shows name for built-ins"
Marco d'Itri [Fri, 8 Jan 2021 04:17:48 +0000 (20:17 -0800)]
Fix "modinfo -F always shows name for built-ins"

Bug reported by Ben Hutchings <ben@decadent.org.uk>:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=970871

Now that the kernel provides module information for potentially
modular code that's actually built-in, it's possible to query these
built-ins with "modinfo -F".  However, this doesn't work quite right:

$ modinfo -Flicense e1000e
GPL v2
$ modinfo -Flicense bitrev
name:           bitrev
GPL

3 years agoREADME: remove leftover from semaphoreci
Lucas De Marchi [Fri, 8 Jan 2021 03:51:40 +0000 (19:51 -0800)]
README: remove leftover from semaphoreci

We are not currently using semaphoreci, so remove leftover status from
README.

3 years agotestsuite: Automatically skip tests that fail when sysconfdir != /etc.
Marius Bakke [Sat, 1 Aug 2020 16:02:22 +0000 (18:02 +0200)]
testsuite: Automatically skip tests that fail when sysconfdir != /etc.

3 years agotestsuite: Add facility to skip tests.
Marius Bakke [Sat, 1 Aug 2020 16:02:21 +0000 (18:02 +0200)]
testsuite: Add facility to skip tests.

The Makefile helpfully warns that some tests will fail when
--sysconfdir != /etc, but there are no provisions to easily disable
those.  This commit provides an escape hatch.

[ Lucas: add comment detailing the purpose of the field ]

3 years agokmod 28 v28
Lucas De Marchi [Thu, 7 Jan 2021 18:43:36 +0000 (10:43 -0800)]
kmod 28

3 years agobuild: add comment with rules for libtool version update
Lucas De Marchi [Thu, 7 Jan 2021 18:26:12 +0000 (10:26 -0800)]
build: add comment with rules for libtool version update

3 years agobuild: fix distcheck due to missing zstd
Lucas De Marchi [Mon, 28 Dec 2020 01:00:43 +0000 (17:00 -0800)]
build: fix distcheck due to missing zstd

Enable zstd since it's used in the testsuite.

3 years agotestsuite: add test for empty modules.builtin.aliases.bin
Lucas De Marchi [Fri, 18 Dec 2020 16:02:09 +0000 (08:02 -0800)]
testsuite: add test for empty modules.builtin.aliases.bin

3 years agoshared: fix UNIQ definition
Lucas De Marchi [Fri, 18 Dec 2020 16:02:08 +0000 (08:02 -0800)]
shared: fix UNIQ definition

We need a macro indirection for UNIQ to work. Otherwise it won't be
unique at all since it will just append "UNIQ" to the name:

In file included from testsuite/test-init.c:30:

testsuite/testsuite.h:142:27: error: redefinition of ‘stest_load_resourcesUNIQ’

3 years agodepmod: unconditionally write builtin.alias.bin
Lucas De Marchi [Fri, 18 Dec 2020 16:02:07 +0000 (08:02 -0800)]
depmod: unconditionally write builtin.alias.bin

The file is always created and unless we return an error, the temporary
file is renamed to its final destination. All other places write the
index without checking if the index is empty, so just do the same.

Reported-by: Joe Buehler <aspam@cox.net>
3 years agoci: remove semaphoreci
Lucas De Marchi [Fri, 4 Dec 2020 03:34:28 +0000 (19:34 -0800)]
ci: remove semaphoreci

It's currently failing and we are already covered by travis-ci.

3 years agoci: update travis distro
Lucas De Marchi [Thu, 3 Dec 2020 21:29:48 +0000 (13:29 -0800)]
ci: update travis distro

Don't bother with gcc 4.8 vs 4.9, just use the latest one for the
distro. Update travis to ubuntu 20.04 so we can get current
dependencies.

3 years agoNEWS: fix typo
Shuo Wang [Wed, 25 Nov 2020 01:31:21 +0000 (09:31 +0800)]
NEWS: fix typo

3 years agolibkmod: kmod_log_null: qualify ctx argument as const
Yauheni Kaliuta [Sun, 29 Nov 2020 16:47:37 +0000 (18:47 +0200)]
libkmod: kmod_log_null: qualify ctx argument as const

kmod_log_null() does not change ctx (does nothing).

Fix warnings

In file included from libkmod/libkmod-index.c:33:
libkmod/libkmod-index.c: In function ‘index_mm_open’:
libkmod/libkmod-index.c:757:6: warning: passing argument 1 of ‘kmod_log_null’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  757 |  DBG(ctx, "file=%s\n", filename);

Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
3 years agodepmod: output_builtin_alias_bin: free idx on error path
Yauheni Kaliuta [Sun, 29 Nov 2020 16:47:36 +0000 (18:47 +0200)]
depmod: output_builtin_alias_bin: free idx on error path

idx is allocated in the beginning but it's not freed if there is
a failure after the allocation.

Change the error path: return immediately if idx allocation fails
and then free it in both success and error path at the end.

Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
3 years agolibkmod: kmod_builtin_get_modinfo: free modinfo on error
Yauheni Kaliuta [Sun, 29 Nov 2020 16:47:35 +0000 (18:47 +0200)]
libkmod: kmod_builtin_get_modinfo: free modinfo on error

The function allocates array but on building it if get_string()
fails it returns the error leaving the array allocated. The caller
does not care about it in error case either.

Free it to fix memory leak.

Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
3 years agoman: fix typo
Samanta Navarro [Sun, 4 Oct 2020 11:43:33 +0000 (11:43 +0000)]
man: fix typo

3 years agotestsuite: add test for zstd-compressed module
Torge Matthies [Tue, 8 Sep 2020 19:59:21 +0000 (21:59 +0200)]
testsuite: add test for zstd-compressed module

I took away one module from the gzip-compressed modules for this purpose.

Signed-off-by: Torge Matthies <openglfreak@googlemail.com>
3 years agoadd Zstandard compression support
Torge Matthies [Tue, 8 Sep 2020 19:59:20 +0000 (21:59 +0200)]
add Zstandard compression support

I changed the style of the hackargs variable in autogen.sh to multiline
because said line was becoming a bit long with the new --with-zstd arg
added.

A previous version of this patch has been running on my two Arch Linux
installations (with an accompanying mkinitcpio patch) for several months
over many kernel updates without any issues.
Any additional testing and/or patch review would of course be appreciated.

Signed-off-by: Torge Matthies <openglfreak@googlemail.com>
4 years agotestsuite: add check for kmod_load_resources
Lucas De Marchi [Tue, 10 Mar 2020 05:00:29 +0000 (22:00 -0700)]
testsuite: add check for kmod_load_resources

Make sure we can call kmod_load_resources when we do have all the
mandatory indexes in place.

4 years agolibkmod: allow modules.alias.builtin to be optional
Lucas De Marchi [Tue, 10 Mar 2020 05:00:28 +0000 (22:00 -0700)]
libkmod: allow modules.alias.builtin to be optional

4 years agolibkmod: fix return error when opening index
Lucas De Marchi [Tue, 10 Mar 2020 05:00:27 +0000 (22:00 -0700)]
libkmod: fix return error when opening index

When calling kmod_load_resources() we could end up getting a bogus
return value -ENOMEM due to several other reasons, like the index not
existing. Change index_mm_open() to propagate the failure reason so we
can take actions on it or return to the caller.

4 years agolibkmod: simplify lookup when builtin.modinfo.bin file is missing
Lucas De Marchi [Tue, 10 Mar 2020 05:00:26 +0000 (22:00 -0700)]
libkmod: simplify lookup when builtin.modinfo.bin file is missing

When we try to lookup a module and builtin.modinfo.bin is missing, we
would do the right thing because the caller was replacing the return
code with 0 (and the list was not modified).

Make it simpler by allowing the caller to check and differentiate the
errors between module not found and index not found.

4 years agodepmod: do not output .bin to stdout
Lucas De Marchi [Thu, 5 Mar 2020 21:33:10 +0000 (13:33 -0800)]
depmod: do not output .bin to stdout

index_write() relies on fseek/ftell to manage the position to which we
are write and thus needs the file stream to support it.

Right now when trying to write the index to stdout we fail with:

depmod: tools/depmod.c:416: index_write: Assertion `initial_offset >= 0' failed.
Aborted (core dumped)

We have no interest in outputting our index to stdout, so just skip it
like is done with other indexes.

While at it, add/remove some newlines to improve readability.

Reported-by: Yanko Kaneti <yaneti@declera.com>
Fix: b866b2165ae6 ("Lookup aliases in the modules.builtin.modinfo")

4 years agotestsuite: check for ill-formed kcmdline
Lucas De Marchi [Tue, 10 Mar 2020 08:17:12 +0000 (01:17 -0700)]
testsuite: check for ill-formed kcmdline

Commit ca3bf5d47cec ("iommu/amd: Introduces ivrs_acpihid kernel parameter")
in the kernel introduced an ill-formed kernel parameter, ivrs_acpihid.
The problem is that it may have a dot on the key side:
"ivrs_acpihid[00:14.5]=AMD0020:0". This could potentially trip our
parser of module options, but right now it's working as intended: the
only thing that happens is that after deciding "ivrs_acpihid[00:14" is a
module name, it will fail the underscores() routine and the option will
be ignored from the kmod pov (not kernel's pov since that driver parsers
the kernel command line by itself).

4 years agolibkmod: ignore kcmdline option if we fail to parse modname
Lucas De Marchi [Tue, 10 Mar 2020 08:06:39 +0000 (01:06 -0700)]
libkmod: ignore kcmdline option if we fail to parse modname

The error message is saying we are ignoring the option on the kernel
command line, so just do it.

4 years agogitignore: ignore .cache.mk when building modules
Lucas De Marchi [Tue, 10 Mar 2020 04:46:32 +0000 (21:46 -0700)]
gitignore: ignore .cache.mk when building modules

4 years agogitignore: ignore release files
Lucas De Marchi [Fri, 28 Feb 2020 20:53:47 +0000 (12:53 -0800)]
gitignore: ignore release files

4 years agokmod 27 v27
Lucas De Marchi [Tue, 18 Feb 2020 23:54:07 +0000 (15:54 -0800)]
kmod 27

4 years agolibkmod: reset was_space on second pass
Lucas De Marchi [Mon, 20 Jan 2020 19:15:38 +0000 (16:15 -0300)]
libkmod: reset was_space on second pass

The softdep config parser uses a 2-pass approach to use a single
allocation for all the softdep struct. However "was_space" variable
isn't reset between them. This can lead to a buffer overflow.

Reported-by: Jorge Lucangeli Obes <jorgelo@google.com>
Link: https://lore.kernel.org/linux-modules/CAKYuF5QhGCPCazHQjN-=kFc5kHs7Ok8WqmmGLo31CiOEN8TYdA@mail.gmail.com
4 years agolibkmod-module: convert return value from system() to errno
Topi Miettinen [Mon, 23 Dec 2019 16:58:13 +0000 (18:58 +0200)]
libkmod-module: convert return value from system() to errno

Don't use exit status of a command directly as errno code, callers
will be confused.

Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
4 years agomodinfo: Show information about built-in modules
Alexey Gladkov [Fri, 8 Nov 2019 17:25:23 +0000 (18:25 +0100)]
modinfo: Show information about built-in modules

Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
4 years agoLookup aliases in the modules.builtin.modinfo
Alexey Gladkov [Fri, 8 Nov 2019 17:25:22 +0000 (18:25 +0100)]
Lookup aliases in the modules.builtin.modinfo

New modules.builtin.modinfo duplicates modules.builtin in the built-in
module name search. If it exists, then we can use this file, but if not,
then we need to fallback to the old file.

Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
4 years agolibkmod: Add function to get list of built-in modules
Alexey Gladkov [Fri, 8 Nov 2019 17:25:21 +0000 (18:25 +0100)]
libkmod: Add function to get list of built-in modules

Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
4 years agolibkmod: Add parser for modules.builtin.modinfo
Alexey Gladkov [Fri, 8 Nov 2019 17:25:20 +0000 (18:25 +0100)]
libkmod: Add parser for modules.builtin.modinfo

The kernel since version v5.2-rc1 exports information about built-in
modules in the modules.builtin.modinfo. Information is stored in
the same format as in the separate modules (null-terminated string
array). The module name is a prefix for each line.

$ tr '\0' '\n' < modules.builtin.modinfo
ext4.softdep=pre: crc32c
ext4.license=GPL
ext4.description=Fourth Extended Filesystem
ext4.author=Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others
ext4.alias=fs-ext4
ext4.alias=ext3
ext4.alias=fs-ext3
ext4.alias=ext2
ext4.alias=fs-ext2
md_mod.alias=block-major-9-*
md_mod.alias=md
md_mod.description=MD RAID framework
md_mod.license=GPL
md_mod.parmtype=create_on_open:bool
md_mod.parmtype=start_dirty_degraded:int
...

Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
4 years agoMakefile.am: filter -Wl,--no-undefined
Fabrice Fontaine [Mon, 18 Nov 2019 21:56:17 +0000 (22:56 +0100)]
Makefile.am: filter -Wl,--no-undefined

Commit 1d14ef82f4a3be741bcdf6b1c6d51ce9dce43567 does not completely fix
the build with python 3.8 as we still get link failure due to
'-z undefs' being ignored by some versions of ld.

Indeed, -z undefs was added by commit
97a232d7335f3bd0231fd9cd39455bde1d563922 in upstream binutils, and this
commit was first present in binutils 2.30.
So any toolchain using binutils version older than that won't have
-z undefs and will build fail on:

/home/buildroot/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mips-linux-gnu/5.3.0/../../../../mips-linux-gnu/bin/ld: warning: -z undefs ignored.

/home/naourr/work/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/aarch64_be-linux-gnu/7.3.1/../../../../aarch64_be-linux-gnu/bin/ld: warning: -z undefs ignored.

So filter -Wl,--no-undefined to fix the issue

Fixes:
 - http://autobuild.buildroot.org/results/e9645d9969481b09f507f6e0d0b35faaa283eb60
 - http://autobuild.buildroot.org/results/06a6d865b6b7d8ebd793bde214f4a4c40e0962e1

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
4 years agomodprobe: use flags rather than bool args
Lucas De Marchi [Thu, 7 Nov 2019 07:27:28 +0000 (23:27 -0800)]
modprobe: use flags rather than bool args

It's easier to know what the caller is doing when we pass a named
flag rather than a list of bools.

4 years agotravis: remove old compiler failing to build kernel module
Lucas De Marchi [Thu, 7 Nov 2019 16:34:15 +0000 (08:34 -0800)]
travis: remove old compiler failing to build kernel module

This is when building the kernel modules for testsuite:

Makefile:718: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
gcc: error: unrecognized command line option ‘-fstack-protector-strong’

Just drop gcc 4.8 from running tests. Failure not really related to kmod.