X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=VNFs%2FDPPD-PROX%2Fhelper-scripts%2Frapid%2Fcheck_prox_system_setup.sh;h=84e2f70fdf51755caef62a43cf40c65083df80e2;hb=849357bb9ca1d27993c9e96b93156ec69b3ac3a9;hp=9effa53c268e600998aeba2feb768957b4ad447d;hpb=ccae9496c217020455acfe337aaf2b2f0c5644d8;p=samplevnf.git diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/check_prox_system_setup.sh b/VNFs/DPPD-PROX/helper-scripts/rapid/check_prox_system_setup.sh index 9effa53c..84e2f70f 100755 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/check_prox_system_setup.sh +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/check_prox_system_setup.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash ## -## Copyright (c) 2010-2018 Intel Corporation +## Copyright (c) 2010-2020 Intel Corporation ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except in compliance with the License. @@ -18,35 +18,39 @@ NCPUS="$(lscpu | egrep '^CPU\(s\):' | awk '{ print $2 }')" MAXCOREID="$((NCPUS-1))" filename="/etc/tuned/realtime-virtual-guest-variables.conf" -logfile="/home/centos/prox_system_setup.log" +logfile="/opt/rapid/prox_system_setup.log" if [ -f "$filename" ] then - while read -r line - do - case $line in - isolated_cores=1-$MAXCOREID*) - echo "Isolated CPU(s) OK, no reboot: $line">>$logfile - modprobe uio - insmod /root/dpdk/build/kmod/igb_uio.ko - exit 0 - ;; - isolated_cores=*) - echo "Isolated CPU(s) NOK, change the config and reboot: $line">>$logfile - sed -i "/^isolated_cores=.*/c\isolated_cores=1-$MAXCOREID" $filename - tuned-adm profile realtime-virtual-guest - reboot - exit 0 - ;; - *) - echo "$line" - ;; - esac - done < "$filename" - echo "isolated_cores=1-$MAXCOREID" >> $filename - echo "No Isolated CPU(s) defined in config, line added: $line">>$logfile - tuned-adm profile realtime-virtual-guest - reboot + while read -r line + do + case $line in + isolated_cores=1-$MAXCOREID*) + echo "Isolated CPU(s) OK, no reboot: $line">>$logfile + FILE=/opt/rapid/after_boot.sh + if test -f "$FILE"; then + ("$FILE") + echo "Executing: $FILE">>$logfile + fi + touch /opt/rapid/system_ready_for_rapid + exit 0 + ;; + isolated_cores=*) + echo "Isolated CPU(s) NOK, change the config and reboot: $line">>$logfile + sed -i "/^isolated_cores=.*/c\isolated_cores=1-$MAXCOREID" $filename + tuned-adm profile realtime-virtual-guest + reboot + exit 0 + ;; + *) + echo "$line" + ;; + esac + done < "$filename" + echo "isolated_cores=1-$MAXCOREID" >> $filename + echo "No Isolated CPU(s) defined in config, line added: $line">>$logfile + tuned-adm profile realtime-virtual-guest + reboot else - echo "$filename not found.">>$logfile + echo "$filename not found.">>$logfile fi