From patchwork Wed Aug 7 15:00:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Denis 'GNUtoo' Carikli X-Patchwork-Id: 2753 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 E9B7227BBE9; Wed, 7 Aug 2024 16:02:02 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,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 7D9C727BBE2 for ; Wed, 7 Aug 2024 16:02:00 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbiAV-0003xu-Mv; Wed, 07 Aug 2024 11:01:39 -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 1sbiAT-0003xT-Mj for guix-patches@gnu.org; Wed, 07 Aug 2024 11:01:37 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbiAT-0000Zt-Bx for guix-patches@gnu.org; Wed, 07 Aug 2024 11:01:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=ON5POoRyHYepeCphks5MdYob+HUdctSoBgX8YyygJHo=; b=vF6HcxluGWBqoXn1Y83k/rrNj9nPrb6ry61CXIeSFF2Gub6juRYv4HtQBhAcN2hY422Jo/HodhU7xMBcuiWPYpwfjj3CwBIeOj8qWrXxdMRkQYFeqKFcKOLx0e32lDkaIChfdTSgxrmv0zaXHzbKKMvG3/RN7xNn6ne45slxEXPV8I6EztWmghPC85ZHYt2yNYY5RIo5CStmPaj5RBuvb5owWZk6z7JScGBoiPpnENtIMgq1uame11xfmdpCzPMYSPG998Id9AOWV4KvYcJxY00H705YDLbW8pbdAEE9ocBYZKnm5S40ZvXg6Akw0xYqJKmddhmWeRzKaBptH1adyA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sbiAs-0001AG-GB for guix-patches@gnu.org; Wed, 07 Aug 2024 11:02:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#72514] [PATCH v1 0/2] Add perp support in guix-install.sh for Dragora. Resent-From: Denis 'GNUtoo' Carikli Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 07 Aug 2024 15:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 72514 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 72514@debbugs.gnu.org, selk@dragora.org Cc: Denis 'GNUtoo' Carikli X-Debbugs-Original-To: guix-patches@gnu.org, =?utf-8?q?Mat=C3=ADas?= Fonzo Received: via spool by submit@debbugs.gnu.org id=B.17230428734388 (code B ref -1); Wed, 07 Aug 2024 15:02:02 +0000 Received: (at submit) by debbugs.gnu.org; 7 Aug 2024 15:01:13 +0000 Received: from localhost ([127.0.0.1]:34896 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbiA5-00018h-2s for submit@debbugs.gnu.org; Wed, 07 Aug 2024 11:01:13 -0400 Received: from lists.gnu.org ([209.51.188.17]:56562) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbiA2-00018Y-Tb for submit@debbugs.gnu.org; Wed, 07 Aug 2024 11:01: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 1sbi9c-0003sT-D7 for guix-patches@gnu.org; Wed, 07 Aug 2024 11:00:45 -0400 Received: from cyberdimension.org ([79.143.250.36] helo=rockpro64.cyberdimension.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1sbi9X-0000Q6-IZ for guix-patches@gnu.org; Wed, 07 Aug 2024 11:00:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=dkim; bh=w4NcOYMKnAMD/Mc 8rhJvdBNr7mKTe5K486tdzLdyjYA=; h=date:subject:cc:to:from; d=cyberdimension.org; b=KycZ5+V7aSpWqBbAcT4jw3c9j0764glY2SusbKwNxCDPlo rY6CbGv0k9hdQdrDsrpZuKqjM5b2H76JKPerDAPKD8+hBnU/28ltk/t7hPC0K0n34SHRy/ KMdcyjeN7IrFnFTjmTvVFDURld0BkNqn8p77flT+Ti7MOxDtSJTvtEqgaa1qq8fXf9vfjX mUROlQHzyX/6FImrZ4ROe4/i560wJAOHxcOEKJ2A49rx/+YUJZc3LzduajWe4DRP7u29vU 65W7wL5oYJdkM7sEkgo49uE3fsistSxUhZKAiM65qQyqemaKw1hSio8VJqekhR9C1RtLE8 iqby0wg/Rxc6gcnw== Received: from localhost.localdomain (localhost [127.0.0.1]) by rockpro64.cyberdimension.org (OpenSMTPD) with ESMTP id a784e9ec; Wed, 7 Aug 2024 15:00:31 +0000 (UTC) From: Denis 'GNUtoo' Carikli Date: Wed, 7 Aug 2024 17:00:02 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Received-SPF: pass client-ip=79.143.250.36; envelope-from=GNUtoo@cyberdimension.org; helo=rockpro64.cyberdimension.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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 Hi, When installing guix through guix-install.sh in Dragora the init system is not detected, so this serie fixes that. I also included a package for perp itself in case that can help getting familiar with it to review the patch for guix-install.sh. I've not tested if it works on top of Guix though, but it's handy as the manuals are present for instance. Also note that for the perp service for guix-install.sh, I took inspiration from the perp services inside the examples directory in perp source code. As for the guix-install.sh I've tested various pieces separately but not together as doing that would require the patch to be in Guix in the fist place: * I've tested that the guix daemon is started and stopped correctly by guix-install.sh once the files are in the right place. * I've tested that the logs are produced. They end up in /var/log/guix-daemon/current. * I've also tested (without guix-install.sh) that 'perpctl A guix-daemon' really starts the service and that then at the next boot the service is running too. I also tested 'perpctl X guix-daemon' in the same way. * I've tested that /etc/perp/guix-daemon/{rc.main,rc.log} are in the right place. * I've tested that the variables are passed to the guix-daemon by replacing it with very simple C code below that prints variables, and by also exporting TESTGNUTOO (and assigining it some value) to make sure that the variable is really passed by /etc/perp/rc.main and not by something else like bashrc. /* * Copyright © 2024 Denis 'GNUtoo' Carikli * * This file is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or (at * your option) any later version. * * This file is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this file. If not, see . */ #include #include #include extern char **environ; int print_entry(char *var1, char *var2) { int i; char *curr; for (i=0; ; i++) { curr = environ[i]; if (curr == NULL) break; if (!strncmp(var1, curr, strlen(var1))) printf("%s: [%s]\n", var1, curr); else if (!strncmp(var2, curr, strlen(var2))) printf("%s: [%s]\n", var2, curr); } } int main() { while(1) { print_entry("GUIX_LOCPATH", "TESTGNUTOO"); sleep(1); } } Denis 'GNUtoo' Carikli (2): gnu: Add perp. guix-install.sh: Support perp. .gitignore | 2 ++ etc/guix-install.sh | 25 +++++++++++++++++++++++ etc/perp/rc.log.in | 24 ++++++++++++++++++++++ etc/perp/rc.main.in | 45 ++++++++++++++++++++++++++++++++++++++++++ gnu/packages/admin.scm | 33 +++++++++++++++++++++++++++++++ nix/local.mk | 17 +++++++++++++++- 6 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 etc/perp/rc.log.in create mode 100644 etc/perp/rc.main.in base-commit: 5e567587dd4abf51f9a6fa44f5a852dde1115ce9