From d67d90b9ab0aa6b7a9532ccb3788a34edde7bc52 Mon Sep 17 00:00:00 2001
From: swedebugia <swedebugia@riseup.net>
Date: Fri, 9 Nov 2018 22:52:12 +0100
Subject: [PATCH] gnu: Deprecate linux-module shpchp and tell user to remove
it.
* gnu/build/linux-modules.scm (load-linux-module*): Add argument
'remove-deprecated-modules'.
* gnu/build/linux-modules.scm (load-dependencies): Add keyword
'#:remove-deprecate-modules'.
* gnu/system/mapped-devices.scm (check-device-initrd-modules): New if
statement raising a condition if shpchp is found.
---
gnu/build/linux-modules.scm | 13 +++++++++++--
gnu/system/mapped-devices.scm | 28 +++++++++++++++++++---------
2 files changed, 30 insertions(+), 11 deletions(-)
@@ -1,6 +1,8 @@
+
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014, 2016, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2018 swedebugia <swedebugia@riseup.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -227,7 +229,13 @@ not a file name."
#:key
(recursive? #t)
(lookup-module dot-ko)
- (black-list (module-black-list)))
+ (black-list (module-black-list))
+ ;; Deprecate modules included in linux-libre but
+ ;; which might still be present in the users
+ ;; config.scm.
+ ;; We tell the users to remove it from their
+ ;; config.scm in gnu/system/mapped-devices.scm
+ (remove-deprecated-modules 'shpchp))
"Load Linux module from FILE, the name of a '.ko' file; return true on
success, false otherwise. When RECURSIVE? is true, load its dependencies
first (à la 'modprobe'.) The actual files containing modules depended on are
@@ -245,7 +253,8 @@ appears in BLACK-LIST are not loaded."
(let ((dependencies (module-dependencies file)))
(every (cut load-linux-module* <>
#:lookup-module lookup-module
- #:black-list black-list)
+ #:black-list black-list
+ #:remove-deprecate-modules remove-deprecate-modules)
(map lookup-module dependencies))))
(and (not (black-listed? (file-name->module-name file)))
@@ -2,6 +2,7 @@
;;; Copyright © 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2017, 2018 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2018 swedebugia <swedebugia@riseup.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -142,13 +143,22 @@ DEVICE must be a \"/dev\" file name."
;; "usb_storage"), not file names (e.g., "usb-storage.ko"). This is
;; OK because we have machinery that accepts both the hyphen and the
;; underscore version.
- (raise (condition
- (&message
- (message (format #f (G_ "you may need these modules \
+ (if (eqv (missing 'shpchp)
+ ;; Tell user to remove shpchp from config.scm
+ ;; True
+ (raise (condition
+ (&message
+ (message (format #f (G_ "shpchp is no longer \
+needed because it has been included in linux-libre. Please remove it from \
+your config.scm to continue"))))))
+ ;; Else
+ (raise (condition
+ (&message
+ (message (format #f (G_ "you may need these modules \
in the initrd for ~a:~{ ~a~}")
- device missing)))
- (&fix-hint
- (hint (format #f (G_ "Try adding them to the
+ device missing)))
+ (&fix-hint
+ (hint (format #f (G_ "Try adding them to the
@code{initrd-modules} field of your @code{operating-system} declaration, along
these lines:
@@ -161,9 +171,9 @@ these lines:
If you think this diagnostic is inaccurate, use the @option{--skip-checks}
option of @command{guix system}.\n")
- missing)))
- (&error-location
- (location (source-properties->location location)))))))))
+ missing)))
+ (&error-location
+ (location (source-properties->location location)))))))))
;;;
--
2.18.0