Skip to content

Commit

Permalink
fix shellcheck warnings and errors
Browse files Browse the repository at this point in the history
  • Loading branch information
teknoraver committed Oct 25, 2022
1 parent cdd0c68 commit 799ad0d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
20 changes: 10 additions & 10 deletions build-samples/build_samples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

set -euo pipefail

THISDIR="$(cd $(dirname $0) && pwd)"
THISDIR="$(cd $(dirname "$0") && pwd)"

source "${THISDIR}"/../helpers.sh

VMLINUX_BTF="$1"
KERNEL="$2"
TOOLCHAIN="$3"

LLVM_VER="$(llvm_version $TOOLCHAIN)" && :
LLVM_VER="$(llvm_version "$TOOLCHAIN")" && :
if [ $? -eq 0 ]; then
export LLVM="-$LLVM_VER"
fi
Expand All @@ -25,16 +25,16 @@ fi

make headers_install
make \
CLANG=clang-${LLVM_VER} \
OPT=opt-${LLVM_VER} \
LLC=llc-${LLVM_VER} \
LLVM_DIS=llvm-dis-${LLVM_VER} \
LLVM_OBJCOPY=llvm-objcopy-${LLVM_VER} \
LLVM_READELF=llvm-readelf-${LLVM_VER} \
LLVM_STRIP=llvm-strip-${LLVM_VER} \
CLANG="clang-${LLVM_VER}" \
OPT="opt-${LLVM_VER}" \
LLC="llc-${LLVM_VER}" \
LLVM_DIS="llvm-dis-${LLVM_VER}" \
LLVM_OBJCOPY="llvm-objcopy-${LLVM_VER}" \
LLVM_READELF="llvm-readelf-${LLVM_VER}" \
LLVM_STRIP="llvm-strip-${LLVM_VER}" \
VMLINUX_BTF="${VMLINUX_BTF}" \
VMLINUX_H="${VMLINUX_H}" \
-C "${REPO_ROOT}/${REPO_PATH}/samples/bpf" \
-j $((4*$(nproc)))
-j "$((4*$(nproc)))"

foldable end build_samples
2 changes: 2 additions & 0 deletions helpers.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# shellcheck shell=ksh

# $1 - start or end
# $2 - fold identifier, no spaces
# $3 - fold section description
Expand Down
2 changes: 1 addition & 1 deletion prepare-rootfs/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ chmod 644 /exitstatus
HERE
# Create the init scripts.
if [[ ! -z SETUPCMD ]]; then
if [[ -n "$SETUPCMD" ]]; then
# Unescape whitespace characters.
setup_cmd=$(sed 's/\(\\\)\([[:space:]]\)/\2/g' <<< "${SETUPCMD}")
kernel="${KERNELRELEASE}"
Expand Down

0 comments on commit 799ad0d

Please sign in to comment.