diff options
| author | Marc Vertes <mvertes@free.fr> | 2026-03-04 13:17:42 +0100 |
|---|---|---|
| committer | Marc Vertes <mvertes@free.fr> | 2026-03-04 13:17:42 +0100 |
| commit | fd6b3c227d160d79f0fb9995e66d16dc836432ab (patch) | |
| tree | d45e35c2ea7c58a1cc24ba7abd76b01273854cd7 /bin | |
| parent | ab50c65a89f324c1ba11e4e50a8a954ce27cf02f (diff) | |
add .gitignore_global; support debian
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/vm | 39 |
1 files changed, 20 insertions, 19 deletions
@@ -5,18 +5,18 @@ vm_version='vm-0.1' # TODO: -# - DONE: fetch, build and install vftool in .vm/vftool -# - DONE: setup a config file per VM -# - DONE: creation of hdd image -# - DONE: delete a VM -# - DONE: import iso, kernel, initrd from existing vm -# - when no vm is specified, apply command to last one -# - script install from CDROM iso: -# - patch alpine setup-disk -# - setup system, including static IP address -# - setup user account from host -# - setup ssh from host -# - time synchronization from host +# - [x] fetch, build and install vftool in .vm/vftool +# - [x] setup a config file per VM +# - [x] creation of hdd image +# - [x] delete a VM +# - [x] import iso, kernel, initrd from existing vm +# - [ ] when no vm is specified, apply command to last one +# - [ ] script install from CDROM iso: +# - [ ] patch alpine setup-disk +# - [ ] setup system, including static IP address +# - [ ] setup user account from host +# - [ ] setup ssh from host +# - [ ] time synchronization from host # unset CDPATH @@ -186,13 +186,14 @@ start() { ! [ "$s" ] || exec ssh "$1" } +# Start a vm. Notice the sub-process pattern here: f() (...) start_vm() ( - [ -f vftool.log ] && cat vftool.log >> vftool.log.old + [ -f vftool.log ] && cat vftool.log >> vftool.log.old exec 1>vftool.log 2>&1 . config || die "vm: could not source $PWD/config" - trap 'rm -f vftool.pid' EXIT + trap 'rm -f vftool.pid' EXIT - "$dir/vftool" \ + "$dir"/vftool \ ${kernel+-k "$kernel"} \ ${initrd+-i "$initrd"} \ ${hda+-d "$hda"} \ @@ -204,10 +205,10 @@ start_vm() ( -a "${arg-console=hvc0}" \ >>vftool.log 2>&1 & sleep 1 - [ -f screenlog.0 ] && mv screenlog.0 screenlog.0.old - echo "$!" >vftool.pid - screen -L -S "${PWD##*/}" -d -m "$(vftool_tty)" - wait + [ -f screenlog.0 ] && mv screenlog.0 screenlog.0.old + echo "$!" >vftool.pid + screen -L -S "${PWD##*/}" -d -m "$(vftool_tty)" + wait ) stop() { |
