From patchwork Sun Oct 28 12:40:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 46 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id D589416754; Sun, 28 Oct 2018 12:43:47 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) by mira.cbaines.net (Postfix) with ESMTPS id 6122616753 for ; Sun, 28 Oct 2018 12:43:47 +0000 (GMT) Received: from localhost ([::1]:40021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGkPy-0002N4-NP for patchwork@mira.cbaines.net; Sun, 28 Oct 2018 08:43:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGkON-0008UU-Og for guix-patches@gnu.org; Sun, 28 Oct 2018 08:42:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gGkOJ-0004YR-KN for guix-patches@gnu.org; Sun, 28 Oct 2018 08:42:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:42538) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gGkOJ-0004Y9-Dy for guix-patches@gnu.org; Sun, 28 Oct 2018 08:42:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gGkOJ-0007NS-BU for guix-patches@gnu.org; Sun, 28 Oct 2018 08:42:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#33186] [PATCH 3/7] services: kmscon: Add an auto-login option. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 28 Oct 2018 12:42:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33186 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 33186@debbugs.gnu.org Received: via spool by 33186-submit@debbugs.gnu.org id=B33186.154073047528245 (code B ref 33186); Sun, 28 Oct 2018 12:42:03 +0000 Received: (at 33186) by debbugs.gnu.org; 28 Oct 2018 12:41:15 +0000 Received: from localhost ([127.0.0.1]:46784 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGkNW-0007LP-Vz for submit@debbugs.gnu.org; Sun, 28 Oct 2018 08:41:15 -0400 Received: from mail-pl1-f179.google.com ([209.85.214.179]:42532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGkNS-0007Ka-L0 for 33186@debbugs.gnu.org; Sun, 28 Oct 2018 08:41:13 -0400 Received: by mail-pl1-f179.google.com with SMTP id t6-v6so2505688plo.9 for <33186@debbugs.gnu.org>; Sun, 28 Oct 2018 05:41:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=F2fEsxsTRNjhz6y3NSL0rFu6K1lidRCK6JUbn5zyL2Y=; b=Bh9fiIui2H4QeOcM9wAAMHxSPPp0fUerDJJIrFmzV3HG0t4vXA5UNzidW9Axd3bR53 LYsDyEA7rL9OPvHTW5wrgAKD0igU7BAWZSgZU/nkidFjL+Mwo3UtuUE+DPl3y8pgh4yn yiWyrYKyntznQ1PFycSUigbIl5DFjPglZ1X4PsvXX9OMsrgK0Vv5PKPG4YTwe7GhKC37 gHzO4qetD5sZwrkevLmE7rPma4xiUhPOHj2+dJ8O1g8usfQ8HTR72NVgVirw59TC/cwT ZUiIA+93cc9kkHYfC1cILxPuFf4t+WUpt8c1G10JImb5ccGrZeCF7twc+YdrjMP4d7nj t9qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F2fEsxsTRNjhz6y3NSL0rFu6K1lidRCK6JUbn5zyL2Y=; b=kgoXRmFwepjmtOGm9RQtHxbS3pGeobP5o3wCR7VdeU+YGSgULJ4kIFkfT3EbiM1zg/ KhogiqeCHsHQbSGp6LgvVUktQGy3jGPVhRSoAymX9tquMTXWvK5ECp3q8AqToyanLwiN ghiLX67q8Ivm5F6xJDw8xEUCk7lmhyAKYtXlwgZgVGG52On6sUCHR6hNf+r8nGjfVvam znKV4e1CVYlEFe+oy/9jH8xTkYrcSPZdm0wv4DGx5xAXQO/F0N2Ykk4UsxubHm8hlCLx OCXVZwAXO2rg6AopsjcPa3N7y02CJsEeNHiaEMf8gr2yLs4WHKQ7dCf9CMMBmC/gyzj9 fvXw== X-Gm-Message-State: AGRZ1gKKkno6UHvO/q87FkGsP1iHjJ+dhIebXjPxxfGOSm+6VnRKC59y hzeItyH+b2mC+hLLDEQMgjdsXSub X-Google-Smtp-Source: AJdET5efNtirkCTLr9DBLut8SaycolAcN4JKazOUYC5AptgW7khc+GSdT6X9a4nmUaf4Rwbo6zllMw== X-Received: by 2002:a17:902:8e8a:: with SMTP id bg10-v6mr10543745plb.214.1540730464527; Sun, 28 Oct 2018 05:41:04 -0700 (PDT) Received: from localhost.localdomain (p506075-ipngn200505niho.hiroshima.ocn.ne.jp. [180.49.233.75]) by smtp.gmail.com with ESMTPSA id c69-v6sm33201759pfg.2.2018.10.28.05.41.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Oct 2018 05:41:04 -0700 (PDT) From: Mathieu Othacehe Date: Sun, 28 Oct 2018 21:40:39 +0900 Message-Id: <20181028124043.21773-4-m.othacehe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181028124043.21773-2-m.othacehe@gmail.com> References: <20181028124043.21773-2-m.othacehe@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Add an auto-login option that behaves as the one of mingetty-service. * gnu/services/base.scm (kmscon-configuration)[auto-login]: New field. (kmscon-service-type): Pass it to kmscon command. * doc/guix.texi: Document it. --- doc/guix.texi | 6 +++++- gnu/services/base.scm | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 87579d414..c58d7909f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -31,7 +31,7 @@ Copyright @copyright{} 2016, 2017, 2018 Jan Nieuwenhuizen@* Copyright @copyright{} 2016 Julien Lepiller@* Copyright @copyright{} 2016 Alex ter Weele@* Copyright @copyright{} 2017, 2018 Clément Lassieur@* -Copyright @copyright{} 2017 Mathieu Othacehe@* +Copyright @copyright{} 2017, 2018 Mathieu Othacehe@* Copyright @copyright{} 2017 Federico Beffa@* Copyright @copyright{} 2017, 2018 Carlo Zancanaro@* Copyright @copyright{} 2017 Thomas Danckaert@* @@ -10873,6 +10873,10 @@ A gexp denoting the name of the log-in program. The default log-in program is @item @code{login-arguments} (default: @code{'("-p")}) A list of arguments to pass to @command{login}. +@item @code{auto-login} (default: #f) +When passed a login name, as a string, the specified user will be logged +in automatically without prompting for their login name or password. + @item @code{hardware-acceleration?} (default: #f) Whether to use hardware acceleration. diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 4c341309b..8a8df45a1 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2016, 2017 Leo Famulari ;;; Copyright © 2016 David Craven ;;; Copyright © 2016 Ricardo Wurmus +;;; Copyright © 2018 Mathieu Othacehe ;;; ;;; This file is part of GNU Guix. ;;; @@ -2040,6 +2041,8 @@ This service is not part of @var{%base-services}." (default (file-append shadow "/bin/login"))) (login-arguments kmscon-configuration-login-arguments (default '("-p"))) + (auto-login kmscon-configuration-auto-login + (default #f)) (hardware-acceleration? kmscon-configuration-hardware-acceleration? (default #f))) ; #t causes failure @@ -2051,6 +2054,7 @@ This service is not part of @var{%base-services}." (virtual-terminal (kmscon-configuration-virtual-terminal config)) (login-program (kmscon-configuration-login-program config)) (login-arguments (kmscon-configuration-login-arguments config)) + (auto-login (kmscon-configuration-auto-login config)) (hardware-acceleration? (kmscon-configuration-hardware-acceleration? config))) (define kmscon-command @@ -2059,7 +2063,10 @@ This service is not part of @var{%base-services}." "--vt" #$virtual-terminal "--no-switchvt" #$@(if hardware-acceleration? '("--hwaccel") '()) - "--" #$login-program #$@login-arguments)) + "--" #$login-program #$@login-arguments + #$@(if auto-login + #~(#$auto-login) + #~()))) (shepherd-service (documentation "kmscon virtual terminal")