mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-05-02 05:34:46 +00:00
Generated by git subtree add --prefix=docs git@github.com:kata-containers/documentation.git master git-subtree-dir: docs git-subtree-mainline:ec146a1b39
git-subtree-split:510287204b
Fixes: #329 Signed-off-by: Peng Tao <bergwolf@hyper.sh>
25 lines
736 B
Bash
25 lines
736 B
Bash
#!/bin/bash
|
|
# Copyright (c) 2019 Intel Corporation
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
# Description: Offline SOS CPUs except BSP before launch UOS
|
|
|
|
[ $(id -u) -eq 0 ] || { echo >&2 "ERROR: run as root"; exit 1; }
|
|
|
|
for i in $(ls -d /sys/devices/system/cpu/cpu[1-9]*); do
|
|
online=`cat $i/online`
|
|
idx=`echo $i | tr -cd "[0-9]"`
|
|
echo "INFO:$0: cpu$idx online=$online"
|
|
if [ "$online" = "1" ]; then
|
|
echo 0 > $i/online
|
|
while [ "$online" = "1" ]; do
|
|
sleep 1
|
|
echo 0 > $i/online
|
|
online=`cat $i/online`
|
|
done
|
|
echo $idx > /sys/class/vhm/acrn_vhm/offline_cpu
|
|
fi
|
|
done
|
|
|