diff --git a/doc/development.rst b/doc/development.rst index b37e108..9e5e0b8 100644 --- a/doc/development.rst +++ b/doc/development.rst @@ -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 `_ 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 ---------------------- diff --git a/modules/outputs.nix b/modules/outputs.nix index 64dc6e4..f55567b 100644 --- a/modules/outputs.nix +++ b/modules/outputs.nix @@ -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 { diff --git a/tests/min-copy-closure/test.nix b/tests/min-copy-closure/test.nix index d296bbd..b07bee2 100644 --- a/tests/min-copy-closure/test.nix +++ b/tests/min-copy-closure/test.nix @@ -9,11 +9,9 @@ let lmx = (import liminix { rogue = lmx.pkgs.rogue; img = lmx.outputs.vmroot; pkgs = import { 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 diff --git a/tests/pppoe/test.nix b/tests/pppoe/test.nix index b9324fe..3bec8f5 100644 --- a/tests/pppoe/test.nix +++ b/tests/pppoe/test.nix @@ -7,7 +7,7 @@ let img = (import liminix { liminix-config = ./configuration.nix; }).outputs.default; pkgs = import { overlays = [(import ../../overlay.nix)]; }; - inherit (pkgs.pkgsBuildBuild) routeros run-liminix-vm; + inherit (pkgs.pkgsBuildBuild) routeros; in pkgs.runCommand "check" { nativeBuildInputs = with pkgs; [ python3Packages.scapy diff --git a/tests/wlan/test.nix b/tests/wlan/test.nix index 0251570..15a8ba5 100644 --- a/tests/wlan/test.nix +++ b/tests/wlan/test.nix @@ -7,7 +7,6 @@ let img = (import liminix { liminix-config = ./configuration.nix; }).outputs.default; pkgs = import { overlays = [(import ../../overlay.nix)]; }; - inherit (pkgs.pkgsBuildBuild) run-liminix-vm; in pkgs.runCommand "check" { nativeBuildInputs = with pkgs; [ expect socat