all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* QEMU image boots into dmd
@ 2013-09-20 23:09 Ludovic Courtès
  2013-09-21 16:02 ` Andreas Enge
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ludovic Courtès @ 2013-09-20 23:09 UTC (permalink / raw)
  To: guix-devel

So (gnu system vm) and its friends are now able to build a bootable QEMU
image.  That’s still *very* rough on the edges, but it boots into dmd
(version -0.4 is out BTW, 10 years later ;-)).

To build it, do something like:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guile
GNU Guile 2.0.9
Copyright (C) 1995-2013 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> ,m (gnu system vm)
scheme@(gnu system vm)> (define s (open-connection ))
scheme@(gnu system vm)> (system-qemu-image s)
$1 = #<derivation /nix/store/yijxfnrwy3c5rv9zc9q474rv4fj91l9f-qemu-image.drv => /nix/store/s9fagmjmqcm14xzzb0j6aviw7nb1j12m-qemu-image 21143c0>
scheme@(gnu system vm)> (build-derivations s (list $1))
$2 = #t
scheme@(gnu system vm)> (derivation->output-path $1)
$3 = "/nix/store/s9fagmjmqcm14xzzb0j6aviw7nb1j12m-qemu-image"
^D

$ cp "/nix/store/s9fagmjmqcm14xzzb0j6aviw7nb1j12m-qemu-image" t.img
$ qemu-system-x86_64 -serial stdio -net nic,model=e1000 -net user,smb=$PWD -hda t.img
--8<---------------cut here---------------end--------------->8---

There are several services that dmd starts [0]: mingetty on tty1-3, and
syslogd.  mingetty runs ‘login’, which uses PAM for authentication [1]
It allows you to log in as ‘root’ with no password.  On tty12 is some
output from syslogd.  Once logged in you can run incredible things such
as ‘/nix/store/*dmd*/bin/deco detailed-status dmd’.

And that’s it!  :-)

We need to at least make a proper profile, put it in $PATH via
/etc/bashrc; we need to have Guix installed in the image, and the
packages already there recognized.  There are many details to fix
(setting a host name, etc.)

Ideally Xorg + slim would be great, not sure how much effort that would
take.

In short, if you feel like helping out, you’re more than welcome!

Thanks,
Ludo’.

PS: The good news is that 90% of this work is directly reusable for a
    “real” system, and not specific to virtual images.

[0] http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/system/vm.scm#n355
[1] http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/system/linux.scm#n42

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

* Re: QEMU image boots into dmd
  2013-09-20 23:09 QEMU image boots into dmd Ludovic Courtès
@ 2013-09-21 16:02 ` Andreas Enge
  2013-09-21 20:10   ` Ludovic Courtès
  2013-09-21 17:59 ` Mark H Weaver
  2013-09-24 21:48 ` Ludovic Courtès
  2 siblings, 1 reply; 6+ messages in thread
From: Andreas Enge @ 2013-09-21 16:02 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

On Sat, Sep 21, 2013 at 01:09:43AM +0200, Ludovic Courtès wrote:
> (version -0.4 is out BTW, 10 years later ;-)).

The - is not a typo? It looks very weird.

Andreas

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

* Re: QEMU image boots into dmd
  2013-09-20 23:09 QEMU image boots into dmd Ludovic Courtès
  2013-09-21 16:02 ` Andreas Enge
@ 2013-09-21 17:59 ` Mark H Weaver
  2013-09-21 19:34   ` Ludovic Courtès
  2013-09-24 21:48 ` Ludovic Courtès
  2 siblings, 1 reply; 6+ messages in thread
From: Mark H Weaver @ 2013-09-21 17:59 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

ludo@gnu.org (Ludovic Courtès) writes:
> So (gnu system vm) and its friends are now able to build a bootable QEMU
> image.  That’s still *very* rough on the edges, but it boots into dmd
> (version -0.4 is out BTW, 10 years later ;-)).

That's great news!  :)  (:  :)

> Once logged in you can run incredible things such
> as ‘/nix/store/*dmd*/bin/deco detailed-status dmd’.

I ran this command, and a strange thing happened: every character in the
output was written twice, mostly (but not entirely) interleaved, as if
two processes were writing the same output at the same time.

> PS: The good news is that 90% of this work is directly reusable for a
>     “real” system, and not specific to virtual images.

Indeed; these are exciting times for Guix!

   Many thanks,
      Mark

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

* Re: QEMU image boots into dmd
  2013-09-21 17:59 ` Mark H Weaver
@ 2013-09-21 19:34   ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2013-09-21 19:34 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel

Mark H Weaver <mhw@netris.org> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:

[...]

>> Once logged in you can run incredible things such
>> as ‘/nix/store/*dmd*/bin/deco detailed-status dmd’.
>
> I ran this command, and a strange thing happened: every character in the
> output was written twice, mostly (but not entirely) interleaved, as if
> two processes were writing the same output at the same time.

Yes, that happens on tty1 but not elsewhere, apparently because dmd
itself writes it on stdout (arguably a bug), and deco prints it too.

Ludo’.

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

* Re: QEMU image boots into dmd
  2013-09-21 16:02 ` Andreas Enge
@ 2013-09-21 20:10   ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2013-09-21 20:10 UTC (permalink / raw)
  To: Andreas Enge; +Cc: guix-devel

Andreas Enge <andreas@enge.fr> skribis:

> On Sat, Sep 21, 2013 at 01:09:43AM +0200, Ludovic Courtès wrote:
>> (version -0.4 is out BTW, 10 years later ;-)).
>
> The - is not a typo? It looks very weird.

Not even a typo!

  http://lists.gnu.org/archive/html/guile-user/2003-06/msg00019.html

I think we should switch to positive numbers real soon though.  :-)

Ludo’.

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

* Re: QEMU image boots into dmd
  2013-09-20 23:09 QEMU image boots into dmd Ludovic Courtès
  2013-09-21 16:02 ` Andreas Enge
  2013-09-21 17:59 ` Mark H Weaver
@ 2013-09-24 21:48 ` Ludovic Courtès
  2 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2013-09-24 21:48 UTC (permalink / raw)
  To: guix-devel

ludo@gnu.org (Ludovic Courtès) skribis:

> We need to at least make a proper profile, put it in $PATH via
> /etc/bashrc; we need to have Guix installed in the image, and the
> packages already there recognized.  There are many details to fix
> (setting a host name, etc.)

With commit 30f25b0, the image’s store is suitably initialized, meaning
that Guix can be used inside the image.

Remember that the store is made of /nix/store plus an SQLite database
that stores references/referrers and additional meta-data.  Thus,
copying /nix/store/foobar to /the-image/nix/store is not enough to
initialize the store.

The new ‘guix-register’ program is here to do that: you run
‘guix-register --prefix /the-image guile.closure’, where ‘guile.closure’
contains meta-data about (say) /nix/store/…-guile-2.0.9, and that
populates /the-image/var/nix/db with meta-data about that directory.
(This is known as ‘nix-store --register-validity’ in Nix.)

Thanks,
Ludo’.

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

end of thread, other threads:[~2013-09-24 21:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-20 23:09 QEMU image boots into dmd Ludovic Courtès
2013-09-21 16:02 ` Andreas Enge
2013-09-21 20:10   ` Ludovic Courtès
2013-09-21 17:59 ` Mark H Weaver
2013-09-21 19:34   ` Ludovic Courtès
2013-09-24 21:48 ` Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.