Compare commits

..

20 Commits

Author SHA1 Message Date
AJ ONeal ccb1487b36 merged old and new 2017-11-06 13:20:05 -07:00
AJ ONeal e57069fe50 rename for merge 2017-11-06 13:17:09 -07:00
richdex14 aed892007f Clean up debugging from copying paths issue. 2017-09-04 14:35:23 -06:00
richdex14 6252737cc1 Update setup-deps-ubuntu.bash to use portable `sudo_cmd` syntax 2017-09-04 13:35:16 -06:00
richdex14 2f9f3c0c82 Update setup-node-ubuntu.bash to use portable `$sudo_cmd` syntax 2017-09-04 12:20:00 -06:00
richdex14 a24f92df98 Update setup.bash to use portable `$sudo_cmd` syntax 2017-09-04 12:18:57 -06:00
richdex14 351056f9bc Update setup-node-ubuntu.bash 2017-09-04 11:39:30 -06:00
richdex14 28c1ad8484 Debugging copying issues 2017-09-04 11:35:52 -06:00
richdex14 ae331149f7 Debugging file copy issues on daplie board. 2017-09-04 11:28:57 -06:00
richdex14 16a6d7e18c Debugging installer script issues on daplie board. 2017-09-04 11:11:18 -06:00
richdex14 6c0afe6488 Update setup-node-ubuntu.bash to use portable copy method as opposed to non-portable `tar --strip-components` in unpacking step. 2017-09-03 21:13:47 -06:00
richdex14 31b92cdadb Update setup-node-ubuntu.bash to replace `arch` call with portable call to `uname -a` 2017-09-03 20:47:40 -06:00
richdex14 561a2e2fa1 Correcting copy-paste mistake in `setup-node-ubuntu.bash`. Restoring version from coolaj86 repo. 2017-09-03 20:46:44 -06:00
richdex14 8a5593363d Update setup.bash to work with portable `head` command. 2017-09-02 12:05:22 -06:00
richdex14 69bc78680d Update setup.bash to use Daplie repo instead of coolaj86 repo. 2017-09-02 11:56:17 -06:00
richdex14 8a3f4ba77f Update setup.bash to work on Marvell arm64 OS 2017-09-02 11:45:28 -06:00
richdex14 a99583fb1d Update setup-min.sh to use Daplie repo instead of coolaj86 private repo. 2017-09-01 20:54:43 -06:00
richdex14 0948a728c3 Update setup-node-ubuntu.bash to use portable `head -n` syntax. 2017-09-01 20:45:22 -06:00
richdex14 fb0a8f6372 Update setup-node-ubuntu.bash to change to Daplie project from coolaj86 private project. 2017-09-01 20:16:12 -06:00
richdex14 de522df09b Update setup-node-ubuntu.bash to allow for `Marvell` OS. This is for our development purposes. In the future, we will have a fully custom image with the name containing `Daplie` 2017-09-01 20:09:55 -06:00
3 changed files with 38 additions and 18 deletions

View File

@ -12,6 +12,10 @@
# curl -fsSL https://example.com/setup-min.bash | bash
# wget -nv https://example.com/setup-min.bash -O - | bash
# Not every platform has or needs sudo, gotta save them O(1)s...
sudo_cmd=""
((EUID)) && [[ -z "$ANDROID_ROOT" ]] && sudo_cmd="sudo"
deps_flag="$1"
set -e
set -u
@ -95,7 +99,7 @@ elif [ "$(uname | grep -i 'Linux')" ]; then
exit 1
fi
if [ -n "$(arch | grep 64)" ]; then
if [ -n "$(uname -a | grep 64)" ]; then
ARCH="64"
else
ARCH="32"
@ -117,6 +121,8 @@ elif [ "$(uname | grep -i 'Linux')" ]; then
OS='raspbian'
elif [ "$(cat /etc/issue | grep -i 'Fedora')" ]; then
OS='fedora'
elif [ "$(cat /etc/issue | grep -i 'Marvell')" ]; then
OS='marvell'
fi
else
echo "unsupported unknown os (non-mac, non-linux)"
@ -134,6 +140,9 @@ case "${OS}" in
raspbian)
SETUP_FILE="ubuntu"
;;
marvell)
SETUP_FILE="ubuntu"
;;
yosemite)
# mavericks
SETUP_FILE="mavericks"
@ -236,10 +245,10 @@ fi
if [ -z "$NODEJS_VER" ]; then
if [ -n "$(type -p curl)" ]; then
NODEJS_VER=$(curl -fsL "$NODEJS_BASE_URL/dist/index.tab" | head -2 | tail -1 | cut -f 1) \
NODEJS_VER=$(curl -fsL "$NODEJS_BASE_URL/dist/index.tab" | head -n 2 | tail -1 | cut -f 1) \
|| echo 'error automatically determining current node.js version'
elif [ -n "$(type -p wget)" ]; then
NODEJS_VER=$(wget --quiet "$NODEJS_BASE_URL/dist/index.tab" -O - | head -2 | tail -1 | cut -f 1) \
NODEJS_VER=$(wget --quiet "$NODEJS_BASE_URL/dist/index.tab" -O - | head -n 2 | tail -1 | cut -f 1) \
|| echo 'error automatically determining current node.js version'
else
echo "Found neither 'curl' nor 'wget'. Can't Continue."
@ -284,7 +293,7 @@ if [ -n "${NODEJS_VER}" ]; then
bash "/tmp/${INSTALL_FILE}" "${NODEJS_VER}"
fi
sudo chown -R $(whoami) $node_install_path/lib/node_modules
$sudo_cmd chown -R $(whoami) $node_install_path/lib/node_modules
echo ""

