Commit graph

17 commits

Author SHA1 Message Date
Ludovic Courtès
4db7a9dc66
linux-modules: Raise an error when a kernel module cannot be found.
Previously we'd get an unhelpful backtrace like this:

  In gnu/build/linux-modules.scm:
     184:47  4 (recursive-module-dependencies _ #:lookup-module _)
      98:14  3 (module-dependencies _)
      85:18  2 (modinfo-section-contents _)
  In ice-9/ports.scm:
     439:11  1 (call-with-input-file #f #<procedure get-bytevector-al?> ?)
  In unknown file:
	     0 (open-file #f "r" #:encoding #f #:guess-encoding #f)

  ERROR: In procedure open-file:
  Wrong type (expecting string): #f
  builder for `/gnu/store/…-linux-modules.drv' failed with exit code 1

* gnu/build/linux-modules.scm (find-module-file): When MODULE cannot be
found, raise an error instead of returning #f.  This is more useful to
the user.
2018-08-29 23:32:01 +02:00
Ludovic Courtès
f43d2dcd80
linux-modules: Adjust 'section-contents' procedure.
* gnu/build/linux-modules.scm (section-contents): Honor SECTION as was
intended.
(modinfo-section-contents): Pass 'section-contents' a section, not a
section name.
2018-08-21 23:27:08 +02:00
Ludovic Courtès
fcd068e984
linux-initrd: Try several file names when looking up modules.
Fixes <https://bugs.gnu.org/31714>.
Reported by Tonton <tonton@riseup.net>.

* gnu/build/linux-modules.scm (find-module-file): New procedure.
* gnu/system/linux-initrd.scm (flat-linux-module-directory)[build-exp]:
Remove 'lookup' procedure and use 'find-module-file' instead.
* gnu/system/mapped-devices.scm (check-device-initrd-modules): Add
comment.
2018-07-29 18:50:28 +02:00
Ludovic Courtès
d2a1cf45f7
linux-initrd: Improve check of initrd modules.
Previously we would not strip the ".ko" suffix if present.

* gnu/build/linux-modules.scm (file-name->module-name): Export.
* gnu/system/mapped-devices.scm (check-device-initrd-modules): Use
'file-name->module-name' instead of 'normalize-module-name'.
2018-07-29 18:50:28 +02:00
Ludovic Courtès
411959bef3
linux-initrd: Module check correctly handles hyphen vs. underscore.
Fixes <https://bugs.gnu.org/31714>.
Reported by Vagrant Cascadian <vagrant@debian.org>
and Florian Pelz <pelzflorian@pelzflorian.de>.

* gnu/system/mapped-devices.scm (check-device-initrd-modules): Pass
LINUX-MODULES through 'normalize-module-name'.
* gnu/build/linux-modules.scm (normalize-module-name): Export.
2018-06-14 23:34:59 +02:00
Ludovic Courtès
71e08fde28
glob: Add an extra glob pattern compilation stage.
* guix/glob.scm (compile-glob-pattern): Rename to...
(string->sglob): ... this.
(compile-sglob, string->compiled-sglob): New procedures.
(glob-match?): Replace '?, 'range, and 'set with a single clause.
* tests/glob.scm (test-compile-glob-pattern): Rename to...
(test-string->sglob): ... this.  Adjust accordingly.
(test-glob-match): Use 'string->compiled-sglob' instead of
'compile-glob-pattern'.
* gnu/build/linux-modules.scm (read-module-aliases): Use
'string->compiled-sglob' instead of 'compile-glob-pattern'.
2018-03-18 22:57:17 +01:00
Ludovic Courtès
675e81a082
linux-modules: 'load-linux-module*' honors BLACK-LIST in recursive calls.
* gnu/build/linux-modules.scm (load-linux-module*): Pass BLACK-LIST in
recursive call.
2018-03-18 22:35:27 +01:00
Ludovic Courtès
a57df67b59
linux-modules: Add 'current-kernel-directory'.
* gnu/build/linux-modules.scm (current-kernel-directory): New procedure.
(current-alias-file): Use it.
2018-03-18 22:35:03 +01:00
Danny Milosavljevic
8b2219d847
linux-modules: Add module-aliases.
* gnu/build/linux-modules.scm (module-aliases): New variable.
2018-03-03 23:40:02 +01:00
Ludovic Courtès
8661ad2743
linux-modules: Add 'device-module-aliases' and related procedures.
* gnu/build/linux-modules.scm (readlink*, stat->device-major)
(stat->device-minor): New procedures.
(%not-slash): New variable.
(read-uevent, device-module-aliases, read-module-aliases)
(current-alias-file, known-module-aliases, matching-modules): New
procedures.
2018-03-02 13:46:33 +01:00
Ludovic Courtès
3c14e7e6bb
linux-modules: Use 'load-linux-module/fd'.
This should be more efficient than loading the whole thing in user space.

* gnu/build/linux-modules.scm (load-linux-module*): Use
'load-linux-module/fd' instead of 'load-linux-module'.  Remove 'slurp'.
2018-02-28 22:47:48 +01:00
Mathieu Othacehe
a5e13c3be9
build: Fix compilation warnings.
* gnu/build/linux-boot.scm (define-module): Use (guix build syscalls).
* gnu/build/linux-modules.scm (define-module): Ditto.
* gnu/build/file-systems (define-module): Stop re-exporting mount, umount and
MS_* flags as this is now safe to include (guix build syscalls) instead.
(mount): Remove procedure.
(umount): Ditto.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-11 11:13:26 +02:00
Ludovic Courtès
5c7dd5ac3a linux-modules: Use normalized module names for 'modprobe.blacklist'.
* gnu/build/linux-modules.scm (normalize-module-name): New procedure.
(file-name->module-name): Use it.
(module-black-list): Expound docstring.
2016-02-21 13:04:10 +01:00
Ludovic Courtès
7ba903b6db linux-modules: Support 'modprobe.blacklist' on the command line.
* gnu/build/linux-modules.scm (file-name->module-name)
(module-black-list): New procedure.
* gnu/build/linux-modules.scm (load-linux-module*): Add #:black-list
parameter.
[black-listed?, load-dependencies]: New procedures.
Use them.
2016-01-16 14:45:47 +01:00
Ludovic Courtès
fb74174958 linux-boot: Remove verbose output for module loads.
* gnu/build/linux-boot.scm (boot-system): Leave
'current-module-debugging-port' unchanged.
* gnu/build/linux-modules.scm (load-linux-module*): Update comment about
'mmap'.
2016-01-05 00:28:42 +01:00
Ludovic Courtès
7c4885f0d7 linux-modules: Correctly propagate error code from 'init_module'.
* gnu/packages/patches/guile-linux-syscalls.patch (scm_load_linux_module):
  Leave 'errno' unchanged when ERR != 0.
* gnu/build/linux-modules.scm (load-linux-module*): Check for the errno
  value of ARGS to determine whether the module was already loaded.
2014-11-28 15:08:56 +01:00
Ludovic Courtès
fcaa5f44a1 system: Add (gnu build linux-modules).
* gnu/build/linux-modules.scm: New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
2014-11-28 00:10:28 +01:00