remove direct use of run-liminix-vm from tests and doc

This commit is contained in:
Daniel Barlow 2023-11-05 20:37:23 +00:00
parent c40eef25d6
commit c94d12934f
5 changed files with 12 additions and 18 deletions

View file

@ -27,19 +27,16 @@ To build it,
nix-build -I liminix-config=path/to/your/configuration.nix --arg device "import ./devices/qemu" -A outputs.default nix-build -I liminix-config=path/to/your/configuration.nix --arg device "import ./devices/qemu" -A outputs.default
In a ``buildEnv`` nix-shell, you can use the :command:`run-liminix-vm` command This creates a :file:`result/` directory containing a :file:`vmlinux`
to run Qemu with appropriate options. It connects the Liminix and a :file:`rootfs`, and also a shell script :file:`run.sh` which
invokes QEMU to run that kernel with that filesystem. It connects the Liminix
serial console and the `QEMU monitor <https://www.qemu.org/docs/master/system/monitor.html>`_ to stdin/stdout. Use ^P (not ^A) to switch to the monitor. serial console and the `QEMU monitor <https://www.qemu.org/docs/master/system/monitor.html>`_ to stdin/stdout. Use ^P (not ^A) to switch to the monitor.
.. code-block:: console
nix-shell --run "run-liminix-vm result/vmlinux result/squashfs"
If you run with ``--background /path/to/some/directory`` as the first If you run with ``--background /path/to/some/directory`` as the first
parameter, it will fork into the background and open Unix sockets in parameter, it will fork into the background and open Unix sockets in
that directory for console and monitor. Use :command:`connect-vm` that directory for console and monitor. Use :command:`nix-shell --run
(also in the ``buildEnv`` environment) to connect to either of these connect-vm` to connect to either of these sockets, and ^O to
sockets, and ^O to disconnect. disconnect.
.. _qemu-networking: .. _qemu-networking:
@ -55,9 +52,9 @@ the right way:
* multicast 230.0.0.1:1235 : lan * multicast 230.0.0.1:1235 : lan
* multicast 230.0.0.1:1236 : world (the internet) * multicast 230.0.0.1:1236 : world (the internet)
A VM started with :command:`run-liminix-vm` is connected to "lan" and "access", and Any VM started by a :command:`run.sh` script is connected to "lan" and
the emulated border network gateway (see below) runs PPPoE and is "access", and the emulated border network gateway (see below) runs
connected to "access" and "world". PPPoE and is connected to "access" and "world".
Border Network Gateway Border Network Gateway
---------------------- ----------------------

View file

@ -36,7 +36,7 @@ in
type = types.package; type = types.package;
description = '' description = ''
Directory containing separate kernel and rootfs image for Directory containing separate kernel and rootfs image for
use with qemu (see run-liminix-vm) use with QEMU
''; '';
}; };
manifest = mkOption { manifest = mkOption {

View file

@ -9,11 +9,9 @@ let lmx = (import liminix {
rogue = lmx.pkgs.rogue; rogue = lmx.pkgs.rogue;
img = lmx.outputs.vmroot; img = lmx.outputs.vmroot;
pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; }; pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; };
inherit (pkgs.pkgsBuildBuild) run-liminix-vm;
in pkgs.runCommand "check" { in pkgs.runCommand "check" {
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
expect expect
run-liminix-vm
socat socat
min-copy-closure min-copy-closure
rogue rogue
@ -22,7 +20,7 @@ in pkgs.runCommand "check" {
. ${../test-helpers.sh} . ${../test-helpers.sh}
mkdir vm mkdir vm
LAN=user,hostfwd=tcp::2022-:22 run-liminix-vm --background ./vm ${img}/vmlinux ${img}/rootfs LAN=user,hostfwd=tcp::2022-:22 ${img}/run.sh --background ./vm
expect ${./wait-until-ready.expect} expect ${./wait-until-ready.expect}
export SSH_COMMAND="ssh -o StrictHostKeyChecking=no -p 2022 -i ${./id}" export SSH_COMMAND="ssh -o StrictHostKeyChecking=no -p 2022 -i ${./id}"
$SSH_COMMAND root@localhost echo ready $SSH_COMMAND root@localhost echo ready

View file

@ -7,7 +7,7 @@ let img = (import liminix {
liminix-config = ./configuration.nix; liminix-config = ./configuration.nix;
}).outputs.default; }).outputs.default;
pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; }; pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; };
inherit (pkgs.pkgsBuildBuild) routeros run-liminix-vm; inherit (pkgs.pkgsBuildBuild) routeros;
in pkgs.runCommand "check" { in pkgs.runCommand "check" {
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
python3Packages.scapy python3Packages.scapy

View file

@ -7,7 +7,6 @@ let img = (import liminix {
liminix-config = ./configuration.nix; liminix-config = ./configuration.nix;
}).outputs.default; }).outputs.default;
pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; }; pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; };
inherit (pkgs.pkgsBuildBuild) run-liminix-vm;
in pkgs.runCommand "check" { in pkgs.runCommand "check" {
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
expect socat expect socat