unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* boot guixsd
@ 2018-03-03  4:41 Rene
  2018-03-03  9:31 ` Ricardo Wurmus
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rene @ 2018-03-03  4:41 UTC (permalink / raw)
  To: guix-devel@gnu.org; +Cc: bug-hurd@gnu.org

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

Hello,
I'm reviewing how GNU GuixSD/Linux boot,

$ cat /proc/cmdline
BOOT_IMAGE=/gnu/store/jnww66749r8ck6l2rwgvpzzbnazs0392-linux-libre-4.15.5/bzImage --root=root --system=/gnu/store/qcia33hqzi6md3q18frs16piis6xxy9i-system --load=/gnu/store/qcia33hqzi6md3q18frs16piis6xxy9i-system/boot

To perform the activation is done as a parameter through the scheme file '/var/guix/profiles/system/boot'.

In GNU Hurd as a workaround I add the lines to the '/libexec/rc' file:
--
echo running GuixSD boot ..
guile -s /var/guix/profiles/system/boot
--

After loading GNU Mach and GNU Hurd it shows:
--
In unknown file:
             ?: 9 [apply-smob/1 #<catch-closure 1a3920>]
          In ice-9/boot-9.scm:
            66: 8 [call-with-prompt prompt0 ...]
          In ice-9/eval.scm:
           432: 7 [eval # #]
          In ice-9/boot-9.scm:
          2412: 6 [save-module-excursion #<procedure 1b4ce0 at ice-9/boot-9.scm:4084:3 ()>
          ]
          4089: 5 [#<procedure 1b4ce0 at ice-9/boot-9.scm:4084:3 ()>]
          In /var/guix/profiles/system/boot:
             1: 4 [#<procedure 223900 ()>]
          In unknown file:
             ?: 3 [primitive-load "/gnu/store/rjp22rca3gv8lrrbb9j4sry9i3n1bvlp-activate"]
          In ice-9/eval.scm:
           432: 2 [eval # ()]
          In /gnu/store/6dvydkcda77dxkpbn5jsj4vsmr19gb7v-module-import/gnu/build/activatio
          n.scm:
           449: 1 [activate-current-system #f]
          In unknown file:
             ?: 0 [symlink #f "/run/current-system.new"]

          ERROR: In procedure symlink:
          ERROR: Wrong type (expecting string): #f
--

I have the following questions:

a) In GNU Hurd, how should activation be done?
b) Regarding the error assuming that I start reading from the bottom up 'ERROR: In procedure symlink',
    in GNU Hurd I guess I should try 'symlink' through guile to see if the procedure exists.

Some thoughts?

Thank you
Rene

[-- Attachment #2: Type: text/html, Size: 4000 bytes --]

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

* Re: boot guixsd
  2018-03-03  4:41 boot guixsd Rene
@ 2018-03-03  9:31 ` Ricardo Wurmus
  2018-03-03 11:42 ` Danny Milosavljevic
  2018-03-03 11:50 ` Danny Milosavljevic
  2 siblings, 0 replies; 4+ messages in thread
From: Ricardo Wurmus @ 2018-03-03  9:31 UTC (permalink / raw)
  To: Rene; +Cc: guix-devel@gnu.org, bug-hurd@gnu.org


Hi Rene,

