GNU bug report logs - #30216
[FIXME] system: Add ARM installer.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Danny Milosavljevic <dannym@HIDDEN>; Keywords: patch; dated Mon, 22 Jan 2018 22:02:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.
Added tag(s) patch. Request was from Christopher Baines <mail@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 30216 <at> debbugs.gnu.org:


Received: (at 30216) by debbugs.gnu.org; 31 Jan 2018 09:10:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 31 04:10:02 2018
Received: from localhost ([127.0.0.1]:50270 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1egoP4-00059g-7N
	for submit <at> debbugs.gnu.org; Wed, 31 Jan 2018 04:10:02 -0500
Received: from hera.aquilenet.fr ([185.233.100.1]:58340)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1egoP2-00059C-Gs
 for 30216 <at> debbugs.gnu.org; Wed, 31 Jan 2018 04:10:01 -0500
Received: from localhost (localhost [127.0.0.1])
 by hera.aquilenet.fr (Postfix) with ESMTP id 54A3311A90;
 Wed, 31 Jan 2018 10:09:59 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at aquilenet.fr
Received: from hera.aquilenet.fr ([127.0.0.1])
 by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id xAeaYU-fp_OV; Wed, 31 Jan 2018 10:09:58 +0100 (CET)
Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465])
 by hera.aquilenet.fr (Postfix) with ESMTPSA id 61F6B11A8F;
 Wed, 31 Jan 2018 10:09:58 +0100 (CET)
