-
Notifications
You must be signed in to change notification settings - Fork 247
/
xen.cfg
87 lines (77 loc) · 2.93 KB
/
xen.cfg
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#
# Uncomment the following variable and set to 0 or 1 to avoid warning.
#
#XEN_OVERRIDE_GRUB_DEFAULT=0
echo "Including Xen overrides from /etc/default/grub.d/xen.cfg"
echo "Using DRAKVUF-optimized settings for Xen"
#
# Uncomment the following lines in order to set Domain 0 CPU and memory
# manually instead of using default auto-detected settings.
# The more resources you dedicate to the host system, the less remains
# to the guest systems in virtual machines.
#
# DRAK_DOM0_CPU=2
# DRAK_DOM0_RAM=2048
if command -v drak-find-xen-defaults >/dev/null
then
echo Detected that drakvuf-bundle is installed.
else
echo "\e[31mWARNING!\e[0m Looks like DRAKVUF bundle is not installed."
echo "\e[31mWARNING!\e[0m Xen will be not configured to work with DRAKVUF"
exit 0
fi
. drak-find-xen-defaults
echo "------------------------------------------"
echo ""
echo "Resources dedicated to Dom0 (host system):"
echo "-> CPU core(s): ${DRAK_DOM0_CPU}"
echo "-> Memory: ${DRAK_DOM0_RAM} MB"
echo ""
echo "------------------------------------------"
echo "You can edit these settings in /etc/default/grub.d/xen.cfg"
#
# When running update-grub with the Xen hypervisor installed, there are
# some additional variables that can be used to pass options to the
# hypervisor or the dom0 kernel.
# The following two are used to generate arguments for the hypervisor:
#
GRUB_CMDLINE_XEN_DEFAULT="dom0_mem=${DRAK_DOM0_RAM}M,max:${DRAK_DOM0_RAM}M dom0_max_vcpus=${DRAK_DOM0_CPU} dom0_vcpus_pin=1 force-ept=1 ept=ad=0 hap_1gb=0 hap_2mb=0 altp2m=1 hpet=legacy-replacement smt=0 sched=credit"
#GRUB_CMDLINE_XEN=""
#
# For example:
#
# dom0_mem=<size>[M]:max=<size>[M]
# Sets the amount of memory dom0 uses (max prevents balloning for more)
# com[12]=<speed>,<data bits><parity><stopbits>
# Initialize a serial console from in the hypervisor (eg. 115200,8n1)
# Note that com1 would be ttyS0 in Linux.
# console=<dev>[,<dev> ...]
# Redirects Xen hypervisor console (eg. com1,vga)
#
# The next two lines are used for creating kernel arguments for the dom0
# kernel. This allows to have different options for the same kernel used
# natively or as dom0 kernel.
#
GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT quiet splash nomodeset"
#GRUB_CMDLINE_LINUX_XEN_REPLACE="$GRUB_CMDLINE_LINUX"
#
# For example:
#
# earlyprintk=xenboot
# Allows to send early printk messages to the Xen hypervisor console
# console=hvc0
# Redirects the Linux console to the hypervisor console
#
# Make booting into Xen the default if not changed above. Finding the
# current string for it always has been a problem.
#
if [ "$XEN_OVERRIDE_GRUB_DEFAULT" = "" ]; then
echo "WARNING: GRUB_DEFAULT changed to boot into Xen by default!"
echo " Edit /etc/default/grub.d/xen.cfg to avoid this warning."
XEN_OVERRIDE_GRUB_DEFAULT=1
fi
if [ "$XEN_OVERRIDE_GRUB_DEFAULT" = "1" ]; then
GRUB_DEFAULT=$( \
printf "$(gettext "%s, with Xen hypervisor")" \
"$GRUB_DISTRIBUTOR GNU/Linux")
fi