diff --git a/pkg/debug/Dockerfile.spec b/pkg/debug/Dockerfile.spec new file mode 100644 index 00000000000..be215360ee8 --- /dev/null +++ b/pkg/debug/Dockerfile.spec @@ -0,0 +1,18 @@ +FROM lfedge/eve-alpine:745ae9066273c73b0fd879c4ba4ff626a8392d04 + +ENV BUILD_PKGS="jq pciutils usbutils lsblk" + +RUN eve-alpine-deploy.sh + +WORKDIR /usr/bin +COPY spec.sh . + +SHELL ["/bin/ash", "-eo", "pipefail", "-c"] + +RUN echo "Testing spec.sh -v..." && \ + ./spec.sh -v | tee /dev/stderr | jq . > /dev/null + +RUN echo "Testing spec.sh..." && \ + ./spec.sh | tee /dev/stderr | jq . > /dev/null + +CMD ["./spec.sh", "-v"] \ No newline at end of file diff --git a/pkg/debug/spec.sh b/pkg/debug/spec.sh index ae28277b11a..1b14a658b0c 100755 --- a/pkg/debug/spec.sh +++ b/pkg/debug/spec.sh @@ -271,8 +271,8 @@ __EOT__ __EOT__ cat <<__EOT__ "usagePolicy": {} - COMMA="}," __EOT__ + COMMA="}," fi } @@ -479,6 +479,10 @@ done #enumerate NICs (ignoring USB devices) for ETH in /sys/class/net/*; do + if [ ! -L "$ETH" ]; then + # skip bonding_masters file + continue + fi LABEL=$(echo "$ETH" | sed -e 's#/sys/class/net/##' -e 's#^k##') # Does $LABEL start with wlan or wwan? Change ztype and cost COST=0