From patchwork Sun May 28 09:44:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Efraim Flashner X-Patchwork-Id: 50378 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 B4AE227BBE9; Sun, 28 May 2023 10:44:37 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,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 1F4E427BBE2 for ; Sun, 28 May 2023 10:44:36 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3Cwa-0008EH-0k; Sun, 28 May 2023 05:44:08 -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 1q3CwU-0008Dn-RQ for guix-patches@gnu.org; Sun, 28 May 2023 05:44:02 -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 1q3CwU-0003Jh-Jj for guix-patches@gnu.org; Sun, 28 May 2023 05:44:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q3CwU-0001bU-GD for guix-patches@gnu.org; Sun, 28 May 2023 05:44:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63766] [PATCH 3/4] system: images: Add unmatched module. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: , guix-patches@gnu.org Resent-Date: Sun, 28 May 2023 09:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63766 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63766@debbugs.gnu.org Cc: Efraim Flashner , ( , Christopher Baines , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Raghav Gururajan , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice , jgart X-Debbugs-Original-Xcc: ( , Christopher Baines , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Raghav Gururajan , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice , jgart Received: via spool by 63766-submit@debbugs.gnu.org id=B63766.16852670296113 (code B ref 63766); Sun, 28 May 2023 09:44:02 +0000 Received: (at 63766) by debbugs.gnu.org; 28 May 2023 09:43:49 +0000 Received: from localhost ([127.0.0.1]:53297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3CwG-0001aQ-QP for submit@debbugs.gnu.org; Sun, 28 May 2023 05:43:49 -0400 Received: from mail-wr1-f54.google.com ([209.85.221.54]:53353) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3CwC-0001Zk-29 for 63766@debbugs.gnu.org; Sun, 28 May 2023 05:43:44 -0400 Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-30ae95c4e75so182271f8f.2 for <63766@debbugs.gnu.org>; Sun, 28 May 2023 02:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685267018; x=1687859018; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=NAbOzbzqxJ6lYEiJzrVXpSrrHjtNe8N8kxIXaw8gDl4=; b=c+oCEYRq0o6argMR2qsMjJJ9CLrhIc2JAc8Zw9JMp7RiemoLxionedAfyV53RFotFo PAS2h2JMvPtGQbXsQjqcL2ktYichQGZuW4TalpBZW4rnYlUO7K2Icaq4whv8Jz9J47n6 gqf3fVVUezRlBW2YvIfFnEB6bKqpoNG/4Kti55Hd0vSq3+oWlW7j8Z2P/CFQzrosWAHP 3zF4H74XmPb9mpoKg/4zfHh40qh/XRLBW93TR+XHlk2CQ5L6cNlOxGzKJDdUIf2HfDxD 0gCw2yVUv3HGtlY2h91/3z7P08OOB2QK69USNnkqTTkP/AsozuzHD0P1vbJldeTppGSZ T69Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685267018; x=1687859018; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=NAbOzbzqxJ6lYEiJzrVXpSrrHjtNe8N8kxIXaw8gDl4=; b=P0XUU66MHi6cE5Lw9jgTyXXBtW2KQBU80CGvCNZHcXt2vY0do+j6DlBio1BKu1KmFP U3fzD9izV72JDHKGuPz35VQb/ENuHROSMGJ60NaF0yQbzOafxu0GPDbkQiTqkrtubreP c/ITVodq5kHwggRYyJDAgRLRZZQcqg1bRHXKnV6NfoJbP35d7BpszU6Ab4bCNhi/GoGq /t9wTjHrS1UL9VuE6vgtuJKT15hVn30EHomKM1NsSo882Q40syHID5TQOLCC089PWYdr Ontm/UiQ7yL27PwjwBHctafDhSDm55tjWG6aQRPtsn7FgS1DZU8cONOBDGUamBsJpYS0 sX0Q== X-Gm-Message-State: AC+VfDwmQ0UkF7Tf0QVOJ2WCVEGXCQbGWtGcPPnn1W5IfKFmChhhIXcs 2Wt6lfxIXkglZpEFXT18r1fm7lI4EP9BiQ== X-Google-Smtp-Source: ACHHUZ5TCSGAfkj7SbpPhlXb8YBY90Gjwzr4x+BQJqI+VKHgZky09LVQ0zXgp6pCAvkPS9toh1JFsA== X-Received: by 2002:a5d:4e09:0:b0:309:3c19:a127 with SMTP id p9-20020a5d4e09000000b003093c19a127mr6247375wrt.36.1685267018207; Sun, 28 May 2023 02:43:38 -0700 (PDT) Received: from localhost ([37.46.46.3]) by smtp.gmail.com with ESMTPSA id q18-20020adffed2000000b003047dc162f7sm10245515wrs.67.2023.05.28.02.43.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 02:43:37 -0700 (PDT) From: Efraim Flashner Date: Sun, 28 May 2023 12:44:20 +0300 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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/system/images/unmatched.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. --- gnu/local.mk | 1 + gnu/system/images/unmatched.scm | 94 +++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 gnu/system/images/unmatched.scm diff --git a/gnu/local.mk b/gnu/local.mk index 18e8235140..50d65a3dba 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -741,6 +741,7 @@ GNU_SYSTEM_MODULES = \ %D%/system/images/pine64.scm \ %D%/system/images/pinebook-pro.scm \ %D%/system/images/rock64.scm \ + %D%/system/images/unmatched.scm \ %D%/system/images/wsl2.scm \ \ %D%/machine.scm \ diff --git a/gnu/system/images/unmatched.scm b/gnu/system/images/unmatched.scm new file mode 100644 index 0000000000..06d8d876d1 --- /dev/null +++ b/gnu/system/images/unmatched.scm @@ -0,0 +1,94 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2023 Efraim Flashner +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix 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. +;;; +;;; GNU Guix 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 GNU Guix. If not, see . + +(define-module (gnu system images unmatched) + #:use-module (gnu bootloader) + #:use-module (gnu bootloader u-boot) + #:use-module (gnu image) + #:use-module (gnu packages linux) + #:use-module (gnu services) + #:use-module (gnu services base) + #:use-module (gnu services networking) + #:use-module (gnu system) + #:use-module (gnu system file-systems) + #:use-module (gnu system image) + #:use-module (guix platforms riscv) + #:use-module (srfi srfi-26) + #:export (unmatched-barebones-os + unmatched-image-type + unmatched-barebones-raw-image)) + +(define unmatched-barebones-os + (operating-system + (host-name "unmatched") + (timezone "Asia/Jerusalem") + (locale "en_US.utf8") + (bootloader (bootloader-configuration + (bootloader u-boot-sifive-unmatched-bootloader) + (targets '("/dev/vda")))) + (initrd-modules '()) + (kernel linux-libre-riscv64-generic) + (file-systems (cons (file-system + (device (file-system-label "my-root")) + (mount-point "/") + (type "ext4")) + %base-file-systems)) + (services + (append (list (service agetty-service-type + (agetty-configuration + (extra-options '("-L")) ; no carrier detect + (baud-rate "115200") + (term "vt100") + (tty "ttySIF0"))) + (service dhcp-client-service-type)) + %base-services)))) + +(define unmatched-disk-image + (image-without-os + (format 'disk-image) + (partition-table-type 'gpt) + ;; https://source.denx.de/u-boot/u-boot/-/blob/master/doc/board/sifive/unmatched.rst + (partitions (list + (partition + (size (* 1 (expt 2 20))) + (label "spl") + (offset (* 34 512)) + (file-system "unformatted") + (uuid (uuid "5b193300-fc78-40cd-8002-e86c45580b47"))) ; HiFive FSBL + (partition + (size (* 4 (expt 2 20))) + (label "uboot") + (offset (* 2082 512)) + (file-system "unformatted") + (uuid (uuid "2e54b353-1271-4842-806f-e436d6af6985"))) ; HiFive BBL + root-partition)))) + +(define unmatched-image-type + (image-type + (name 'unmatched-raw) + (constructor (cut image-with-os unmatched-disk-image <>)))) + +(define unmatched-barebones-raw-image + (image + (inherit + (os+platform->image unmatched-barebones-os riscv64-linux + #:type unmatched-image-type)) + (name 'unmatched-barebones-raw-image))) + +;; Return the default image. +unmatched-barebones-raw-image