#!/bin/bash # # Copyright (c) 2022 Wind River Systems, Inc. # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. The ASF licenses this # file to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # The only parameter is the name of the new directory that will contain # the extracted source code. Be aware that this new directory will be # created in the same directory as where this script is located when # building. # Tools needed: mkdir, rm, tar DL_TARBALL=bcm_232.1.132.8c.tar.gz SRC_TARBALL=drivers_linux/bnxt_rocelib/libbnxt_re-232.0.155.5.tar.gz TMPDIR="bcm_tmp" DESTDIR="${1}" if test -z "${DESTDIR}"; then echo "Missing destination directory on command line." exit 1 fi rm -rf "${TMPDIR}" mkdir -p "${TMPDIR}" if ! tar -C "${TMPDIR}" --strip-components=1 -xvf "${DL_TARBALL}"; then echo "Could not extract into ${TMPDIR}: ${DL_TARBALL}" exit 1 fi mkdir -p "${DESTDIR}" if ! tar -C "${DESTDIR}" --strip-components=1 -xvf "${TMPDIR}/${SRC_TARBALL}"; then echo "Could not extract into ${DESTDIR}: ${TMPDIR}/${SRC_TARBALL}" exit 1 fi rm -rf "${TMPDIR}"