Compare commits

..

11 Commits
v1.2 ... 1.2

Author SHA1 Message Date
openoms
858648fc48 add Nvidia Jetson Nano image link 2019-06-12 19:07:31 +01:00
openoms
f281489a36 mklabel msdos if there is no partition 2019-06-12 18:46:09 +01:00
bluecell296
cc7094d2a0 Merge pull request #50 from bavarianledger/patch-1
added "special prepare when Nvidia Jetson Nano"
2019-06-08 18:33:01 +02:00
bavarianledger
53b73ea62e Merge pull request #4 from bavarianledger/patch-1.1
Introduce a variable to identify the Nvidia
2019-06-07 11:04:44 +02:00
bavarianledger
8f37c51b81 Introduce a variable to identify the Nvidia
based on a suggestion from @openoms
2019-06-07 11:02:50 +02:00
openoms
e7cbe6175e add check for python-dev 2019-05-30 13:46:20 +01:00
openoms
d556a8e36b add ubuntu bionic repo to sources.list 2019-05-29 19:30:44 +01:00
openoms
e0d9f349fc make stresstest exit 0 if not on Raspbian 2019-05-29 15:52:13 +01:00
openoms
422427d726 let bootstarp finish on every system 2019-05-29 15:50:37 +01:00
openoms
ab5b7eae06 fix python-grpc permissions 2019-05-29 00:06:51 +01:00
bavarianledger
4b47a9eef6 added "special prepare when Nvidia Jetson Nano"
Disables GUI/X11 login to make sure that you can login after rebooting.
2019-05-19 16:25:47 +02:00
17 changed files with 71 additions and 391 deletions

2
FAQ.md
View File

@@ -374,7 +374,7 @@ You dont need a LAN port on your laptop as long as you can connect over WLAN to
## Is it possible to connect the Blitz over Wifi instead of using a LAN cable?
A LAN cable is recommended because it reduces a possible source of error on the network connection side. But how to setup WLAN when you dont have a LAN-Router/Switch available see here:
https://stadicus.github.io/RaspiBolt/raspibolt_20_pi.html#prepare-wifi
https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#prepare-wifi
## Can I directly connect the RaspiBlitz with my laptop?

View File

