Re: kmscon not working on MacBook

2020-03-29 Thread pelzflorian (Florian Pelz)
On Thu, Mar 26, 2020 at 05:53:11PM +0100, pelzflorian (Florian Pelz) wrote:
> On Thu, Mar 26, 2020 at 03:26:05AM +0100, Bengt Richter wrote:
> > Are you a member of the video group?
> 
> Indeed the issue was that the gdm user was not a member of the video
> group.  […]  I will push if nobody objects.

I pushed my change adding gdm to the video group in Guix.  I do not
think there is a downside.

Regards,
Florian



Re: kmscon not working on MacBook

2020-03-26 Thread pelzflorian (Florian Pelz)
On Thu, Mar 26, 2020 at 03:26:05AM +0100, Bengt Richter wrote:
> On +2020-03-26 00:00:18 +0100, pelzflorian (Florian Pelz) wrote:
> > on one of my computers uvesafb can only be used after „chmmod o+rw
> > /dev/fb0“ which is a security issue, I suppose.
> >
> 
> Are you a member of the video group?

Indeed the issue was that the gdm user was not a member of the video
group.  Thank you!

I have verified the attached patch makes it sufficient to run
`modprobe uvesafb v86d=$(guix build v86d | head -n1)/sbin/v86d
mode_option=1280x800-32` before `herd restart xorg-server` without any
additional chmod.  I will push if nobody objects.

I do however need to remove xf86-video-vesa via
set-xorg-configuration.  Perhaps xf86-video-vesa should not be among
the defaults if uvesafb is to be made a default.  Note that when not
running X as root, xf86-video-vesa does not work anyway.  That’s what
uvesafb is for.

If uvesafb should be made a default, v86d:testvbe could be used to
find a suitable resolution as a mode_option parameter.

However I still do not know how best to modprobe uvesafb
automatically.

Regards,
Florian
>From 419ec6f3866d223b88f195466d3e731090240a2a Mon Sep 17 00:00:00 2001
From: Florian Pelz 
Date: Thu, 26 Mar 2020 15:19:21 +0100
Subject: [PATCH] services: gdm: Add gdm user to 'video' supplementary group.

See .

