Subject: Re: bug#60010: [version 1.4.0] AMD screen stays black; modprobe fails

From: Ludovic Courtès <[email-masked]>
Date: Tue, 13 Dec 2022 00:18:52 +0100

Hi Florian,

"pelzflorian (Florian Pelz)" <[email-masked]> 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’.