forked from DGNum/liminix
remove direct use of run-liminix-vm from tests and doc
This commit is contained in:
parent
c40eef25d6
commit
c94d12934f
5 changed files with 12 additions and 18 deletions
|
@ -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
|
||||
|
||||
In a ``buildEnv`` nix-shell, you can use the :command:`run-liminix-vm` command
|
||||
to run Qemu with appropriate options. It connects the Liminix
|
||||
This creates a :file:`result/` directory containing a :file:`vmlinux`
|
||||
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.
|
||||
|
||||
.. 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
|
||||
parameter, it will fork into the background and open Unix sockets in
|
||||
that directory for console and monitor. Use :command:`connect-vm`
|
||||
(also in the ``buildEnv`` environment) to connect to either of these
|
||||
sockets, and ^O to disconnect.
|
||||
that directory for console and monitor. Use :command:`nix-shell --run
|
||||
connect-vm` to connect to either of these sockets, and ^O to
|
||||
disconnect.
|
||||
|
||||
.. _qemu-networking:
|
||||
|
||||
|
@ -55,9 +52,9 @@ the right way:
|
|||
* multicast 230.0.0.1:1235 : lan
|
||||
* multicast 230.0.0.1:1236 : world (the internet)
|
||||
|
||||
A VM started with :command:`run-liminix-vm` is connected to "lan" and "access", and
|
||||
the emulated border network gateway (see below) runs PPPoE and is
|
||||
connected to "access" and "world".
|
||||
Any VM started by a :command:`run.sh` script is connected to "lan" and
|
||||
"access", and the emulated border network gateway (see below) runs
|
||||
PPPoE and is connected to "access" and "world".
|
||||
|
||||
Border Network Gateway
|
||||
----------------------
|
||||
|
|
|
@ -36,7 +36,7 @@ in
|
|||
type = types.package;
|
||||
description = ''
|
||||
Directory containing separate kernel and rootfs image for
|
||||
use with qemu (see run-liminix-vm)
|
||||
use with QEMU
|
||||
'';
|
||||
};
|
||||
manifest = mkOption {
|
||||
|
|
|
@ -9,11 +9,9 @@ let lmx = (import liminix {
|
|||
rogue = lmx.pkgs.rogue;
|
||||
img = lmx.outputs.vmroot;
|
||||
pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; };
|
||||
inherit (pkgs.pkgsBuildBuild) run-liminix-vm;
|
||||
in pkgs.runCommand "check" {
|
||||
nativeBuildInputs = with pkgs; [
|
||||
expect
|
||||
run-liminix-vm
|
||||
socat
|
||||
min-copy-closure
|
||||
rogue
|
||||
|
@ -22,7 +20,7 @@ in pkgs.runCommand "check" {
|
|||
. ${../test-helpers.sh}
|
||||
|
||||
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}
|
||||
export SSH_COMMAND="ssh -o StrictHostKeyChecking=no -p 2022 -i ${./id}"
|
||||
$SSH_COMMAND root@localhost echo ready
|
||||
|
|
|
@ -7,7 +7,7 @@ let img = (import liminix {
|
|||
liminix-config = ./configuration.nix;
|
||||
}).outputs.default;
|
||||
pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; };
|
||||
inherit (pkgs.pkgsBuildBuild) routeros run-liminix-vm;
|
||||
inherit (pkgs.pkgsBuildBuild) routeros;
|
||||
in pkgs.runCommand "check" {
|
||||
nativeBuildInputs = with pkgs; [
|
||||
python3Packages.scapy
|
||||
|
|
|
@ -7,7 +7,6 @@ let img = (import liminix {
|
|||
liminix-config = ./configuration.nix;
|
||||
}).outputs.default;
|
||||
pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; };
|
||||
inherit (pkgs.pkgsBuildBuild) run-liminix-vm;
|
||||
in pkgs.runCommand "check" {
|
||||
nativeBuildInputs = with pkgs; [
|
||||
expect socat
|
||||
|
|
Loading…
Reference in a new issue