@@ -63,7 +63,6 @@ The cheapest way is to buy ans assemble the single parts yourself. These are the
* [China](shoppinglist_cn.md)
* [Australia](shoppinglist_au.md)
* [Czech](shoppinglist_cz.md)
* [Italy](shoppinglist_it.md)
*You can even pay your RaspiBlitz Amazon Shopping with Bitcoin & Lightning thru [Bitrefill](https://blog.bitrefill.com/its-here-buy-amazon-vouchers-with-bitcoin-on-bitrefill-bb2a4449724a).*
@@ -127,8 +126,6 @@ Now open up a terminal ([OSX](https://www.youtube.com/watch?v=5XgBd6rjuDQ)/[Win1
## Support
Get get help on RaspiBlitz setup and to exchange on how to best manage/run your node - try the community managed telegram group: https://t.me/raspiblitz
If you run into a problem or you have still a question, follow the steps below to get support. Also check the [setup documentation](#setup-process-detailed-documentation) for details.
1. Lookup the [FAQ](FAQ.md) if you can find an answere to this question/problem.
@@ -455,8 +452,6 @@ The RTL Webinterface is a LND Control Dashboard you can run in your browser with
![RTL](pictures/RTL-dashboard.png)
Read an Intro-Tutorial to RTL: https://medium.com/@suheb.khan/how-to-ride-the-lightning-447af999dcd2
Feedback is welcome by the RTL programmer: https://github.com/ShahanaFarooqui/RTL
##### LND Auto-Unlock
@@ -488,8 +483,6 @@ and [Zeus (iOS/Android)](https://github.com/ZeusLN/zeus) are available.
Please keep in mind that if you also want to connect to your smartphone also from the outside (when you are outside of your local network) with your RaspiBlitz you might need to open/forward ports on your router and should look into the DynamicDNS features to handle changeing IP of our Home-DSL.
This youtube video explains the "port forwarding" on your router in more detail: https://www.youtube.com/watch?v=KESo7hHXQtg
* [How do I shrink the QR code for connecting my Shango/Zap/Zeus mobile phone?](FAQ.md#how-do-i-shrink-the-qr-code-for-connecting-my-shangozap-mobile-phone)
#### EXPORT: Macaroons and TLS.cert

View File

@@ -135,7 +135,7 @@ Basically you follow the assemble instructions on the RaspiBlitz GuitHUb README.
## Prepare HDDs with Blockchain Data
This is the most time consuming part of the preparation. Try it once to get a feel for how much time you need to prepare one HDD. If you prepare more then one HDD check out the "Copystation" script below.
This is the most time consuming part of the preparation. Try it once to get a feel for how much time you need to prepare one HDD.
A prepared HDD is formatted in EXT4 and named "BLOCKCHAIN". In folder called `bitcoin` it contains a copy of the following data folders from a running Bitcoin core client (same version on RaspiBlitz).
@@ -161,20 +161,6 @@ Once you have that "template" you can make a image from that and write that imag
## Prepare Blockchain Copy Station
In the RaspiBlitz Github repo and also on every RaspiBlitz (since v1.3) you can find the script:
`/home/admin/CCcopyStation.sh`
This can be used to prepare and keep multiple HDDs in snyc with blockchain data in preparation of a workshop. You can start it directly on a RaspiBlitz and turn it into "Copy Station Mode" with executing on the command line:
`sudo /home/admin/CCcopyStation.sh`
*Beware that it will not run as a Lightning Node during that time (LND is stopped). And to reset it back into normal mode you need to stop the script with `CTLR+c` and the reboot with `sudo shutdown -r now`.*
In "COpy Station Mode" the RaspiBlitz will just run the bitcoind (so it needs network connection), copy fresh blockchain data over to a template folder on the HDD called `/mnt/hdd/templateHDD` and from there syncs it to further HDDs that get connected to it.
If you run it in a setup lke on this photo with an extra powered USB hub, you can connect up to 10 HDDs at once to be synced with an almost up-to-date blockchain.
At the moment the "Blockchain Copy Station" is just a computer (laptop - not a RaspberryPi) having a image of a "template" HDD (see above) and you can attach (with a USB3.0 Hub) multiple fresh HHDs to it and start writing in the template image to that.
To update the "template" HDD for the next workshop use it for a fresh clean RaspiBllitz setup just days before, sync the blockchain to 100% and repeat the process above.

View File

@@ -18,7 +18,7 @@ Specifications of the tested hardware: [hw_comparison.md](hw_comparison.md)
All testers are welcome. Open an issue for your specific board to collaborate and share your experience.
---
## Armbian
## Armbian Stretch
Many SBC-s are supported:
https://www.armbian.com/download/
@@ -40,12 +40,13 @@ Continue with building the SDcard: https://github.com/rootzoll/raspiblitz#build-
---
## Ubuntu
## Ubuntu Bionic
A common distro to be supplied by the manufacturer for various boards.
Tested on:
* Odroid XU4 with ubuntu-18.04.1-4.14-minimal image from https://de.eu.odroid.in/ubuntu_18.04lts/XU3_XU4_MC1_HC1_HC2
* Nvidia Jetson Nano with Ubuntu Bionic image from https://developer.nvidia.com/embedded/learn/get-started-jetson-nano-devkit#write
Burn the image to the SDCard with [Etcher](https://www.balena.io/etcher/).

View File

@@ -62,6 +62,7 @@ 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')
isNvidia=$(uname -a | grep -c 'tegra')
if [ ${isRaspbian} -gt 0 ]; then
baseImage="raspbian"
fi
@@ -148,6 +149,12 @@ if [ "${baseImage}" = "ubuntu" ] || [ "${baseImage}" = "armbian" ]; then
sudo adduser pi sudo
fi
# special prepare when Nvidia Jetson Nano
if [ ${isNvidia} -eq 1 ] ; then
# disable GUI on boot
sudo systemctl set-default multi-user.target
fi
echo ""
echo "*** CONFIG ***"
# based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#raspi-config
@@ -278,6 +285,7 @@ sudo -H pip3 install redis
# check for dependencies on DietPi, Ubuntu, Armbian
sudo apt-get install -y build-essential
sudo apt-get install -y python-pip
sudo apt-get install -y python-dev
# rsync is needed to copy from HDD
sudo apt install -y rsync
# install ifconfig
@@ -293,6 +301,7 @@ sudo apt install -y openssh-client
sudo apt install -y openssh-sftp-server
# install killall, fuser
sudo apt-get install -y psmisc
sudo apt-get clean
sudo apt-get -y autoremove
@@ -569,7 +578,8 @@ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.5 2
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1
echo "to switch between python2/3: sudo update-alternatives --config python"
sudo apt-get -f -y install virtualenv
sudo -u admin bash -c "cd; sudo virtualenv python-env-lnd; source /home/admin/python-env-lnd/bin/activate; sudo pip install grpcio grpcio-tools googleapis-common-protos pathlib2"
sudo chown -R admin /home/admin
sudo -u admin bash -c "cd; virtualenv python-env-lnd; source /home/admin/python-env-lnd/bin/activate; pip install grpcio grpcio-tools googleapis-common-protos pathlib2"
echo ""
# "*** Installing Go ***"

View File

@@ -308,7 +308,7 @@ ${color_yellow} ${color_amber}%s ${color_green} ${ln_alias}
${color_yellow} ${color_gray}${network} Fullnode + Lightning Network ${torInfo}
${color_yellow} ,/ ${color_yellow}%s
${color_yellow} ,'/ ${color_gray}%s, temp %s°C %s°F
${color_yellow} ,' / ${color_gray}Free Mem ${color_ram}${ram} ${color_gray} Free HDD ${color_hdd}%s${color_gray}
${color_yellow} ,' / ${color_gray}Free Mem ${color_ram}${ram} ${color_gray} Free HDD ${color_hdd}%s
${color_yellow} ,' /_____, ${color_gray}ssh admin@${color_green}${local_ip}${color_gray}${network_rx}${network_tx}
${color_yellow} .'____ ,' ${color_gray}${webinterfaceInfo}
${color_yellow} / ,' ${color_gray}${network} ${color_green}${networkVersion} ${chain}net ${color_gray}Sync ${sync_color}${sync} %s${torrentBaseStatus}${torrentUpdateStatus}

View File

@@ -53,12 +53,16 @@ while :
fi
# get config info if already available
source ${infoFile}
configExists=$(ls ${configFile} 2>/dev/null | grep -c '.conf')
if [ ${configExists} -eq 1 ]; then
source ${configFile}
fi
# if setup not marked as done (=100) load boostrap info file
if [ "${setupStep}" != "100" ]; then
source ${infoFile}
fi
# if no information available from files - set default
if [ ${#setupStep} -eq 0 ]; then
setupStep=0
@@ -83,7 +87,8 @@ while :
# when in presync - get more info on progress
elif [ "${state}" = "presync" ]; then
blockchaininfo="$(sudo -u root bitcoin-cli --conf=/home/admin/assets/bitcoin.conf getblockchaininfo 2>/dev/null)"
# get blockchain sync progress
blockchaininfo="$(sudo -u root ${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo 2>/dev/null)"
message="starting"
if [ ${#blockchaininfo} -gt 0 ]; then
message="$(echo "${blockchaininfo}" | jq -r '.verificationprogress')"
@@ -193,14 +198,6 @@ while :
continue
fi
if [ "${state}" = "copystation" ]; then
l1="COPY STATION MODE\n"
l2="${message}"
dialog --backtitle "RaspiBlitz ${codeVersion} ${localip}" --infobox "$l1$l2" 6 56
sleep 2
continue
fi
# if LND is syncing or scanning
lndSynced=$(sudo -u bitcoin /usr/local/bin/lncli --chain=${network} --network=${chain}net getinfo 2>/dev/null | jq -r '.synced_to_chain' | grep -c true)
if [ ${lndSynced} -eq 0 ]; then

View File

@@ -20,6 +20,7 @@ if [ ${hddExists} -eq 0 ]; then
echo "Press ENTER to create a Partition - or CTRL+C to abort"
read key
echo "Creating Partition ..."
sudo parted -s /dev/sda mklabel msdos
sudo parted -s /dev/sda unit s mkpart primary `sudo parted /dev/sda unit s print free | grep 'Free Space' | tail -n 1`
echo "DONE."
sleep 3
@@ -75,14 +76,6 @@ if [ "${state}" = "retorrent" ]; then
exit
fi
# singal that copstation is running
if [ "${state}" = "copystation" ]; then
echo "Copy Station is Runnning ..."
echo "reboot to return to normal"
sudo /home/admin/XXcopyStation.sh
exit
fi
# if pre-sync is running - stop it - before continue
if [ "${state}" = "presync" ]; then
# stopping the pre-sync

View File

@@ -56,8 +56,6 @@ if [ ${existsHDD} -eq 1 ]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "You HDD was detected with the size of ${isSize} bytes"
echo "For ${network} at least ${minSize} bytes is recommended"
echo "If you know the HDD is bigger then detected, please"
echo "change HDD to 1 partition on another computer first,"
echo "If you want to change to a bigger HDD:"
echo "* Unplug power of RaspiBlitz"
echo "* Make a fresh SD card again"

View File

@@ -30,6 +30,5 @@ while :
echo ""
echo "network(${network}) chain(${chain})"
sudo tail -n 1 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log
echo "Wallet still locked - please try again or"
echo "Cancel with CTRL+C - back to setup with command: raspiblitz"
echo "Wallet still locked - please try again or Cancel with CTRL+C"
done

View File

@@ -1,323 +0,0 @@
#!/bin/bash
# command info
if [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo "# Turns the RaspiBlitz into HDD CopyStation Mode"
echo "# lightning is deactivated during CopyStationMode"
echo "# reboot RaspiBlitz to set back to normal mode"
exit 1
fi
####### CONFIG #############
# where to find the BITCOIN data directory (no trailing /)
pathBitcoinBlockchain="/mnt/hdd/bitcoin"
# where to find the LITECOIN data directory (no trailing /)
pathLitecoinBlockchain="/mnt/hdd/litecoin"
# where to find the RaspiBlitz HDD template directory (no trailing /)
pathTemplateHDD="/mnt/hdd/templateHDD"
# 0 = ask before formatting/init new HDD
# 1 = auto-formatting every new HDD that needs init
nointeraction=1
# override values if XXcopyStation.conf files exists
# use when you run this outside RaspiBlitz
# - clean Ubuntu install
# - install bitcoind as systemd service
# - disable automount: https://askubuntu.com/questions/89244/how-to-disable-automount-in-nautiluss-preferences#102601
# - clone the github to get script (or download)
# - set your pathes bitcoin/template in conf file
source ./XXcopyStation.conf 2>/dev/null
# -- start script with parameter "-foreground"
####### SCRIPT #############
# check sudo
if [ "$EUID" -ne 0 ]; then
echo "Please run as root (with sudo)"
exit 1
fi
# make sure that its running in screen
# call with '-foreground' to prevent running in screen
if [ "$1" != "-foreground" ]; then
screenPID=$(screen -ls | grep "copystation" | cut -d "." -f1 | xargs)
if [ ${#screenPID} -eq 0 ]; then
# start copystation in sreen
echo "starting copystation screen session"
screen -S copystation -dm /home/admin/XXcopyStation.sh -foreground
screen -d -r
exit 0
else
echo "changing into running copystation screen session"
screen -d -r
exit 0
fi
fi
clear
echo "******************************"
echo "RASPIBLITZ COPYSTATION SCRIPT"
echo "******************************"
echo
echo "*** CHECKING CONFIG"
# check that path information is valid
if [ -d "$pathBitcoinBlockchain" ]; then
echo "OK found $pathBitcoinBlockchain"
else
echo "FAIL path of 'pathBitcoinBlockchain' does not exists: ${pathBitcoinBlockchain}"
exit 1
fi
# check that path information is valid
if [ -d "$pathTemplateHDD" ]; then
echo "OK found $pathTemplateHDD"
else
echo "Creating: ${pathTemplateHDD}"
mkdir ${pathTemplateHDD}
chmod 777 ${pathTemplateHDD}
fi
# make sure that lnd is stopped (if runnning)
systemctl stop lnd 2>/dev/null
systemctl stop background 2>/dev/null
if [ "${nointeraction}" == "1" ]; then
echo "setting RaspiBlitz LCD info"
sudo sed -i "s/^state=.*/state=copystation/g" /home/admin/raspiblitz.info 2>/dev/null
sudo sed -i "s/^message=.*/message='Disconnect target HDDs!'/g" /home/admin/raspiblitz.info 2>/dev/null
echo "Disconnect target HDDs! .. 30ses until continue."
sleep 30
else
echo
echo "*** INIT HDD SCAN"
echo "Please make sure that no HDDs that you want to sync later to are not connected now."
echo "PRESS ENTER when ready."
read key
fi
# finding system drives (the drives that should not be synced to)
systemDrives=$(lsblk -o NAME | grep "^sd")
echo "OK - the following drives detected as system drives:"
echo "$systemDrives"
echo
if [ "${nointeraction}" == "1" ]; then
sudo sed -i "s/^message=.*/message='Connect now target HDDs ..'/g" /home/admin/raspiblitz.info 2>/dev/null
sleep 5
fi
# BASIC IDEA:
# 1. get fresh data from bitcoind --> template data
# 2. detect HDDs
# 3. sync HDDs with template data
# repeat
echo
echo "*** RUNNING ***"
lastBlockchainUpdateTimestamp=1
while :
do
################################################
# 1. get fresh data from bitcoind for template data
# only execute every 30min
nowTimestamp=$(date +%s)
secondsDiff=$(echo "${nowTimestamp}-${lastBlockchainUpdateTimestamp}" | bc)
echo "seconds since last update from bitcoind: ${secondsDiff}"
echo
if [ ${secondsDiff} -gt 3000 ]; then
echo "******************************"
echo "Bitcoin Blockchain Update"
echo "******************************"
# stop blockchains
echo "Stopping Blockchain ..."
systemctl stop bitcoind 2>/dev/null
systemctl stop litecoind 2>/dev/null
sleep 10
# sync bitcoin
echo "Syncing Bitcoin ..."
sudo sed -i "s/^message=.*/message='Updating Template: Bitcoin'/g" /home/admin/raspiblitz.info 2>/dev/null
# make sure the bitcoin directory in template folder exists
if [ ! -d "$pathTemplateHDD/bitcoin" ]; then
echo "creating the bitcoin subfolder in the template folder"
mkdir ${pathTemplateHDD}/bitcoin
chmod 777 ${pathTemplateHDD}/bitcoin
fi
rsync -a --info=progress2 ${pathBitcoinBlockchain}/chainstate ${pathBitcoinBlockchain}/indexes ${pathBitcoinBlockchain}/blocks ${pathBitcoinBlockchain}/testnet3 ${pathTemplateHDD}/bitcoin
if [ -d "${pathLitecoinBlockchain}" ]; then
# sync litecoin
echo "Syncing Litecoin ..."
echo "creating the litecoin subfolder in the template folder"
mkdir ${pathTemplateHDD}/litecoin 2>/dev/null
chmod 777 ${pathTemplateHDD}/litecoin 2>/dev/null
sudo sed -i "s/^message=.*/message='Updating Template: Litecoin'/g" /home/admin/raspiblitz.info 2>/dev/null
rsync -a --info=progress2 ${pathLitecoinBlockchain}/chainstate ${pathLitecoinBlockchain}/indexes ${pathLitecoinBlockchain}/blocks ${pathTemplateHDD}/litecoin
fi
# restart bitcoind (to let further setup while syncing HDDs)
echo "Restarting Blockchain ..."
systemctl start bitcoind 2>/dev/null
systemctl start litecoind 2>/dev/null
# update timer
lastBlockchainUpdateTimestamp=$(date +%s)
fi
################################################
# 2. detect connected HDDs and loop thru them
sleep 4
echo "" > ./.syncinfo.tmp
lsblk -o NAME | grep "^sd" | while read -r detectedDrive ; do
isSystemDrive=$(echo "${systemDrives}" | grep -c "${detectedDrive}")
if [ ${isSystemDrive} -eq 0 ]; then
# check if drives 1st partition is named BLOCKCHAIN & in EXT4 format
isNamedBlockchain=$(lsblk -o NAME,FSTYPE,LABEL | grep "${detectedDrive}" | grep -c "BLOCKCHAIN")
isFormatExt4=$(lsblk -o NAME,FSTYPE,LABEL | grep "${detectedDrive}" | grep -c "ext4")
# init a fresh device
if [ ${isNamedBlockchain} -eq 0 ] || [ ${isFormatExt4} -eq 0 ]; then
echo "*** NEW EMPTY HDD FOUND ***"
echo "Device: ${detectedDrive}"
echo "isNamedBlockchain: ${isNamedBlockchain}"
echo "isFormatExt4:" ${isFormatExt4}
# check if size is OK
size=$(lsblk -o NAME,SIZE -b | grep "^${detectedDrive}" | awk '$1=$1' | cut -d " " -f 2)
echo "size: ${size}"
if [ ${size} -lt 250000000000 ]; then
read key
whiptail --title "FAIL" --msgbox "
THE DEVICE IS TOO SMALL <250GB
Please remove device and PRESS ENTER
" 9 46
else
# find biggest partition
biggestSize=0
lsblk -o NAME,SIZE -b | grep "${detectedDrive}" | while read -r partitionLine ; do
partition=$(echo "${partitionLine}" | cut -d ' ' -f 1 | tr -cd "[:alnum:]")
size=$(echo "${partitionLine}" | tr -cd "[0-9]")
if [ ${size} -gt ${biggestSize} ]; then
formatPartition="${partition}"
biggestSize=$size
fi
echo "${formatPartition}" > .formatPartition.tmp
done
formatPartition=$(cat .formatPartition.tmp)
rm .formatPartition.tmp
if [ ${#formatPartition} -eq 0 ]; then
whiptail --title "FAIL" --msgbox "
NO PARTITIONS FOUND ON THAT DEVICE
Format on external computer with FAT32 first.
Please remove device now.
" 10 46
else
# if config value "nointeraction=1" default to format
if [ "${nointeraction}" != "1" ]; then
whiptail --title "Format HDD" --yes-button "Format" --no-button "Cancel" --yesno "
Found new HDD. Do you want to FORMAT now?
Please temp lable device with: ${formatPartition}
" 10 54
choice=$?
else
choice=0
sudo sed -i "s/^message=.*/message='Formatting new HDD: ${formatPartition}'/g" /home/admin/raspiblitz.info 2>/dev/null
fi
# on cancel
if [ "${choice}" != "0" ]; then
whiptail --title "Format HDD" --msgbox "
OK NO FORMAT - Please remove decive now.
" 8 46
exit 1
fi
# format the HDD
echo "Starting Formatting of device ..."
sudo mkfs.ext4 /dev/${formatPartition} -F -L BLOCKCHAIN
fi
fi
fi # end init new HDD
################################################
# 3. sync HDD with template data
partition=$(lsblk -o NAME,FSTYPE,LABEL | grep "${detectedDrive}" | grep "BLOCKCHAIN" | cut -d ' ' -f 1 | tr -cd "[:alnum:]")
if [ ${#partition} -gt 0 ]; then
# temp mount device
echo "mounting: ${partition}"
mkdir /mnt/hdd2 2>/dev/null
sudo mount -t ext4 /dev/${partition} /mnt/hdd2
# rsync device
mountOK=$(lsblk -o NAME,MOUNTPOINT | grep "${detectedDrive}" | grep -c "/mnt/hdd2")
if [ ${mountOK} -eq 1 ]; then
if [ "${nointeraction}" == "1" ]; then
sudo sed -i "s/^message=.*/message='Syncing from Template: ${partition}'/g" /home/admin/raspiblitz.info 2>/dev/null
fi
rsync -a --info=progress2 ${pathTemplateHDD}/* /mnt/hdd2
chmod -r 777 /mnt/hdd2
rm -r /mnt/hdd2/lost+found 2>/dev/null
echo "${partition} " >> ./.syncinfo.tmp
else
echo "FAIL: was not able to mount --> ${partition}"
fi
# unmount device
sudo umount -l /mnt/hdd2
fi
fi
done
clear
echo "**** SYNC LOOP DONE ****"
synced=$(cat ./.syncinfo.tmp | tr '\r\n' ' ')
echo "HDDs ready synced: ${synced}"
echo "*************************"
echo "Its safe to disconnect/remove HDDs now."
echo "To stop copystation script: CTRL+c"
echo ""
sudo sed -i "s/^message=.*/message='Ready HDDs: ${synced}'/g" /home/admin/raspiblitz.info 2>/dev/null
sleep 25
clear
echo "starting new sync loop"
sleep 5
done

View File

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

View File

@@ -105,7 +105,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
# mount the BTRFS drive
echo "Mounting under /mnt/data ..."
sudo mkdir -p /mnt/data
sudo mount barrier=1 /dev/${dev1} /mnt/data
sudo mount /dev/${dev1} /mnt/data
echo "OK"
echo ""

View File

@@ -7,6 +7,12 @@ if [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
exit 1
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
# sysbench manual: http://imysql.com/wp-content/uploads/2014/10/sysbench-manual.pdf

View File

@@ -12,6 +12,33 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
exit 1
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
prepareTorSources()
{
@@ -29,8 +56,13 @@ prepareTorSources()
echo ""
echo "*** Adding Tor Sources to 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
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-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 ""
}

View File

@@ -5,10 +5,8 @@ See the reference [German Shoppinglist](shoppinglist_de.md) for all the latest p
- RaspBerry Pi 3: https://www.alza.cz/raspberry-pi-3-model-b-d5284636.htm?o=1
- Micro SD-Card 32GB: https://www.alza.cz/EN/samsung-microsdhc-32gb-pro-endurance-uhs-i-u1-sd-adapter-d5339757.htm
- Power: https://www.alza.cz/EN/raspberry-pi-2-5a-d4191252.htm
- Power: https://www.alza.cz/EN/alzapower-q100-quick-charge-3-0-black-d5324257.htm?o=2
- maybe you need an micro usb cable
- 1TB Hard Drive: https://www.czc.cz/toshiba-canvio-basics-1tb-cerna/235949/produkt?gclid=EAIaIQobChMIgpLF5Mac3gIVCM53Ch3D9QWpEAQYAyABEgK-ZfD_BwE
- Case: https://www.alza.cz/EN/raspberry-pi-black-d3837597.htm?o=1
- LCD-Display (delivered to Czech Republic): https://www.amazon.com/dp/B01N3JROH8/ref=cm_sw_r_cp_ep_dp_-gOuBb2Q6T0C5
*The Power Supply was tested by one user - if it shows sonstant power issues on your hardware and aou find a better more stable one, please make a PullRequest. Thx.*

View File

@@ -1,10 +0,0 @@
## Shopping List: Amazon Italy
* RaspBerry Pi 3: https://www.amazon.it/dp/B07BDR5PDW/
* Micro SD-Card 32GB: https://www.amazon.it/dp/B07CY3QSST
* Power: https://www.amazon.it/dp/B01566WOAG
* 1TB Hard Drive: https://www.amazon.it/dp/B07997KKSK
* Heatsink-Case: https://www.amazon.it/dp/B07KYCNF1D
* LCD-Display: https://www.amazon.it/dp/B06ZZBL1C4
*The listed Power Supply showed on testing sometimes some udervoltages - if you find a better Power Supply (like on the german shopping list) on the italian Amazon, please send a PullRequest to improve this shoppingl list. Thx.*