> I'm reviewing how GNU GuixSD/Linux boot,
>
> $ cat /proc/cmdline
> BOOT_IMAGE=/gnu/store/jnww66749r8ck6l2rwgvpzzbnazs0392-linux-libre-4.15.5/bzImage --root=root --system=/gnu/store/qcia33hqzi6md3q18frs16piis6xxy9i-system --load=/gnu/store/qcia33hqzi6md3q18frs16piis6xxy9i-system/boot
>
> To perform the activation is done as a parameter through the scheme file '/var/guix/profiles/system/boot'.
>
> In GNU Hurd as a workaround I add the lines to the '/libexec/rc' file:
> --
> echo running GuixSD boot ..
> guile -s /var/guix/profiles/system/boot
> --
>
> After loading GNU Mach and GNU Hurd it shows:
> --
> In unknown file:
>              ?: 9 [apply-smob/1 #<catch-closure 1a3920>]
>           In ice-9/boot-9.scm:
>             66: 8 [call-with-prompt prompt0 ...]
>           In ice-9/eval.scm:
>            432: 7 [eval # #]
>           In ice-9/boot-9.scm:
>           2412: 6 [save-module-excursion #<procedure 1b4ce0 at ice-9/boot-9.scm:4084:3 ()>
>           ]
>           4089: 5 [#<procedure 1b4ce0 at ice-9/boot-9.scm:4084:3 ()>]
>           In /var/guix/profiles/system/boot:
>              1: 4 [#<procedure 223900 ()>]
>           In unknown file:
>              ?: 3 [primitive-load "/gnu/store/rjp22rca3gv8lrrbb9j4sry9i3n1bvlp-activate"]
>           In ice-9/eval.scm:
>            432: 2 [eval # ()]
>           In /gnu/store/6dvydkcda77dxkpbn5jsj4vsmr19gb7v-module-import/gnu/build/activatio
>           n.scm:
>            449: 1 [activate-current-system #f]
>           In unknown file:
>              ?: 0 [symlink #f "/run/current-system.new"]
>
>           ERROR: In procedure symlink:
>           ERROR: Wrong type (expecting string): #f

This shows that “activate-current-system” from the (gnu build
activation) module is given #f, when actually it should be given a
string containing the location of the system in the store.

For reconfiguration the new system can be specified with the
GUIX_NEW_SYSTEM environment variable.  You may need to set this
environment variable before booting.

The problem here is that the default system is either whatever
GUIX_NEW_SYSTEM holds or the result of evaluating “(boot-time-system)”,
which is Linux-specific:

--8<---------------cut here---------------start------------->8---
(define (boot-time-system)
  "Return the '--system' argument passed on the kernel command line."
  (find-long-option "--system" (linux-command-line)))
--8<---------------cut here---------------end--------------->8---

We should adjust this procedure to do the right thing when we didn’t
boot Linux.

Hope this helps!

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

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

* Re: boot guixsd
  2018-03-03  4:41 boot guixsd Rene
  2018-03-03  9:31 ` Ricardo Wurmus
@ 2018-03-03 11:42 ` Danny Milosavljevic
  2018-03-03 11:50 ` Danny Milosavljevic
  2 siblings, 0 replies; 4+ messages in thread
From: Danny Milosavljevic @ 2018-03-03 11:42 UTC (permalink / raw)
  To: Rene; +Cc: guix-devel@gnu.org

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

Hi Rene,

On Fri, 02 Mar 2018 23:41:48 -0500
Rene <pacoon@protonmail.com> wrote:

>              ?: 3 [primitive-load "/gnu/store/rjp22rca3gv8lrrbb9j4sry9i3n1bvlp-activate"]
>           In ice-9/eval.scm:
>            432: 2 [eval # ()]
>           In /gnu/store/6dvydkcda77dxkpbn5jsj4vsmr19gb7v-module-import/gnu/build/activatio
>           n.scm:
>            449: 1 [activate-current-system #f]
>           In unknown file:
>              ?: 0 [symlink #f "/run/current-system.new"]
> 
>           ERROR: In procedure symlink:
>           ERROR: Wrong type (expecting string): #f
> 
> a) In GNU Hurd, how should activation be done?
> b) Regarding the error assuming that I start reading from the bottom up 'ERROR: In procedure symlink',
>     in GNU Hurd I guess I should try 'symlink' through guile to see if the procedure exists.

I think the procedure was found alright, but the first argument is #f:

>              ?: 0 [symlink #f "/run/current-system.new"]

Checking gnu/build/activation.scm, there is this:

(define* (activate-current-system
          #:optional (system (or (getenv "GUIX_NEW_SYSTEM")
                                 (boot-time-system))))
  "Atomically make SYSTEM the current system."
  ;; The 'GUIX_NEW_SYSTEM' environment variable is used as a way for 'guix
  ;; system reconfigure' to pass the file name of the new system.

  (format #t "making '~a' the current system...~%" system)

  ;; Atomically make SYSTEM current.
  (let ((new (string-append %current-system ".new")))
    (symlink system new)
    (rename-file new %current-system)))

(define (boot-time-system)
  "Return the '--system' argument passed on the kernel command line."
  (find-long-option "--system" (linux-command-line)))

So it's trying to find the system via an environment variable or via
the "--system" option of the Linux kernel command line.

As a quick check, try setting GUIX_NEW_SYSTEM before you run guile:

(setenv "GUIX_NEW_SYSTEM" "/var/guix/profiles/system-1-link")

In the long run it would be nice to have the system reference stored in
the Hurd (or GNU Mach) command line.  I wonder whether there are any
downsides to just using a new regular file, maybe even /proc/cmdline
without /proc being special.

On the other hand, having the environment variable is fine I guess.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: boot guixsd
  2018-03-03  4:41 boot guixsd Rene
  2018-03-03  9:31 ` Ricardo Wurmus
  2018-03-03 11:42 ` Danny Milosavljevic
@ 2018-03-03 11:50 ` Danny Milosavljevic
  2 siblings, 0 replies; 4+ messages in thread
From: Danny Milosavljevic @ 2018-03-03 11:50 UTC (permalink / raw)
  To: Rene; +Cc: guix-devel@gnu.org

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

On Fri, 02 Mar 2018 23:41:48 -0500
Rene <pacoon@protonmail.com> wrote:

> a) In GNU Hurd, how should activation be done?

After examining our GuixSD/Debian hybrid Hurd image, there's at least argument
parsing of kernel arguments inside /libexec/runsystem.hurd (the regular shell
arguments there).

So a dirty workaround would be to add to /libexec/runsystem.hurd :

mkdir /proc
echo "$@" > /proc/cmdline

The advantage would be that nothing else would need to be changed and it would
be automatically prepared to run guixsd on boot.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2018-03-03 11:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-03  4:41 boot guixsd Rene
2018-03-03  9:31 ` Ricardo Wurmus
2018-03-03 11:42 ` Danny Milosavljevic
2018-03-03 11:50 ` Danny Milosavljevic

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).