File size: 1,146 Bytes
021894c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b9ed1a3
 
 
 
 
 
 
 
 
 
 
 
 
021894c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
set -Eeuo pipefail

: "${APP:="QEMU"}"
: "${PLATFORM:="x64"}"
: "${SUPPORT:="https://github.com/qemus/qemu"}"

cd /run

. start.sh      # Startup hook
. utils.sh      # Load functions
. reset.sh      # Initialize system
. server.sh     # Start webserver
. define.sh     # Define images
. install.sh    # Download image
. disk.sh       # Initialize disks
. display.sh    # Initialize graphics
. network.sh    # Initialize network
. boot.sh       # Configure boot
. proc.sh       # Initialize processor
. memory.sh     # Check available memory
. config.sh     # Configure arguments
. finish.sh     # Finish initialization

trap - ERR

version=$(qemu-system-x86_64 --version | head -n 1 | cut -d '(' -f 1 | awk '{ print $NF }')
info "Booting image${BOOT_DESC} using QEMU v$version..."

# Print which accelerator will be used (KVM vs TCG)
ACCEL_NAME="tcg"
if [[ "${KVM:-Y}" != [Nn]* ]]; then
	if [ -e /dev/kvm ] && [ -w /dev/kvm ] 2>/dev/null; then
		ACCEL_NAME="kvm"
	else
		ACCEL_NAME="tcg"
	fi
else
	ACCEL_NAME="tcg"
fi
info "Selected accelerator: $ACCEL_NAME (set KVM=N to force TCG)"

exec qemu-system-x86_64 ${ARGS:+ $ARGS}