unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: swedebugia <swedebugia@riseup.net>
To: 33329@debbugs.gnu.org, rekado@elephly.net
Subject: [bug#33329] [PATCH] gnu: Deprecate linux-module shpchp and tell user to remove it.
Date: Fri, 9 Nov 2018 23:47:34 +0100	[thread overview]
Message-ID: <01fa8c80-c57c-f73a-cec1-af91cacb58bf@riseup.net> (raw)
In-Reply-To: <87h8jbang2.fsf@elephly.net>


[-- Attachment #1.1: Type: text/plain, Size: 1686 bytes --]

Hi

Ricardo, you mentioned that this needs to be fixed.

I made a patch to fix this. I did not test the patch as I have no idea 
how to do that.

I have not run the indent script on it.

Se attachment


-------- Forwarded Message --------
Subject: 	Re: GuixSD system reconfigure error
Date: 	Thu, 30 Aug 2018 17:22:53 +0200
From: 	Ricardo Wurmus <rekado@elephly.net>
To: 	Hebi Li <lihebi.com@gmail.com>
CC: 	help-guix@gnu.org




Hi,

>      https://github.com/lihebi/dothebi/blob/master/config.scm

I see you use the “shpchp” kernel module. This no longer exists in the
latest version of the kernel Linux. That’s what this really bad error
message tries to tell you:

> Backtrace:
>             8 (primitive-load "/gnu/store/vz7ci9rh483f2zps2cl174rd91b?")
> In ice-9/eval.scm:
>      619:8  7 (_ #f)
>     626:19  6 (_ #<directory (guile-user) 7cf140>)
>      159:9  5 (_ _)
> 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/0ahsvp7wx52zzh1rywbdbq78llcwb7id-linux-modules.drv' failed with exit code 1

(I only know this because I had the same problem.) Obviously, this
error message should be changed.

As a workaround you could switch to the LTS kernel where that module
still exists.

--
Ricardo



[-- Attachment #1.2: Type: text/html, Size: 3496 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Deprecate-linux-module-shpchp-and-tell-user-to-r.patch --]
[-- Type: text/x-patch; name="0001-gnu-Deprecate-linux-module-shpchp-and-tell-user-to-r.patch", Size: 5108 bytes --]

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(-)

diff --git a/gnu/build/linux-modules.scm b/gnu/build/linux-modules.scm
index 2d8117504..999ab4fc6 100644
--- a/gnu/build/linux-modules.scm
+++ b/gnu/build/linux-modules.scm
@@ -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)))
diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm
index a87466646..d30372c25 100644
--- a/gnu/system/mapped-devices.scm
+++ b/gnu/system/mapped-devices.scm
@@ -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)))))))))
 
 \f
 ;;;
-- 
2.18.0


       reply	other threads:[~2018-11-09 22:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87h8jbang2.fsf@elephly.net>
2018-11-09 22:47 ` swedebugia [this message]
2018-11-10 12:03   ` [bug#33329] [PATCH] gnu: Deprecate linux-module shpchp and tell user to remove it swedebugia
2018-11-10 22:31     ` Ludovic Courtès
2018-11-11  0:15       ` Brett Gilio
2018-11-11  7:27         ` swedebugia
2018-11-11 11:32           ` Ludovic Courtès
2018-11-11 18:42             ` swedebugia
2018-11-12  8:42               ` bug#33329: " Ludovic Courtès
2018-11-11 11:27         ` [bug#33329] " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=01fa8c80-c57c-f73a-cec1-af91cacb58bf@riseup.net \
    --to=swedebugia@riseup.net \
    --cc=33329@debbugs.gnu.org \
    --cc=rekado@elephly.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).