[bug#76098,3/4] etc: Add installer manifest.

Message ID 136a425368c9707e3097f7c57adb809d24a6689c.1738851574.git.efraim@flashner.co.il
State New
Headers
Series Patches towards a release |

Commit Message

Efraim Flashner Feb. 6, 2025, 2:36 p.m. UTC
  * etc/manifests/installer.scm: New file.
* Makefile.am (GUIX_SYSTEM_SUPPORTED_SYSTEMS): Rename to
GUIX_SYSTEM_INSTALLER_SYSTEMS.
(assert-binaries-available): Check for substitutes using the installer
manifest.

Change-Id: I5c15e6916583bcd56e535733f284f3a735d7600b
---
 Makefile.am                 |  13 +++--
 etc/manifests/installer.scm | 112 ++++++++++++++++++++++++++++++++++++
 2 files changed, 119 insertions(+), 6 deletions(-)
 create mode 100644 etc/manifests/installer.scm
  

Patch

diff --git a/Makefile.am b/Makefile.am
index ad8bb907515..f2a5bcf5f7b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1076,8 +1076,9 @@  SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux armhf-linux aarch64-linux \
 BINARY_TARBALLS =							\
   $(foreach system,$(SUPPORTED_SYSTEMS),guix-binary.$(system).tar.xz)
 
-# Systems supported by Guix System.
-GUIX_SYSTEM_SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux
+# Systems supported by the Guix System installer.
+# A Hurd install happens from a Linux installer image.
+GUIX_SYSTEM_INSTALLER_SYSTEMS ?= x86_64-linux i686-linux
 
 # Systems for which we build Guix VMs.
 GUIX_SYSTEM_VM_SYSTEMS ?= x86_64-linux
@@ -1138,10 +1139,10 @@  release: dist-with-updated-version all
 # Build 'current-guix' to speed things up for the next step.
 	$(top_builddir)/pre-inst-env guix build				\
 	      -e '((@ (gnu packages package-management) current-guix))'	\
-	      $(call system_flags,$(GUIX_SYSTEM_SUPPORTED_SYSTEMS))	\
+	      $(call system_flags,$(GUIX_SYSTEM_INSTALLER_SYSTEMS))	\
 	      -v1 --no-grafts --fallback
 # Generate the ISO installation images.
-	for system in $(GUIX_SYSTEM_SUPPORTED_SYSTEMS) ; do				\
+	for system in $(GUIX_SYSTEM_INSTALLER_SYSTEMS) ; do				\
 	  GUIX_DISPLAYED_VERSION="`git describe --match=v* | sed -'es/^v//'`" ;		\
 	  image=`$(top_builddir)/pre-inst-env						\
 	    guix system image -t iso9660						\
@@ -1205,11 +1206,11 @@  assert-no-store-file-names:
 	  exit 1 ;								\
 	fi
 
-# Make sure important substitutes are available.  Check only the primary
+# Make sure installer substitutes are available.  Check only the primary
 # server so that '--display-missing' doesn't print two lists.
 assert-binaries-available: $(GOBJECTS)
 	$(AM_V_at)$(top_builddir)/pre-inst-env				\
-	  guix weather -m "$(top_srcdir)/etc/manifests/release.scm"	\
+	  guix weather -m "$(top_srcdir)/etc/manifests/installer.scm"	\
 	                --substitute-urls="https://ci.guix.gnu.org"	\
 	                --display-missing
 
diff --git a/etc/manifests/installer.scm b/etc/manifests/installer.scm
new file mode 100644
index 00000000000..264cb4bab8e
--- /dev/null
+++ b/etc/manifests/installer.scm
@@ -0,0 +1,112 @@ 
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2020, 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2025 Efraim Flashner <efraim@flashner.co.il>
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+;;; This file returns a manifest containing packages which are needed by the
+;;; installer.
+
+(use-modules (gnu packages)
+             (guix packages)
+             (guix profiles)
+             ((guix platform) #:select (targets))
+             ((gnu services xorg) #:select (%default-xorg-modules))
+             ((gnu system) #:select (%base-packages %base-packages-linux))
+             (guix utils)
+             (guix gexp)
+             (srfi srfi-1)
+             (srfi srfi-26))
+
+(define* (package->manifest-entry* package system
+                                   #:key target)
+  "Return a manifest entry for PACKAGE on SYSTEM, optionally cross-compiled to
+TARGET."
+  (manifest-entry
+    (inherit (package->manifest-entry package))
+    (name (string-append (package-name package) "." system
+                         (if target
+                             (string-append "." target)
+                             "'")))
+    (item (with-parameters ((%current-system system)
+                            (%current-target-system target))
+            package))))
+
+(define %guix-system-installer-systems
+  ;; Only the systems listed in GUIX_SYSTEM_INSTALLER_SYSTEMS
+  '("x86_64-linux" "i686-linux"
+    ;; These would be installed from their Linux counterparts:
+    ;"x86_64-gnu" "i586-gnu"
+    ;; Not actually for the installer, but needs the same packages anyway.
+    "aarch64-linux"))
+
+(define %base-packages/hurd
+  ;; Remove the packages from %base-packages-linux and some of the packages
+  ;; from the other package sets.
+  (fold delete %base-packages
+        (append (map specification->package
+                     '("e2fsprogs" "kbd" "iproute2" "iw" "wireless-tools"))
+                %base-packages-linux)))
+
+(define %system-packages
+  ;; Key packages proposed by the Guix System installer.
+  (append (map specification->package
+               '("gnome" "xfce" "mate" "enlightenment"
+                 "openbox" "awesome"
+                 "i3-wm" "i3status" "dmenu" "st"
+                 "ratpoison" "xterm"
+                 "emacs" "emacs-exwm" "emacs-desktop-environment"
+                 "openssh" "tor" "ntp" "gpm"
+                 "connman" "network-manager" "wpa-supplicant" "isc-dhcp" "cups"
+                 "linux-libre" "grub-hybrid"))
+          %default-xorg-modules))
+
+
+;;;
+;;; Manifests.
+;;;
+
+(define %base-manifest
+  (manifest
+   (append-map (lambda (system)
+                 (map (cut package->manifest-entry* <> system)
+                      (cond ((target-hurd? system)
+                             %base-packages/hurd)
+                            (else
+                             %base-packages))))
+               %guix-system-installer-systems)))
+
+(define %system-manifest
+  (manifest
+    (cons
+      ;; linux-libre-arm64-generic is the commonly used kernel on aarch64-linux.
+      (package->manifest-entry* (@ (gnu packages linux)
+                                   linux-libre-arm64-generic)
+                                "aarch64-linux")
+      (append-map (lambda (system)
+                    ;; Some of %SYSTEM-PACKAGES are currently unsupported on some
+                    ;; systems--e.g., GNOME on 32-bit, due to Rust.  Filter
+                    ;; them out.
+                    (filter-map (lambda (package)
+                                  (and (supported-package? package system)
+                                       (package->manifest-entry* package system)))
+                                %system-packages))
+                  %guix-system-installer-systems))))
+
+;; Return the union of all installer manifests.
+(concatenate-manifests (list %base-manifest
+                             %system-manifest))