Skip to content

Commit

Permalink
optimize rootfs scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevent-fei committed Dec 5, 2022
1 parent 94f8f8c commit 177814d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions context/rootfs/scripts/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ scripts_path=$(cd `dirname "$0"`; pwd)
image_dir="$scripts_path/../images"
DOCKER_VERSION="19.03.14-sealer"

# shellcheck disable=SC1091
get_distribution() {
lsb_dist=""
# Every system that we officially support has /etc/os-release
Expand Down
1 change: 1 addition & 0 deletions context/rootfs/scripts/init-kube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# shellcheck disable=SC2046
# shellcheck disable=SC2164
# shellcheck disable=SC2006
# shellcheck disable=SC1091
scripts_path=$(cd `dirname "$0"`; pwd)
source "${scripts_path}"/utils.sh

Expand Down
5 changes: 3 additions & 2 deletions context/rootfs/scripts/nvidia-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# shellcheck disable=SC2006
# shellcheck disable=SC2005
# shellcheck disable=SC2181
# shellcheck disable=SC1091
scripts_path=$(cd `dirname "$0"`; pwd)
source "${scripts_path}"/utils.sh

Expand Down Expand Up @@ -53,7 +54,7 @@ public::nvidia::enable_gpu_device_plugin() {
}

kube::nvidia::detect_gpu(){
tar -xvf "${scripts_path}"/../tgz/nvidia.tgz -C ${scripts_path}/../rpm/
tar -xvf "${scripts_path}"/../tgz/nvidia.tgz -C "${scripts_path}"/../rpm/
kube::nvidia::setup_lspci
lspci | grep -i nvidia > /dev/null 2>&1
if [[ "$?" == "0" ]]; then
Expand All @@ -66,7 +67,7 @@ kube::nvidia::setup_lspci(){
return
fi
utils_info "lspci command not exist, install it"
rpm -ivh --force --nodeps ${RPM_DIR}/pciutils*.rpm
rpm -ivh --force --nodeps "${RPM_DIR}"/pciutils*.rpm
if [[ "$?" != "0" ]]; then
panic "failed to install pciutils via command (rpm -ivh --force --nodeps ${RPM_DIR}/pciutils*.rpm) in dir ${PWD}, please run it for debug"
fi
Expand Down

0 comments on commit 177814d

Please sign in to comment.