all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#60010: [version 1.4.0] AMD screen stays black; modprobe fails
@ 2022-12-12 16:27 pelzflorian (Florian Pelz)
  2022-12-12 20:11 ` Josselin Poiret via Bug reports for GNU Guix
  2022-12-12 23:18 ` Ludovic Courtès
  0 siblings, 2 replies; 14+ messages in thread
From: pelzflorian (Florian Pelz) @ 2022-12-12 16:27 UTC (permalink / raw)
  To: 60010

[-- Attachment #1: Type: text/plain, Size: 1491 bytes --]

Just now I tried the installer on an AMD desktop but the graphical
installer screen stays black.  Same on an AMD laptop.  After switching
to another TTY, dmesg tells me this:

> [   11.625264] shepherd[1]: Service host-name has been started.
> [   11.625839] shepherd[1]: Service user-homes has been started.
> [   11.629846] shepherd[1]: 
> [   11.630078] [
> [   11.630230] modprobe
> [   11.630382] ] 
> [   11.630592] modprobe: FATAL: Module uvesafb not found in directory /lib/modules/6.0.10-gnu
> 
> [   11.631734] shepherd[1]: Failed to start maybe-uvesafb in the background.
> [   15.185776] 0000:04:00.0: Missing Free firmware (non-Free firmware loading is disabled)

I tried manually running the modprobe command from
gnu/system/install.scm:

/gnu/store/vh4g56m35wwlfg300s4qafykxjy09511-kmod-29/bin/modprobe uvesafb v86d=/gnu/store/na24a7653hyf0pghhw9nhfr6mi15v6cz-v86d-0.1.10/sbin/v86d mode_option=1024x768

Works fine.  I can switch back by Ctrl-Alt-F1 and the graphical
installer works.

/run/current-system/kernel/lib/modules/6.0.10-gnu/kernel/drivers/video/fbdev/uvesafb.ko.gz
exists.

So I tried waiting until it exists before modprobe (in the attached
patch).  But modprobe still fails in the same way, according to dmesg,
even though the file evidently already existed.

Why doesn’t modprobe find it?  Where does it look?

I will try tomorrow to get an strace.  The installer worked fine in …
August I believe.

Regards,
Florian


[-- Attachment #2: installer-Fix-uvesafb-not-loading.patch --]
[-- Type: text/x-patch, Size: 2001 bytes --]

From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Mon, 12 Dec 2022 15:33:26 +0100
Subject: [PATCH doesnt work] installer: Fix uvesafb not loading.

* gnu/system/install.scm (uvesafb-shepherd-service): Wait before
invoking modprobe.
---
 gnu/system/install.scm | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index f6f1923121..ffde933990 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -4,7 +4,7 @@
 ;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2020 Florian Pelz <pelzflorian@pelzflorian.de>
+;;; Copyright © 2020, 2022 Florian Pelz <pelzflorian@pelzflorian.de>
 ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2022 Josselin Poiret <dev@jpoiret.xyz>
 ;;;
@@ -289,11 +289,18 @@ (define (uvesafb-shepherd-service _)
          (provision '(maybe-uvesafb))
          (requirement '(file-systems))
          (start #~(lambda ()
-                    (or (file-exists? "/dev/fb0")
-                        (invoke #+(file-append kmod "/bin/modprobe")
+		    (define (start-uvesafb)
+		      ;; HOW TO DO THIS THE RIGHT WAY??
+		      (if (file-exists? "/run/current-system/kernel/lib\
+/modules/6.0.10-gnu/kernel/drivers/video/fbdev/uvesafb.ko.gz")
+			  (invoke #+(file-append kmod "/bin/modprobe")
                                 "uvesafb"
                                 (string-append "v86d=" #$v86d "/sbin/v86d")
-                                "mode_option=1024x768"))))
+                                "mode_option=1024x768")
+			  ;; Wait and try again.
+			  (begin (sleep 1) (start-uvesafb))))
+                    (or (file-exists? "/dev/fb0")
+                        (start-uvesafb))))
          (respawn? #f)
          (one-shot? #t))))
 
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* bug#60010: [version 1.4.0] AMD screen stays black; modprobe fails
  2022-12-12 16:27 bug#60010: [version 1.4.0] AMD screen stays black; modprobe fails pelzflorian (Florian Pelz)
@ 2022-12-12 20:11 ` Josselin Poiret via Bug reports for GNU Guix
  2022-12-13 12:29   ` pelzflorian (Florian Pelz)
  2022-12-12 23:18 ` Ludovic Courtès
  1 sibling, 1 reply; 14+ messages in thread
From: Josselin Poiret via Bug reports for GNU Guix @ 2022-12-12 20:11 UTC (permalink / raw)
  To: pelzflorian (Florian Pelz), 60010

Hi Florian,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> writes:

> So I tried waiting until it exists before modprobe (in the attached
> patch).  But modprobe still fails in the same way, according to dmesg,
> even though the file evidently already existed.

I don't think there's a race issue with the files being available:
shepherd should start after system activation (so /run/current-system
exists), and after /gnu/store was mounted in the early userspace.

> I will try tomorrow to get an strace.  The installer worked fine in …
> August I believe.

You could also probably try logging the system* call in some temporary
log file, by using some bash redirection (or with-current-output-port
and friends).

By the way, why is the modprobe binary inside a #+?  The target will want
to be able to run the binary itself, right?  Shouldn't it be #$?

Best,
-- 
Josselin Poiret




^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#60010: [version 1.4.0] AMD screen stays black; modprobe fails
  2022-12-12 16:27 bug#60010: [version 1.4.0] AMD screen stays black; modprobe fails pelzflorian (Florian Pelz)
  2022-12-12 20:11 ` Josselin Poiret via Bug reports for GNU Guix
@ 2022-12-12 23:18 ` Ludovic Courtès
  2022-12-13 10:00   ` Ludovic Courtès
  1 sibling, 1 reply; 14+ messages in thread
From: Ludovic Courtès @ 2022-12-12 23:18 UTC (permalink / raw)
  To: pelzflorian (Florian Pelz); +Cc: 60010

Hi Florian,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

> Just now I tried the installer on an AMD desktop but the graphical
> installer screen stays black.  Same on an AMD laptop.  After switching
> to another TTY, dmesg tells me this:
>
>> [   11.625264] shepherd[1]: Service host-name has been started.
>> [   11.625839] shepherd[1]: Service user-homes has been started.
>> [   11.629846] shepherd[1]: 
>> [   11.630078] [
>> [   11.630230] modprobe
>> [   11.630382] ] 
>> [   11.630592] modprobe: FATAL: Module uvesafb not found in directory /lib/modules/6.0.10-gnu

[...]

> @@ -289,11 +289,18 @@ (define (uvesafb-shepherd-service _)
>           (provision '(maybe-uvesafb))
>           (requirement '(file-systems))
>           (start #~(lambda ()
> -                    (or (file-exists? "/dev/fb0")
> -                        (invoke #+(file-append kmod "/bin/modprobe")
> +		    (define (start-uvesafb)
> +		      ;; HOW TO DO THIS THE RIGHT WAY??
> +		      (if (file-exists? "/run/current-system/kernel/lib\
> +/modules/6.0.10-gnu/kernel/drivers/video/fbdev/uvesafb.ko.gz")
> +			  (invoke #+(file-append kmod "/bin/modprobe")
>                                  "uvesafb"
>                                  (string-append "v86d=" #$v86d "/sbin/v86d")
> -                                "mode_option=1024x768"))))
> +                                "mode_option=1024x768")

The ‘kmod’ package is patched to honor $LINUX_MODULE_DIRECTORY.
However, that variable is unset here:

--8<---------------cut here---------------start------------->8---
$ sudo cat /proc/1/environ |xargs -0
HOME=/ TERM=linux BOOT_IMAGE=/gnu/store/04ac4skvnrfdsdw7z3rl3ya8spcgsn6g-linux-libre-6.0.10/bzImage PATH=/gnu/store/zyk2b4zmy3vcaqs67s2czb6nsrbf3b68-e2fsck-static-1.46.4/sbin:/gnu/store/cchslqkqm3qix71bsjr72mw9fd85p8a5-loadkeys-static-2.5.1/bin GUIX_LOCPATH=/gnu/store/mw3py6smb1pk8yx298hd9ivz9lzbksqi-glibc-utf8-locales-2.33/lib/locale
--8<---------------cut here---------------end--------------->8---

So you may need to add:

  (setenv "LINUX_MODULE_DIRECTORY" "/run/booted-system/kernel/lib/modules")

Besides, but that’s more about aesthetics, it would make sense to use
(gnu build linux-modules) instead of calling out to ‘modprobe’, along
these lines:

  (load-linux-modules-from-directory '("uvesafb")
                                     "/run/booted-system/kernel/lib/modules")

HTH!

Ludo’.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#60010: [version 1.4.0] AMD screen stays black; modprobe fails
  2022-12-12 23:18 ` Ludovic Courtès
@ 2022-12-13 10:00   ` Ludovic Courtès
  2022-12-13 12:50     ` pelzflorian (Florian Pelz)
  0 siblings, 1 reply; 14+ messages in thread
From: Ludovic Courtès @ 2022-12-13 10:00 UTC (permalink / raw)
  To: pelzflorian (Florian Pelz); +Cc: 60010

[-- Attachment #1: Type: text/plain, Size: 216 bytes --]

Ludovic Courtès <ludo@gnu.org> skribis:

> So you may need to add:
>
>   (setenv "LINUX_MODULE_DIRECTORY" "/run/booted-system/kernel/lib/modules")

Specifically, here’s the minimal change we should test:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1269 bytes --]

diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index f6f1923121..a512ace29e 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -289,11 +289,16 @@ (define (uvesafb-shepherd-service _)
          (provision '(maybe-uvesafb))
          (requirement '(file-systems))
          (start #~(lambda ()
-                    (or (file-exists? "/dev/fb0")
-                        (invoke #+(file-append kmod "/bin/modprobe")
-                                "uvesafb"
-                                (string-append "v86d=" #$v86d "/sbin/v86d")
-                                "mode_option=1024x768"))))
+                    (unless (file-exists? "/dev/fb0")
+                      (setenv "LINUX_MODULE_DIRECTORY"
+                              "/run/booted-system/kernel/lib/modules")
+                      ;; TODO: Use 'load-linux-modules-from-directory' instead.
+                      (invoke #+(file-append kmod "/bin/modprobe")
+                              "uvesafb"
+                              (string-append "v86d=" #$v86d "/sbin/v86d")
+                              "mode_option=1024x768")
+                      (unsetenv "LINUX_MODULE_DIRECTORY")
+                      #t)))
          (respawn? #f)
          (one-shot? #t))))
 

[-- Attachment #3: Type: text/plain, Size: 21 bytes --]


Thanks,
Ludo’.

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* bug#60010: [version 1.4.0] AMD screen stays black; modprobe fails
  2022-12-12 20:11 ` Josselin Poiret via Bug reports for GNU Guix
@ 2022-12-13 12:29   ` pelzflorian (Florian Pelz)
  0 siblings, 0 replies; 14+ messages in thread
From: pelzflorian (Florian Pelz) @ 2022-12-13 12:29 UTC (permalink / raw)
  To: Josselin Poiret; +Cc: 60010

[-- Attachment #1: Type: text/plain, Size: 1607 bytes --]

Thank you Josselin.

Josselin Poiret <dev@jpoiret.xyz> writes:
> I don't think there's a race issue with the files being available:

Yes apparently, but it is some kind of race.

BTW it happens on master branch too despite its more recent linux.

> By the way, why is the modprobe binary inside a #+?  The target will want
> to be able to run the binary itself, right?  Shouldn't it be #$?

You are right, I guess.  But I will later try replacing it with Ludo’s
load-linux-modules-from-directory instead.  Perhaps that even gets the
install image small enough for a CDROM again? :)

>> I will try tomorrow to get an strace.  The installer worked fine in …
>> August I believe.
>
> You could also probably try logging the system* call in some temporary
> log file, by using some bash redirection (or with-current-output-port
> and friends).

I replaced the “(invoke #+(file-append kmod "/bin/modprobe") "uvesafb" …”
by a convoluted

(with-output-to-file "/tmp/strace"
  (lambda ()
    (with-error-to-port
     (current-output-port)
     (lambda ()
       (open-pipe* OPEN_READ
                   #+(file-append strace "/bin/strace")
                   "-f"
                   #+(file-append kmod "/bin/modprobe")
                   "uvesafb"

but now the strace is a workaround and the modprobe succeeds.  Either
way, /tmp/strace shows that modprobe first reads
/run/booted-system/kernel/lib/modules/6.0.10-gnu/modules.softdep and the
like.  The successful strace only eventually goes on to read
uvesafb.ko.gz.

For completeness, the strace ends with


[-- Attachment #2: strace --]
[-- Type: text/plain, Size: 6155 bytes --]

openat(AT_FDCWD, "/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0203\0\0\0\0\0\0"..., 832) = 832
pread64(3, "\4\0\0\0 \0\0\0\5\0\0\0GNU\0\1\0\1\300\4\0\0\0\v\0\0\0\0\0\0\0"..., 48, 94696) = 48
newfstatat(3, "", {st_mode=S_IFREG|0444, st_size=100760, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc734a32000
mmap(NULL, 103496, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fc734a18000
mmap(0x7fc734a1b000, 69632, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7fc734a1b000
mmap(0x7fc734a2c000, 16384, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x7fc734a2c000
mmap(0x7fc734a30000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7fc734a30000
close(3)                                = 0
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc734a15000
arch_prctl(ARCH_SET_FS, 0x7fc734a15740) = 0
mprotect(0x7fc734be7000, 16384, PROT_READ) = 0
mprotect(0x7fc734a30000, 4096, PROT_READ) = 0
mprotect(0x7fc734c11000, 4096, PROT_READ) = 0
mprotect(0x7fc734c2d000, 4096, PROT_READ) = 0
mprotect(0x7fc734c5a000, 4096, PROT_READ) = 0
mprotect(0x7fc734d69000, 4096, PROT_READ) = 0
mprotect(0x425000, 4096, PROT_READ)     = 0
mprotect(0x7fc734d9c000, 8192, PROT_READ) = 0
munmap(0x7fc734d6b000, 6584)            = 0
set_tid_address(0x7fc734a15a10)         = 153
set_robust_list(0x7fc734a15a20, 24)     = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x7fc734c196a0, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7fc734c24d80}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7fc734c19740, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7fc734c24d80}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
brk(NULL)                               = 0x1882000
brk(0x18a3000)                          = 0x18a3000
uname({sysname="Linux", nodename="gnu", ...}) = 0
newfstatat(AT_FDCWD, "/gnu/store/vh4g56m35wwlfg300s4qafykxjy09511-kmod-29/etc/modprobe.d", 0x7ffe93ffa1f0, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/run/modprobe.d", 0x7ffe93ffa1f0, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/local/lib/modprobe.d", 0x7ffe93ffa1f0, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/lib/modprobe.d", 0x7ffe93ffa1f0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/booted-system/kernel/lib/modules/6.0.10-gnu/modules.softdep", O_RDONLY|O_CLOEXEC) = 3
fcntl(3, F_GETFL)                       = 0x8000 (flags O_RDONLY|O_LARGEFILE)
newfstatat(3, "", {st_mode=S_IFREG|0444, st_size=1424, ...}, AT_EMPTY_PATH) = 0
read(3, "# Soft dependencies extracted fr"..., 2048) = 1424
read(3, "", 2048)                       = 0
close(3)                                = 0
openat(AT_FDCWD, "/proc/cmdline", O_RDONLY|O_CLOEXEC) = 3
read(3, "BOOT_IMAGE=/gnu/store/3qdad0k7wv"..., 4095) = 300
read(3, "", 3795)                       = 0
close(3)                                = 0
openat(AT_FDCWD, "/run/booted-system/kernel/lib/modules/6.0.10-gnu/modules.dep.bin", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0444, st_size=1050966, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 1050966, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fc734914000
close(3)                                = 0
openat(AT_FDCWD, "/run/booted-system/kernel/lib/modules/6.0.10-gnu/modules.alias.bin", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0444, st_size=1522188, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 1522188, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fc7347a0000
close(3)                                = 0
openat(AT_FDCWD, "/run/booted-system/kernel/lib/modules/6.0.10-gnu/modules.symbols.bin", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0444, st_size=780289, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 780289, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fc7346e1000
close(3)                                = 0
openat(AT_FDCWD, "/run/booted-system/kernel/lib/modules/6.0.10-gnu/modules.builtin.alias.bin", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0444, st_size=0, ...}, AT_EMPTY_PATH) = 0
close(3)                                = 0
openat(AT_FDCWD, "/run/booted-system/kernel/lib/modules/6.0.10-gnu/modules.builtin.bin", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0444, st_size=12061, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 12061, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fc7346de000
close(3)                                = 0
openat(AT_FDCWD, "/sys/module/uvesafb/initstate", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/sys/module/uvesafb", 0x7ffe93ffa110, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/sys/module/uvesafb/initstate", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/sys/module/uvesafb", 0x7ffe93ffa110, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/booted-system/kernel/lib/modules/6.0.10-gnu/kernel/drivers/video/fbdev/uvesafb.ko.gz", O_RDONLY|O_CLOEXEC) = 3
read(3, "\37\213\10\0\0\0", 6)          = 6
lseek(3, 0, SEEK_SET)                   = 0
lseek(3, 0, SEEK_CUR)                   = 0
mmap(NULL, 4198400, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc7342dd000
read(3, "\37\213\10\0\0\0\0\0\0\3\354}\17x\24\325\271\367l\262\204\5\301\211\210\n^\257\214mPh"..., 8192) = 8192
read(3, "\235.\211\323\224\200\263\3015\2\347\1W\361\307\223\327j\364\256:\237\7g\237\4|#\274\36|\253"..., 8192) = 6966
read(3, "", 1226)                       = 0
init_module(0x7fc7342dd010, 54160, "v86d=/gnu/store/na24a7653hyf0pgh"...) = 0
munmap(0x7fc7342dd000, 4198400)         = 0
close(3)                                = 0
munmap(0x7fc734914000, 1050966)         = 0
munmap(0x7fc7347a0000, 1522188)         = 0
munmap(0x7fc7346e1000, 780289)          = 0
munmap(0x7fc7346de000, 12061)           = 0
exit_group(0)                           = ?
+++ exited with 0 +++

[-- Attachment #3: Type: text/plain, Size: 18 bytes --]


Regards,
Florian

^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#60010: [version 1.4.0] AMD screen stays black; modprobe fails
  2022-12-13 10:00   ` Ludovic Courtès
@ 2022-12-13 12:50     ` pelzflorian (Florian Pelz)
  2022-12-13 13:03       ` Ludovic Courtès
  2022-12-13 13:51       ` pelzflorian (Florian Pelz)
  0 siblings, 2 replies; 14+ messages in thread
From: pelzflorian (Florian Pelz) @ 2022-12-13 12:50 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 60010

Ludovic Courtès <ludo@gnu.org> writes:
> Specifically, here’s the minimal change we should test:[…]
> +                    (unless (file-exists? "/dev/fb0")
> +                      (setenv "LINUX_MODULE_DIRECTORY"
> +                              "/run/booted-system/kernel/lib/modules")

Thanks for the patch.

I found I can test in QEMU if I put nomodeset in the kernel arguments
in GRUB.

Without the patch, the screen stays black there too.
With the patch, it hrmm it also stays black.

I will next try using 'load-linux-modules-from-directory' and no
modprobe.

Regards,
Florian




^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#60010: [version 1.4.0] AMD screen stays black; modprobe fails
  2022-12-13 12:50     ` pelzflorian (Florian Pelz)
@ 2022-12-13 13:03       ` Ludovic Courtès
  2022-12-14 13:49         ` pelzflorian (Florian Pelz)
  2022-12-13 13:51       ` pelzflorian (Florian Pelz)
  1 sibling, 1 reply; 14+ messages in thread
From: Ludovic Courtès @ 2022-12-13 13:03 UTC (permalink / raw)
  To: pelzflorian (Florian Pelz); +Cc: 60010

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:
>> Specifically, here’s the minimal change we should test:[…]
>> +                    (unless (file-exists? "/dev/fb0")
>> +                      (setenv "LINUX_MODULE_DIRECTORY"
>> +                              "/run/booted-system/kernel/lib/modules")
>
> Thanks for the patch.
>
> I found I can test in QEMU if I put nomodeset in the kernel arguments
> in GRUB.
>
> Without the patch, the screen stays black there too.
> With the patch, it hrmm it also stays black.

Do you see hints as to whether uvesafb gets loaded?

You can do that by adding “console=ttyS0” to the kernel arguments and by
passing ‘-serial stdio’ to QEMU.

Ludo’.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#60010: [version 1.4.0] AMD screen stays black; modprobe fails
  2022-12-13 12:50     ` pelzflorian (Florian Pelz)
  2022-12-13 13:03       ` Ludovic Courtès
@ 2022-12-13 13:51       ` pelzflorian (Florian Pelz)
  2022-12-13 16:37         ` Ludovic Courtès
  1 sibling, 1 reply; 14+ messages in thread
From: pelzflorian (Florian Pelz) @ 2022-12-13 13:51 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 60010

[-- Attachment #1: Type: text/plain, Size: 795 bytes --]

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> writes:
> I will next try using 'load-linux-modules-from-directory' and no
> modprobe.

I tried the attached patch.  Doesn’t work, still black (in QEMU).

Says the dmesg:
> [   11.183789] shepherd[1]: Service user-homes has been started.
> [   11.184555] shepherd[1]: Service user-processes has been started.
> [   11.185587] shepherd[1]: Service host-name has been started.
> [   11.186350] shepherd[1]: Service user-homes has been started.
> [   11.187383] shepherd[1]: Failed to start maybe-uvesafb in the background.
> [   15.213524] 8021q: 802.1Q VLAN Support v1.8
> [   15.213541] 8021q: adding VLAN 0 to HW filter on device eth0

And nothing more.

Maybe there is a mistake in my patch.

Regards,
Florian


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: load-linux-modules.patch --]
[-- Type: text/x-patch, Size: 2167 bytes --]

diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index f6f1923121..8456cc1570 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -37,6 +37,7 @@ (define-module (gnu system install)
   #:use-module ((guix store) #:select (%store-prefix))
   #:use-module (guix utils)
   #:use-module (gnu installer)
+  #:use-module (gnu build linux-modules)
   #:use-module (gnu system locale)
   #:use-module (gnu services avahi)
   #:use-module (gnu services dbus)
@@ -289,14 +290,20 @@ (define (uvesafb-shepherd-service _)
          (provision '(maybe-uvesafb))
          (requirement '(file-systems))
          (start #~(lambda ()
-                    (or (file-exists? "/dev/fb0")
-                        (invoke #+(file-append kmod "/bin/modprobe")
-                                "uvesafb"
-                                (string-append "v86d=" #$v86d "/sbin/v86d")
-                                "mode_option=1024x768"))))
+                    (unless (file-exists? "/dev/fb0")
+                      (load-linux-modules-from-directory '("uvesafb") "\
+/run/booted-system/kernel/lib/modules"))))
          (respawn? #f)
          (one-shot? #t))))
 
+(define uvesafb-config
+  (computed-file "uvesafb.conf"
+                 #~(with-output-to-file #$output
+                     (lambda ()
+                       (display
+                        (string-append "options v86d=" #$v86d "/sbin/v86d"
+                                       " " "mode_option=1024x768"))))))
+
 (define uvesafb-service-type
   (service-type
    (name 'uvesafb)
@@ -450,7 +457,10 @@ (define bare-bones-os
      ;; installer.  Some may also need a kernel parameter like nomodeset
      ;; or vga=793, but we leave that for the user to specify in GRUB.
      `(,@(if (supported-package? v86d system)
-             (list (service uvesafb-service-type))
+             (list (simple-service 'uvesafb-config etc-service-type
+                                             (list `("modprobe.d/uvesafb.conf"
+                                                     ,uvesafb-config)))
+                   (service uvesafb-service-type))
              '())))))
 
 (define %issue

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* bug#60010: [version 1.4.0] AMD screen stays black; modprobe fails
  2022-12-13 13:51       ` pelzflorian (Florian Pelz)
@ 2022-12-13 16:37         ` Ludovic Courtès
  0 siblings, 0 replies; 14+ messages in thread
From: Ludovic Courtès @ 2022-12-13 16:37 UTC (permalink / raw)
  To: pelzflorian (Florian Pelz); +Cc: 60010

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

>           (provision '(maybe-uvesafb))
>           (requirement '(file-systems))
>           (start #~(lambda ()
> -                    (or (file-exists? "/dev/fb0")
> -                        (invoke #+(file-append kmod "/bin/modprobe")
> -                                "uvesafb"
> -                                (string-append "v86d=" #$v86d "/sbin/v86d")
> -                                "mode_option=1024x768"))))
> +                    (unless (file-exists? "/dev/fb0")
> +                      (load-linux-modules-from-directory '("uvesafb") "\
> +/run/booted-system/kernel/lib/modules"))))

To make it work, you’d need to add a ‘modules’ field so that (gnu build
linux-modules) is in scope, plus throw in ‘with-imported-modules’.

I’d say let’s stick to the minimal change where we still invoke
‘modprobe’.

Ludo’.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#60010: [version 1.4.0] AMD screen stays black; modprobe fails
  2022-12-13 13:03       ` Ludovic Courtès
@ 2022-12-14 13:49         ` pelzflorian (Florian Pelz)
  2022-12-14 23:29           ` Ludovic Courtès
  0 siblings, 1 reply; 14+ messages in thread
From: pelzflorian (Florian Pelz) @ 2022-12-14 13:49 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 60010

Ludovic Courtès <ludo@gnu.org> writes:
> Do you see hints as to whether uvesafb gets loaded?
>
> You can do that by adding “console=ttyS0” to the kernel arguments and by
> passing ‘-serial stdio’ to QEMU.

This serial output shows nothing about uvesafb, but dmesg contains about
uvesafb exactly the same modprobe failure as initially without
LINUX_MODULE_DIRECTORY.

I shall try Brice Waegeneire’s kernel-module-loader-service.  This
cannot be a solution because some computers do already have /dev/fb0 and
doing modprobe uvesafb regardless makes their screen go awry.  But it
will be interesting to know if it still works.

Also of course uvesafb still worked fine in November when we added
hardware support warnings to the installer, not long ago, not August.
Probably restoring the old linux kernel would be a workaround too.

Regards,
Florian




^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#60010: [version 1.4.0] AMD screen stays black; modprobe fails
  2022-12-14 13:49         ` pelzflorian (Florian Pelz)
@ 2022-12-14 23:29           ` Ludovic Courtès
  2022-12-15 17:42             ` pelzflorian (Florian Pelz)
  0 siblings, 1 reply; 14+ messages in thread
From: Ludovic Courtès @ 2022-12-14 23:29 UTC (permalink / raw)
  To: pelzflorian (Florian Pelz); +Cc: 60010

[-- Attachment #1: Type: text/plain, Size: 935 bytes --]

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:
>> Do you see hints as to whether uvesafb gets loaded?
>>
>> You can do that by adding “console=ttyS0” to the kernel arguments and by
>> passing ‘-serial stdio’ to QEMU.
>
> This serial output shows nothing about uvesafb, but dmesg contains about
> uvesafb exactly the same modprobe failure as initially without
> LINUX_MODULE_DIRECTORY.

Oooh.  ‘invoke’ uses ‘system*’, and in shepherd 0.9.3, ‘system*’ is
implemented in terms of ‘fork+exec-command’, which only passes the
environment variables listed in ‘default-environment-variables’ by
default.  Thus, (setenv "LINUX_MODULE_DIRECTORY" …) had no effect on the
child process; it just wouldn’t see LINUX_MODULE_DIRECTORY.

I think the patch below will be good… or very close to it.

Lemme know!

Thanks,
Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1433 bytes --]

diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index f6f1923121..e524729baf 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -289,11 +289,21 @@ (define (uvesafb-shepherd-service _)
          (provision '(maybe-uvesafb))
          (requirement '(file-systems))
          (start #~(lambda ()
-                    (or (file-exists? "/dev/fb0")
+                    (unless (file-exists? "/dev/fb0")
+                      ;; In shepherd 0.9.3, 'system*' is implemented in terms
+                      ;; of 'fork+exec-command'.  Thus, set
+                      ;; 'default-environment-variables' to pass an extra
+                      ;; variable to the child process.
+                      (parameterize ((default-environment-variables
+                                       `("LINUX_MODULE_DIRECTORY=/run/booted-system/kernel/lib/modules"
+                                         ,(environ))))
+                        ;; TODO: Use 'load-linux-modules-from-directory'
+                        ;; instead.
                         (invoke #+(file-append kmod "/bin/modprobe")
                                 "uvesafb"
                                 (string-append "v86d=" #$v86d "/sbin/v86d")
-                                "mode_option=1024x768"))))
+                                "mode_option=1024x768"))
+                      #t)))
          (respawn? #f)
          (one-shot? #t))))
 

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* bug#60010: [version 1.4.0] AMD screen stays black; modprobe fails
  2022-12-14 23:29           ` Ludovic Courtès
@ 2022-12-15 17:42             ` pelzflorian (Florian Pelz)
  2022-12-15 23:37               ` Ludovic Courtès
  0 siblings, 1 reply; 14+ messages in thread
From: pelzflorian (Florian Pelz) @ 2022-12-15 17:42 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 60010

[-- Attachment #1: Type: text/plain, Size: 1057 bytes --]

Hello Ludo, sorry to say I attempted your modprobe patch that uses
(parameterize ((default-environment-variables …

No good.  Screen is black.  Same [ modprobe ] failure in dmesg on QEMU
and on real AMD hardware.

There are workarounds by surrounding modprobe within strace or
alternatively using kernel-module-loader-service (attached; but again,
without the file-exists? check, this would cause new issues on some
machines that dont need uvesafb).

A stupid

diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index f6f1923121..a99cf09e31 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -289,6 +289,7 @@ (define (uvesafb-shepherd-service _)
          (provision '(maybe-uvesafb))
          (requirement '(file-systems))
          (start #~(lambda ()
+                   (sleep 1)
                     (or (file-exists? "/dev/fb0")
                         (invoke #+(file-append kmod "/bin/modprobe")
                                 "uvesafb"


fails though.

All bad…

Regards,
Florian

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: use-kernel-module-loader.patch --]
[-- Type: text/x-patch, Size: 2925 bytes --]

diff --git a/gnu/system/install.scm b/gnu/sysdiff --git a/gnu/system/install.scm b/gnu/system/install.scm
index f6f1923121..2a1f401536 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -40,6 +40,7 @@ (define-module (gnu system install)
   #:use-module (gnu system locale)
   #:use-module (gnu services avahi)
   #:use-module (gnu services dbus)
+  #:use-module (gnu services linux)
   #:use-module (gnu services networking)
   #:use-module (gnu services shepherd)
   #:use-module (gnu services ssh)
@@ -283,29 +284,22 @@ (define %nscd-minimal-caches
 ;; These define a service to load the uvesafb kernel module with the
 ;; appropriate options.  The GUI installer needs it when the machine does not
 ;; support Kernel Mode Setting.  Otherwise kmscon is missing /dev/fb0.
-(define (uvesafb-shepherd-service _)
-  (list (shepherd-service
-         (documentation "Load the uvesafb kernel module if needed.")
-         (provision '(maybe-uvesafb))
-         (requirement '(file-systems))
-         (start #~(lambda ()
-                    (or (file-exists? "/dev/fb0")
-                        (invoke #+(file-append kmod "/bin/modprobe")
-                                "uvesafb"
-                                (string-append "v86d=" #$v86d "/sbin/v86d")
-                                "mode_option=1024x768"))))
-         (respawn? #f)
-         (one-shot? #t))))
-
-(define uvesafb-service-type
-  (service-type
-   (name 'uvesafb)
-   (extensions
-    (list (service-extension shepherd-root-service-type
-                             uvesafb-shepherd-service)))
-   (description
-    "Load the @code{uvesafb} kernel module with the right options.")
-   (default-value #t)))
+(define uvesafb-config
+  (computed-file "uvesafb.conf"
+                 #~(with-output-to-file #$output
+                     (lambda ()
+                       (display
+                        (string-append "options uvesafb"
+                                      " " "v86d=" #$v86d "/sbin/v86d"
+                                       " " "mode_option=1024x768"))))))
+
+(define uvesafb-services
+  (list (service kernel-module-loader-service-type
+                 '("uvesafb"))
+       (simple-service 'uvesafb-config etc-service-type
+                                             (list `("modprobe.d/uvesafb.conf"
+                                                     ,uvesafb-config)))))
+       
 
 (define* (%installation-services #:key (system (or (and=>
                                                     (%current-target-system)
@@ -450,8 +444,7 @@ (define bare-bones-os
      ;; installer.  Some may also need a kernel parameter like nomodeset
      ;; or vga=793, but we leave that for the user to specify in GRUB.
      `(,@(if (supported-package? v86d system)
-             (list (service uvesafb-service-type))
-             '())))))
+             uvesafb-services)))))
 
 (define %issue
   ;; Greeting.

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* bug#60010: [version 1.4.0] AMD screen stays black; modprobe fails
  2022-12-15 17:42             ` pelzflorian (Florian Pelz)
@ 2022-12-15 23:37               ` Ludovic Courtès
  2022-12-16 11:48                 ` pelzflorian (Florian Pelz)
  0 siblings, 1 reply; 14+ messages in thread
From: Ludovic Courtès @ 2022-12-15 23:37 UTC (permalink / raw)
  To: pelzflorian (Florian Pelz); +Cc: 60010

Hi Florian,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

> Hello Ludo, sorry to say I attempted your modprobe patch that uses
> (parameterize ((default-environment-variables …

Bah, turns out it’s trickier than this.  See
<https://issues.guix.gnu.org/60106>.

I figured I could test it in a VM.  I ended up with a minimal change,
pushed in commit b1aef25453067004279c4267cf25e8d6d365890d, that lets
modprobe load uvesafb for good (it was all about setting
‘LINUX_MODULE_DIRECTORY’).

Let me know if anything’s amiss!

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#60010: [version 1.4.0] AMD screen stays black; modprobe fails
  2022-12-15 23:37               ` Ludovic Courtès
@ 2022-12-16 11:48                 ` pelzflorian (Florian Pelz)
  0 siblings, 0 replies; 14+ messages in thread
From: pelzflorian (Florian Pelz) @ 2022-12-16 11:48 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 60010

Ludovic Courtès <ludo@gnu.org> writes:
> I ended up with a minimal change,
> pushed in commit b1aef25453067004279c4267cf25e8d6d365890d, that lets
> modprobe load uvesafb for good (it was all about setting
> ‘LINUX_MODULE_DIRECTORY’).

Thank you Ludo for your excellent work.  All is good now on AMD hardware
(my laptop and PC).  I’m still not sure why LINUX_MODULE_DIRECTORY is
needed here and is not needed for kernel module loader service, but
whatever.

Regards,
Florian




^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-12-16 11:49 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-12 16:27 bug#60010: [version 1.4.0] AMD screen stays black; modprobe fails pelzflorian (Florian Pelz)
2022-12-12 20:11 ` Josselin Poiret via Bug reports for GNU Guix
2022-12-13 12:29   ` pelzflorian (Florian Pelz)
2022-12-12 23:18 ` Ludovic Courtès
2022-12-13 10:00   ` Ludovic Courtès
2022-12-13 12:50     ` pelzflorian (Florian Pelz)
2022-12-13 13:03       ` Ludovic Courtès
2022-12-14 13:49         ` pelzflorian (Florian Pelz)
2022-12-14 23:29           ` Ludovic Courtès
2022-12-15 17:42             ` pelzflorian (Florian Pelz)
2022-12-15 23:37               ` Ludovic Courtès
2022-12-16 11:48                 ` pelzflorian (Florian Pelz)
2022-12-13 13:51       ` pelzflorian (Florian Pelz)
2022-12-13 16:37         ` Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.