launchers/9p : passage à Perl
This commit is contained in:
parent
95189e503f
commit
73aa42a7f8
1 changed files with 20 additions and 9 deletions
|
@ -1,11 +1,22 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env perl
|
||||||
base=$(echo "$QEMUSH_BASE" | cut -d , -f 1)
|
use warnings;
|
||||||
QEMUSH_BASE=$(echo "$QEMUSH_BASE" | sed "s/^${base}//" | sed 's/^,//')
|
use strict;
|
||||||
|
|
||||||
set -- "$base" \
|
my @launchers_chain = ("kvm");
|
||||||
-fsdev local,security_model=passthrough,id=fsdev0,path="${HOME}/shared/${QEMUSH_NAME}" \
|
|
||||||
-device virtio-9p-pci,id=fs0,fsdev=fsdev0,mount_tag=shared \
|
|
||||||
"$@"
|
|
||||||
|
|
||||||
set -x
|
if (defined $ENV{'QEMUSH_BASE'}) {
|
||||||
exec "$@"
|
@launchers_chain = split ",", $ENV{'QEMUSH_BASE'};
|
||||||
|
}
|
||||||
|
|
||||||
|
my $base = shift @launchers_chain;
|
||||||
|
$ENV{'QEMUSH_BASE'} = join ",", @launchers_chain;
|
||||||
|
|
||||||
|
my @command = (
|
||||||
|
$base,
|
||||||
|
"-fsdev", "local,security_model=passthrough,id=fsdev0,path=" . $ENV{'HOME'} . "/shared/" . $ENV{'QEMUSH_NAME'},
|
||||||
|
"-device", "virtio-9p-pci,id=fs0,fsdev=fsdev0,mount_tag=shared",
|
||||||
|
@ARGV
|
||||||
|
);
|
||||||
|
|
||||||
|
print "+ exec ", join(" ", @command), "\n";
|
||||||
|
exec @command;
|
||||||
|
|
Loading…
Reference in a new issue