Add support for native Kubernetes CPU Manager
[samplevnf.git] / VNFs / DPPD-PROX / helper-scripts / rapid / check_prox_system_setup.sh
index 7d66bd3..84e2f70 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 ##
-## Copyright (c) 2010-2019 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