;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu build vm) #:use-module (guix build utils) #:use-module (guix build store-copy) #:use-module (gnu build linux-boot) #:use-module (gnu build install) #:use-module (ice-9 match) #:use-module (ice-9 regex) #:use-module (srfi srfi-26) #:export (qemu-command load-in-linux-vm format-partition initialize-root-partition initialize-partition-table initialize-hard-disk)) ;;; Commentary: ;;; ;;; This module provides supporting code to run virtual machines and build ;;; virtual machine images using QEMU. ;;; ;;; Code: (define* (qemu-command #:optional (system %host-type)) "Return the default name of the QEMU command for SYSTEM." (let ((cpu (substring %host-type 0 (string-index %host-type #\-)))) (string-append "qemu-system-" (if (string-match "^i[3456]86$" cpu) "i386" cpu)))) (define* (load-in-linux-vm builder #:key output (qemu (qemu-command)) (memory-size 512) linux init;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013 John Darrington <jmd@gnu.org> ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org> ;;; Copyright © 2014, 2015 David Thompson <dthompson2@worcester.edu> ;;; Copyright © 2014-2023 Eric Bavier <bavier@posteo.net> ;;; Copyright © 2014 Cyrill Schenkel <cyrill.schenkel@gmail.com> ;;; Copyright © 2014 Sylvain Beucler <beuc@beuc.net> ;;; Copyright © 2014, 2015, 2018, 2019, 2021 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2014, 2015, 2016, 2024 宋文武 <iyzsong@envs.net> ;;; Copyright © 2014, 2015, 2019 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2015, 2016 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2015 David Hashe <david.hashe@dhashe.com> ;;; Copyright © 2015, 2017, 2018, 2021 Christine Lemmer-Webber <cwebber@dustycloud.org> ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2021 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2015, 2016, 2017 Alex Kost <alezost@gmail.com> ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org> ;;; Copyright © 2016, 2017 Rodger Fox <thylakoid@openmailbox.org> ;;; Copyright © 2016, 2017, 2018 Nikita <nikita@n0.is> ;;; Copyright © 2016 Albin Söderqvist <albin@fripost.org> ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Kei Kebreau <kkebreau@posteo.net> ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com> ;;; Copyright © 2016-2021, 2023, 2024 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org> ;;; Copyright © 2016 Steve Webber <webber.sl@gmail.com> ;;; Copyright © 2017 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@hyperbola.info> ;;; Copyright © 2017, 2018, 2020 Arun Isaac <arunisaac@systemreboot.net> ;;; Copyright © 2017–2023 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2017, 2019 nee <nee-git@hidamari.blue> ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org> ;;; Copyright © 2017, 2019, 2020 Marius Bakke <mbakke@fastmail.com> ;;; Copyright © 2017, 2018 Rutger Helling <rhelling@mykolab.com> ;;; Copyright © 2017 Roel Janssen <roel@gnu.org> ;;; Copyright © 2017-2024 Nicolas Goaziou <mail@nicolasgoaziou.fr> ;;; Copyright © 2018 okapi <okapi@firemail.cc> ;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de> ;;; Copyright © 2018 Madalin Ionel-Patrascu <madalinionel.patrascu@mdc-berlin.de> ;;; Copyright © 2018 Benjamin Slade <slade@jnanam.net> ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com> ;;; Copyright © 2019, 2020 Pierre Neidhardt <mail@ambrevar.xyz> ;;; Copyright © 2019, 2020, 2024 Oleg Pykhalov <go.wigust@gmail.com> ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com> ;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu> ;;; Copyright © 2019, 2020 Jesse Gibbons <jgibbons2357+guix@gmail.com> ;;; Copyright © 2019 Dan Frumin <dfrumin@cs.ru.nl> ;;; Copyright © 2019-2023 Guillaume Le Vaillant <glv@posteo.net> ;;; Copyright © 2019, 2020 Timotej Lazar <timotej.lazar@araneo.si> ;;; Copyright © 2019 Josh Holland <josh@inv.alid.pw> ;;; Copyright © 2019 Pkill -9 <pkill9@runbox.com> ;;; Copyright © 2017, 2019 Hartmut Goebel <h.goebel@crazy-compilers.com> ;;; Copyright © 2020 Alberto Eleuterio Flores Guerrero <barbanegra+guix@posteo.mx> ;;; Copyright © 2020 Naga Malleswari <nagamalli@riseup.net> ;;; Copyright © 2020 Vitaliy Shatrov <D0dyBo0D0dyBo0@protonmail.com> ;;; Copyright © 2020 Jack Hill <jackhill@jackhill.us> ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com> ;;; Copyright © 2020, 2021, 2022 Michael Rohleder <mike@rohleder.de> ;;; Copyright © 2020 Trevor Hass <thass@okstate.edu> ;;; Copyright © 2020, 2021 Liliana Marie Prikler <liliana.prikler@gmail.com> ;;; Copyright © 2020 Lu hux <luhux@outlook.com> ;;; Copyright © 2020 Tomás Ortín Fernández <tomasortin@mailbox.org> ;;; Copyright © 2021 Olivier Rojon <o.rojon@posteo.net> ;;; Copyright © 2021 Stefan Reichör <stefan@xsteve.at> ;;; Copyright © 2021, 2022 Greg Hogan <code@greghogan.com> ;;; Copyright © 2021, 2024 David Pflug <david@pflug.io> ;;; Copyright © 2021, 2022 Felix Gruber <felgru@posteo.net> ;;; Copyright © 2021 Solene Rapenne <solene@perso.pw> ;;; Copyright © 2021, 2022 Noisytoot <ron@noisytoot.org> ;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com> ;;; Copyright © 2021, 2022 Brendan Tildesley <mail@brendan.scot> ;;; Copyright © 2021 Christopher Baines <mail@cbaines.net> ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com> ;;; Copyright © 2022, 2023 Yovan Naumovski <yovan@gorski.stream> ;;; Copyright © 2022 Roman Riabenko <roman@riabenko.com> ;;; Copyright © 2022, 2023 zamfofex <zamfofex@twdb.moe> ;;; Copyright © 2022 Gabriel Arazas <foo.dogsquared@gmail.com> ;;; Copyright © 2022-2024 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2022 Hendursaga <hendursaga@aol.com> ;;; Copyright © 2022 Parnikkapore <poomklao@yahoo.com> ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2023 Florian Pelz <pelzflorian@pelzflorian.de> ;;; Copyright © 2023 Ivana Drazovic <iv.dra@hotmail.com> ;;; Copyright © 2023, 2024 gemmaro <gemmaro.dev@gmail.com> ;;; Copyright © 2023 Wilko Meyer <w@wmeyer.eu> ;;; Copyright © 2024 Vagrant Cascadian <vagrant@debian.org> ;;; Copyright © 2024 Sébastien Lerique <sl@eauchat.org> ;;; Copyright © 2024 James Smith <jsubuntuxp@disroot.org> ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu packages games) #:use-module (ice-9 match) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix utils) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix svn-download) #:use-module (guix gexp) #:use-module (gnu packages) #:use-module (gnu packages adns) #:use-module (gnu packages algebra) #:use-module (gnu packages autotools) #:use-module (gnu packages backup) #:use-module (gnu packages base) #:use-module (gnu packages build-tools) #:use-module (gnu packages admin) #:use-module (gnu packages audio) #:use-module (gnu packages avahi) #:use-module (gnu packages assembly) #:use-module (gnu packages bash) #:use-module (gnu packages bison) #:use-module (gnu packages boost) #:use-module (gnu packages c) #:use-module (gnu packages