Skip to content

Commit

Permalink
Merge pull request #147 from km4ack/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
km4ack authored Sep 24, 2020
2 parents 5b5dc65 + ffe5f5f commit 9061ac1
Show file tree
Hide file tree
Showing 18 changed files with 550 additions and 257 deletions.
2 changes: 1 addition & 1 deletion .complete
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

MYPATH=$HOME/pi-build
MYPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
LOGO=$MYPATH/logo.png

cat <<EOF > $MYPATH/boot.txt
Expand Down
2 changes: 1 addition & 1 deletion .funfacts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#20200515 km4ack

MYPATH=$HOME/pi-build
MYPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
LOGO=$MYPATH/logo.png


Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.vscode/
config
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,17 @@ Winlink Password & Grid Square
# Install
This script is intended to run on a brand new installation of Buster. It should not be run on a pi that you have already started installing applications on. Install additional apps that you require after running this script.\
\
Flash a fresh copy of Buster to a SD card and run the following command
Get Debian Buster from https://cdimage.debian.org/debian-cd/current/arm64/iso-cd/ file debian-10.4.0-arm64-xfce-CD-1.iso
NOTE: The Debian Buster arm64 image does not come with RealVNC server pre-installed, as it does with Raspbian. The reason is that RealVNC package is currently compiled for the armhf version of libbcm_host.so, which is a hook into the Broadcom GPU chip. As of 2020-06-27, it is not yet possible to get Debian Buster ARM64 to work with VNC.

git clone https://github.com/km4ack/pi-build.git $HOME/pi-build && bash $HOME/pi-build/build-a-pi
If this is a problem for you, then you will need to download Raspberry Pi OS (previously called Rasbian) 32-bit from https://downloads.raspberrypi.org/raspios_armhf_latest

Use a USB flash application such as Balena Etcher to copy the iso file to a USB key, get it at https://www.balena.io/etcher/

Power up your Raspberry Pi, login, and in your home directory, run the following command