From: ludo@HIDDEN (Ludovic =?utf-8?Q?Court=C3=A8s?=)
To: Danny Milosavljevic <dannym@HIDDEN>
Subject: Re: [bug#30216] [WIP v5] services: agetty: Make tty optional.
References: <20180124131219.14202-1-dannym@HIDDEN>
 <20180124133147.15060-1-dannym@HIDDEN>
 <87r2q7vzei.fsf@HIDDEN> <20180131003018.23bf45d7@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 12 =?utf-8?Q?Pluvi=C3=B4se?= an 226 de la
 =?utf-8?Q?R=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Wed, 31 Jan 2018 10:09:57 +0100
In-Reply-To: <20180131003018.23bf45d7@HIDDEN> (Danny Milosavljevic's
 message of "Wed, 31 Jan 2018 00:30:18 +0100")
Message-ID: <87r2q6v1ga.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 30216
Cc: 30216 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

Hey Danny,

Danny Milosavljevic <dannym@HIDDEN> skribis:

>> I think this would work:
>>=20
>>   (let* ((consoles     (find-long-option "console" (linux-command-line)))
>>          (console-ttys (remove (lambda (console)
>>                                  (string-prefix? "tty" console))
>>                                (string-tokenize consoles not-comma))))
>
> "ttyS0" starts with "tty" but should not be removed...
>
>> Maybe default to /dev/ttyS0?
>
> Sounds unsafe.  Also, on x86_64 that's not really useful either.  It woul=
d be
> good to have a way to the not start the service after all in that case.

What about having =E2=80=98default-serial-port=E2=80=99 return #f in that c=
ase, and do
something like:

  #:start #~(let ((tty #$(default-serial-port)))
              (if tty
                  (make-forkexec-constructor =E2=80=A6)
                  (const #f)))   ;never start

?

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#30216; Package guix-patches. Full text available.

Message received at 30216 <at> debbugs.gnu.org:


Received: (at 30216) by debbugs.gnu.org; 30 Jan 2018 23:30:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 30 18:30:26 2018
Received: from localhost ([127.0.0.1]:49977 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1egfMA-0000ij-8R
	for submit <at> debbugs.gnu.org; Tue, 30 Jan 2018 18:30:26 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:38408)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1egfM8-0000ic-Sn
 for 30216 <at> debbugs.gnu.org; Tue, 30 Jan 2018 18:30:25 -0500
Received: from localhost (178.113.233.123.wireless.dyn.drei.com
 [178.113.233.123])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id 6C8683365137;
 Wed, 31 Jan 2018 00:30:23 +0100 (CET)
Date: Wed, 31 Jan 2018 00:30:18 +0100
From: Danny Milosavljevic <dannym@HIDDEN>
To: ludo@HIDDEN (Ludovic =?ISO-8859-1?Q?Court=E8s?=)
Subject: Re: [bug#30216] [WIP v5] services: agetty: Make tty optional.
Message-ID: <20180131003018.23bf45d7@HIDDEN>
In-Reply-To: <87r2q7vzei.fsf@HIDDEN>
References: <20180124131219.14202-1-dannym@HIDDEN>
 <20180124133147.15060-1-dannym@HIDDEN>
 <87r2q7vzei.fsf@HIDDEN>
X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 30216
Cc: 30216 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Hi Ludo,

> I think this would work:
> 
>   (let* ((consoles     (find-long-option "console" (linux-command-line)))
>          (console-ttys (remove (lambda (console)
>                                  (string-prefix? "tty" console))
>                                (string-tokenize consoles not-comma))))

"ttyS0" starts with "tty" but should not be removed...

> Maybe default to /dev/ttyS0?

Sounds unsafe.  Also, on x86_64 that's not really useful either.  It would be
good to have a way to the not start the service after all in that case.




Information forwarded to guix-patches@HIDDEN:
bug#30216; Package guix-patches. Full text available.

Message received at 30216 <at> debbugs.gnu.org:


Received: (at 30216) by debbugs.gnu.org; 30 Jan 2018 23:24:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 30 18:24:41 2018
Received: from localhost ([127.0.0.1]:49974 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1egfGb-0000Zg-KJ
	for submit <at> debbugs.gnu.org; Tue, 30 Jan 2018 18:24:41 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:38016)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1egfGZ-0000ZX-ID
 for 30216 <at> debbugs.gnu.org; Tue, 30 Jan 2018 18:24:40 -0500
Received: from localhost (178.113.233.123.wireless.dyn.drei.com
 [178.113.233.123])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id 4B2633364BE2;
 Wed, 31 Jan 2018 00:24:35 +0100 (CET)
Date: Wed, 31 Jan 2018 00:24:30 +0100
From: Danny Milosavljevic <dannym@HIDDEN>
To: ludo@HIDDEN (Ludovic =?ISO-8859-1?Q?Court=E8s?=)
Subject: Re: [bug#30216] [WIP v5] services: agetty: Make tty optional.
Message-ID: <20180131002430.753330b5@HIDDEN>
In-Reply-To: <87r2q7vzei.fsf@HIDDEN>
References: <20180124131219.14202-1-dannym@HIDDEN>
 <20180124133147.15060-1-dannym@HIDDEN>
 <87r2q7vzei.fsf@HIDDEN>
X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 30216
Cc: 30216 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

> +(define (default-tty) =20

>Could you add a docstring, like, IIUC: =E2=80=9CReturn a gexp that determi=
nes a
>reasonable default serial port to use as the tty.  This is primarily
>useful for headless systems such as ARM SoCs.=E2=80=9D
>In the manual, for the agetty service, it would be good to document the
>=E2=80=98agetty.tty=E2=80=99 kernel command-line option.

Sure.

> Rather use =E2=80=98linux-command-line=E2=80=99 from (gnu build linux-boo=
t).
> =E2=80=98find-long-option=E2=80=99 in the same module does almost what yo=
u want, but if
> you really want to support repeated =E2=80=9Cagetty.tty=E2=80=9D options,=
 you=E2=80=99ll have to
> make a new =E2=80=98find-long-options=E2=80=99 (plural) variant.

It's more for the repeated "console=3D" options which Linux supports.

>Perhaps =E2=80=98default-serial-port=E2=80=99 is more appropriate in fact?

Yeah.




Information forwarded to guix-patches@HIDDEN:
bug#30216; Package guix-patches. Full text available.

Message received at 30216 <at> debbugs.gnu.org:


Received: (at 30216) by debbugs.gnu.org; 30 Jan 2018 20:56:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 30 15:56:43 2018
Received: from localhost ([127.0.0.1]:49863 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1egcxO-0005Y0-T7
	for submit <at> debbugs.gnu.org; Tue, 30 Jan 2018 15:56:43 -0500
Received: from hera.aquilenet.fr ([185.233.100.1]:57424)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1egcxM-0005Xr-HE
 for 30216 <at> debbugs.gnu.org; Tue, 30 Jan 2018 15:56:41 -0500
Received: from localhost (localhost [127.0.0.1])
 by hera.aquilenet.fr (Postfix) with ESMTP id E3BFB118EA;
 Tue, 30 Jan 2018 21:56:39 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at aquilenet.fr
Received: from hera.aquilenet.fr ([127.0.0.1])
 by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id M35PzmobPTdo; Tue, 30 Jan 2018 21:56:39 +0100 (CET)
Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465])
 by hera.aquilenet.fr (Postfix) with ESMTPSA id CD074118E9;
 Tue, 30 Jan 2018 21:56:38 +0100 (CET)
From: ludo@HIDDEN (Ludovic =?utf-8?Q?Court=C3=A8s?=)
To: Danny Milosavljevic <dannym@HIDDEN>
Subject: Re: [bug#30216] [WIP v5] services: agetty: Make tty optional.
References: <20180124131219.14202-1-dannym@HIDDEN>
 <20180124133147.15060-1-dannym@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 11 =?utf-8?Q?Pluvi=C3=B4se?= an 226 de la
 =?utf-8?Q?R=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Tue, 30 Jan 2018 21:56:37 +0100
In-Reply-To: <20180124133147.15060-1-dannym@HIDDEN> (Danny
 Milosavljevic's message of "Wed, 24 Jan 2018 14:31:47 +0100")
Message-ID: <87r2q7vzei.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 30216
Cc: 30216 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

Hi,

Danny Milosavljevic <dannym@HIDDEN> skribis:

> * gnu/system/install.scm (agetty-default-service): Delete variable.
> (beaglebone-black-installation-os): Do not specify tty.
> (a20-olinuxino-lime-installation-os): Do not specify tty.
> (a20-olinuxino-lime2-emmc-installation-os): Do not specify tty.
> (a20-olinuxino-micro-installation-os): Do not specify tty.
> (banana-pi-m2-ultra-installation-os): Do not specify tty.
> (nintendo-nes-classic-edition-installation-os): Do not specify tty.
> (embedded-installation-os): Move agetty-service instantiation to...
> * gnu/services/base.scm (%base-services): ...here.
> (default-tty): New variable.
> (agetty-shepherd-service): Make tty optional, default to the above.

Neat, it looks better than hardcoding a default tty for each of these
machines.  :-)

> +(define (default-tty)

Could you add a docstring, like, IIUC: =E2=80=9CReturn a gexp that determin=
es a
reasonable default serial port to use as the tty.  This is primarily
useful for headless systems such as ARM SoCs.=E2=80=9D

In the manual, for the agetty service, it would be good to document the
=E2=80=98agetty.tty=E2=80=99 kernel command-line option.

Perhaps =E2=80=98default-serial-port=E2=80=99 is more appropriate in fact?

> +  #~(begin
> +      ;; console=3Ddevice,options
> +      ;; device: can be tty0, ttyS0, lp0, ttyUSB0 (serial).
> +      ;; options: BBBBPNF. P n|o|e, N number of bits,
> +      ;; F flow control (r RTS)
> +      (use-modules (rnrs io ports))
> +      (let* ((command (call-with-input-file "/proc/cmdline" get-string-a=
ll))
> +             (not-comma (char-set-complement (char-set #\,)))
> +             (items (string-tokenize command))
> +             (items-by-key (lambda (key target-prefix)
> +                            (let ((keylen (string-length key)))
> +                              (map (lambda (a)
> +                                     (string-append target-prefix
> +                                                    (string-drop a keyle=
n)))
> +                                   (filter (lambda (b)
> +                                             (string-prefix? key b)) ite=
ms)))))
> +             (agetty-ttys (items-by-key "agetty.tty=3D" ""))

Rather use =E2=80=98linux-command-line=E2=80=99 from (gnu build linux-boot).
=E2=80=98find-long-option=E2=80=99 in the same module does almost what you =
want, but if
you really want to support repeated =E2=80=9Cagetty.tty=E2=80=9D options, y=
ou=E2=80=99ll have to
make a new =E2=80=98find-long-options=E2=80=99 (plural) variant.

> +             (console-ttys (filter (lambda (tty)
> +                                     (not (or
> +                                            (string-prefix? tty "tty0")
> +                                            (string-prefix? tty "tty1")
> +                                            (string-prefix? tty "tty2")
> +                                            (string-prefix? tty "tty3")
> +                                            (string-prefix? tty "tty4")
> +                                            (string-prefix? tty "tty5")
> +                                            (string-prefix? tty "tty6")
> +                                            (string-prefix? tty "tty7")
> +                                            (string-prefix? tty "tty8")
> +                                            (string-prefix? tty "tty9"))=
))
> +                                   (items-by-key "console=3Dtty" "tty")))

I think this would work:

  (let* ((consoles     (find-long-option "console" (linux-command-line)))
         (console-ttys (remove (lambda (console)
                                 (string-prefix? "tty" console))
                               (string-tokenize consoles not-comma))))
    =E2=80=A6)

> +             (ttys (or agetty-ttys (map (lambda (console-spec)
> +                                          ;; Extract device name.
> +                                          (car (string-tokenize console-=
spec
> +                                                                not-comm=
a)))
> +                                        console-ttys))))
> +        (if (null? ttys)
> +          "XXX" ; would crash entire boot process: (error "agetty: No de=
fault tty found.")
> +          (car ttys)))))

Maybe default to /dev/ttyS0?

Could you send an updated patch?

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#30216; Package guix-patches. Full text available.

Message received at 30216 <at> debbugs.gnu.org:


Received: (at 30216) by debbugs.gnu.org; 26 Jan 2018 10:36:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 26 05:36:06 2018
Received: from localhost ([127.0.0.1]:43095 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ef1Mc-0005SE-9i
	for submit <at> debbugs.gnu.org; Fri, 26 Jan 2018 05:36:06 -0500
Received: from hera.aquilenet.fr ([185.233.100.1]:33748)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1ef1Ma-0005S4-Er
 for 30216 <at> debbugs.gnu.org; Fri, 26 Jan 2018 05:36:04 -0500
Received: from localhost (localhost [127.0.0.1])
 by hera.aquilenet.fr (Postfix) with ESMTP id 703A7109BC;
 Fri, 26 Jan 2018 11:36:03 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at aquilenet.fr
Received: from hera.aquilenet.fr ([127.0.0.1])
 by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id imPgsvWNyH_B; Fri, 26 Jan 2018 11:36:02 +0100 (CET)
Received: from ribbon (unknown [193.50.110.110])
 by hera.aquilenet.fr (Postfix) with ESMTPSA id 52B111067B;
 Fri, 26 Jan 2018 11:36:02 +0100 (CET)
From: ludo@HIDDEN (Ludovic =?utf-8?Q?Court=C3=A8s?=)
To: Danny Milosavljevic <dannym@HIDDEN>
Subject: Re: [bug#30216] [WIP] system: Add ARM installer;
 services: agetty: Make tty optional
References: <20180122220011.7896-1-dannym@HIDDEN>
 <87lggo7qjl.fsf@HIDDEN> <20180123145452.57b9e1e6@HIDDEN>
 <87vafqt2at.fsf@HIDDEN> <20180125233315.677b3ae5@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 7 =?utf-8?Q?Pluvi=C3=B4se?= an 226 de la =?utf-8?Q?R?=
 =?utf-8?Q?=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Fri, 26 Jan 2018 11:36:01 +0100
In-Reply-To: <20180125233315.677b3ae5@HIDDEN> (Danny Milosavljevic's
 message of "Thu, 25 Jan 2018 23:33:15 +0100")
Message-ID: <87inbo52lq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 30216
Cc: 30216 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

Danny Milosavljevic <dannym@HIDDEN> skribis:

>> I suppose fixing it would mean having a universal ARM U-Boot?=20=20
>
> Well, I guess that's for u-boot upstream to get to work.
>
>> Or do you have other solutions in mind?
>
> User boots the (u-boot-less) image using qemu and sets up u-boot on there=
 - and
> only then copies the whole (new) image to the SD card.

OK.  I guess that=E2=80=99d work, though it doesn=E2=80=99t sound particula=
rly
convenient.

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#30216; Package guix-patches. Full text available.

Message received at 30216 <at> debbugs.gnu.org:


Received: (at 30216) by debbugs.gnu.org; 25 Jan 2018 22:33:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 25 17:33:22 2018
Received: from localhost ([127.0.0.1]:42936 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eeq5C-0003li-OO
	for submit <at> debbugs.gnu.org; Thu, 25 Jan 2018 17:33:22 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:51476)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1eeq5B-0003la-IX
 for 30216 <at> debbugs.gnu.org; Thu, 25 Jan 2018 17:33:22 -0500
Received: from localhost (178.113.251.209.wireless.dyn.drei.com
 [178.113.251.209])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id 1A6E73360350;
 Thu, 25 Jan 2018 23:33:20 +0100 (CET)
Date: Thu, 25 Jan 2018 23:33:15 +0100
From: Danny Milosavljevic <dannym@HIDDEN>
To: ludo@HIDDEN (Ludovic =?ISO-8859-1?Q?Court=E8s?=)
Subject: Re: [bug#30216] [WIP] system: Add ARM installer; services: agetty:
 Make tty optional
Message-ID: <20180125233315.677b3ae5@HIDDEN>
In-Reply-To: <87vafqt2at.fsf@HIDDEN>
References: <20180122220011.7896-1-dannym@HIDDEN>
 <87lggo7qjl.fsf@HIDDEN> <20180123145452.57b9e1e6@HIDDEN>
 <87vafqt2at.fsf@HIDDEN>
X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 30216
Cc: 30216 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

> I suppose fixing it would mean having a universal ARM U-Boot?  

Well, I guess that's for u-boot upstream to get to work.

> Or do you have other solutions in mind?

User boots the (u-boot-less) image using qemu and sets up u-boot on there - and
only then copies the whole (new) image to the SD card.




Information forwarded to guix-patches@HIDDEN:
bug#30216; Package guix-patches. Full text available.

Message received at 30216 <at> debbugs.gnu.org:


Received: (at 30216) by debbugs.gnu.org; 25 Jan 2018 14:56:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 25 09:56:30 2018
Received: from localhost ([127.0.0.1]:42702 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eeix4-0001Op-LF
	for submit <at> debbugs.gnu.org; Thu, 25 Jan 2018 09:56:30 -0500
Received: from hera.aquilenet.fr ([185.233.100.1]:57438)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1eeix3-0001Og-D8
 for 30216 <at> debbugs.gnu.org; Thu, 25 Jan 2018 09:56:29 -0500
Received: from localhost (localhost [127.0.0.1])
 by hera.aquilenet.fr (Postfix) with ESMTP id 45AF210DE0;
 Thu, 25 Jan 2018 15:56:28 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at aquilenet.fr
Received: from hera.aquilenet.fr ([127.0.0.1])
 by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id xJDGRVi9cQfk; Thu, 25 Jan 2018 15:56:27 +0100 (CET)
Received: from ribbon (unknown [193.50.110.182])
 by hera.aquilenet.fr (Postfix) with ESMTPSA id 0C9E710DC5;
 Thu, 25 Jan 2018 15:56:26 +0100 (CET)
From: ludo@HIDDEN (Ludovic =?utf-8?Q?Court=C3=A8s?=)
To: Danny Milosavljevic <dannym@HIDDEN>
Subject: Re: [bug#30216] [WIP] system: Add ARM installer;
 services: agetty: Make tty optional
References: <20180122220011.7896-1-dannym@HIDDEN>
 <87lggo7qjl.fsf@HIDDEN> <20180123145452.57b9e1e6@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 6 =?utf-8?Q?Pluvi=C3=B4se?= an 226 de la =?utf-8?Q?R?=
 =?utf-8?Q?=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Thu, 25 Jan 2018 15:56:26 +0100
In-Reply-To: <20180123145452.57b9e1e6@HIDDEN> (Danny Milosavljevic's
 message of "Tue, 23 Jan 2018 14:54:52 +0100")
Message-ID: <87vafqt2at.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 30216
Cc: 30216 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

Hello!

Danny Milosavljevic <dannym@HIDDEN> skribis:

> I hope it's not that board-specific.  There are minimal differences but
> many ARM boards use the same Linux kernel (with the same config).
>
> This was one of the motivation to create u-boot:  u-boot is like a
> board-specific mini-Linux kernel.  The Linux kernel that u-boot then
> loads later is not board-specific.
>
> In the past, board vendors kept putting huge board configuration tables i=
nside
> Linux until Linus put a stop to it.
>
> Nowadays it should not be the case anymore that Linux is board-specific.

Understood.

> Therefore, I think it would be preferrable in the long run if
> Hydra didn't build 1000 different 1 GB images for different boards
> where the only different part is u-boot.

Definitely!

> So long story short, about 99% of the image this arm-installer generates
> will work and be identical for almost every ARMv7 board, except for u-boot
> (u-boot is kinda important, though).

Yes, but=E2=80=A6 this 1% is enough to make a non-bootable image though, wh=
ich
is what I=E2=80=99m concerned with.  :-)

I suppose fixing it would mean having a universal ARM U-Boot?  Or do you
have other solutions in mind?

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#30216; Package guix-patches. Full text available.

Message received at 30216 <at> debbugs.gnu.org:


Received: (at 30216) by debbugs.gnu.org; 24 Jan 2018 13:59:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 24 08:59:49 2018
Received: from localhost ([127.0.0.1]:40474 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eeLaf-0005Yv-3n
	for submit <at> debbugs.gnu.org; Wed, 24 Jan 2018 08:59:49 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:43954)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1eeLad-0005Yn-LI
 for 30216 <at> debbugs.gnu.org; Wed, 24 Jan 2018 08:59:48 -0500
Received: from dayas.3.home (77.118.190.53.wireless.dyn.drei.com
 [77.118.190.53])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id 8A95F33601CF;
 Wed, 24 Jan 2018 14:59:45 +0100 (CET)
From: Danny Milosavljevic <dannym@HIDDEN>
To: 30216 <at> debbugs.gnu.org
Subject: [WIP v5] services: agetty: Make tty optional.
Date: Wed, 24 Jan 2018 14:31:47 +0100
Message-Id: <20180124133147.15060-1-dannym@HIDDEN>
X-Mailer: git-send-email 2.15.1
In-Reply-To: <20180124131219.14202-1-dannym@HIDDEN>
References: <20180124131219.14202-1-dannym@HIDDEN>
Tags: patch
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 30216
Cc: Danny Milosavljevic <dannym@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

* gnu/system/install.scm (agetty-default-service): Delete variable.
(beaglebone-black-installation-os): Do not specify tty.
(a20-olinuxino-lime-installation-os): Do not specify tty.
(a20-olinuxino-lime2-emmc-installation-os): Do not specify tty.
(a20-olinuxino-micro-installation-os): Do not specify tty.
(banana-pi-m2-ultra-installation-os): Do not specify tty.
(nintendo-nes-classic-edition-installation-os): Do not specify tty.
(embedded-installation-os): Move agetty-service instantiation to...
* gnu/services/base.scm (%base-services): ...here.
(default-tty): New variable.
(agetty-shepherd-service): Make tty optional, default to the above.
---
 gnu/services/base.scm  | 54 +++++++++++++++++++++++++++++++++++++++++++++++---
 gnu/system/install.scm | 37 +++++++++++-----------------------
 2 files changed, 63 insertions(+), 28 deletions(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 8e30bcd34..e8c0240bf 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -817,7 +817,7 @@ the message of the day, among other things."
   agetty-configuration?
   (agetty           agetty-configuration-agetty   ;<package>
                     (default util-linux))
-  (tty              agetty-configuration-tty)     ;string
+  (tty              agetty-configuration-tty)     ;string | #f
   (term             agetty-term                   ;string | #f
                     (default #f))
   (baud-rate        agetty-baud-rate              ;string | #f
@@ -890,6 +890,46 @@ the message of the day, among other things."
 ;;;                 (default #f))
   )
 
+(define (default-tty)
+  #~(begin
+      ;; console=device,options
+      ;; device: can be tty0, ttyS0, lp0, ttyUSB0 (serial).
+      ;; options: BBBBPNF. P n|o|e, N number of bits,
+      ;; F flow control (r RTS)
+      (use-modules (rnrs io ports))
+      (let* ((command (call-with-input-file "/proc/cmdline" get-string-all))
+             (not-comma (char-set-complement (char-set #\,)))
+             (items (string-tokenize command))
+             (items-by-key (lambda (key target-prefix)
+                            (let ((keylen (string-length key)))
+                              (map (lambda (a)
+                                     (string-append target-prefix
+                                                    (string-drop a keylen)))
+                                   (filter (lambda (b)
+                                             (string-prefix? key b)) items)))))
+             (agetty-ttys (items-by-key "agetty.tty=" ""))
+             (console-ttys (filter (lambda (tty)
+                                     (not (or
+                                            (string-prefix? tty "tty0")
+                                            (string-prefix? tty "tty1")
+                                            (string-prefix? tty "tty2")
+                                            (string-prefix? tty "tty3")
+                                            (string-prefix? tty "tty4")
+                                            (string-prefix? tty "tty5")
+                                            (string-prefix? tty "tty6")
+                                            (string-prefix? tty "tty7")
+                                            (string-prefix? tty "tty8")
+                                            (string-prefix? tty "tty9"))))
+                                   (items-by-key "console=tty" "tty")))
+             (ttys (or agetty-ttys (map (lambda (console-spec)
+                                          ;; Extract device name.
+                                          (car (string-tokenize console-spec
+                                                                not-comma)))
+                                        console-ttys))))
+        (if (null? ttys)
+          "XXX" ; would crash entire boot process: (error "agetty: No default tty found.")
+          (car ttys)))))
+
 (define agetty-shepherd-service
   (match-lambda
     (($ <agetty-configuration> agetty tty term baud-rate auto-login
@@ -901,7 +941,7 @@ the message of the day, among other things."
      (list
        (shepherd-service
          (documentation "Run agetty on a tty.")
-         (provision (list (symbol-append 'term- (string->symbol tty))))
+         (provision (list (symbol-append 'term- (string->symbol (or tty "auto")))))
 
          ;; Since the login prompt shows the host name, wait for the 'host-name'
          ;; service to be done.  Also wait for udev essentially so that the tty
@@ -946,6 +986,9 @@ the message of the day, among other things."
                                         ('always "--local-line=always")
                                         ('never "-local-line=never")))
                                  #~())
+                          #$@(if tty
+                                 #~()
+                                 #~("--keep-baud"))
                           #$@(if extract-baud?
                                  #~("--extract-baud")
                                  #~())
@@ -1009,7 +1052,7 @@ the message of the day, among other things."
                           #$@(if login-pause?
                                  #~("--login-pause")
                                  #~())
-                          #$tty
+                          #$(or tty (default-tty))
                           #$@(if baud-rate
                                  #~(#$baud-rate)
                                  #~())
@@ -2012,6 +2055,11 @@ This service is not part of @var{%base-services}."
                         (cons tty %default-console-font))
                       '("tty1" "tty2" "tty3" "tty4" "tty5" "tty6")))
 
+        (agetty-service (agetty-configuration
+                         (extra-options '("-L")) ; no carrier detect
+                         (term "vt100")
+                         (tty #f))) ; automatic
+
         (mingetty-service (mingetty-configuration
                            (tty "tty1")))
         (mingetty-service (mingetty-configuration
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index e4b2e8237..db06b7a52 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -381,19 +381,10 @@ You have been warned.  Thanks for being so brave.\x1b[0m
                      nvi                          ;:wq!
                      %base-packages))))
 
-(define* (agetty-default-service #:optional (tty "ttyS0"))
-  "Return an agetty-service on the given TTY"
-  (agetty-service (agetty-configuration
-                   (extra-options '("-L"))
-                   (baud-rate "115200")
-                   (term "vt100")
-                   (tty tty))))
-
-(define* (embedded-installation-os bootloader bootloader-target tty
+(define* (embedded-installation-os bootloader bootloader-target
                                    #:key (extra-modules '()))
   "Return an installation os for embedded systems.
 The initrd gets the extra modules EXTRA-MODULES.
-A getty is provided on TTY.
 The bootloader BOOTLOADER is installed to BOOTLOADER-TARGET."
   (operating-system
     (inherit installation-os)
@@ -404,43 +395,39 @@ The bootloader BOOTLOADER is installed to BOOTLOADER-TARGET."
     (initrd (lambda (fs . rest)
               (apply base-initrd fs
                      #:extra-modules extra-modules
-                     rest)))
-    (services (cons* (agetty-default-service tty)
-                     (operating-system-user-services installation-os)))))
+                     rest)))))
 
 (define beaglebone-black-installation-os
   (embedded-installation-os u-boot-beaglebone-black-bootloader
                             "/dev/sda"
-                            "ttyO0"
                             #:extra-modules
                             ;; This module is required to mount the sd card.
                             '("omap_hsmmc")))
 
-
 (define a20-olinuxino-lime-installation-os
   (embedded-installation-os u-boot-a20-olinuxino-lime-bootloader
-                            "/dev/mmcblk0" ; SD card storage
-                            "ttyS0"))
+                            ;; SD card storage
+                            "/dev/mmcblk0"))
 
 (define a20-olinuxino-lime2-emmc-installation-os
   (embedded-installation-os u-boot-a20-olinuxino-lime2-bootloader
-                            "/dev/mmcblk1" ; eMMC storage
-                            "ttyS0"))
+                            ;; eMMC storage
+                            "/dev/mmcblk1"))
 
 (define a20-olinuxino-micro-installation-os
   (embedded-installation-os u-boot-a20-olinuxino-micro-bootloader
-                            "/dev/mmcblk0" ; SD card storage
-                            "ttyS0"))
+                            ;; SD card storage
+                            "/dev/mmcblk0"))
 
 (define banana-pi-m2-ultra-installation-os
   (embedded-installation-os u-boot-banana-pi-m2-ultra-bootloader
-                            "/dev/mmcblk1" ; eMMC storage
-                            "ttyS0"))
+                            ;; eMMC storage
+                            "/dev/mmcblk1"))
 
 (define nintendo-nes-classic-edition-installation-os
   (embedded-installation-os u-boot-nintendo-nes-classic-edition-bootloader
-                            "/dev/mmcblk0" ; SD card (solder it yourself)
-                            "ttyS0"))
+                            ;; SD card storage (solder it yourself)
+                            "/dev/mmcblk0"))
 
 ;; Return the default os here so 'guix system' can consume it directly.
 installation-os




Information forwarded to guix-patches@HIDDEN:
bug#30216; Package guix-patches. Full text available.

Message received at 30216 <at> debbugs.gnu.org:


Received: (at 30216) by debbugs.gnu.org; 24 Jan 2018 13:12:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 24 08:12:32 2018
Received: from localhost ([127.0.0.1]:40454 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eeKqt-0004Ji-Oa
	for submit <at> debbugs.gnu.org; Wed, 24 Jan 2018 08:12:32 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:40058)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1eeKqs-0004JY-Bs
 for 30216 <at> debbugs.gnu.org; Wed, 24 Jan 2018 08:12:31 -0500
Received: from dayas.3.home (77.118.190.53.wireless.dyn.drei.com
 [77.118.190.53])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id 31E7D33602DD;
 Wed, 24 Jan 2018 14:12:28 +0100 (CET)
From: Danny Milosavljevic <dannym@HIDDEN>
To: 30216 <at> debbugs.gnu.org
Subject: [WIP v4] services: agetty: Make tty optional.
Date: Wed, 24 Jan 2018 14:12:19 +0100
Message-Id: <20180124131219.14202-1-dannym@HIDDEN>
X-Mailer: git-send-email 2.15.1
In-Reply-To: <20180123144022.31285-1-dannym@HIDDEN>
References: <20180123144022.31285-1-dannym@HIDDEN>
Tags: patch
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 30216
Cc: Danny Milosavljevic <dannym@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

* gnu/system/install.scm (agetty-default-service): Delete variable.
(embedded-installation-os): Move agetty-service instantiation to...
* gnu/services/base.scm (%base-services): ...here.
(default-tty): New variable.
(agetty-shepherd-service): Make tty optional, default to the above.
---
 gnu/services/base.scm  | 55 +++++++++++++++++++++++++++++++++++++++++++++++---
 gnu/system/install.scm | 12 +----------
 2 files changed, 53 insertions(+), 14 deletions(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 8e30bcd34..90b45920d 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -817,7 +817,7 @@ the message of the day, among other things."
   agetty-configuration?
   (agetty           agetty-configuration-agetty   ;<package>
                     (default util-linux))
-  (tty              agetty-configuration-tty)     ;string
+  (tty              agetty-configuration-tty)     ;string | #f
   (term             agetty-term                   ;string | #f
                     (default #f))
   (baud-rate        agetty-baud-rate              ;string | #f
@@ -890,6 +890,47 @@ the message of the day, among other things."
 ;;;                 (default #f))
   )
 
+(define (default-tty)
+  #~(begin
+      ;; console=device,options
+      ;; device: can be tty0, ttyS0, lp0, ttyUSB0 (serial).
+      ;; options: BBBBPNF. P n|o|e, N number of bits,
+      ;; F flow control (r RTS)
+      (use-modules (rnrs io ports))
+      (let* ((command (call-with-input-file "/proc/cmdline" get-string-all))
+             (not-comma (char-set-complement (char-set #\,)))
+             (items (string-tokenize command))
+             (items-by-key (lambda (key target-prefix)
+                            (let ((keylen (string-length key)))
+                              (map (lambda (a)
+                                     (string-append target-prefix
+                                                    (string-drop a keylen)))
+                                   (filter (lambda (b)
+                                             (string-prefix? key b)) items)))))
+             (agetty-ttys (items-by-key "agetty.tty=" ""))
+             (console-ttys (filter (lambda (tty)
+                                     (not (or
+                                            (string-prefix? tty "tty0")
+                                            (string-prefix? tty "tty1")
+                                            (string-prefix? tty "tty2")
+                                            (string-prefix? tty "tty3")
+                                            (string-prefix? tty "tty4")
+                                            (string-prefix? tty "tty5")
+                                            (string-prefix? tty "tty6")
+                                            (string-prefix? tty "tty7")
+                                            (string-prefix? tty "tty8")
+                                            (string-prefix? tty "tty9"))))
+                                   (items-by-key "console=tty" "tty")))
+             (ttys (or agetty-ttys (map (lambda (console-spec)
+                                          ;; Extract device name.
+                                          (car (string-tokenize console-spec
+                                                                not-comma)))
+                                        console-ttys))))
+        (if (null? ttys)
+          "XXX" ; crashes entire boot: (error "agetty: 'tty' not specified and no default tty found.
+;Try specifying 'agetty.tty' or 'console' on the kernel command line.")
+          (car ttys)))))
+
 (define agetty-shepherd-service
   (match-lambda
     (($ <agetty-configuration> agetty tty term baud-rate auto-login
@@ -901,7 +942,7 @@ the message of the day, among other things."
      (list
        (shepherd-service
          (documentation "Run agetty on a tty.")
-         (provision (list (symbol-append 'term- (string->symbol tty))))
+         (provision (list (symbol-append 'term- (string->symbol (or tty "auto")))))
 
          ;; Since the login prompt shows the host name, wait for the 'host-name'
          ;; service to be done.  Also wait for udev essentially so that the tty
@@ -946,6 +987,9 @@ the message of the day, among other things."
                                         ('always "--local-line=always")
                                         ('never "-local-line=never")))
                                  #~())
+                          #$@(if tty
+                                 #~()
+                                 #~("--keep-baud"))
                           #$@(if extract-baud?
                                  #~("--extract-baud")
                                  #~())
@@ -1009,7 +1053,7 @@ the message of the day, among other things."
                           #$@(if login-pause?
                                  #~("--login-pause")
                                  #~())
-                          #$tty
+                          #$(or tty (default-tty))
                           #$@(if baud-rate
                                  #~(#$baud-rate)
                                  #~())
@@ -2012,6 +2056,11 @@ This service is not part of @var{%base-services}."
                         (cons tty %default-console-font))
                       '("tty1" "tty2" "tty3" "tty4" "tty5" "tty6")))
 
+        (agetty-service (agetty-configuration
+                         (extra-options '("-L")) ; no carrier detect
+                         (term "vt100")
+                         (tty #f))) ; automatic
+
         (mingetty-service (mingetty-configuration
                            (tty "tty1")))
         (mingetty-service (mingetty-configuration
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index e4b2e8237..27bc05c95 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -381,14 +381,6 @@ You have been warned.  Thanks for being so brave.\x1b[0m
                      nvi                          ;:wq!
                      %base-packages))))
 
-(define* (agetty-default-service #:optional (tty "ttyS0"))
-  "Return an agetty-service on the given TTY"
-  (agetty-service (agetty-configuration
-                   (extra-options '("-L"))
-                   (baud-rate "115200")
-                   (term "vt100")
-                   (tty tty))))
-
 (define* (embedded-installation-os bootloader bootloader-target tty
                                    #:key (extra-modules '()))
   "Return an installation os for embedded systems.
@@ -404,9 +396,7 @@ The bootloader BOOTLOADER is installed to BOOTLOADER-TARGET."
     (initrd (lambda (fs . rest)
               (apply base-initrd fs
                      #:extra-modules extra-modules
-                     rest)))
-    (services (cons* (agetty-default-service tty)
-                     (operating-system-user-services installation-os)))))
+                     rest)))))
 
 (define beaglebone-black-installation-os
   (embedded-installation-os u-boot-beaglebone-black-bootloader




Information forwarded to guix-patches@HIDDEN:
bug#30216; Package guix-patches. Full text available.

Message received at 30216 <at> debbugs.gnu.org:


Received: (at 30216) by debbugs.gnu.org; 23 Jan 2018 14:47:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 23 09:47:40 2018
Received: from localhost ([127.0.0.1]:39245 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1edzrP-00074p-M2
	for submit <at> debbugs.gnu.org; Tue, 23 Jan 2018 09:47:39 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:54894)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1edzrO-00074i-7o
 for 30216 <at> debbugs.gnu.org; Tue, 23 Jan 2018 09:47:38 -0500
Received: from dayas.3.home (178.113.249.158.wireless.dyn.drei.com
 [178.113.249.158])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id D6BED3360321;
 Tue, 23 Jan 2018 15:47:36 +0100 (CET)
From: Danny Milosavljevic <dannym@HIDDEN>
To: 30216 <at> debbugs.gnu.org
Subject: [WIP v3] services: agetty: Make tty optional.
Date: Tue, 23 Jan 2018 15:40:22 +0100
Message-Id: <20180123144022.31285-1-dannym@HIDDEN>
X-Mailer: git-send-email 2.15.1
In-Reply-To: <20180123143409.31064-1-dannym@HIDDEN>
References: <20180123143409.31064-1-dannym@HIDDEN>
Tags: patch
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 30216
Cc: Danny Milosavljevic <dannym@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

* gnu/services/base.scm (default-tty): New variable.
(agetty-shepherd-service): Make tty optional, default to the above.
* gnu/system/install.scm (arm-installation-os): New variable.  Use the above.
---
 gnu/services/base.scm  | 49 ++++++++++++++++++++++++++++++++++++++++++++++---
 gnu/system/install.scm |  8 +++++++-
 2 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 8e30bcd34..45b057eb8 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -817,7 +817,7 @@ the message of the day, among other things."
   agetty-configuration?
   (agetty           agetty-configuration-agetty   ;<package>
                     (default util-linux))
-  (tty              agetty-configuration-tty)     ;string
+  (tty              agetty-configuration-tty)     ;string | #f
   (term             agetty-term                   ;string | #f
                     (default #f))
   (baud-rate        agetty-baud-rate              ;string | #f
@@ -890,6 +890,46 @@ the message of the day, among other things."
 ;;;                 (default #f))
   )
 
+(define (default-tty)
+  #~(begin
+      ;; console=device,options
+      ;; device: can be tty0, ttyS0, lp0, ttyUSB0 (serial).
+      ;; options: BBBBPNF. P n|o|e, N number of bits,
+      ;; F flow control (r RTS)
+      (use-modules (ice-9 textual-ports))
+      (let* ((command (call-with-input-file "/proc/cmdline" get-string-all))
+             (not-comma (char-set-complement (char-set #\,)))
+             (items (string-tokenize command))
+             (items-by-key (lambda (key target-prefix)
+                            (let ((keylen (string-length key)))
+                              (map (lambda (a)
+                                     (string-append target-prefix
+                                                    (string-drop a keylen)))
+                                   (filter (lambda (b)
+                                             (string-prefix? key b)) items)))))
+             (agetty-ttys (items-by-key "agetty.tty=" ""))
+             (console-ttys (filter (lambda (tty)
+                                     (not (or
+                                            (string-prefix tty "tty0")
+                                            (string-prefix tty "tty1")
+                                            (string-prefix tty "tty2")
+                                            (string-prefix tty "tty3")
+                                            (string-prefix tty "tty4")
+                                            (string-prefix tty "tty5")
+                                            (string-prefix tty "tty6")
+                                            (string-prefix tty "tty7")
+                                            (string-prefix tty "tty8")
+                                            (string-prefix tty "tty9"))))
+                                   (items-by-key "console=tty" "tty")))
+             (ttys (or agetty-ttys (map (lambda (console-spec)
+                                          ;; Extract device name.
+                                          (car (string-tokenize console-spec
+                                                                not-comma)))
+                                        console-ttys))))
+        (if (null? ttys)
+          "XXX"
+          (car ttys)))))
+
 (define agetty-shepherd-service
   (match-lambda
     (($ <agetty-configuration> agetty tty term baud-rate auto-login
@@ -901,7 +941,7 @@ the message of the day, among other things."
      (list
        (shepherd-service
          (documentation "Run agetty on a tty.")
-         (provision (list (symbol-append 'term- (string->symbol tty))))
+         (provision (list (symbol-append 'term- (string->symbol (or tty "auto")))))
 
          ;; Since the login prompt shows the host name, wait for the 'host-name'
          ;; service to be done.  Also wait for udev essentially so that the tty
@@ -946,6 +986,9 @@ the message of the day, among other things."
                                         ('always "--local-line=always")
                                         ('never "-local-line=never")))
                                  #~())
+                          #$@(if tty
+                                 #~()
+                                 #~("--keep-baud"))
                           #$@(if extract-baud?
                                  #~("--extract-baud")
                                  #~())
@@ -1009,7 +1052,7 @@ the message of the day, among other things."
                           #$@(if login-pause?
                                  #~("--login-pause")
                                  #~())
-                          #$tty
+                          #$(or tty (default-tty))
                           #$@(if baud-rate
                                  #~(#$baud-rate)
                                  #~())
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index e4b2e8237..cde30ec3b 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -47,6 +47,7 @@
             a20-olinuxino-lime-installation-os
             a20-olinuxino-lime2-emmc-installation-os
             a20-olinuxino-micro-installation-os
+            arm-installation-os
             banana-pi-m2-ultra-installation-os
             beaglebone-black-installation-os
             nintendo-nes-classic-edition-installation-os))
@@ -381,7 +382,7 @@ You have been warned.  Thanks for being so brave.\x1b[0m
                      nvi                          ;:wq!
                      %base-packages))))
 
-(define* (agetty-default-service #:optional (tty "ttyS0"))
+(define* (agetty-default-service #:optional (tty #f))
   "Return an agetty-service on the given TTY"
   (agetty-service (agetty-configuration
                    (extra-options '("-L"))
@@ -408,6 +409,11 @@ The bootloader BOOTLOADER is installed to BOOTLOADER-TARGET."
     (services (cons* (agetty-default-service tty)
                      (operating-system-user-services installation-os)))))
 
+(define arm-installation-os
+  (embedded-installation-os u-boot-bootloader
+                            "/dev/null"
+                            #f))
+
 (define beaglebone-black-installation-os
   (embedded-installation-os u-boot-beaglebone-black-bootloader
                             "/dev/sda"




Information forwarded to guix-patches@HIDDEN:
bug#30216; Package guix-patches. Full text available.

Message received at 30216 <at> debbugs.gnu.org:


Received: (at 30216) by debbugs.gnu.org; 23 Jan 2018 14:34:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 23 09:34:34 2018
Received: from localhost ([127.0.0.1]:39236 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1edzek-0006m1-5l
	for submit <at> debbugs.gnu.org; Tue, 23 Jan 2018 09:34:34 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:53482)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1edzei-0006lq-S9
 for 30216 <at> debbugs.gnu.org; Tue, 23 Jan 2018 09:34:33 -0500
Received: from dayas.3.home (178.113.249.158.wireless.dyn.drei.com
 [178.113.249.158])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id 7432C3360321;
 Tue, 23 Jan 2018 15:34:30 +0100 (CET)
From: Danny Milosavljevic <dannym@HIDDEN>
To: 30216 <at> debbugs.gnu.org
Subject: [WIP v2] services: agetty: Make tty optional.
Date: Tue, 23 Jan 2018 15:34:09 +0100
Message-Id: <20180123143409.31064-1-dannym@HIDDEN>
X-Mailer: git-send-email 2.15.1
In-Reply-To: <20180122232643.22408-1-dannym@HIDDEN>
References: <20180122232643.22408-1-dannym@HIDDEN>
Tags: patch
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 30216
Cc: Danny Milosavljevic <dannym@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

* gnu/services/base.scm (default-tty): New variable.
(agetty-shepherd-service): Make tty optional, default to the above.
* gnu/system/install.scm (arm-installation-os): New variable.  Use the above.
---
 gnu/services/base.scm  | 45 ++++++++++++++++++++++++++++++++++++++++++---
 gnu/system/install.scm |  8 +++++++-
 2 files changed, 49 insertions(+), 4 deletions(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 8e30bcd34..3874c22b8 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -817,7 +817,7 @@ the message of the day, among other things."
   agetty-configuration?
   (agetty           agetty-configuration-agetty   ;<package>
                     (default util-linux))
-  (tty              agetty-configuration-tty)     ;string
+  (tty              agetty-configuration-tty)     ;string | #f
   (term             agetty-term                   ;string | #f
                     (default #f))
   (baud-rate        agetty-baud-rate              ;string | #f
@@ -890,6 +890,42 @@ the message of the day, among other things."
 ;;;                 (default #f))
   )
 
+(define (default-tty)
+  #~(begin
+      ;; console=device,options
+      ;; device: can be tty0, ttyS0, lp0, ttyUSB0 (serial).
+      ;; options: BBBBPNF. P n|o|e, N number of bits,
+      ;; F flow control (r RTS)
+      (use-modules (ice-9 textual-ports))
+      (let* ((command (call-with-input-file "/proc/cmdline" get-string-all))
+             (not-comma (char-set-complement (char-set #\,)))
+             (items (string-tokenize command))
+             (items-by-key (lambda (key target-prefix)
+                            (let ((keylen (string-length key)))
+                              (map (lambda (a)
+                                     (string-append target-prefix
+                                                    (string-drop a keylen)))
+                                   (filter (lambda (b)
+                                             (string-prefix? key b)) items)))))
+             (agetty-ttys (items-by-key "agetty.tty=" ""))
+             (console-ttys (filter (lambda (tty)
+                                     (not (or
+                                            (string-prefix tty "tty0")
+                                            (string-prefix tty "tty1")
+                                            (string-prefix tty "tty2")
+                                            (string-prefix tty "tty3")
+                                            (string-prefix tty "tty4")
+                                            (string-prefix tty "tty5")
+                                            (string-prefix tty "tty6")
+                                            (string-prefix tty "tty7")
+                                            (string-prefix tty "tty8")
+                                            (string-prefix tty "tty9"))))
+                                   (items-by-key "console=tty" "tty")))
+             (ttys (or agetty-ttys (map car (string-tokenize console-ttys not-comma)))))
+        (if (null? ttys)
+          "XXX"
+          (car ttys)))))
+
 (define agetty-shepherd-service
   (match-lambda
     (($ <agetty-configuration> agetty tty term baud-rate auto-login
@@ -901,7 +937,7 @@ the message of the day, among other things."
      (list
        (shepherd-service
          (documentation "Run agetty on a tty.")
-         (provision (list (symbol-append 'term- (string->symbol tty))))
+         (provision (list (symbol-append 'term- (string->symbol (or tty "auto")))))
 
          ;; Since the login prompt shows the host name, wait for the 'host-name'
          ;; service to be done.  Also wait for udev essentially so that the tty
@@ -946,6 +982,9 @@ the message of the day, among other things."
                                         ('always "--local-line=always")
                                         ('never "-local-line=never")))
                                  #~())
+                          #$@(if tty
+                                 #~()
+                                 #~("--keep-baud"))
                           #$@(if extract-baud?
                                  #~("--extract-baud")
                                  #~())
@@ -1009,7 +1048,7 @@ the message of the day, among other things."
                           #$@(if login-pause?
                                  #~("--login-pause")
                                  #~())
-                          #$tty
+                          #$(or tty (default-tty))
                           #$@(if baud-rate
                                  #~(#$baud-rate)
                                  #~())
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index e4b2e8237..cde30ec3b 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -47,6 +47,7 @@
             a20-olinuxino-lime-installation-os
             a20-olinuxino-lime2-emmc-installation-os
             a20-olinuxino-micro-installation-os
+            arm-installation-os
             banana-pi-m2-ultra-installation-os
             beaglebone-black-installation-os
             nintendo-nes-classic-edition-installation-os))
@@ -381,7 +382,7 @@ You have been warned.  Thanks for being so brave.\x1b[0m
                      nvi                          ;:wq!
                      %base-packages))))
 
-(define* (agetty-default-service #:optional (tty "ttyS0"))
+(define* (agetty-default-service #:optional (tty #f))
   "Return an agetty-service on the given TTY"
   (agetty-service (agetty-configuration
                    (extra-options '("-L"))
@@ -408,6 +409,11 @@ The bootloader BOOTLOADER is installed to BOOTLOADER-TARGET."
     (services (cons* (agetty-default-service tty)
                      (operating-system-user-services installation-os)))))
 
+(define arm-installation-os
+  (embedded-installation-os u-boot-bootloader
+                            "/dev/null"
+                            #f))
+
 (define beaglebone-black-installation-os
   (embedded-installation-os u-boot-beaglebone-black-bootloader
                             "/dev/sda"




Information forwarded to guix-patches@HIDDEN:
bug#30216; Package guix-patches. Full text available.

Message received at 30216 <at> debbugs.gnu.org:


Received: (at 30216) by debbugs.gnu.org; 23 Jan 2018 13:55:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 23 08:55:00 2018
Received: from localhost ([127.0.0.1]:39194 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1edz2S-0005jG-F9
	for submit <at> debbugs.gnu.org; Tue, 23 Jan 2018 08:55:00 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:49674)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1edz2Q-0005j8-Dl
 for 30216 <at> debbugs.gnu.org; Tue, 23 Jan 2018 08:54:58 -0500
Received: from localhost (178.113.249.158.wireless.dyn.drei.com
 [178.113.249.158])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id DE9C5336115D;
 Tue, 23 Jan 2018 14:54:56 +0100 (CET)
Date: Tue, 23 Jan 2018 14:54:52 +0100
From: Danny Milosavljevic <dannym@HIDDEN>
To: ludo@HIDDEN (Ludovic =?ISO-8859-1?Q?Court=E8s?=)
Subject: Re: [bug#30216] [WIP] system: Add ARM installer; services: agetty:
 Make tty optional
Message-ID: <20180123145452.57b9e1e6@HIDDEN>
In-Reply-To: <87lggo7qjl.fsf@HIDDEN>
References: <20180122220011.7896-1-dannym@HIDDEN>
 <87lggo7qjl.fsf@HIDDEN>
X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 30216
Cc: 30216 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Hi Ludo,

On Tue, 23 Jan 2018 12:39:10 +0100
ludo@HIDDEN (Ludovic Court=C3=A8s) wrote:

> What would it mean to have an =E2=80=9CARM=E2=80=9D installer?  I=E2=80=
=99d expect these things
> to be board-specific, no?

I hope it's not that board-specific.  There are minimal differences but
many ARM boards use the same Linux kernel (with the same config).

This was one of the motivation to create u-boot:  u-boot is like a
board-specific mini-Linux kernel.  The Linux kernel that u-boot then
loads later is not board-specific.

In the past, board vendors kept putting huge board configuration tables ins=
ide
Linux until Linus put a stop to it.

Nowadays it should not be the case anymore that Linux is board-specific.

Therefore, I think it would be preferrable in the long run if
Hydra didn't build 1000 different 1 GB images for different boards
where the only different part is u-boot.

This is preparatory work which is very much work-in-progress, mostly
as a discussion basis.

There's a thread about it on guix-devel, "Porting GuixSD to ARM article.".

So long story short, about 99% of the image this arm-installer generates
will work and be identical for almost every ARMv7 board, except for u-boot
(u-boot is kinda important, though).




Information forwarded to guix-patches@HIDDEN:
bug#30216; Package guix-patches. Full text available.

Message received at 30216 <at> debbugs.gnu.org:


Received: (at 30216) by debbugs.gnu.org; 23 Jan 2018 11:39:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 23 06:39:15 2018
Received: from localhost ([127.0.0.1]:39111 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1edwv4-0000UK-RP
	for submit <at> debbugs.gnu.org; Tue, 23 Jan 2018 06:39:14 -0500
Received: from hera.aquilenet.fr ([185.233.100.1]:42474)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1edwv3-0000UD-Mw
 for 30216 <at> debbugs.gnu.org; Tue, 23 Jan 2018 06:39:14 -0500
Received: from localhost (localhost [127.0.0.1])
 by hera.aquilenet.fr (Postfix) with ESMTP id A8638105B9;
 Tue, 23 Jan 2018 12:39:12 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at aquilenet.fr
Received: from hera.aquilenet.fr ([127.0.0.1])
 by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id xaLc84LdqodO; Tue, 23 Jan 2018 12:39:11 +0100 (CET)
Received: from ribbon (unknown [193.50.110.135])
 by hera.aquilenet.fr (Postfix) with ESMTPSA id 3C9A910567;
 Tue, 23 Jan 2018 12:39:11 +0100 (CET)
From: ludo@HIDDEN (Ludovic =?utf-8?Q?Court=C3=A8s?=)
To: Danny Milosavljevic <dannym@HIDDEN>
Subject: Re: [bug#30216] [FIXME] system: Add ARM installer.
References: <20180122220011.7896-1-dannym@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 4 =?utf-8?Q?Pluvi=C3=B4se?= an 226 de la =?utf-8?Q?R?=
 =?utf-8?Q?=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Tue, 23 Jan 2018 12:39:10 +0100
In-Reply-To: <20180122220011.7896-1-dannym@HIDDEN> (Danny
 Milosavljevic's message of "Mon, 22 Jan 2018 23:00:11 +0100")
Message-ID: <87lggo7qjl.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 30216
Cc: 30216 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

Hi Danny!

Danny Milosavljevic <dannym@HIDDEN> skribis:

> * gnu/system/install.scm (arm-installation-os): New exported variable.

What would it mean to have an =E2=80=9CARM=E2=80=9D installer?  I=E2=80=99d=
 expect these things
to be board-specific, no?

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#30216; Package guix-patches. Full text available.

Message received at 30216 <at> debbugs.gnu.org:


Received: (at 30216) by debbugs.gnu.org; 22 Jan 2018 23:26:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 22 18:26:51 2018
Received: from localhost ([127.0.0.1]:38725 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1edlUI-0002xm-Uq
	for submit <at> debbugs.gnu.org; Mon, 22 Jan 2018 18:26:51 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:40274)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1edlUG-0002xa-NW
 for 30216 <at> debbugs.gnu.org; Mon, 22 Jan 2018 18:26:49 -0500
Received: from dayas.3.home (178.113.249.158.wireless.dyn.drei.com
 [178.113.249.158])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id BD1E93365512;
 Tue, 23 Jan 2018 00:26:46 +0100 (CET)
From: Danny Milosavljevic <dannym@HIDDEN>
To: 30216 <at> debbugs.gnu.org
Subject: [WIP] services: agetty: Make tty optional.
Date: Tue, 23 Jan 2018 00:26:43 +0100
Message-Id: <20180122232643.22408-1-dannym@HIDDEN>
X-Mailer: git-send-email 2.15.1
Tags: patch
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 30216
Cc: Danny Milosavljevic <dannym@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

* gnu/services/base.scm (default-tty): New variable.
(agetty-shepherd-service): Make tty optional, default to the above.
* gnu/system/install.scm (arm-installation-os): New variable.  Use the above.
---
 gnu/services/base.scm  | 27 ++++++++++++++++++++++++---
 gnu/system/install.scm |  8 +++++++-
 2 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 8e30bcd34..d29da29ff 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -817,7 +817,7 @@ the message of the day, among other things."
   agetty-configuration?
   (agetty           agetty-configuration-agetty   ;<package>
                     (default util-linux))
-  (tty              agetty-configuration-tty)     ;string
+  (tty              agetty-configuration-tty)     ;string | #f
   (term             agetty-term                   ;string | #f
                     (default #f))
   (baud-rate        agetty-baud-rate              ;string | #f
@@ -890,6 +890,27 @@ the message of the day, among other things."
 ;;;                 (default #f))
   )
 
+(define (default-tty)
+  #~(begin
+      ;; console=device,options
+      ;; device: can be tty0, ttyS0, lp0, ttyUSB0 (serial).
+      ;; options: BBBBPNF. P n|o|e, N number of bits,
+      ;; F flow control (r RTS)
+      (use-modules (ice-9 textual-ports))
+      (let* ((command (call-with-input-file "/proc/cmdline" get-string-all))
+             (not-comma (char-set-complement (char-set #\,)))
+             (items (string-tokenize command))
+             (item-by-key (lambda (key)
+                            (let ((keylen (string-length key)))
+                              (map (lambda (a) (string-drop a keylen))
+                                   (filter (lambda (b) (string-prefix? key b)) items)))))
+             (agetty-ttys (item-by-key "agetty.tty="))
+             (console-ttys (item-by-key "console="))
+             (ttys (or agetty-ttys (map car (string-tokenize console-ttys not-comma)))))
+        (if (null? ttys)
+          "XXX"
+          (car ttys)))))
+
 (define agetty-shepherd-service
   (match-lambda
     (($ <agetty-configuration> agetty tty term baud-rate auto-login
@@ -901,7 +922,7 @@ the message of the day, among other things."
      (list
        (shepherd-service
          (documentation "Run agetty on a tty.")
-         (provision (list (symbol-append 'term- (string->symbol tty))))
+         (provision (list (symbol-append 'term- (string->symbol (or tty "auto")))))
 
          ;; Since the login prompt shows the host name, wait for the 'host-name'
          ;; service to be done.  Also wait for udev essentially so that the tty
@@ -1009,7 +1030,7 @@ the message of the day, among other things."
                           #$@(if login-pause?
                                  #~("--login-pause")
                                  #~())
-                          #$tty
+                          #$(or tty (default-tty))
                           #$@(if baud-rate
                                  #~(#$baud-rate)
                                  #~())
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index 286415052..19a129ce3 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -47,6 +47,7 @@
             a20-olinuxino-lime-installation-os
             a20-olinuxino-lime2-emmc-installation-os
             a20-olinuxino-micro-installation-os
+            arm-installation-os
             banana-pi-m2-ultra-installation-os
             beaglebone-black-installation-os
             nintendo-nes-classic-edition-installation-os))
@@ -381,7 +382,7 @@ You have been warned.  Thanks for being so brave.\x1b[0m
                      nvi                          ;:wq!
                      %base-packages))))
 
-(define* (agetty-default-service #:optional (tty "ttyS0"))
+(define* (agetty-default-service #:optional (tty #f))
   "Return an agetty-service on the given TTY"
   (agetty-service (agetty-configuration
                    (extra-options '("-L"))
@@ -408,6 +409,11 @@ The bootloader BOOTLOADER is installed to BOOTLOADER-TARGET."
     (services (cons* (agetty-default-service tty)
                      (operating-system-user-services installation-os)))))
 
+(define arm-installation-os
+  (embedded-installation-os u-boot-bootloader
+                            "/dev/null"
+                            #f))
+
 (define beaglebone-black-installation-os
   (embedded-installation-os u-boot-beaglebone-black-bootloader
                             "/dev/sda"




Information forwarded to guix-patches@HIDDEN:
bug#30216; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 22 Jan 2018 22:01:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 22 17:01:40 2018
Received: from localhost ([127.0.0.1]:38669 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1edk9r-0000h5-VH
	for submit <at> debbugs.gnu.org; Mon, 22 Jan 2018 17:01:40 -0500
Received: from eggs.gnu.org ([208.118.235.92]:34899)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1edk9p-0000gc-UR
 for submit <at> debbugs.gnu.org; Mon, 22 Jan 2018 17:01:38 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <dannym@HIDDEN>) id 1edk9k-0008Vf-1W
 for submit <at> debbugs.gnu.org; Mon, 22 Jan 2018 17:01:32 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:48269)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <dannym@HIDDEN>)
 id 1edk9j-0008VJ-UX
 for submit <at> debbugs.gnu.org; Mon, 22 Jan 2018 17:01:31 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:54103)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <dannym@HIDDEN>) id 1edk9i-0003fL-Rv
 for guix-patches@HIDDEN; Mon, 22 Jan 2018 17:01:31 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <dannym@HIDDEN>) id 1edk9f-0008Pa-Qm
 for guix-patches@HIDDEN; Mon, 22 Jan 2018 17:01:30 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:44210)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <dannym@HIDDEN>)
 id 1edk9f-0008Mv-JP
 for guix-patches@HIDDEN; Mon, 22 Jan 2018 17:01:27 -0500
Received: from dayas.3.home (178.113.168.23.wireless.dyn.drei.com
 [178.113.168.23])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id 9D2CF336067E;
 Mon, 22 Jan 2018 23:01:25 +0100 (CET)
From: Danny Milosavljevic <dannym@HIDDEN>
To: guix-patches@HIDDEN
Subject: [FIXME] system: Add ARM installer.
Date: Mon, 22 Jan 2018 23:00:11 +0100
Message-Id: <20180122220011.7896-1-dannym@HIDDEN>
X-Mailer: git-send-email 2.15.1
Tags: patch
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
Cc: Danny Milosavljevic <dannym@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

* gnu/system/install.scm (arm-installation-os): New exported variable.
---
 gnu/system/install.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index 286415052..a708e57f3 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -47,6 +47,7 @@
             a20-olinuxino-lime-installation-os
             a20-olinuxino-lime2-emmc-installation-os
             a20-olinuxino-micro-installation-os
+            arm-installation-os
             banana-pi-m2-ultra-installation-os
             beaglebone-black-installation-os
             nintendo-nes-classic-edition-installation-os))
@@ -408,6 +409,11 @@ The bootloader BOOTLOADER is installed to BOOTLOADER-TARGET."
     (services (cons* (agetty-default-service tty)
                      (operating-system-user-services installation-os)))))
 
+(define arm-installation-os
+  (embedded-installation-os u-boot-bootloader
+                            "/dev/null"
+                            "ttyS0"))
+
 (define beaglebone-black-installation-os
   (embedded-installation-os u-boot-beaglebone-black-bootloader
                             "/dev/sda"




Acknowledgement sent to Danny Milosavljevic <dannym@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#30216; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 19 Mar 2018 08:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.