Browse Source

Merge pull request #634 from openoms/x86v1.2

bug fixes for alternative platforms
master
Christian Rotzoll 6 years ago
committed by GitHub
parent
commit
6663ea7c45
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      build_sdcard.sh
  2. 2
      home.admin/_bootstrap.sh
  3. 6
      home.admin/config.scripts/blitz.stresstest.sh
  4. 32
      home.admin/config.scripts/internet.tor.sh

2
build_sdcard.sh

@ -278,6 +278,7 @@ sudo -H pip3 install redis
# check for dependencies on DietPi, Ubuntu, Armbian # check for dependencies on DietPi, Ubuntu, Armbian
sudo apt-get install -y build-essential sudo apt-get install -y build-essential
sudo apt-get install -y python-pip sudo apt-get install -y python-pip
sudo apt-get install -y python-dev
# rsync is needed to copy from HDD # rsync is needed to copy from HDD
sudo apt install -y rsync sudo apt install -y rsync
# install ifconfig # install ifconfig
@ -293,6 +294,7 @@ sudo apt install -y openssh-client
sudo apt install -y openssh-sftp-server sudo apt install -y openssh-sftp-server
# install killall, fuser # install killall, fuser
sudo apt-get install -y psmisc sudo apt-get install -y psmisc
sudo apt-get clean sudo apt-get clean
sudo apt-get -y autoremove sudo apt-get -y autoremove

2
home.admin/_bootstrap.sh

@ -506,7 +506,7 @@ if [ "${baseImage}" = "raspbian" ] ; then
sed -i "s/^state=.*/state=stresstest/g" ${infoFile} sed -i "s/^state=.*/state=stresstest/g" ${infoFile}
sed -i "s/^message=.*/message='Testing Hardware 60s'/g" ${infoFile} sed -i "s/^message=.*/message='Testing Hardware 60s'/g" ${infoFile}
sudo /home/admin/config.scripts/blitz.stresstest.sh /home/admin/stresstest.report sudo /home/admin/config.scripts/blitz.stresstest.sh /home/admin/stresstest.report
fi
echo "DONE BOOTSTRAP" >> $logFile echo "DONE BOOTSTRAP" >> $logFile
exit 0 exit 0
fi

6
home.admin/config.scripts/blitz.stresstest.sh

@ -7,6 +7,12 @@ if [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
exit 1 exit 1
fi fi
isRaspbian=$(cat /etc/os-release 2>/dev/null | grep -c 'Raspbian')
if [ ${isRaspbian} -eq 0 ]; then
echo "the OS is not Raspbian - the stresstest is only for the Raspberry Pi"
exit 0
fi
# Based on https://github.com/bamarni/pi64/issues/4#issuecomment-292707581 # Based on https://github.com/bamarni/pi64/issues/4#issuecomment-292707581
# sysbench manual: http://imysql.com/wp-content/uploads/2014/10/sysbench-manual.pdf # sysbench manual: http://imysql.com/wp-content/uploads/2014/10/sysbench-manual.pdf

32
home.admin/config.scripts/internet.tor.sh

@ -12,6 +12,33 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
exit 1 exit 1
fi fi
echo "Detect Base Image ..."
baseImage="?"
isDietPi=$(uname -n | grep -c 'DietPi')
isRaspbian=$(cat /etc/os-release 2>/dev/null | grep -c 'Raspbian')
isArmbian=$(cat /etc/os-release 2>/dev/null | grep -c 'Debian')
isUbuntu=$(cat /etc/os-release 2>/dev/null | grep -c 'Ubuntu')
if [ ${isRaspbian} -gt 0 ]; then
baseImage="raspbian"
fi
if [ ${isArmbian} -gt 0 ]; then
baseImage="armbian"
fi
if [ ${isUbuntu} -gt 0 ]; then
baseImage="ubuntu"
fi
if [ ${isDietPi} -gt 0 ]; then
baseImage="dietpi"
fi
if [ "${baseImage}" = "?" ]; then
cat /etc/os-release 2>/dev/null
echo "!!! FAIL !!!"
echo "Base Image cannot be detected or is not supported."
exit 1
else
echo "OK running ${baseImage}"
fi
# function: install keys & sources # function: install keys & sources
prepareTorSources() prepareTorSources()
{ {
@ -29,8 +56,13 @@ prepareTorSources()
echo "" echo ""
echo "*** Adding Tor Sources to sources.list ***" echo "*** Adding Tor Sources to sources.list ***"
if [ "${baseImage}" = "raspbian" ] || [ "${baseImage}" = "armbian" ] || [ "${baseImage}" = "dietpi" ]; then
echo "deb https://deb.torproject.org/torproject.org stretch main" | sudo tee -a /etc/apt/sources.list echo "deb https://deb.torproject.org/torproject.org stretch main" | sudo tee -a /etc/apt/sources.list
echo "deb-src https://deb.torproject.org/torproject.org stretch main" | sudo tee -a /etc/apt/sources.list echo "deb-src https://deb.torproject.org/torproject.org stretch main" | sudo tee -a /etc/apt/sources.list
elif [ "${baseImage}" = "ubuntu" ]; then
echo "deb https://deb.torproject.org/torproject.org bionic main" | sudo tee -a /etc/apt/sources.list
echo "deb-src https://deb.torproject.org/torproject.org bionic main" | sudo tee -a /etc/apt/sources.list
fi
echo "OK" echo "OK"
echo "" echo ""
} }

Loading…
Cancel
Save