Export die() function
I realised I'd been using die() in a few places assuming it was available, but it wasn't exported. I guess it didn't matter because whatever was wrong, we were failing anyway :) This exports the function to make it available to sub-processes, which should remove the need to source it as done in several places. Change-Id: I7b9a5a6db406e160099b6ed9fde80455ae227327
This commit is contained in:
parent
f0b57d5efd
commit
7550d25db0
@ -7,7 +7,6 @@ fi
|
|||||||
set -eu
|
set -eu
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
source $_LIB/die
|
|
||||||
[ -n "$TMP_HOOKS_PATH" ] || die "Temp hook path not set"
|
[ -n "$TMP_HOOKS_PATH" ] || die "Temp hook path not set"
|
||||||
|
|
||||||
echo "$DIB_ENV" > $TMP_HOOKS_PATH/dib_environment
|
echo "$DIB_ENV" > $TMP_HOOKS_PATH/dib_environment
|
||||||
|
@ -8,7 +8,6 @@ fi
|
|||||||
set -eu
|
set -eu
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
source $_LIB/die
|
|
||||||
[ -n "$TMP_HOOKS_PATH" ] || die "Temp hook path not set"
|
[ -n "$TMP_HOOKS_PATH" ] || die "Temp hook path not set"
|
||||||
|
|
||||||
if [ -e ~/.ssh/authorized_keys ]; then
|
if [ -e ~/.ssh/authorized_keys ]; then
|
||||||
|
@ -7,7 +7,6 @@ set -eu
|
|||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
# sanity checks
|
# sanity checks
|
||||||
source $_LIB/die
|
|
||||||
[ -n "$IMAGE_BLOCK_DEVICE" ] || die "Image block device not set"
|
[ -n "$IMAGE_BLOCK_DEVICE" ] || die "Image block device not set"
|
||||||
|
|
||||||
# execute sfdisk with the given partitioning schema
|
# execute sfdisk with the given partitioning schema
|
||||||
|
@ -6,7 +6,6 @@ fi
|
|||||||
set -eu
|
set -eu
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
source $_LIB/die
|
|
||||||
[ -n "$IMAGE_BLOCK_DEVICE" ] || die "Image block device not set"
|
[ -n "$IMAGE_BLOCK_DEVICE" ] || die "Image block device not set"
|
||||||
|
|
||||||
# Create 2 partitions for PPC, one for PReP boot and other for root
|
# Create 2 partitions for PPC, one for PReP boot and other for root
|
||||||
|
3
lib/die
3
lib/die
@ -16,10 +16,11 @@
|
|||||||
|
|
||||||
# Prints "message" and exits
|
# Prints "message" and exits
|
||||||
# Usage: die "message"
|
# Usage: die "message"
|
||||||
function die() {
|
function die {
|
||||||
local exitcode=$?
|
local exitcode=$?
|
||||||
set +o xtrace
|
set +o xtrace
|
||||||
echo $@
|
echo $@
|
||||||
exit $exitcode
|
exit $exitcode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export -f die
|
||||||
|
Loading…
Reference in New Issue
Block a user