all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Jesse Gibbons <jgibbons2357@gmail.com>, 44347@debbugs.gnu.org
Subject: bug#44347: mingetty --no-clear is hard-coded
Date: Sun, 01 Nov 2020 11:30:20 -0500	[thread overview]
Message-ID: <87zh413uq0.fsf@netris.org> (raw)
In-Reply-To: <9da4da56-c557-19be-fac6-f8b9ab8541c5@gmail.com>

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

Hi Jesse,

Jesse Gibbons <jgibbons2357@gmail.com> writes:

> The --no-clear option is hard-coded for mingetty, with no documentation 
> about why. The mingetty page says,
>         --noclear
>                Do not clear the screen before prompting for the login 
> name (the
>                screen is normally cleared).
>
> I do not think I am alone in preferring the screen cleared after logout. 

You're not alone.  I'd also prefer that the screen be cleared.  At
least, it should be configurable.

Here's an *untested* patch to make it configurable, and to change the
default behavior to clear.  I'm rebuilding my system now, but I have a
lot of compiling ahead of me (I don't use substitutes), so it will be a
while.  I'll report back after I've tested it.

In the meantime, does anyone object to changing the default behavior to
clear-on-logout, which is the upstream default?

     Regards,
       Mark


[-- Attachment #2: [PATCH] UNTESTED: gnu: mingetty-shepherd-service: Make 'clear-on-logout' configurable. --]
[-- Type: text/x-patch, Size: 3702 bytes --]

From 61d0055493c46cdee178d0ffbbf15742de930028 Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw@netris.org>
Date: Sun, 1 Nov 2020 11:16:08 -0500
Subject: [PATCH] UNTESTED: gnu: mingetty-shepherd-service: Make
 'clear-on-logout' configurable.

Also change the default configuration to clear on logout, which is the
upstream default.

* gnu/services/base.scm (<mingetty-configuration>): Add 'clear-on-logout?'
field.
(mingetty-shepherd-service): Pass the "--noclear" option to mingetty only if
'clear-on-logout?' is #false.
---
 gnu/services/base.scm | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 5a5c41d588..1f750670c9 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com>
-;;; Copyright © 2015, 2016 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2015, 2016, 2020 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016 David Craven <david@craven.ch>
@@ -1024,20 +1024,22 @@ the tty to run, among other things."
 (define-record-type* <mingetty-configuration>
   mingetty-configuration make-mingetty-configuration
   mingetty-configuration?
-  (mingetty       mingetty-configuration-mingetty ;<package>
-                  (default mingetty))
-  (tty            mingetty-configuration-tty)     ;string
-  (auto-login     mingetty-auto-login             ;string | #f
-                  (default #f))
-  (login-program  mingetty-login-program          ;gexp
-                  (default #f))
-  (login-pause?   mingetty-login-pause?           ;Boolean
-                  (default #f)))
+  (mingetty         mingetty-configuration-mingetty ;<package>
+                    (default mingetty))
+  (tty              mingetty-configuration-tty)     ;string
+  (auto-login       mingetty-auto-login             ;string | #f
+                    (default #f))
+  (login-program    mingetty-login-program          ;gexp
+                    (default #f))
+  (login-pause?     mingetty-login-pause?           ;Boolean
+                    (default #f))
+  (clear-on-logout? mingetty-clear-on-logout?       ;Boolean
+                    (default #t)))
 
 (define mingetty-shepherd-service
   (match-lambda
     (($ <mingetty-configuration> mingetty tty auto-login login-program
-                                 login-pause?)
+                                 login-pause? clear-on-logout?)
      (list
       (shepherd-service
        (documentation "Run mingetty on an tty.")
@@ -1050,7 +1052,6 @@ the tty to run, among other things."
 
        (start  #~(make-forkexec-constructor
                   (list #$(file-append mingetty "/sbin/mingetty")
-                        "--noclear"
 
                         ;; Avoiding 'vhangup' allows us to avoid 'setfont'
                         ;; errors down the path where various ioctls get
@@ -1058,6 +1059,9 @@ the tty to run, among other things."
                         ;; in Linux.
                         "--nohangup" #$tty
 
+                        #$@(if clear-on-logout?
+                               #~()
+                               #~("--noclear"))
                         #$@(if auto-login
                                #~("--autologin" #$auto-login)
                                #~())
-- 
2.28.0


  reply	other threads:[~2020-11-01 16:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31 15:16 bug#44347: mingetty --no-clear is hard-coded Jesse Gibbons
2020-11-01 16:30 ` Mark H Weaver [this message]
2020-11-01 16:37   ` Mark H Weaver
2020-11-01 22:12   ` Ludovic Courtès
2020-12-03 17:12     ` 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

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

  git send-email \
    --in-reply-to=87zh413uq0.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=44347@debbugs.gnu.org \
    --cc=jgibbons2357@gmail.com \
    /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 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.