build: Explicitly use bash for shell scripts
VPP requires bash for all shell scripts. Align shebang lines in build and test scripts to look up the location of bash rather than hard coding '/bin/bash'. Look up the location of bash for makefiles. Type: improvement Change-Id: I23b705d81d60389fa8af61c680cf0abd74f0ea24 Signed-off-by: Tom Jones <thj@freebsd.org>
This commit is contained in:
parent
ca75cd83b5
commit
c3b416c492
2
Makefile
2
Makefile
@ -14,7 +14,7 @@
|
||||
export WS_ROOT=$(CURDIR)
|
||||
export BR=$(WS_ROOT)/build-root
|
||||
CCACHE_DIR?=$(BR)/.ccache
|
||||
SHELL:=/bin/bash
|
||||
SHELL:=$(shell which bash)
|
||||
GDB?=gdb
|
||||
PLATFORM?=vpp
|
||||
SAMPLE_PLUGIN?=no
|
||||
|
@ -39,7 +39,7 @@
|
||||
######################################################################
|
||||
|
||||
# Scripts require non-POSIX parts of bash
|
||||
SHELL := /bin/bash
|
||||
SHELL := $(shell which bash)
|
||||
|
||||
# Where this makefile lives
|
||||
MU_BUILD_ROOT_DIR = $(shell pwd)
|
||||
@ -962,7 +962,7 @@ $(PLATFORM_IMAGE_DIR)/ro.img ro-image: $(patsubst %,%-find-source,$(ROOT_PACKAGE
|
||||
chmod 0755 $${tmp_dir} ; \
|
||||
cd $${tmp_dir} ; \
|
||||
trap "rm -rf $${tmp_dir}" err ; \
|
||||
fakeroot /bin/bash -c "{ \
|
||||
fakeroot $(SHELL) -c "{ \
|
||||
set -eu$(BUILD_DEBUG) ; \
|
||||
$(MAKE) -C $(MU_BUILD_ROOT_DIR) IMAGE_INSTALL_DIR=$${tmp_dir} \
|
||||
$(patsubst %,%-image_install, \
|
||||
@ -1054,7 +1054,7 @@ rw-image: rw-image-check-type ro-image
|
||||
chmod 0755 $${tmp_dir} ; \
|
||||
cd $${tmp_dir} ; \
|
||||
trap "rm -rf $${tmp_dir}" err ; \
|
||||
fakeroot /bin/bash -c "{ \
|
||||
fakeroot $(SHELL) -c "{ \
|
||||
set -eu$(BUILD_DEBUG) ; \
|
||||
$(linuxrc_makedev) ; \
|
||||
$(call rw_image_embed_ro_image_fn,$${ro_image}) ; \
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2015 Cisco and/or its affiliates.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
2
build/external/Makefile
vendored
2
build/external/Makefile
vendored
@ -12,7 +12,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
# Scripts require non-POSIX parts of bash
|
||||
SHELL := /bin/bash
|
||||
SHELL := $(shell which bash)
|
||||
|
||||
DL_CACHE_DIR = $(HOME)/Downloads
|
||||
MAKE ?= make
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Get Command Line arguements if present
|
||||
VPP_DIR=$1
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Capture all the interface IPs, in case we need them later
|
||||
ip -o addr show > ~vagrant/ifconfiga
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Get Command Line arguements if present
|
||||
VPP_DIR=$1
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Figure out what system we are running on
|
||||
if [ "$(uname)" <> "Darwin" ] ; then
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Make sure that we get the hugepages we need on provision boot
|
||||
# Note: The package install should take care of this at the end
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
VPP_DIR=$1
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
: ${VPP_BUILD_USER:=$(whoami)}
|
||||
: ${VPP_BUILD_HOST:=$(hostname)}
|
||||
DATE_FMT="+%Y-%m-%dT%H:%M:%S"
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2015 Cisco and/or its affiliates.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# to obtain dhcp address from leftpeer
|
||||
dhclient -d -v eth1
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ "$(ls -A ${FAILED_DIR})" ]
|
||||
then
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
ff="0"
|
||||
items=
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
rv=0
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cmd=$1
|
||||
force_foreground=$2
|
||||
|
@ -1,4 +1,4 @@
|
||||
#! /bin/bash
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# socket_test.sh -- script to run socket tests.
|
||||
#
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
function usage() {
|
||||
echo "$0" 1>&2
|
||||
|
Loading…
x
Reference in New Issue
Block a user