qemush : ajout commande run, documentation, dossier bin -> launchers

This commit is contained in:
Ahurac 2023-12-08 10:59:49 +01:00
parent 4a5327ca0a
commit 00b9c552ca
8 changed files with 17 additions and 6 deletions

View file

@ -81,10 +81,16 @@ system wide.
`first-free-port` is a small C program designed accordingly to the Unix
philosophy to show in `stdout` the first free (not listening) TCP port
after `argv[1]`, or `argv[1]` if it is free. You can compile it and add
it to your `PATH` if you need to allocate ports to protocols like SPICE in
your launching scripts (example in `qemu/bin/*-spice`). Its source is in
`src` folder of this repository.
after `argv[1]`, or `argv[1]` if it is free. You will need it to allocate
ports to protocols like SPICE in your launching scripts (example in
`qemu/bin/*-spice`).
Example `qemush` command to add the program to a local `qemu` `bin` folder
:
```sh
qemush do 'mkdir ~/bin && cc -o "${_}/first-free-port" src/first-free-port.c'
```
## Usage

View file

@ -12,9 +12,9 @@ exec_as() {
exec_as qemu "$@"
bin="${HOME}/bin"
bin="${HOME}/launchers"
images="${HOME}/images"
PATH="${bin}:${PATH}"
PATH="${bin}:${HOME}/bin:${PATH}"
EDITOR="${EDITOR:-nvim}"
alias ls='ls --color=auto'
alias exec='exec '
@ -47,6 +47,7 @@ ${name}: usage:
${name} shell - start a shell as user qemu
${name} help - show this help
${name} add <path to script> [<VM name>] - add a launching script
${name} run <command> - run shell input as user qemu
EOF
}
@ -122,6 +123,10 @@ public_add() {
trap - EXIT
}
public_run() {
sh -c "$*"
}
function="$1"
shift