[PATCH] Allow booting with custom shepherd package (fixed)

  • Done
  • quality assurance status badge
Details
3 participants
  • Leo Prikler
  • Ludovic Courtès
  • Maxime Devos
Owner
unassigned
Submitted by
Maxime Devos
Severity
normal
M
M
Maxime Devos wrote on 22 Jan 2021 20:57
874kj8bv8w.fsf@telenet.be
[previous e-mail was bogus. ggrr emacs, why can't I open e-mail
I was composing and saved with C-x C-f and continue later,
even if I set mml-mode]

Hi Guix,

If I didn't miss anything, this patch allows for booting with a non-standard
shepherd package, which may be useful for using features from a not-yet
released shepherd (presuming you've packaged the custom shepherd first :)).

I'll send a follow-up e-mail to confirm/disconfirm whether this works
well.

Maxime
-----BEGIN PGP SIGNATURE-----

iI0EARYIADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYAsuDxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7pEoAQCi2xSw+zmejpU63T4XnH7zQEGW
QsK9g0L+HYya36gGWgEAgGHjYcFmfwGTE/HbYh4Eavy5/BHExcWOFEtJA6/fFgg=
=CCaY
-----END PGP SIGNATURE-----

L
L
Leo Prikler wrote on 23 Jan 2021 09:25
ee2e799f378be5d6ff197c37a5d35549e0a2f563.camel@student.tugraz.at
Hi Maxime,

Am Freitag, den 22.01.2021, 20:57 +0100 schrieb Maxime Devos:
Toggle quote (8 lines)
> (compose concatenate)
> - (extend append)
> + (extend (lambda (config extra-services)
> + (shepherd-configuration
> + (inherit config)
> + (services (append (shepherd-configuration-services
> config)
> + extra-services)))))
I think you should also patch compose or drop it. I sadly don't know,
what impact that would have, but IIUC you should only spawn one
shepherd-root-service anyway.

Regards,
Leo
M
M
Maxime Devos wrote on 23 Jan 2021 16:11
733adeb431a34b153e580172ae865836966d789b.camel@telenet.be
Hi Leo,
On Sat, 2021-01-23 at 09:25 +0100, Leo Prikler wrote:
Toggle quote (15 lines)
> Hi Maxime,
>
> Am Freitag, den 22.01.2021, 20:57 +0100 schrieb Maxime Devos:
> > (compose concatenate)
> > - (extend append)
> > + (extend (lambda (config extra-services)
> > + (shepherd-configuration
> > + (inherit config)
> > + (services (append (shepherd-configuration-services
> > config)
> > + extra-services)))))
> I think you should also patch compose or drop it. I sadly don't know,
> what impact that would have, but IIUC you should only spawn one
> shepherd-root-service anyway.

Only one shepherd-root-service-type should be spawned, correct.
In practice, this means you'll need to use a construct like this
(if I didn't make any errors):

(modify-services %base-services
(shepherd-root-service-type c =>
(shepherd-configuration
(inherit c)
(shepherd a-custom-shepherd))))

For clarification: shepherd services should be added
via the service-extension mechanism, not by
manually changing the 'services' field
(though the latter is a possibility now).

About compose and concatenate: I think it is correct as-is.
If compose is dropped, then shepherd-root-service-type wouldn't be
extensible anymore. I don't see how it could be patched
in a way that makes sense.

Compare with udev-service-type as described in the manual,
which follows the same structure.

Regards,
Maxime
--
Maxime Devos <maximedevos@telenet.be>
PGP Key: C1F3 3EE2 0C52 8FDB 7DD7 011F 49E3 EE22 1917 25EE
Freenode handle: mdevos
-----BEGIN PGP SIGNATURE-----

iI0EABYIADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYAw8uBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7tUUAQC/8NnsnyIc6xAhGOmiRYOdw+Op
OromQNsx9rotYZtUTwEApZ1cFR1F2Z5hkNr8QPGWgy8M/9sGS6fHz5GhYV48FA8=
=9YA5
-----END PGP SIGNATURE-----


L
L
Leo Prikler wrote on 23 Jan 2021 16:25
(address . 46043@debbugs.gnu.org)(name . Maxime Devos)(address . maximedevos@telenet.be)
d930a10ab4cd982d1e04af94c3130124ef18bf86.camel@student.tugraz.at
Hi,

Am Samstag, den 23.01.2021, 16:11 +0100 schrieb Maxime Devos:
Toggle quote (6 lines)
> [...]
>
> About compose and concatenate: I think it is correct as-is.
> If compose is dropped, then shepherd-root-service-type wouldn't be
> extensible anymore. I don't see how it could be patched
> in a way that makes sense.
Ahh, my bad. It seems I don't have a strong enough understanding of
the difference between compose and extend yet. Nvm then.

Regards,
Leo
M
M
Maxime Devos wrote on 25 Jan 2021 09:48
(address . 46043@debbugs.gnu.org)(name . Maxime Devos)(address . maximedevos@telenet.be)
97fca7da3cf4fd0ff5aa554bc3ec95431f85e530.camel@telenet.be
Version 2 of the patch is attached. This version also uses
the custom package for /run/current-system/profile/bin/shepherd.
-----BEGIN PGP SIGNATURE-----

iI0EABYIADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYA6F5BccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7haNAQDmCkf7RMW+VF8FGTJqa6EU904b
dKz7vl7xL6k5++n2SQD/UnrR7D7SWwm/uJtUDdRn4klW6t/eDTcJElHW83bojgg=
=YlVB
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 26 Jan 2021 21:49
Re: bug#46043: [PATCH] Allow booting with custom shepherd package (fixed)
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 46043@debbugs.gnu.org)
875z3jzami.fsf_-_@gnu.org
Hi Maxime,

Maxime Devos <maximedevos@telenet.be> skribis:

Toggle quote (15 lines)
> Version 2 of the patch is attached. This version also uses
> the custom package for /run/current-system/profile/bin/shepherd.
>
> From b3102f72cd66dee4442596d89e29900b8215e1be Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos@telenet.be>
> Date: Fri, 22 Jan 2021 20:06:55 +0100
> Subject: [PATCH] services: shepherd: allow custom 'shepherd' package
>
> * gnu/services/shepherd.scm
> (<shepherd-configuration>): New record.
> (shepherd-boot-gexp, shepherd-root-service-type): Use it.
> (scm->go, shepherd-configuration-file): Allow passing custom
> shepherd package.
> * doc/guix.texi (Shepherd Services). Document it.

Nice! Overall LGTM. Nitpicking:

Toggle quote (4 lines)
> shepherd services (@pxref{Service Types and Services}, for an example).
> -Each extension must pass a list of @code{<shepherd-service>}.
> +Each extension must pass a list of @code{<shepherd-service>}. Its

Please leave two spaces after end-of-sentence periods.

Toggle quote (2 lines)
> +value must be a @code{shepherd-configuration}, as described below:

End with period rather than colon.

Toggle quote (3 lines)
> +@deftp {Data Type} shepherd-configuration
> +This data type represents shepherd's configuration.

s/shepherd/the Shepherd/ (referring to the software).

Toggle quote (4 lines)
> +@table @code
> +@item shepherd (default: @code{shepherd})
> +The shepherd package to use.

“Shepherd” (capitalized).

Toggle quote (2 lines)
> +(define* (scm->go file #:key (shepherd shepherd))

[...]

Toggle quote (2 lines)
> +(define* (shepherd-configuration-file services #:key (shepherd shepherd))

I’d made the second argument compulsory instead of a keyword parameter.

That’s all. Could you send an updated patch?

Thanks for addressing this longstanding shortcoming!

Ludo’.
M
M
Maxime Devos wrote on 27 Jan 2021 14:24
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 46043@debbugs.gnu.org)
e0610ac55cbc14b03744f9beab5fbf0b90f4ea2f.camel@telenet.be
Toggle quote (1 lines)
> That’s all. Could you send an updated patch?
See attachment.
-----BEGIN PGP SIGNATURE-----

iI0EABYIADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYBFpqhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7sKkAP9yD8c5B9hwm6T9cTlJauWGcenb
U7AvV2eN83YTyRl5wAEAwe+HrB9kHO5ZFP16h+9X2oqxD8ULdzHrnHZgqYq+gw8=
=mrgz
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 28 Jan 2021 00:09
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 46043-done@debbugs.gnu.org)
878s8et1sw.fsf@gnu.org
Hi,

Maxime Devos <maximedevos@telenet.be> skribis:

Toggle quote (12 lines)
> From 1b1e49f4aad95b766126fadd4166acf5ab6fbd31 Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos@telenet.be>
> Date: Fri, 22 Jan 2021 20:06:55 +0100
> Subject: [PATCH] services: shepherd: allow custom 'shepherd' package
>
> * gnu/services/shepherd.scm
> (<shepherd-configuration>): New record.
> (shepherd-boot-gexp, shepherd-root-service-type): Use it.
> (scm->go, shepherd-configuration-file): Allow passing custom
> shepherd package.
> * doc/guix.texi (Shepherd Services). Document it.

Applied, thanks!

Ludo’.
Closed
L
L
Ludovic Courtès wrote on 28 Jan 2021 00:15
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 46043@debbugs.gnu.org)
87y2germxk.fsf@gnu.org
Maxime Devos <maximedevos@telenet.be> skribis:

Toggle quote (12 lines)
> From 1b1e49f4aad95b766126fadd4166acf5ab6fbd31 Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos@telenet.be>
> Date: Fri, 22 Jan 2021 20:06:55 +0100
> Subject: [PATCH] services: shepherd: allow custom 'shepherd' package
>
> * gnu/services/shepherd.scm
> (<shepherd-configuration>): New record.
> (shepherd-boot-gexp, shepherd-root-service-type): Use it.
> (scm->go, shepherd-configuration-file): Allow passing custom
> shepherd package.
> * doc/guix.texi (Shepherd Services). Document it.

Oops, I spoke too fast: “make check-system TESTS=basic” shows one
problem, which stems from this:

Toggle snippet (9 lines)
(define (operating-system-shepherd-service-names os)
"Return the list of Shepherd service names for OS."
(append-map shepherd-service-provision
(service-value
(fold-services (operating-system-services os)
#:target-type
shepherd-root-service-type))))

This procedure needs to be adjusted because the value of
‘shepherd-root-service-type’ instances is no longer a list of
<shepherd-service>.

I suspect ‘guix system search’ and ‘guix system shepherd-graph’ are
affected as well, though I didn’t check (“make check” should catch it, I
think.)

Could you take a look?

TIA,
Ludo’.
L
L
Ludovic Courtès wrote on 28 Jan 2021 00:16
control message for bug #46043
(address . control@debbugs.gnu.org)
87wnvyrmx0.fsf@gnu.org
reopen 46043
tags 46043 - fixed patch
quit
M
M
Maxime Devos wrote on 28 Jan 2021 09:20
Re: bug#46043: [PATCH] Allow booting with custom shepherd package (fixed)
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 46043@debbugs.gnu.org)
74ad9bc1419a00dcf21b5e3e1370c1656f1bd740.camel@telenet.be
Toggle quote (1 lines)
> Could you take a look?
Revised patch is attached.
'make check-system TESTS=basic' now succeeds, I'm now
running 'make check-system' just in case.
-----BEGIN PGP SIGNATURE-----

iI0EABYIADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYBJzsBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7jnDAP9vVqiKOzlu5stCmHj4jo5w4h3B
gPbeuLKNL98U9PN4ngEAxnczR09ZUTdd8L6jtrsn5Sj9RLFYgOj/u/sN62Tj0wo=
=uGCh
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 28 Jan 2021 14:18
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 46043@debbugs.gnu.org)
87y2gdp5d2.fsf@gnu.org
Maxime Devos <maximedevos@telenet.be> skribis:

Toggle quote (2 lines)
> Revised patch is attached.

I think that’s the same as before (there are no changes to
gnu/system.scm). :-)

Ludo’.
M
M
Maxime Devos wrote on 28 Jan 2021 17:32
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 46043@debbugs.gnu.org)
8a034285f33c9eb70a5c1ba928dd24b224cdc326.camel@telenet.be
Toggle quote (2 lines)
> I think that’s the same as before (there are no changes to
> gnu/system.scm). :-)
This time for real :-)
-----BEGIN PGP SIGNATURE-----

iI0EABYIADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYBLnCBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7ppCAQDsJX36pgXe7rba7WtRiVxTScWy
KkWhoCm7xKLpjW0CtgEAy79ZTuk2Z5BklVuznwar7swo3y/QIvKOiRX7USv9EA4=
=Hz6o
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 30 Jan 2021 15:36
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 46043-done@debbugs.gnu.org)
87ft2ifq4o.fsf_-_@gnu.org
Hi,

Maxime Devos <maximedevos@telenet.be> skribis:

Toggle quote (14 lines)
> From 085708344c4a9d7f819a399e666e2bab2ae7a54d Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos@telenet.be>
> Date: Fri, 22 Jan 2021 20:06:55 +0100
> Subject: [PATCH] services: shepherd: allow custom 'shepherd' package
>
> * gnu/services/shepherd.scm
> (<shepherd-configuration>): New record.
> (shepherd-boot-gexp, shepherd-root-service-type): Use it.
> (scm->go, shepherd-configuration-file): Allow passing custom
> shepherd package.
> * gnu/system.scm
> (operating-system-shepherd-service-names): Use the new record.
> * doc/guix.texi (Shepherd Services). Document it.

Applied! I had to fix ‘guix system shepherd-graph’, as explained
before, but apart from that it all looks good.

Thanks,
Ludo’.
Closed
?