* gnu/services/xorg.scm (%gdm-accounts): Set supplementary groups.
---
 gnu/services/xorg.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index 09379d40c3..d0196a299e 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -798,6 +798,7 @@ the GNOME desktop environment.")
 (user-account
  (name "gdm")
  (group "gdm")
+ (supplementary-groups '("video"))
  (system? #t)
  (comment "GNOME Display Manager user")
  (home-directory "/var/lib/gdm")
-- 
2.25.1



Re: kmscon not working on MacBook

2020-03-25 Thread Bengt Richter
Hi,

On +2020-03-26 00:00:18 +0100, pelzflorian (Florian Pelz) wrote:
> On Fri, Mar 20, 2020 at 09:48:50AM +0100, pelzflorian (Florian Pelz) wrote:
> > I would
> > like something similar to be included in the next release.  Maybe
> > kmscon works everywhere then.
> 
> Of course the machines that need uvesafb to show the installer also
> later have problems showing Xorg.  Maybe until Xorg on installed
> systems without Kernel Mode Setting works fine without manually
> fiddling with uvesafb or nonfree drivers, there is no use making the
> installer work.
> 
> Perhaps uvesafb could somehow be made to work automatically, however
> on one of my computers uvesafb can only be used after „chmmod o+rw
> /dev/fb0“ which is a security issue, I suppose.
>

Are you a member of the video group?
What do you see typing
stat /dev/fb0
? Maybe something to try?
Or not relevant to your context?

> 
> > ('nomodeset' is not needed; I leave it
> > in only for testing on computers where the graphical installer works
> > anyway when not passing 'nomodeset'.)
> 
> In fact nomodeset was needed on a friend’s AMD GPU system.  Probably
> one could blacklist yet another AMD graphics module instead of passing
> nomodeset.  But then the installer on AMD systems where the module is
> working fine would be limited to uvesafb.
> 
> Regards,
> Florian
> 

-- 
Regards,
Bengt Richter



Re: kmscon not working on MacBook

2020-03-25 Thread pelzflorian (Florian Pelz)
On Fri, Mar 20, 2020 at 09:48:50AM +0100, pelzflorian (Florian Pelz) wrote:
> I would
> like something similar to be included in the next release.  Maybe
> kmscon works everywhere then.

Of course the machines that need uvesafb to show the installer also
later have problems showing Xorg.  Maybe until Xorg on installed
systems without Kernel Mode Setting works fine without manually
fiddling with uvesafb or nonfree drivers, there is no use making the
installer work.

Perhaps uvesafb could somehow be made to work automatically, however
on one of my computers uvesafb can only be used after „chmmod o+rw
/dev/fb0“ which is a security issue, I suppose.


> ('nomodeset' is not needed; I leave it
> in only for testing on computers where the graphical installer works
> anyway when not passing 'nomodeset'.)

In fact nomodeset was needed on a friend’s AMD GPU system.  Probably
one could blacklist yet another AMD graphics module instead of passing
nomodeset.  But then the installer on AMD systems where the module is
working fine would be limited to uvesafb.

Regards,
Florian



Re: kmscon not working on MacBook

2020-03-20 Thread pelzflorian (Florian Pelz)
On Fri, Mar 20, 2020 at 09:48:50AM +0100, pelzflorian (Florian Pelz) wrote:
> The attached patch […]
Forgot attachment …
>From 2dd61d18b88f197d8d6951fe1dc97bafdf4fe03f Mon Sep 17 00:00:00 2001
From: Florian Pelz 
Date: Thu, 19 Mar 2020 15:50:00 +0100
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Subject: [PATCH 3/3] [for TESTING, only works for some machines] installer:
 Run installer in uvesafb.

* gnu/system/install.scm (installation-os): Load uvesafb before installer.
---
 gnu/system/install.scm | 29 -
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index c15c2c7814..88db4320b0 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -50,6 +50,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages nvi)
+  #:use-module (gnu packages xorg)
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-26)
   #:export (installation-os
@@ -304,8 +305,34 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m
 (define bare-bones-os
   (load "examples/bare-bones.tmpl"))
 
+(define (insmod-uvesafb-activation value)
+  #~(begin
+  (use-modules (guix build utils))
+  (symlink #$(file-append linux-libre "/lib") "/lib")))
+
+(define (insmod-uvesafb-shepherd-service _)
+  (list (shepherd-service
+ (provision '(insmod-uvesafb))
+ (requirement '(user-processes udev dbus-system))
+ (start #~(make-forkexec-constructor
+   (list #+(file-append kmod "/bin/modprobe") "uvesafb"
+ (string-append "v86d=" #$v86d "/sbin/v86d")
+ "mode_option=1024x768")))
+ (stop #~(make-kill-destructor))
+ (one-shot? #t
+
 (list (service virtual-terminal-service-type)
 
+  (service
+   (service-type (name 'insmod-uvesafb)
+ (extensions
+  (list (service-extension activation-service-type
+   insmod-uvesafb-activation)
+(service-extension shepherd-root-service-type
+   
insmod-uvesafb-shepherd-service)))
+ (description "Start uvesafb."))
+   #t)
+
   (service kmscon-service-type
(kmscon-configuration
 (virtual-terminal "tty1")
@@ -434,7 +461,7 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m
 ;; non-functional:
 ;; .
 ;; Thus, blacklist it.
-(kernel-arguments '("quiet" "modprobe.blacklist=radeon"))
+(kernel-arguments '("quiet" "modprobe.blacklist=radeon" "nomodeset"))
 
 (file-systems
  ;; Note: the disk image build code overrides this root file system with
-- 
2.25.1



Re: kmscon not working on MacBook

2020-03-20 Thread pelzflorian (Florian Pelz)
On Wed, Mar 11, 2020 at 08:14:37AM +0100, pelzflorian (Florian Pelz) wrote:
> I could get the installer to display properly by using […]the useful v86d 
> helper[…]
> 
> guix package -f v86d.scm
> ln -s /gnu/store/yj9mxi0yr4ksg5v7031mdrc8fvb2wxrb-linux-libre-5.4.24/lib/ /lib
> modprobe uvesafb v86d=/root/.guix-profile/sbin/v86d
> 
> Without the symbolic linking, kmscon displays a flickering Module
> uvesafb not found in directory /lib/modules…
> 
> I will try to properly package v86d now (without bundled libraries).
> uvesafb does not work on my Macbook though; I believe it conflicts
> with modesetting.
> 

Now that v86d is pushed as e2303e8e375ed2e07c1fd760c86a204eb51fbc6e
(see ):

The attached patch makes the graphical installer work on two old
computers I tested.  I do not know how to proceed with it.  I would
like something similar to be included in the next release.  Maybe
kmscon works everywhere then.  ('nomodeset' is not needed; I leave it
in only for testing on computers where the graphical installer works
anyway when not passing 'nomodeset'.)  The patch should not change
behavior on machines where /dev/fb0 is created via modesetting anyway.

Regards,
Florian



Re: kmscon not working on MacBook

2020-03-11 Thread pelzflorian (Florian Pelz)
On Wed, Mar 11, 2020 at 08:14:37AM +0100, pelzflorian (Florian Pelz) wrote:
> I’m not sure if that is a good means for detection.
> 
> 
> 

Perhaps one could go by whether /dev/fb0 exists.  I wonder if /dev/fb0
is missing on all affected devices.  I will check mine later.

Regards,
Florian



Re: kmscon not working on MacBook

2020-03-11 Thread pelzflorian (Florian Pelz)
On Mon, Mar 09, 2020 at 05:45:45PM +0100, Ludovic Courtès wrote:
> However, in cases where kmscon does *not* exits and simply produces a
> black screen, I don’t see what can be done.  In the cases you list
> above, does kmscon simply sit there without exiting?
> 

When run with --debug, kmscon displays not quite helpful errors:

[.488942] DEBUG: pty: forking child 28378 (pty_spawn() in src/pty.c:422)
[.490819] DEBUG: pty: HUP on pty of child 28378 (pty_input() in 
src/pty.c:520)
[.490866] DEBUG: eloop: child 28378 exited with status 1 (sig_child() in 
src/eloop.c:350)
[.490883] INFO: pty: child exited: pid: 28378 status: 256 (sig_child() in 
src/pty.c:536)

over and over again.  (The errors are visible after killing kmscon.)

I’m not sure if that is a good means for detection.



"pelzflorian (Florian Pelz)"  skribis:
> A laptop Acer Aspire 5738 using “Advanced Micro Devices,
> Inc. [AMD/ATI] RV710/M92 [Mobility Radeon HD 4530/4570/545v]” *fails*
> with a black screen; manual installation is required (which I have not
> tested but probably works).
>

I could get the installer to display properly by using my unfinished
package for the useful v86d helper (attached):

guix package -f v86d.scm
ln -s /gnu/store/yj9mxi0yr4ksg5v7031mdrc8fvb2wxrb-linux-libre-5.4.24/lib/ /lib
modprobe uvesafb v86d=/root/.guix-profile/sbin/v86d

Without the symbolic linking, kmscon displays a flickering Module
uvesafb not found in directory /lib/modules…

I will try to properly package v86d now (without bundled libraries).
uvesafb does not work on my Macbook though; I believe it conflicts
with modesetting.

Regards,
Florian


v86d.scm
Description: Lotus Screencam


Re: kmscon not working on MacBook

2020-03-09 Thread Ludovic Courtès
Hi,

"pelzflorian (Florian Pelz)"  skribis:

> On Sun, Mar 08, 2020 at 10:03:26PM +0100, Ludovic Courtès wrote:
>> In the past, Mathieu, Florian, and others looked at similar issues on
>> some graphics boards.  Perhaps there’s something we can do here to
>> special-case this hardware?
>> 
>> Ludo’.
>
> The affected hardware is diverse and I see no pattern.  I would favor
> restarting with mingetty.  However, the installer runs but just has no
> display, so I do not know how to detect it.
>
> My Macbook using “NVIDIA Corporation MCP89 [GeForce 320M] (rev a2)”
> runs the installer just fine.
>
> A desktop PC using “NVIDIA Corporation GM107 [GeForce GTX 750 Ti] (rev
> a2)” runs it just fine too.
>
> Another PC using “Advanced Micro Devices, Inc. [AMD/ATI] Oland PRO
> [Radeon R7 240/340]” runs the installer just fine (but not Xorg X).
>
> A laptop Acer Aspire 5738 using “Advanced Micro Devices,
> Inc. [AMD/ATI] RV710/M92 [Mobility Radeon HD 4530/4570/545v]” *fails*
> with a black screen; manual installation is required (which I have not
> tested but probably works).
>
> Another laptop Uniwill U50SI1 using “Silicon Integrated Systems [SiS]
> 771/671 PCIE VGA Display Adapter (rev 10)” *fails* the same way.
> Manual install works fine.  Note that I cannot boot non-Windows
> install images (Debian or Guix) on this machine, only via DVD, and
> Xorg X server only runs using uvesafb with a v86d helper.
>
> None of these installers flicker; the screen is black or it runs fine.

For the cases where kmscon actually fails (exit with a non-zero code),
a solution would be the following: instead of running kmscon directly,
we run a wrapper around it that spawn mingetty (as you suggested) when
kmscon exits with non-zero.

(Perhaps the flickering Joshua mentioned was actually due to kmscon
being continuously restarted by shepherd?)

However, in cases where kmscon does *not* exits and simply produces a
black screen, I don’t see what can be done.  In the cases you list
above, does kmscon simply sit there without exiting?

At any rate, thanks for the testing & detailed info!

Ludo’.



Re: kmscon not working on MacBook

2020-03-09 Thread Vincent Legoll
Hello,

On Mon, Mar 9, 2020 at 8:44 AM pelzflorian (Florian Pelz)
 wrote:
> None of these installers flicker; the screen is black or it runs fine.

I also tried the installer on an old laptop (AMD CPU + GPU) on which
the gui installer did not work, black screen. The manual installer run on
an alternate text console worked fine.

-- 
Vincent Legoll



Re: kmscon not working on MacBook

2020-03-09 Thread pelzflorian (Florian Pelz)
On Sun, Mar 08, 2020 at 10:03:26PM +0100, Ludovic Courtès wrote:
> In the past, Mathieu, Florian, and others looked at similar issues on
> some graphics boards.  Perhaps there’s something we can do here to
> special-case this hardware?
> 
> Ludo’.

The affected hardware is diverse and I see no pattern.  I would favor
restarting with mingetty.  However, the installer runs but just has no
display, so I do not know how to detect it.

My Macbook using “NVIDIA Corporation MCP89 [GeForce 320M] (rev a2)”
runs the installer just fine.

A desktop PC using “NVIDIA Corporation GM107 [GeForce GTX 750 Ti] (rev
a2)” runs it just fine too.

Another PC using “Advanced Micro Devices, Inc. [AMD/ATI] Oland PRO
[Radeon R7 240/340]” runs the installer just fine (but not Xorg X).

A laptop Acer Aspire 5738 using “Advanced Micro Devices,
Inc. [AMD/ATI] RV710/M92 [Mobility Radeon HD 4530/4570/545v]” *fails*
with a black screen; manual installation is required (which I have not
tested but probably works).

Another laptop Uniwill U50SI1 using “Silicon Integrated Systems [SiS]
771/671 PCIE VGA Display Adapter (rev 10)” *fails* the same way.
Manual install works fine.  Note that I cannot boot non-Windows
install images (Debian or Guix) on this machine, only via DVD, and
Xorg X server only runs using uvesafb with a v86d helper.

None of these installers flicker; the screen is black or it runs fine.

Regards,
Florian