guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 20/36: system: hurd: Add the Shepherd.


From: Ludovic Courtès
Subject: Re: 20/36: system: hurd: Add the Shepherd.
Date: Fri, 01 May 2020 00:25:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

address@hidden skribis:

> commit bb17242a511014e1691d494b17152865db0580e0
> Author: Jan (janneke) Nieuwenhuizen <address@hidden>
> AuthorDate: Tue Apr 7 08:03:03 2020 +0200
>
>     system: hurd: Add the Shepherd.
>     
>     This starts console and ttys using the Shepherd.  Shepherd is not running 
> as
>     PID 1 yet, its started from `rc'.
>     
>     * gnu/system/hurd.scm (%base-packages/hurd): Add "shepherd".
>     (%base-services/hurd): New variable.
>     (%hurd-os): New variable.
>     (hurd-shepherd-services): New function.
>     (cross-hurd-image): Use them to generate an (unused and incomplete) ...
>     (shepherd.conf): Generate from services defined in
>     %hurd-os.
>     * gnu/packages/hurd.scm (hurd-rc-script): Do not start console, start the
>     shepherd instead.
>     (hurd)[arguments]: Create pty devices.
>     * gnu/system/hurd.scm (shepherd.conf): New file.

[...]

> +;; XXX: We will replace this by addding (gnu services shepherd).
> +(define shepherd-configuration-file
> +  (@@ (gnu services shepherd) shepherd-configuration-file))
> +
>  (define %base-packages/hurd
>    (list hurd bash coreutils file findutils grep sed
>          guile-3.0 guile-colorized guile-readline
> -        net-base inetutils less which))
> +        net-base inetutils less shepherd which))
> +
> +(define %base-services/hurd
> +  (list (service user-processes-service-type)
> +        (service hurd-console-service-type
> +                 (hurd-console-configuration (hurd hurd)))
> +        (service hurd-ttys-service-type
> +                 (hurd-ttys-configuration (hurd hurd)))))
> +
> +(define %hurd-os
> +  (operating-system
> +    (host-name "guixygnu")
> +    (bootloader #f)
> +    (file-systems '())
> +    (timezone "GNUrope")
> +    (services %base-services/hurd)))
> +
> +(define (hurd-shepherd-services os)
> +  (append-map hurd-service->shepherd-service (operating-system-services os)))
>  
>  (define* (cross-hurd-image #:key (hurd hurd) (gnumach gnumach))
>    "Return a cross-built GNU/Hurd image."
> @@ -136,6 +163,10 @@ if [ -f \"$GUIX_PROFILE/etc/profile\" ]; then
>    . \"$GUIX_PROFILE/etc/profile\"
>  fi\n"))
>  
> +  (define shepherd.conf
> +    (with-parameters ((%current-target-system "i586-pc-gnu"))
> +      (shepherd-configuration-file (hurd-shepherd-services %hurd-os))))

This looks like an intermediate before fully using the service/OS
framework, but I wonder how much it helps.

The way I see it, now that you’ve defined services for Hurd-specific
things like the console client, you could very much write:

  (operating-system
    ;; …
    (kernel gnumach)
    (hurd hurd)  ;<- we probably need this new field
    (essential-services (hurd-essential-services this-operating-system))
    (services %base-hurd-services))

(Eventually we can even arrange for ‘essential-services’ and ‘services’
to pick the right default as a function of the chosen kernel.)

and then do:

  guix system build --target=i586-pc-gnu the-config-above.scm

Assuming system cross-compilation works as advertised :-), it should
cross-compile the whole system.

At that stage, you don’t need ‘cross-hurd-image’ any longer and you can
instead run:

  guix system vm-image --target=i586-pc-gnu the-config-above.scm

to achieve the same result.

But!  There’s one missing bit: a Hurdish grub.cfg.  I think that can be
hacked in (gnu bootloader grub), by inheriting from ‘grub-bootloader’
and providing a custom ‘configuration-file-generator’ field and maybe
‘installer’ as well.

Thus, (gnu system hurd) would be left with nothing but the definitions
of ‘%base-services/hurd’, ‘%base-packages/hurd’, and so on.
‘hurd-essential-services’ could maybe go to (gnu services hurd).

But I wonder if I’m missing something, WDYT?

Thanks for the exciting developments again!  :-)

Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]