[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
QEMU image boots into dmd
From: |
Ludovic Courtès |
Subject: |
QEMU image boots into dmd |
Date: |
Sat, 21 Sep 2013 01:09:43 +0200 |
User-agent: |
Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux) |
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
- QEMU image boots into dmd,
Ludovic Courtès <=