git clone https://github.com/km4ack/pi-build.git \
$HOME/pi-build && bash $HOME/pi-build/build-a-pi
# Video
[![IMAGE ALT TEXT](https://img.youtube.com/vi/l4M9VVqGxoc/0.jpg)](https://youtu.be/l4M9VVqGxoc "Build a Pi")
Expand All @@ -44,6 +52,10 @@ Software for DS3231 real time clock (Available through update script after initi
#### HOTSPOT:
Hotspot is used to generate a wifi hotspot that you can connect to with other wireless devices. This is useful when in the field so you can connect to and contol the pi from a wireless device.

If enabled, the hotspot will only activate IF the Pi is not connected to a wireless network. The hotspot will either activate at bootup, OR a maximum of 5 minutes AFTER you have forcefully disconnected from a wireless network. You can tune that detection delay in the settings.
The hotspot default SSID is *RpiHotspot* and the default IP address of the Pi is 10.10.10.10.
Make sure to enable either VNC or SSH server in order to remotely connect to your Pi at that address.

#### Hotspot Tools:
Hotspot tools is a collection of tools designed to make managing the hotspot easier through a GUI interface. https://youtu.be/O_eihSN_ES8

Expand Down Expand Up @@ -144,4 +156,4 @@ Calculate lengths needed for dipole legs
Graphic viewer to view/manage log files

#### Gparted
Disk utility
Disk utility
100 changes: 61 additions & 39 deletions build-a-pi
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@


DESK=$(printenv | grep DISPLAY)
MYPATH=$HOME/pi-build
MYPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
LOGO=$MYPATH/logo.png
RB=$( ls $HOME/.config | grep KM4ACK)
RB=$HOME/.config/KM4ACK
BASE=$MYPATH/base.txt
ADDITIONAL=$MYPATH/additional.txt
UTILITY=$MYPATH/utility.txt
Expand All @@ -25,7 +25,7 @@ FUNCTIONS=$MYPATH/functions
TEMPCRON=$MYPATH/cron.tmp
DIR=$MYPATH/temp
WHO=$(whoami)
VERSION=$(cat $MYPATH/changelog | grep version= | sed 's/version=//')
VERSION=$(grep "version=" $MYPATH/changelog | sed 's/version=//')

FINISH(){
if [ -f "$BASE" ]; then
Expand Down Expand Up @@ -71,11 +71,14 @@ sudo apt-get update
if ! hash jq 2>/dev/null; then
sudo apt install -y jq
fi
if ! hash bc>/dev/null; then
sudo apt install -y bc
fi

#####################################
# Check if run before
#####################################
if [ -n "$RB" ]; then
if [ -f "$RB" ]; then
bash $MYPATH/update &
exit
fi
Expand Down Expand Up @@ -139,17 +142,31 @@ CALL
CALL=$(echo $INFO | awk -F "|" '{print $1}')
CALL=${CALL^^}

echo "CALL=$CALL" > $CONFIG

#Verify call not empty
if [ -z "$CALL" ]; then
yad --form --width=420 --text-align=center --center --title="Build-a-Pi" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="<b>Call Can't be Blank</b>" \
--button=gtk-ok
CALL
fi
ATTEMPTS=0
while [ -z "$CALL" ];
do
if [ $ATTEMPTS -eq 3 ]
then
yad --form --width=420 --text-align=center --center --title="Build-a-Pi" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="<b>Empty callsign after 3 attempts. Quiting!</b>" \
--button=gtk-ok
exit
fi

yad --form --width=420 --text-align=center --center --title="Build-a-Pi" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="<b>Call Can't be Blank</b>" \
--button=gtk-ok

((ATTEMPTS=ATTEMPTS+1))
CALL
CALL=$(echo $INFO | awk -F "|" '{print $1}')
CALL=${CALL^^}
done

echo "CALL=$CALL" > $CONFIG

#####################################
# Base Apps
Expand Down Expand Up @@ -183,10 +200,8 @@ echo "$i" >> $BASE
done
fi

#############################################################
#check if hotspot is chosen for install & get info if needed#
#############################################################
HS=$(cat $BASE | grep HOTSPOT)
#check if hotspot is chosen for install & get info if needed
HS=$(grep "HOTSPOT" $BASE)
if [ -n "$HS" ]; then
HSINFO(){
#unblock wifi
Expand All @@ -195,7 +210,7 @@ sudo rfkill unblock all > /dev/null 2>&1
sudo ifconfig wlan0 up
#LIST=$(sudo iw dev "wlan0" scan ap-force | egrep "^BSS|SSID:" | grep SSID: | sed 's/SSID://' | awk '{ print $1 }')
#LIST=$(echo $LIST | sed 's/ /|/g')
LIST=$(sudo iw dev "wlan0" scan ap-force | egrep "^BSS|SSID:" | grep SSID: | sed 's/SSID://')
LIST=$(sudo iw dev "wlan0" scan ap-force | grep "SSID:" | awk '{print $2}')
LIST=$(echo "$LIST" | tr '\n' '|')


Expand Down Expand Up @@ -252,8 +267,7 @@ echo "HSPASS=\"$HSPASS\"" >> $CONFIG
###################################
GPSINSTALL=$(cat $BASE | grep GPS)
if [ -n "$GPSINSTALL" ]; then
USB=$(ls /dev/serial/by-id)
USB=$(echo $USB | sed "s/\s/|/g")


yad --center --height="300" --width="300" --form --separator="|" --item-separator="|" --title="GPS" \
--image $LOGO --window-icon=$LOGO --image-on-top \
Expand All @@ -265,7 +279,8 @@ BUT=$?
if [ $BUT = 1 ] || [ $BUT = 252 ]; then
exit
fi

USB=$(ls /dev/serial/by-id)
USB=$(echo $USB | sed "s/\s/|/g")

GPS=$(yad --center --height="600" --width="300" --form --separator="|" --item-separator="|" --title="GPS" \
--image $LOGO --window-icon=$LOGO --image-on-top \
Expand Down Expand Up @@ -326,8 +341,10 @@ false "PAT-MENU" "Control for Pat Winlink" \
false "JS8CALL" "Weak Signal Digital Mode Software" \
false "M0IAX" "Tools for JS8Call Messages" \
false "WSJTX" "Weak Signal Digital Mode Software" \
false "JTDX" "Weak Signal Digital Mode Software" \
false "PYQSO" "Logging Software" \
false "CQRLOG" "Logging Software" \
false "XLOG" "Logging Software" \
false "EES" "KM4ACK Emergency Email Server" \
false "QSSTV" "Slow Scan TV" \
false "GRIDTRACKER" "Track Grids in WSJTX" \
Expand All @@ -336,6 +353,7 @@ false "PROPAGATION" "Propagation Prediction Software" \
false "YAAC" "Yet Another APRS Client" \
false "XASTIR" "APRS Client" \
false "GPREDICT" "Satellite Tracking" \
false "TQSL" "LOTW Software" \
--button="Exit":1 \
--button="Check All and Continue":3 \
--button="Next":2 > $ADDITIONAL
Expand All @@ -346,7 +364,8 @@ fi

if [ $BUT = 3 ]; then
ADDAPPS=(CONKY PI-APRS CHIRP GARIM PAT PAT-MENU JS8CALL M0IAX WSJTX PYQSO \
CQRLOG EES QSSTV GRIDTRACKER HAMCLOCK PROPAGATION YAAC XASTIR GPREDICT)
CQRLOG EES QSSTV GRIDTRACKER HAMCLOCK PROPAGATION YAAC XASTIR GPREDICT TQSL \
XLOG JTDX)

for i in "${ADDAPPS[@]}"
do
Expand All @@ -355,7 +374,7 @@ done
fi

#check if hamclock is being installed
HCCHECK=$(cat $ADDITIONAL | grep HAMCLOCK)
HCCHECK=$(grep "HAMCLOCK" $ADDITIONAL)
if [ -n "$HCCHECK" ]; then

HC=$(yad --form --width=420 --text-align=center --center --title="Build-a-Pi" \
Expand All @@ -368,7 +387,7 @@ sed -i 's/HAMCLOCK//' $ADDITIONAL
echo $HC >> $ADDITIONAL
fi

PATCHECK=$(cat $ADDITIONAL | grep PAT)
PATCHECK=$(grep "PAT" $ADDITIONAL)
if [ -n "$PATCHECK" ]; then
INFO=$(yad --form --width=420 --text-align=center --center --title="Build-a-Pi" \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
Expand Down Expand Up @@ -396,6 +415,7 @@ false "CALLSIGN" "Call sign lookup" \
false "TEMPCONVERT" "Temperature Converter" \
false "GPARTED" "Disk Utility Tool" \
false "SHOWLOG" "Log file viewer" \
false "PISTATS" "Pi3/4 Stats Monitor" \
--button="Exit":1 \
--button="Check All and Continue":3 \
--button="Install Selected":2 > $UTILITY
Expand All @@ -405,7 +425,7 @@ exit
fi

if [ $BUT = 3 ]; then
UTILAPPS=(DIPOLE CALLSIGN TEMPCONVERT GPARTED SHOWLOG)
UTILAPPS=(DIPOLE CALLSIGN TEMPCONVERT GPARTED SHOWLOG PISTATS)
for i in "${UTILAPPS[@]}"
do
echo "$i" >> $UTILITY
Expand All @@ -421,7 +441,9 @@ sudo apt-get -y upgrade
sudo apt -y full-upgrade

#set wallpaper
pcmanfm --set-wallpaper $HOME/pi-build/bap-wallpaper.jpg
pcmanfm --set-wallpaper $MYPATH/bap-wallpaper.jpg

mkdir -p $DIR 2> /dev/null

#add virtual sound card link for pulse audio
cd $DIR
Expand Down Expand Up @@ -467,8 +489,8 @@ cat > build-a-pi.desktop <<EOF
Name=Build-a-Pi
GenericName=KM4ACK Build-a-Pi
Comment=Build-a-Pi App Manager
Exec=$HOME/pi-build/update
Icon=$HOME/pi-build/logo.png
Exec=$MYPATH/update
Icon=$MYPATH/logo.png
Terminal=true
Type=Application
Categories=Settings;DesktopSettings;GTK;X-LXDE-Settings;
Expand All @@ -479,9 +501,9 @@ sudo mv build-a-pi.desktop /usr/share/applications/
#####################################
# Install Base Apps
#####################################
touch $HOME/.config/KM4ACK
while read i ; do
touch $RB
source $FUNCTIONS/base.function
while read i ; do
$i
done < $BASE

Expand All @@ -491,37 +513,35 @@ done < $BASE
#####################################
source $FUNCTIONS/flsuite.function
#perform memory increase if needed
CHECKFL=$(cat $MYPATH/flsuite.txt)
if [ -n "$CHECKFL" ]; then
CHECKFL="$MYPATH/flsuite.txt"
if [ -s "$CHECKFL" ]; then
FLSTART
fi
touch $HOME/.config/KM4ACK
touch $RB
while read i ; do
source $FUNCTIONS/flsuite.function
$i
done < $FLSUITE

source $FUNCTIONS/flsuite.function
#Perform memory reset if needed
if [ -n "$CHECKFL" ]; then
if [ -s "$CHECKFL" ]; then
FLSTOP
fi


#####################################
# Install ADDITIONAL Apps
#####################################
while read i ; do
source $FUNCTIONS/additional.function
while read i ; do
$i
done < $ADDITIONAL


#####################################
# Install KM4ACK Utilites
#####################################
while read i ; do
source $FUNCTIONS/utility.function
while read i ; do
$i
done < $UTILITY

Expand All @@ -532,12 +552,14 @@ done < $UTILITY
#Remove temp files
rm $BASE $ADDITIONAL $UTILITY $FLSUITE > /dev/null 2>&1
rm -rf $DIR > /dev/null 2>&1
rm -rf $HOME/Downloads/* > /dev/null 2>&1
sudo apt -y autoremove > /dev/null 2>&1

#restore crontab
crontab $TEMPCRON
rm $TEMPCRON

echo "WE ARE ALL DONE HERE. If you close this window, you will have to reboot manually."

#reboot when done
yad --width=400 --height=200 --title="Reboot" --image $LOGO \
--text-align=center --skip-taskbar --image-on-top \
Expand Down
22 changes: 21 additions & 1 deletion changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
version=3.0.3
version=3.0.4

3.0.4 Add gitignore
Fix Issue #109 https://github.com/km4ack/pi-build/issues/109
add setconky to main menu in pref sub catagory
fix issue #119 https://github.com/km4ack/pi-build/issues/119
add TQSL - resolve https://github.com/km4ack/pi-build/issues/93
add PISTATS - https://github.com/km4ack/pi-build/issues/9
add JTDX https://github.com/km4ack/pi-build/issues/15
add xlog https://github.com/km4ack/pi-build/issues/45
fix issue 101 https://github.com/km4ack/pi-build/issues/101
update ruby install to 2.5
update M0IAX JS8Call Utils install method
improve GPS selection section to handle GPS not plugged in at boot
add bc install to build a pi script
add bc install to update script
update pat winlink check
update pat winlink install
backup/restore pat config file if it exist
fix grid tracker download (Thanks KN4QLH for finding the bug!)
fix pat install (Thanks KD7UM for finding the bug!)

3.0.3 Add GPS by-id to allow for different GPS units to be used (Thanks pleasantone for suggestion) https://github.com/km4ack/pi-build/issues/40
Change conky auto start. Fix https://github.com/km4ack/pi-build/issues/83
Expand Down
Loading

0 comments on commit 9061ac1

Please sign in to comment.