all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: guix-devel@gnu.org
Subject: QEMU image boots into dmd
Date: Sat, 21 Sep 2013 01:09:43 +0200	[thread overview]
Message-ID: <87vc1vay4o.fsf@gnu.org> (raw)

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

             reply	other threads:[~2013-09-20 23:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-20 23:09 Ludovic Courtès [this message]
2013-09-21 16:02 ` QEMU image boots into dmd 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vc1vay4o.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.