summaryrefslogtreecommitdiffstats
path: root/lib/configure-deps-functions.sh
diff options
context:
space:
mode:
authorDan Radez <dradez@redhat.com>2017-05-05 16:51:02 -0400
committerDan Radez <dradez@redhat.com>2017-06-22 16:37:59 -0400
commit586110a27dc11e89a5ff3552f3215e8a0716aa92 (patch)
treee1fa6054d3f8077f114675d8de2b5da4a302a374 /lib/configure-deps-functions.sh
parentff9beeb45e7d25aedf2d25644497b0468a96ee16 (diff)
Adding conditionals dependent on arch
There are x86 specific build items that can't be used when building on aarch64. Adding conditionals so that the items only get built in when building on x86_64. There are aarch64 specific settings that need to be set for deployment. JIRA: APEX-381 Change-Id: I63e1c99d5d22bbb523c88be7e973a6c834a38b01 Signed-off-by: Dan Radez <dradez@redhat.com>
Diffstat (limited to 'lib/configure-deps-functions.sh')
-rwxr-xr-xlib/configure-deps-functions.sh53
1 files changed, 28 insertions, 25 deletions
diff --git a/lib/configure-deps-functions.sh b/lib/configure-deps-functions.sh
index 32900015..3d0e3ac7 100755
--- a/lib/configure-deps-functions.sh
+++ b/lib/configure-deps-functions.sh
@@ -129,36 +129,39 @@ EOF
virsh pool-list --all | grep default > /dev/null || virsh pool-define-as --name default dir --target /var/lib/libvirt/images
virsh pool-list | grep -Eo "default\s+active" > /dev/null || (virsh pool-autostart default; virsh pool-start default)
- if ! egrep '^flags.*(vmx|svm)' /proc/cpuinfo > /dev/null; then
- echo "${red}virtualization extensions not found, kvm kernel module insertion may fail.\n \
+ # Virt flag check is Arch dependent on x86
+ if "$(uname -i)" == 'x86_64'; then
+ if ! egrep '^flags.*(vmx|svm)' /proc/cpuinfo > /dev/null; then
+ echo "${red}virtualization extensions not found, kvm kernel module insertion may fail.\n \
Are you sure you have enabled vmx in your bios or hypervisor?${reset}"
- fi
+ fi
- if ! lsmod | grep kvm > /dev/null; then modprobe kvm; fi
- if ! lsmod | grep kvm_intel > /dev/null; then modprobe kvm_intel; fi
+ if ! lsmod | grep kvm > /dev/null; then modprobe kvm; fi
+ if ! lsmod | grep kvm_intel > /dev/null; then modprobe kvm_intel; fi
- if ! lsmod | grep kvm > /dev/null; then
- echo "${red}kvm kernel modules not loaded!${reset}"
- return 1
- fi
+ if ! lsmod | grep kvm > /dev/null; then
+ echo "${red}kvm kernel modules not loaded!${reset}"
+ return 1
+ fi
- # try to enabled nested kvm
- if [ "$virtual" == "TRUE" ]; then
- nested_kvm=`cat /sys/module/kvm_intel/parameters/nested`
- if [ "$nested_kvm" != "Y" ]; then
- # try to enable nested kvm
- echo 'options kvm-intel nested=1' > /etc/modprobe.d/kvm_intel.conf
- if rmmod kvm_intel; then
- modprobe kvm_intel
+ # try to enabled nested kvm
+ if [ "$virtual" == "TRUE" ]; then
+ nested_kvm=`cat /sys/module/kvm_intel/parameters/nested`
+ if [ "$nested_kvm" != "Y" ]; then
+ # try to enable nested kvm
+ echo 'options kvm-intel nested=1' > /etc/modprobe.d/kvm_intel.conf
+ if rmmod kvm_intel; then
+ modprobe kvm_intel
+ fi
+ nested_kvm=`cat /sys/module/kvm_intel/parameters/nested`
+ fi
+ if [ "$nested_kvm" != "Y" ]; then
+ echo "${red}Cannot enable nested kvm, falling back to qemu for deployment${reset}"
+ DEPLOY_OPTIONS+=" --libvirt-type qemu"
+ else
+ echo "${blue}Nested kvm enabled, deploying with kvm acceleration${reset}"
+ fi
fi
- nested_kvm=`cat /sys/module/kvm_intel/parameters/nested`
- fi
- if [ "$nested_kvm" != "Y" ]; then
- echo "${red}Cannot enable nested kvm, falling back to qemu for deployment${reset}"
- DEPLOY_OPTIONS+=" --libvirt-type qemu"
- else
- echo "${blue}Nested kvm enabled, deploying with kvm acceleration${reset}"
- fi
fi
##sshkeygen for root