View File

@ -2,6 +2,10 @@
# curl -fsSL https://ldsconnect.org/setup-linux.bash | bash -c
# Not every platform has or needs sudo, gotta save them O(1)s...
sudo_cmd=""
((EUID)) && [[ -z "$ANDROID_ROOT" ]] && sudo_cmd="sudo"
NO_FAIL2BAN=${1}
echo ""
@ -18,7 +22,7 @@ echo " * jshint"
echo ""
echo "updating apt-get..."
sudo bash -c "apt-get update -qq -y < /dev/null" > /dev/null
$sudo_cmd bash -c "apt-get update -qq -y < /dev/null" > /dev/null
# fail2ban
#if [ -z "$(which fail2ban-server | grep fail2ban)" ]; then
@ -32,5 +36,5 @@ sudo bash -c "apt-get update -qq -y < /dev/null" > /dev/null
if [ -z "$(type -p pkg-config)" ] || [ -z "$(type -p git)" ] || [ -z "$(type -p wget)" ] || [ -z "$(type -p curl)" ] || [ -z "$(type -p gcc)" ] || [ -z "$(type -p rsync)" ] || [ -z "$(type -p python)" ]
then
echo "installing git, wget, curl, build-essential, rsync, pkg-config, python..."
sudo bash -c "apt-get install -qq -y git wget curl build-essential rsync pkg-config python < /dev/null" > /dev/null 2>/dev/null
$sudo_cmd bash -c "apt-get install -qq -y git wget curl build-essential rsync pkg-config python < /dev/null" > /dev/null 2>/dev/null
fi

View File

@ -1,5 +1,9 @@
#!/bin/bash
# Not every platform has or needs sudo, gotta save them O(1)s...
sudo_cmd=""
((EUID)) && [[ -z "$ANDROID_ROOT" ]] && sudo_cmd="sudo"
set -e
set -u
set -o pipefail
@ -27,15 +31,15 @@ then
NODEJS_NAME="iojs"
fi
if [ -n "$(arch | grep aarch64)" ]; then
if [ -n "$(uname -a | grep aarch64)" ]; then
ARCH="arm64"
elif [ -n "$(arch | grep 64)" ]; then
elif [ -n "$(uname -a | grep 64)" ]; then
ARCH="x64"
elif [ -n "$(arch | grep armv8l)" ]; then
elif [ -n "$(uname -a | grep armv8l)" ]; then
ARCH="arm64"
elif [ -n "$(arch | grep armv7l)" ]; then
elif [ -n "$(uname -a | grep armv7l)" ]; then
ARCH="armv7l"
elif [ -n "$(arch | grep armv6l)" ]; then
elif [ -n "$(uname -a | grep armv6l)" ]; then
ARCH="armv6l"
else
ARCH="x86"
@ -59,11 +63,14 @@ if [ -n "${NODEJS_VER}" ]; then
fi
mkdir -p ${NODEJS_UNTAR}/
tar xf ${NODEJS_LOCAL} -C ${NODEJS_UNTAR}/ --strip-components=1
rm ${NODEJS_UNTAR}/{LICENSE,CHANGELOG.md,README.md}
sudo rsync -a "${NODEJS_UNTAR}/" "$node_install_path/"
# --strip-components isn't portable, switch to portable version by performing move step after untar
tar xf ${NODEJS_LOCAL} -C ${NODEJS_UNTAR}/ #--strip-components=1
mv ${NODEJS_UNTAR}/${NODEJS_NAME}-${NODEJS_VER}-linux-${ARCH}/* ${NODEJS_UNTAR}/
rm -rf ${NODEJS_UNTAR}/${NODEJS_NAME}-${NODEJS_VER}-linux-${ARCH} # clean up the temporary unzip folder
rm ${NODEJS_UNTAR}/{LICENSE,CHANGELOG.md,README.md}
$sudo_cmd rsync -av "${NODEJS_UNTAR}/" "$node_install_path/"
rm -rf "${NODEJS_UNTAR}"
sudo chown -R $(whoami) "$node_install_path/lib/node_modules/"
sudo chown $(whoami) ""$node_install_path"/bin/"
fi
$sudo_cmd chown -R $(whoami) "$node_install_path/lib/node_modules/"
$sudo_cmd chown $(whoami) ""$node_install_path"/bin/"
fi