From patchwork Thu Nov 3 19:19:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 44275 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 CA44E27BBEB; Thu, 3 Nov 2022 19:21:24 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 946C327BBE9 for ; Thu, 3 Nov 2022 19:21:23 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqflv-0004xw-PM; Thu, 03 Nov 2022 15:21:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqflv-0004xe-7F for guix-patches@gnu.org; Thu, 03 Nov 2022 15:21:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqflu-0004mB-V5 for guix-patches@gnu.org; Thu, 03 Nov 2022 15:21:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oqflu-0004pP-QI for guix-patches@gnu.org; Thu, 03 Nov 2022 15:21:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#59003] [PATCH 1/7] installer: Warn about hardware support after the welcome page. References: <20221103191756.16265-1-ludo@gnu.org> In-Reply-To: <20221103191756.16265-1-ludo@gnu.org> Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Nov 2022 19:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59003 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59003@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 59003-submit@debbugs.gnu.org id=B59003.166750320318411 (code B ref 59003); Thu, 03 Nov 2022 19:21:02 +0000 Received: (at 59003) by debbugs.gnu.org; 3 Nov 2022 19:20:03 +0000 Received: from localhost ([127.0.0.1]:50765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqfkw-0004ml-Uu for submit@debbugs.gnu.org; Thu, 03 Nov 2022 15:20:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqfkm-0004l7-Q8 for 59003@debbugs.gnu.org; Thu, 03 Nov 2022 15:19:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqfkh-0004Tb-Hj; Thu, 03 Nov 2022 15:19:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=vYtf1NKB6x+4crIIovUkiCZ/5k3CbwhBxIMNVcv/B0Y=; b=C7JOF9ZpcqTBIW 3Xn5eV1lWMvmpCEk2rEF44i70XlwS/VbgO4CA1nc31M9TZ0EhgH0w7iKRsI0VVIUE3fIFrPhAwwHB U+PyyrZHB2P/S1ywq3MG/exO4KGsvb03REYcYaUJ7PMVdgolAX8VxYZkIBwJmFNxDpFhsNtAGkk7H 8h+51JwDa5MCwA+No0xoKEJd3UbT7Pqnd9aEG6wNBpNYMZUHobxb7smj+N4+dXsM+2R7bb73ufGId 8+UJXDumun0+aJanaWlGvGjFI2HMcpUS7DkDDuoA+4dKt+yFTzgVMpZw3t17NYmgSCIDRtil+yzhn y2jUhLWq0aXZ3iaYWZ8Q==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqfkh-0001MS-5D; Thu, 03 Nov 2022 15:19:47 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 3 Nov 2022 20:19:29 +0100 Message-Id: <20221103191935.16336-1-ludo@gnu.org> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Guix-patches" Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches This is a followup to 682639c107908426fe6bf0a1b8404b98b7820290, which added the uvesafb upfront, before welcome page hard been displayed. * gnu/installer/newt/welcome.scm (check-hardware-support): New procedure. (run-welcome-page): Use it. --- gnu/installer/newt/welcome.scm | 85 ++++++++++++++++++---------------- 1 file changed, 44 insertions(+), 41 deletions(-) diff --git a/gnu/installer/newt/welcome.scm b/gnu/installer/newt/welcome.scm index 326996b005..1c7372b3be 100644 --- a/gnu/installer/newt/welcome.scm +++ b/gnu/installer/newt/welcome.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Mathieu Othacehe -;;; Copyright © 2020 Ludovic Courtès +;;; Copyright © 2020, 2022 Ludovic Courtès ;;; Copyright © 2022 Florian Pelz ;;; ;;; This file is part of GNU Guix. @@ -121,55 +121,58 @@ (define (choice->item str) (lambda () (destroy-form-and-pop form)))))) -(define (run-welcome-page logo) - "Run a welcome page with the given textual LOGO displayed at the center of -the page. Ask the user to choose between manual installation, graphical -installation and reboot." - (begin - (when (member "uvesafb" (modules-loaded)) - (run-error-page (G_ "\ +(define (check-hardware-support) + "Warn about unsupported devices." + (when (member "uvesafb" (modules-loaded)) + (run-error-page (G_ "\ This may be a false alarm, but possibly your graphics hardware does not work well with only free software. Expect trouble. If after installation, the system does not boot, perhaps you will need to add nomodeset to the kernel arguments and need to configure the uvesafb kernel module.") - (G_ "Pre-install warning"))) - (when (file-exists? %core-dump) - (match - (choice-window - (G_ "Previous installation failed") - (G_ "Continue") - (G_ "Report the failure") - (G_ "It seems that the previous installation exited unexpectedly \ + (G_ "Pre-install warning")))) + +(define (run-welcome-page logo) + "Run a welcome page with the given textual LOGO displayed at the center of +the page. Ask the user to choose between manual installation, graphical +installation and reboot." + (when (file-exists? %core-dump) + (match (choice-window + (G_ "Previous installation failed") + (G_ "Continue") + (G_ "Report the failure") + (G_ "It seems that the previous installation exited unexpectedly \ and generated a core dump. Do you want to continue or to report the failure \ first?")) - (1 #t) - (2 (raise - (condition - (&user-abort-error)))))) - (run-menu-page - (G_ "GNU Guix install") - (G_ "Welcome to GNU Guix system installer! + (1 #t) + (2 (raise + (condition + (&user-abort-error)))))) + + (run-menu-page + (G_ "GNU Guix install") + (G_ "Welcome to GNU Guix system installer! You will be guided through a graphical installation program. If you are familiar with GNU/Linux and you want tight control over \ the installation process, you can instead choose manual installation. \ Documentation is accessible at any time by pressing Ctrl-Alt-F2.") - logo - #:listbox-items - `((,(G_ "Graphical install using a terminal based interface") - . - ,(const #t)) - (,(G_ "Install using the shell based process") - . - ,(lambda () - ;; Switch to TTY3, where a root shell is available for shell based - ;; install. The other root TTY's would have been ok too. - (system* "chvt" "3") - (run-welcome-page logo))) - (,(G_ "Reboot") - . - ,(lambda () - (newt-finish) - (reboot)))) - #:listbox-item->text car))) + logo + #:listbox-items + `((,(G_ "Graphical install using a terminal based interface") + . + ,check-hardware-support) + (,(G_ "Install using the shell based process") + . + ,(lambda () + (check-hardware-support) + ;; Switch to TTY3, where a root shell is available for shell based + ;; install. The other root TTY's would have been ok too. + (system* "chvt" "3") + (run-welcome-page logo))) + (,(G_ "Reboot") + . + ,(lambda () + (newt-finish) + (reboot)))) + #:listbox-item->text car)) From patchwork Thu Nov 3 19:19:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 44276 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 129E127BBEB; Thu, 3 Nov 2022 19:21:27 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0D50127BBEA for ; Thu, 3 Nov 2022 19:21:26 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqflx-0004zN-2M; Thu, 03 Nov 2022 15:21:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqflv-0004xr-MV for guix-patches@gnu.org; Thu, 03 Nov 2022 15:21:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqflv-0004mG-Dj for guix-patches@gnu.org; Thu, 03 Nov 2022 15:21:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oqflv-0004pW-8H for guix-patches@gnu.org; Thu, 03 Nov 2022 15:21:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#59003] [PATCH 2/7] linux-modules: Add support for listing PCI devices. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Nov 2022 19:21:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59003 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59003@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 59003-submit@debbugs.gnu.org id=B59003.166750320418418 (code B ref 59003); Thu, 03 Nov 2022 19:21:03 +0000 Received: (at 59003) by debbugs.gnu.org; 3 Nov 2022 19:20:04 +0000 Received: from localhost ([127.0.0.1]:50767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqfkx-0004mu-LW for submit@debbugs.gnu.org; Thu, 03 Nov 2022 15:20:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqfkn-0004lE-NB for 59003@debbugs.gnu.org; Thu, 03 Nov 2022 15:19:54 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqfki-0004Tm-BS; Thu, 03 Nov 2022 15:19:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=LWyzEjVfc27/547JoZbVxC3AnVWjO4OxgG5yepVCsjY=; b=EhvMBkCIAyFVJ2v3wkr/ TETUwDwBoapfeYwOCSFMg3Xgi0iegHvIarhh9OUEgvltloMVxAKF+/t5JqnKQ2Szz1hRYF/0y4SNO ipJfgRDDTDSq36/yZVVVVGNoQLxLPNwoth+v/f+ZaFpIOgDSpWySVt07rs34FZVpDH9XG/D0M3fMb tyAFElPfyJ+aKr2Fzf+emdmrdoze0pnluhsZafoZTSpDJ2g8rgtgPueTaw6iu2RRAh9Ni+Lt9DH19 nZLIBVb/SaN5qlpgCwn/SwrIbRC4nrr63gSY+3jG6DZLxt+wuVNEU5VYKoi6hNaz4ll5csQWI8Dhb uq1jiMgl6jqtXQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqfkh-0001MS-Ok; Thu, 03 Nov 2022 15:19:47 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 3 Nov 2022 20:19:30 +0100 Message-Id: <20221103191935.16336-2-ludo@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221103191935.16336-1-ludo@gnu.org> References: <20221103191935.16336-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Guix-patches" Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/build/linux-modules.scm (): New record type. (pci-device-class-predicate, storage-pci-device?, network-pci-device?) (display-pci-device?, pci-devices?): New procedures. --- gnu/build/linux-modules.scm | 61 ++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/gnu/build/linux-modules.scm b/gnu/build/linux-modules.scm index 053720574b..09cf752bef 100644 --- a/gnu/build/linux-modules.scm +++ b/gnu/build/linux-modules.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014, 2016, 2018, 2019 Ludovic Courtès +;;; Copyright © 2014, 2016, 2018, 2019, 2022 Ludovic Courtès ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2018 Danny Milosavljevic ;;; @@ -28,6 +28,7 @@ (define-module (gnu build linux-modules) #:use-module (rnrs io ports) #:use-module (rnrs bytevectors) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-9 gnu) #:use-module (srfi srfi-11) #:use-module (srfi srfi-26) #:use-module (ice-9 ftw) @@ -50,6 +51,16 @@ (define-module (gnu build linux-modules) load-linux-module* load-linux-modules-from-directory + pci-devices + pci-device? + pci-device-vendor + pci-device-id + pci-device-class + pci-device-module-alias + storage-pci-device? + network-pci-device? + display-pci-device? + current-module-debugging-port device-module-aliases @@ -429,6 +440,54 @@ (define (read-uevent port) (line (loop (cons (key=value->pair line) result)))))) +;; PCI device known to the Linux kernel. +(define-immutable-record-type + (pci-device vendor device class module-alias) + pci-device? + (vendor pci-device-vendor) ;integer + (device pci-device-id) ;integer + (class pci-device-class) ;integer + (module-alias pci-device-module-alias)) ;string | #f + +(define (pci-device-class-predicate mask bits) + (lambda (device) + "Return true if DEVICE has the chosen class." + (= (logand mask (pci-device-class device)) bits))) + +(define storage-pci-device? ;"Mass storage controller" class + (pci-device-class-predicate #xff0000 #x010000)) +(define network-pci-device? ;"Network controller" class + (pci-device-class-predicate #xff0000 #x020000)) +(define display-pci-device? ;"Display controller" class + (pci-device-class-predicate #xff0000 #x030000)) + +(define (pci-devices) + "Return the list of PCI devices of the system ( records)." + (define (read-hex port) + (let ((line (read-line port))) + (and (string? line) + (string-prefix? "0x" line) + (string->number (string-drop line 2) 16)))) + + (filter-map (lambda (directory) + (define properties + (call-with-input-file (string-append directory "/uevent") + read-uevent)) + (define vendor + (call-with-input-file (string-append directory "/vendor") + read-hex)) + (define device + (call-with-input-file (string-append directory "/device") + read-hex)) + (define class + (call-with-input-file (string-append directory "/class") + read-hex)) + + (pci-device vendor device class + (assq-ref properties 'MODALIAS))) + (find-files "/sys/bus/pci/devices" + #:stat lstat))) + (define (device-module-aliases device) "Return the list of module aliases required by DEVICE, a /dev file name, as in this example: From patchwork Thu Nov 3 19:19:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 44280 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 1937E27BBEA; Thu, 3 Nov 2022 19:21:48 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 71EEE27BBE9 for ; Thu, 3 Nov 2022 19:21:47 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqflx-0004zi-Cx; Thu, 03 Nov 2022 15:21:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqflw-0004yG-61 for guix-patches@gnu.org; Thu, 03 Nov 2022 15:21:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqflv-0004mM-TK for guix-patches@gnu.org; Thu, 03 Nov 2022 15:21:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oqflv-0004pe-NI for guix-patches@gnu.org; Thu, 03 Nov 2022 15:21:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#59003] [PATCH 3/7] linux-modules: Add 'load-pci-device-database'. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Nov 2022 19:21:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59003 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59003@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 59003-submit@debbugs.gnu.org id=B59003.166750320418427 (code B ref 59003); Thu, 03 Nov 2022 19:21:03 +0000 Received: (at 59003) by debbugs.gnu.org; 3 Nov 2022 19:20:04 +0000 Received: from localhost ([127.0.0.1]:50769 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqfky-0004n1-5J for submit@debbugs.gnu.org; Thu, 03 Nov 2022 15:20:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46736) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqfkn-0004lG-Vt for 59003@debbugs.gnu.org; Thu, 03 Nov 2022 15:19:54 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqfki-0004Tu-Ob; Thu, 03 Nov 2022 15:19:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=7Aed3jnUd50+ZQc08YclTlx5MAYdpPY3hhZfxXuM9bw=; b=dVRbj8Afrzs/2t27ReW+ NnOywiRjLmvwgZRWCK4N18Yx5PqhLqE5xU97+OM5BAiV+EQLmw8JdyIUNeFnAdpMVd4QbE2Szvmzk y4WS3IxtC5WQb1gNA8wlreXGRLTfGs+j1W/z8f81JTgLRklED0UcxZ+C9NdiYldicMguMJseNIaSt gd6btx91yW2o01oTSDk8lczFeKDITDuUXKs2oZAK1UE9vSc1YCz6ct9N65AP4XIn8kdUl8vWT7DuY WHpxlhX+VUEXowh/18nVn2ayaWpGxItpz1bAHd7IvA/8S5pHBz5HONj4kVKU/VpqfFTgQTxKHf0L9 w0m5JnqUP/9gsQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqfki-0001MS-Bg; Thu, 03 Nov 2022 15:19:48 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 3 Nov 2022 20:19:31 +0100 Message-Id: <20221103191935.16336-3-ludo@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221103191935.16336-1-ludo@gnu.org> References: <20221103191935.16336-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Guix-patches" Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/build/linux-modules.scm (read-pci-device-database) (load-pci-device-database): New procedures. --- gnu/build/linux-modules.scm | 74 +++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/gnu/build/linux-modules.scm b/gnu/build/linux-modules.scm index 09cf752bef..3b1f512663 100644 --- a/gnu/build/linux-modules.scm +++ b/gnu/build/linux-modules.scm @@ -60,6 +60,7 @@ (define-module (gnu build linux-modules) storage-pci-device? network-pci-device? display-pci-device? + load-pci-device-database current-module-debugging-port @@ -488,6 +489,79 @@ (define class (find-files "/sys/bus/pci/devices" #:stat lstat))) +(define (read-pci-device-database port) + "Parse the 'pci.ids' database that ships with the pciutils package and is +maintained at ." + (define (comment? str) + (string-prefix? "#" (string-trim str))) + (define (blank? str) + (string-null? (string-trim-both str))) + (define (device? str) + (eqv? #\tab (string-ref str 0))) + (define (subvendor? str) + (string-prefix? "\t\t" str)) + (define (class? str) + (string-prefix? "C " str)) + (define (parse-id-line str) + (let* ((str (string-trim-both str)) + (space (string-index str char-set:whitespace))) + (values (string->number (string-take str space) 16) + (string-trim (string-drop str (+ 1 space)))))) + (define (finish vendor vendor-id devices table) + (fold (lambda (device table) + (match device + ((device-id . name) + (vhash-consv (logior (ash vendor-id 16) device-id) + (cons vendor name) + table)))) + table + devices)) + + (let loop ((table vlist-null) + (vendor-id #f) + (vendor #f) + (devices '())) + (match (read-line port) + ((? eof-object?) + (let ((table (if (and vendor vendor-id) + (finish vendor vendor-id devices table) + table))) + (lambda (vendor device) + (match (vhash-assv (logior (ash vendor 16) device) table) + (#f + (values #f #f)) + ((_ . (vendor . name)) + (values vendor name)))))) + ((? comment?) + (loop table vendor-id vendor devices)) + ((? blank?) + (loop table vendor-id vendor devices)) + ((? subvendor?) ;currently ignored + (loop table vendor-id vendor devices)) + ((? class?) ;currently ignored + (loop table vendor-id vendor devices)) + ((? device? line) + (let-values (((id name) (parse-id-line line))) + (loop table vendor-id vendor + (if (and vendor-id vendor) ;class or device? + (alist-cons id name devices) + devices)))) + (line + (let ((table (if (and vendor vendor-id) + (finish vendor vendor-id devices table) + table))) + (let-values (((vendor-id vendor) (parse-id-line line))) + (loop table vendor-id vendor '()))))))) + +(define (load-pci-device-database file) + "Read the 'pci.ids' database at FILE (get it from the pciutils package or +from ) and return a lookup procedure that takes a PCI +vendor ID and a device ID (two integers) and returns the vendor name and +device name as two values." + (let ((port (open-file file "r0"))) + (call-with-gzip-input-port port + read-pci-device-database))) + (define (device-module-aliases device) "Return the list of module aliases required by DEVICE, a /dev file name, as in this example: From patchwork Thu Nov 3 19:19:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 44279 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 A950327BBEA; Thu, 3 Nov 2022 19:21:38 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6B3DD27BBE9 for ; Thu, 3 Nov 2022 19:21:38 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqfm5-00057G-4P; Thu, 03 Nov 2022 15:21:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqflx-0004zz-Ks for guix-patches@gnu.org; Thu, 03 Nov 2022 15:21:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqflx-0004mS-CP for guix-patches@gnu.org; Thu, 03 Nov 2022 15:21:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oqflw-0004pl-7O for guix-patches@gnu.org; Thu, 03 Nov 2022 15:21:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#59003] [PATCH 4/7] installer: Use 'current-guix' for extensions. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Nov 2022 19:21:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59003 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59003@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 59003-submit@debbugs.gnu.org id=B59003.166750320518434 (code B ref 59003); Thu, 03 Nov 2022 19:21:04 +0000 Received: (at 59003) by debbugs.gnu.org; 3 Nov 2022 19:20:05 +0000 Received: from localhost ([127.0.0.1]:50771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqfky-0004nA-KZ for submit@debbugs.gnu.org; Thu, 03 Nov 2022 15:20:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqfko-0004lH-Hj for 59003@debbugs.gnu.org; Thu, 03 Nov 2022 15:19:54 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqfkj-0004U8-BL; Thu, 03 Nov 2022 15:19:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=mBOJeRKKn7K84kapSEezMGT0SrvtRWyq0zTk1NAa27Y=; b=DM1s2YOsGeuk03uYbcb3 OPbrlxTFBLuCkfUBC/8bVUBxez8gGWmr7+KrhMmYVfBijWM4fQyQlcFvcbjx0IE8HnRLr1CJFqXHd 8soUIyOCgteSEwOhfWDNWEJ4fj55Kwi/qjh3FlEtdJNfm4M/rAbEA5NvpcC+TwXQnyRJo+mxQhHW9 U5qPw6Kss2TumN2zSQUnA1DySmcwxedmZlfeLfC8KGK5mxY5qU6LHlV4oP2CvuVpVu1RLuOmd254f MQ0vBX5du/PKOeAzaRcdP3IEasCkYJ7h85gNhF9UjhIG26Wg7IAs22LzSZP39JCRilyyQzvUn7KYf mkWGEeRi0FqYag==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqfki-0001MS-VQ; Thu, 03 Nov 2022 15:19:49 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 3 Nov 2022 20:19:32 +0100 Message-Id: <20221103191935.16336-4-ludo@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221103191935.16336-1-ludo@gnu.org> References: <20221103191935.16336-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Guix-patches" Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches This lets us use the latest (gnu build linux-modules) for instance. Note that items listed in 'with-extensions' come first in the load path, before the directory containing the modules in 'with-imported-modules'. * gnu/installer.scm (installer-program): Use (current-guix) instead of 'guix' in 'with-extensions'. --- gnu/installer.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index 5cd1af8edf..df7625e05c 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -358,7 +358,7 @@ (define installer-builder (with-extensions (list guile-gcrypt guile-newt guile-parted guile-bytestructures guile-json-3 guile-git guile-webutils - guix gnutls) + (current-guix) gnutls) (with-imported-modules `(,@(source-module-closure `(,@modules (gnu services herd) From patchwork Thu Nov 3 19:19:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 44278 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 AB6F127BBEA; Thu, 3 Nov 2022 19:21:36 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1E03D27BBE9 for ; Thu, 3 Nov 2022 19:21:36 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqfm2-00054A-Nz; Thu, 03 Nov 2022 15:21:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqflx-0004zU-4y for guix-patches@gnu.org; Thu, 03 Nov 2022 15:21:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqflw-0004mZ-Sb for guix-patches@gnu.org; Thu, 03 Nov 2022 15:21:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oqflw-0004pu-M7 for guix-patches@gnu.org; Thu, 03 Nov 2022 15:21:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#59003] [PATCH 5/7] installer: Error page width is parameterized. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Nov 2022 19:21:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59003 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59003@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 59003-submit@debbugs.gnu.org id=B59003.166750320518440 (code B ref 59003); Thu, 03 Nov 2022 19:21:04 +0000 Received: (at 59003) by debbugs.gnu.org; 3 Nov 2022 19:20:05 +0000 Received: from localhost ([127.0.0.1]:50773 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqfky-0004nH-Uc for submit@debbugs.gnu.org; Thu, 03 Nov 2022 15:20:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqfkq-0004lO-5T for 59003@debbugs.gnu.org; Thu, 03 Nov 2022 15:19:56 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqfkj-0004UH-VH; Thu, 03 Nov 2022 15:19:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=rkLskT/IaHJ17csRUttX0XBeudbtAZHJtaiN0Rl1SVw=; b=ew0r1tYEqCflnWXy6YGJ uG8YiIlFPrXIuIBpLQ1AW/dLbwdQOxEAYEuJHmliO7XaK1ueg3X9tuVFyLZxxKeQyLxW7ggfSzaBl rRcgCGLosiv6Yfi/PfkAHkGK5tMChnGGs221ZvTzJGh3F+bCCo6FkzZ6glFxEVuUIxszTCzoZAyA3 7RAhG0bByWSaIgPvBlcx4FUXppoZbq5GCR1Tk0kc9fgcOXPwGxqLlOf2sW30ancKSLuo4q5JiGPar h7s82C38efezeiMpsMLHunpuQmICNIyOTdPkaZgUUDi1hqV3LPEvbutwubxyWEeB7PSjCMKqV0e8c X0kMmkuE0g3ecw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqfkj-0001MS-IT; Thu, 03 Nov 2022 15:19:49 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 3 Nov 2022 20:19:33 +0100 Message-Id: <20221103191935.16336-5-ludo@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221103191935.16336-1-ludo@gnu.org> References: <20221103191935.16336-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Guix-patches" Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/installer/newt/page.scm (run-error-page): Add #:width and honor it. --- gnu/installer/newt/page.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gnu/installer/newt/page.scm b/gnu/installer/newt/page.scm index 0f508a31c0..e1623a51fd 100644 --- a/gnu/installer/newt/page.scm +++ b/gnu/installer/newt/page.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Mathieu Othacehe -;;; Copyright © 2019, 2020 Ludovic Courtès +;;; Copyright © 2019, 2020, 2022 Ludovic Courtès ;;; Copyright © 2019 Tobias Geerinckx-Rice ;;; ;;; This file is part of GNU Guix. @@ -278,12 +278,12 @@ (define* (run-input-page text title (destroy-form-and-pop form) input)))))))) -(define (run-error-page text title) - "Run a page to inform the user of an error. The page contains the given TEXT -to explain the error and an \"OK\" button to acknowledge the error. The title -of the page is set to TITLE." +(define* (run-error-page text title #:key (width 40)) + "Run a page to inform the user of an error. The page is WIDTH column wide +and contains the given TEXT to explain the error and an \"OK\" button to +acknowledge the error. The title of the page is set to TITLE." (let* ((text-box - (make-reflowed-textbox -1 -1 text 40 + (make-reflowed-textbox -1 -1 text width #:flags FLAG-BORDER)) (grid (make-grid 1 2)) (ok-button (make-button -1 -1 "OK")) From patchwork Thu Nov 3 19:19:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 44274 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 EA09127BBEB; Thu, 3 Nov 2022 19:21:21 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 741AD27BBEA for ; Thu, 3 Nov 2022 19:21:20 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqfm3-00054d-2Z; Thu, 03 Nov 2022 15:21:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqflx-00050K-T7 for guix-patches@gnu.org; Thu, 03 Nov 2022 15:21:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqflx-0004mo-LQ for guix-patches@gnu.org; Thu, 03 Nov 2022 15:21:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oqflx-0004q8-Gs for guix-patches@gnu.org; Thu, 03 Nov 2022 15:21:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#59003] [PATCH 6/7] installer: Report known-unsupported PCI devices. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Nov 2022 19:21:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59003 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59003@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 59003-submit@debbugs.gnu.org id=B59003.166750320618455 (code B ref 59003); Thu, 03 Nov 2022 19:21:05 +0000 Received: (at 59003) by debbugs.gnu.org; 3 Nov 2022 19:20:06 +0000 Received: from localhost ([127.0.0.1]:50777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqfkz-0004na-J6 for submit@debbugs.gnu.org; Thu, 03 Nov 2022 15:20:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqfkq-0004lM-Px for 59003@debbugs.gnu.org; Thu, 03 Nov 2022 15:19:57 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqfkk-0004UO-K5; Thu, 03 Nov 2022 15:19:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=TDvpcVv/w7bwmSti93U1Nc1C/rog6c0eJGa0f9WxbIQ=; b=LX5Kfds5xSTmyZGTacd6 AGyunZbDm/mh+ol7KfjaGCZ2RDhDJ9dozPyUgV+tCExZWCnefVreNAGJ0K8EfHCDqopn23ckAU4yE gZ3znrvbUIljVgDw2U/+EXAoo0lFm1s+nOkpvQuYB+woFNI0VexKRMIdeaTNFu/pvaRSnLDXAdOMH PX988IdD3kPezQyYZ6RqO6QUzwxmxA32G7ROi/a+HLVf1p2zYEf9NOeIRppAMiOc3GulUt3TfPb8h xi+pbwVkp/x0UhZm+4apwtcudAQ5Lc6+oFRV3drwCbG5cCbQmRtPDl+dzj8+3s44Z7uzLWu8wiqWY 7rdayUTYWglwiQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqfkk-0001MS-5d; Thu, 03 Nov 2022 15:19:50 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 3 Nov 2022 20:19:34 +0100 Message-Id: <20221103191935.16336-6-ludo@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221103191935.16336-1-ludo@gnu.org> References: <20221103191935.16336-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Guix-patches" Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/installer.scm (installer-steps): Pass #:pci-database to the 'welcome' step procedure. * gnu/installer/newt.scm (welcome-page): Add #:pci-database and pass it to 'run-welcome-page'. * gnu/installer/newt/welcome.scm (%unsupported-linux-modules): New variable. (unsupported-pci-device?, pci-device-description): New procedures. (check-hardware-support): Add #:pci-database. Enumerate unsupported PCI devices and run an error page when unsupported devices are found. (run-welcome-page): Add #:pci-database and pass it to 'check-hardware-support'. * gnu/installer/record.scm ()[welcome-page]: Adjust comment. --- gnu/installer.scm | 6 ++- gnu/installer/newt.scm | 4 +- gnu/installer/newt/welcome.scm | 78 +++++++++++++++++++++++++++++++--- gnu/installer/record.scm | 2 +- 4 files changed, 80 insertions(+), 10 deletions(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index df7625e05c..e1b040088b 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -46,6 +46,7 @@ (define-module (gnu installer) #:use-module (gnu packages nano) #:use-module (gnu packages ncurses) #:use-module (gnu packages package-management) + #:use-module (gnu packages pciutils) #:use-module (gnu packages tls) #:use-module (gnu packages xorg) #:use-module (gnu system locale) @@ -226,7 +227,9 @@ (define (installer-steps) (id 'welcome) (compute (lambda _ ((installer-welcome-page current-installer) - #$(local-file "installer/aux-files/logo.txt"))))) + #$(local-file "installer/aux-files/logo.txt") + #:pci-database + #$(file-append pciutils "/share/hwdata/pci.ids.gz"))))) ;; Ask the user to select a timezone under glibc format. (installer-step @@ -358,6 +361,7 @@ (define installer-builder (with-extensions (list guile-gcrypt guile-newt guile-parted guile-bytestructures guile-json-3 guile-git guile-webutils + guile-zlib ;for (gnu build linux-modules) (current-guix) gnutls) (with-imported-modules `(,@(source-module-closure `(,@modules diff --git a/gnu/installer/newt.scm b/gnu/installer/newt.scm index 0bd0856219..60f9e75b81 100644 --- a/gnu/installer/newt.scm +++ b/gnu/installer/newt.scm @@ -176,8 +176,8 @@ (define* (locale-page #:key (define (timezone-page zonetab) (run-timezone-page zonetab)) -(define (welcome-page logo) - (run-welcome-page logo)) +(define* (welcome-page logo #:key pci-database) + (run-welcome-page logo #:pci-database pci-database)) (define (menu-page steps) (run-menu-page steps)) diff --git a/gnu/installer/newt/welcome.scm b/gnu/installer/newt/welcome.scm index 1c7372b3be..e9a4e0bbb4 100644 --- a/gnu/installer/newt/welcome.scm +++ b/gnu/installer/newt/welcome.scm @@ -19,7 +19,15 @@ (define-module (gnu installer newt welcome) #:use-module ((gnu build linux-modules) - #:select (modules-loaded)) + #:select (modules-loaded + known-module-aliases + matching-modules + pci-devices + pci-device-id + pci-device-vendor + pci-device-module-alias + network-pci-device? + load-pci-device-database)) #:use-module (gnu installer dump) #:use-module (gnu installer steps) #:use-module (gnu installer utils) @@ -30,6 +38,8 @@ (define-module (gnu installer newt welcome) #:use-module (srfi srfi-1) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) + #:use-module (srfi srfi-71) + #:use-module (ice-9 format) #:use-module (ice-9 match) #:use-module (ice-9 receive) #:use-module (newt) @@ -121,7 +131,43 @@ (define (choice->item str) (lambda () (destroy-form-and-pop form)))))) -(define (check-hardware-support) +(define %unsupported-linux-modules + ;; List of Linux modules that are useless without non-free firmware. + '("iwlwifi")) + +(define unsupported-pci-device? + ;; Arrange to load the module alias database only once. + (let ((aliases (delay (known-module-aliases)))) + (lambda (device) + "Return true if DEVICE is known to not be supported by free software." + (any (lambda (module) + (member module %unsupported-linux-modules)) + (matching-modules (pci-device-module-alias device) + (force aliases)))))) + +(define (pci-device-description pci-database) + "Return a procedure that, given a PCI device, returns a string describing +it." + (define (with-fallback lookup) + (lambda (vendor-id id) + (let ((vendor name (lookup vendor-id id))) + (values (or vendor (number->string vendor-id 16)) + (or name (number->string id 16)))))) + + (define pci-lookup + (with-fallback (load-pci-device-database pci-database))) + + (lambda (device) + (let ((vendor name (pci-lookup (pci-device-vendor device) + (pci-device-id device)))) + (if (network-pci-device? device) + ;; TRANSLATORS: The two placeholders are the manufacturer + ;; and name of a PCI device. + (format #f (G_ "~a ~a (networking device)") + vendor name) + (string-append vendor " " name))))) + +(define (check-hardware-support pci-database) "Warn about unsupported devices." (when (member "uvesafb" (modules-loaded)) (run-error-page (G_ "\ @@ -129,9 +175,28 @@ (define (check-hardware-support) work well with only free software. Expect trouble. If after installation, the system does not boot, perhaps you will need to add nomodeset to the kernel arguments and need to configure the uvesafb kernel module.") - (G_ "Pre-install warning")))) + (G_ "Pre-install warning"))) -(define (run-welcome-page logo) + (let ((devices (pci-devices))) + (match (filter unsupported-pci-device? devices) + (() ;no unsupported device + #t) + (unsupported + (run-error-page (format #f (G_ "\ +Devices not supported by free software were found on your computer: + +~{ - ~a~%~} +Unfortunately, it means those devices will not be usable. + +To address it, we recommend choosing hardware that respects your freedom as a \ +user--hardware for which free drivers and firmware exist. See \"Hardware \ +Considerations\" in the manual for more information.") + (map (pci-device-description pci-database) + unsupported)) + (G_ "Hardware support warning") + #:width 76))))) + +(define* (run-welcome-page logo #:key pci-database) "Run a welcome page with the given textual LOGO displayed at the center of the page. Ask the user to choose between manual installation, graphical installation and reboot." @@ -161,11 +226,12 @@ (define (run-welcome-page logo) #:listbox-items `((,(G_ "Graphical install using a terminal based interface") . - ,check-hardware-support) + ,(lambda () + (check-hardware-support pci-database))) (,(G_ "Install using the shell based process") . ,(lambda () - (check-hardware-support) + (check-hardware-support pci-database) ;; Switch to TTY3, where a root shell is available for shell based ;; install. The other root TTY's would have been ok too. (system* "chvt" "3") diff --git a/gnu/installer/record.scm b/gnu/installer/record.scm index 20519a26c3..5e0264682f 100644 --- a/gnu/installer/record.scm +++ b/gnu/installer/record.scm @@ -89,7 +89,7 @@ (define-record-type* (partition-page installer-partition-page) ;; procedure void -> void (services-page installer-services-page) - ;; procedure (logo) -> void + ;; procedure (logo #:pci-database) -> void (welcome-page installer-welcome-page) ;; procedure (menu-proc) -> void (parameters-menu installer-parameters-menu) From patchwork Thu Nov 3 19:19:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 44277 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 D2AAC27BBEA; Thu, 3 Nov 2022 19:21:28 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D31D827BBEB for ; Thu, 3 Nov 2022 19:21:27 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqfm3-00055V-He; Thu, 03 Nov 2022 15:21:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqflx-0004zy-JZ for guix-patches@gnu.org; Thu, 03 Nov 2022 15:21:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqflx-0004mh-A2 for guix-patches@gnu.org; Thu, 03 Nov 2022 15:21:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oqflx-0004q1-4e for guix-patches@gnu.org; Thu, 03 Nov 2022 15:21:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#59003] [PATCH 7/7] installer: Remove unused variable. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Nov 2022 19:21:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59003 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59003@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 59003-submit@debbugs.gnu.org id=B59003.166750320518447 (code B ref 59003); Thu, 03 Nov 2022 19:21:05 +0000 Received: (at 59003) by debbugs.gnu.org; 3 Nov 2022 19:20:05 +0000 Received: from localhost ([127.0.0.1]:50775 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqfkz-0004nS-9k for submit@debbugs.gnu.org; Thu, 03 Nov 2022 15:20:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqfkq-0004lP-DD for 59003@debbugs.gnu.org; Thu, 03 Nov 2022 15:19:56 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqfkl-0004UU-7D; Thu, 03 Nov 2022 15:19:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=Pro6seiUJdkWROFvRJwYpHHfH5Q3gVGG2+Bx5eIT4Zc=; b=m6vGbuV7q/8hS1SDoITk qdg3E0N/f/9uynyBfquj+HqX2nJzud5Tq5erKWW1kDr4YOeOJQFnQaQf0Fmyu8o5PQOJjN9O8z/qp inLwUrjRvtFo+kevjwNIM4TBIRCvged8Eu3t6b0RJth9KzVjnbsfMqpa26cBKtuVFDXupw4DNzvHM g6GNpnIlcQo1Kr8SnpqktGSxQzdSqbb2GiBvOhmaPzsPTbTpPKq5SDN2MNE7MzuccxLeLgr9ECC2Q cM/4El7ESWyU2/4LuAsMR4vppzEwmY4p9z2t5lX+sc4O7KNXYzDm26RkKlTXwfgctv5QuLHWrvuLb zBqQ+da8jiGtJg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqfkk-0001MS-R2; Thu, 03 Nov 2022 15:19:51 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 3 Nov 2022 20:19:35 +0100 Message-Id: <20221103191935.16336-7-ludo@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221103191935.16336-1-ludo@gnu.org> References: <20221103191935.16336-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Guix-patches" Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/installer/newt.scm (newt-run-command): Remove 'displayed-command'. --- gnu/installer/newt.scm | 4 ---- 1 file changed, 4 deletions(-) diff --git a/gnu/installer/newt.scm b/gnu/installer/newt.scm index 60f9e75b81..798ff53af2 100644 --- a/gnu/installer/newt.scm +++ b/gnu/installer/newt.scm @@ -117,10 +117,6 @@ (define command-output "") (define (line-accumulator line) (set! command-output (string-append/shared command-output line "\n"))) - (define displayed-command - (string-join - (map (lambda (s) (string-append "\"" s "\"")) args) - " ")) (define result (run-external-command-with-line-hooks (list line-accumulator) args)) (define exit-val (status:exit-val result))