aboutsummaryrefslogtreecommitdiff
path: root/gnu/build/linux-modules.scm
Commit message (Collapse)AuthorAge
* gnu: linux-libre: Enable Zstd compression of kernel modules.Maxim Cournoyer2024-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | This brings the on disk size of the kernel from 164 MiB to 144 MiB, or about 12%. * gnu/packages/linux.scm (default-extra-linux-options) [version>=5.13]: Enable CONFIG_MODULE_COMPRESS_ZSTD, else CONFIG_MODULE_COMPRESS_GZIP. (make-linux-libre*) [phases] {set-environment}: Set ZSTD_CLEVEL environment variable to 19. [native-inputs]: Add zstd. * gnu/build/linux-modules.scm (module-regex): Add .zst to regexp. Update doc. (modinfo-section-contents): Extend support to Zstd compressed module. (dot-ko): Register the 'zstd compression type. (ensure-dot-ko, file-name->module-name, load-linux-module*) (module-name->file-name/guess, write-module-name-database) (write-module-alias-database, write-module-device-database): Update doc. (module-name-lookup): Also consider zstd-compressed modules. * gnu/installer.scm (installer-program): Add guile-zstd extension to gexp. * gnu/system/linux-initrd.scm (flat-linux-module-directory): Likewise. Decompress zstd-compressed modules for use in initrd. * guix/profiles.scm (linux-module-database): Add guile-zstd extension to gexp. Change-Id: Ide899dc5c58ea5033583b1a91a92c025fc8d901a
* linux-modules: Ignore nonexistent module files on boot.Hilton Chain2024-03-27
| | | | | | | | | | | This is a follow-up to 8f8ec56052766aa5105d672b77ad9eaca5c1ab3c, which only covers building initrd, while the booting code still tries to load nonexistent files for builtin modules. * gnu/build/linux-modules.scm (load-linux-modules-from-directory): Ignore nonexistent module files. Change-Id: I09ef207e82397e915e671c8464b92bcf90f03dcf
* linux-modules: Fix module dependency loading.Tobias Geerinckx-Rice2023-10-15
| | | | | | * gnu/build/linux-modules.scm (dot-ko): Make COMPRESSION optional, as expected by callers RECURSIVE-MODULE-DEPENDENCIES and LOAD-LINUX-MODULE*.
* linux-modules: Add 'load-pci-device-database'.Ludovic Courtès2022-11-15
| | | | | * gnu/build/linux-modules.scm (read-pci-device-database) (load-pci-device-database): New procedures.
* linux-modules: Add support for listing PCI devices.Ludovic Courtès2022-11-15
| | | | | | * gnu/build/linux-modules.scm (<pci-device>): New record type. (pci-device-class-predicate, storage-pci-device?, network-pci-device?) (display-pci-device?, pci-devices?): New procedures.
* linux-modules: Ignore EINVAL in ‘modprobe’ mode.Tobias Geerinckx-Rice via Guix-patches via2021-12-16
| | | | | | | | | | | | Loading the framebuffer-coreboot module simply fails with EINVAL on a non-Corebooted system. Crashing the system with a kernel panic is not a reasonable reaction to loading valid modules on unsupported hardware. The kernel should log an error, which the user is expected to see. Bogus module names will still be fatally reported by linux-modules.drv. * gnu/build/linux-modules.scm (load-linux-module*): Ignore EINVAL errors when operating recursively.
* linux-libre: Support module compression.Mathieu Othacehe2020-08-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds support for GZIP compression for linux-libre kernel modules. The initrd modules are kept uncompressed as the initrd is already compressed as a whole. The linux-libre kernel also supports XZ compression, but as Guix does not have any available bindings for now, and the compression time is far more significant, GZIP seems to be a better option. * gnu/build/linux-modules.scm (modinfo-section-contents): Use 'call-with-gzip-input-port' to read from a module file using '.gz' extension, (strip-extension): new procedure, (dot-ko): adapt to support compression, (ensure-dot-ko): ditto, (file-name->module-name): ditto, (find-module-file): ditto, (load-linux-module*): ditto, (module-name->file-name/guess): ditto, (module-name-lookup): ditto, (write-module-name-database): ditto, (write-module-alias-database): ditto, (write-module-device-database): ditto. * gnu/installer.scm (installer-program): Add "guile-zlib" to the extensions. * gnu/machine/ssh.scm (machine-check-initrd-modules): Ditto. * gnu/services.scm (activation-script): Ditto. * gnu/services/base.scm (default-serial-port): Ditto, (agetty-shepherd-service): ditto, (udev-service-type): ditto. * gnu/system/image.scm (gcrypt-sqlite3&co): Ditto. * gnu/system/linux-initrd.scm (flat-linux-module-directory): Add "guile-zlib" to the extensions and make sure that the initrd only contains uncompressed module files. * gnu/system/shadow.scm (account-shepherd-service): Add "guile-zlib" to the extensions. * guix/profiles.scm (linux-module-database): Ditto.
* system: Add kernel-loadable-modules to operating-system.Danny Milosavljevic2020-03-22
| | | | | | | | | | | | | | | * gnu/system.scm (<operating-system>): Add kernel-loadable-modules. (operating-system-directory-base-entries): Use it. * doc/guix.texi (operating-system Reference): Document KERNEL-LOADABLE-MODULES. * gnu/build/linux-modules.scm (depmod): New procedure. (make-linux-module-directory): New procedure. Export it. * guix/profiles.scm (linux-module-database): New procedure. Export it. * gnu/tests/linux-modules.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * gnu/packages/linux.scm (make-linux-libre*)[arguments]<#:phases>[install]: Disable depmod. Remove "build" and "source" symlinks. [native-inputs]: Remove kmod.
* linux-modules: Define and use a module name database.Ludovic Courtès2019-08-16
| | | | | | | | | | | | | Fixes <https://bugs.gnu.org/34902>. Reported by Julien Lepiller <julien@lepiller.eu>. * gnu/build/linux-modules.scm (module-formal-name): New procedure. (load-linux-modules-from-directory)[lookup-module]: Remove. [module-name->file-name]: New variable. Use it. (module-name->file-name/guess, module-name-lookup) (write-module-name-database): New procedures. * gnu/system/linux-initrd.scm (flat-linux-module-directory): Call 'write-module-name-database'.
* linux-modules: Add 'load-linux-modules-from-directory'.Ludovic Courtès2019-08-16
| | | | | | | * gnu/build/linux-modules.scm (load-linux-modules-from-directory): New procedure. * gnu/build/linux-boot.scm (boot-system)[lookup-module]: Remove. Use 'load-linux-modules-from-directory' instead.
* linux-modules: Add "modules.devname" writer.Ludovic Courtès2019-08-16
| | | | | | | | * gnu/build/linux-modules.scm (aliases->device-tuple) (write-module-device-database): New procedures. (%not-dash): New variable. Co-authored-by: Danny Milosavljevic <dannym@scratchpost.org>.
* linux-modules: Add "modules.alias" writer.Danny Milosavljevic2019-08-16
| | | | | | | * gnu/build/linux-modules.scm (write-module-alias-database): New procedure. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* linux-modules: Factorize 'missing-modules'.Ludovic Courtès2019-03-13
| | | | | * gnu/build/linux-modules.scm (missing-modules): New procedure. * gnu/system/mapped-devices.scm (check-device-initrd-modules): Use it.
* linux-modules: module-soft-dependencies: Partition the result and return it ↵Danny Milosavljevic2019-03-05
| | | | | | | as two lists. * gnu/build/linux-modules.scm (module-soft-dependencies): Partition the result and return it as two lists.
* linux-modules: module-soft-dependencies: Remove colon from section names.Danny Milosavljevic2019-01-25
| | | | | | | Follow-up to 1a5f46621b44aa1458ad7acd4eca5fe1d4574f92. * gnu/build/linux-modules.scm (module-soft-dependencies): Remove colon from section names.
* linux-modules: Add module-soft-dependencies.Danny Milosavljevic2019-01-25
| | | | | * gnu/build/linux-modules.scm (not-softdep-whitespace): New variable. (module-soft-dependencies): New procedure.
* linux-modules: Raise an error when a kernel module cannot be found.Ludovic Courtès2018-08-29
| | | | | | | | | | | | | | | | | | | | | 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.
* linux-modules: Adjust 'section-contents' procedure.Ludovic Courtès2018-08-21
| | | | | | | * gnu/build/linux-modules.scm (section-contents): Honor SECTION as was intended. (modinfo-section-contents): Pass 'section-contents' a section, not a section name.
* linux-initrd: Try several file names when looking up modules.Ludovic Courtès2018-07-29
| | | | | | | | | | | 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.
* linux-initrd: Improve check of initrd modules.Ludovic Courtès2018-07-29
| | | | | | | | 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'.
* linux-initrd: Module check correctly handles hyphen vs. underscore.Ludovic Courtès2018-06-14
| | | | | | | | | | 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.
* glob: Add an extra glob pattern compilation stage.Ludovic Courtès2018-03-18
| | | | | | | | | | | | | * 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'.
* linux-modules: 'load-linux-module*' honors BLACK-LIST in recursive calls.Ludovic Courtès2018-03-18
| | | | | * gnu/build/linux-modules.scm (load-linux-module*): Pass BLACK-LIST in recursive call.
* linux-modules: Add 'current-kernel-directory'.Ludovic Courtès2018-03-18
| | | | | * gnu/build/linux-modules.scm (current-kernel-directory): New procedure. (current-alias-file): Use it.
* linux-modules: Add module-aliases.Danny Milosavljevic2018-03-03
| | | | * gnu/build/linux-modules.scm (module-aliases): New variable.
* linux-modules: Add 'device-module-aliases' and related procedures.Ludovic Courtès2018-03-02
| | | | | | | | | * 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.
* linux-modules: Use 'load-linux-module/fd'.Ludovic Courtès2018-02-28
| | | | | | | 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'.
* build: Fix compilation warnings.Mathieu Othacehe2017-04-11
| | | | | | | | | | | * 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>
* linux-modules: Use normalized module names for 'modprobe.blacklist'.Ludovic Courtès2016-02-21
| | | | | | * gnu/build/linux-modules.scm (normalize-module-name): New procedure. (file-name->module-name): Use it. (module-black-list): Expound docstring.
* linux-modules: Support 'modprobe.blacklist' on the command line.Ludovic Courtès2016-01-16
| | | | | | | | | * 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.
* linux-boot: Remove verbose output for module loads.Ludovic Courtès2016-01-05
| | | | | | | * 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'.
* linux-modules: Correctly propagate error code from 'init_module'.Ludovic Courtès2014-11-28
| | | | | | | * 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.
* system: Add (gnu build linux-modules).Ludovic Courtès2014-11-28
* gnu/build/linux-modules.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it.