From patchwork Fri Dec 16 22:15:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Bakke X-Patchwork-Id: 45379 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 49BC127BBEB; Fri, 16 Dec 2022 22:34: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 196CC27BBED for ; Fri, 16 Dec 2022 22:34:16 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6Izu-0005DB-1G; Fri, 16 Dec 2022 17:16:06 -0500 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 1p6Izq-0005CK-Ok for guix-patches@gnu.org; Fri, 16 Dec 2022 17:16:02 -0500 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 1p6Izq-0007cI-BQ for guix-patches@gnu.org; Fri, 16 Dec 2022 17:16:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p6Izq-0007RZ-6y for guix-patches@gnu.org; Fri, 16 Dec 2022 17:16:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60129] [PATCH 1/2] activation: Firmware activation handles missing support in kernel. References: <20221216221147.13945-1-marius@gnu.org> In-Reply-To: <20221216221147.13945-1-marius@gnu.org> Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 16 Dec 2022 22:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60129 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60129@debbugs.gnu.org Received: via spool by 60129-submit@debbugs.gnu.org id=B60129.167122894428594 (code B ref 60129); Fri, 16 Dec 2022 22:16:02 +0000 Received: (at 60129) by debbugs.gnu.org; 16 Dec 2022 22:15:44 +0000 Received: from localhost ([127.0.0.1]:51836 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6IzY-0007R8-6Y for submit@debbugs.gnu.org; Fri, 16 Dec 2022 17:15:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37400) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6IzW-0007R1-FH for 60129@debbugs.gnu.org; Fri, 16 Dec 2022 17:15:42 -0500 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 1p6IzR-0007TM-6M for 60129@debbugs.gnu.org; Fri, 16 Dec 2022 17:15:37 -0500 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=w50SPAK0Sfe7sSl4GYNbv8uZlBXP/h4h1Xu2YRtKvfM=; b=UEwarNHj9st5O2 t9HVbfjUYo5Z63dgXIp92n2KRT4YIguV7d72hMbnzfp90PUO65F+q33Wxftu2n/GtC8c0bFexh0Nr 2woL+ESbROMl9+NDpYmD+oOYlyGxxX4PnAKGyiuqfHlagmeSFX4YBqAXLYEyebIk6VewfWjgXVS5Z jmPRQwEiD1f0bRaT/xKJYVDjBLhiXMs5xDAfOuS2HwfeiQfZHtjpPN6vi6I/sd6nqd8AmkzRyA8XD O+uj0Zs2qdPtLYg9AfdodeJwZZrHs4+qkWxccf54C1gJQrFc866Y8Rr5l7fblJtiSlePeFoayWZSx yACwZrWzE5IZfxv8ThqA==; Received: from [188.113.115.135] (helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6IzQ-00059X-Ih for 60129@debbugs.gnu.org; Fri, 16 Dec 2022 17:15:37 -0500 From: Marius Bakke Date: Fri, 16 Dec 2022 23:15:33 +0100 Message-Id: <20221216221534.14500-1-marius@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: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/build/activation.scm (activate-firmware): Check if firmware loading is enabled before attempting to use it. --- gnu/build/activation.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm index 10c9045740..af1aa0f4c4 100644 --- a/gnu/build/activation.scm +++ b/gnu/build/activation.scm @@ -363,9 +363,12 @@ (define (activate-firmware directory) "Tell the kernel to look for device firmware under DIRECTORY. This mechanism bypasses udev: it allows Linux to handle firmware loading directly by itself, without having to resort to a \"user helper\"." - (call-with-output-file "/sys/module/firmware_class/parameters/path" - (lambda (port) - (display directory port)))) + ;; If the kernel was built without firmware loading support, this file + ;; does not exist. Do nothing in that case. + (when (file-exists? "/sys/module/firmware_class/parameters/path") + (call-with-output-file "/sys/module/firmware_class/parameters/path" + (lambda (port) + (display directory port))))) (define (activate-ptrace-attach) "Allow users to PTRACE_ATTACH their own processes.