diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 63b4e72fcf..b405fa3eab 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,37 @@ +v158 +(12/11/17) + +Changes / Improvements / Optimizations: +DietPi-Services | status: Improved this command to highlight working and detail failed services. Failed services will also be listed. 'dietpi-services status': https://github.com/Fourdee/DietPi/issues/1230 +DietPi-Software | Google AIY: Now available for installation: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=9486#p9486 +DietPi-Software | moOde: Initial pass adding into DietPi: https://github.com/Fourdee/DietPi/issues/1223 +DietPi-Software | Gitea: Now available for installation. Many thanks to @techdabbler for contributing this addition: https://github.com/Fourdee/DietPi/issues/686 +DietPi-Software | Squeezelite recompiled with -DDSD, now supports DSD and DoP audio playback: https://github.com/Fourdee/DietPi/issues/1210 +DietPi-Sotware | AudioPhonics Pi-SPC: Now available for installation. Power control module which lets you physically power off system using a button: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=9359#p9359 +DietPi-Software | Raspotify: Now available for installation. Spotify Connect client for the Raspberry Pi (and other ARMv6/v7 devices) that Just Works™: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=9368#p9368 +DietPi-Software | Sabnzbd: Updated to 2.3.1 for new installations only. Thanks @Invictaz : https://github.com/Fourdee/DietPi/issues/865#issuecomment-340282019 +DietPi-Set_Software | Improved useradd/userdel functions. Please see sourcecode for details. + +Bug Fixes: +General | Sparky SBC: Applied latest kernel (USB + ETH) stability patches, which will resolve loss of connection, audio device and URB errors. Thanks @Sudeep. +General | Fixed kill-ssh-user-sessions-before-network.service, to prevent it always generating an error. +DietPi-Config | Corrected descriptions for Auto swapfile size, and, Ondemand as recommended CPU gov. Thanks @k-plan : https://github.com/Fourdee/DietPi/issues/1205 +DietPi-Config | NAS: Resolved an issue where samba client share names, which contained spaces, would cause the mount the fail: https://github.com/Fourdee/DietPi/issues/1201 +DietPi-Config | Rock64: Resolved an issue with incorrect card/device indexs for HDMI/3.5mm, thanks @BryanSmithDev : https://github.com/Fourdee/DietPi/issues/1102 +DietPi-Set_Hardware | Soundcard: When setting USB-DAC, and it fails detection, the soundcard will be reset to 'none'. +DietPi-Set_Software | DietPi User: Resolved an issue where /etc/sudoers was being incorrectly written with additional \. +DietPi-Software | Uninstalling DietPi-Cam, will no longer remove the motion package, shared with Motioneye, thanks @vilhelmp: https://github.com/Fourdee/DietPi/issues/1194 +DietPi-Software | Resolved an issue with Emby server (ARMv7/ARMv8) failing to install, due to missing packages not available in Debian repo: https://github.com/Fourdee/DietPi/issues/1150 +DietPi-Software | Resolved an issue with 404 and Owncloud: https://github.com/Fourdee/DietPi/issues/1225 +DietPi-Software | Resolved an issue with Home Assistant on Native PC failing. Many thanks to @sytone : https://github.com/Fourdee/DietPi/issues/1145 + +Allo Web Interface v3: +Roon | Resolved an issue where Roon was not generating unique IDs, resulting in multiple devices on the same network, having issues with Roon Core detection. +Squeezelite | Now supports DSD and DoP audio playback: https://github.com/Fourdee/DietPi/issues/1210 +General | Added ability to set S24_3 bit depth modes for Shairport-sync and Squeezelite. Required by some DACs + +----------------------------------------------------------------------------------------------------------- + v157 (19/10/17) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index ed7d53813e..b6efabd0cd 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -287,7 +287,7 @@ Before=network.target shutdown.target [Service] Type=oneshot -ExecStart=/usr/bin/killall sshd && /usr/bin/killall dropbear +ExecStart=/bin/bash -c 'killall sshd &> /dev/null; killall dropbear &> /dev/null' [Install] WantedBy=poweroff.target halt.target reboot.target @@ -438,6 +438,7 @@ sed -i "/FORCE=/c\FORCE=force" /etc/default/fake-hwclock # echo -e "options 8188eu rtw_power_mgnt=0" > /etc/modprobe.d/8188eu.conf # echo -e "options 8189es rtw_power_mgnt=0" > /etc/modprobe.d/8189es.conf + #Set swapfile size echo -e "CONF_SWAPSIZE=0" > /etc/dphys-swapfile diff --git a/README.md b/README.md index aaf4f1cdcb..560ba77847 100644 --- a/README.md +++ b/README.md @@ -28,12 +28,14 @@ Creator, programmer and project lead of DietPi. * Daniel Knight (Fourdee) Current contributors: -* JohnVick - Joined 08/06/2016 - - DietPi forum co-administrator, including managment, support, testing and valuable feedback. +* MichaIng - Joined Q3 2017 +Source code contributor, bug fixes, software improvements. +* JohnVick - Joined 08/06/2016 - +DietPi forum co-administrator, including managment, support, testing and valuable feedback * K-Plan - Joined 01/01/2016 - - Contributions to the DietPi in general, including In-depth testing, bug finding and valuable feedback. Forum moderator. +Contributions to the DietPi in general, including In-depth testing, bug finding and valuable feedback. Forum moderator. * ZombieVirus - Joined 20/03/2016 - - DietPi forum moderator and version history maintainer on forums. +DietPi forum moderator and version history maintainer on forums. Collaborations: * DietPi + AmiBerry 02/09/2016 - @@ -47,7 +49,7 @@ Contributions to the DietPi in general, including sourcecode, testing, new devic Provided DietPi.com web hosting for 1 year until April 17th 2016, forum moderator, testing, bug reporting. * xenfomation - Joined 01/04/2016 - Contributions to the DietPi in general, including sourcecode, virtualBox image creation/conversion. -* AWL29 - Joined 01/10/2016 - +* AWL29 - Joined 01/10/2016 - Created the DietPi image for NanoPi M3/T3. Honourable mentions/thanks: diff --git a/dietpi/.version b/dietpi/.version index 2bab4226fc..147ea53ba1 100644 --- a/dietpi/.version +++ b/dietpi/.version @@ -1 +1 @@ -157 \ No newline at end of file +158 \ No newline at end of file diff --git a/dietpi/conf/squeezelite.service b/dietpi/conf/squeezelite.service index e4fc683d62..ce29911a5d 100644 --- a/dietpi/conf/squeezelite.service +++ b/dietpi/conf/squeezelite.service @@ -3,7 +3,7 @@ Description=squeezelite [Service] Type=simple -ExecStart=/usr/bin/squeezelite -a 4096:1024:16:0 -C 5 -n 'DietPi-Squeezelite' -f /var/log/squeezelite.log +ExecStart=/usr/bin/squeezelite -D -a 4096:1024:16:0 -C 5 -n 'DietPi-Squeezelite' -f /var/log/squeezelite.log [Install] WantedBy=multi-user.target diff --git a/dietpi/dietpi-bugreport b/dietpi/dietpi-bugreport index 4a57fd2566..51378c59ca 100644 --- a/dietpi/dietpi-bugreport +++ b/dietpi/dietpi-bugreport @@ -176,6 +176,7 @@ _EOF_ "lsmod" "systemctl status *.service -l" "systemctl status *.mount -l" + "/DietPi/dietpi/dietpi-services status" ) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 57c32c056d..be3bf9dddd 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1292,7 +1292,7 @@ MIN_VALUE=0 MAX_VALUE=2000 - OPTION=$(whiptail --inputbox "This will set the size of your swap file in MB:\n\nSwapfile has a swapiness setting of 1. Swapfile is used only to prevent out of memory errors.\n\n - Recommended value = 1 (auto)\n - 0 = Disable swapfile\n - 1 = Auto size swapfile (1GB - RAM = size)\n - 2 - $MAX_VALUE = Manual size" 16 75 "$swap_size" --title "SwapFile Size (MB)" 3>&1 1>&2 2>&3) + OPTION=$(whiptail --inputbox "This will set the size of your swap file in MB:\n\nSwapfile has a swapiness setting of 1. Swapfile is used only to prevent out of memory errors.\n\n - Recommended value = 1 (auto)\n - 0 = Disable swapfile\n - 1 = Auto size swapfile (2GB - RAM = size)\n - 2 - $MAX_VALUE = Manual size" 16 75 "$swap_size" --title "SwapFile Size (MB)" 3>&1 1>&2 2>&3) CHOICE=$? if (( $CHOICE == 0 )); then @@ -1910,19 +1910,20 @@ local Description="Change CPU Governor:" local whiptail_menu_array=() - if (( $(cat "$FP_CPU_SCALING_GOV" | grep -ci -m1 'interactive') == 1 )); then - - whiptail_menu_array+=("interactive" "Scales CPU frequency between $frequency_min_cpu_governor MHz and $frequency_max_cpu_governor MHz.") - Description+="\nInteractive | Dynamic CPU frequency based on usage (recommended)" - - fi # - C1 | disable ondemand: https://github.com/Fourdee/DietPi/issues/248 if (( $(cat "$FP_CPU_SCALING_GOV" | grep -ci -m1 'ondemand') == 1 )) && (( $HW_MODEL != 10 )); then whiptail_menu_array+=("ondemand" "Scales CPU frequency between $frequency_min_cpu_governor MHz and $frequency_max_cpu_governor MHz.") - Description+="\nOndemand | Dynamic CPU frequency based on usage." + Description+="\nOndemand | Dynamic CPU frequency based on usage (recommended)." + + fi + + if (( $(cat "$FP_CPU_SCALING_GOV" | grep -ci -m1 'interactive') == 1 )); then + + whiptail_menu_array+=("interactive" "Scales CPU frequency between $frequency_min_cpu_governor MHz and $frequency_max_cpu_governor MHz.") + Description+="\nInteractive | Dynamic CPU frequency based on usage." fi @@ -4415,8 +4416,8 @@ _EOF_ whiptail_menu_array+=("none" "Disables HDMI + 3.5mm Analogue") - # NanoPi M2/M3, BPi Pro, OPi Zero, Rock64 - elif (( $HW_MODEL == 32 || $HW_MODEL == 43 || $HW_MODEL == 51 || $HW_MODEL == 61 || $HW_MODEL == 62 )); then + # NanoPi M2/M3, BPi Pro, OPi Zero + elif (( $HW_MODEL == 32 || $HW_MODEL == 51 || $HW_MODEL == 61 || $HW_MODEL == 62 )); then whiptail_menu_array+=("default" "3.5mm Analogue") @@ -4474,7 +4475,8 @@ _EOF_ whiptail_menu_array+=("allo-boss-dac-pcm512x-audio" "Allo Mini Boss DAC") whiptail_menu_array+=("allo-digione" "Allo DigiOne") whiptail_menu_array+=("allo-piano-dac-pcm512x-audio" "Allo Piano DAC") - whiptail_menu_array+=("allo-piano-dac-plus-pcm512x-audio" "Allo Piano DAC 2.1") + whiptail_menu_array+=("allo-piano-dac-pcm512x-audio" "Allo Piano DAC") + whiptail_menu_array+=("googlevoicehat-soundcard" "Google AIY voice kit") whiptail_menu_array+=("hifiberry-amp" "HifiBerry AMP / AMP+") whiptail_menu_array+=("hifiberry-dac" "HifiBerry DAC / MiniAMP") whiptail_menu_array+=("hifiberry-dacplus" "HifiBerry DAC+ / DAC+ Pro") @@ -4503,7 +4505,7 @@ _EOF_ # - Rock64 elif (( $HW_MODEL == 43 )); then - whiptail_menu_array+=("rock64-hdmi" "HDMI") + whiptail_menu_array+=("rock64-analogue" "3.5MM") # NanoPi M2/M3 elif (( $HW_MODEL == 61 || $HW_MODEL == 62 )); then @@ -4754,9 +4756,9 @@ _EOF_ if (( $(df -h | grep -ci -m1 '/mnt/samba') == 1 )); then #Get stats - sambaclient_mounted_size=$(df -h | grep -m1 '/mnt/samba' | awk '{ print $2 }') - sambaclient_mounted_used=$(df -h | grep -m1 '/mnt/samba' | awk '{ print $3 }') - sambaclient_mounted_free=$(df -h | grep -m1 '/mnt/samba' | awk '{ print $4 }') + sambaclient_mounted_size=$(df -h | grep -m1 '/mnt/samba' | awk '{print $(NF-4)}') + sambaclient_mounted_used=$(df -h | grep -m1 '/mnt/samba' | awk '{print $(NF-3)}') + sambaclient_mounted_free=$(df -h | grep -m1 '/mnt/samba' | awk '{print $(NF-2)}') sambaclient_status="/mnt/samba | Size $sambaclient_mounted_size | Used $sambaclient_mounted_used | Free $sambaclient_mounted_free" fi diff --git a/dietpi/dietpi-letsencrypt b/dietpi/dietpi-letsencrypt index cae85ebd43..cc5b790d41 100644 --- a/dietpi/dietpi-letsencrypt +++ b/dietpi/dietpi-letsencrypt @@ -45,36 +45,25 @@ DP_LOGFILE="/var/log/dietpi-letsencrypt.log" DP_MONTHLY_CRON="/etc/cron.monthly/dietpi-letsencrypt" DP_LETSENCRYPT_BINARY="/usr/bin/certbot" - DP_LETSENCRYPT_SCRIPTS="/etc/certbot_scripts" + if (( $DISTRO < 4 )); then + DP_LETSENCRYPT_BINARY="/etc/certbot_scripts/certbot-auto" + fi DP_WEBSERVER_INDEX=0 #0=apache2 1=lighttpd 2=nginx 3=minio LETSENCRYPT_INSTALLED=0 - if [[ $DISTRO == 4 ]]; then - if [ -f "$DP_LETSENCRYPT_BINARY" ]; then - LETSENCRYPT_INSTALLED=1 - fi - else - if [ -d "$DP_LETSENCRYPT_SCRIPTS" ]; then - LETSENCRYPT_INSTALLED=1 - fi + if [ -f "$DP_LETSENCRYPT_BINARY" ]; then + LETSENCRYPT_INSTALLED=1 fi - LETSENCRYPT_DOMAIN="mydomain.com" LETSENCRYPT_EMAIL="myemail@email.com" LETSENCRYPT_REDIRECT=0 LETSENCRYPT_AUTORENEW=0 - LETSENCRYPT_KEYSIZE=2048 + LETSENCRYPT_KEYSIZE=4096 Run_Lets_Encrypt(){ /DietPi/dietpi/func/dietpi-notify 3 "$PROGRAM_NAME" "Running cert" - if [[ ! $DISTRO == 4 ]]; then - - cd "$DP_LETSENCRYPT_SCRIPTS" - - fi - #Conditions that must be met before allowing run local run_conditions_met=1 @@ -85,6 +74,9 @@ DP_WEBSERVER_INDEX=0 /DietPi/dietpi/func/dietpi-notify 0 "Apache2 webserver detected" + if (( $DISTRO >= 4 )); then + DP_LETSENCRYPT_BINARY="$DP_LETSENCRYPT_BINARY --apache" + fi elif (( $(ps aux | grep -ci -m1 '[l]ighttpd') )); then @@ -95,6 +87,9 @@ DP_WEBSERVER_INDEX=2 /DietPi/dietpi/func/dietpi-notify 0 "Nginx webserver detected" + if (( $DISTRO >= 4 )); then + DP_LETSENCRYPT_BINARY="$DP_LETSENCRYPT_BINARY --nginx" + fi elif (( $(ps aux | grep -ci -m1 '[m]inio') )); then @@ -150,7 +145,7 @@ fi #Cert me up Apache2 - ./certbot-auto --duplicate --agree-tos $cli_redirect --rsa-key-size $LETSENCRYPT_KEYSIZE --email $LETSENCRYPT_EMAIL -d $LETSENCRYPT_DOMAIN + $DP_LETSENCRYPT_BINARY --duplicate --agree-tos $cli_redirect --rsa-key-size $LETSENCRYPT_KEYSIZE --email $LETSENCRYPT_EMAIL -d $LETSENCRYPT_DOMAIN #------------------------------------------------------------------------------------------------------ #Lighttpd @@ -159,7 +154,7 @@ # - Cert me up /DietPi/dietpi/dietpi-services stop - ./certbot-auto certonly --standalone --duplicate --agree-tos $cli_redirect --rsa-key-size $LETSENCRYPT_KEYSIZE --email $LETSENCRYPT_EMAIL -d $LETSENCRYPT_DOMAIN + $DP_LETSENCRYPT_BINARY certonly --standalone --duplicate --agree-tos $cli_redirect --rsa-key-size $LETSENCRYPT_KEYSIZE --email $LETSENCRYPT_EMAIL -d $LETSENCRYPT_DOMAIN # - Create combined key cd /etc/letsencrypt/live/"$LETSENCRYPT_DOMAIN" @@ -219,7 +214,7 @@ _EOF_ fi #Cert me up Nginx - certbot --nginx --duplicate --agree-tos $cli_redirect --rsa-key-size $LETSENCRYPT_KEYSIZE --email $LETSENCRYPT_EMAIL -d $LETSENCRYPT_DOMAIN + $DP_LETSENCRYPT_BINARY --duplicate --agree-tos $cli_redirect --rsa-key-size $LETSENCRYPT_KEYSIZE --email $LETSENCRYPT_EMAIL -d $LETSENCRYPT_DOMAIN #------------------------------------------------------------------------------------------------------ @@ -228,7 +223,7 @@ _EOF_ # - Cert me up /DietPi/dietpi/dietpi-services stop - ./certbot-auto certonly --standalone --preferred-challenges tls-sni --staple-ocsp --agree-tos $cli_redirect --rsa-key-size $LETSENCRYPT_KEYSIZE --email $LETSENCRYPT_EMAIL -d $LETSENCRYPT_DOMAIN + $DP_LETSENCRYPT_BINARY certonly --standalone --preferred-challenges tls-sni --staple-ocsp --agree-tos $cli_redirect --rsa-key-size $LETSENCRYPT_KEYSIZE --email $LETSENCRYPT_EMAIL -d $LETSENCRYPT_DOMAIN # Locate them correctly (THIS didn't work as symlinks) cp /etc/letsencrypt/live/$LETSENCRYPT_DOMAIN/fullchain.pem /home/minio-user/.minio/certs/public.crt @@ -274,7 +269,7 @@ _EOF_ #------------------------------------------------------------------------------------------------------ #ALL | Create cron job - if (( $LETSENCRYPT_AUTORENEW )); then + if (( $LETSENCRYPT_AUTORENEW && $DISTRO < 4 )); then cat << _EOF_ > "$DP_MONTHLY_CRON" #!/bin/bash @@ -483,13 +478,13 @@ _EOF_ #Menu if (( $INPUT == 0 )); then - /DietPi/dietpi/func/dietpi-notify 1 "Certbot scripts not found ( $DP_LETSENCRYPT_SCRIPTS )" + /DietPi/dietpi/func/dietpi-notify 1 "Certbot binary not found ( $DP_LETSENCRYPT_BINARY )" /DietPi/dietpi/func/dietpi-notify 2 "Please install Certbot with DietPi-Software before running this program." read -p "Press any key to continue....." else - echo -e "Error: Lets encrypt scripts not installed ( $DP_LETSENCRYPT_SCRIPTS )." >> "$DP_LOGFILE" + echo -e "Error: Letsencrypt binary not installed ( $DP_LETSENCRYPT_BINARY )." >> "$DP_LOGFILE" fi diff --git a/dietpi/dietpi-obtain_hw_model b/dietpi/dietpi-obtain_hw_model index b956a0a953..81729255ca 100644 --- a/dietpi/dietpi-obtain_hw_model +++ b/dietpi/dietpi-obtain_hw_model @@ -20,6 +20,7 @@ # HW_MODEL 100 Asus Tinker Board # HW_MODEL 90 A20-OLinuXino-MICRO # HW_MODEL 80 Cubieboard 3 + # HW_MODEL 71 Beagle Bone Black # HW_MODEL 70 Sparky SBC # HW_MODEL 66 NanoPi M1 Plus # HW_MODEL 65 NanoPi NEO 2 @@ -397,6 +398,11 @@ HW_MODEL_DESCRIPTION='Cubieboard 3' IMAGE_ADDITIONAL_CREDITS='ARMbian' + #Beagle Bone Black + elif (( $HW_MODEL == 71 )); then + + HW_MODEL_DESCRIPTION='BBB' + #Sparky SBC elif (( $HW_MODEL == 70 )); then diff --git a/dietpi/dietpi-process_tool b/dietpi/dietpi-process_tool index 8703d01c89..8650abac75 100644 --- a/dietpi/dietpi-process_tool +++ b/dietpi/dietpi-process_tool @@ -219,7 +219,9 @@ aNAME[$index]='Emby Server';aPROCESS_NAME[$index]='emby-server';((index++)) aNAME[$index]='EmonHUB';aPROCESS_NAME[$index]='emonhub';((index++)) aNAME[$index]='FuguHub';aPROCESS_NAME[$index]='bdd';((index++)) + aNAME[$index]='Gitea';aPROCESS_NAME[$index]='gitea';((index++)) aNAME[$index]='Gogs';aPROCESS_NAME[$index]='gogs';((index++)) + aNAME[$index]='Google AIY';aPROCESS_NAME[$index]='main.py';((index++)) aNAME[$index]='Gmediarender';aPROCESS_NAME[$index]='gmediarender';((index++)) aNAME[$index]='Home Assistant';aPROCESS_NAME[$index]='hass';((index++)) aNAME[$index]='HTPC Manager';aPROCESS_NAME[$index]='Htpc.py';((index++)) @@ -231,6 +233,7 @@ aNAME[$index]='Jconvolver';aPROCESS_NAME[$index]='jconvolver';((index++)) aNAME[$index]='Minio';aPROCESS_NAME[$index]='minio';((index++)) aNAME[$index]='MiniDLNA';aPROCESS_NAME[$index]='minidlna';((index++)) + #aNAME[$index]='moOde (worker.php)';aPROCESS_NAME[$index]='worker.php';((index++)) aNAME[$index]='Mopidy';aPROCESS_NAME[$index]='mopidy';((index++)) aNAME[$index]='Mosquitto';aPROCESS_NAME[$index]='mosquitto';((index++)) aNAME[$index]='MotionEye';aPROCESS_NAME[$index]='motioneye';((index++)) @@ -246,11 +249,13 @@ aNAME[$index]='Open Media Vault';aPROCESS_NAME[$index]='omv-engined';((index++)) aNAME[$index]='OpenSSH Server';aPROCESS_NAME[$index]='sshd';((index++)) aNAME[$index]='OpenVPN Server';aPROCESS_NAME[$index]='openvpn';((index++)) + aNAME[$index]='Pi-SPC';aPROCESS_NAME[$index]='sds.sh';((index++)) aNAME[$index]='Pi-hole';aPROCESS_NAME[$index]='dnsmasq';((index++)) aNAME[$index]='Pi-hole FTL';aPROCESS_NAME[$index]='pihole-FTL';((index++)) aNAME[$index]='ProFTP';aPROCESS_NAME[$index]='proftpd';((index++)) aNAME[$index]='qBitTorrent';aPROCESS_NAME[$index]='qbittorrent-nox';((index++)) aNAME[$index]='Radarr';aPROCESS_NAME[$index]='Radarr.exe';((index++)) + aNAME[$index]='Raspotify';aPROCESS_NAME[$index]='librespot';((index++)) aNAME[$index]='RoonBridge';aPROCESS_NAME[$index]='RoonBridge';((index++)) aNAME[$index]='RoonBridge (Helper)';aPROCESS_NAME[$index]='RoonBridgeHelper';((index++)) aNAME[$index]='RoonBridge/Server (RAATServer)';aPROCESS_NAME[$index]='RAATServer';((index++)) diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index ecc37dbfcd..628f0aa8ff 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -109,6 +109,12 @@ 'minio' 'gmrender' 'nukkit' + 'gitea' + 'pi-spc' + 'raspotify' + #'moode-worker' + 'voice-recognizer' + 'alsa-init' ) # - User: read custom services file @@ -230,7 +236,18 @@ #Apply if (( ${aSERVICE_AVAILABLE[$i]} == 1 )); then - echo -e "${aSERVICE_NAME[$i]}\t$(systemctl status "${aSERVICE_NAME[$i]}" | grep Active | cut -c12-)" + STATUS="${aSERVICE_NAME[$i]}\t$(systemctl status ${aSERVICE_NAME[$i]} | grep -m1 'Active' | cut -c12-)" + + if [[ "$STATUS" =~ .*'failed'.* ]]; then + + /DietPi/dietpi/func/dietpi-notify 1 "$STATUS" + systemctl status "${aSERVICE_NAME[$i]}" -l --no-pager + + else + + /DietPi/dietpi/func/dietpi-notify 0 "$STATUS" + + fi fi diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d1f1dbba9a..7dd02d7220 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -17,10 +17,10 @@ # Usage: # - dietpi-software # - /DietPi/dietpi/dietpi-software install iUNIQUEID (OR) sINDEX_{SSHSERVER,FILESERVER,LOGGING,WEBSERVER}_TARGET=-int - # - /DietPi/dietpi/dietpi-software reinstall Same as installed, however, only reinstalls if state =2. Does not uninstall due to package removal danger (eg: xserver removes kodi), simply flags to be installed (=1). - # - /DietPi/dietpi/dietpi-software uninstall iUNIQUEID - # - /DietPi/dietpi/dietpi-software list #Lists UNIQUEIDs for software - # - /DietPi/dietpi/dietpi-software setpermissions #Sets shared permissions for /var/www and userdata folders + # - /DietPi/dietpi/dietpi-software reinstall #Same as installed, however, only reinstalls if state =2. Does not uninstall due to package removal danger (eg: xserver removes kodi), simply flags to be installed (=1). + # - /DietPi/dietpi/dietpi-software uninstall iUNIQUEID + # - /DietPi/dietpi/dietpi-software list #Lists UNIQUEIDs for software. + # - /DietPi/dietpi/dietpi-software setpermissions #Sets shared permissions for /var/www and userdata folders. #//////////////////////////////////// #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. @@ -264,7 +264,7 @@ _EOF_ #PHP5/7 specific directories, apt package-, module- and command names FP_PHP_BASE_DIR='/etc/php/7.0' PHP_APT_PACKAGE_NAME='php' - if (( $DISTRO == 3 )); then + if (( $DISTRO < 4 )); then FP_PHP_BASE_DIR='/etc/php5' PHP_APT_PACKAGE_NAME='php5' @@ -308,17 +308,17 @@ _EOF_ # - Software #NB: All software has a unique index that must not be changed (eg: DESKTOP_LXDE = 23) TOTAL_SOFTWARE_INDEXS=0 - TOTAL_SOFTWARE_INDEXS_HARDLIMIT=165 #Increase as needed. Must be higher than TOTAL_SOFTWARE_INDEXS once calculated in Software_Arrays_Init + TOTAL_SOFTWARE_INDEXS_HARDLIMIT=170 #Increase as needed. Must be higher than TOTAL_SOFTWARE_INDEXS once calculated in Software_Arrays_Init - INSTALLING_INDEX=0 #Which software index is currently being installed? + INSTALLING_INDEX=0 #Which software index is currently being installed? - aSOFTWARE_CATEGORY_INDEX=0 #Category index - aSOFTWARE_TYPE=0 #0=DietPi 1=Linux | -1=Hidden from install menu, visible in uninstall menu | -2 Hidden from all menus + aSOFTWARE_CATEGORY_INDEX=0 #Category index + aSOFTWARE_TYPE=0 #0=DietPi 1=Linux | -1=Hidden from install menu, visible in uninstall menu | -2 Hidden from all menus - aSOFTWARE_INSTALL_STATE=0 #0=not / 1=tobe, or not tobe that is the... / 2=installed + aSOFTWARE_INSTALL_STATE=0 #0=not / 1=tobe, or not tobe that is the... / 2=installed - aSOFTWARE_WHIP_NAME=0 #Item name eg: Kodi - aSOFTWARE_WHIP_DESC=0 #Blah blah + aSOFTWARE_WHIP_NAME=0 #Item name eg: Kodi + aSOFTWARE_WHIP_DESC=0 #Blah blah FP_ONLINEDOC_URL='http://dietpi.com/phpbb/viewtopic.php?' aSOFTWARE_ONLINEDOC_URL=0 @@ -357,11 +357,11 @@ _EOF_ # Adding Software to the Install List: # ------------------------------------ # - index_current: - # This is the next number in the sequence, each software install has a unique number + # This is the next number in the sequence. Each software install has a unique number, # so it can be referenced in all arrays. This has to be the same for install, uninstall # and setting up the service. Run "dietpi-software list | grep 'index Current'" to - # get the next number in the sequence. Ensure you are running a testing build as - # release may be behind the testing branch and avaliable software packages + # get the next number in the sequence. Ensure that you are running a testing build, as + # release may be behind the testing branch and avaliable software packages. # # - aSOFTWARE_WHIP_NAME: # This is the name to display in the UI. @@ -370,27 +370,27 @@ _EOF_ # This is the description to place next to the name in the UI. # # - aSOFTWARE_CATEGORY_INDEX: - # If you are adding a new peice of software first choose the category it goes under - # (aSOFTWARE_CATEGORIES_DIETPI or aSOFTWARE_CATEGORIES_LINUX) this will give you - # the aSOFTWARE_CATEGORY_INDEX to set, in the example belo this is 0. + # If you are adding a new peice of software, first choose the category it belongs to + # (see aSOFTWARE_CATEGORIES_DIETPI and aSOFTWARE_CATEGORIES_LINUX below), which will + # give you the aSOFTWARE_CATEGORY_INDEX to set. In the example below this is 0. # # - aSOFTWARE_TYPE: - # If this is aSOFTWARE_CATEGORIES_DIETPI then aSOFTWARE_TYPE = 0 if it is + # If this is aSOFTWARE_CATEGORIES_DIETPI then aSOFTWARE_TYPE=0, if it is # aSOFTWARE_CATEGORIES_LINUX then it is 1. In the example it is 0. # # - aSOFTWARE_ONLINEDOC_URL: # This is appeneded to FP_ONLINEDOC_URL to make a URL for help on this software. # # Specifying other software as dependencies: - # If you need other software to be avaliable for you look under the 'Requires software + # If your software needs other software to be available, look under the 'Requires software # to be installed' heading and then add that to the section you create. In the example - # below ALSA and XSERVERXORG are needed. The system will check to see if they are - # installed and if not will install them for you. + # below ALSA and XSERVERXORG are needed. The system will check their presence + # and install as needed. # # Dealing with Hardware types: - # If you have hardware requirements like must not/only be installed on a pi then you need - # to add something like the following, look for other examples in the existing software - # installations. Full list of models can be found in 'dietpi-obtain_hw_model' + # If you have hardware requirements, like must not/only be installed on a Pi, then you need + # to add something like below. Look for other examples in the existing software + # installations. Full list of models can be found in 'dietpi-obtain_hw_model'. # # # - Disabled for All non-rpi # for ((i=10; i<=$MAX_HW_MODEL; i++)) @@ -1071,8 +1071,45 @@ _EOF_ aSOFTWARE_REQUIRES_ALSA[$index_current]=1 aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=9012#p9012' + #------------------ + index_current=167 + + aSOFTWARE_WHIP_NAME[$index_current]='Raspotify' + aSOFTWARE_WHIP_DESC[$index_current]='spotify connect client' + aSOFTWARE_CATEGORY_INDEX[$index_current]=2 + aSOFTWARE_TYPE[$index_current]=0 + aSOFTWARE_REQUIRES_ALSA[$index_current]=1 + aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=9368#p9368' + + #disable ARMv8: + aSOFTWARE_AVAIL_HW_ARCH[$index_current,3]=0 + + #disable x86_64: + aSOFTWARE_AVAIL_HW_ARCH[$index_current,10]=0 + + #------------------ + index_current=168 + + aSOFTWARE_WHIP_NAME[$index_current]='moOde' + aSOFTWARE_WHIP_DESC[$index_current]='audiophile-quality music playback' + aSOFTWARE_CATEGORY_INDEX[$index_current]=2 + aSOFTWARE_TYPE[$index_current]=-1 + aSOFTWARE_REQUIRES_WEBSERVER[$index_current]=1 + aSOFTWARE_REQUIRES_SQLITE[$index_current]=1 + aSOFTWARE_REQUIRES_BUILDESSENTIAL[$index_current]=1 + aSOFTWARE_REQUIRES_GIT[$index_current]=1 + aSOFTWARE_REQUIRES_ALSA[$index_current]=1 + aSOFTWARE_ONLINEDOC_URL[$index_current]='xxxxxxxxxxxxxxxxx' + + # - Disabled for All non-rpi + for ((i=10; i<=$MAX_HW_MODEL; i++)) + do + + aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + + done - #BitTorrent + #BitTorrent #-------------------------------------------------------------------------------- index_current=44 @@ -1303,6 +1340,20 @@ _EOF_ # - ARMv8 aSOFTWARE_AVAIL_HW_ARCH[$index_current,3]=0 + #------------------ + index_current=165 + + aSOFTWARE_WHIP_NAME[$index_current]='Gitea' + aSOFTWARE_WHIP_DESC[$index_current]='Git with a cup of tea' + aSOFTWARE_CATEGORY_INDEX[$index_current]=4 + aSOFTWARE_TYPE[$index_current]=0 + aSOFTWARE_REQUIRES_GIT[$index_current]=1 + aSOFTWARE_REQUIRES_MYSQL[$index_current]=1 + aSOFTWARE_ONLINEDOC_URL[$index_current]='' + + # - ARMv8 + aSOFTWARE_AVAIL_HW_ARCH[$index_current,3]=0 + #Emulation / Gaming #-------------------------------------------------------------------------------- @@ -1802,6 +1853,42 @@ _EOF_ aSOFTWARE_REQUIRES_NODEJS[$index_current]=1 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$index_current]=1 + #------------------ + index_current=166 + + aSOFTWARE_WHIP_NAME[$index_current]='PI-SPC' + aSOFTWARE_WHIP_DESC[$index_current]='audiophonics pi-spc power control module' + aSOFTWARE_CATEGORY_INDEX[$index_current]=11 + aSOFTWARE_TYPE[$index_current]=0 + aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=9359#p9359' + + # - Disabled for All non-rpi + for ((i=10; i<=$MAX_HW_MODEL; i++)) + do + + aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + + done + + #------------------ + index_current=169 + + aSOFTWARE_WHIP_NAME[$index_current]='Google AIY' + aSOFTWARE_WHIP_DESC[$index_current]='voice kit' + aSOFTWARE_CATEGORY_INDEX[$index_current]=11 + aSOFTWARE_TYPE[$index_current]=0 + aSOFTWARE_REQUIRES_ALSA[$index_current]=1 + aSOFTWARE_REQUIRES_GIT[$index_current]=1 + aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=9486#p9486' + + # - Disabled for All non-rpi + for ((i=10; i<=$MAX_HW_MODEL; i++)) + do + + aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + + done + #System security #-------------------------------------------------------------------------------- index_current=73 @@ -2571,8 +2658,185 @@ _EOF_ /DietPi/dietpi/func/dietpi-notify 3 DietPi-Software "Checking for prerequisite software" - #WEBSERVER - Manual stack install - # - Define extra DietPi install flags for WEBSERVER_STACKS + #------------------------------------------------------------------------- + #Pre-req software, for items that do not have their own array aSOFTWARE_REQUIRES_SOFTWARENAME + local index=0 + + #Additional software that requires WiringPi + # AudioPhonics Pi-SPC + if (( ${aSOFTWARE_INSTALL_STATE[166]} == 1 )); then + + aSOFTWARE_INSTALL_STATE[70]=1 + + fi + + #Additional Software required by Allo Web Interface + if (( ${aSOFTWARE_INSTALL_STATE[159]} == 1 )); then + + aSOFTWARE_INSTALL_STATE[36]=1 # Squeezelite + aSOFTWARE_INSTALL_STATE[37]=1 # Shairport Sync + + if (( $HW_MODEL == 70 )); then + + aSOFTWARE_INSTALL_STATE[60]=1 # WiFi Hotspot + + fi + + aSOFTWARE_INSTALL_STATE[65]=1 # Netdata + aSOFTWARE_INSTALL_STATE[96]=1 # Samba + + #aSOFTWARE_INSTALL_STATE[80]=1 # LLMP + aSOFTWARE_INSTALL_STATE[121]=1 # Roon Bridge + aSOFTWARE_INSTALL_STATE[124]=1 # NAA Daemon + #aSOFTWARE_INSTALL_STATE[128]=1 # MPD + aSOFTWARE_INSTALL_STATE[129]=1 # O!MPD + #aSOFTWARE_INSTALL_STATE[152]=1 # Avahi (pulled in by O!MPD) + aSOFTWARE_INSTALL_STATE[163]=1 # Gmrender + + fi + + #Additional Software required by moOde + if (( ${aSOFTWARE_INSTALL_STATE[168]} == 1 )); then + + #aSOFTWARE_INSTALL_STATE[36]=1 # Squeezelite # Disabled/optional + #aSOFTWARE_INSTALL_STATE[37]=1 # Shairport Sync # Disabled/optional + #aSOFTWARE_INSTALL_STATE[128]=1 # MPD # Compiled during install, as per moOde docs + #aSOFTWARE_INSTALL_STATE[60]=1 # WiFi Hotspot # Installed as per moOde docs + + /DietPi/dietpi/func/dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[78]} will be installed" + aSOFTWARE_INSTALL_STATE[78]=1 # LESP, override user choice for now. + + /DietPi/dietpi/func/dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[1]} will be installed" + aSOFTWARE_INSTALL_STATE[1]=1 # Samba Client + + /DietPi/dietpi/func/dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[96]} will be installed" + aSOFTWARE_INSTALL_STATE[96]=1 # Samba Server + + fi + + #Additional Software required by Google AIY + if (( ${aSOFTWARE_INSTALL_STATE[169]} == 1 )); then + + aSOFTWARE_INSTALL_STATE[69]=1 # RPi.GPIO + #aSOFTWARE_INSTALL_STATE[130]=1 # python-pip, enabled in #Software that requires Python-Pip + + fi + + #Software that requires Avahi-Daemon + index=152 + if (( ${aSOFTWARE_INSTALL_STATE[31]} == 1 || + ${aSOFTWARE_INSTALL_STATE[37]} == 1 || + ${aSOFTWARE_INSTALL_STATE[128]} == 1 || + ${aSOFTWARE_INSTALL_STATE[138]} == 1 || + ${aSOFTWARE_INSTALL_STATE[163]} == 1 || + ${aSOFTWARE_INSTALL_STATE[168]} == 1 )); then + + if (( ${aSOFTWARE_INSTALL_STATE[$index]} == 0 )); then + + aSOFTWARE_INSTALL_STATE[$index]=1 + + #aSOFTWARE_WHIP_NAME + /DietPi/dietpi/func/dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[$index]} will be installed" + + fi + + fi + + #Software that requires Mono + if (( ${aSOFTWARE_INSTALL_STATE[41]} == 1 || + ${aSOFTWARE_INSTALL_STATE[144]} == 1 || + ${aSOFTWARE_INSTALL_STATE[145]} == 1 || + ${aSOFTWARE_INSTALL_STATE[147]} == 1 )); then + + if (( ${aSOFTWARE_INSTALL_STATE[150]} == 0 )); then + + aSOFTWARE_INSTALL_STATE[150]=1 + + /DietPi/dietpi/func/dietpi-notify 2 "Mono runtime libary will be installed" + + fi + + fi + + #Software that requires SDL2: + if (( ${aSOFTWARE_INSTALL_STATE[108]} == 1 )); then + + if (( ${aSOFTWARE_INSTALL_STATE[140]} == 0 )); then + + aSOFTWARE_INSTALL_STATE[140]=1 + + /DietPi/dietpi/func/dietpi-notify 2 "SDL2 will be installed" + + fi + + fi + + #Software that requires Python-Pip: https://github.com/Fourdee/DietPi/issues/784 + if (( ${aSOFTWARE_INSTALL_STATE[58]} == 1 || + ${aSOFTWARE_INSTALL_STATE[99]} == 1 || + ${aSOFTWARE_INSTALL_STATE[118]} == 1 || + ${aSOFTWARE_INSTALL_STATE[136]} == 1 || + ${aSOFTWARE_INSTALL_STATE[139]} == 1 || + ${aSOFTWARE_INSTALL_STATE[142]} == 1 || + ${aSOFTWARE_INSTALL_STATE[153]} == 1 || + ${aSOFTWARE_INSTALL_STATE[169]} == 1 )); then + + if (( ${aSOFTWARE_INSTALL_STATE[130]} == 0 )); then + + aSOFTWARE_INSTALL_STATE[130]=1 + + /DietPi/dietpi/func/dietpi-notify 2 "Python-Pip will be installed" + + fi + + fi + + #Software that requires MPD + # YMPD + # Cava + # OMPD + if (( ${aSOFTWARE_INSTALL_STATE[32]} == 1 || + ${aSOFTWARE_INSTALL_STATE[119]} == 1 || + ${aSOFTWARE_INSTALL_STATE[129]} == 1 )); then + + if (( ${aSOFTWARE_INSTALL_STATE[128]} == 0 )); then + + # - Flag for install + aSOFTWARE_INSTALL_STATE[128]=1 + + /DietPi/dietpi/func/dietpi-notify 2 "MPD will be installed" + + fi + + fi + + #OMV (requires Samba, Proftpd) + if (( ${aSOFTWARE_INSTALL_STATE[126]} == 1 )); then + + #Proftpd + if (( ${aSOFTWARE_INSTALL_STATE[94]} == 0 )); then + + aSOFTWARE_INSTALL_STATE[94]=1 + + /DietPi/dietpi/func/dietpi-notify 2 "ProFTP will be installed" + + fi + + #Samba + if (( ${aSOFTWARE_INSTALL_STATE[96]} == 0 )); then + + aSOFTWARE_INSTALL_STATE[96]=1 + + /DietPi/dietpi/func/dietpi-notify 2 "Samba Server will be installed" + + fi + + fi + + #------------------------------------------------------------------------- + #Pre-req software, for items that do DO have their own array aSOFTWARE_REQUIRES_SOFTWARENAME + # WEBSERVER - Manual stack install + # - Define extra DietPi install flags for WEBSERVER_STACKS #LLAP if (( ${aSOFTWARE_INSTALL_STATE[82]} == 1 )); then aSOFTWARE_INSTALL_STATE[84]=1 @@ -3003,144 +3267,6 @@ _EOF_ done - #------------ - #Specials - local index=0 - - #Additional Software required by Allo Web Interface - if (( ${aSOFTWARE_INSTALL_STATE[159]} == 1 )); then - - aSOFTWARE_INSTALL_STATE[36]=1 # Squeezelite - aSOFTWARE_INSTALL_STATE[37]=1 # Shairport Sync - - if (( $HW_MODEL == 70 )); then - - aSOFTWARE_INSTALL_STATE[60]=1 # WiFi Hotspot - - fi - - aSOFTWARE_INSTALL_STATE[65]=1 # Netdata - aSOFTWARE_INSTALL_STATE[96]=1 # Samba - - #aSOFTWARE_INSTALL_STATE[80]=1 # LLMP - aSOFTWARE_INSTALL_STATE[121]=1 # Roon Bridge - aSOFTWARE_INSTALL_STATE[124]=1 # NAA Daemon - #aSOFTWARE_INSTALL_STATE[128]=1 # MPD - aSOFTWARE_INSTALL_STATE[129]=1 # O!MPD - #aSOFTWARE_INSTALL_STATE[152]=1 # Avahi (pulled in by O!MPD) - aSOFTWARE_INSTALL_STATE[163]=1 # Gmrender - - fi - - #Software that requires Avahi-Daemon - index=152 - if (( ${aSOFTWARE_INSTALL_STATE[31]} == 1 || - ${aSOFTWARE_INSTALL_STATE[37]} == 1 || - ${aSOFTWARE_INSTALL_STATE[128]} == 1 || - ${aSOFTWARE_INSTALL_STATE[138]} == 1 || - ${aSOFTWARE_INSTALL_STATE[163]} == 1)); then - - if (( ${aSOFTWARE_INSTALL_STATE[$index]} == 0 )); then - - aSOFTWARE_INSTALL_STATE[$index]=1 - - #aSOFTWARE_WHIP_NAME - /DietPi/dietpi/func/dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[$index]} will be installed" - - fi - - fi - - #Software that requires Mono - if (( ${aSOFTWARE_INSTALL_STATE[41]} == 1 || - ${aSOFTWARE_INSTALL_STATE[144]} == 1 || - ${aSOFTWARE_INSTALL_STATE[145]} == 1 || - ${aSOFTWARE_INSTALL_STATE[147]} == 1 )); then - - if (( ${aSOFTWARE_INSTALL_STATE[150]} == 0 )); then - - aSOFTWARE_INSTALL_STATE[150]=1 - - /DietPi/dietpi/func/dietpi-notify 2 "Mono runtime libary will be installed" - - fi - - fi - - #Software that requires SDL2: - if (( ${aSOFTWARE_INSTALL_STATE[108]} == 1 )); then - - if (( ${aSOFTWARE_INSTALL_STATE[140]} == 0 )); then - - aSOFTWARE_INSTALL_STATE[140]=1 - - /DietPi/dietpi/func/dietpi-notify 2 "SDL2 will be installed" - - fi - - fi - - #Software that requires Python-Pip: https://github.com/Fourdee/DietPi/issues/784 - if (( ${aSOFTWARE_INSTALL_STATE[58]} == 1 || - ${aSOFTWARE_INSTALL_STATE[99]} == 1 || - ${aSOFTWARE_INSTALL_STATE[118]} == 1 || - ${aSOFTWARE_INSTALL_STATE[136]} == 1 || - ${aSOFTWARE_INSTALL_STATE[139]} == 1 || - ${aSOFTWARE_INSTALL_STATE[142]} == 1 || - ${aSOFTWARE_INSTALL_STATE[153]} == 1 )); then - - if (( ${aSOFTWARE_INSTALL_STATE[130]} == 0 )); then - - aSOFTWARE_INSTALL_STATE[130]=1 - - /DietPi/dietpi/func/dietpi-notify 2 "Python-Pip will be installed" - - fi - - fi - - #Software that requires MPD - # HiFi - # Cava - # OMPD - if (( ${aSOFTWARE_INSTALL_STATE[32]} == 1 || - ${aSOFTWARE_INSTALL_STATE[119]} == 1 || - ${aSOFTWARE_INSTALL_STATE[129]} == 1 )); then - - if (( ${aSOFTWARE_INSTALL_STATE[128]} == 0 )); then - - # - Flag for install - aSOFTWARE_INSTALL_STATE[128]=1 - - /DietPi/dietpi/func/dietpi-notify 2 "MPD will be installed" - - fi - - fi - - #OMV (requires Samba, Proftpd) - if (( ${aSOFTWARE_INSTALL_STATE[126]} == 1 )); then - - #Proftpd - if (( ${aSOFTWARE_INSTALL_STATE[94]} == 0 )); then - - aSOFTWARE_INSTALL_STATE[94]=1 - - /DietPi/dietpi/func/dietpi-notify 2 "ProFTP will be installed" - - fi - - #Samba - if (( ${aSOFTWARE_INSTALL_STATE[96]} == 0 )); then - - aSOFTWARE_INSTALL_STATE[96]=1 - - /DietPi/dietpi/func/dietpi-notify 2 "Samba Server will be installed" - - fi - - fi - } Create_Desktop_Shared_Items(){ @@ -3225,7 +3351,7 @@ _EOF_ fi #-qq can add a slight period of appearing nothing is happening, lets inform user - /DietPi/dietpi/func/dietpi-notify 2 "Apt-get is processing, please wait...\n" + /DietPi/dietpi/func/dietpi-notify 2 "APT is processing, please wait...\n" DEBIAN_FRONTEND=noninteractive $APT_BINARY install -y -qq $force_options $string 2>&1 | tee "$FP_APT_LOG" local result=${PIPESTATUS[0]} @@ -3695,7 +3821,7 @@ _EOF_ # + stretch extras if (( $DISTRO >= 4 )); then - AGI "$PHP_APT_PACKAGE_NAME"-opcache "$PHP_APT_PACKAGE_NAME"-mbstring "$PHP_APT_PACKAGE_NAME"-zip "$PHP_APT_PACKAGE_NAME"-xml + AGI "$PHP_APT_PACKAGE_NAME"-mbstring "$PHP_APT_PACKAGE_NAME"-zip "$PHP_APT_PACKAGE_NAME"-xml fi @@ -5144,6 +5270,13 @@ _EOF_ #Stop service service logitechmediaserver stop + #Stretch + # Compile pre-req CPAN modules??? + # if (( $DISTRO >= 4 )); then + + # AGI yasm git build-essential automake cpanminus nasm libxml-parser-perl libexpat1-dev libgif-dev zlib1g-dev libjpeg-dev libpng-dev + + # + ARMv6 cpan if (( $HW_ARCH == 1 )); then @@ -5423,34 +5556,44 @@ _EOF_ Banner_Installing + if (( $DISTRO >= 4 )); then - INSTALL_URL_ADDRESS='https://github.com/certbot/certbot/archive/master.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" - - #Install - if (( $? == 0 )); then + AGI certbot - if (( $DISTRO == 4 )); then + if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then - AGI certbot python-certbot-nginx + AGI python-certbot-apache - else + fi - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip -d /root - rm package.zip - mv certbot* /etc/certbot_scripts + if (( ${aSOFTWARE_INSTALL_STATE[85]} >= 1 )); then - # - Install packages - cd /etc/certbot_scripts - ./certbot-auto -n --os-packages-only - cd ~/ + AGI python-certbot-nginx fi else - Error_NoConnection_NoInstall + INSTALL_URL_ADDRESS='https://github.com/certbot/certbot/archive/master.zip' + /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + + #Install + if (( $? == 0 )); then + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip -d /root + rm package.zip + mv certbot* /etc/certbot_scripts + + # - Install packages + cd /etc/certbot_scripts + ./certbot-auto -n --os-packages-only + cd ~/ + + else + + Error_NoConnection_NoInstall + + fi fi @@ -5915,17 +6058,6 @@ _EOF_ Banner_Installing - #ARMv8, requires libjpeg from unofficial port in SID :(, all links provide 404... - # if (( $HW_ARCH == 3 )); then - - # INSTALL_URL_ADDRESS='http://ftp.de.debian.org/debian-ports//pool-arm64/main/libj/libjpeg8/libjpeg8_8d1-2_arm64.deb' - # /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" - # wget "$INSTALL_URL_ADDRESS" -O package.deb - # dpkg -i package.deb - # rm package.deb - - # fi - #ARM packages only available in 14.04 repo: https://github.com/Fourdee/DietPi/issues/1059#issuecomment-313661959 INSTALL_URL_ADDRESS='http://download.opensuse.org/repositories/home:/emby/xUbuntu_14.04/' @@ -5958,13 +6090,40 @@ _EOF_ rm Release.key apt-get update - #ARMv7, Grab Libjpeg8 from Wheezy: https://github.com/Fourdee/DietPi/issues/1128#issuecomment-326743471 + #ARMv7, Grab required pre-reqs from various sources: https://github.com/Fourdee/DietPi/issues/1128#issuecomment-326743471 / https://github.com/Fourdee/DietPi/issues/1150#issuecomment-330291298 if (( $HW_ARCH == 2 )); then wget http://ftp.us.debian.org/debian/pool/main/libj/libjpeg8/libjpeg8_8d-1+deb7u1_armhf.deb -O package.deb dpkg -i package.deb rm package.deb + wget http://ftp.us.debian.org/debian/pool/main/libp/libpng/libpng12-0_1.2.50-2+deb8u3_armhf.deb -O package.deb + dpkg -i package.deb + rm package.deb + + wget http://ftp.us.debian.org/debian/pool/main/libw/libwebp/libwebp5_0.4.1-1.2+b2_armhf.deb -O package.deb + dpkg -i package.deb + rm package.deb + + #ARMv8 + elif (( $HW_ARCH == 3 )); then + + wget http://ftp.us.debian.org/debian/pool/main/libp/libpng/libpng12-0_1.2.50-2+deb8u3_arm64.deb -O package.deb + dpkg -i package.deb + rm package.deb + + wget http://ftp.us.debian.org/debian/pool/main/libw/libwebp/libwebp5_0.4.1-1.2+b2_arm64.deb -O package.deb + dpkg -i package.deb + rm package.deb + + wget https://mirror.i-novus.ru/ubuntu-ports/pool/main/libj/libjpeg-turbo/libjpeg-turbo8_1.3.0-0ubuntu2_arm64.deb -O package.deb + dpkg -i package.deb + rm package.deb + + wget http://turul.canonical.com/pool/main/libj/libjpeg8-empty/libjpeg8_8c-2ubuntu8_arm64.deb -O package.deb + dpkg -i package.deb + rm package.deb + fi AGI emby-server embymagick @@ -6675,7 +6834,7 @@ _EOF_ Banner_Installing - local version='2.3.0' + local version='2.3.1' INSTALL_URL_ADDRESS="https://github.com/sabnzbd/sabnzbd/archive/$version.zip" @@ -7137,84 +7296,359 @@ _EOF_ /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - # Offical Docker recommended install command - wget -O DockerInstall.sh "$INSTALL_URL_ADDRESS" - chmod +x DockerInstall.sh - ./DockerInstall.sh - #rm DockerInstall.sh + if (( $? == 0 )); then + # Offical Docker recommended install command + wget -O DockerInstall.sh "$INSTALL_URL_ADDRESS" + chmod +x DockerInstall.sh + ./DockerInstall.sh + #rm DockerInstall.sh + else + Error_NoConnection_NoInstall + fi + + fi + + #FuguHub + INSTALLING_INDEX=161 + if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + + Banner_Installing + + if (( $HW_ARCH == 10 )); then + + INSTALL_URL_ADDRESS='http://FuguHub.com/install/FuguHub.linux.install' + + else + + INSTALL_URL_ADDRESS='http://FuguHub.com/releases/raspberrypi/install.sh' + + fi + + /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + + if (( $? == 0 )); then + + wget -O FHinstall.sh "$INSTALL_URL_ADDRESS" + chmod +x FHinstall.sh + ./FHinstall.sh + rm FHinstall.sh + wget http://fuguhub.com/box.zip -O /home/bd/applications/box.zip + + else + Error_NoConnection_NoInstall + fi + + fi + + #Nukkit + INSTALLING_INDEX=164 + if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + + Banner_Installing + + INSTALL_URL_ADDRESS='http://ci.mengcraft.com:8080/job/nukkit/lastStableBuild/artifact/target/nukkit-1.0-SNAPSHOT.jar' + + /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + + if (( $? == 0 )); then + + mkdir /usr/local/bin/nukkit + wget -O /usr/local/bin/nukkit/nukkit.jar "$INSTALL_URL_ADDRESS" + + else + Error_NoConnection_NoInstall + fi + fi + + #GITEA + INSTALLING_INDEX=165 + if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + + Banner_Installing + + INSTALL_URL_ADDRESS='https://dl.gitea.io/gitea/1.2/gitea-1.2-' + + #armv6 + if (( $HW_ARCH == 1 )); then + + INSTALL_URL_ADDRESS+='linux-arm-6' + + #armv7+ + elif (( $HW_ARCH == 2 )); then + + INSTALL_URL_ADDRESS+='linux-arm-7' + + #x86_64 + elif (( $HW_ARCH == 10 )); then + + INSTALL_URL_ADDRESS+='linux-amd64' + fi + + /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + + #Install + if (( $? == 0 )); then + + #create user + adduser --system --group git + sleep 2 + mkdir /home/git/gitea + wget -O /home/git/gitea/gitea "$INSTALL_URL_ADDRESS" + chmod +x /home/git/gitea/gitea + chown -R git:git /home/git/gitea + + # Download systemd file + wget -O /etc/systemd/system/gitea.service https://github.com/go-gitea/gitea/raw/master/contrib/systemd/gitea.service + + + else + + Error_NoConnection_NoInstall + + fi + + fi + + + #Allo Web Interface + INSTALLING_INDEX=159 #160 for quick reinstall + if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 || + ${aSOFTWARE_INSTALL_STATE[160]} == 1 )); then + + Banner_Installing + + INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/allo_web_interface_v3.7z' + /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + if (( $? == 0 )); then + + wget "$INSTALL_URL_ADDRESS" -O package.7z + 7z x -y package.7z -o/var/www/ + rm package.7z + else + Error_NoConnection_NoInstall + fi fi - #FuguHub - INSTALLING_INDEX=161 + #Gmediarender + INSTALLING_INDEX=163 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing + INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/gmrender_1_' if (( $HW_ARCH == 10 )); then - INSTALL_URL_ADDRESS='http://FuguHub.com/install/FuguHub.linux.install' + INSTALL_URL_ADDRESS+='amd64.deb' - else + elif (( $HW_ARCH == 3 )); then - INSTALL_URL_ADDRESS='http://FuguHub.com/releases/raspberrypi/install.sh' + INSTALL_URL_ADDRESS+='arm64.deb' + + elif (( $HW_ARCH == 2 )); then + + INSTALL_URL_ADDRESS+='armv7.deb' + + elif (( $HW_ARCH == 1 )); then + + INSTALL_URL_ADDRESS+='armv6.deb' fi /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - wget -O FHinstall.sh "$INSTALL_URL_ADDRESS" - chmod +x FHinstall.sh - ./FHinstall.sh - rm FHinstall.sh - wget http://fuguhub.com/box.zip -O /home/bd/applications/box.zip + AGI libupnp6 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-alsa + + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb else + Error_NoConnection_NoInstall + fi fi - #Nukkit - INSTALLING_INDEX=164 + #AudioPhonics Pi-SPC + INSTALLING_INDEX=166 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - INSTALL_URL_ADDRESS='http://ci.mengcraft.com:8080/job/nukkit/lastStableBuild/artifact/target/nukkit-1.0-SNAPSHOT.jar' + #NB: Please see configuration section - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + fi + + #Raspotify + INSTALLING_INDEX=167 + if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + + Banner_Installing + INSTALL_URL_ADDRESS='https://dtcooper.github.io/raspotify/key.asc' + /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - mkdir /usr/local/bin/nukkit - wget -O /usr/local/bin/nukkit/nukkit.jar "$INSTALL_URL_ADDRESS" + wget -O - "$INSTALL_URL_ADDRESS" | apt-key add - + echo -e "deb https://dtcooper.github.io/raspotify jessie main" > /etc/apt/sources.list.d/raspotify.list + apt-get update + + AGI raspotify else + Error_NoConnection_NoInstall + fi + fi - #Allo Web Interface - INSTALLING_INDEX=159 #160 for quick reinstall - if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 || - ${aSOFTWARE_INSTALL_STATE[160]} == 1 )); then + #moOde + INSTALLING_INDEX=168 + if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/allo_web_interface.7z' + INSTALL_URL_ADDRESS='http://moodeaudio.org/downloads/beta/r40b8/rel-stretch.zip' /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - wget "$INSTALL_URL_ADDRESS" -O package.7z - 7z x -y package.7z -o/var/www/ - rm package.7z + cd "$HOME" + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip + + #Pre-Reqs ----------------------------------------------------------------------- + # Core packages + AGI rpi-update mpc memcached $PHP_APT_PACKAGE_NAME-memcache \ +bs2b-ladspa libbs2b0 libasound2-plugin-equal telnet automake sysstat tcpdump shellinabox \ +udisks-glue exfat-fuse inotify-tools libav-tools + +#php5-memcached + + # WiFi Hotspot + AGI dnsmasq hostapd + + # BT + AGI bluez bluez-firmware \ +dh-autoreconf expect libortp-dev libbluetooth-dev libasound2-dev \ +libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc-dev + + if (( $HW_MODEL < 10 )); then + + AGI pi-bluetooth + + fi + + # MPD dev libs for compile + AGI libmad0-dev libmpg123-dev libid3tag0-dev \ +libflac-dev libvorbis-dev libfaad-dev \ +libwavpack-dev \ +libavcodec-dev libavformat-dev \ +libmp3lame-dev \ +libsoxr-dev \ +libcdio-paranoia-dev libiso9660-dev \ +libcurl4-gnutls-dev \ +libasound2-dev \ +libshout3-dev libyajl-dev \ +libmpdclient-dev \ +libavahi-client-dev \ +libsystemd-dev \ +libwrap0-dev \ +libboost-dev \ +libicu-dev \ +libglib2.0-dev + + #Disable Shell in box -------------------------------------------------------------------- + systemctl stop shellinabox + systemctl disable shellinabox + + #HostAPD/BT ------------------------------------------------------------------------------- + systemctl disable hostapd + systemctl disable dnsmasq + + cd "$HOME" + git clone https://github.com/Arkq/bluez-alsa.git --depth=1 + cd bluez-alsa + autoreconf --install + mkdir build + cd build + ../configure --disable-hcitop --with-alsaplugindir=/usr/lib/arm-linux-gnueabihf/alsa-lib + make -j $(nproc --all) + make install + cd "$HOME" + rm -rf bluez-alsa + + systemctl daemon-reload + systemctl disable bluetooth.service + systemctl disable bluealsa.service + systemctl disable hciuart.service + + mkdir -p /var/run/bluealsa + + #Wiring Pi ------------------------------------------------------------------------------- + #??? Use/test with DietPi WP install + cd "$HOME" + cp ./rel-stretch/other/wiringpi/wiringPi-*.tar.gz ./ + tar xfz ./wiringPi-*.tar.gz + cd wiringPi-96344ff + ./build + cd "$HOME" + rm -rf ./wiringPi-* + + #Rotary encoder driver -------------------------------------------------------------------- + cp ./rel-stretch/other/rotenc/rotenc.c ./ + gcc -std=c99 rotenc.c -orotenc -lwiringPi + cp ./rotenc /usr/local/bin + rm ./rotenc* + + #Compile and install MPD ------------------------------------------------------------------ + #??? Use DietPi's MPD install in future? + # ENV + useradd mpd + mkdir /var/lib/mpd + mkdir /var/lib/mpd/music + mkdir /var/lib/mpd/playlists + touch /var/lib/mpd/state + chown -R mpd:audio /var/lib/mpd + mkdir /var/log/mpd + touch /var/log/mpd/mpd.log + chmod 644 /var/log/mpd/mpd.log + chown -R mpd:audio /var/log/mpd + cp ./rel-stretch/mpd/mpd.conf.default /etc/mpd.conf + chown mpd:audio /etc/mpd.conf + chmod 0666 /etc/mpd.conf + mkdir -p /var/run/mpd + + # Download/compile + cd "$HOME" + wget http://www.musicpd.org/download/mpd/0.20/mpd-0.20.10.tar.xz + tar xf mpd-*.tar.xz + cd mpd-0.20.10 + ./autogen.sh + + ./configure --enable-database --enable-libmpdclient --enable-alsa \ +--enable-curl --enable-dsd --enable-ffmpeg --enable-flac \ +--enable-id3 --enable-soundcloud --enable-lame-encoder --enable-mad \ +--enable-mpg123 --enable-pipe-output --enable-recorder-output --enable-shout \ +--enable-vorbis --enable-wave-encoder --enable-wavpack --enable-httpd-output \ +--enable-soxr --with-zeroconf=avahi \ +--disable-bzip2 --disable-zzip --disable-fluidsynth --disable-gme \ +--disable-wildmidi --disable-sqlite --disable-jack --disable-ao --disable-oss \ +--disable-ipv6 --disable-pulse --disable-nfs --disable-smbclient \ +--disable-upnp --disable-expat --disable-lsr \ +--disable-sndfile --disable-audiofile --disable-sidplay + + make -j $(nproc --all) + make install + strip --strip-unneeded /usr/local/bin/mpd + cd "$HOME" + rm -R mpd-* else @@ -7224,39 +7658,44 @@ _EOF_ fi - #Gmediarender - INSTALLING_INDEX=163 + #Google AIY + INSTALLING_INDEX=169 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/gmrender_1_' - if (( $HW_ARCH == 10 )); then - - INSTALL_URL_ADDRESS+='amd64.deb' + INSTALL_URL_ADDRESS='https://github.com/google/aiyprojects-raspbian.git' + /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + if (( $? == 0 )); then - elif (( $HW_ARCH == 3 )); then + git clone "$INSTALL_URL_ADDRESS" "$FP_DIETPI_USERDATA_DIRECTORY"/voice-recognizer-raspi + cd "$FP_DIETPI_USERDATA_DIRECTORY"/voice-recognizer-raspi - INSTALL_URL_ADDRESS+='arm64.deb' + pip3 install --upgrade pip virtualenv + virtualenv --system-site-packages -p python3 env + env/bin/pip install -r requirements.txt - elif (( $HW_ARCH == 2 )); then + #??? ARMv7 only + if (( $HW_ARCH == 2 )); then - INSTALL_URL_ADDRESS+='armv7.deb' + env/bin/pip install google-assistant-library==0.0.3 - elif (( $HW_ARCH == 1 )); then + fi - INSTALL_URL_ADDRESS+='armv6.deb' + # - Services + sed -i "s#/home/pi#$FP_DIETPI_USERDATA_DIRECTORY#g" systemd/voice-recognizer.service + sed -i "/^User=/c\User=dietpi" systemd/voice-recognizer.service - fi + cp systemd/voice-recognizer.service /etc/systemd/system/ + cp systemd/alsa-init.service /etc/systemd/system/ + #cp systemd/ntpdate.service /etc/systemd/system/ - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then + source env/bin/activate - AGI libupnp6 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-alsa + # - Enable default app for service start + cp src/assistant_library_with_button_demo.py src/main.py - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb + cd "$HOME" else @@ -7769,7 +8208,7 @@ _EOF_ python ./install.py rm install.py - AGI python-pip + AGI python-pip python3-pip else @@ -7836,28 +8275,62 @@ _EOF_ INSTALLING_INDEX=157 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - Banner_Installing + Banner_Installing + + HA_USER="homeassistant" + HA_USERROOT="/home/$HA_USER" + HA_SRVROOT="/srv/homeassistant" + HA_PYENV_ACTIVATION="export PATH=\"$HA_USERROOT/.pyenv/bin:\$PATH\"; eval \"\$(pyenv init -)\"; eval \"\$(pyenv virtualenv-init -)\"" + HA_PYTHON_VERSION="3.6.3" + + /DietPi/dietpi/func/dietpi-notify 2 "HA_USER: $HA_USER" + /DietPi/dietpi/func/dietpi-notify 2 "HA_USERROOT: $HA_USERROOT" + /DietPi/dietpi/func/dietpi-notify 2 "HA_SRVROOT: $HA_SRVROOT" + /DietPi/dietpi/func/dietpi-notify 2 "HA_PYENV_ACTIVATION: $HA_PYENV_ACTIVATION" + /DietPi/dietpi/func/dietpi-notify 2 "HA_PYTHON_VERSION: $HA_PYTHON_VERSION" + + # Install needed libraries + AGI libssl-dev git cmake libc-ares-dev uuid-dev daemon curl libgnutls28-dev libgnutlsxx28 nmap net-tools sudo libglib2.0-dev libudev-dev swig libssl-dev libusb-1.0-0 gcc libssl-dev libffi-dev libbz2-dev zlib1g-dev libreadline-dev libsqlite3-dev libncurses5-dev libncursesw5-dev + if (( $DISTRO == 3 )); then + AGI libmysqlclient-dev + fi + if (( $DISTRO == 4 )); then + AGI libmariadbclient-dev + fi + + # Setup the user account information + adduser --system $HA_USER + addgroup $HA_USER + usermod -G dialout -a $HA_USER + # this allows the dietpi user to edit the files along with HA. + usermod -G dietpi -a $HA_USER + mkdir $HA_SRVROOT + chown $HA_USER:$HA_USER $HA_SRVROOT + + # Install pyenv + su --shell /bin/bash --command "cd $HA_USERROOT; curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash" $HA_USER - AGI python3 python3-pip libssl-dev cmake libc-ares-dev uuid-dev daemon curl libgnutls28-dev libgnutlsxx28 nmap net-tools sudo libglib2.0-dev cython3 libudev-dev python3-sphinx python3-setuptools libmysqlclient-dev swig libssl-dev python-dev libusb-1.0-0 gcc python3-dev libssl-dev libffi-dev + # Install Python which is needed for HA. + su --shell /bin/bash --command "cd $HA_USERROOT; $HA_PYENV_ACTIVATION; pyenv install $HA_PYTHON_VERSION" $HA_USER - pip3 install --upgrade virtualenv + # Make the virtual environment. + su --shell /bin/bash --command "cd $HA_SRVROOT; $HA_PYENV_ACTIVATION; pyenv virtualenv $HA_PYTHON_VERSION homeassistant-$HA_PYTHON_VERSION" $HA_USER + su --shell /bin/bash --command "cd $HA_SRVROOT; $HA_PYENV_ACTIVATION; pyenv local homeassistant-$HA_PYTHON_VERSION" $HA_USER + su --shell /bin/bash --command "cd $HA_SRVROOT; $HA_PYENV_ACTIVATION; pyenv local" $HA_USER - adduser --system homeassistant - addgroup homeassistant - usermod -G dialout -a homeassistant - # this allows the dietpi user to edit the files along with HA. - usermod -G dietpi -a homeassistant - mkdir /srv/homeassistant - chown homeassistant:homeassistant /srv/homeassistant + # Install Home Assistant and extra modules. + su --shell /bin/bash --command "cd $HA_SRVROOT; $HA_PYENV_ACTIVATION; pyenv activate homeassistant-$HA_PYTHON_VERSION; pip3 install colorlog PyMySQL mysqlclient" $HA_USER + su --shell /bin/bash --command "cd $HA_SRVROOT; $HA_PYENV_ACTIVATION; pyenv activate homeassistant-$HA_PYTHON_VERSION; pip3 install --upgrade homeassistant" $HA_USER + + # Generate the scripts to launch HA using pyenv. + echo '#!/bin/bash' > $HA_SRVROOT/homeassistant-start.sh + echo "cd $HA_SRVROOT" >> $HA_SRVROOT/homeassistant-start.sh + echo "$HA_PYENV_ACTIVATION" >> $HA_SRVROOT/homeassistant-start.sh + echo "pyenv activate homeassistant-$HA_PYTHON_VERSION" >> $HA_SRVROOT/homeassistant-start.sh + echo "hass -c \"$HA_USERROOT/.homeassistant\"" >> $HA_SRVROOT/homeassistant-start.sh + #su --shell /bin/bash --command "/srv/homeassistant/homeassistant-start.sh" homeassistant + chmod +x /srv/homeassistant/homeassistant-start.sh - su -s /bin/bash homeassistant < /dev/null + ln -fs /usr/share/owncloud /var/www/owncloud + #Setup Data directory local target_data_dir="$FP_DIETPI_USERDATA_DIRECTORY/owncloud_data" mkdir -p "$target_data_dir" - #Create symlink from default /var/www/owncloud/data to FP_DIETPI_USERDATA_DIRECTORY - local target_data_symlink="/var/www/owncloud/data" + #Create symlink from default owncloud/data to FP_DIETPI_USERDATA_DIRECTORY + local target_data_symlink="/usr/share/owncloud/data" mkdir -p "$target_data_symlink" &> /dev/null # - Copy existing data to our data location @@ -8611,18 +9092,29 @@ _EOF_ INSTALLING_INDEX=114 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - #Install/Enable necessary PHP modules: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation + # Install/Enable necessary PHP modules: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation AGI "$PHP_APT_PACKAGE_NAME"-intl ${PHP_APT_PACKAGE_NAME}enmod curl gd intl json pdo_mysql opcache apcu - #Solve: https://github.com/Fourdee/DietPi/issues/1067#issuecomment-335200352 + # Solve: https://github.com/Fourdee/DietPi/issues/1067#issuecomment-335200352 if (( $DISTRO >= 4 )); then phpenmod ctype dom fileinfo iconv mbstring posix simplexml xmlwriter xmlreader zip exif fi - #Create Nextcloud specific webserver + PHP config. - #Apache: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#apache-web-server-configuration + # APCu configuration: To prevent cli (cron.php) producing Nextcloud log [info] entries. + grep -q 'apc.enable_cli=' $FP_PHP_BASE_DIR/mods-available/apcu.ini && sed -i '/apc.enable_cli=/c\apc.enable_cli=1' $FP_PHP_BASE_DIR/mods-available/apcu.ini || echo 'apc.enable_cli=1' >> $FP_PHP_BASE_DIR/mods-available/apcu.ini + + # OPCache configuration: https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html?highlight=opcache#enable-php-opcache + grep -q 'opcache.enable=' $FP_PHP_BASE_DIR/mods-available/opcache.ini && sed -i '/opcache.enable=/c\opcache.enable=1' $FP_PHP_BASE_DIR/mods-available/opcache.ini || echo 'opcache.enable=1' >> $FP_PHP_BASE_DIR/mods-available/opcache.ini + grep -q 'opcache.enable_cli=' $FP_PHP_BASE_DIR/mods-available/opcache.ini && sed -i '/opcache.enable_cli=/c\opcache.enable_cli=1' $FP_PHP_BASE_DIR/mods-available/opcache.ini || echo 'opcache.enable_cli=1' >> $FP_PHP_BASE_DIR/mods-available/opcache.ini + grep -q 'opcache.interned_strings_buffer=' $FP_PHP_BASE_DIR/mods-available/opcache.ini && sed -i '/opcache.interned_strings_buffer=/c\opcache.interned_strings_buffer=8' $FP_PHP_BASE_DIR/mods-available/opcache.ini || echo 'opcache.interned_strings_buffer=8' >> $FP_PHP_BASE_DIR/mods-available/opcache.ini + grep -q 'opcache.max_accelerated_files=' $FP_PHP_BASE_DIR/mods-available/opcache.ini && sed -i '/opcache.max_accelerated_files=/c\opcache.max_accelerated_files=10000' $FP_PHP_BASE_DIR/mods-available/opcache.ini || echo 'opcache.max_accelerated_files=10000' >> $FP_PHP_BASE_DIR/mods-available/opcache.ini + grep -q 'opcache.save_comments=' $FP_PHP_BASE_DIR/mods-available/opcache.ini && sed -i '/opcache.save_comments=/c\opcache.save_comments=1' $FP_PHP_BASE_DIR/mods-available/opcache.ini || echo 'opcache.save_comments=1' >> $FP_PHP_BASE_DIR/mods-available/opcache.ini + grep -q 'opcache.revalidate_freq=' $FP_PHP_BASE_DIR/mods-available/opcache.ini && sed -i '/opcache.revalidate_freq=/c\opcache.revalidate_freq=1' $FP_PHP_BASE_DIR/mods-available/opcache.ini || echo 'opcache.revalidate_freq=1' >> $FP_PHP_BASE_DIR/mods-available/opcache.ini + + # Create Nextcloud specific webserver config. + # Apache: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#apache-web-server-configuration if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then a2enmod rewrite headers env dir mime @@ -8640,31 +9132,8 @@ Alias /nextcloud "/var/www/nextcloud/" SetEnv HOME /var/www/nextcloud SetEnv HTTP_HOME /var/www/nextcloud - # OPCache configuration: https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html?highlight=opcache#enable-php-opcache - #php_admin_value opcache.enable 1 defaults anyway and isn't possible here: http://php.net/manual/en/opcache.configuration.php#ini.opcache.enable - php_admin_value opcache.enable_cli 1 - php_admin_value opcache.interned_strings_buffer 8 - php_admin_value opcache.max_accelerated_files 10000 - php_admin_value opcache.memory_consumption 128 - php_admin_value opcache.save_comments 1 - php_admin_value opcache.revalidate_freq 1 - - # MySQL/MariaDB configuration: https://docs.nextcloud.com/server/12/admin_manual/configuration_database/linux_database_configuration.html#configuring-a-mysql-or-mariadb-database - php_admin_value mysql.allow_local_infile 1 - php_admin_value mysql.allow_persistent 1 - php_admin_value mysql.cache_size 2000 - php_admin_value mysql.max_persistent -1 - php_admin_value mysql.max_links -1 - php_admin_value mysql.default_port 0 - php_admin_value mysql.default_socket /var/run/mysqld/mysqld.sock - #php_admin_value mysql.default_host - #php_admin_value mysql.default_user - #php_admin_value mysql.default_password - php_admin_value mysql.connect_timeout 60 - php_admin_value mysql.trace_mode 0 - - # APCu configuration: To prevent cron.php produce Nextcloud log [info] entry. - php_admin_value apc.enable_cli 1 + # Hard coding 128M OPCache size, only for /nextcloud, to suppress warning on nextcloud admin panel. + php_admin_value opcache.memory_consumption 128 _EOF_ @@ -8673,6 +9142,113 @@ _EOF_ fi + # Nginx: https://docs.nextcloud.com/server/12/admin_manual/installation/nginx.html#nextcloud-in-a-subdir-of-nginx + if (( ${aSOFTWARE_INSTALL_STATE[85]} >= 1 )); then + + cat << _EOF_ > /etc/nginx/sites-dietpi/nextcloud.config +location ^~ /nextcloud { + + # Security headers + add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;"; + add_header X-Content-Type-Options nosniff; + add_header X-XSS-Protection "1; mode=block"; + add_header X-Robots-Tag none; + add_header X-Download-Options noopen; + add_header X-Permitted-Cross-Domain-Policies none; + + # set max upload size + client_max_body_size $(( $(php -r 'print(PHP_INT_MAX);') / 1024 / 1024))M; + fastcgi_buffers 64 4K; + + # Enable gzip but do not remove ETag headers + gzip on; + gzip_vary on; + gzip_comp_level 4; + gzip_min_length 256; + gzip_proxied expired no-cache no-store private no_last_modified no_etag auth; + gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; + + # Uncomment if your server is build with the ngx_pagespeed module + # This module is currently not supported. + #pagespeed off; + + location /nextcloud { + rewrite ^ /nextcloud/index.php\$request_uri; + } + + location ~ ^/nextcloud/(?:build|tests|config|lib|3rdparty|templates|data)/ { + deny all; + } + + location ~ ^/nextcloud/(?:\.|autotest|occ|issue|indie|db_|console) { + deny all; + } + + location ~ ^/nextcloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) { + include fastcgi_params; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_param SCRIPT_FILENAME \$request_filename; + fastcgi_param PATH_INFO \$fastcgi_path_info; + # HTTPS forces redirection from http://, thus has to be enabled only on active HTTPS environment. + #fastcgi_param HTTPS on; + # Avoid sending the security headers twice + fastcgi_param modHeadersAvailable true; + fastcgi_param REMOTE_USER \$remote_user; + fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_intercept_errors on; + # Disable because Jessie Nginx does not support that parameter + #fastcgi_request_buffering off; + # Hard coding 128M OPCache size, only for /nextcloud, to suppress warning on nextcloud admin panel. + fastcgi_param PHP_ADMIN_VALUE "opcache.memory_consumption=128"; + } + + location ~ ^/nextcloud/(?:updater|ocs-provider)(?:$|/) { + try_files \$uri/ =404; + index index.php; + } + + # Adding the cache control header for js and css files + # Make sure it is BELOW the PHP block + location ~ \.(?:css|js|woff|svg|gif)$ { + try_files \$uri /nextcloud/index.php\$uri\$is_args\$args; + add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;"; + add_header Cache-Control "public, max-age=15778463"; + add_header X-Content-Type-Options nosniff; + add_header X-XSS-Protection "1; mode=block"; + add_header X-Robots-Tag none; + add_header X-Download-Options noopen; + add_header X-Permitted-Cross-Domain-Policies none; + # Optional: Don't log access to assets + access_log off; + } + + location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ { + try_files \$uri /nextcloud/index.php\$uri$is_args\$args; + # Optional: Don't log access to other assets + access_log off; + } + +} +_EOF_ + + # - Stretch, set php7.0 and fastcgi_request_buffering off; + if (( $DISTRO >= 4 )); then + + sed -i "s#/run/php5-fpm.sock#/run/php/php7.0-fpm.sock#g" /etc/nginx/sites-dietpi/nextcloud.config + sed -i "s#\#fastcgi_request_buffering off;#fastcgi_request_buffering off;#g" /etc/nginx/sites-dietpi/nextcloud.config + + fi + + # Set HTTPS on, if SSL connection is available, even with self-signed/untrusted certificate. + DietPi/dietpi/func/check_connection https://localhost &> /dev/null + if (( $? == 0 || $? == 5)); then + + sed -i "s#\#fastcgi_param HTTPS on;#fastcgi_param HTTPS on;#g" /etc/nginx/sites-dietpi/nextcloud.config + + fi + + fi + mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/nextcloud_data Install_Apply_Permissions &> /dev/null @@ -8686,19 +9262,22 @@ _EOF_ fi - # - Create DB v11: https://github.com/Fourdee/DietPi/issues/647#issuecomment-267019815 - /DietPi/dietpi/func/create_mysql_db nextcloud "$GLOBAL_PW" root "$GLOBAL_PW" - sudo -u www-data php /var/www/nextcloud/occ maintenance:install --no-interaction --database "mysql" --database-name "nextcloud" --database-user "root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$FP_DIETPI_USERDATA_DIRECTORY/nextcloud_data" - #Disable trusted_domains. + # Remove obsolete 'oc_admin'@'%' MySQL user: + mysql -uroot -p"$GLOBAL_PW" -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" + + # Disable trusted_domains. if (( ! $(cat /var/www/nextcloud/config/config.php | grep -ci -m1 "1 => '*'") )); then sed -i "/0 => 'localhost'/a 1 => '*'," /var/www/nextcloud/config/config.php fi - #Owncloud/Nextcloud ignores system wide php.ini settings. Use their own config. + # Set CLI URL to Nextcloud sub directory: + sed -i "s#'http://localhost'#'http://localhost/nextcloud'#g" + + # Owncloud/Nextcloud ignores system wide php.ini settings. Use their own config. # - max upload size local php_max_upload_size="$(( $(php -r 'print(PHP_INT_MAX);') / 1024 / 1024))M" @@ -8860,7 +9439,6 @@ ExecStart=/usr/bin/mpd --no-daemon /etc/mpd.conf # allow MPD to use real-time priority 50 LimitRTPRIO=50 -LimitRTTIME=-1 [Install] WantedBy=multi-user.target @@ -11788,15 +12366,15 @@ _EOF_ INSTALLING_INDEX=157 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - cat << _EOF_ > /etc/systemd/system/home-assistant.service + cat << _EOF_ > /etc/systemd/system/home-assistant.service [Unit] Description=Home Assistant After=network.target [Service] Type=simple -User=%i -ExecStart=/srv/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant" +User=homeassistant +ExecStart=/srv/homeassistant/homeassistant-start.sh [Install] WantedBy=multi-user.target @@ -11895,6 +12473,18 @@ _EOF_ fi + #GITEA Config + INSTALLING_INDEX=165 + if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + # - Data storage / user data + mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/gitea-repositories + + # - sqldb + /DietPi/dietpi/func/create_mysql_db gitea "$GLOBAL_PW" root "$GLOBAL_PW" + + fi + + #Allo Config INSTALLING_INDEX=159 #160 for quick reinstall/update if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 || @@ -11978,6 +12568,289 @@ _EOF_ fi + #AudioPhonics Pi-SPC + INSTALLING_INDEX=166 + if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + + mkdir -p /etc/dietpi/audiophonics/pi-spc + + cat << _EOF_ > /etc/dietpi/audiophonics/pi-spc/sds.sh +#!/bin/bash +#DietPi version +PATH=/usr/bin:/home/pi/wiringPi/gpio:/usr/local/bin + +TICKRATE=0.25 + +echo -e "Audiophonics Shutdown script starting..." +echo -e "Asserting pins : " +echo -e "ShutDown : GPIO17=in, Low" +echo -e "BootOK : GPIO22=out, High" +echo -e "SoftSD : GPIO04=out, Low" + +gpio -g mode 04 out +gpio -g write 04 0 +gpio -g mode 17 in +gpio -g write 17 0 +gpio -g mode 22 out +gpio -g write 22 1 + +while true +do + + if (( \$(gpio -g read 17) == 1 )); then + + /DietPi/dietpi/func/dietpi-notify 0 "AudioPhonics Pi-SPC: Power off requested. Shutting down system." + sudo poweroff + #sudo shutdown -h -P now + break + + fi + + sleep \$TICKRATE + +done + +exit 0 +_EOF_ + + chmod +x /etc/dietpi/audiophonics/pi-spc/sds.sh + + cat << _EOF_ > /etc/systemd/system/pi-spc.service +[Unit] +Description=AudioPhonics Pi-SPC + +[Service] +Type=simple +StandardOutput=tty +User=root + +ExecStart=/bin/bash -c '/etc/dietpi/audiophonics/pi-spc/sds.sh' + +[Install] +WantedBy=multi-user.target +_EOF_ + + fi + + #moOde Configuration + INSTALLING_INDEX=168 + if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + + #Create moOde runtime environment --------------------------------------------------------- + # Create Pi user, does not exist on DietPi systems. + # - Required for some moOde bash scripts which live in /home/pi + /DietPi/dietpi/func/dietpi-set_software useradd pi + + # Priv + #echo -e 'pi\tALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers # Completed with /DietPi/dietpi/func/dietpi-set_software useradd pi + echo -e 'www-data\tALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers + + # Dirs + mkdir -p /var/local/www/commandw + mkdir -p /var/local/www/cssw + mkdir -p /var/local/www/jsw + mkdir -p /var/local/www/imagesw + mkdir -p /var/local/www/imagesw/toggle + mkdir -p /var/local/www/db + mkdir -p /var/local/www/templatesw + chmod -R 0755 /var/local/www + + mkdir -p /var/lib/mpd/music/RADIO + mkdir -p /mnt/NAS + mkdir -p /mnt/SDCARD + mkdir -p /mnt/UPNP + mkdir /media + + # Symlinks + ln -s /mnt/NAS /var/lib/mpd/music/NAS + ln -s /mnt/SDCARD /var/lib/mpd/music/SDCARD + ln -s /media /var/lib/mpd/music/USB + ln -s /var/lib/mpd/music /var/www/mpdmusic + + # Logs + touch /var/log/moode.log + chmod 0666 /var/log/moode.log + touch /var/log/php_errors.log + chmod 0666 /var/log/php_errors.log + + # Files + cp ./rel-stretch/mpd/sticker.sql /var/lib/mpd + cp -r "./rel-stretch/other/sdcard/Stereo Test/" /var/lib/mpd/music/SDCARD + #cp ./rel-stretch/network/interfaces.default /etc/network/interfaces #Disabled as overwrites DietPi network conf. As DietPi does not use/set /etc/dhcpcd.conf, this will render no connection after reboot. + cp ./rel-stretch/network/wpa_supplicant.conf.default /etc/wpa_supplicant/wpa_supplicant.conf + cp ./rel-stretch/network/dhcpcd.conf.default /etc/dhcpcd.conf + cp ./rel-stretch/network/hostapd.conf.default /etc/hostapd/hostapd.conf + cp ./rel-stretch/var/local/www/db/moode-sqlite3.db.default /var/local/www/db/moode-sqlite3.db + + # Permissions + chmod 0777 /var/lib/mpd/music/RADIO + chmod -R 0777 /var/local/www/db + + # Deletes + rm /etc/update-motd.d/10-uname + + #Install moOde sources and configs --------------------------------------------------------- + # Application sources and configs + rm /var/lib/mpd/music/RADIO/* + rm /var/www/images/radio-logos/* + + cp ./rel-stretch/mpd/RADIO/* /var/lib/mpd/music/RADIO + cp ./rel-stretch/mpd/playlists/* /var/lib/mpd/playlists + cp -r ./rel-stretch/etc/* /etc/ + cp -r ./rel-stretch/home/* /home/pi/ + cp -r ./rel-stretch/home/.dircolors /home/pi/ + cp -r ./rel-stretch/lib/* /lib/ + cp -r ./rel-stretch/usr/* /usr/ + cp -r ./rel-stretch/var/* /var/ + cp -r ./rel-stretch/www/* /var/www/ + + # Prep SQL DB + chmod 0755 /var/www/command/* + /var/www/command/util.sh "emerald" "2ecc71" "27ae60" + sqlite3 /var/local/www/db/moode-sqlite3.db "update cfg_system set value='Emerald' where param='themecolor'" + + # Permissions for service files + # - MPD + chmod 0755 /etc/init.d/mpd + chmod 0644 /lib/systemd/system/mpd.service + chmod 0644 /lib/systemd/system/mpd.socket + + # - Bluetooth + chmod 0666 /etc/bluealsaaplay.conf + chmod 0644 /etc/systemd/system/bluealsa-aplay@.service + chmod 0644 /etc/systemd/system/bluealsa.service + chmod 0644 /lib/systemd/system/bluetooth.service + chmod 0755 /usr/local/bin/a2dp-autoconnect + + # - Rotenc + chmod 0644 /lib/systemd/system/rotenc.service + + # - Udev + chmod 0644 /etc/udev/rules.d/* + + # Services are started by moOde Worker so lets disable them here. + systemctl daemon-reload + #systemctl disable mpd.service #dietpi-services + systemctl disable mpd.socket + systemctl disable rotenc.service + + # Following binaries will not have been installed yet, but let's disable the services here + chmod 0644 /lib/systemd/system/squeezelite-armv6l.service + chmod 0644 /lib/systemd/system/squeezelite-armv7l.service + systemctl disable squeezelite-armv6l + systemctl disable squeezelite-armv7l + chmod 0644 /lib/systemd/system/upmpdcli.service + systemctl disable upmpdcli.service + + # Initial permissions for certain files. These also get set during moOde Worker startup. + chmod 0777 /var/local/www/playhistory.log + chmod 0777 /var/local/www/currentsong.txt + touch /var/local/www/libcache.json + chmod 0777 /var/local/www/libcache.json + + #ALSAEQ ------------------------------------------------------------------------------------ + #alsamixer -D alsaequal # Disabled, need to automate alsaequal.bin generation. + chmod 0755 /usr/local/bin/alsaequal.bin + chown mpd:audio /usr/local/bin/alsaequal.bin + rm /usr/share/alsa/alsa.conf.d/equal.conf + + mpc enable only 1 + + #DietPi - Post steps START ----------------------------------------------------------------- + # PHP-FPM set to v5 if Jessie + # /etc/nginx/nginx.conf + # fastcgi_pass unix:/run/php5-fpm.sock; + + # Link /mnt/dietpi_userdata/Music to MPD/moOde defaults + ln -sf /mnt/dietpi_userdata/Music /var/lib/mpd/music/DietPi_UserData_Music + + # ??? Support for all webserver types with global site conf? (eg: lighttpd/nginx/apache2) + # Need to also look at fastcgi_parms in /etc/nginx + # ln -sf /var/local/www/cssw /var/www/cssw + # ln -sf /var/local/www/imagesw /var/www/imagesw + # ln -sf /var/local/www/jsw /var/www/jsw + # ln -sf /var/local/www/templatesw /var/www/templatesw + # chown -R www-data:www-data /var/local/www + + #Remove default .html site + rm /var/www/index.h* + + # Combined /etc/rc.local + cat << _EOF_ > /etc/rc.local +#!/bin/bash +#Precaution: Wait for DietPi Ramdisk to finish +while [ ! -f /DietPi/.ramdisk ] +do + + /DietPi/dietpi/func/dietpi-notify 2 "Waiting for DietPi-RAMDISK to finish mounting DietPi to RAM..." + sleep 1 + +done + +echo -e "\$(cat /proc/uptime | awk '{print \$1}') Seconds" > /var/log/boottime +if (( \$(cat /DietPi/dietpi/.install_stage) == 1 )); then + + /DietPi/dietpi/dietpi-services start + +fi +/DietPi/dietpi/dietpi-banner 0 +echo -e " Default Login:\n Username = root\n Password = dietpi\n" + +#moOde additions +SQLDB=/var/local/www/db/moode-sqlite3.db + +# set cpu govenor +RESULT=\$(sqlite3 \$SQLDB "select value from cfg_system where param='cpugov'") +echo "\$RESULT" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor + +/usr/bin/udisks-glue > /dev/null 2>&1 +/var/www/command/worker.php > /dev/null 2>&1 + +exit 0 +_EOF_ + + # moOde worker service + # ??? Hangs on /bin/systemd-tty-ask-password-agent --watch + # cat << _EOF_ > /etc/systemd/system/moode-worker.service +# [Unit] +# Description=moOde worker.php service +# After=php7.0-fpm.service php5-fpm.service apache2.service lighttpd.service nginx.service + +# [Service] +# Type=forking +# StandardOutput=tty +# StandardInput=tty +# User=root +# ExecStart=/bin/bash -c '/var/www/command/worker.php' + +# [Install] +# WantedBy=multi-user.target +# _EOF_ + + Download_Test_Media + + #Flag compiled MPD as installed + aSOFTWARE_INSTALL_STATE[128]=2 + + #DietPi - Post steps END ------------------------------------------------------------------- + + fi + + #Google AIY + INSTALLING_INDEX=169 + if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + + # - Symlink userdata location for assistant.json + ln -sf /mnt/dietpi_userdata/voice-recognizer-raspi/assistant.json /home/dietpi/assistant.json + + # - Generate cache dir + mkdir -p /home/dietpi/.cache/voice-recognizer + + #Setup soundcard + /DietPi/dietpi/func/dietpi-set_hardware soundcard googlevoicehat-soundcard + + fi + } Install_Apply_GPU_Settings(){ @@ -12215,10 +13088,11 @@ _EOF_ systemctl start mysql mysqladmin -u root -p"$GLOBAL_PW" drop nextcloud -f + mysql -uroot -p"$GLOBAL_PW" -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")@$(grep -m1 "'dbhost'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" rm -R /var/www/nextcloud - a2dissite nextcloud 2>/dev/null - rm /etc/apache2/sites-available/nextcloud.conf 2>/dev/null - rm /etc/nginx/sites-dietpi/nextcloud.config 2>/dev/null + a2dissite nextcloud &>/dev/null + rm /etc/apache2/sites-available/nextcloud.conf &>/dev/null + rm /etc/nginx/sites-dietpi/nextcloud.config &>/dev/null elif (( $1 == 115 )); then @@ -12269,7 +13143,7 @@ _EOF_ elif (( $1 == 130 )); then - AGP python-pip + AGP python-pip python3-pip elif (( $1 == 131 )); then @@ -12470,13 +13344,12 @@ _EOF_ elif (( $1 == 59 )); then - AGP gpac motion + AGP gpac rm -R /var/www/dietpicam rm /opt/vc/bin/raspimjpeg rm /usr/bin/raspimjpeg rm /etc/dietpi/dietpi-software/services/raspimjpeg.service rm /etc/raspimjpeg - rm /etc/motion/motion.conf elif (( $1 == 45 )); then @@ -12642,14 +13515,15 @@ _EOF_ elif (( $1 == 92 )); then - rm -R /etc/letsencrypt_scripts - rm -R /etc/certbot_scripts + if (( $DISTRO >= 4 )); then - if (( $DISTRO == 4 )); then + AGP python-certbot-apache python-certbot-nginx certbot - AGP certbot fi + rm -R /etc/letsencrypt_scripts &>/dev/null + rm -R /etc/certbot_scripts &>/dev/null + elif (( $1 == 69 )); then AGP python-rpi.gpio python3-rpi.gpio @@ -12901,10 +13775,53 @@ _EOF_ elif (( $1 == 157)); then - rm -R /srv/homeassistant - userdel -r -f homeassistant + # Remove installationof HA. + rm -R /srv/homeassistant + + # Remove the user and all files. This removed pyenv for this user as well. + userdel -r -f homeassistant + groupdel homeassistant + + # Remove the service. + rm /etc/systemd/system/home-assistant.service + + elif (( $1 == 165 )); then + + # Delete the user / executible + userdel -r -f git + # Delete systemd files + rm /etc/systemd/system/gitea.service + # Delete data + rm -r "$FP_DIETPI_USERDATA_DIRECTORY"/gitea-repositories + + # drop/delete database + systemctl start mysql + mysqladmin -u root -p"$GLOBAL_PW" drop gitea -f + + elif (( $1 == 166 )); then + + rm /etc/systemd/system/pi-spc.service + rm -R /etc/dietpi/audiophonics/pi-spc + + elif (( $1 == 167 )); then + + AGP raspotify + rm /etc/apt/sources.list.d/raspotify.list + apt-get update + + elif (( $1 == 168 )); then + + echo -e "pending" + + elif (( $1 == 169 )); then + + rm -R "$FP_DIETPI_USERDATA_DIRECTORY"/voice-recognizer-raspi + rm /etc/systemd/system/voice-recognizer.service + rm /etc/systemd/system/alsa-init.service + rm -R /home/dietpi/assistant.json elif (( $1 == 158 )); then + # Remove service systemctl stop minio.service systemctl disable minio.service diff --git a/dietpi/finalise b/dietpi/finalise index 44039e47e4..1a189de078 100644 --- a/dietpi/finalise +++ b/dietpi/finalise @@ -303,7 +303,7 @@ _EOF_ #//////////////////////////////////// #Create DietPi user: https://github.com/Fourdee/DietPi/issues/796 - /DietPi/dietpi/func/dietpi-set_software useradd_dietpi 1 + /DietPi/dietpi/func/dietpi-set_software useradd dietpi #//////////////////////////////////// # Reset DietPi generated files diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index aae1f5408a..3e43946c04 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1360,6 +1360,7 @@ _EOF_ echo -e "options 8188eu rtw_power_mgnt=0" > /etc/modprobe.d/8188eu.conf echo -e "options 8189es rtw_power_mgnt=0" > /etc/modprobe.d/8189es.conf #OPi Plus echo -e "options 8723bs rtw_power_mgnt=0" > /etc/modprobe.d/8723bs.conf #PineA64 + echo -e "options wlan_8192eu rtw_power_mgnt=0" > /etc/modprobe.d/wlan_8192eu.conf # Sparky/Allo WiFi #cfg80211 first for ((i=0; i<${#aWIFI_MODULES[@]}; i++)) @@ -1695,6 +1696,11 @@ _EOF_ sed -i '/dtoverlay=allo-/d' "$FP_RPI_CONFIG" sed -i '/dtoverlay=rpi-dac/d' "$FP_RPI_CONFIG" sed -i '/dtoverlay=i-sabre-k2m/d' "$FP_RPI_CONFIG" + sed -i '/dtoverlay=googlevoicehat-soundcard/d' "$FP_RPI_CONFIG" + + # - Disable i2s maps + sed -i '/dtoverlay=i2s-mmap/d' "$FP_RPI_CONFIG" + sed -i '/dtparam=i2s=/d' "$FP_RPI_CONFIG" # onboard blacklist module echo -e "blacklist snd-bcm2835" > /etc/modprobe.d/rpi-bcm2708.conf @@ -1840,6 +1846,9 @@ _EOF_ /DietPi/dietpi/func/dietpi-notify 1 "Unable to find a USB-DAC on system." EXIT_CODE=1 + # - Reset + sed -i "/^soundcard=/c\soundcard=none" /DietPi/dietpi.txt + fi SOUNDCARD_TARGET_DEVICE=0 @@ -1905,6 +1914,18 @@ _EOF_ ;; + #googlevoicehat-soundcard + googlevoicehat-soundcard*) + + # - enable dtoverlay + cat << _EOF_ >> "$FP_RPI_CONFIG" +dtoverlay=$INPUT_DEVICE_VALUE +dtoverlay=i2s-mmap +dtparam=i2s=on +_EOF_ + + ;; + #JustBoom-dac: DAC HAT, Amp HAT, DAC Zero and Amp Zero #JustBoom-digi: Digi HAT and Digi Zero justboom-*) @@ -2098,7 +2119,7 @@ _EOF_ ;; #Rock64 ------------------------------------------------------------------------------- - rock64-hdmi) + rock64-analogue) SOUNDCARD_TARGET_CARD=1 @@ -2122,7 +2143,40 @@ _EOF_ esac # - Apply asound.conf - if (( $ALSA_EQ_ENABLED )); then + if [[ "$INPUT_DEVICE_VALUE" = 'googlevoicehat-soundcard'* ]]; then + + cat << _EOF_ > /etc/asound.conf +pcm.softvol { + type softvol + slave.pcm dmix + control { + name Master + card 0 + } +} + +pcm.micboost { + type route + slave.pcm dsnoop + ttable { + 0.0 30.0 + 1.1 30.0 + } +} + +pcm.!default { + type asym + playback.pcm "plug:softvol" + capture.pcm "plug:micboost" +} + +ctl.!default { + type hw + card 0 +} +_EOF_ + + elif (( $ALSA_EQ_ENABLED )); then cat << _EOF_ > /etc/asound.conf ctl.eq { diff --git a/dietpi/func/dietpi-set_smbclient b/dietpi/func/dietpi-set_smbclient index fc20c5a258..775c658324 100644 --- a/dietpi/func/dietpi-set_smbclient +++ b/dietpi/func/dietpi-set_smbclient @@ -42,8 +42,11 @@ Apply_And_Mount(){ + #NB: Convert spaces into '\040': https://github.com/Fourdee/DietPi/issues/1201#issuecomment-339720271 + local space_to_040=$(echo -e "$samba_clientshare" | sed 's/ /\\\\040/g') + #Apply to fstab - sed -i "/\/mnt\/samba/c\\/\/$samba_clientname\/$samba_clientshare \/mnt\/samba cifs username=$samba_clientusename,password=$samba_clientpassword,iocharset=utf8,sec=ntlm,nofail 0 0" /etc/fstab + sed -i "/\/mnt\/samba/c\\/\/$samba_clientname\/$space_to_040 \/mnt\/samba cifs username=$samba_clientusename,password=$samba_clientpassword,iocharset=utf8,sec=ntlm,nofail 0 0" /etc/fstab #Mount up mount -a diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index d23e52ac30..f95c41429b 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -12,7 +12,8 @@ # Usage: # # - /DietPi/dietpi/func/dietpi-set_software allo eth_dhcp / eth_static - # - /DietPi/dietpi/func/dietpi-set_software useradd_dietpi 0=delete / 1=create + # - /DietPi/dietpi/func/dietpi-set_software useradd X=create user with name X and default permissions, using global DietPi password (dietpi) + # - /DietPi/dietpi/func/dietpi-set_software userdel X=delete user with name X # - /DietPi/dietpi/func/dietpi-set_software apt-mirror url/default # - /DietPi/dietpi/func/dietpi-set_software ntpd-mirror url/default #//////////////////////////////////// @@ -207,72 +208,84 @@ _EOF_ } #///////////////////////////////////////////////////////////////////////////////////// - # Add DietPi user + # Users #///////////////////////////////////////////////////////////////////////////////////// - Useradd_DietPi_Main(){ + Useradd_Main(){ if [ -n "$INPUT_MODE_VALUE" ]; then - # - Delete - if [ "$INPUT_MODE_VALUE" = "disable" ]; then + # - Create $INPUT_MODE_VALUE - userdel -f dietpi - rm -R /home/dietpi + mkdir -p /home + useradd -m -s /bin/bash "$INPUT_MODE_VALUE" + chpasswd <<< "$INPUT_MODE_VALUE:$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_Global_Password=' | sed 's/.*=//')" - # - Create - elif [ "$INPUT_MODE_VALUE" = "enable" ]; then + # Copy existing profile/bashrc + cp /root/.profile /home/$INPUT_MODE_VALUE/ + cp /root/.bashrc /home/$INPUT_MODE_VALUE/ - mkdir -p /home - useradd -m -s /bin/bash dietpi - chpasswd <<< "dietpi:$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_Global_Password=' | sed 's/.*=//')" + # Sudo up dietpi login script + sed -i '/^\/DietPi\/dietpi\/login/c\sudo \/DietPi\/dietpi\/login' /home/$INPUT_MODE_VALUE/.bashrc - # Copy existing profile/bashrc - cp /root/.profile /home/dietpi/ - cp /root/.bashrc /home/dietpi/ + chown -R $INPUT_MODE_VALUE:$INPUT_MODE_VALUE /home/$INPUT_MODE_VALUE - # Sudo up dietpi login script - sed -i '/^\/DietPi\/dietpi\/login/c\sudo \/DietPi\/dietpi\/login' /home/dietpi/.bashrc + # Allow sudo without pw + if (( ! $(cat /etc/sudoers | grep -ci -m1 "^$INPUT_MODE_VALUE[[:space:]]") )); then - chown -R dietpi:dietpi /home/dietpi + cat << _EOF_ >> /etc/sudoers +$INPUT_MODE_VALUE ALL=NOPASSWD: ALL +_EOF_ - # Allow sudo without pw - if (( ! $(cat /etc/sudoers | grep -ci -m1 '^dietpi') )); then + fi - echo -e "\dietpi ALL=NOPASSWD: ALL\n" >> /etc/sudoers + # Same groups as user pi + local group_array=() + group_array+=('input') + group_array+=('netdev') + group_array+=('spi') + group_array+=('i2c') + group_array+=('gpio') + group_array+=('tty') + group_array+=('users') + group_array+=('games') + group_array+=('plugdev') + group_array+=('video') + group_array+=('audio') + group_array+=('sudo') + group_array+=('cdrom') + group_array+=('dialout') + group_array+=('adm') + + # + allow access to www-data + group_array+=('www-data') + + for ((i=0; i<${#group_array[@]}; i++)) + do - fi + usermod -a -G ${group_array[$i]} $INPUT_MODE_VALUE + + done + + unset group_array + + else - # Same groups as user pi - local group_array=() - group_array+=('input') - group_array+=('netdev') - group_array+=('spi') - group_array+=('i2c') - group_array+=('gpio') - group_array+=('tty') - group_array+=('users') - group_array+=('games') - group_array+=('plugdev') - group_array+=('video') - group_array+=('audio') - group_array+=('sudo') - group_array+=('cdrom') - group_array+=('dialout') - group_array+=('adm') + Unknown_Input_Mode - # + allow access to www-data - group_array+=('www-data') + fi - for ((i=0; i<${#group_array[@]}; i++)) - do + } - usermod -a -G ${group_array[$i]} dietpi + Userdel_Main(){ - done + if [ -n "$INPUT_MODE_VALUE" ]; then - unset group_array + # - Delete $INPUT_MODE_VALUE + userdel -f $INPUT_MODE_VALUE + rm -R /home/$INPUT_MODE_VALUE - fi + # - Remove from sudoers + sed -i "/^$INPUT_MODE_VALUE[[:space:]]/d" /etc/sudoers else @@ -295,9 +308,13 @@ _EOF_ AptMirror_Main - elif [ "$INPUT_MODE_NAME" = "useradd_dietpi" ]; then + elif [ "$INPUT_MODE_NAME" = "useradd" ]; then + + Useradd_Main + + elif [ "$INPUT_MODE_NAME" = "userdel" ]; then - Useradd_DietPi_Main + Userdel_Main elif [ "$INPUT_MODE_NAME" = "ntpd-mirror" ]; then diff --git a/dietpi/patch_file b/dietpi/patch_file index 130fe81a5b..b5e872fe55 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -33,6 +33,21 @@ DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) HW_ARCH=$(sed -n 6p /DietPi/dietpi/.hw_model) + #Global Password: Exception to AUTO first run init. + GLOBAL_PW=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_Global_Password=' | sed 's/.*=//') + if [ ! -n "$GLOBAL_PW" ]; then + + GLOBAL_PW='dietpi' + + fi + + ALLO_GUI_IMAGE=0 + if [ -f /DietPi/dietpi/.installed ] && (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 '^aSOFTWARE_INSTALL_STATE\[159\]=2') )); then + + ALLO_GUI_IMAGE=1 + + fi + AUTOINSTALL_ENABLED=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_Install_Enable=' | sed 's/.*=//') USER_INPUTS=1 if (( $AUTOINSTALL_ENABLED == 1 && $(cat /DietPi/dietpi/.install_stage) <= 0 )); then #Automated @@ -2415,7 +2430,7 @@ _EOF_ chmod 4755 /usr/bin/sudo #------------------------------------------------------------------------------- #Create DietPi user: https://github.com/Fourdee/DietPi/issues/796 - /DietPi/dietpi/func/dietpi-set_software useradd_dietpi 1 + /DietPi/dietpi/func/dietpi-set_software useradd dietpi #------------------------------------------------------------------------------- #DietPi-Config + display rotation options: https://github.com/Fourdee/DietPi/issues/859 if (( $HW_MODEL < 10 )); then @@ -2739,60 +2754,80 @@ _EOF_ #Set Ondemand as default CPU gov: https://github.com/Fourdee/DietPi/issues/1141 sed -i "/cpu_governor=/c\cpu_governor=ondemand" /DietPi/dietpi.txt #------------------------------------------------------------------------------- - #Reinstalls Allo Web interface Only - if (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 '^aSOFTWARE_INSTALL_STATE\[159\]=2') )); then - - #Update V2 images - if [ -f /etc/dietpi/.allo_web_image_version ] && (( $(cat /etc/dietpi/.allo_web_image_version) == 2 )); then - - #Update period size change for Squeezelite: - cp /DietPi/dietpi/conf/squeezelite.service /etc/systemd/system/squeezelite.service - systemctl daemon-reload - - #Update V1 images - else - - # - Add quick reinstall entry if does not exist - if (( ! $(cat /DietPi/dietpi/.installed | grep -ci -m1 '^aSOFTWARE_INSTALL_STATE\[160\]=2') )); then + #RPi update DietPi kernel: + if (( $HW_MODEL < 10 )); then - echo -e "aSOFTWARE_INSTALL_STATE[160]=2" >> /DietPi/dietpi/.installed + # - remove old flags + rm /etc/dietpi/.dietpi_rpi &> /dev/null + rm /etc/dietpi/.384khz_rpi &> /dev/null - fi + /DietPi/dietpi/func/dietpi-set_hardware kernel dietpi_rpi - # - Quick update - #/DietPi/dietpi/dietpi-software reinstall 160 + # Sabre module update + if (( $(cat /DietPi/config.txt | grep -ci -m1 'dtoverlay=i-sabre-k2m') )); then - # - Full update (including pre-req reinstalls) - /DietPi/dietpi/dietpi-software reinstall 159 + whiptail --title "i-sabre-k2m" --msgbox "Due to a kernel update, this driver must be reinstalled, however, this can only be completed after the system is rebooted.\n\nOnce the system reboots:\n - use DietPi-Config to select soundcard 'none'\n - then reselect 'i-sabre-k2m'\n - Reboot system" 14 70 fi - #Reinstalls Everything else - else + fi + #------------------------------------------------------------------------------- - # Squeezelite/Shairport-sync - /DietPi/dietpi/dietpi-software reinstall 36 37 + elif (( $VERSION_CURRENT == 157 )); then + #------------------------------------------------------------------------------- + #Allo GUI: + if (( $ALLO_GUI_IMAGE )); then + + #Regenerate unique Roon ID's: https://community.roonlabs.com/t/roon-core-will-not-recognize-two-dietpi-allo-gui-roon-bridges-simultaneously/32563/18?u=dan_knight + rm /mnt/dietpi_userdata/roon/RoonBridge/Settings/unique_id + rm /mnt/dietpi_userdata/roon/RAATServer/Settings/unique_id fi #------------------------------------------------------------------------------- - #RPi update DietPi kernel: - if (( $HW_MODEL < 10 )); then + #Reinstalls + # Squeezelite / Shairport-sync / Allo GUI (full) + /DietPi/dietpi/dietpi-software reinstall 36 37 159 + #------------------------------------------------------------------------------- + #Nextcloud: Remove obsolete MySQL user + if [ -f /var/www/nextcloud/config/config.php ]; then - # - remove old flags - rm /etc/dietpi/.dietpi_rpi &> /dev/null - rm /etc/dietpi/.384khz_rpi &> /dev/null + if ! [ "$(grep -m1 "'dbhost'" /var/www/nextcloud/config/config.php 2> /dev/null | awk '{print $3}' | sed "s/,//")" == "''" ]; then + mysql -uroot -p"$GLOBAL_PW" -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" &> /dev/null + fi - /DietPi/dietpi/func/dietpi-set_hardware kernel dietpi_rpi + fi + #------------------------------------------------------------------------------- + #WiFi module disable powersave addition: + echo -e "options wlan_8192eu rtw_power_mgnt=0" > /etc/modprobe.d/wlan_8192eu.conf + #------------------------------------------------------------------------------- + #Update of SSH kill on shutdown (due to dropbear/sshd not terminating during shutdown, before network is dropped) + cat << _EOF_ > /etc/systemd/system/kill-ssh-user-sessions-before-network.service +[Unit] +Description=Shutdown all ssh sessions before network +DefaultDependencies=no +Before=network.target shutdown.target - # Sabre module update - if (( $(cat /DietPi/config.txt | grep -ci -m1 'dtoverlay=i-sabre-k2m') )); then +[Service] +Type=oneshot +ExecStart=/bin/bash -c 'killall sshd &> /dev/null; killall dropbear &> /dev/null' - whiptail --title "i-sabre-k2m" --msgbox "Due to a kernel update, this driver must be reinstalled, however, this can only be completed after the system is rebooted.\n\nOnce the system reboots:\n - use DietPi-Config to select soundcard 'none'\n - then reselect 'i-sabre-k2m'\n - Reboot system" 14 70 +[Install] +WantedBy=poweroff.target halt.target reboot.target +_EOF_ + systemctl daemon-reload + systemctl enable kill-ssh-user-sessions-before-network + #------------------------------------------------------------------------------- + #Sparky SBC USB/ETH stability patches + if (( $HW_MODEL == 70 )); then - fi + wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/urb_fix_71117/uImage -O /boot/uImage + wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/urb_fix_71117/ethernet.ko -O /lib/modules/$(uname -r)/kernel/drivers/net/ethernet/acts/ethernet.ko fi #------------------------------------------------------------------------------- + #config.txt missing newline on older images, and uploaded/shared confs (<145) + echo -e "\n" >> /DietPi/config.txt + #------------------------------------------------------------------------------- fi diff --git a/dietpi/server_version b/dietpi/server_version index 0c3b883213..f9f1a244d2 100644 --- a/dietpi/server_version +++ b/dietpi/server_version @@ -1,2 +1,2 @@ -157 +158 5