Merge "Add support for modifying genesis kernel parameters for OVS-DPDK"
This commit is contained in:
commit
b610831afa
|
@ -14,6 +14,7 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
GENESIS_HOST_PROFILE=${2:-}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Helper functions
|
# Helper functions
|
||||||
|
@ -64,8 +65,8 @@ install_file(){
|
||||||
local path="$1"
|
local path="$1"
|
||||||
local content="$2"
|
local content="$2"
|
||||||
local permissions="$3"
|
local permissions="$3"
|
||||||
local dirname
|
local reboot="${4:-false}"
|
||||||
dirname=$(dirname "$path")
|
local dirname=$(dirname "$path")
|
||||||
|
|
||||||
if [[ ! -d $dirname ]]; then
|
if [[ ! -d $dirname ]]; then
|
||||||
mkdir -p "$dirname"
|
mkdir -p "$dirname"
|
||||||
|
@ -74,6 +75,9 @@ install_file(){
|
||||||
if [[ ! -f $path ]] || [ "$(cat "$path")" != "$content" ]; then
|
if [[ ! -f $path ]] || [ "$(cat "$path")" != "$content" ]; then
|
||||||
echo "$content" > "$path"
|
echo "$content" > "$path"
|
||||||
chmod "$permissions" "$path"
|
chmod "$permissions" "$path"
|
||||||
|
if [[ $reboot = reboot ]]; then
|
||||||
|
REBOOT=true
|
||||||
|
fi
|
||||||
export FILE_UPDATED=true
|
export FILE_UPDATED=true
|
||||||
else
|
else
|
||||||
export FILE_UPDATED=false
|
export FILE_UPDATED=false
|
||||||
|
@ -136,6 +140,7 @@ if [[ ! $DISABLE_SECCOMP_PROFILE ]]; then
|
||||||
install_file "$path" "$content" "$permissions"
|
install_file "$path" "$content" "$permissions"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# bootaction: apparmor-profiles
|
# bootaction: apparmor-profiles
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
@ -171,3 +176,48 @@ if [[ ! $DISABLE_APPARMOR_PROFILES ]]; then
|
||||||
systemctl reload apparmor.service
|
systemctl reload apparmor.service
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# bootaction: Additional kernel parameters and hugepages for OVS-DPDK
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
if [[ -n "$GENESIS_HOST_PROFILE" ]]; then
|
||||||
|
|
||||||
|
manifests_lookup "$rendered_file" "drydock/HostProfile/v1" \
|
||||||
|
"$GENESIS_HOST_PROFILE" \
|
||||||
|
"['data']['platform']['kernel_params']" \
|
||||||
|
"dict_keys" "true"
|
||||||
|
kernel_params=$RESULT
|
||||||
|
|
||||||
|
grub_args=()
|
||||||
|
# NOTE: reverse sort is to ensure hugepagesz is before hugepages
|
||||||
|
for kp in $(echo $kernel_params | tr ' ' '\n' | sort -r); do
|
||||||
|
manifests_lookup "$rendered_file" "drydock/HostProfile/v1" \
|
||||||
|
"$GENESIS_HOST_PROFILE" \
|
||||||
|
"['data']['platform']['kernel_params']['$kp']"
|
||||||
|
if [[ $(tr '[:lower:]' '[:upper:]' <<< "$RESULT") == "TRUE" ]]; then
|
||||||
|
grub_args+=("$kp")
|
||||||
|
else
|
||||||
|
grub_args+=("$kp=$RESULT")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
path="/etc/default/grub.d/50-curtin-settings.cfg"
|
||||||
|
content="GRUB_CMDLINE_LINUX_DEFAULT=\"${grub_args[*]}\""
|
||||||
|
|
||||||
|
install_file "$path" "$content" '644' reboot
|
||||||
|
|
||||||
|
update-grub
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Reboot node
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
if [[ ! $DISABLE_REBOOT ]] && [[ $REBOOT = true ]]; then
|
||||||
|
echo Rebooting node $(hostname)...
|
||||||
|
reboot now &
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,14 @@ set -e
|
||||||
|
|
||||||
source "${GATE_UTILS}"
|
source "${GATE_UTILS}"
|
||||||
|
|
||||||
|
GENESIS_HOST_PROFILE=${GENESIS_HOST_PROFILE:-}
|
||||||
|
|
||||||
# Copies script and virtmgr private key to genesis VM
|
# Copies script and virtmgr private key to genesis VM
|
||||||
rsync_cmd "${REPO_ROOT}/tools/deployment/seaworthy-virt/airship_gate/lib/bootaction-runner.sh" "${GENESIS_NAME}:/root/airship/"
|
rsync_cmd "${REPO_ROOT}/tools/deployment/seaworthy-virt/airship_gate/lib/bootaction-runner.sh" "${GENESIS_NAME}:/root/airship/"
|
||||||
rsync_cmd "${RENDERED_DEPOT}/rendered.yaml" "${GENESIS_NAME}:/root/airship/"
|
rsync_cmd "${RENDERED_DEPOT}/rendered.yaml" "${GENESIS_NAME}:/root/airship/"
|
||||||
|
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
ssh_cmd "${GENESIS_NAME}" /root/airship/bootaction-runner.sh /root/airship/rendered.yaml 2>&1 | tee -a "${LOG_FILE}"
|
ssh_cmd "${GENESIS_NAME}" /root/airship/bootaction-runner.sh /root/airship/rendered.yaml "${GENESIS_HOST_PROFILE}" |& tee -a "${LOG_FILE}"
|
||||||
|
ssh_wait "${GENESIS_NAME}"
|
||||||
set +o pipefail
|
set +o pipefail
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue