1
0
mirror of https://github.com/rancher/os.git synced 2025-08-30 21:26:09 +00:00

Fix sha1sum call to work on both Linux and Darwin.

This commit is contained in:
Pepijn Bruienne 2015-08-22 13:49:02 -04:00
parent ab59d3cc64
commit 3565a3513b

View File

@ -7,16 +7,21 @@ cd $(dirname $0)/..
source scripts/build-common source scripts/build-common
BASE=$(pwd) BASE=$(pwd)
UNAME=$(uname)
# Linux and Darwin SHA1 sum binary are different, pick which to use
if [ "$UNAME" == "Darwin" ]; then sha1sum=$(which shasum)
elif [ "$UNAME" == "Linux" ]; then sha1sum=$(which sha1sum);
fi
KERNEL=${BASE}/dist/artifacts/vmlinuz KERNEL=${BASE}/dist/artifacts/vmlinuz
INITRD=${BASE}/dist/artifacts/initrd INITRD=${BASE}/dist/artifacts/initrd
NO_COMPRESS_INITRD=${INITRD}.none NO_COMPRESS_INITRD=${INITRD}.none
HD=${BASE}/state/empty-hd.img HD=${BASE}/state/empty-hd.img
HD_GZ=${BASE}/assets/empty-hd.img.gz HD_GZ=${BASE}/assets/empty-hd.img.gz
INITRD_TMP=${BUILD}/$(sha1sum ${INITRD} | awk '{print $1}') INITRD_TMP=${BUILD}/$(${sha1sum} ${INITRD} | awk '{print $1}')
INITRD_CURRENT=${BUILD}/initrd-current INITRD_CURRENT=${BUILD}/initrd-current
INITRD_TEST=${BUILD}/initrd.test INITRD_TEST=${BUILD}/initrd.test
UNAME=$(uname)
USER_DATA=cloud-init/openstack/latest/user_data USER_DATA=cloud-init/openstack/latest/user_data
# PREREQ: brew install coreutils # PREREQ: brew install coreutils