Compare commits
3 commits
8c3dc22119
...
95189e503f
Author | SHA1 | Date | |
---|---|---|---|
95189e503f | |||
fbc979fa8a | |||
7e5c72aee4 |
3 changed files with 18 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# version=0.5.0
|
# version=0.6.0
|
||||||
|
|
||||||
# Function to re-exec the script as another user via sudo (only if needed)
|
# Function to re-exec the script as another user via sudo (only if needed)
|
||||||
exec_as() {
|
exec_as() {
|
||||||
|
@ -66,6 +66,7 @@ public_start() {
|
||||||
QEMUSH_NAME="$1"
|
QEMUSH_NAME="$1"
|
||||||
|
|
||||||
set -- "$@" \
|
set -- "$@" \
|
||||||
|
-name "$QEMUSH_NAME" \
|
||||||
-monitor "unix:$(pathof socket),server,nowait" \
|
-monitor "unix:$(pathof socket),server,nowait" \
|
||||||
-daemonize
|
-daemonize
|
||||||
if ! "$@"; then
|
if ! "$@"; then
|
||||||
|
|
11
qemu/launchers/9p
Executable file
11
qemu/launchers/9p
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
base=$(echo "$QEMUSH_BASE" | cut -d , -f 1)
|
||||||
|
QEMUSH_BASE=$(echo "$QEMUSH_BASE" | sed "s/^${base}//" | sed 's/^,//')
|
||||||
|
|
||||||
|
set -- "$base" \
|
||||||
|
-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
|
||||||
|
exec "$@"
|
|
@ -1,6 +1,10 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
# What processor architecture to use
|
||||||
|
arch=$QEMUSH_ARCH
|
||||||
|
[ -z "$arch" ] && arch=$(uname -m)
|
||||||
|
|
||||||
# How many CPU cores to use
|
# How many CPU cores to use
|
||||||
nproc=$QEMUSH_NPROC
|
nproc=$QEMUSH_NPROC
|
||||||
[ -z "$nproc" ] && nproc=$(($(nproc) / 2))
|
[ -z "$nproc" ] && nproc=$(($(nproc) / 2))
|
||||||
|
@ -10,7 +14,7 @@ ram=$QEMUSH_RAM
|
||||||
[ -z "$ram" ] && ram=$(($(free | grep '^Mem:\s' | awk '{ print $NF }') / 2))K
|
[ -z "$ram" ] && ram=$(($(free | grep '^Mem:\s' | awk '{ print $NF }') / 2))K
|
||||||
|
|
||||||
# Set the arguments
|
# Set the arguments
|
||||||
set -- qemu-system-x86_64 \
|
set -- "qemu-system-${arch}" \
|
||||||
-enable-kvm \
|
-enable-kvm \
|
||||||
-M q35 \
|
-M q35 \
|
||||||
-cpu host -smp "$nproc" \
|
-cpu host -smp "$nproc" \
|
||||||
|
|
Loading…
Reference in a new issue