gnu: metabat: Update to 2.11.3.
[jackhill/guix/guix.git] / gnu / system.scm
index 8e44ee8..6b35e3c 100644 (file)
             boot-parameters?
             boot-parameters-label
             boot-parameters-root-device
-            boot-parameters-boot-name
+            boot-parameters-bootloader-name
             boot-parameters-store-device
             boot-parameters-store-mount-point
             boot-parameters-kernel
             boot-parameters-initrd
             read-boot-parameters
             read-boot-parameters-file
+            boot-parameters->menu-entry
 
             local-host-aliases
             %setuid-programs
@@ -215,7 +216,7 @@ directly by the user."
   ;; exactly to the device field of the <file-system> object representing the
   ;; OS's root file system, so it might be a device path like "/dev/sda3".
   (root-device      boot-parameters-root-device)
-  (boot-name        boot-parameters-boot-name)
+  (bootloader-name  boot-parameters-bootloader-name)
   (store-device     boot-parameters-store-device)
   (store-mount-point boot-parameters-store-mount-point)
   (kernel           boot-parameters-kernel)
@@ -234,8 +235,8 @@ directly by the user."
       (label label)
       (root-device root)
 
-      (boot-name
-       (match (assq 'boot-name rest)
+      (bootloader-name
+       (match (assq 'bootloader-name rest)
          ((_ args) args)
          (#f       'grub))) ; for compatibility reasons.
 
@@ -299,6 +300,17 @@ The object has its kernel-arguments extended in order to make it bootable."
                                                      system
                                                      root-device)))
       #f)))
+
+(define (boot-parameters->menu-entry conf)
+  (menu-entry
+   (label (boot-parameters-label conf))
+   (device (boot-parameters-store-device conf))
+   (device-mount-point (boot-parameters-store-mount-point conf))
+   (linux (boot-parameters-kernel conf))
+   (linux-arguments (boot-parameters-kernel-arguments conf))
+   (initrd (boot-parameters-initrd conf))))
+
+
 \f
 ;;;
 ;;; Services.
@@ -378,6 +390,7 @@ from the initrd."
   (cond
    ((string-prefix? "arm" (%current-system)) "zImage")
    ((string-prefix? "mips" (%current-system)) "vmlinuz")
+   ((string-prefix? "aarch64" (%current-system)) "Image")
    (else "bzImage")))
 
 (define (operating-system-kernel-file os)
@@ -389,17 +402,18 @@ OS."
 (define* (operating-system-directory-base-entries os #:key container?)
   "Return the basic entries of the 'system' directory of OS for use as the
 value of the SYSTEM-SERVICE-TYPE service."
-  (mlet %store-monad ((locale (operating-system-locale-directory os)))
-    (if container?
-        (return `(("locale" ,locale)))
-        (mlet %store-monad
-            ((kernel  ->  (operating-system-kernel os))
-             (initrd      (operating-system-initrd-file os))
-             (params      (operating-system-boot-parameters-file os)))
-          (return `(("kernel" ,kernel)
-                    ("parameters" ,params)
-                    ("initrd" ,initrd)
-                    ("locale" ,locale)))))))      ;used by libc
+  (let ((locale (operating-system-locale-directory os)))
+    (with-monad %store-monad
+      (if container?
+          (return `(("locale" ,locale)))
+          (mlet %store-monad
+              ((kernel  ->  (operating-system-kernel os))
+               (initrd      (operating-system-initrd-file os))
+               (params      (operating-system-boot-parameters-file os)))
+            (return `(("kernel" ,kernel)
+                      ("parameters" ,params)
+                      ("initrd" ,initrd)
+                      ("locale" ,locale))))))))   ;used by libc
 
 (define* (essential-services os #:key container?)
   "Return the list of essential services for OS.  These are special services
@@ -476,6 +490,7 @@ explicitly appear in OS."
          lsof                                 ;for Guix's 'list-runtime-roots'
          pciutils usbutils
          util-linux inetutils isc-dhcp
+         (@ (gnu packages admin) shadow)          ;for 'passwd'
 
          ;; wireless-tools is deprecated in favor of iw, but it's still what
          ;; many people are familiar with, so keep it around.
@@ -499,10 +514,16 @@ explicitly appear in OS."
 
          bash-completion
 
+         ;; XXX: We don't use (canonical-package guile-2.2) here because that
+         ;; would create a collision in the global profile between the GMP
+         ;; variant propagated by 'guile-final' and the GMP variant propagated
+         ;; by 'gnutls', itself propagated by 'guix'.
+         guile-2.2
+
          ;; The packages below are also in %FINAL-INPUTS, so take them from
          ;; there to avoid duplication.
          (map canonical-package
-              (list guile-2.2 bash coreutils findutils grep sed
+              (list bash coreutils findutils grep sed
                     diffutils patch gawk tar gzip bzip2 xz lzip))))
 
 (define %default-issue
@@ -702,6 +723,8 @@ use 'plain-file' instead~%")
   (let ((shadow (@ (gnu packages admin) shadow)))
     (list (file-append shadow "/bin/passwd")
           (file-append shadow "/bin/su")
+          (file-append shadow "/bin/newuidmap")
+          (file-append shadow "/bin/newgidmap")
           (file-append inetutils "/bin/ping")
           (file-append inetutils "/bin/ping6")
           (file-append sudo "/bin/sudo")
@@ -847,15 +870,16 @@ listed in OS.  The C library expects to find it under
   (store-file-system (operating-system-file-systems os)))
 
 (define* (operating-system-bootcfg os #:optional (old-entries '()))
-  "Return the bootloader configuration file for OS.  Use OLD-ENTRIES to
-populate the \"old entries\" menu."
+  "Return the bootloader configuration file for OS.  Use OLD-ENTRIES
+(which is a list of <menu-entry>) to populate the \"old entries\" menu."
   (mlet* %store-monad
       ((system      (operating-system-derivation os))
        (root-fs ->  (operating-system-root-file-system os))
        (root-device -> (if (eq? 'uuid (file-system-title root-fs))
                            (uuid->string (file-system-device root-fs))
                            (file-system-device root-fs)))
-       (entry (operating-system-boot-parameters os system root-device))
+       (params (operating-system-boot-parameters os system root-device))
+       (entry -> (boot-parameters->menu-entry params))
        (bootloader-conf -> (operating-system-bootloader os)))
     ((bootloader-configuration-file-generator
       (bootloader-configuration-bootloader bootloader-conf))
@@ -878,7 +902,7 @@ kernel arguments for that derivation to <boot-parameters>."
        (store -> (operating-system-store-file-system os))
        (bootloader  -> (bootloader-configuration-bootloader
                         (operating-system-bootloader os)))
-       (boot-name   -> (bootloader-name bootloader))
+       (bootloader-name -> (bootloader-name bootloader))
        (label -> (kernel->boot-label (operating-system-kernel os))))
     (return (boot-parameters
              (label label)
@@ -889,7 +913,7 @@ kernel arguments for that derivation to <boot-parameters>."
                 (operating-system-kernel-arguments os system.drv root-device)
                 (operating-system-user-kernel-arguments os)))
              (initrd initrd)
-             (boot-name boot-name)
+             (bootloader-name bootloader-name)
              (store-device (fs->boot-device store))
              (store-mount-point (file-system-mount-point store))))))
 
@@ -915,7 +939,7 @@ being stored into the \"parameters\" file)."
                     (kernel-arguments
                      #$(boot-parameters-kernel-arguments params))
                     (initrd #$(boot-parameters-initrd params))
-                    (boot-name #$(boot-parameters-boot-name params))
+                    (bootloader-name #$(boot-parameters-bootloader-name params))
                     (store
                      (device #$(boot-parameters-store-device params))
                      (mount-point #$(boot-parameters-store-mount-point params))))