unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#41541] [PATCH 1/8] system: Add 'hurd' field to <operating-system>.
       [not found] ` <20200604135914.4499-2-janneke@gnu.org>
@ 2020-06-06 10:45   ` Ludovic Courtès
  2020-06-06 11:14     ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 20+ messages in thread
From: Ludovic Courtès @ 2020-06-06 10:45 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 41541

Hi!

"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

> * gnu/system.scm (<operating-system>)[hurd]: New field.
> * doc/guix.texi (operating-system Reference): Document 'hurd'.
> ---
>  doc/guix.texi  | 13 ++++++++++---
>  gnu/system.scm |  3 +++
>  2 files changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/doc/guix.texi b/doc/guix.texi
> index 056bf011f6..4776eacacd 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -11484,9 +11484,16 @@ configuration (@pxref{Using the Configuration System}).
>  
>  @table @asis
>  @item @code{kernel} (default: @code{linux-libre})
> -The package object of the operating system kernel to use@footnote{Currently
> -only the Linux-libre kernel is supported.  In the future, it will be
> -possible to use the GNU@tie{}Hurd.}.
> +The package object of the operating system kernel to
> +use@footnote{Currently only the Linux-libre kernel is fully supported.
> +Using GNU@tie{}mach in combination with a @code{hurd} is experimental

Using GNU@tie{}Mach with the GNU@tie{}Hurd is experimental

> +and only available when building a vm-image.}.
> +
> +@cindex hurd
> +@item @code{hurd} (default: @code{#f})
> +The hurd to be started by the kernel.  This is required to build an
> +experimental vm-image for the Hurd and requires using @code{kernel}
> +GNU@tie{}mach as well as other specific operating system overrides.

To show that this field is not specific to disk/VM images, how about
something along these lines:

  When this field is set, produce a GNU/Hurd operating system.  In that
  case, @code{kernel} must also be set to the @code{gnumach}
  package---the microkernel the Hurd runs on.

  @quotation Warning
  This feature is experimental and only supported for disk images.
  @end quotation

Ludo’.




^ permalink raw reply	[flat|nested] 20+ messages in thread

* [bug#41541] [PATCH 2/8] bootloader: Extend `<menu-entry>' for multiboot.
       [not found] ` <20200604135914.4499-3-janneke@gnu.org>
@ 2020-06-06 10:48   ` Ludovic Courtès
  2020-06-06 12:00     ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 20+ messages in thread
From: Ludovic Courtès @ 2020-06-06 10:48 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 41541

"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

> * gnu/bootloader.scm (<menu-entry>)[multiboot-kernel,multiboot-arguments,
> multiboot-modules]: New fields.
> [linux,initrd]: Add default value '#f'.
> (menu-entry->sexp, sexp->menu-entry): Support multiboot entry.

Could you mention the new fields in guix.texi?

Otherwise LGTM!




^ permalink raw reply	[flat|nested] 20+ messages in thread

* [bug#41541] [PATCH 3/8] system: Add 'multiboot-modules' field to <boot-parameters>.
       [not found]   ` <87eeqsmyxy.fsf@gnu.org>
@ 2020-06-06 10:55     ` Ludovic Courtès
  2020-06-07  7:39       ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 20+ messages in thread
From: Ludovic Courtès @ 2020-06-06 10:55 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 41541, Jan (janneke) Nieuwenhuizen

Hi,

Mathieu Othacehe <othacehe@gnu.org> skribis:

>> +             (mach (if (%current-target-system)
>> +                       ;; A cross-built GNUmach does not work
>> +                       (with-parameters ((%current-system "i686-linux")
>> +                                         (%current-target-system #f))
>> +                         mach)
>
> Maybe it would make more sense to check if we are on a Hurd system,
> rather than just checking for %current-target-system to be set, don't
> know.

If this hack is still needed, can we move it away to hurd-os.tmpl, or to
the ‘gnumach’ package itself or something?

I think it’s best to keep (gnu system) free of any such assumptions.

>> +         (libc (if target
>> +                   (with-parameters ((%current-target-system #f))
>> +                     (cross-libc target))
>> +                   glibc))
>
> In the future, it would be nice to make this think transparent. Anyway,
> for now this is the best we can do I think.

Yeah, perhaps add a FIXME.

>> "--x-xattr-translator-records"

Do we need this yet?  If it can wait for later, that’s even nicer IMO as
it would allow us to separate concerns.

Ludo’.




^ permalink raw reply	[flat|nested] 20+ messages in thread

* [bug#41541] [PATCH 4/8] bootloader: grub: Add support for multiboot.
       [not found] ` <20200604135914.4499-5-janneke@gnu.org>
@ 2020-06-06 10:57   ` Ludovic Courtès
  2020-06-06 12:08     ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 20+ messages in thread
From: Ludovic Courtès @ 2020-06-06 10:57 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 41541

"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

> * gnu/bootloader/grub.scm (grub-configuration-file): Add support for
> multiboot.

[...]

> -  #:export (menu-entry
> +  #:export (<menu-entry>

Please don’t do that.  In general we shouldn’t export record-type
descriptors as it breaks encapsulation.




^ permalink raw reply	[flat|nested] 20+ messages in thread

* [bug#41541] [PATCH 5/8] system: Use 'hurd' package in label.
       [not found] ` <20200604135914.4499-6-janneke@gnu.org>
@ 2020-06-06 10:57   ` Ludovic Courtès
  0 siblings, 0 replies; 20+ messages in thread
From: Ludovic Courtès @ 2020-06-06 10:57 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 41541

"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

> * gnu/system.scm (kernel->boot-label): Add keyword parameter 'hurd'.  If set,
> use it for label.
> (operating-system-default-label): Call with it with operating-system-hurd.

LGTM! :-)




^ permalink raw reply	[flat|nested] 20+ messages in thread

* [bug#41541] [PATCH 6/8] system: examples: Add bare-hurd.tmpl.
       [not found]   ` <875zc4mxtu.fsf@gnu.org>
@ 2020-06-06 10:58     ` Jan Nieuwenhuizen
  2020-06-06 16:49       ` Mathieu Othacehe
  0 siblings, 1 reply; 20+ messages in thread
From: Jan Nieuwenhuizen @ 2020-06-06 10:58 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 41541, Ludovic Courtès

Mathieu Othacehe writes:

Hello Mathieu, Ludo!

>>     ./pre-inst-env guix system vm-image --target=i586-pc-gnu --no-grafts \
>>         gnu/system/examples/bare-hurd.tmpl
>
> Not related to your serie, but I would really like the "image" catalog I
> proposed to help here. Most people struggle to get the difference
> between --system and --target. Plus, those cross-compilation targets are
> not really documented.
>
> I think if one could write:
>
> guix system image gnu/system/images/bare-hurd.scm
>
> or so, it would help. But this needs some more discussions.

Yes, I agree.  Do you propose to hold back merging wip-hurd-vm until
after merging the "image" catalog feature and then rewrite this message?

Exactly when we merge wip-hurd-vm does not matter all that much to me,
it's much more important/interesting to agree when we're happy with it.

>> -  #:use-module ((guix utils) #:select (source-properties->location))
>> +  #:use-module ((guix utils) #:select (source-properties->location
>> +                                       %current-target-system))
>
> You're not using it right?

Ah, no (not since the grub work moved).

>> +    ;; (kernel-loadable-modules '())
>
> Remove it.

Ok, I was already unsure about keeping...

>> +    ;; (label (operating-system-default-label this-operating-system))
>
> Same for this one and the other commented lines below.

...these all.  They were pretty helpful for me to get it to work,
initially.  This will see more changes as Hurd support improves!

Hmm, oops: the guix-system.sh test fails.  Added this

--8<---------------cut here---------------start------------->8---
diff --git a/tests/guix-system.sh b/tests/guix-system.sh
index 3a831cba1d..0e22686a34 100644
--- a/tests/guix-system.sh
+++ b/tests/guix-system.sh
@@ -307,7 +307,12 @@ guix system search anonym network | grep "^name: tor"
 
 # Verify that the examples can be built.
 for example in gnu/system/examples/*.tmpl; do
-    guix system -n disk-image "$example"
+    if echo "$example" | grep hurd; then
+        target="--target=i586-pc-gnu"
+    else
+        target=
+    fi
+    guix system -n disk-image $target "$example"
 done
 
 # Verify that the disk image types can be built.
--8<---------------cut here---------------end--------------->8---

to "fix" that.  It feals a bit heavy, ugly and specific.  Ideas?

Greetings, Janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [bug#41541] [PATCH 6/8] system: examples: Add bare-hurd.tmpl.
       [not found] ` <20200604135914.4499-7-janneke@gnu.org>
       [not found]   ` <875zc4mxtu.fsf@gnu.org>
@ 2020-06-06 10:59   ` Ludovic Courtès
  2020-06-06 12:34     ` Jan Nieuwenhuizen
  1 sibling, 1 reply; 20+ messages in thread
From: Ludovic Courtès @ 2020-06-06 10:59 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 41541

"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

> With this, we can now build a VM like so
>
>     ./pre-inst-env guix system vm-image --target=i586-pc-gnu --no-grafts \
>         gnu/system/examples/bare-hurd.tmpl
>
> it boots, but needs some more setup/services to be really useful.

Maybe make it a comment at the top of bare-hurd.tmpl?

> See also: <https://bugs.gnu.org/40839>; wip-disk-image.

What does this mean?

Otherwise LGTM!




^ permalink raw reply	[flat|nested] 20+ messages in thread

* [bug#41541] [PATCH 8/8] system: Add `hurd-activation'.
       [not found] ` <20200604135914.4499-9-janneke@gnu.org>
@ 2020-06-06 11:05   ` Ludovic Courtès
  2020-06-06 14:21     ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 20+ messages in thread
From: Ludovic Courtès @ 2020-06-06 11:05 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 41541

"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

> +(define (hurd-activation-script gexps)
> +  "Return the Hurd activation script, which evaluates GEXPS."
> +  (define actions
> +    (map (cut program-file "activate-service.scm" <>) gexps))
> +
> +  (with-imported-modules (source-module-closure
> +                          '((gnu build activation)
> +                            (guix build utils)))
> +    #~(begin
> +        (use-modules (gnu build activation)
> +                     (guix build utils))
> +
> +        (mkdir-p "/var/run")            ;for the PID files
> +        (mkdir-p "/var/log")
> +
> +        ;; Set up /run/current-system.  Among other things this
> +        ;; sets up locales, which the activation snippets
> +        ;; executed below may expect.
> +        (activate-current-system #:kernel-command-line command-line)

It seems that ‘command-line’ is unbound here, no?

I was wondering: if the only thing that differs between Linux and Mach
is the command line, could we keep the same activation script for both
cases, and instead move the conditional to (gnu build activation), like:

  (if (string-contains %host-type "linux-gnu")
      linux-command-line
      mach-command-line)

Does that make sense?

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 20+ messages in thread

* [bug#41541] [PATCH 7/8] services: hurd: Add `hurd-etc-service'.
       [not found] ` <20200604135914.4499-8-janneke@gnu.org>
@ 2020-06-06 11:08   ` Ludovic Courtès
  2020-06-06 14:31     ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 20+ messages in thread
From: Ludovic Courtès @ 2020-06-06 11:08 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 41541

"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

> * gnu/services/hurd.scm: New file.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
> * doc/guix.texi (Hurd Services): Document it.

[...]

> +@deffn {Scheme Procedure} hurd-etc-service @var{os}
> +This service implements a minimal @code{etc-service}, adding some
> +specifics for the Hurd.
> +
> +It is part of the @code{hurd-default-essential-services}.
> +@end deffn

The ‘hurd-default-essential-services’ bit is not in this patch, though.

> +;;; The ETC service for the Hurd.

s/ETC/etc/

> +(define (hurd-etc-service os)
> +  "Return a <service> that builds containing the static part of the /etc
> +directory."
> +  (let ((profile (mixed-text-file "profile"  "\
> +# Generated by hurd-etc-services
> +export PS1='\\u@\\h\\$ '
> +
> +GUIX_PROFILE=\"/run/current-system/profile\"
> +. \"$GUIX_PROFILE/etc/profile\"
> +
> +GUIX_PROFILE=\"$HOME/.guix-profile\"
> +if [ -f \"$GUIX_PROFILE/etc/profile\" ]; then
> +  . \"$GUIX_PROFILE/etc/profile\"
> +fi\n"))
> +        (hurd (operating-system-hurd os)))
> +    (etc-service
> +     `(("services" ,(file-append net-base "/etc/services"))
> +       ("protocols" ,(file-append net-base "/etc/protocols"))
> +       ("profile" ,profile)
> +       ("hostname" ,(plain-file "hostname" (operating-system-host-name os)))
> +       ("login" ,(file-append hurd "/etc/login"))
> +       ("motd" ,(file-append hurd "/etc/motd"))))))

Why again does it need to be different from that on GNU/Linux?
Intuitively it should be the same, but it’s fine to keep this one,
perhaps with a FIXME, until we’ve figured out what to do to use the same
/etc service in both cases.

Ludo’.




^ permalink raw reply	[flat|nested] 20+ messages in thread

* [bug#41541] [PATCH 1/8] system: Add 'hurd' field to <operating-system>.
  2020-06-06 10:45   ` [bug#41541] [PATCH 1/8] system: Add 'hurd' field to <operating-system> Ludovic Courtès
@ 2020-06-06 11:14     ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 20+ messages in thread
From: Jan Nieuwenhuizen @ 2020-06-06 11:14 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41541

Ludovic Courtès writes:

Hello!

> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
>
>> * gnu/system.scm (<operating-system>)[hurd]: New field.
>> * doc/guix.texi (operating-system Reference): Document 'hurd'.
>> ---
>>  doc/guix.texi  | 13 ++++++++++---
>>  gnu/system.scm |  3 +++
>>  2 files changed, 13 insertions(+), 3 deletions(-)
>>
>> diff --git a/doc/guix.texi b/doc/guix.texi
>> index 056bf011f6..4776eacacd 100644
>> --- a/doc/guix.texi
>> +++ b/doc/guix.texi
>> @@ -11484,9 +11484,16 @@ configuration (@pxref{Using the Configuration System}).
>>  
>>  @table @asis
>>  @item @code{kernel} (default: @code{linux-libre})
>> -The package object of the operating system kernel to use@footnote{Currently
>> -only the Linux-libre kernel is supported.  In the future, it will be
>> -possible to use the GNU@tie{}Hurd.}.
>> +The package object of the operating system kernel to
>> +use@footnote{Currently only the Linux-libre kernel is fully supported.
>> +Using GNU@tie{}mach in combination with a @code{hurd} is experimental
>
> Using GNU@tie{}Mach with the GNU@tie{}Hurd is experimental

Ok!  (I think i tried to refer to the field "hurd", but I like your suggestion better)

>> +and only available when building a vm-image.}.
>> +
>> +@cindex hurd
>> +@item @code{hurd} (default: @code{#f})
>> +The hurd to be started by the kernel.  This is required to build an
>> +experimental vm-image for the Hurd and requires using @code{kernel}
>> +GNU@tie{}mach as well as other specific operating system overrides.
>
> To show that this field is not specific to disk/VM images, how about
> something along these lines:
>
>   When this field is set, produce a GNU/Hurd operating system.  In that
>   case, @code{kernel} must also be set to the @code{gnumach}
>   package---the microkernel the Hurd runs on.
>
>   @quotation Warning
>   This feature is experimental and only supported for disk images.
>   @end quotation

Nice, thanks!  Changed to

@item @code{hurd} (default: @code{#f})
The package object of the hurd to be started by the kernel.  When this
field is set, produce a GNU/Hurd operating system.  In that case,
@code{kernel} must also be set to the @code{gnumach} package---the
microkernel the Hurd runs on.

@quotation Warning
This feature is experimental and only supported for disk images.
@end quotation

Janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




^ permalink raw reply	[flat|nested] 20+ messages in thread

* [bug#41541] [PATCH 2/8] bootloader: Extend `<menu-entry>' for multiboot.
  2020-06-06 10:48   ` [bug#41541] [PATCH 2/8] bootloader: Extend `<menu-entry>' for multiboot Ludovic Courtès
@ 2020-06-06 12:00     ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 20+ messages in thread
From: Jan Nieuwenhuizen @ 2020-06-06 12:00 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41541

Ludovic Courtès writes:

> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
>
>> * gnu/bootloader.scm (<menu-entry>)[multiboot-kernel,multiboot-arguments,
>> multiboot-modules]: New fields.
>> [linux,initrd]: Add default value '#f'.
>> (menu-entry->sexp, sexp->menu-entry): Support multiboot entry.
>
> Could you mention the new fields in guix.texi?

Oops, I missed that.  Added the "default #f" for the linux and initrd
fields, and this

@item @code{multiboot-kernel} (default: @code{#f})
The kernel to boot in Multiboot-mode (@pxref{multiboot,,, grub, GNU GRUB
manual}).  When this field is set, a Multiboot menu-entry is generated.
For example:

@lisp
(file-append mach "/boot/gnumach")
@end lisp

@item @code{multiboot-arguments} (default: @code{()})
The list of extra command-line arguments for the multiboot-kernel.

@item @code{multiboot-modules} (default: @code{()})
The list of commands for loading Multiboot modules.  For example:

@lisp
(list (list (file-append hurd "/hurd/ext2fs.static") "ext2fs"
             @dots{})
      (list (file-append libc "/lib/ld.so.1") "exec"
             @dots{}))
@end lisp

> Otherwise LGTM!

Thanks, Janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




^ permalink raw reply	[flat|nested] 20+ messages in thread

* [bug#41541] [PATCH 4/8] bootloader: grub: Add support for multiboot.
  2020-06-06 10:57   ` [bug#41541] [PATCH 4/8] bootloader: grub: Add support for multiboot Ludovic Courtès
@ 2020-06-06 12:08     ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 20+ messages in thread
From: Jan Nieuwenhuizen @ 2020-06-06 12:08 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41541

Ludovic Courtès writes:

> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
>
>> * gnu/bootloader/grub.scm (grub-configuration-file): Add support for
>> multiboot.
>
> [...]
>
>> -  #:export (menu-entry
>> +  #:export (<menu-entry>
>
> Please don’t do that.  In general we shouldn’t export record-type
> descriptors as it breaks encapsulation.

Hmm...okay, it's not needed per se.  I rewrote the (match (($
<menu-entry>) ... ) to use accessors again!

Greetings, Janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




^ permalink raw reply	[flat|nested] 20+ messages in thread

* [bug#41541] [PATCH 6/8] system: examples: Add bare-hurd.tmpl.
  2020-06-06 10:59   ` Ludovic Courtès
@ 2020-06-06 12:34     ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 20+ messages in thread
From: Jan Nieuwenhuizen @ 2020-06-06 12:34 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41541

Ludovic Courtès writes:

> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
>
>> With this, we can now build a VM like so
>>
>>     ./pre-inst-env guix system vm-image --target=i586-pc-gnu --no-grafts \
>>         gnu/system/examples/bare-hurd.tmpl
>>
>> it boots, but needs some more setup/services to be really useful.
>
> Maybe make it a comment at the top of bare-hurd.tmpl?

Sure, moved there and...

...and adapted to say "disk-image".

>> See also: <https://bugs.gnu.org/40839>; wip-disk-image.

> What does this mean?

Removed.  This was from before our "explosive" mixture of the two wip
branches, as a courtesy for fellow Hurd hackers to get involved :-/

I tend to add extra stuff to commit messages and then forget to clean-up
later.

> Otherwise LGTM!

Thanks, Janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




^ permalink raw reply	[flat|nested] 20+ messages in thread

* [bug#41541] [PATCH 8/8] system: Add `hurd-activation'.
  2020-06-06 11:05   ` [bug#41541] [PATCH 8/8] system: Add `hurd-activation' Ludovic Courtès
@ 2020-06-06 14:21     ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 20+ messages in thread
From: Jan Nieuwenhuizen @ 2020-06-06 14:21 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41541

Ludovic Courtès writes:

> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
>
>> +(define (hurd-activation-script gexps)
>> +        (activate-current-system #:kernel-command-line command-line)
>
> It seems that ‘command-line’ is unbound here, no?

I don't think so...activation will be loaded from RC (following commit),
which is a guile script started by RUNSYSTEM:

--8<---------------cut here---------------start------------->8---
...
exec ${system}/rc \"$@\"
--8<---------------cut here---------------end--------------->8---

> I was wondering: if the only thing that differs between Linux and Mach
> is the command line, could we keep the same activation script for both
> cases, and instead move the conditional to (gnu build activation), like:
>
   (if (string-contains %host-type "linux-gnu")
       linux-command-line
       mach-command-line)

> Does that make sense?

Yes, much better now.  Using (command-line), though.

This used to be much more complicated, when stuff didn't cross build
correctly etc.

Greetings,
Janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




^ permalink raw reply	[flat|nested] 20+ messages in thread

* [bug#41541] [PATCH 7/8] services: hurd: Add `hurd-etc-service'.
  2020-06-06 11:08   ` [bug#41541] [PATCH 7/8] services: hurd: Add `hurd-etc-service' Ludovic Courtès
@ 2020-06-06 14:31     ` Jan Nieuwenhuizen
  2020-06-07 20:02       ` Ludovic Courtès
  0 siblings, 1 reply; 20+ messages in thread
From: Jan Nieuwenhuizen @ 2020-06-06 14:31 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41541

[-- Attachment #1: Type: text/plain, Size: 2161 bytes --]

Ludovic Courtès writes:

> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
>
>> * gnu/services/hurd.scm: New file.
>> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
>> * doc/guix.texi (Hurd Services): Document it.
>
> [...]

As discussed on IRC: dropped altogether, replaced with attached patch.

>> +@deffn {Scheme Procedure} hurd-etc-service @var{os}
>> +This service implements a minimal @code{etc-service}, adding some
>> +specifics for the Hurd.
>> +
>> +It is part of the @code{hurd-default-essential-services}.
>> +@end deffn
>
> The ‘hurd-default-essential-services’ bit is not in this patch, though.

Hmm.  I think it's complicated...No, it was complicated.  ETC depends on
%activatation which depends on %boot, but those now work; so I can
reorder!

Reordered, added to hurd-default-essential-services in compliance with
the documentation.

>> +;;; The ETC service for the Hurd.
>
> s/ETC/etc/

OK.  Eh... ok. ;-)

>> +(define (hurd-etc-service os)
[..]
>> +    (etc-service
>> +     `(("services" ,(file-append net-base "/etc/services"))
>> +       ("protocols" ,(file-append net-base "/etc/protocols"))
>> +       ("profile" ,profile)
>> +       ("hostname" ,(plain-file "hostname" (operating-system-host-name os)))
>> +       ("login" ,(file-append hurd "/etc/login"))
>> +       ("motd" ,(file-append hurd "/etc/motd"))))))
>
> Why again does it need to be different from that on GNU/Linux?

Good question!  Yeah...this started out as a more formalized copy of the
gnu/system/hurd.scm hack and it used to be complicated; services didn't
cross build, for example.

Also, it felt good to start really minimalistic, especially because of
the cross build troubles.

I seemed to remember that on top of that there was a Hurd build problem,
but I think that must have been sudo and it's easy to disable.

> Intuitively it should be the same, but it’s fine to keep this one,
> perhaps with a FIXME, until we’ve figured out what to do to use the same
> /etc service in both cases.

Phew, I didn't expect so much work; but also not so much cleanup so
soon.

Thanks, Janneke


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-services-Support-etc-service-for-the-Hurd.patch --]
[-- Type: text/x-patch, Size: 3181 bytes --]

From 4cef6e73ce9fd137640c1c00f98958cdc41dda90 Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
Date: Sat, 25 Apr 2020 11:55:56 +0200
Subject: [PATCH] services: Support etc-service for the Hurd.

* gnu/system.scm (operating-system-etc-service): Cater for missing nsswitch
and missing sudoers-file.  For the Hurd, add "login" and "motd".
(hurd-default-essential-services): Add operating-system-etc-service.
---
 gnu/system.scm | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index ac64dfcff6..0df642679d 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -611,6 +611,7 @@ bookkeeping."
   (list (service system-service-type '())
         %boot-service
         %activation-service
+        (operating-system-etc-service os)
         (service profile-service-type '())))
 
 (define* (operating-system-services os)
@@ -716,7 +717,7 @@ This is the GNU system.  Welcome.\n")
 (define* (operating-system-etc-service os)
   "Return a <service> that builds containing the static part of the /etc
 directory."
-  (let ((login.defs
+  (let* ((login.defs
           (plain-file "login.defs"
                       (string-append
                         "# Default paths for non-login shells started by su(1).\n"
@@ -727,10 +728,13 @@ directory."
                         "/run/current-system/profile/bin:"
                         "/run/current-system/profile/sbin\n")))
 
-        (issue      (plain-file "issue" (operating-system-issue os)))
-        (nsswitch   (plain-file "nsswitch.conf"
-                                (name-service-switch->string
-                                 (operating-system-name-service-switch os))))
+         (hurd       (operating-system-hurd os))
+         (issue      (plain-file "issue" (operating-system-issue os)))
+         (nsswitch   (operating-system-name-service-switch os))
+         (nsswitch   (and nsswitch
+                          (plain-file "nsswitch.conf"
+                                      (name-service-switch->string nsswitch))))
+         (sudoers    (operating-system-sudoers-file os))
 
         ;; Startup file for POSIX-compliant login shells, which set system-wide
         ;; environment variables.
@@ -820,7 +824,7 @@ fi\n")))
        ("rpc" ,(file-append net-base "/etc/rpc"))
        ("login.defs" ,#~#$login.defs)
        ("issue" ,#~#$issue)
-       ("nsswitch.conf" ,#~#$nsswitch)
+       ,@(if nsswitch `(("nsswitch.conf" ,#~#$nsswitch)) '())
        ("profile" ,#~#$profile)
        ("bashrc" ,#~#$bashrc)
        ("hosts" ,#~#$(or (operating-system-hosts-file os)
@@ -836,7 +840,9 @@ fi\n")))
        ("timezone" ,(plain-file "timezone" (operating-system-timezone os)))
        ("localtime" ,(file-append tzdata "/share/zoneinfo/"
                                   (operating-system-timezone os)))
-       ("sudoers" ,(operating-system-sudoers-file os))))))
+       ,@(if sudoers `(("sudoers" ,sudoers)) '())
+       ,@(if hurd `(("login" ,(file-append hurd "/etc/login"))
+                    ("motd"  ,(file-append hurd "/etc/motd"))))))))
 
 (define %root-account
   ;; Default root account.
-- 
2.26.2


[-- Attachment #3: Type: text/plain, Size: 152 bytes --]


-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [bug#41541] [PATCH 6/8] system: examples: Add bare-hurd.tmpl.
  2020-06-06 10:58     ` [bug#41541] [PATCH 6/8] system: examples: Add bare-hurd.tmpl Jan Nieuwenhuizen
@ 2020-06-06 16:49       ` Mathieu Othacehe
  2020-06-06 22:44         ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 20+ messages in thread
From: Mathieu Othacehe @ 2020-06-06 16:49 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: 41541, Ludovic Courtès


Hey,

>
> Yes, I agree.  Do you propose to hold back merging wip-hurd-vm until
> after merging the "image" catalog feature and then rewrite this message?

No, I have no clear objective for the catalog in mind, and as your serie
is almost ready, let's merge it first!

>  # Verify that the examples can be built.
>  for example in gnu/system/examples/*.tmpl; do
> -    guix system -n disk-image "$example"
> +    if echo "$example" | grep hurd; then
> +        target="--target=i586-pc-gnu"
> +    else
> +        target=
> +    fi
> +    guix system -n disk-image $target "$example"
>  done
>  
>  # Verify that the disk image types can be built.
>
> to "fix" that.  It feals a bit heavy, ugly and specific.  Ideas?

It's somehow linked to the catalog subject. I think we should get rid of
this "examples" folder and provide something encapsulating the
system/target, the image and the operating-system, but I'm not sure how.

For now, I don't think that there's much better that the hack you're
proposing.

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 20+ messages in thread

* [bug#41541] [PATCH 6/8] system: examples: Add bare-hurd.tmpl.
  2020-06-06 16:49       ` Mathieu Othacehe
@ 2020-06-06 22:44         ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 20+ messages in thread
From: Jan Nieuwenhuizen @ 2020-06-06 22:44 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 41541, Ludovic Courtès

Mathieu Othacehe writes:

Hello Mathieu,

>> Yes, I agree.  Do you propose to hold back merging wip-hurd-vm until
>> after merging the "image" catalog feature and then rewrite this message?
>
> No, I have no clear objective for the catalog in mind, and as your serie
> is almost ready, let's merge it first!

Good; let's look at the last bits tomorrow.  I think wip-hurd-vm should
be ready to merge (except of course the top "DRAFT" commit).

>>  # Verify that the examples can be built.
>>  for example in gnu/system/examples/*.tmpl; do
>> -    guix system -n disk-image "$example"
>> +    if echo "$example" | grep hurd; then
>> +        target="--target=i586-pc-gnu"
>> +    else
>> +        target=
>> +    fi
>> +    guix system -n disk-image $target "$example"
>>  done
>>  
>>  # Verify that the disk image types can be built.
>>
>> to "fix" that.  It feals a bit heavy, ugly and specific.  Ideas?
>
> It's somehow linked to the catalog subject. I think we should get rid of
> this "examples" folder and provide something encapsulating the
> system/target, the image and the operating-system, but I'm not sure how.
>
> For now, I don't think that there's much better that the hack you're
> proposing.

Ok, all great then for now.  Thank, Janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




^ permalink raw reply	[flat|nested] 20+ messages in thread

* [bug#41541] [PATCH 3/8] system: Add 'multiboot-modules' field to <boot-parameters>.
  2020-06-06 10:55     ` [bug#41541] [PATCH 3/8] system: Add 'multiboot-modules' field to <boot-parameters> Ludovic Courtès
@ 2020-06-07  7:39       ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 20+ messages in thread
From: Jan Nieuwenhuizen @ 2020-06-07  7:39 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41541, Mathieu Othacehe

Ludovic Courtès writes:

Hi,

> Mathieu Othacehe <othacehe@gnu.org> skribis:
>
>>> +             (mach (if (%current-target-system)
>>> +                       ;; A cross-built GNUmach does not work
>>> +                       (with-parameters ((%current-system "i686-linux")
>>> +                                         (%current-target-system #f))
>>> +                         mach)
>>
>> Maybe it would make more sense to check if we are on a Hurd system,
>> rather than just checking for %current-target-system to be set, don't
>> know.
>
> If this hack is still needed, can we move it away to hurd-os.tmpl, or to
> the ‘gnumach’ package itself or something?

Yes, it's needed; GNUmach does not work when cross-built.

> I think it’s best to keep (gnu system) free of any such assumptions.

Ok.

Changed this to

--8<---------------cut here---------------start------------->8---
(define (operating-system-kernel-file os)
  "Return an object representing the absolute file name of the kernel image of
OS."
  (if (operating-system-hurd os)
      (file-append (operating-system-kernel os) "/boot/gnumach")
      (file-append (operating-system-kernel os)
                      "/" (system-linux-image-file-name))))
--8<---------------cut here---------------end--------------->8---

and compensated for MACH (folded in a later patch) in
gnu/system/hurd.scm, like

--8<---------------cut here---------------start------------->8---
(define %hurd-default-operating-system-kernel
  (if (hurd-system?)
      gnumach
      ;; A cross-built GNUmach does not work
      (with-parameters ((%current-system "i686-linux")
                        (%current-target-system #f))
        gnumach)))
[...]
(define %hurd-default-operating-system
  (operating-system
    (kernel %hurd-default-operating-system-kernel)
[...]
--8<---------------cut here---------------end--------------->8---

>>> +         (libc (if target
>>> +                   (with-parameters ((%current-target-system #f))
>>> +                     (cross-libc target))
>>> +                   glibc))
>>
>> In the future, it would be nice to make this think transparent. Anyway,
>> for now this is the best we can do I think.
>
> Yeah, perhaps add a FIXME.

Yes, did that!

>>> "--x-xattr-translator-records"
>
> Do we need this yet?  If it can wait for later, that’s even nicer IMO as
> it would allow us to separate concerns.

Not "just" yet, it's used after the introduction of hurd-boot.scm, where
I use setxattr instead of MAKEDEV.  Moved it up the stack, to

    8dff3d0382 hurd-boot: Use setxattr instead of MAKEDEV.

Phew.  I think that was it for this round.  I've reset wip-hurd-vm so
that we can have another good look tomorrow.

Thanks a lot!
Janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




^ permalink raw reply	[flat|nested] 20+ messages in thread

* [bug#41541] [PATCH 7/8] services: hurd: Add `hurd-etc-service'.
  2020-06-06 14:31     ` Jan Nieuwenhuizen
@ 2020-06-07 20:02       ` Ludovic Courtès
  2020-06-07 20:31         ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 20+ messages in thread
From: Ludovic Courtès @ 2020-06-07 20:02 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: 41541

Hi,

Jan Nieuwenhuizen <janneke@gnu.org> skribis:

> From 4cef6e73ce9fd137640c1c00f98958cdc41dda90 Mon Sep 17 00:00:00 2001
> From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
> Date: Sat, 25 Apr 2020 11:55:56 +0200
> Subject: [PATCH] services: Support etc-service for the Hurd.
>
> * gnu/system.scm (operating-system-etc-service): Cater for missing nsswitch
> and missing sudoers-file.  For the Hurd, add "login" and "motd".
> (hurd-default-essential-services): Add operating-system-etc-service.

Perfect!
  
[...]

> +       ,@(if sudoers `(("sudoers" ,sudoers)) '())
> +       ,@(if hurd `(("login" ,(file-append hurd "/etc/login"))
> +                    ("motd"  ,(file-append hurd "/etc/motd"))))))))

We’re missing the ‘else’ branch  here.

Apart from that, LGTM!

Thank you,
Ludo’.




^ permalink raw reply	[flat|nested] 20+ messages in thread

* [bug#41541] [PATCH 7/8] services: hurd: Add `hurd-etc-service'.
  2020-06-07 20:02       ` Ludovic Courtès
@ 2020-06-07 20:31         ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 20+ messages in thread
From: Jan Nieuwenhuizen @ 2020-06-07 20:31 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41541

Ludovic Courtès writes:

Hi,

> Jan Nieuwenhuizen <janneke@gnu.org> skribis:
>
>> From 4cef6e73ce9fd137640c1c00f98958cdc41dda90 Mon Sep 17 00:00:00 2001
>> From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
>> Date: Sat, 25 Apr 2020 11:55:56 +0200
>> Subject: [PATCH] services: Support etc-service for the Hurd.
>>
>> * gnu/system.scm (operating-system-etc-service): Cater for missing nsswitch
>> and missing sudoers-file.  For the Hurd, add "login" and "motd".
>> (hurd-default-essential-services): Add operating-system-etc-service.
>
> Perfect!
>   
> [...]
>
>> +       ,@(if sudoers `(("sudoers" ,sudoers)) '())
>> +       ,@(if hurd `(("login" ,(file-append hurd "/etc/login"))
>> +                    ("motd"  ,(file-append hurd "/etc/motd"))))))))
>
> We’re missing the ‘else’ branch  here.

Ah yes -- make check found that for me...

    http://git.savannah.gnu.org/cgit/guix.git/commit/?h=wip-hurd-vm&id=c7012882da88760fdc7ae5413dc80bd768469341

; already fixed :-)

> Apart from that, LGTM!

Great...getting there!
Janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2020-06-07 20:32 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200604135914.4499-1-janneke@gnu.org>
     [not found] ` <20200604135914.4499-2-janneke@gnu.org>
2020-06-06 10:45   ` [bug#41541] [PATCH 1/8] system: Add 'hurd' field to <operating-system> Ludovic Courtès
2020-06-06 11:14     ` Jan Nieuwenhuizen
     [not found] ` <20200604135914.4499-3-janneke@gnu.org>
2020-06-06 10:48   ` [bug#41541] [PATCH 2/8] bootloader: Extend `<menu-entry>' for multiboot Ludovic Courtès
2020-06-06 12:00     ` Jan Nieuwenhuizen
     [not found] ` <20200604135914.4499-4-janneke@gnu.org>
     [not found]   ` <87eeqsmyxy.fsf@gnu.org>
2020-06-06 10:55     ` [bug#41541] [PATCH 3/8] system: Add 'multiboot-modules' field to <boot-parameters> Ludovic Courtès
2020-06-07  7:39       ` Jan Nieuwenhuizen
     [not found] ` <20200604135914.4499-5-janneke@gnu.org>
2020-06-06 10:57   ` [bug#41541] [PATCH 4/8] bootloader: grub: Add support for multiboot Ludovic Courtès
2020-06-06 12:08     ` Jan Nieuwenhuizen
     [not found] ` <20200604135914.4499-6-janneke@gnu.org>
2020-06-06 10:57   ` [bug#41541] [PATCH 5/8] system: Use 'hurd' package in label Ludovic Courtès
     [not found] ` <20200604135914.4499-7-janneke@gnu.org>
     [not found]   ` <875zc4mxtu.fsf@gnu.org>
2020-06-06 10:58     ` [bug#41541] [PATCH 6/8] system: examples: Add bare-hurd.tmpl Jan Nieuwenhuizen
2020-06-06 16:49       ` Mathieu Othacehe
2020-06-06 22:44         ` Jan Nieuwenhuizen
2020-06-06 10:59   ` Ludovic Courtès
2020-06-06 12:34     ` Jan Nieuwenhuizen
     [not found] ` <20200604135914.4499-9-janneke@gnu.org>
2020-06-06 11:05   ` [bug#41541] [PATCH 8/8] system: Add `hurd-activation' Ludovic Courtès
2020-06-06 14:21     ` Jan Nieuwenhuizen
     [not found] ` <20200604135914.4499-8-janneke@gnu.org>
2020-06-06 11:08   ` [bug#41541] [PATCH 7/8] services: hurd: Add `hurd-etc-service' Ludovic Courtès
2020-06-06 14:31     ` Jan Nieuwenhuizen
2020-06-07 20:02       ` Ludovic Courtès
2020-06-07 20:31         ` Jan Nieuwenhuizen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).