From d1de190447deebdbf59785c82ee930e5ab0871d6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 8 Dec 2017 01:00:16 +0100 Subject: [PATCH 001/390] DietPi-Software | MariaDB as new default and remove MySQL option on Jessie https://github.com/Fourdee/DietPi/issues/1269 https://github.com/Fourdee/DietPi/issues/1032#issuecomment-312274155 https://github.com/Fourdee/DietPi/issues/894 --- dietpi/dietpi-software | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 7dd02d7220..4c08ce364b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1910,6 +1910,12 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$index_current]=13 aSOFTWARE_TYPE[$index_current]=0 aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&start=10#p52' + # - Stretch only + if (( $DISTRO < 4 )); then + + aSOFTWARE_AVAIL_HW_MODEL[$index_current,$HW_MODEL]=0 + + fi #------------------ index_current=75 @@ -1937,6 +1943,12 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$index_current]=13 aSOFTWARE_TYPE[$index_current]=0 aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5#p5' + # - Stretch only + if (( $DISTRO < 4 )); then + + aSOFTWARE_AVAIL_HW_MODEL[$index_current,$HW_MODEL]=0 + + fi #------------------ index_current=78 @@ -1964,6 +1976,12 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$index_current]=13 aSOFTWARE_TYPE[$index_current]=0 aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=1335#p1335' + # - Stretch only + if (( $DISTRO < 4 )); then + + aSOFTWARE_AVAIL_HW_MODEL[$index_current,$HW_MODEL]=0 + + fi #------------------ index_current=81 @@ -2018,6 +2036,12 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$index_current]=13 aSOFTWARE_TYPE[$index_current]=-1 aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=1335#p1335' + # - Stretch only + if (( $DISTRO < 4 )); then + + aSOFTWARE_AVAIL_HW_MODEL[$index_current,$HW_MODEL]=0 + + fi #------------------ index_current=87 @@ -2957,10 +2981,10 @@ _EOF_ if (( ! ${aSOFTWARE_INSTALL_STATE[86]} && ! ${aSOFTWARE_INSTALL_STATE[88]} )); then - #WEBSERVER_MYSQL - aSOFTWARE_INSTALL_STATE[86]=1 + #WEBSERVER_MARIADB as new default + aSOFTWARE_INSTALL_STATE[88]=1 - /DietPi/dietpi/func/dietpi-notify 2 "MySQL will be installed" + /DietPi/dietpi/func/dietpi-notify 2 "MariaDB will be installed" fi @@ -3092,8 +3116,8 @@ _EOF_ # Both selected for install, disable Maria else - aSOFTWARE_INSTALL_STATE[88]=0 - /DietPi/dietpi/func/dietpi-notify 2 "MySQL and MariaDB are selected for install. MariaDB has been de-selected to prevent incompatible MySQL + MariaDB installation" + aSOFTWARE_INSTALL_STATE[86]=0 + /DietPi/dietpi/func/dietpi-notify 2 "MySQL and MariaDB are selected for install. MySQL has been de-selected to prevent incompatible MySQL + MariaDB installation" fi From 398635719ca58241db789ff228756f325b0b8f10 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 8 Dec 2017 01:10:36 +0100 Subject: [PATCH 002/390] DietPi-Software | MariaDB over MySQL --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 4c08ce364b..f3f988e089 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3113,7 +3113,7 @@ _EOF_ aSOFTWARE_INSTALL_STATE[86]=0 /DietPi/dietpi/func/dietpi-notify 2 "MariaDB is already installed, MySQL install has been disabled" - # Both selected for install, disable Maria + # Both selected for install, disable MySQL else aSOFTWARE_INSTALL_STATE[86]=0 From 72bc76f5978d139d3036b21e96f272cdfa22567b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 8 Dec 2017 21:30:29 +0100 Subject: [PATCH 003/390] v160 --- dietpi/dietpi-software | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f3f988e089..89ec498fcc 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1910,8 +1910,8 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$index_current]=13 aSOFTWARE_TYPE[$index_current]=0 aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&start=10#p52' - # - Stretch only - if (( $DISTRO < 4 )); then + # - disable on Stretch + if (( $DISTRO >= 4 )); then aSOFTWARE_AVAIL_HW_MODEL[$index_current,$HW_MODEL]=0 @@ -1943,8 +1943,8 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$index_current]=13 aSOFTWARE_TYPE[$index_current]=0 aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5#p5' - # - Stretch only - if (( $DISTRO < 4 )); then + # - disable on Stretch + if (( $DISTRO >= 4 )); then aSOFTWARE_AVAIL_HW_MODEL[$index_current,$HW_MODEL]=0 @@ -1976,8 +1976,8 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$index_current]=13 aSOFTWARE_TYPE[$index_current]=0 aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=1335#p1335' - # - Stretch only - if (( $DISTRO < 4 )); then + # - disable on Stretch + if (( $DISTRO >= 4 )); then aSOFTWARE_AVAIL_HW_MODEL[$index_current,$HW_MODEL]=0 @@ -2036,8 +2036,8 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$index_current]=13 aSOFTWARE_TYPE[$index_current]=-1 aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=1335#p1335' - # - Stretch only - if (( $DISTRO < 4 )); then + # - disable on Stretch + if (( $DISTRO >= 4 )); then aSOFTWARE_AVAIL_HW_MODEL[$index_current,$HW_MODEL]=0 From e66074c60032e264f143480dc48908923d08a251 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 8 Dec 2017 23:24:46 +0100 Subject: [PATCH 004/390] v160 --- dietpi/dietpi-software | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 89ec498fcc..4f542f14bb 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3797,9 +3797,6 @@ _EOF_ Banner_Installing - debconf-set-selections <<< "mysql-server mysql-server/root_password password $GLOBAL_PW" - debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $GLOBAL_PW" - AGI mariadb-server fi @@ -13056,7 +13053,7 @@ _EOF_ elif (( $1 == 86 || $i == 88 )); then - AGP mysql-server + AGP mysql-server mysql-client AGP mariadb-server mariadb-client From c2b51a5f62ccd51965f3b32d3c5a8dbd51a0cbb9 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 9 Dec 2017 01:30:01 +0100 Subject: [PATCH 005/390] v160 --- dietpi/patch_file | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index d7f191c006..3ae567f281 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2941,6 +2941,34 @@ _EOF_ fi #------------------------------------------------------------------------------- + if [ grep 'aSOFTWARE_INSTALL_STATE[86]=2' /Dietpi/dietpi/.installed ]; then + + apt -y install mariadb-server + apt -y purge mysql-server default-mysql-server + sed -i 's/aSOFTWARE_INSTALL_STATE[86]=2/aSOFTWARE_INSTALL_STATE[86]=0/' /DietPi/dietpi/.installed + sed -i 's/aSOFTWARE_INSTALL_STATE[88]=0/aSOFTWARE_INSTALL_STATE[88]=2/' /DietPi/dietpi/.installed + # Also manually switch webstacks to MariaDB: + if [ grep 'aSOFTWARE_INSTALL_STATE[74]=2' /Dietpi/dietpi/.installed ]; then + + sed -i 's/aSOFTWARE_INSTALL_STATE\[74\]=2/aSOFTWARE_INSTALL_STATE\[74\]=0/' /DietPi/dietpi/.installed + sed -i 's/aSOFTWARE_INSTALL_STATE\[76\]=0/aSOFTWARE_INSTALL_STATE\[76\]=2/' /DietPi/dietpi/.installed + + fi + if [ grep 'aSOFTWARE_INSTALL_STATE[74]=2' /Dietpi/dietpi/.installed ]; then + + sed -i 's/aSOFTWARE_INSTALL_STATE\[77\]=2/aSOFTWARE_INSTALL_STATE\[77\]=0/' /DietPi/dietpi/.installed + sed -i 's/aSOFTWARE_INSTALL_STATE\[79\]=0/aSOFTWARE_INSTALL_STATE\[79\]=2/' /DietPi/dietpi/.installed + + fi + if [ grep 'aSOFTWARE_INSTALL_STATE[74]=2' /Dietpi/dietpi/.installed ]; then + + sed -i 's/aSOFTWARE_INSTALL_STATE\[80\]=2/aSOFTWARE_INSTALL_STATE\[80\]=0/' /DietPi/dietpi/.installed + sed -i 's/aSOFTWARE_INSTALL_STATE\[82\]=0/aSOFTWARE_INSTALL_STATE\[82\]=2/' /DietPi/dietpi/.installed + + fi + + fi + #------------------------------------------------------------------------------- fi From ffda71eda57c755204ee94cc8752a6ec5f9f8896 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 9 Dec 2017 01:46:36 +0100 Subject: [PATCH 006/390] v160 --- dietpi/patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 3ae567f281..6927d9de87 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2941,7 +2941,7 @@ _EOF_ fi #------------------------------------------------------------------------------- - if [ grep 'aSOFTWARE_INSTALL_STATE[86]=2' /Dietpi/dietpi/.installed ]; then + if [ grep 'aSOFTWARE_INSTALL_STATE[86]=2' /Dietpi/dietpi/.installed ] && (( $DISTRO > 3 )); then apt -y install mariadb-server apt -y purge mysql-server default-mysql-server From c920dbae4a34227863ed3afca156d319e8b46eed Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 10 Dec 2017 23:56:09 +0000 Subject: [PATCH 007/390] v160 + Version codes + Correct Release Date for v159 --- CHANGELOG.txt | 15 ++++++++++++++- dietpi/.version | 2 +- dietpi/patch_file | 5 +++++ dietpi/server_version | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 353ac085ca..151cfedb94 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,18 @@ +v160 +(xx/12/17) + +Image Modifications: + +Changes / Improvements / Optimizations: + +Bug Fixes: + +Allo Web Interface v4: + +----------------------------------------------------------------------------------------------------------- + v159 -(10/11/17) +(10/12/17) Image Modifications: VMWare | Updated to Debian Stretch: https://github.com/Fourdee/DietPi/issues/1219 diff --git a/dietpi/.version b/dietpi/.version index b00047941a..9da06a1833 100644 --- a/dietpi/.version +++ b/dietpi/.version @@ -1 +1 @@ -159 \ No newline at end of file +160 \ No newline at end of file diff --git a/dietpi/patch_file b/dietpi/patch_file index d7f191c006..e4ec123566 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2942,6 +2942,11 @@ _EOF_ fi #------------------------------------------------------------------------------- + elif (( $VERSION_CURRENT == 159 )); then + #------------------------------------------------------------------------------- + echo 0 + #------------------------------------------------------------------------------- + fi #------------------------------------------------------------------------------- diff --git a/dietpi/server_version b/dietpi/server_version index ae84183be4..7fce2b5853 100644 --- a/dietpi/server_version +++ b/dietpi/server_version @@ -1,2 +1,2 @@ -159 +160 5 From 3a4fd4abe2bfb1980c76837f7be086c016bf9876 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 11 Dec 2017 03:16:21 +0000 Subject: [PATCH 008/390] v160 + Initial start of: https://github.com/Fourdee/DietPi/issues/1285 NB: failed replace on $OPTION casing WHIP_OPTION --- PREP_SYSTEM_FOR_DIETPI.sh | 466 +++++++++++++++++++++++++++++++++----- 1 file changed, 414 insertions(+), 52 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 493c5d9cf4..2bb12c90ab 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -12,88 +12,450 @@ #------------------------------------------------------------------------------------------------ # Legend: # - Items that are commented out should not be used. -# - Sections with '#???', are optional, depending on the device and its specs. (eg: does it need bluetooth?) +# - Sections with '#???', are WHIP_OPTIONal, depending on the device and its specs. (eg: does it need bluetooth?) #------------------------------------------------------------------------------------------------ -#This is not currently a executable script. Please manually run through the commands: -exit 0 #prevent continuation of this script. +#------------------------------------------------------------------------------------------------ +#Globals +#------------------------------------------------------------------------------------------------ +#System +DISTRO=4 +DISTRO_NAME='stretch' +HW_MODEL=0 + +#Funcs +INTERNET_ADDRESS='' +Check_Connection(){ + + wget -q --spider --timeout=10 --tries=2 "$INTERNET_ADDRESS" + +} + +Error_Check(){ + + #Grab exit code in case of failure + exit_code=$? + if (( $exit_code != 0 )); then + + dietpi-notify 1 "($exit_code): Script aborted" + exit $exit_code + + else + + dietpi-notify 2 "($exit_code): Passed" + fi + +} + +#Apt-get +AGI(){ + + local string="$@" + + local force_WHIP_OPTIONs='--force-yes' + + if (( $DISTRO >= 4 )); then + + force_WHIP_OPTIONs='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' + + fi + + DEBIAN_FRONTEND=noninteractive $(which apt) install -y $force_WHIP_OPTIONs $string + +} + +AGP(){ + + local string="$@" + if (( $DISTRO >= 4 )); then + + string+=' --allow-change-held-packages' + + fi + + $(which apt) purge -y $string + +} + + +#DietPi-Notify: +dietpi-notify(){ + + aINPUT_STRING=("$@") + + STATUS_TEXT_OK="\e[32mOk\e[0m" + STATUS_TEXT_FAILED="\e[31mFailed:\e[0m" + + BRACKET_STRING_L="\e[90m[\e[0m" + BRACKET_STRING_R="\e[90m]\e[0m" + + #Funcs + + Print_Ok(){ + + echo -ne " $BRACKET_STRING_L\e[32mOk\e[0m$BRACKET_STRING_R" + + } + + Print_Failed(){ + + echo -ne " $BRACKET_STRING_L\e[31mFailed\e[0m$BRACKET_STRING_R" + + } + + # - Print all input string on same line + # - $1 = start printing from word number $1 + Print_Input_String(){ + + for (( i=$1;i<${#aINPUT_STRING[@]} ;i++)) + do + echo -ne " ${aINPUT_STRING[${i}]}" + done + + echo -e "" + + } + + # Main Loop + #-------------------------------------------------------------------------------------- + echo -e "" + + if (( $1 == -1 )); then + + if [ "$2" = "0" ]; then + + aINPUT_STRING+=("Completed") + Print_Ok + Print_Input_String 2 + echo -e "" + + else + + aINPUT_STRING+=("An issue has occured") + Print_Failed + Print_Input_String 2 + echo -e "" + + fi + + #-------------------------------------------------------------------------------------- + #Status Ok + #$@ = txt desc + elif (( $1 == 0 )); then + + Print_Ok + Print_Input_String 1 + + #Status failed + #$@ = txt desc + elif (( $1 == 1 )); then + + Print_Failed + Print_Input_String 1 + + #Status Info + #$@ = txt desc + elif (( $1 == 2 )); then + + echo -ne " $BRACKET_STRING_L\e[0mInfo\e[0m$BRACKET_STRING_R" + echo -ne "\e[90m" + Print_Input_String 1 + echo -ne "\e[0m" + + fi + + echo -e "" + #----------------------------------------------------------------------------------- + unset aINPUT_STRING + #----------------------------------------------------------------------------------- +} + +#Whiptail +WHIP_BACKTITLE='DietPi-Prep' +WHIP_TITLE=0 +WHIP_DESC=0 +WHIP_MENU_ARRAY=0 +WHIP_RETURN_VALUE=0 +WHIP_DEFAULT_ITEM=0 +WHIP_OPTION=0 +WHIP_CHOICE=0 +Run_Whiptail(){ + + WHIP_OPTION=$(whiptail --title "$WHIP_TITLE" --menu "$WHIP_DESC" --default-item "$WHIP_DEFAULT_ITEM" --backtitle "$WHIP_BACKTITLE" 30 80 20 "${WHIP_MENU_ARRAY[@]}" 3>&1 1>&2 2>&3) + WHIP_CHOICE=$? + if (( $WHIP_CHOICE == 0 )); then + + WHIP_RETURN_VALUE=$WHIP_OPTION + + else + + dietpi-notify 1 'No choices detected, aborting' + exit 0 + + fi + + #delete [] + unset WHIP_MENU_ARRAY + +} #------------------------------------------------------------------------------------------------ -#Packages +#------------------------------------------------------------------------------------------------ +#------------------------------------------------------------------------------------------------ +# MAIN LOOP +#------------------------------------------------------------------------------------------------ +#------------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------------ -#NOTE: -#Apt mirror will get overwritten by: /DietPi/dietpi/func/dietpi-set_software apt-mirror default : during finalize. -#??? RPI -DISTRO='stretch' -cat << _EOF_ > /etc/apt/sources.list +#------------------------------------------------------------------------------------------------ +#Step 1: Initial Critical Prep +#------------------------------------------------------------------------------------------------ + +############### +dietpi-notify 0 'Updating Apt and installing initial core packages' + +apt-get clean +Error_Check + +apt-get update +Error_Check + +############### +dietpi-notify 0 'Installing Core Packages' +AGI wget unzip whiptail +Error_Check + +#------------------------------------------------------------------------------------------------ +#Step 2: Hardware selection +#------------------------------------------------------------------------------------------------ +############### +dietpi-notify 0 'Hardware selection' + +WHIP_TITLE='Hardware selection' +WHIP_DESC='Please select the current device this is being installed on:' +WHIP_DEFAULT_ITEM=0 +WHIP_MENU_ARRAY=( + '110' 'RoseapplePi' + '100' 'Asus Tinker Board' + '90' 'A20-OLinuXino-MICRO' + '80' 'Cubieboard 3' + '71' 'Beagle Bone Black' + '70' 'Sparky SBC' + '66' 'NanoPi M1 Plus' + '65' 'NanoPi NEO 2' + '64' 'NanoPi NEO Air' + '63' 'NanoPi M1/T1' + '62' 'NanoPi M3/T3' + '61' 'NanoPi M2/T2' + '60' 'NanoPi Neo' + '51' 'BananaPi Pro (Lemaker)' + '50' 'BananaPi M2+ (sinovoip)' + '43' 'Rock64' + '42' 'Pine A64+ (2048mb)' + '41' 'Pine A64+ (1024mb)' + '40' 'Pine A64 (512mb)' + '38' 'OrangePi PC 2' + '37' 'OrangePi Prime' + '36' 'OrangePi Win' + '35' 'OrangePi Zero Plus 2 (H3/H5)' + '34' 'OrangePi Plus' + '33' 'OrangePi Lite' + '32' 'OrangePi Zero (H2+)' + '31' 'OrangePi One' + '30' 'OrangePi PC' + '21' 'x86_64 native (PC)' + '20' 'VM x64 (VMware VirtualBox)' + '13' 'oDroid U3' + '12' 'oDroid C2' + '11' 'oDroid XU3/4' + '10' 'oDroid C1' + '3' 'Raspberry Pi 3' + '2' 'Raspberry Pi 2' + '1' 'Raspberry Pi 1/Zero (512mb)' + '0' 'Raspberry Pi 1 (256mb)' +) + +Run_Whiptail +HW_MODEL=$WHIP_RETURN_VALUE + +dietpi-notify 2 "Setting HW_MODEL index of: $HW_MODEL" + + + +#------------------------------------------------------------------------------------------------ +#Step 3: Distro Selection + APT prep +#------------------------------------------------------------------------------------------------ +############### +dietpi-notify 0 'Distro selection' + +WHIP_TITLE='Distro Selection' +WHIP_DESC='Please select a distro to install on this system. Selecting a distro that is older than the current installed on system, is not supported.' +WHIP_DEFAULT_ITEM=4 +WHIP_MENU_ARRAY=( + '1' 'wheezy' + '3' 'jessie' + '4' 'stretch' + '5' 'buster' +) + +Run_Whiptail +DISTRO=$WHIP_RETURN_VALUE + +if (( $DISTRO == 1 )); then + + DISTRO_NAME='wheezy' + +elif (( $DISTRO == 3 )); then + + DISTRO_NAME='jessie' + +elif (( $DISTRO == 4 )); then + + DISTRO_NAME='stretch' + +elif (( $DISTRO == 5 )); then + + DISTRO_NAME='buster' + +fi + +dietpi-notify 2 "Setting APT sources.list: $DISTRO_NAME $DISTRO" + +if (( $HW_MODEL < 10 )); then + + cat << _EOF_ > /etc/apt/sources.list deb https://www.mirrorservice.org/sites/archive.raspbian.org/raspbian $DISTRO main contrib non-free rpi _EOF_ -cat << _EOF_ > /etc/apt/sources.list.d/raspi.list + cat << _EOF_ > /etc/apt/sources.list.d/raspi.list deb https://archive.raspberrypi.org/debian/ $DISTRO main ui _EOF_ -#??? Everything else (excluding RPi!) -DISTRO='stretch' -cat << _EOF_ > /etc/apt/sources.list -deb http://ftp.debian.org/debian/ $DISTRO main contrib non-free -deb http://ftp.debian.org/debian/ $DISTRO-updates main contrib non-free -deb http://security.debian.org $DISTRO/updates main contrib non-free -deb http://ftp.debian.org/debian/ $DISTRO-backports main contrib non-free +else + + cat << _EOF_ > /etc/apt/sources.list +deb http://ftp.debian.org/debian/ $DISTRO_NAME main contrib non-free +deb http://ftp.debian.org/debian/ $DISTRO_NAME-updates main contrib non-free +deb http://security.debian.org $DISTRO_NAME/updates main contrib non-free +deb http://ftp.debian.org/debian/ $DISTRO_NAME-backports main contrib non-free _EOF_ +fi +Error_Check + +#NB: Apt mirror will get overwritten by: /DietPi/dietpi/func/dietpi-set_software apt-mirror default : during finalize. -#+Meveric images -rm /etc/apt/sources.list.d/deb-multimedia.list +############### +dietpi-notify 0 "Updating APT for $DISTRO_NAME" -#Remove following All apt-get clean +Error_Check + apt-get update -apt-get purge -y libpython* fonts-* xmms2-client-* pulseaudio* jq xxd iperf3 gdisk gpsd ppp libboost-iostreams* sgml-base xml-core usb-modeswitch* libpng* cpp-* cpp ntpdate bluez bluetooth rsync dialog dhcpcd5 lua5.1 netcat-* make makedev ncdu plymouth openresolv shared-mime-in* tcpd strace tasksel* wireless-* xdg-user-dirs triggerhappy python* v4l-utils traceroute xz-utils ucf xauth zlib1g-dev xml-core aptitude* avahi-daemon rsyslog logrotate man-db manpages vim vim-common vim-runtime vim-tiny mc mc-data +Error_Check + +############### +dietpi-notify 0 'Removing known conflicting apt sources.list.d' -#+Desktop images (Mostly desktop packages, but apply to non-desktop images also): -apt-get purge -y libpod-* libpeas-* isc-dhcp-server gnome-* fonts-dejavu* eject dnsmasq* dns-root-data colord-data libjasper* libjson* libwbclient* libwayland* golang-* libavahi* libtext* libweb* libpcsclite1 libxau6* libxc* dictionaries-* libgtk* miscfiles minicom lrzsz lxmenu-* x11-* zenity* yelp-* +rm /etc/apt/sources.list.d/deb-multimedia.list &> /dev/null +echo 0 #always pass +Error_Check + +#------------------------------------------------------------------------------------------------ +#Step 4: APT removals +#------------------------------------------------------------------------------------------------ + +############### +dietpi-notify 0 "Removing Core APT packages not required by DietPi" + +AGP libpython* fonts-* xmms2-client-* pulseaudio* jq xxd iperf3 gdisk gpsd ppp libboost-iostreams* sgml-base xml-core usb-modeswitch* libpng* cpp-* cpp ntpdate bluez bluetooth rsync dialog dhcpcd5 lua5.1 netcat-* make makedev ncdu plymouth openresolv shared-mime-in* tcpd strace tasksel* wireless-* xdg-user-dirs triggerhappy python* v4l-utils traceroute xz-utils ucf xauth zlib1g-dev xml-core aptitude* avahi-daemon rsyslog logrotate man-db manpages vim vim-common vim-runtime vim-tiny mc mc-data +Error_Check + +############### +dietpi-notify 0 "Removing Misc (Stage 1) APT packages not required by DietPi" + +AGP libpod-* libpeas-* isc-dhcp-server gnome-* fonts-dejavu* eject dnsmasq* dns-root-data colord-data libjasper* libjson* libwbclient* libwayland* golang-* libavahi* libtext* libweb* libpcsclite1 libxau6* libxc* dictionaries-* libgtk* miscfiles minicom lrzsz lxmenu-* x11-* zenity* yelp-* +Error_Check + +############### +dietpi-notify 0 "Removing Misc (Stage 2) APT packages not required by DietPi" + +AGP apache2* lighttpd* nginx* nodejs memtester expect tcl-expect toilet toilet-fonts w-scan vlan weather-util* sysbench stress cmake cmake-data device-tree-co* fping hddtemp haveged hostapd i2c-tools iperf ir-keytable libasound2* libmtp* libusb-dev lirc lsof ncurses-term pkg-config unicode-data rfkill pv mtp-tools m4 screen alsa-utils autotools-dev bind9-host btrfs-tools bridge-utils cpufrequtils dvb-apps dtv-scan-table* evtest f3 figlet gcc gcc-4.8-* git git-man ifenslave +Error_Check + +############### +dietpi-notify 0 "Removing Fonts" rm -R /usr/share/fonts/* rm -R /usr/share/icons/* -#+Misc -#??? BBB: https://github.com/Fourdee/DietPi/issues/931#issuecomment-345451529 -apt-get purge -y apache2 roboticscape ardupilot-* ti-* nodejs mjpg-streamer bonescript libapr1 -#??? +############### +dietpi-notify 0 "Removing Dev APT packages not required by DietPi" -apt-get purge -y memtester expect tcl-expect toilet toilet-fonts w-scan vlan weather-util* sysbench stress cmake cmake-data device-tree-co* fping hddtemp haveged hostapd i2c-tools iperf ir-keytable libasound2* libmtp* libusb-dev lirc lsof ncurses-term pkg-config unicode-data rfkill pv mtp-tools m4 screen alsa-utils autotools-dev bind9-host btrfs-tools bridge-utils cpufrequtils dvb-apps dtv-scan-table* evtest f3 figlet gcc gcc-4.8-* git git-man ifenslave +AGP '\-dev$' linux-headers* +Error_Check -#+ dev packages -# On ARMbian DEV branch images, manually do this as triggers '*-dev' image/uboot etc -apt-get purge -y '\-dev$' linux-headers* +# - Hardware specific +if (( $HW_MODEL == 71 )); then -#+ Meveric's repo | Renders patch for removal in apt -# apt-get purge setup-odroid # not compat with DietPi + ############### + dietpi-notify 0 "Removing BBB APT packages not required by DietPi" -#??? RPI -apt-get purge -y rpi-update libraspberrypi-doc -#??? RPI (remove older version packages marked as manual): https://github.com/Fourdee/DietPi/issues/598#issuecomment-25919922 -apt-get purge gcc-4.6-base gcc-4.7-base gcc-4.8-base libsigc++-1.2-5c2 -#??? + AGP roboticscape ardupilot-* ti-* bonescript libapr1 + Error_Check + +elif (( $HW_MODEL < 10 )); then + + ############### + dietpi-notify 0 "Removing RPi APT packages not required by DietPi" + + AGP rpi-update libraspberrypi-doc gcc-4.6-base gcc-4.7-base gcc-4.8-base libsigc++-1.2-5c2 + Error_Check + +fi + + +############### +dietpi-notify 0 "Purging APT with autoremoval" apt-get autoremove --purge -y +Error_Check + + + + + #??? ROCK64, reinstall kernel packages: -apt-get install linux-rock64-package +# apt-get install linux-rock64-package #??? -#???: Optional Reinstall OpenSSH (for updating dietpi scripts etc). Gets removed during finalise. -apt-get install openssh-server -y -echo -e "PermitRootLogin yes" >> /etc/ssh/sshd_config -systemctl restart ssh +#???: WHIP_OPTIONal Reinstall OpenSSH (for updating dietpi scripts etc). Gets removed during finalise. +# apt-get install openssh-server -y +# echo -e "PermitRootLogin yes" >> /etc/ssh/sshd_config +# systemctl restart ssh #??? +exit + + + + + + + + +#------------------------------------------------------------------------------------------------ +#Packages +#------------------------------------------------------------------------------------------------ + + + + #install packages apt-get dist-upgrade -y echo -e "CONF_SWAPSIZE=0" > /etc/dphys-swapfile @@ -172,9 +534,9 @@ mkdir -p /mnt/dietpi_userdata mkdir -p /mnt/samba mkdir -p /mnt/ftp_client mkdir -p /mnt/nfs_client -echo -e "Samba client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking Options: NAS/Misc menu" > /mnt/samba/readme.txt -echo -e "FTP client mount can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking Options: NAS/Misc menu" > /mnt/ftp_client/readme.txt -echo -e "NFS client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking Options: NAS/Misc menu" > /mnt/nfs_client/readme.txt +echo -e "Samba client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking WHIP_OPTIONs: NAS/Misc menu" > /mnt/samba/readme.txt +echo -e "FTP client mount can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking WHIP_OPTIONs: NAS/Misc menu" > /mnt/ftp_client/readme.txt +echo -e "NFS client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking WHIP_OPTIONs: NAS/Misc menu" > /mnt/nfs_client/readme.txt /boot/dietpi/dietpi-logclear 2 @@ -334,7 +696,7 @@ rm /etc/init.d/ntp &> /dev/null #Apt # - Force use existing installed configs if available, else install new. Also disables end user prompt from dpkg cat << _EOF_ > /etc/apt/apt.conf.d/local -Dpkg::Options { +Dpkg::WHIP_OPTIONs { "--force-confdef"; "--force-confold"; } @@ -452,9 +814,9 @@ _EOF_ sed -i "/FORCE=/c\FORCE=force" /etc/default/fake-hwclock #wifi dongles | move to dietpi-set_hardware wifi -# echo -e "options 8192cu rtw_power_mgnt=0" > /etc/modprobe.d/8192cu.conf -# 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 +# echo -e "WHIP_OPTIONs 8192cu rtw_power_mgnt=0" > /etc/modprobe.d/8192cu.conf +# echo -e "WHIP_OPTIONs 8188eu rtw_power_mgnt=0" > /etc/modprobe.d/8188eu.conf +# echo -e "WHIP_OPTIONs 8189es rtw_power_mgnt=0" > /etc/modprobe.d/8189es.conf #Set swapfile size @@ -551,11 +913,11 @@ _EOF_ cat << _EOF_ > /etc/modprobe.d/blacklist-nouveau.conf blacklist nouveau blacklist lbm-nouveau -options nouveau modeset=0 +WHIP_OPTIONs nouveau modeset=0 alias nouveau off alias lbm-nouveau off _EOF_ -echo -e "options nouveau modeset=0" > /etc/modprobe.d/nouveau-kms.conf +echo -e "WHIP_OPTIONs nouveau modeset=0" > /etc/modprobe.d/nouveau-kms.conf update-initramfs -u #??? From f5f88219405c14a88ae73c0742a77becd6104ec5 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 11 Dec 2017 03:40:11 +0000 Subject: [PATCH 009/390] v160 + Dry run of AGP. continue: https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 94 ++++++++++++++++++++++++++------------- 1 file changed, 62 insertions(+), 32 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 2bb12c90ab..33de867896 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -14,6 +14,19 @@ # - Items that are commented out should not be used. # - Sections with '#???', are WHIP_OPTIONal, depending on the device and its specs. (eg: does it need bluetooth?) #------------------------------------------------------------------------------------------------ +#Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. +LANG=en_GB.UTF-8 + +#Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 +cd "$HOME" + +#Exit path for non-root logins. +if (( $UID != 0 )); then + + echo -e 'Error: Root privileges required. Please run the command with "sudo"\n' + exit + +fi #------------------------------------------------------------------------------------------------ #Globals @@ -73,33 +86,35 @@ AGP(){ fi + #DEBUG: Dry run for testing + string+=' --dry-run' + $(which apt) purge -y $string } - #DietPi-Notify: dietpi-notify(){ - aINPUT_STRING=("$@") + local ainput_string=("$@") - STATUS_TEXT_OK="\e[32mOk\e[0m" - STATUS_TEXT_FAILED="\e[31mFailed:\e[0m" + local status_text_ok="\e[32mOk\e[0m" + local status_text_failed="\e[31mFailed:\e[0m" - BRACKET_STRING_L="\e[90m[\e[0m" - BRACKET_STRING_R="\e[90m]\e[0m" + local bracket_string_l="\e[90m[\e[0m" + local bracket_string_r="\e[90m]\e[0m" #Funcs Print_Ok(){ - echo -ne " $BRACKET_STRING_L\e[32mOk\e[0m$BRACKET_STRING_R" + echo -ne " $bracket_string_l\e[32mOk\e[0m$bracket_string_r" } Print_Failed(){ - echo -ne " $BRACKET_STRING_L\e[31mFailed\e[0m$BRACKET_STRING_R" + echo -ne " $bracket_string_l\e[31mFailed\e[0m$bracket_string_r" } @@ -107,9 +122,9 @@ dietpi-notify(){ # - $1 = start printing from word number $1 Print_Input_String(){ - for (( i=$1;i<${#aINPUT_STRING[@]} ;i++)) + for (( i=$1;i<${#ainput_string[@]} ;i++)) do - echo -ne " ${aINPUT_STRING[${i}]}" + echo -ne " ${ainput_string[${i}]}" done echo -e "" @@ -124,14 +139,14 @@ dietpi-notify(){ if [ "$2" = "0" ]; then - aINPUT_STRING+=("Completed") + ainput_string+=("Completed") Print_Ok Print_Input_String 2 echo -e "" else - aINPUT_STRING+=("An issue has occured") + ainput_string+=("An issue has occured") Print_Failed Print_Input_String 2 echo -e "" @@ -157,7 +172,7 @@ dietpi-notify(){ #$@ = txt desc elif (( $1 == 2 )); then - echo -ne " $BRACKET_STRING_L\e[0mInfo\e[0m$BRACKET_STRING_R" + echo -ne " $bracket_string_l\e[0mInfo\e[0m$bracket_string_r" echo -ne "\e[90m" Print_Input_String 1 echo -ne "\e[0m" @@ -166,7 +181,7 @@ dietpi-notify(){ echo -e "" #----------------------------------------------------------------------------------- - unset aINPUT_STRING + unset ainput_string #----------------------------------------------------------------------------------- } @@ -321,7 +336,16 @@ elif (( $DISTRO == 5 )); then fi -dietpi-notify 2 "Setting APT sources.list: $DISTRO_NAME $DISTRO" +############### +dietpi-notify 0 'Removing conflicting apt sources.list.d' + +#rm /etc/apt/sources.list.d/* &> /dev/null #Probably a bad idea +rm /etc/apt/sources.list.d/deb-multimedia.list &> /dev/null #meveric +echo 0 #always pass +Error_Check + +############### +dietpi-notify 0 "Setting APT sources.list: $DISTRO_NAME $DISTRO" if (( $HW_MODEL < 10 )); then @@ -356,13 +380,6 @@ Error_Check apt-get update Error_Check -############### -dietpi-notify 0 'Removing known conflicting apt sources.list.d' - -rm /etc/apt/sources.list.d/deb-multimedia.list &> /dev/null -echo 0 #always pass -Error_Check - #------------------------------------------------------------------------------------------------ #Step 4: APT removals #------------------------------------------------------------------------------------------------ @@ -370,23 +387,36 @@ Error_Check ############### dietpi-notify 0 "Removing Core APT packages not required by DietPi" -AGP libpython* fonts-* xmms2-client-* pulseaudio* jq xxd iperf3 gdisk gpsd ppp libboost-iostreams* sgml-base xml-core usb-modeswitch* libpng* cpp-* cpp ntpdate bluez bluetooth rsync dialog dhcpcd5 lua5.1 netcat-* make makedev ncdu plymouth openresolv shared-mime-in* tcpd strace tasksel* wireless-* xdg-user-dirs triggerhappy python* v4l-utils traceroute xz-utils ucf xauth zlib1g-dev xml-core aptitude* avahi-daemon rsyslog logrotate man-db manpages vim vim-common vim-runtime vim-tiny mc mc-data +AGP libpython* xmms2-client-* pulseaudio* jq xxd iperf3 gdisk gpsd ppp libboost-iostreams* sgml-base xml-core usb-modeswitch* libpng* cpp-* cpp ntpdate bluez bluetooth rsync dialog dhcpcd5 lua5.1 netcat-* make makedev ncdu plymouth openresolv shared-mime-in* tcpd strace tasksel* wireless-* xdg-user-dirs triggerhappy python* v4l-utils traceroute xz-utils ucf xauth zlib1g-dev xml-core aptitude* avahi-daemon rsyslog logrotate man-db manpages vim vim-common vim-runtime vim-tiny mc mc-data +Error_Check + +############### +dietpi-notify 0 "Removing webserver APT packages not required by DietPi" + +#TD: Add php here +AGP apache2* lighttpd* nginx* +Error_Check + +############### +dietpi-notify 0 "Removing Desktop related APT packages not required by DietPi" + +AGP gnome-* mate-* lxde lxde-* lxmenu-* fonts-dejavu* libwayland* dictionaries-* libgtk* x11-* zenity* yelp-* fonts-* Error_Check ############### dietpi-notify 0 "Removing Misc (Stage 1) APT packages not required by DietPi" -AGP libpod-* libpeas-* isc-dhcp-server gnome-* fonts-dejavu* eject dnsmasq* dns-root-data colord-data libjasper* libjson* libwbclient* libwayland* golang-* libavahi* libtext* libweb* libpcsclite1 libxau6* libxc* dictionaries-* libgtk* miscfiles minicom lrzsz lxmenu-* x11-* zenity* yelp-* +AGP libpod-* libpeas-* isc-dhcp-server eject dnsmasq* dns-root-data colord-data libjasper* libjson* libwbclient* golang-* libavahi* libtext* libweb* libpcsclite1 libxau6* libxc* miscfiles minicom lrzsz Error_Check ############### dietpi-notify 0 "Removing Misc (Stage 2) APT packages not required by DietPi" -AGP apache2* lighttpd* nginx* nodejs memtester expect tcl-expect toilet toilet-fonts w-scan vlan weather-util* sysbench stress cmake cmake-data device-tree-co* fping hddtemp haveged hostapd i2c-tools iperf ir-keytable libasound2* libmtp* libusb-dev lirc lsof ncurses-term pkg-config unicode-data rfkill pv mtp-tools m4 screen alsa-utils autotools-dev bind9-host btrfs-tools bridge-utils cpufrequtils dvb-apps dtv-scan-table* evtest f3 figlet gcc gcc-4.8-* git git-man ifenslave +AGP nodejs memtester expect tcl-expect toilet toilet-fonts w-scan vlan weather-util* sysbench stress cmake cmake-data device-tree-co* fping hddtemp haveged hostapd i2c-tools iperf ir-keytable libasound2* libmtp* libusb-dev lirc lsof ncurses-term pkg-config unicode-data rfkill pv mtp-tools m4 screen alsa-utils autotools-dev bind9-host btrfs-tools bridge-utils cpufrequtils dvb-apps dtv-scan-table* evtest f3 figlet gcc gcc-4.8-* git git-man ifenslave Error_Check ############### -dietpi-notify 0 "Removing Fonts" +dietpi-notify 0 "Removing Fonts/Icons not Required by DietPi" rm -R /usr/share/fonts/* rm -R /usr/share/icons/* @@ -696,7 +726,7 @@ rm /etc/init.d/ntp &> /dev/null #Apt # - Force use existing installed configs if available, else install new. Also disables end user prompt from dpkg cat << _EOF_ > /etc/apt/apt.conf.d/local -Dpkg::WHIP_OPTIONs { +Dpkg::options { "--force-confdef"; "--force-confold"; } @@ -814,9 +844,9 @@ _EOF_ sed -i "/FORCE=/c\FORCE=force" /etc/default/fake-hwclock #wifi dongles | move to dietpi-set_hardware wifi -# echo -e "WHIP_OPTIONs 8192cu rtw_power_mgnt=0" > /etc/modprobe.d/8192cu.conf -# echo -e "WHIP_OPTIONs 8188eu rtw_power_mgnt=0" > /etc/modprobe.d/8188eu.conf -# echo -e "WHIP_OPTIONs 8189es rtw_power_mgnt=0" > /etc/modprobe.d/8189es.conf +# echo -e "options 8192cu rtw_power_mgnt=0" > /etc/modprobe.d/8192cu.conf +# 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 @@ -913,11 +943,11 @@ _EOF_ cat << _EOF_ > /etc/modprobe.d/blacklist-nouveau.conf blacklist nouveau blacklist lbm-nouveau -WHIP_OPTIONs nouveau modeset=0 +options nouveau modeset=0 alias nouveau off alias lbm-nouveau off _EOF_ -echo -e "WHIP_OPTIONs nouveau modeset=0" > /etc/modprobe.d/nouveau-kms.conf +echo -e "options nouveau modeset=0" > /etc/modprobe.d/nouveau-kms.conf update-initramfs -u #??? From a0a41728bdf0ac694c947c0219c789ac0aac7409 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 12 Dec 2017 01:06:46 +0000 Subject: [PATCH 010/390] v160 DietPi-Update | dietpi.txt is now checked for missing entries, and, will now be patched during the update: https://github.com/Fourdee/DietPi/issues/1292#issuecomment-350818969 Sparky SBC | Kernel patch will be applied which resolves issues with HQPlayer playback: https://www.computeraudiophile.com/forums/topic/32132-allo-sparky-usbridge/?do=findComment&comment=753100 --- CHANGELOG.txt | 4 +- PREP_SYSTEM_FOR_DIETPI.sh | 1 - dietpi/dietpi-update | 7 ++- dietpi/func/dietpi-set_hardware | 39 +++++++++------- dietpi/func/dietpi-set_software | 80 ++++++++++++++++++++++++++++++--- dietpi/patch_file | 38 +++++++++------- 6 files changed, 126 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 151cfedb94..d2cdb5036a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,8 @@ Image Modifications: Changes / Improvements / Optimizations: Bug Fixes: +DietPi-Update | dietpi.txt is now checked for missing entries, and, will now be patched during the update: https://github.com/Fourdee/DietPi/issues/1292#issuecomment-350818969 +Sparky SBC | Kernel patch will be applied which resolves issues with HQPlayer playback: https://www.computeraudiophile.com/forums/topic/32132-allo-sparky-usbridge/?do=findComment&comment=753100 Allo Web Interface v4: @@ -23,7 +25,7 @@ Changes / Improvements / Optimizations: General | Odroid XU3/4 images updated: Includes kernel support for EMMC 5.1 (thanks Meveric): https://github.com/Fourdee/DietPi/issues/1252 General | DietPi RPi kernel: Updated to 4.9.62. General | DietPi RPi kernel: Will no longer re-install, if the current version is already at latest. -General | Added farenheit readouts for cpu_info and dietpi-config. For those "over the pond" :D : http://dietpi.com/phpbb/viewtopic.php?f=12&t=2516&p=9772#p9772 +General | Added fahrenheit readouts for cpu_info and dietpi-config. For those "over the pond" :D : http://dietpi.com/phpbb/viewtopic.php?f=12&t=2516&p=9772#p9772 General | Sparky SBC: Kernel update to add support for USB 1.1 DACs, thanks @sudeep. This must be enabled manually, if using a USB 1.1 DAC, as this breaks Allo WiFi dongle. Edit "/DietPi/uEnv.txt" and change the value "aotg.aotg1_speed=1" (from "0"), then reboot. General | We now define a default LD_LIBRARY_PATH for all systems, exported from /etc/bash.bashrc: https://github.com/Fourdee/DietPi/issues/475#issuecomment-350380744 DietPi-Services | Run "dietpi-services help" to see a full list of updated commands: Added support for "enable" and "disable". "disable" will stop and disable the service and prevent it from running, "enable" will enable and start the service. EG: "dietpi-services disable cron", will prevent Cron from starting. Added support for start/stop/restart a single service (eg: dietpi-services stop apache2). This is basically a symlink to systemD: https://github.com/Fourdee/DietPi/issues/1114 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 33de867896..b5e5def5bd 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -298,7 +298,6 @@ HW_MODEL=$WHIP_RETURN_VALUE dietpi-notify 2 "Setting HW_MODEL index of: $HW_MODEL" - #------------------------------------------------------------------------------------------------ #Step 3: Distro Selection + APT prep #------------------------------------------------------------------------------------------------ diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 209b6a50dc..6e216bfe66 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -51,8 +51,8 @@ #///////////////////////////////////////////////////////////////////////////////////// #GIT Branch | master / testing #///////////////////////////////////////////////////////////////////////////////////// - GITBRANCH=$(cat /DietPi/dietpi.txt | grep -m1 '^gitbranch=' | sed 's/.*=//') - GITFORKOWNER=$(cat /DietPi/dietpi.txt | grep -m1 '^gitforkowner=' | sed 's/.*=//') + GITBRANCH=$(grep -m1 '^gitbranch=' /DietPi/dietpi.txt | sed 's/.*=//') + GITFORKOWNER=$(grep -m1 '^gitforkowner=' /DietPi/dietpi.txt | sed 's/.*=//') #///////////////////////////////////////////////////////////////////////////////////// #UPDATE Vars @@ -227,6 +227,9 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok #Allow execute of all DietPi scripts and patch file chmod -R +x /DietPi + #Verify/update dietpi.txt entries: + /DietPi/dietpi/func/dietpi-set_software verify_dietpi.txt + #Run Patch file while (( $VERSION_CURRENT < $VERSION_SERVER )); do diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 3205a3cd78..ab5ee6c8b9 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -10,23 +10,26 @@ #//////////////////////////////////// # # Usage: - # - /DietPi/dietpi/func/dietpi-set_hardware rpi3_usb_boot enable - # - /DietPi/dietpi/func/dietpi-set_hardware rpi-camera enable/disable - # - /DietPi/dietpi/func/dietpi-set_hardware gpumemsplit 64/128/256 #RPi only - # - /DietPi/dietpi/func/dietpi-set_hardware remoteir odroid_remote/justboom_ir_remote - # - /DietPi/dietpi/func/dietpi-set_hardware kernel ??see sourcode - # - /DietPi/dietpi/func/dietpi-set_hardware eth-forcespeed 10/100/1000/disable - # - /DietPi/dietpi/func/dietpi-set_hardware rpi-opengl enable/disable - # - /DietPi/dietpi/func/dietpi-set_hardware i2c enable/disable/khz - # - /DietPi/dietpi/func/dietpi-set_hardware wificountrycode code - # - /DietPi/dietpi/func/dietpi-set_hardware wifimodules enable/disable/onboard_enable/onboard_disable - # - /DietPi/dietpi/func/dietpi-set_hardware wificreds set | Generates wpa_supplicant.conf from dietpi.txt globals - # - /DietPi/dietpi/func/dietpi-set_hardware preferipversion auto/ipv4/ipv6 - # - /DietPi/dietpi/func/dietpi-set_hardware bluetooth enable/disable - # - /DietPi/dietpi/func/dietpi-set_hardware serialconsole enable/disable - # - /DietPi/dietpi/func/dietpi-set_hardware soundcard target_card (non-matching name for reset to default) add '-eq' to target_card string, enable alsa eq on card - # HW:x,x (specify target card and device index eg: HW:9,1) - # - /DietPi/dietpi/func/dietpi-set_hardware lcdpanel target_panel (none to remove all) + FP_SCRIPT='/DietPi/dietpi/func/dietpi-set_hardware' + AVAIABLE_COMMANDS=" +Available commands +$FP_SCRIPT rpi3_usb_boot enable +$FP_SCRIPT rpi-camera enable/disable +$FP_SCRIPT gpumemsplit 64/128/256 #RPi only +$FP_SCRIPT remoteir odroid_remote/justboom_ir_remote +$FP_SCRIPT kernel ??see sourcode +$FP_SCRIPT eth-forcespeed 10/100/1000/disable +$FP_SCRIPT rpi-opengl enable/disable +$FP_SCRIPT i2c enable/disable/khz +$FP_SCRIPT wificountrycode code +$FP_SCRIPT wifimodules enable/disable/onboard_enable/onboard_disable +$FP_SCRIPT wificreds set | Generates wpa_supplicant.conf from dietpi.txt globals +$FP_SCRIPT preferipversion auto/ipv4/ipv6 +$FP_SCRIPT bluetooth enable/disable +$FP_SCRIPT serialconsole enable/disable +$FP_SCRIPT soundcard target_card (non-matching name for reset to default) add '-eq' to target_card string, enable alsa eq on card. HW:x,x (specify target card and device index eg: HW:9,1) +$FP_SCRIPT lcdpanel target_panel (none to remove all) +" #//////////////////////////////////// #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. @@ -86,6 +89,8 @@ EXIT_CODE=1 /DietPi/dietpi/func/dietpi-notify 2 "Unknown input name ($INPUT_DEVICE_NAME). Nothing has been applied." + echo -e "$AVAIABLE_COMMANDS" + } Unknown_Input_Mode(){ diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 617dde8372..573cc4af63 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -11,12 +11,17 @@ # # Usage: # - # - /DietPi/dietpi/func/dietpi-set_software allo eth_dhcp / eth_static - # - /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 - # - /DietPi/dietpi/func/dietpi-set_software ntpd-mode configures NTPD mode (eg: ntp/systemd) + FP_SCRIPT='/DietPi/dietpi/func/dietpi-set_software' + AVAIABLE_COMMANDS=" +Available commands +$FP_SCRIPT allo eth_dhcp / eth_static +$FP_SCRIPT useradd X=create user with name X and default permissions, using global DietPi password (dietpi) +$FP_SCRIPT userdel X=delete user with name X +$FP_SCRIPT apt-mirror url/default +$FP_SCRIPT ntpd-mirror url/default +$FP_SCRIPT ntpd-mode configures NTPD mode (eg: ntp/systemd) +$FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entries if required +" #//////////////////////////////////// #Exit path for non-root logins. @@ -58,6 +63,7 @@ EXIT_CODE=1 /DietPi/dietpi/func/dietpi-notify 2 "Unknown input name ($INPUT_MODE_NAME). Nothing has been applied." + echo -e "$AVAIABLE_COMMANDS" } @@ -343,6 +349,64 @@ _EOF_ } + Verify_DietPi_Txt(){ + + #Verify entries with git dietpi.txt + local gitbranch=$(grep -m1 '^gitbranch=' /DietPi/dietpi.txt | sed 's/.*=//') + if [ -z "$gitbranch" ]; then + + gitbranch='master' + + fi + + INSTALL_URL="https://raw.githubusercontent.com/Fourdee/DietPi/$gitbranch/dietpi.txt" + /DietPi/dietpi/func/check_connection "$INSTALL_URL" + if (( $? == 0 )); then + + /DietPi/dietpi/func/dietpi-notify 0 "Patching dietpi.txt" + wget "$INSTALL_URL" -O /tmp/dietpi.txt_patch + + local entry=0 + local value=0 + while read line + do + + entry=$(echo -e "$line" | grep "^[^#;/]" ) + + if [ -n "$entry" ]; then + + value=$(echo -e "${entry##*=}") #*=X + entry=$(echo -e "${entry%%=*}") #X* + + # - Patch new entry if required + if (( ! $(grep -ci -m1 "^$entry=" /DietPi/dietpi.txt) )); then + + /DietPi/dietpi/func/dietpi-notify 2 "Updating dietpi.txt with new entry: $entry=$value" + cat << _EOF_ >> /DietPi/dietpi.txt +$entry=$value +_EOF_ + + else + + /DietPi/dietpi/func/dietpi-notify 0 "Verified: $entry" + + fi + + fi + + done < /tmp/dietpi.txt_patch + rm /tmp/dietpi.txt_patch + + /DietPi/dietpi/func/dietpi-notify 0 "dietpi.txt verification completed" + + else + + /DietPi/dietpi/func/dietpi-notify 1 "Failed to verify dietpi.txt, $INSTALL_URL is offline and/or inaccessible" + + fi + + } + #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// @@ -376,6 +440,10 @@ _EOF_ Allo_Main + elif [ "$INPUT_MODE_NAME" = "verify_dietpi.txt" ]; then + + Verify_DietPi_Txt + else Unknown_Input_Name diff --git a/dietpi/patch_file b/dietpi/patch_file index e4ec123566..5bae46673a 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -194,6 +194,7 @@ # fi + #///////////////////////////////////////////////////////////////////////////////////// #Incremental patch system: @@ -2904,21 +2905,6 @@ _EOF_ ${PHP_BIN}enmod dietpi fi - #------------------------------------------------------------------------------- - #Sparky SBC kernel patches - if (( $HW_MODEL == 70 )); then - - wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dragon_fly_check/uImage -O /boot/uImage - wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dragon_fly_check/3.10.38.bz2 -O package.tar - tar xvf package.tar -C /lib/modules/ - rm package.tar - - cat << _EOF_ > /DietPi/uEnv.txt -uenvcmd=setenv os_type linux; -bootargs=earlyprintk clk_ignore_unused selinux=0 scandelay console=tty0 loglevel=1 real_rootflag=rw root=/dev/mmcblk0p2 rootwait init=/lib/systemd/systemd aotg.urb_fix=1 aotg.aotg1_speed=0 -_EOF_ - - fi #------------------------------------------------------------------------------- #XU4 FFMPEG fix. Prefer debian.org over Meveric for backports: https://github.com/Fourdee/DietPi/issues/1273 if (( $HW_MODEL == 11 && $DISTRO == 3 )); then @@ -2944,7 +2930,27 @@ _EOF_ elif (( $VERSION_CURRENT == 159 )); then #------------------------------------------------------------------------------- - echo 0 + #Verify/update dietpi.txt entries: + #NB: After v160, dietpi-update will do this prior to each update + /DietPi/dietpi/func/dietpi-set_software verify_dietpi.txt + #------------------------------------------------------------------------------- + + + #Sparky SBC kernel patches + # Updated kernel which resolves HQplayer playback issues. + if (( $HW_MODEL == 70 )); then + + wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dragon_fly_check/uImage -O /boot/uImage + wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dragon_fly_check/3.10.38.bz2 -O package.tar + tar xvf package.tar -C /lib/modules/ + rm package.tar + + cat << _EOF_ > /DietPi/uEnv.txt +uenvcmd=setenv os_type linux; +bootargs=earlyprintk clk_ignore_unused selinux=0 scandelay console=tty0 loglevel=1 real_rootflag=rw root=/dev/mmcblk0p2 rootwait init=/lib/systemd/systemd aotg.urb_fix=1 aotg.aotg1_speed=0 +_EOF_ + + fi #------------------------------------------------------------------------------- fi From a4b9aff562cbfa7b99ffc606e9b95d814f7cf12d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 12 Dec 2017 22:09:54 +0100 Subject: [PATCH 011/390] DietPi-Software | ownCloud/Nextcloud: Respect existing redis socket path ...in case redis was already installed and different socket path in use by other software. --- dietpi/dietpi-software | 67 +++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 30 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 6f23164f3b..a1130219c1 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4170,19 +4170,22 @@ _EOF_ if (( $DISTRO == 3 )); then - echo -e "deb https://download.owncloud.org/download/repositories/stable/Debian_8.0/ /" > /etc/apt/sources.list.d/owncloud.list - apt-get update + echo -e 'deb https://download.owncloud.org/download/repositories/stable/Debian_8.0/ /' > /etc/apt/sources.list.d/owncloud.list elif (( $DISTRO == 4 )); then - echo -e "deb https://download.owncloud.org/download/repositories/stable/Debian_9.0/ /" > /etc/apt/sources.list.d/owncloud.list - apt-get update + echo -e 'deb https://download.owncloud.org/download/repositories/stable/Debian_9.0/ /' > /etc/apt/sources.list.d/owncloud.list fi fi - AGI owncloud-files 2> /dev/null + # Install APT package just, if we have ownCloud's own up to date repository. + if [ -f /etc/apt/sources.list.d/owncloud.list ]; then + + apt-get update && AGI owncloud-files + + fi else @@ -9130,7 +9133,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then # Enable necessary PHP modules: https://doc.owncloud.org/server/latest/admin_manual/installation/source_installation.html#php-extensions - ${PHP_APT_PACKAGE_NAME}enmod curl gd intl json pdo_mysql opcache apcu redis + "$PHP_APT_PACKAGE_NAME"enmod curl gd intl json pdo_mysql opcache apcu redis # Following modules are switchable since Stretch: if (( $DISTRO > 3 )); then @@ -9150,13 +9153,13 @@ _EOF_ # Do not overwrite existing config. if [ -f $owncloud_conf ]; then - owncloud_conf='/etc/apache2/sites-available/owncloud.conf.new' + owncloud_conf='/etc/apache2/sites-available/owncloud.conf.dietpi-new' fi cp /DietPi/dietpi/conf/apache.ownnextcloud.conf $owncloud_conf - sed -i "s/nextcloud/owncloud/g" $owncloud_conf - # OPCache adjustment is just forced by Nextcloud - sed -i "s/php_admin_value/#php_admin_value/" $owncloud_conf + sed -i 's/nextcloud/owncloud/g' $owncloud_conf + # OPcache adjustment is just asked by Nextcloud + sed -i 's/php_admin_value/#php_admin_value/' $owncloud_conf a2ensite owncloud &> /dev/null fi @@ -9168,7 +9171,7 @@ _EOF_ # Do not overwrite existing config. if [ -f $owncloud_config ]; then - owncloud_config='/etc/nginx/sites-dietpi/owncloud.config.new' + owncloud_config='/etc/nginx/sites-dietpi/owncloud.config.dietpi-new' fi cp /DietPi/dietpi/conf/nginx.sites-dietpi.owncloud.config $owncloud_config @@ -9176,8 +9179,8 @@ _EOF_ # Stretch: Use PHP7.0 socket and set 'fastcgi_request_buffering off'; if (( $DISTRO > 3 )); then - sed -i "s#/run/php5-fpm.sock#/run/php/php7.0-fpm.sock#g" $owncloud_config - sed -i "s/#fastcgi_request_buffering off;/fastcgi_request_buffering off;/g" $owncloud_config + sed -i 's|/run/php5-fpm.sock|/run/php/php7.0-fpm.sock|g' $owncloud_config + sed -i 's/#fastcgi_request_buffering off;/fastcgi_request_buffering off;/g' $owncloud_config fi @@ -9185,7 +9188,7 @@ _EOF_ 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" $owncloud_config + sed -i 's/#fastcgi_param HTTPS on;/fastcgi_param HTTPS on;/g' $owncloud_config fi @@ -9200,7 +9203,7 @@ innodb_file_per_table=1 _EOF_ # Check if we really do fresh installation: local oc_is_fresh=1 - if [ -d '/mnt/dietpi_userdata/mysql/owncloud' ]; then + if [ -d /mnt/dietpi_userdata/mysql/owncloud ]; then oc_is_fresh=0 @@ -9245,7 +9248,7 @@ _EOF_ fi # Set CLI URL to ownCloud sub directory: - sed -i "s#'http://localhost'#'http://localhost/owncloud'#g" $config_php + sed -i "s|'http://localhost'|'http://localhost/owncloud'|g" $config_php # APCu Memcache if (( ! $(cat $config_php | grep -ci -m1 "'memcache.local'") )); then @@ -9257,8 +9260,10 @@ _EOF_ # Redis for transactional file locking: # https://doc.owncloud.org/server/latest/admin_manual/configuration/server/caching_configura$ # - Enable Redis socket and grant www-data access to it: - sed -i "\#unixsocket /#c\unixsocket /var/run/redis/redis.sock" /etc/redis/redis*.conf - sed -i "\#unixsocketperm#c\unixsocketperm 770" /etc/redis/redis*.conf + local redis_conf="/etc/redis/redis*.conf" + grep -q "^\s*unixsocket /" $redis_conf || grep -q '#unixsocket /' $redis_conf && sed -i 's|#unixsocket /|unixsocket /|' $redis_conf || echo 'unixsocket /var/run/redis/redis.sock' >> $redis_conf + grep -q "^\s*#?unixsocketperm " $redis_conf && sed -i "/^\s*#?unixsocketperm /c\unixsocketperm 770" $redis_conf || echo 'unixsocketperm 770' >> $redis_conf + local redis_sock=$(grep "^\s*unixsocket " $redis_conf | sed "s/\s*unixsocket //") usermod -a -G redis www-data # - Enable ownCloud to use Redis socket: if (( ! $(cat $config_php | grep -ci -m1 "'memcache.locking'") )); then @@ -9266,7 +9271,7 @@ _EOF_ sed -i "\#'memcache.local'#a \ \ 'filelocking.enabled' => true,\n\ 'memcache.locking' => '\\\OC\\\Memcache\\\Redis',\n\ 'redis' => [\n\ - 'host' => '/var/run/redis/redis.sock',\n\ + 'host' => '$redis_sock',\n\ 'port' => 0,\n\ ]," $config_php @@ -9296,7 +9301,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then # Enable necessary PHP modules: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - ${PHP_APT_PACKAGE_NAME}enmod curl gd intl json pdo_mysql opcache apcu redis + "$PHP_APT_PACKAGE_NAME"enmod curl gd intl json pdo_mysql opcache apcu redis # Following modules are switchable since Stretch: if (( $DISTRO > 3 )); then @@ -9324,7 +9329,7 @@ _EOF_ # Do not overwrite existing config. if [ -f $nextcloud_conf ]; then - nextcloud_conf='/etc/apache2/sites-available/nextcloud.conf.new' + nextcloud_conf='/etc/apache2/sites-available/nextcloud.conf.dietpi-new' fi cp /DietPi/dietpi/conf/apache.ownnextcloud.conf $nextcloud_conf @@ -9339,7 +9344,7 @@ _EOF_ # Do not overwrite existing config. if [ -f $nextcloud_config ]; then - nextcloud_config='/etc/nginx/sites-dietpi/nextcloud.config.new' + nextcloud_config='/etc/nginx/sites-dietpi/nextcloud.config.dietpi-new' fi cp /DietPi/dietpi/conf/nginx.sites-dietpi.nextcloud.config $nextcloud_config @@ -9347,8 +9352,8 @@ _EOF_ # Stretch: Use PHP7.0 socket and set 'fastcgi_request_buffering off'; if (( $DISTRO > 3 )); then - sed -i "s#/run/php5-fpm.sock#/run/php/php7.0-fpm.sock#g" $nextcloud_config - sed -i "s/#fastcgi_request_buffering off;/fastcgi_request_buffering off;/g" $nextcloud_config + sed -i 's|/run/php5-fpm.sock|/run/php/php7.0-fpm.sock|g' $nextcloud_config + sed -i 's/#fastcgi_request_buffering off;/fastcgi_request_buffering off;/g' $nextcloud_config fi @@ -9356,7 +9361,7 @@ _EOF_ 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" $nextcloud_config + sed -i 's/#fastcgi_param HTTPS on;/fastcgi_param HTTPS on;/g' $nextcloud_config fi @@ -9371,7 +9376,7 @@ innodb_file_per_table=1 _EOF_ # Check if we really do fresh installation: local nc_is_fresh=1 - if [ -d '/mnt/dietpi_userdata/mysql/nextcloud' ]; then + if [ -d /mnt/dietpi_userdata/mysql/nextcloud ]; then nc_is_fresh=0 @@ -9414,7 +9419,7 @@ _EOF_ fi # Set CLI URL to Nextcloud sub directory: - sed -i "s#'http://localhost'#'http://localhost/nextcloud'#g" $config_php + sed -i "s|'http://localhost'|'http://localhost/nextcloud'|g" $config_php # APCu Memcache if (( ! $(cat $config_php | grep -ci -m1 "'memcache.local'") )); then @@ -9426,8 +9431,10 @@ _EOF_ # Redis for transactional file locking: # https://docs.nextcloud.com/server/12/admin_manual/configuration_files/files_locking_transactional.html # - Enable Redis socket and grant www-data access to it: - sed -i "\#unixsocket /#c\unixsocket /var/run/redis/redis.sock" /etc/redis/redis*.conf - sed -i "\#unixsocketperm#c\unixsocketperm 770" /etc/redis/redis*.conf + local redis_conf="/etc/redis/redis*.conf" + grep -q "^\s*unixsocket /" $redis_conf || grep -q '#unixsocket /' $redis_conf && sed -i 's|#unixsocket /|unixsocket /|' $redis_conf || echo 'unixsocket /var/run/redis/redis.sock' >> $redis_conf + grep -q "^\s*#?unixsocketperm " $redis_conf && sed -i "/^\s*#?unixsocketperm /c\unixsocketperm 770" $redis_conf || echo 'unixsocketperm 770' >> $redis_conf + local redis_sock=$(grep "^\s*unixsocket " $redis_conf | sed "s/\s*unixsocket //") usermod -a -G redis www-data # - Enable Nextloud to use Redis socket: if (( ! $(cat $config_php | grep -ci -m1 "'memcache.locking'") )); then @@ -9435,7 +9442,7 @@ _EOF_ sed -i "\#'memcache.local'#a \ \ 'filelocking.enabled' => true,\n\ 'memcache.locking' => '\\\OC\\\Memcache\\\Redis',\n\ 'redis' => array(\n\ - 'host' => '/var/run/redis/redis.sock',\n\ + 'host' => '$redis_sock',\n\ 'port' => 0,\n\ )," $config_php From 9a34482718e6adae4601b4d1b26c1d24991b2f53 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 12 Dec 2017 22:26:13 +0100 Subject: [PATCH 012/390] v160 --- dietpi/patch_file | 1 + 1 file changed, 1 insertion(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index 5bae46673a..81535caba6 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2790,6 +2790,7 @@ _EOF_ rm /etc/init.d/ympd &> /dev/null # switch to systemD # Enable ownCloud/Nextcloud maintenance mode before reinstall: + systemctl start mysql &> /dev/null sudo -u www-data php /var/www/owncloud/occ maintenance:mode --on &> /dev/null sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on &> /dev/null From 7a7e115e2bc61642efe7ccb16504014883363637 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 12 Dec 2017 23:24:59 +0100 Subject: [PATCH 013/390] v160 --- dietpi/patch_file | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 6927d9de87..82088aa571 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2941,26 +2941,26 @@ _EOF_ fi #------------------------------------------------------------------------------- - if [ grep 'aSOFTWARE_INSTALL_STATE[86]=2' /Dietpi/dietpi/.installed ] && (( $DISTRO > 3 )); then + if grep -q 'aSOFTWARE_INSTALL_STATE\[86\]=2' /DietPi/dietpi/.installed && (( $DISTRO > 3 )); then apt -y install mariadb-server apt -y purge mysql-server default-mysql-server - sed -i 's/aSOFTWARE_INSTALL_STATE[86]=2/aSOFTWARE_INSTALL_STATE[86]=0/' /DietPi/dietpi/.installed - sed -i 's/aSOFTWARE_INSTALL_STATE[88]=0/aSOFTWARE_INSTALL_STATE[88]=2/' /DietPi/dietpi/.installed + sed -i 's/aSOFTWARE_INSTALL_STATE\[86\]=2/aSOFTWARE_INSTALL_STATE\[86\]=0/' /DietPi/dietpi/.installed + sed -i 's/aSOFTWARE_INSTALL_STATE\[88\]=0/aSOFTWARE_INSTALL_STATE\[88\]=2/' /DietPi/dietpi/.installed # Also manually switch webstacks to MariaDB: - if [ grep 'aSOFTWARE_INSTALL_STATE[74]=2' /Dietpi/dietpi/.installed ]; then + if grep -q 'aSOFTWARE_INSTALL_STATE\[74\]=2' /DietPi/dietpi/.installed; then sed -i 's/aSOFTWARE_INSTALL_STATE\[74\]=2/aSOFTWARE_INSTALL_STATE\[74\]=0/' /DietPi/dietpi/.installed sed -i 's/aSOFTWARE_INSTALL_STATE\[76\]=0/aSOFTWARE_INSTALL_STATE\[76\]=2/' /DietPi/dietpi/.installed fi - if [ grep 'aSOFTWARE_INSTALL_STATE[74]=2' /Dietpi/dietpi/.installed ]; then + if grep -q 'aSOFTWARE_INSTALL_STATE\[77\]=2' /DietPi/dietpi/.installed; then sed -i 's/aSOFTWARE_INSTALL_STATE\[77\]=2/aSOFTWARE_INSTALL_STATE\[77\]=0/' /DietPi/dietpi/.installed sed -i 's/aSOFTWARE_INSTALL_STATE\[79\]=0/aSOFTWARE_INSTALL_STATE\[79\]=2/' /DietPi/dietpi/.installed fi - if [ grep 'aSOFTWARE_INSTALL_STATE[74]=2' /Dietpi/dietpi/.installed ]; then + if grep -q 'aSOFTWARE_INSTALL_STATE\[80\]=2' /DietPi/dietpi/.installed; then sed -i 's/aSOFTWARE_INSTALL_STATE\[80\]=2/aSOFTWARE_INSTALL_STATE\[80\]=0/' /DietPi/dietpi/.installed sed -i 's/aSOFTWARE_INSTALL_STATE\[82\]=0/aSOFTWARE_INSTALL_STATE\[82\]=2/' /DietPi/dietpi/.installed From 29a2b7cf9d80b9c703674f65eeab44f9d3118db3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 12 Dec 2017 23:51:28 +0100 Subject: [PATCH 014/390] v160 --- CHANGELOG.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d2cdb5036a..3b09190379 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -37,8 +37,8 @@ DietPi-Software | First run setup, now logged to /etc/dietpi/logs/dietpi-firstru DietPi-Software | APT log: Moved to /etc/dietpi/logs/dietpi-software_apt.log, to prevent RAMlog clearing log during automated installations. DietPi-Software | MPD (Stretch): Install updated to 0.20.11. Also supports native DSD playback (thanks to @sudeep and PJotr), when "Native" output freq/bit is set: https://github.com/Fourdee/DietPi/issues/1236 DietPi-Software | moOde: MPD now installed via pre-built binaries. Will reduce install time: https://github.com/Fourdee/DietPi/issues/1223#issuecomment-345265290 -DietPi-Software | Nextcloud: Correct database access issue for MariaDB + minor fixes: https://github.com/Fourdee/DietPi/pull/1242 -DietPi-Software | ownCloud: Installation fixed, respecting different distro repos: https://github.com/Fourdee/DietPi/pull/1243 +DietPi-Software | Nextcloud: Large installation rework, featuring redis file locking, system cron jobs, automatic maintenance, optimized webserver stack configs and others: https://github.com/Fourdee/DietPi/issues/1067 +DietPi-Software | ownCloud: Large installation rework, providing same state than Nextcloud. DietPi-Software | MPD (inc YMPD/O!MPD): Default data directory is now "/mnt", this will include all USB drives and network locations: https://github.com/Fourdee/DietPi/issues/1202 DietPi-Software | Mopidy: Default data directory is now "/mnt", this will include all USB drives and network locations. DietPi-Software | Syncthing: Installation updated to version 0.14.40, for new installations only. Removal of inotify (now included in main syncthing): https://github.com/Fourdee/DietPi/issues/1260 From 89d208e784d16f443a43b718a97f0abbe4fe2ce4 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 13 Dec 2017 09:09:08 +0000 Subject: [PATCH 015/390] v160 + DietPi-Software | Plex Media Server: Resolved uninstall to include /var/lib/plexmediaserver in removal (which is not completed via apt purge). + Sparky SBC: Matrix Audio X-SPDIF 2, native DSD is now added to kernel, many thanks @sudeep: https://github.com/sparkysbc/Linux/pull/3 + https://github.com/Fourdee/DietPi/issues/1285 --- CHANGELOG.txt | 3 + PREP_SYSTEM_FOR_DIETPI.sh | 813 +++++++++++++++++++++++----- dietpi/conf/fstab | 19 - dietpi/conf/fstab_rock64 | 19 - dietpi/conf/fstab_vm | 14 - dietpi/conf/fstab_x86_64-native | 15 - dietpi/conf/fstab_x86_64-native_EFI | 19 - dietpi/dietpi-drive_manager | 38 +- dietpi/dietpi-software | 2 + dietpi/finalise | 40 +- dietpi/patch_file | 2 - 11 files changed, 715 insertions(+), 269 deletions(-) delete mode 100644 dietpi/conf/fstab delete mode 100644 dietpi/conf/fstab_rock64 delete mode 100644 dietpi/conf/fstab_vm delete mode 100644 dietpi/conf/fstab_x86_64-native delete mode 100644 dietpi/conf/fstab_x86_64-native_EFI diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d2cdb5036a..6ebaf79647 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,10 +6,13 @@ Image Modifications: Changes / Improvements / Optimizations: Bug Fixes: +DietPi-Software | Plex Media Server: Resolved uninstall to include /var/lib/plexmediaserver in removal (which is not completed via apt purge). DietPi-Update | dietpi.txt is now checked for missing entries, and, will now be patched during the update: https://github.com/Fourdee/DietPi/issues/1292#issuecomment-350818969 Sparky SBC | Kernel patch will be applied which resolves issues with HQPlayer playback: https://www.computeraudiophile.com/forums/topic/32132-allo-sparky-usbridge/?do=findComment&comment=753100 + Allo Web Interface v4: +Sparky SBC: Matrix Audio X-SPDIF 2, native DSD is now added to kernel, many thanks @sudeep: https://github.com/sparkysbc/Linux/pull/3 ----------------------------------------------------------------------------------------------------------- diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index b5e5def5bd..54ebe0d880 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -44,55 +44,6 @@ Check_Connection(){ } -Error_Check(){ - - #Grab exit code in case of failure - exit_code=$? - if (( $exit_code != 0 )); then - - dietpi-notify 1 "($exit_code): Script aborted" - exit $exit_code - - else - - dietpi-notify 2 "($exit_code): Passed" - fi - -} - -#Apt-get -AGI(){ - - local string="$@" - - local force_WHIP_OPTIONs='--force-yes' - - if (( $DISTRO >= 4 )); then - - force_WHIP_OPTIONs='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' - - fi - - DEBIAN_FRONTEND=noninteractive $(which apt) install -y $force_WHIP_OPTIONs $string - -} - -AGP(){ - - local string="$@" - if (( $DISTRO >= 4 )); then - - string+=' --allow-change-held-packages' - - fi - - #DEBUG: Dry run for testing - string+=' --dry-run' - - $(which apt) purge -y $string - -} - #DietPi-Notify: dietpi-notify(){ @@ -185,6 +136,55 @@ dietpi-notify(){ #----------------------------------------------------------------------------------- } +Error_Check(){ + + #Grab exit code in case of failure + exit_code=$? + if (( $exit_code != 0 )); then + + dietpi-notify 1 "($exit_code): Script aborted" + exit $exit_code + + else + + dietpi-notify 2 "($exit_code): Passed" + fi + +} + +#Apt-get +AGI(){ + + local string="$@" + + local force_WHIP_OPTIONs='--force-yes' + + if (( $DISTRO >= 4 )); then + + force_WHIP_OPTIONs='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' + + fi + + DEBIAN_FRONTEND=noninteractive $(which apt) install -y $force_WHIP_OPTIONs $string + +} + +AGP(){ + + local string="$@" + if (( $DISTRO >= 4 )); then + + string+=' --allow-change-held-packages' + + fi + + #DEBUG: Dry run for testing + string+=' --dry-run' + + $(which apt) purge -y $string + +} + #Whiptail WHIP_BACKTITLE='DietPi-Prep' WHIP_TITLE=0 @@ -196,7 +196,7 @@ WHIP_OPTION=0 WHIP_CHOICE=0 Run_Whiptail(){ - WHIP_OPTION=$(whiptail --title "$WHIP_TITLE" --menu "$WHIP_DESC" --default-item "$WHIP_DEFAULT_ITEM" --backtitle "$WHIP_BACKTITLE" 30 80 20 "${WHIP_MENU_ARRAY[@]}" 3>&1 1>&2 2>&3) + WHIP_OPTION=$(whiptail --title "$WHIP_TITLE" --menu "$WHIP_DESC" --default-item "$WHIP_DEFAULT_ITEM" --backtitle "$WHIP_BACKTITLE" 22 80 16 "${WHIP_MENU_ARRAY[@]}" 3>&1 1>&2 2>&3) WHIP_CHOICE=$? if (( $WHIP_CHOICE == 0 )); then @@ -223,13 +223,14 @@ Run_Whiptail(){ #------------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------------ +AVOIDRUN(){ #------------------------------------------------------------------------------------------------ #Step 1: Initial Critical Prep #------------------------------------------------------------------------------------------------ ############### -dietpi-notify 0 'Updating Apt and installing initial core packages' +dietpi-notify 0 'Updating APT' apt-get clean Error_Check @@ -238,7 +239,7 @@ apt-get update Error_Check ############### -dietpi-notify 0 'Installing Core Packages' +dietpi-notify 0 'Installing core packages, required for this script to function' AGI wget unzip whiptail Error_Check @@ -349,11 +350,11 @@ dietpi-notify 0 "Setting APT sources.list: $DISTRO_NAME $DISTRO" if (( $HW_MODEL < 10 )); then cat << _EOF_ > /etc/apt/sources.list -deb https://www.mirrorservice.org/sites/archive.raspbian.org/raspbian $DISTRO main contrib non-free rpi +deb https://www.mirrorservice.org/sites/archive.raspbian.org/raspbian $DISTRO_NAME main contrib non-free rpi _EOF_ cat << _EOF_ > /etc/apt/sources.list.d/raspi.list -deb https://archive.raspberrypi.org/debian/ $DISTRO main ui +deb https://archive.raspberrypi.org/debian/ $DISTRO_NAME main ui _EOF_ else @@ -379,9 +380,348 @@ Error_Check apt-get update Error_Check +} + #------------------------------------------------------------------------------------------------ #Step 4: APT removals #------------------------------------------------------------------------------------------------ +# - DietPi list of minimal required packages which must be installed: +# dpkg --get-selections | awk '{print $1}' | sed 's/:armhf//g' | sed "s/^/'/g" | sed "s/$/'/g" + +aPACKAGES_REQUIRED_INSTALL=( + + 'acl' + 'adduser' + 'apt' + 'apt-transport-https' + 'apt-utils' + 'base-files' + 'base-passwd' + 'bash' + 'bash-completion' + 'bc' + 'bsdmainutils' + 'bsdutils' + 'bzip2' + 'ca-certificates' + 'console-common' + 'console-data' + 'console-setup' + 'console-setup-linux' + 'coreutils' + 'cpio' + 'crda' + 'cron' + 'curl' + 'dash' + 'dbus' + 'dc' + 'debconf' + 'debconf-utils' + 'debian-archive-keyring' + 'debianutils' + 'diffutils' + 'dmidecode' + 'dmsetup' + 'dosfstools' + 'dphys-swapfile' + 'dpkg' + 'e2fslibs' + 'e2fsprogs' + 'ethtool' + 'fake-hwclock' + 'fbset' + 'findutils' + 'firmware-atheros' + 'firmware-brcm80211' + 'firmware-ralink' + 'firmware-realtek' + 'fuse' + 'gnupg' + 'gpgv' + 'grep' + 'groff-base' + 'gzip' + 'hdparm' + 'hfsplus' + 'hostname' + 'htop' + 'ifupdown' + 'init' + 'init-system-helpers' + 'initramfs-tools' + 'initscripts' + 'insserv' + 'iproute2' + 'iputils-ping' + 'isc-dhcp-client' + 'isc-dhcp-common' + 'iw' + 'kbd' + 'keyboard-configuration' + 'klibc-utils' + 'kmod' + 'less' + 'locales' + 'login' + 'lsb-base' + 'mawk' + 'mount' + 'multiarch-support' + 'nano' + 'ncurses-base' + 'ncurses-bin' + 'net-tools' + 'netbase' + 'nfacct' + 'ntfs-3g' + 'ntp' + 'openssl' + 'p7zip-full' + 'parted' + 'passwd' + 'perl-base' + 'procps' + 'psmisc' + 'readline-common' + 'resolvconf' + 'rsync' + 'sed' + 'sensible-utils' + 'startpar' + 'sudo' + 'systemd' + 'systemd-sysv' + 'sysv-rc' + 'sysvinit-utils' + 'tar' + 'tzdata' + 'udev' + 'unzip' + 'usbutils' + 'util-linux' + 'wget' + 'whiptail' + 'wireless-regdb' + 'wireless-tools' + 'wpasupplicant' + 'wput' + 'xkb-data' + 'xz-utils' + 'zip' + +) + +#List of packages we should never remove (eg: HW specific kernels, uboot etc): +aPACKAGES_AVOID_REMOVAL=( + + #General + 'lib' #Libs + 'gcc-' + 'linux-image-' #Odroid/x86_64 kernel + 'linux-base' + 'busybox' + 'uboot' #Odroid + 'u-boot' #Odroid + 'u-boot-tools' #Odroid + 'rfkill' #Used by some onboard WiFi adapters + + #Firmware + 'firmware-linux-nonfree' #x86 AMD/INTEL bundle + 'firmware-misc-nonfree' + + #Keys + 'deb-multimedia-keyring' + + #RPi + 'libraspberrypi-bin' + 'libraspberrypi0' + 'raspberrypi-bootloader' + 'raspberrypi-kernel' + 'raspberrypi-sys-mods' + 'raspbian-archive-keyring' + 'raspi-copies-and-fills' + +) + +aPACKAGES_REQUIRED_DEPS=() + +INSTALL_PACKAGES='' +REMOVE_PACKAGES='' + +############### +dietpi-notify 0 "Obtaining list of currently installed packages" + +dpkg --get-selections | awk '{print $1}' > /tmp/current_installed_packages +Error_Check + + +############### +dietpi-notify 0 "Generating a list of deps, required for the DietPi packages\nThis may take some time, please wait..." + +for ((i=0; i<${#aPACKAGES_REQUIRED_INSTALL[@]}; i++)) +do + + # One line INSTALL_PACKAGES so we can use it later. + INSTALL_PACKAGES+="${aPACKAGES_REQUIRED_INSTALL[$i]}" + + # Add deps (ignoring libs and <>) + echo -e "Checking deps: ${aPACKAGES_REQUIRED_INSTALL[$i]}" + #dietpi-notify 2 "Checking deps for ${aPACKAGES_REQUIRED_INSTALL[$i]}" # RESULTS IN $i fixated on 3 + + VALUE=$(apt-cache depends ${aPACKAGES_REQUIRED_INSTALL[$i]} | grep 'Depends' | awk '{print $2}' | sed '/^lib/d' | sed '/ /etc/apt/apt.conf.d/local +Dpkg::options { + "--force-confdef"; + "--force-confold"; +} +_EOF_ +Error_Check +############### +dietpi-notify 0 "Upgrading existing APT installed packages to latest" +DEBIAN_FRONTEND='noninteractive' apt-get dist-upgrade -y +Error_Check +if (( $HW_MODEL == 43 )); then -#??? ROCK64, reinstall kernel packages: -# apt-get install linux-rock64-package -#??? + ############### + dietpi-notify 0 "Reinstalling linux-rock64-package" + AGI linux-rock64-package + Error_Check + +fi #???: WHIP_OPTIONal Reinstall OpenSSH (for updating dietpi scripts etc). Gets removed during finalise. # apt-get install openssh-server -y @@ -469,113 +822,264 @@ Error_Check #??? -exit +############### +dietpi-notify 0 "Disabling swapfile generation for dphys-swapfile during install" + +echo -e "CONF_SWAPSIZE=0" > /etc/dphys-swapfile +Error_Check + + +############### +dietpi-notify 0 "Installing core DietPi pre-req APT packages" + +AGI gnupg net-tools cron rfkill ca-certificates locales apt-transport-https ethtool p7zip-full hfsplus iw debconf-utils xz-utils fbset wpasupplicant resolvconf bc dbus bzip2 psmisc bash-completion cron whiptail sudo ntp ntfs-3g dosfstools parted hdparm usbutils zip htop wput wget fake-hwclock dphys-swapfile curl unzip console-setup console-data console-common keyboard-configuration wireless-tools wireless-regdb crda --no-install-recommends +Error_Check + +# - HW specific +if (( $HW_MODEL == 21 )); then + + ############### + dietpi-notify 0 "Installing Grub" + # MBR + # AGI grub2 + # UEFI + AGI grub-common grub-efi-amd64 grub-efi-amd64-bin grub2-common + Error_Check + +fi + +WHIP_TITLE='Onboard Bluetooth' +WHIP_DESC='Please select an option' +WHIP_DEFAULT_ITEM=0 +WHIP_MENU_ARRAY=( + '0' 'Select if this device does NOT have onboard Bluetooth' + '1' 'Select if this device DOES have onboard Bluetooth' +) + +Run_Whiptail +if (( $WHIP_RETURN_VALUE == 1 )); then + + ############### + dietpi-notify 0 "Installing Bluetooth packages" + + AGI bluetooth bluez-firmware + Error_Check +fi +if (( $HW_MODEL < 10 )); then + ############### + dietpi-notify 0 "Installing Bluetooth packages specific to RPi" + AGI pi-bluetooth libraspberrypi-bin + Error_Check +fi + +if (( $HW_MODEL < 10 )); then + + ############### + dietpi-notify 0 "Installing firmware packages" + + AGI firmware-linux-nonfree firmware-realtek firmware-ralink firmware-brcm80211 firmware-atheros --no-install-recommends + Error_Check + +fi #------------------------------------------------------------------------------------------------ -#Packages +#Step 6: Download DietPi sourcecode #------------------------------------------------------------------------------------------------ +############### +INTERNET_ADDRESS='https://github.com/Fourdee/DietPi/archive/testing.zip' #NB: testing until this is stable in master +dietpi-notify 0 "Checking connection to $INTERNET_ADDRESS" +Check_Connection "$INTERNET_ADDRESS" +Error_Check +############### +dietpi-notify 0 "Downloading DietPi sourcecode" +wget "$INTERNET_ADDRESS" -O package.zip +Error_Check -#install packages -apt-get dist-upgrade -y -echo -e "CONF_SWAPSIZE=0" > /etc/dphys-swapfile -apt-get install -y gnupg net-tools cron rfkill ca-certificates locales apt-transport-https ethtool p7zip-full hfsplus iw debconf-utils xz-utils fbset wpasupplicant resolvconf bc dbus bzip2 psmisc bash-completion cron whiptail sudo ntp ntfs-3g dosfstools parted hdparm usbutils zip htop wput wget fake-hwclock dphys-swapfile curl unzip console-setup console-data console-common keyboard-configuration wireless-tools wireless-regdb crda --no-install-recommends +############### +dietpi-notify 0 "Extracting DietPi sourcecode" -#??? Grub/intel+amd microcode firmware x86_64 native -# MBR -apt-get install -y grub2 -# UEFI -apt-get install -y grub-common grub-efi-amd64 grub-efi-amd64-bin grub2-common -#??? +unzip package.zip +Error_Check -#??? bluetooth if onboard device / RPI -apt-get install -y bluetooth bluez-firmware -#??? +rm package.zip -#??? RPi - bluetooth/firmware for all RPi's -apt-get install -y pi-bluetooth libraspberrypi-bin -#??? -#??? x86 images only: firmware -apt-get install -y firmware-linux-nonfree firmware-realtek firmware-ralink firmware-brcm80211 firmware-atheros --no-install-recommends -#??? +############### +dietpi-notify 0 "Removing files not required" + +# Remove files we do not require, or want to overwrite in /boot +rm DietPi-*/CHANGELOG.txt +rm DietPi-*/PREP_SYSTEM_FOR_DIETPI.sh +rm DietPi-*/TESTING-BRANCH.md +rm DietPi-*/uEnv.txt # Pine 64, use existing on system. + + +############### +dietpi-notify 0 "Creating /boot" + +mkdir -p /boot +Error_Check + + +############### +dietpi-notify 0 "Moving to /boot" + +# - HW specific boot.ini uenv.txt +if (( $HW_MODEL == 10 )); then + + mv DietPi-*/boot_c1.ini /boot/boot.ini + Error_Check + +fi + +if (( $HW_MODEL == 11 )); then + + mv DietPi-*/boot_xu4.ini /boot/boot.ini + Error_Check + +fi + +if (( $HW_MODEL == 12 )); then + + mv DietPi-*/boot_c2.ini /boot/boot.ini + Error_Check + +fi + +rm DietPi-*/*.ini + +cp -R DietPi-*/* /boot/ +Error_Check + + +############### +dietpi-notify 0 "Cleaning up extracted files" + +rm -R DietPi-* +Error_Check + + +############### +dietpi-notify 0 "Setting execute permissions for /boot/dietpi" + +chmod +x -R /boot/dietpi +Error_Check #------------------------------------------------------------------------------------------------ -#DIETPI STUFF +#Step 7: Prep DietPi ENV #------------------------------------------------------------------------------------------------ -chmod +x -R /boot +############### +dietpi-notify 0 "Prep system for DietPi ENV" -#Delete any non-root user (eg: pi) -userdel -f pi -userdel -f test #armbian -userdel -f odroid -userdel -f rock64 -userdel -f linaro #ASUS TB -userdel -f dietpi -userdel -f debian #BBB -#Remove folders (now in finalise script) +############### +dietpi-notify 0 "Deleting list of known users, not required by DietPi" + +userdel -f pi &> /dev/null +userdel -f test &> /dev/null #armbian +userdel -f odroid &> /dev/null +userdel -f rock64 &> /dev/null +userdel -f linaro &> /dev/null #ASUS TB +userdel -f dietpi &> /dev/null +userdel -f debian &> /dev/null #BBB + +############### +dietpi-notify 0 "Removing misc files/folders, not required by DietPi" + +rm -R /home &> /dev/null +rm -R /media &> /dev/null + +rm -R /usr/share/fonts/* &> /dev/null +rm -R /usr/share/icons/* &> /dev/null -#+Remove files #rm /etc/apt/sources.list.d/armbian.list -rm /etc/init.d/resize2fs -rm /etc/update-motd.d/* # ARMbian +rm /etc/init.d/resize2fs &> /dev/null +rm /etc/update-motd.d/* &> /dev/null # ARMbian -systemctl disable firstrun -rm /etc/init.d/firstrun # ARMbian +systemctl disable firstrun &> /dev/null +rm /etc/init.d/firstrun &> /dev/null # ARMbian -# Disable ARMbian's log2ram: https://github.com/Fourdee/DietPi/issues/781 -systemctl disable log2ram.service -systemctl stop log2ram.service -rm /usr/local/sbin/log2ram -rm /etc/systemd/system/log2ram.service -systemctl daemon-reload -rm /etc/cron.hourly/log2ram +# - Disable ARMbian's log2ram: https://github.com/Fourdee/DietPi/issues/781 +systemctl disable log2ram.service &> /dev/null +systemctl stop log2ram.service &> /dev/null +rm /usr/local/sbin/log2ram &> /dev/null +rm /etc/systemd/system/log2ram.service &> /dev/null +systemctl daemon-reload &> /dev/null +rm /etc/cron.hourly/log2ram &> /dev/null + +rm /etc/init.d/cpu_governor &> /dev/null# Meveric +rm /etc/systemd/system/cpu_governor.service &> /dev/null# Meveric -rm /etc/init.d/cpu_governor # Meveric -rm /etc/systemd/system/cpu_governor.service # Meveric +# -Disable ARMbian's resize service (not automatically removed by ARMbian scripts...) +systemctl disable resize2fs &> /dev/null +rm /etc/systemd/system/resize2fs.service &> /dev/null -# Disable ARMbian's resize service (not automatically removed by ARMbian scripts...) -systemctl disable resize2fs -rm /etc/systemd/system/resize2fs.service +# -ARMbian-config +rm /etc/profile.d/check_first_login_reboot.sh &> /dev/null -# ARMbian-config -rm /etc/profile.d/check_first_login_reboot.sh -#Set UID bit for sudo: https://github.com/Fourdee/DietPi/issues/794 +############### +dietpi-notify 0 "Setting UID bit for sudo" + +# - https://github.com/Fourdee/DietPi/issues/794 chmod 4755 /usr/bin/sudo +Error_Check + + +############### +dietpi-notify 0 "Creating DietPi system directories" -#Create DietPi common folders +# - Create DietPi common folders mkdir /DietPi +Error_Check + +mkdir -p /etc/dietpi +Error_Check mkdir -p /mnt/dietpi_userdata +Error_Check mkdir -p /mnt/samba +Error_Check + mkdir -p /mnt/ftp_client +Error_Check + mkdir -p /mnt/nfs_client +Error_Check + echo -e "Samba client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking WHIP_OPTIONs: NAS/Misc menu" > /mnt/samba/readme.txt echo -e "FTP client mount can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking WHIP_OPTIONs: NAS/Misc menu" > /mnt/ftp_client/readme.txt echo -e "NFS client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking WHIP_OPTIONs: NAS/Misc menu" > /mnt/nfs_client/readme.txt + +############### +dietpi-notify 0 "Deleting all log files /var/log. Please ignore any errors, its fine :)" + /boot/dietpi/dietpi-logclear 2 -#FSTAB -cp /boot/dietpi/conf/fstab /etc/fstab -systemctl daemon-reload -mount -a -#Setup DietPi services -# DietPi-Ramdisk +############### +dietpi-notify 0 "Generating DietPi /etc/fstab" + +/boot/dietpi/dietpi-drive_manager 4 +Error_Check + + +############### +dietpi-notify 0 "Installing and starting DietPi-RAMdisk service" + cat << _EOF_ > /etc/systemd/system/dietpi-ramdisk.service [Unit] Description=DietPi-RAMdisk @@ -594,6 +1098,11 @@ _EOF_ systemctl enable dietpi-ramdisk.service systemctl daemon-reload systemctl start dietpi-ramdisk.service +Error_Check + + +############### +dietpi-notify 0 "Installing and starting DietPi-RAMlog service" # DietPi-Ramlog cat << _EOF_ > /etc/systemd/system/dietpi-ramlog.service @@ -614,6 +1123,11 @@ _EOF_ systemctl enable dietpi-ramlog.service systemctl daemon-reload systemctl start dietpi-ramlog.service +Error_Check + + +############### +dietpi-notify 0 "Installing DietPi boot service" # Boot cat << _EOF_ > /etc/systemd/system/dietpi-boot.service @@ -634,10 +1148,13 @@ _EOF_ systemctl enable dietpi-boot.service systemctl daemon-reload -# Remove rc.local from /etc/init.d -update-rc.d -f rc.local remove -rm /etc/init.d/rc.local -rm /lib/systemd/system/rc-local.service + +############### +dietpi-notify 0 "Installing DietPi /etc/rc.local service" + +update-rc.d -f rc.local remove &> /dev/null +rm /etc/init.d/rc.local &> /dev/null +rm /lib/systemd/system/rc-local.service &> /dev/null cat << _EOF_ > /etc/systemd/system/rc-local.service [Unit] @@ -681,7 +1198,10 @@ _EOF_ chmod +x /etc/rc.local systemctl daemon-reload -# Shutdown SSH/Dropbear before reboot + +############### +dietpi-notify 0 "Installing kill-ssh-user-sessions-before-network.service" + cat << _EOF_ > /etc/systemd/system/kill-ssh-user-sessions-before-network.service [Unit] Description=Shutdown all ssh sessions before network @@ -699,13 +1219,23 @@ systemctl enable kill-ssh-user-sessions-before-network systemctl daemon-reload +############### +dietpi-notify 0 "Installing DietPi Cron jobs" + #Cron jobs cp /DietPi/dietpi/conf/cron.daily_dietpi /etc/cron.daily/dietpi +Error_Check chmod +x /etc/cron.daily/dietpi +Error_Check cp /DietPi/dietpi/conf/cron.hourly_dietpi /etc/cron.hourly/dietpi +Error_Check chmod +x /etc/cron.hourly/dietpi +Error_Check + + +############### +dietpi-notify 0 "Generating default crontab" -#Crontab cat << _EOF_ > /etc/crontab #Please use dietpi-cron to change cron start times SHELL=/bin/sh @@ -717,20 +1247,23 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 47 1 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 1 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) _EOF_ +Error_Check + + + + + + +exit + + + + #ntp rm /etc/cron.daily/ntp &> /dev/null rm /etc/init.d/ntp &> /dev/null -#Apt -# - Force use existing installed configs if available, else install new. Also disables end user prompt from dpkg -cat << _EOF_ > /etc/apt/apt.conf.d/local -Dpkg::options { - "--force-confdef"; - "--force-confold"; -} -_EOF_ - #Disable automatic updates and management of apt cache. Prevents unexpected lock on Apt cache and therefore failed apt installations. systemctl mask apt-daily.service systemctl mask apt-daily-upgrade.timer diff --git a/dietpi/conf/fstab b/dietpi/conf/fstab deleted file mode 100644 index 15bfabfa71..0000000000 --- a/dietpi/conf/fstab +++ /dev/null @@ -1,19 +0,0 @@ -#Internal Drives--------------------------------------------------- -proc /proc proc defaults 0 0 -/dev/mmcblk0p1 /boot auto defaults,noatime,discard 0 2 -/dev/mmcblk0p2 / auto defaults,noatime,discard 0 1 -tmpfs /tmp tmpfs defaults,noatime,nodev,nosuid,mode=1777 0 0 -tmpfs /var/log tmpfs defaults,size=20m,noatime,nodev,nosuid,mode=1777 0 0 -tmpfs /DietPi tmpfs defaults,size=10m,noatime,nodev,nosuid,mode=1777 0 0 - -#Samba Client------------------------------------------------------ -#/mnt/samba . Please use dietpi-config and the Networking Options: NAS menu to setup this mount - -#FTP Client Mount-------------------------------------------------- -#/mnt/ftp_client . Please use dietpi-config and the Networking Options: NAS menu to setup this mount - -#NFS Client Mount-------------------------------------------------- -#/mnt/nfs_client . Please use dietpi-config and the Networking Options: NAS menu to setup this mount - -#External Drives--------------------------------------------------- -#NB: Please use dietpi-drive_manager to setup and control your external drives. diff --git a/dietpi/conf/fstab_rock64 b/dietpi/conf/fstab_rock64 deleted file mode 100644 index 3982d78cda..0000000000 --- a/dietpi/conf/fstab_rock64 +++ /dev/null @@ -1,19 +0,0 @@ -#Internal Drives--------------------------------------------------- -proc /proc proc defaults 0 0 -PARTUUID=1ad0eca1-3f39-40c8-be44-c07adeeb5917 /boot/efi auto defaults,noatime,discard 0 2 -PARTUUID=c1cae5b3-08a0-4d9f-97fd-890fbac03de6 / auto defaults,noatime,discard 0 1 -tmpfs /tmp tmpfs defaults,noatime,nodev,nosuid,mode=1777 0 0 -tmpfs /var/log tmpfs defaults,size=20m,noatime,nodev,nosuid,mode=1777 0 0 -tmpfs /DietPi tmpfs defaults,size=10m,noatime,nodev,nosuid,mode=1777 0 0 - -#Samba Client------------------------------------------------------ -#/mnt/samba . Please use dietpi-config and the Networking Options: NAS menu to setup this mount - -#FTP Client Mount-------------------------------------------------- -#/mnt/ftp_client . Please use dietpi-config and the Networking Options: NAS menu to setup this mount - -#NFS Client Mount-------------------------------------------------- -#/mnt/nfs_client . Please use dietpi-config and the Networking Options: NAS menu to setup this mount - -#External Drives--------------------------------------------------- -#NB: Please use dietpi-drive_manager to setup and control your external drives. diff --git a/dietpi/conf/fstab_vm b/dietpi/conf/fstab_vm deleted file mode 100644 index b3c0a6e84b..0000000000 --- a/dietpi/conf/fstab_vm +++ /dev/null @@ -1,14 +0,0 @@ -#Internal Drives--------------------------------------------------- -UUID=044766be-96ca-491a-a93f-913b75a843bd / ext4 defaults,noatime,nodiratime,errors=remount-ro 0 1 -tmpfs /tmp tmpfs defaults,noatime,nodev,nosuid,mode=1777 0 0 -tmpfs /var/log tmpfs defaults,size=20m,noatime,nodev,nosuid,mode=1777 0 0 -tmpfs /DietPi tmpfs defaults,size=10m,noatime,nodev,nosuid,mode=1777 0 0 - -#Samba Client------------------------------------------------------ -#/mnt/samba . Please use dietpi-config and the networking menu to setup this mount - -#FTP Client Mount-------------------------------------------------- -#/mnt/ftp_client . Please use dietpi-config and the networking menu to setup this mount - -#External Drives--------------------------------------------------- -#NB: Please use dietpi-drive_manager to setup and control your external drives. diff --git a/dietpi/conf/fstab_x86_64-native b/dietpi/conf/fstab_x86_64-native deleted file mode 100644 index 9701a8fc18..0000000000 --- a/dietpi/conf/fstab_x86_64-native +++ /dev/null @@ -1,15 +0,0 @@ -#Internal Drives--------------------------------------------------- -UUID=497d51ff-a4c5-4ead-9195-329f4d97ac66 / ext4 noatime,nodiratime,errors=remount-ro 0 1 -UUID=c796bac5-7cf9-464f-aecd-788904a1b3da /boot ext4 noatime,nodiratime 0 2 -tmpfs /tmp tmpfs defaults,noatime,nodev,nosuid,mode=1777 0 0 -tmpfs /var/log tmpfs defaults,size=20m,noatime,nodev,nosuid,mode=1777 0 0 -tmpfs /DietPi tmpfs defaults,size=10m,noatime,nodev,nosuid,mode=1777 0 0 - -#Samba Client------------------------------------------------------ -#/mnt/samba . Please use dietpi-config and the networking menu to setup this mount - -#FTP Client Mount-------------------------------------------------- -#/mnt/ftp_client . Please use dietpi-config and the networking menu to setup this mount - -#External Drives--------------------------------------------------- -#NB: Please use dietpi-drive_manager to setup and control your external drives. diff --git a/dietpi/conf/fstab_x86_64-native_EFI b/dietpi/conf/fstab_x86_64-native_EFI deleted file mode 100644 index 9c2b5a7951..0000000000 --- a/dietpi/conf/fstab_x86_64-native_EFI +++ /dev/null @@ -1,19 +0,0 @@ -#Internal Drives--------------------------------------------------- -proc /proc proc defaults 0 0 -UUID=CA7A-8CED /boot/efi auto defaults,noatime,discard 0 2 -UUID=e1efd31c-5b47-4db1-b600-7954f833f9f5 / auto defaults,noatime,discard 0 1 -tmpfs /tmp tmpfs defaults,noatime,nodev,nosuid,mode=1777 0 0 -tmpfs /var/log tmpfs defaults,size=20m,noatime,nodev,nosuid,mode=1777 0 0 -tmpfs /DietPi tmpfs defaults,size=10m,noatime,nodev,nosuid,mode=1777 0 0 - -#Samba Client------------------------------------------------------ -#/mnt/samba . Please use dietpi-config and the Networking Options: NAS menu to setup this mount - -#FTP Client Mount-------------------------------------------------- -#/mnt/ftp_client . Please use dietpi-config and the Networking Options: NAS menu to setup this mount - -#NFS Client Mount-------------------------------------------------- -#/mnt/nfs_client . Please use dietpi-config and the Networking Options: NAS menu to setup this mount - -#External Drives--------------------------------------------------- -#NB: Please use dietpi-drive_manager to setup and control your external drives. diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 220ad63301..6a66ca2f71 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -17,6 +17,7 @@ # 1 = Selectadrive! Provides a list of available drive mount locations, with value on selection saved to: /tmp/dietpi-drive_manager_selmnt # 2 = Returns exit 1 if low on freespace # 3 = Returns exit 1 if rootfs is currently RO (NB: simple check via mount cmd, does not init full drive manager vars, for quicker loading/processing) + # 4 = Generates a new /etc/fstab based on current mounted drives (for use in PREP_SYSTEM_FOR_DIETPI.sh) # # NB: This script does not support quoted/string UUID entries in /etc/fstab. #//////////////////////////////////// @@ -35,8 +36,15 @@ fi - HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) - HW_NAME=$(sed -n 2p /DietPi/dietpi/.hw_model) + HW_MODEL=$(cat /etc/.dietpi_hw_model_identifier) + HW_NAME='PREP_SYSTEM_FOR_DIETPI.sh' + + if [ -d /DietPi/dietpi ]; then + + HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) + HW_NAME=$(sed -n 2p /DietPi/dietpi/.hw_model) + + fi #Grab Input (valid interger) INPUT=0 @@ -1266,8 +1274,32 @@ fi #----------------------------------------------------------------------------------- + #Generate /etc/fstab based on current drive mounts + if (( $INPUT == 4 )); then + + cat << _EOF_ > /etc/fstab +#Samba Client------------------------------------------------------ +#/mnt/samba . Please use dietpi-config and the Networking Options: NAS menu to setup this mount + +#FTP Client Mount-------------------------------------------------- +#/mnt/ftp_client . Please use dietpi-config and the Networking Options: NAS menu to setup this mount + +#NFS Client Mount-------------------------------------------------- +#/mnt/nfs_client . Please use dietpi-config and the Networking Options: NAS menu to setup this mount + +#TMPFS / MISC ------------------------------------------------------ +proc /proc proc defaults 0 0 +tmpfs /tmp tmpfs defaults,noatime,nodev,nosuid,mode=1777 0 0 +tmpfs /var/log tmpfs defaults,size=20m,noatime,nodev,nosuid,mode=1777 0 0 +tmpfs /DietPi tmpfs defaults,size=10m,noatime,nodev,nosuid,mode=1777 0 0 + +#Internal Drives--------------------------------------------------- +_EOF_ + + Init_Drives_and_Refresh + #Return 1 if RootFS is RO - if (( $INPUT == 3 )); then + elif (( $INPUT == 3 )); then RootFS_RW_Check diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 6f23164f3b..752043c01b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -13891,6 +13891,8 @@ _EOF_ AGP plexmediaserver + rm -R /var/lib/plexmediaserver + rm /etc/apt/sources.list.d/plex.list &> /dev/null apt-get update diff --git a/dietpi/finalise b/dietpi/finalise index aa6d155ebd..c41f7f31b8 100644 --- a/dietpi/finalise +++ b/dietpi/finalise @@ -125,43 +125,10 @@ #//////////////////////////////////// #Reset FSTAB - cp /DietPi/dietpi/conf/fstab /etc/fstab - - # Rock64 - if (( $HW_MODEL == 43 )); then - - cp /DietPi/dietpi/conf/fstab_rock64 /etc/fstab - - # X86_64 native - elif (( $HW_MODEL == 21 )); then - - if [ -d /boot/efi ]; then - - cp /DietPi/dietpi/conf/fstab_x86_64-native_EFI /etc/fstab - - else - - cp /DietPi/dietpi/conf/fstab_x86_64-native /etc/fstab - - fi - - # VM - elif (( $HW_MODEL == 20 )); then - - cp /DietPi/dietpi/conf/fstab_vm /etc/fstab - - # XU4 requires UUID with 4.9 kernel: https://github.com/Fourdee/DietPi/issues/899#issuecomment-298912660 - # NB: Do this on EMMC due to SD mmcblk1 - elif (( $HW_MODEL == 11 )); then - - UUID_CURRENT=$(blkid /dev/mmcblk0p1 -s UUID -o value) - sed -i "s#^/dev/mmcblk0p1#UUID=$UUID_CURRENT#g" /etc/fstab - - UUID_CURRENT=$(blkid /dev/mmcblk0p2 -s UUID -o value) - sed -i "s#^/dev/mmcblk0p2#UUID=$UUID_CURRENT#g" /etc/fstab + /DietPi/dietpi/dietpi-drive_manager 4 # RPi requires PARTUUID for USB write: https://github.com/Fourdee/DietPi/issues/970 - elif (( $HW_MODEL < 10 )); then + if (( $HW_MODEL < 10 )); then PARTUUID_CURRENT=$(blkid /dev/mmcblk0p1 -s PARTUUID -o value) sed -i "s#^/dev/mmcblk0p1#PARTUUID=$PARTUUID_CURRENT#g" /etc/fstab @@ -171,9 +138,6 @@ fi - systemctl daemon-reload - mount -a - #//////////////////////////////////// # Reset cmdline.txt / boot.ini / dietpi.txt #Set Pi Config.txt back to normal diff --git a/dietpi/patch_file b/dietpi/patch_file index 5bae46673a..ca50f7faea 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2934,8 +2934,6 @@ _EOF_ #NB: After v160, dietpi-update will do this prior to each update /DietPi/dietpi/func/dietpi-set_software verify_dietpi.txt #------------------------------------------------------------------------------- - - #Sparky SBC kernel patches # Updated kernel which resolves HQplayer playback issues. if (( $HW_MODEL == 70 )); then From 0762b53367e6cd357f11ab362f5b508679aadd48 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 13 Dec 2017 09:35:07 +0000 Subject: [PATCH 016/390] v160 + Package removal test: https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 90 ++++++++------------------------------- 1 file changed, 18 insertions(+), 72 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 54ebe0d880..5cb1526039 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -417,7 +417,6 @@ aPACKAGES_REQUIRED_INSTALL=( 'dbus' 'dc' 'debconf' - 'debconf-utils' 'debian-archive-keyring' 'debianutils' 'diffutils' @@ -472,11 +471,8 @@ aPACKAGES_REQUIRED_INSTALL=( 'ncurses-base' 'ncurses-bin' 'net-tools' - 'netbase' - 'nfacct' 'ntfs-3g' 'ntp' - 'openssl' 'p7zip-full' 'parted' 'passwd' @@ -485,7 +481,6 @@ aPACKAGES_REQUIRED_INSTALL=( 'psmisc' 'readline-common' 'resolvconf' - 'rsync' 'sed' 'sensible-utils' 'startpar' @@ -506,13 +501,11 @@ aPACKAGES_REQUIRED_INSTALL=( 'wireless-tools' 'wpasupplicant' 'wput' - 'xkb-data' - 'xz-utils' 'zip' ) -#List of packages we should never remove (eg: HW specific kernels, uboot etc): +# - List of packages we should never remove (eg: HW specific kernels, uboot etc): aPACKAGES_AVOID_REMOVAL=( #General @@ -521,14 +514,15 @@ aPACKAGES_AVOID_REMOVAL=( 'linux-image-' #Odroid/x86_64 kernel 'linux-base' 'busybox' + 'grub-' #x86_64 'uboot' #Odroid 'u-boot' #Odroid 'u-boot-tools' #Odroid 'rfkill' #Used by some onboard WiFi adapters + 'rsync' #DietPi-Backup #Firmware - 'firmware-linux-nonfree' #x86 AMD/INTEL bundle - 'firmware-misc-nonfree' + 'firmware-' #Keys 'deb-multimedia-keyring' @@ -549,6 +543,17 @@ aPACKAGES_REQUIRED_DEPS=() INSTALL_PACKAGES='' REMOVE_PACKAGES='' +############### +dietpi-notify 0 "Generating list of minimal packages required for DietPi installation" + +for ((i=0; i<${#aPACKAGES_REQUIRED_INSTALL[@]}; i++)) +do + + # One line INSTALL_PACKAGES so we can use it later. + INSTALL_PACKAGES+="${aPACKAGES_REQUIRED_INSTALL[$i]} " + +done + ############### dietpi-notify 0 "Obtaining list of currently installed packages" @@ -562,9 +567,6 @@ dietpi-notify 0 "Generating a list of deps, required for the DietPi packages\nTh for ((i=0; i<${#aPACKAGES_REQUIRED_INSTALL[@]}; i++)) do - # One line INSTALL_PACKAGES so we can use it later. - INSTALL_PACKAGES+="${aPACKAGES_REQUIRED_INSTALL[$i]}" - # Add deps (ignoring libs and <>) echo -e "Checking deps: ${aPACKAGES_REQUIRED_INSTALL[$i]}" #dietpi-notify 2 "Checking deps for ${aPACKAGES_REQUIRED_INSTALL[$i]}" # RESULTS IN $i fixated on 3 @@ -578,11 +580,10 @@ do do PACKAGE_ENTRY_EXISTS=0 - for ((j=0; j<${#aPACKAGES_REQUIRED_INSTALL[@]}; j++)) + for ((j=0; j<${#aPACKAGES_REQUIRED_DEPS[@]}; j++)) do - if [[ $line == "${aPACKAGES_REQUIRED_INSTALL[$j]}"* ]]; then - + if [[ $line == "${aPACKAGES_REQUIRED_DEPS[$j]}"* ]]; then PACKAGE_ENTRY_EXISTS=1 break @@ -669,7 +670,7 @@ do done < /tmp/current_installed_packages rm /tmp/current_installed_packages -echo -e "$REMOVE_PACKAGES" +dietpi-notify 2 "The following packages will be removed\n$REMOVE_PACKAGES" #Set aPACKAGES_REQUIRED_INSTALL to apt-mark manual? @@ -722,61 +723,6 @@ exit - -############### -dietpi-notify 0 "Removing Core APT packages not required by DietPi" - -AGP libpython* xmms2-client-* pulseaudio* jq xxd iperf3 gdisk gpsd ppp libboost-iostreams* sgml-base xml-core usb-modeswitch* libpng* cpp-* cpp ntpdate bluez bluetooth rsync dialog dhcpcd5 lua5.1 netcat-* make makedev ncdu plymouth openresolv shared-mime-in* tcpd strace tasksel* wireless-* xdg-user-dirs triggerhappy python* v4l-utils traceroute xz-utils ucf xauth zlib1g-dev xml-core aptitude* avahi-daemon rsyslog logrotate man-db manpages vim vim-common vim-runtime vim-tiny mc mc-data -Error_Check - -############### -dietpi-notify 0 "Removing webserver APT packages not required by DietPi" - -AGP apache2* lighttpd* nginx* php-* php7.0-* mysql-* mariadb-* -Error_Check - -############### -dietpi-notify 0 "Removing Desktop related APT packages not required by DietPi" - -AGP gnome-* mate-* lxde lxde-* lxmenu-* libwayland* dictionaries-* libgtk* x11-* zenity* yelp-* fonts-* -Error_Check - -############### -dietpi-notify 0 "Removing Misc (Stage 1) APT packages not required by DietPi" - -AGP libpod-* libpeas-* isc-dhcp-server eject dnsmasq* dns-root-data colord-data libjasper* libjson* libwbclient* golang-* libavahi* libtext* libweb* libpcsclite1 libxau6* libxc* miscfiles minicom lrzsz -Error_Check - -############### -dietpi-notify 0 "Removing Misc (Stage 2) APT packages not required by DietPi" - -AGP nodejs memtester expect tcl-expect toilet toilet-fonts w-scan vlan weather-util* sysbench stress cmake cmake-data device-tree-co* fping hddtemp haveged hostapd i2c-tools iperf ir-keytable libasound2* libmtp* libusb-dev lirc lsof ncurses-term pkg-config unicode-data rfkill pv mtp-tools m4 screen alsa-utils autotools-dev bind9-host btrfs-tools bridge-utils cpufrequtils dvb-apps dtv-scan-table* evtest f3 figlet gcc gcc-4.8-* git git-man ifenslave -Error_Check - -############### -dietpi-notify 0 "Removing Dev APT packages not required by DietPi" - -AGP '\-dev$' linux-headers* -Error_Check - -# - Hardware specific -if (( $HW_MODEL == 71 )); then - - ############### - dietpi-notify 0 "Removing BBB APT packages not required by DietPi" - - AGP roboticscape ardupilot-* ti-* bonescript libapr1 - Error_Check - -elif (( $HW_MODEL < 10 )); then - - ############### - dietpi-notify 0 "Removing RPi APT packages not required by DietPi" - - AGP rpi-update libraspberrypi-doc gcc-4.6-base gcc-4.7-base gcc-4.8-base libsigc++-1.2-5c2 - Error_Check - -fi ############### From 368a0b9d1385036f1e25c83c617047e1c186d87b Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 13 Dec 2017 11:00:48 +0000 Subject: [PATCH 017/390] v160 + DietPi-Software | Shairport-sync (Stretch): Resolved an issue where this would fail to install, due to pre-req URLS becomming invalid: https://github.com/Fourdee/DietPi/issues/1303 --- CHANGELOG.txt | 1 + PREP_SYSTEM_FOR_DIETPI.sh | 119 ++++++++++++++------------------------ dietpi/dietpi-software | 23 +++++--- dietpi/patch_file | 28 ++++----- 4 files changed, 73 insertions(+), 98 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 6ebaf79647..b80f4cc4dd 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ Image Modifications: Changes / Improvements / Optimizations: Bug Fixes: +DietPi-Software | Shairport-sync (Stretch): Resolved an issue where this would fail to install, due to pre-req URLS becomming invalid: https://github.com/Fourdee/DietPi/issues/1303 DietPi-Software | Plex Media Server: Resolved uninstall to include /var/lib/plexmediaserver in removal (which is not completed via apt purge). DietPi-Update | dietpi.txt is now checked for missing entries, and, will now be patched during the update: https://github.com/Fourdee/DietPi/issues/1292#issuecomment-350818969 Sparky SBC | Kernel patch will be applied which resolves issues with HQPlayer playback: https://www.computeraudiophile.com/forums/topic/32132-allo-sparky-usbridge/?do=findComment&comment=753100 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 5cb1526039..64a58a5986 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -35,6 +35,30 @@ fi DISTRO=4 DISTRO_NAME='stretch' HW_MODEL=0 +HW_ARCH_DESCRIPTION=$(uname -m) +if [ "$HW_ARCH_DESCRIPTION" = "armv6l" ]; then + + HW_ARCH=1 + +elif [ "$HW_ARCH_DESCRIPTION" = "armv7l" ]; then + + HW_ARCH=2 + +elif [ "$HW_ARCH_DESCRIPTION" = "aarch64" ]; then + + HW_ARCH=3 + +elif [ "$HW_ARCH_DESCRIPTION" = "x86_64" ]; then + + HW_ARCH=10 + +# - Unknown arch for DietPi, inform user by adding 'unknown'. +else + + echo -e "Unknown HW_ARCH $HW_ARCH_DESCRIPTION, aborting" + exit + +fi #Funcs INTERNET_ADDRESS='' @@ -214,7 +238,6 @@ Run_Whiptail(){ } - #------------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------------ @@ -297,7 +320,7 @@ Run_Whiptail HW_MODEL=$WHIP_RETURN_VALUE dietpi-notify 2 "Setting HW_MODEL index of: $HW_MODEL" - +dietpi-notify 2 "CPU ARCH = $HW_ARCH : $HW_ARCH_DESCRIPTION" #------------------------------------------------------------------------------------------------ #Step 3: Distro Selection + APT prep @@ -415,7 +438,6 @@ aPACKAGES_REQUIRED_INSTALL=( 'curl' 'dash' 'dbus' - 'dc' 'debconf' 'debian-archive-keyring' 'debianutils' @@ -487,7 +509,6 @@ aPACKAGES_REQUIRED_INSTALL=( 'sudo' 'systemd' 'systemd-sysv' - 'sysv-rc' 'sysvinit-utils' 'tar' 'tzdata' @@ -505,6 +526,15 @@ aPACKAGES_REQUIRED_INSTALL=( ) +# - HW specific required packages +if (( $HW_ARCH == 10 )); then + + aPACKAGES_REQUIRED_INSTALL+=('intel-microcode') + aPACKAGES_REQUIRED_INSTALL+=('amd64-microcode') + aPACKAGES_REQUIRED_INSTALL+=('firmware-linux-nonfree') + +fi + # - List of packages we should never remove (eg: HW specific kernels, uboot etc): aPACKAGES_AVOID_REMOVAL=( @@ -538,8 +568,6 @@ aPACKAGES_AVOID_REMOVAL=( ) -aPACKAGES_REQUIRED_DEPS=() - INSTALL_PACKAGES='' REMOVE_PACKAGES='' @@ -564,6 +592,7 @@ Error_Check ############### dietpi-notify 0 "Generating a list of deps, required for the DietPi packages\nThis may take some time, please wait..." +aPACKAGES_REQUIRED_DEPS=() for ((i=0; i<${#aPACKAGES_REQUIRED_INSTALL[@]}; i++)) do @@ -594,7 +623,7 @@ do if (( ! $PACKAGE_ENTRY_EXISTS )); then - echo -e "Adding deps: $line" + echo -e " - Adding deps: $line" aPACKAGES_REQUIRED_DEPS+=("$line") fi @@ -670,59 +699,21 @@ do done < /tmp/current_installed_packages rm /tmp/current_installed_packages -dietpi-notify 2 "The following packages will be removed\n$REMOVE_PACKAGES" - - #Set aPACKAGES_REQUIRED_INSTALL to apt-mark manual? +# - delete[] unset aPACKAGES_REQUIRED_INSTALL unset aPACKAGES_AVOID_REMOVAL unset aPACKAGES_REQUIRED_DEPS - -exit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +dietpi-notify 2 "The following packages will be removed\n$REMOVE_PACKAGES" +############### +dietpi-notify 0 "Removing packages" +AGP $REMOVE_PACKAGES +Error_Check ############### @@ -778,23 +769,9 @@ Error_Check ############### dietpi-notify 0 "Installing core DietPi pre-req APT packages" -AGI gnupg net-tools cron rfkill ca-certificates locales apt-transport-https ethtool p7zip-full hfsplus iw debconf-utils xz-utils fbset wpasupplicant resolvconf bc dbus bzip2 psmisc bash-completion cron whiptail sudo ntp ntfs-3g dosfstools parted hdparm usbutils zip htop wput wget fake-hwclock dphys-swapfile curl unzip console-setup console-data console-common keyboard-configuration wireless-tools wireless-regdb crda --no-install-recommends +AGI $INSTALL_PACKAGES Error_Check -# - HW specific -if (( $HW_MODEL == 21 )); then - - ############### - dietpi-notify 0 "Installing Grub" - - # MBR - # AGI grub2 - - # UEFI - AGI grub-common grub-efi-amd64 grub-efi-amd64-bin grub2-common - Error_Check - -fi WHIP_TITLE='Onboard Bluetooth' WHIP_DESC='Please select an option' @@ -825,16 +802,6 @@ if (( $HW_MODEL < 10 )); then fi -if (( $HW_MODEL < 10 )); then - - ############### - dietpi-notify 0 "Installing firmware packages" - - AGI firmware-linux-nonfree firmware-realtek firmware-ralink firmware-brcm80211 firmware-atheros --no-install-recommends - Error_Check - -fi - #------------------------------------------------------------------------------------------------ #Step 6: Download DietPi sourcecode #------------------------------------------------------------------------------------------------ diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 752043c01b..02f4993d6f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5898,6 +5898,11 @@ _EOF_ INSTALL_URL_ADDRESS+='arm64.7z' + # - x86_64 + # elif (( $HW_ARCH == 10 )); then + + # INSTALL_URL_ADDRESS+='amd64.7z' + fi /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" @@ -5918,20 +5923,22 @@ _EOF_ # - Stretch, libssl1.0.0 no longer available if (( $DISTRO >= 4 )); then - # - ARMv6 - if (( $HW_ARCH == 1 )); then - - INSTALL_URL_ADDRESS='http://ftp.us.debian.org/debian/pool/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u6_armhf.deb' + INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/' - # - ARMv7 - elif (( $HW_ARCH == 2 )); then + # - ARMv6/7 + if (( $HW_ARCH == 1 || $HW_ARCH == 2 )); then - INSTALL_URL_ADDRESS='http://ftp.us.debian.org/debian/pool/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u6_armhf.deb' + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_armhf.deb' # - ARM64 elif (( $HW_ARCH == 3 )); then - INSTALL_URL_ADDRESS='http://ftp.us.debian.org/debian/pool/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u6_arm64.deb' + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_arm64.deb' + + # - x86_64 + elif (( $HW_ARCH == 10 )); then + + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_amd64.deb' fi diff --git a/dietpi/patch_file b/dietpi/patch_file index ca50f7faea..6dcf0c2518 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2780,20 +2780,6 @@ _EOF_ #------------------------------------------------------------------------------- elif (( $VERSION_CURRENT == 158 )); then - #------------------------------------------------------------------------------- - #Reinstalls - # Allo GUI (full) - # MPD - # Squeezelite - # YMPD - update-rc.d ympd remove &> /dev/null # switch to systemD - rm /etc/init.d/ympd &> /dev/null # switch to systemD - - # Enable ownCloud/Nextcloud maintenance mode before reinstall: - sudo -u www-data php /var/www/owncloud/occ maintenance:mode --on &> /dev/null - sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on &> /dev/null - - /DietPi/dietpi/dietpi-software reinstall 159 128 114 47 36 32 #------------------------------------------------------------------------------- #RPi update DietPi kernel: if (( $HW_MODEL < 10 )); then @@ -2950,6 +2936,20 @@ _EOF_ fi #------------------------------------------------------------------------------- + #Reinstalls | Moved from v159 + # Allo GUI (full) + # MPD + # Squeezelite + # YMPD + update-rc.d ympd remove &> /dev/null # switch to systemD + rm /etc/init.d/ympd &> /dev/null # switch to systemD + + # Enable ownCloud/Nextcloud maintenance mode before reinstall: + sudo -u www-data php /var/www/owncloud/occ maintenance:mode --on &> /dev/null + sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on &> /dev/null + + /DietPi/dietpi/dietpi-software reinstall 159 128 114 47 36 32 + #------------------------------------------------------------------------------- fi From 793a923f266c4b1c77dd0d274ff4206f2836c59a Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 13 Dec 2017 11:08:47 +0000 Subject: [PATCH 018/390] v160 +DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi drop during software installs/updates etc: https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480 --- CHANGELOG.txt | 1 + dietpi/dietpi-services | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b80f4cc4dd..5756ca9c9c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ Image Modifications: Changes / Improvements / Optimizations: Bug Fixes: +DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi drop during software installs/updates etc: https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480 DietPi-Software | Shairport-sync (Stretch): Resolved an issue where this would fail to install, due to pre-req URLS becomming invalid: https://github.com/Fourdee/DietPi/issues/1303 DietPi-Software | Plex Media Server: Resolved uninstall to include /var/lib/plexmediaserver in removal (which is not completed via apt purge). DietPi-Update | dietpi.txt is now checked for missing entries, and, will now be patched during the update: https://github.com/Fourdee/DietPi/issues/1292#issuecomment-350818969 diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index f87498de6d..67dff0fe3d 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -110,7 +110,7 @@ 'htpc-manager' 'home-assistant' 'openbazaar' - 'dietpi-wifi-monitor' + #'dietpi-wifi-monitor' : https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480 'docker' 'bdd' 'minio' From 6a28882c390e768bef0e01f6438409b50ac50cca Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 14 Dec 2017 00:48:41 +0100 Subject: [PATCH 019/390] v160 --- dietpi/patch_file | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index d6e84c4f82..6f598760b7 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2780,21 +2780,7 @@ _EOF_ #------------------------------------------------------------------------------- elif (( $VERSION_CURRENT == 158 )); then - #------------------------------------------------------------------------------- - #Reinstalls - # Allo GUI (full) - # MPD - # Squeezelite - # YMPD - update-rc.d ympd remove &> /dev/null # switch to systemD - rm /etc/init.d/ympd &> /dev/null # switch to systemD - # Enable ownCloud/Nextcloud maintenance mode before reinstall: - systemctl start mysql &> /dev/null - sudo -u www-data php /var/www/owncloud/occ maintenance:mode --on &> /dev/null - sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on &> /dev/null - - /DietPi/dietpi/dietpi-software reinstall 159 128 114 47 36 32 #------------------------------------------------------------------------------- #RPi update DietPi kernel: if (( $HW_MODEL < 10 )); then @@ -2960,6 +2946,7 @@ _EOF_ rm /etc/init.d/ympd &> /dev/null # switch to systemD # Enable ownCloud/Nextcloud maintenance mode before reinstall: + systemctl start mysql &> /dev/null sudo -u www-data php /var/www/owncloud/occ maintenance:mode --on &> /dev/null sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on &> /dev/null From 56cbb98f44aff9b03c2f5efdbeeef8c3499c905a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 14 Dec 2017 00:49:07 +0100 Subject: [PATCH 020/390] Update patch_file --- dietpi/patch_file | 1 - 1 file changed, 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 6f598760b7..bff92a5452 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2780,7 +2780,6 @@ _EOF_ #------------------------------------------------------------------------------- elif (( $VERSION_CURRENT == 158 )); then - #------------------------------------------------------------------------------- #RPi update DietPi kernel: if (( $HW_MODEL < 10 )); then From 8090cec935fe63b01c21c4250eaf8b653e2e6a28 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 14 Dec 2017 00:59:01 +0000 Subject: [PATCH 021/390] v160 + Switch to @MichaIng APT removal method, much more efficent (scrap array based removal): https://github.com/Fourdee/DietPi/issues/1285 + Buster DISTRO --- PREP_SYSTEM_FOR_DIETPI.sh | 292 ++++++++++++---------------------- dietpi/dietpi-obtain_hw_model | 13 +- 2 files changed, 113 insertions(+), 192 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 64a58a5986..2b73718490 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -220,7 +220,7 @@ WHIP_OPTION=0 WHIP_CHOICE=0 Run_Whiptail(){ - WHIP_OPTION=$(whiptail --title "$WHIP_TITLE" --menu "$WHIP_DESC" --default-item "$WHIP_DEFAULT_ITEM" --backtitle "$WHIP_BACKTITLE" 22 80 16 "${WHIP_MENU_ARRAY[@]}" 3>&1 1>&2 2>&3) + WHIP_OPTION=$(whiptail --title "$WHIP_TITLE" --menu "$WHIP_DESC" --default-item "$WHIP_DEFAULT_ITEM" --backtitle "$WHIP_BACKTITLE" 22 80 14 "${WHIP_MENU_ARRAY[@]}" 3>&1 1>&2 2>&3) WHIP_CHOICE=$? if (( $WHIP_CHOICE == 0 )); then @@ -246,8 +246,6 @@ Run_Whiptail(){ #------------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------------ -AVOIDRUN(){ - #------------------------------------------------------------------------------------------------ #Step 1: Initial Critical Prep #------------------------------------------------------------------------------------------------ @@ -276,6 +274,7 @@ WHIP_TITLE='Hardware selection' WHIP_DESC='Please select the current device this is being installed on:' WHIP_DEFAULT_ITEM=0 WHIP_MENU_ARRAY=( + '110' 'RoseapplePi' '100' 'Asus Tinker Board' '90' 'A20-OLinuXino-MICRO' @@ -304,8 +303,8 @@ WHIP_MENU_ARRAY=( '32' 'OrangePi Zero (H2+)' '31' 'OrangePi One' '30' 'OrangePi PC' - '21' 'x86_64 native (PC)' - '20' 'VM x64 (VMware VirtualBox)' + '21' 'x86_64 Native PC' + '20' 'x86_64 VMware/VirtualBox' '13' 'oDroid U3' '12' 'oDroid C2' '11' 'oDroid XU3/4' @@ -314,6 +313,7 @@ WHIP_MENU_ARRAY=( '2' 'Raspberry Pi 2' '1' 'Raspberry Pi 1/Zero (512mb)' '0' 'Raspberry Pi 1 (256mb)' + ) Run_Whiptail @@ -332,20 +332,17 @@ WHIP_TITLE='Distro Selection' WHIP_DESC='Please select a distro to install on this system. Selecting a distro that is older than the current installed on system, is not supported.' WHIP_DEFAULT_ITEM=4 WHIP_MENU_ARRAY=( - '1' 'wheezy' + '3' 'jessie' '4' 'stretch' '5' 'buster' + ) Run_Whiptail DISTRO=$WHIP_RETURN_VALUE -if (( $DISTRO == 1 )); then - - DISTRO_NAME='wheezy' - -elif (( $DISTRO == 3 )); then +if (( $DISTRO == 3 )); then DISTRO_NAME='jessie' @@ -394,6 +391,40 @@ Error_Check #NB: Apt mirror will get overwritten by: /DietPi/dietpi/func/dietpi-set_software apt-mirror default : during finalize. + +############### +# - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files +dietpi-notify 0 "Marking all packages as auto installed first, to allow allow effective autoremove afterwards" + +apt-mark auto $(apt-mark showmanual) +Error_Check + + +############### +# - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files +dietpi-notify 0 "Temporary disable automatic recommends/suggests installation and allow them to be autoremoved:" + +cat << _EOF_ > /etc/apt/apt.conf.d/99norecommends +APT::Install-Recommends "false"; +APT::Install-Suggests "false"; +APT::AutoRemove::RecommendsImportant "false"; +APT::AutoRemove::SuggestsImportant "false"; +_EOF_ +Error_Check + + +############### +dietpi-notify 0 "Forcing use of existing apt configs if available" + +cat << _EOF_ > /etc/apt/apt.conf.d/local +Dpkg::options { + "--force-confdef"; + "--force-confold"; +} +_EOF_ +Error_Check + + ############### dietpi-notify 0 "Updating APT for $DISTRO_NAME" @@ -403,14 +434,12 @@ Error_Check apt-get update Error_Check -} #------------------------------------------------------------------------------------------------ #Step 4: APT removals #------------------------------------------------------------------------------------------------ # - DietPi list of minimal required packages which must be installed: # dpkg --get-selections | awk '{print $1}' | sed 's/:armhf//g' | sed "s/^/'/g" | sed "s/$/'/g" - aPACKAGES_REQUIRED_INSTALL=( 'acl' @@ -457,6 +486,7 @@ aPACKAGES_REQUIRED_INSTALL=( 'firmware-brcm80211' 'firmware-ralink' 'firmware-realtek' + 'firmware-misc-nonfree' 'fuse' 'gnupg' 'gpgv' @@ -503,6 +533,7 @@ aPACKAGES_REQUIRED_INSTALL=( 'psmisc' 'readline-common' 'resolvconf' + 'rfkill' #Used by some onboard WiFi chipsets 'sed' 'sensible-utils' 'startpar' @@ -526,216 +557,97 @@ aPACKAGES_REQUIRED_INSTALL=( ) -# - HW specific required packages +# - HW_ARCH specific required packages +# x86_64 if (( $HW_ARCH == 10 )); then + aPACKAGES_REQUIRED_INSTALL+=('linux-image-amd64') aPACKAGES_REQUIRED_INSTALL+=('intel-microcode') aPACKAGES_REQUIRED_INSTALL+=('amd64-microcode') aPACKAGES_REQUIRED_INSTALL+=('firmware-linux-nonfree') + aPACKAGES_REQUIRED_INSTALL+=('grub-efi-amd64') fi -# - List of packages we should never remove (eg: HW specific kernels, uboot etc): -aPACKAGES_AVOID_REMOVAL=( - - #General - 'lib' #Libs - 'gcc-' - 'linux-image-' #Odroid/x86_64 kernel - 'linux-base' - 'busybox' - 'grub-' #x86_64 - 'uboot' #Odroid - 'u-boot' #Odroid - 'u-boot-tools' #Odroid - 'rfkill' #Used by some onboard WiFi adapters - 'rsync' #DietPi-Backup - - #Firmware - 'firmware-' - - #Keys - 'deb-multimedia-keyring' - - #RPi - 'libraspberrypi-bin' - 'libraspberrypi0' - 'raspberrypi-bootloader' - 'raspberrypi-kernel' - 'raspberrypi-sys-mods' - 'raspbian-archive-keyring' - 'raspi-copies-and-fills' - -) - -INSTALL_PACKAGES='' -REMOVE_PACKAGES='' - -############### -dietpi-notify 0 "Generating list of minimal packages required for DietPi installation" - -for ((i=0; i<${#aPACKAGES_REQUIRED_INSTALL[@]}; i++)) -do - - # One line INSTALL_PACKAGES so we can use it later. - INSTALL_PACKAGES+="${aPACKAGES_REQUIRED_INSTALL[$i]} " - -done - -############### -dietpi-notify 0 "Obtaining list of currently installed packages" - -dpkg --get-selections | awk '{print $1}' > /tmp/current_installed_packages -Error_Check - - -############### -dietpi-notify 0 "Generating a list of deps, required for the DietPi packages\nThis may take some time, please wait..." - -aPACKAGES_REQUIRED_DEPS=() -for ((i=0; i<${#aPACKAGES_REQUIRED_INSTALL[@]}; i++)) -do - - # Add deps (ignoring libs and <>) - echo -e "Checking deps: ${aPACKAGES_REQUIRED_INSTALL[$i]}" - #dietpi-notify 2 "Checking deps for ${aPACKAGES_REQUIRED_INSTALL[$i]}" # RESULTS IN $i fixated on 3 - - VALUE=$(apt-cache depends ${aPACKAGES_REQUIRED_INSTALL[$i]} | grep 'Depends' | awk '{print $2}' | sed '/^lib/d' | sed '/ /etc/apt/apt.conf.d/local -Dpkg::options { - "--force-confdef"; - "--force-confold"; -} -_EOF_ -Error_Check ############### dietpi-notify 0 "Upgrading existing APT installed packages to latest" @@ -743,15 +655,6 @@ dietpi-notify 0 "Upgrading existing APT installed packages to latest" DEBIAN_FRONTEND='noninteractive' apt-get dist-upgrade -y Error_Check -if (( $HW_MODEL == 43 )); then - - ############### - dietpi-notify 0 "Reinstalling linux-rock64-package" - AGI linux-rock64-package - Error_Check - -fi - #???: WHIP_OPTIONal Reinstall OpenSSH (for updating dietpi scripts etc). Gets removed during finalise. # apt-get install openssh-server -y # echo -e "PermitRootLogin yes" >> /etc/ssh/sshd_config @@ -773,12 +676,17 @@ AGI $INSTALL_PACKAGES Error_Check -WHIP_TITLE='Onboard Bluetooth' +############### +dietpi-notify 0 "Onboard Bluetooth selection" + +WHIP_TITLE='Bluetooth Required' WHIP_DESC='Please select an option' WHIP_DEFAULT_ITEM=0 WHIP_MENU_ARRAY=( - '0' 'Select if this device does NOT have onboard Bluetooth' - '1' 'Select if this device DOES have onboard Bluetooth' + + '0' 'BT not required, do not install.' + '1' 'Device has onboard BT, and/or, I require BT functionality.' + ) Run_Whiptail @@ -802,6 +710,14 @@ if (( $HW_MODEL < 10 )); then fi + +############### +# - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files +dietpi-notify 0 "Enable auto install of recommendations again, in case it is necessary somewhere:" + +rm /etc/apt/apt-conf.d/99norecommends &> /dev/null + + #------------------------------------------------------------------------------------------------ #Step 6: Download DietPi sourcecode #------------------------------------------------------------------------------------------------ diff --git a/dietpi/dietpi-obtain_hw_model b/dietpi/dietpi-obtain_hw_model index 81729255ca..50417a7bcd 100644 --- a/dietpi/dietpi-obtain_hw_model +++ b/dietpi/dietpi-obtain_hw_model @@ -62,6 +62,7 @@ # DISTRO 2 Ubuntu 14.04 (No longer supported, left in for user message during update) # DISTRO 3 Jessie # DISTRO 4 Stretch, pulled a muscle! + # DISTRO 5 Buster # - Line4 - # RootFS device path (eg: /dev/mmc01) # - Line5 - @@ -615,18 +616,22 @@ fi - #Get Distro Index (assumes jessie) - if (( $( cat /etc/*release | grep -ci -m1 'jessie') )); then + #Get Distro Index + if (( $( grep -ci -m1 'jessie' /etc/*release) )); then DISTRO=3 - elif (( $( cat /etc/*release | grep -ci -m1 'stretch') )); then + elif (( $( grep -ci -m1 'stretch' /etc/*release) )); then DISTRO=4 + elif (( $( grep -ci -m1 'buster' /etc/*release) )); then + + DISTRO=5 + fi - #Generate UUID if it doesnt not exist + #Generate UUID if it does not exist if [ ! -f /DietPi/dietpi/.hw_model ]; then HW_UUID=$(cat /proc/sys/kernel/random/uuid) From 690786cfeab2b34f8d7b7374e30f15729772a37f Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 14 Dec 2017 05:24:34 +0000 Subject: [PATCH 022/390] v160 + Initial pass: https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 1645 ++++++++++++++++++------------------- dietpi/finalise | 85 +- 2 files changed, 819 insertions(+), 911 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 2b73718490..8a27453d39 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1,915 +1,825 @@ +#!/bin/bash +{ + #------------------------------------------------------------------------------------------------ + # Setup a Debian installation, for DietPi. + # - PRE-REQ + # System currently running a Debian image (ideally minimal) + # System with active eth0 connection + # No USB drives attached + #------------------------------------------------------------------------------------------------ + # DO NOT USE. Currently under testing. + #------------------------------------------------------------------------------------------------ + #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. + LANG=en_GB.UTF-8 + + #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 + cd "$HOME" + + #Exit path for non-root logins. + if (( $UID != 0 )); then + + echo -e 'Error: Root privileges required. Please run the command with "sudo"\n' + exit -#------------------------------------------------------------------------------------------------ -# Setup a Debian installation, for DietPi. -#------------------------------------------------------------------------------------------------ -# NOTICE: Images created by non-DietPi staff, will NOT be officially supported by DietPi, unless authorized by DietPi. -# NOTICE: There is no offical support for using these script/notes. However, exceptions may be made. -#------------------------------------------------------------------------------------------------ -# Before starting, copy the following files and folders to /boot/ https://github.com/Fourdee/DietPi -# - /boot/dietpi.txt (file) -# - /boot/config.txt (file) -# - /boot/dietpi (folder) -#------------------------------------------------------------------------------------------------ -# Legend: -# - Items that are commented out should not be used. -# - Sections with '#???', are WHIP_OPTIONal, depending on the device and its specs. (eg: does it need bluetooth?) -#------------------------------------------------------------------------------------------------ -#Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. -LANG=en_GB.UTF-8 + fi -#Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 -cd "$HOME" + #------------------------------------------------------------------------------------------------ + #Globals + #------------------------------------------------------------------------------------------------ + #System + DISTRO=4 + DISTRO_NAME='stretch' + HW_MODEL=0 + HW_ARCH_DESCRIPTION=$(uname -m) + if [ "$HW_ARCH_DESCRIPTION" = "armv6l" ]; then -#Exit path for non-root logins. -if (( $UID != 0 )); then + HW_ARCH=1 - echo -e 'Error: Root privileges required. Please run the command with "sudo"\n' - exit + elif [ "$HW_ARCH_DESCRIPTION" = "armv7l" ]; then -fi + HW_ARCH=2 -#------------------------------------------------------------------------------------------------ -#Globals -#------------------------------------------------------------------------------------------------ -#System -DISTRO=4 -DISTRO_NAME='stretch' -HW_MODEL=0 -HW_ARCH_DESCRIPTION=$(uname -m) -if [ "$HW_ARCH_DESCRIPTION" = "armv6l" ]; then + elif [ "$HW_ARCH_DESCRIPTION" = "aarch64" ]; then - HW_ARCH=1 + HW_ARCH=3 -elif [ "$HW_ARCH_DESCRIPTION" = "armv7l" ]; then + elif [ "$HW_ARCH_DESCRIPTION" = "x86_64" ]; then - HW_ARCH=2 + HW_ARCH=10 -elif [ "$HW_ARCH_DESCRIPTION" = "aarch64" ]; then + else - HW_ARCH=3 + echo -e "Unknown HW_ARCH $HW_ARCH_DESCRIPTION, aborting" + exit -elif [ "$HW_ARCH_DESCRIPTION" = "x86_64" ]; then + fi - HW_ARCH=10 + #Funcs + INTERNET_ADDRESS='' + Check_Connection(){ -# - Unknown arch for DietPi, inform user by adding 'unknown'. -else + wget -q --spider --timeout=10 --tries=2 "$INTERNET_ADDRESS" - echo -e "Unknown HW_ARCH $HW_ARCH_DESCRIPTION, aborting" - exit + } -fi + #DietPi-Notify: + dietpi-notify(){ -#Funcs -INTERNET_ADDRESS='' -Check_Connection(){ + local ainput_string=("$@") - wget -q --spider --timeout=10 --tries=2 "$INTERNET_ADDRESS" + local status_text_ok="\e[32mOk\e[0m" + local status_text_failed="\e[31mFailed:\e[0m" -} + local bracket_string_l="\e[90m[\e[0m" + local bracket_string_r="\e[90m]\e[0m" -#DietPi-Notify: -dietpi-notify(){ + #Funcs - local ainput_string=("$@") + Print_Ok(){ - local status_text_ok="\e[32mOk\e[0m" - local status_text_failed="\e[31mFailed:\e[0m" + echo -ne " $bracket_string_l\e[32mOk\e[0m$bracket_string_r" - local bracket_string_l="\e[90m[\e[0m" - local bracket_string_r="\e[90m]\e[0m" + } - #Funcs + Print_Failed(){ - Print_Ok(){ + echo -ne " $bracket_string_l\e[31mFailed\e[0m$bracket_string_r" - echo -ne " $bracket_string_l\e[32mOk\e[0m$bracket_string_r" + } - } + # - Print all input string on same line + # - $1 = start printing from word number $1 + Print_Input_String(){ - Print_Failed(){ + for (( i=$1;i<${#ainput_string[@]} ;i++)) + do + echo -ne " ${ainput_string[${i}]}" + done - echo -ne " $bracket_string_l\e[31mFailed\e[0m$bracket_string_r" + echo -e "" - } + } - # - Print all input string on same line - # - $1 = start printing from word number $1 - Print_Input_String(){ + # Main Loop + #-------------------------------------------------------------------------------------- + echo -e "" - for (( i=$1;i<${#ainput_string[@]} ;i++)) - do - echo -ne " ${ainput_string[${i}]}" - done + if (( $1 == -1 )); then - echo -e "" + if [ "$2" = "0" ]; then - } + ainput_string+=("Completed") + Print_Ok + Print_Input_String 2 + echo -e "" + + else - # Main Loop - #-------------------------------------------------------------------------------------- - echo -e "" + ainput_string+=("An issue has occured") + Print_Failed + Print_Input_String 2 + echo -e "" - if (( $1 == -1 )); then + fi - if [ "$2" = "0" ]; then + #-------------------------------------------------------------------------------------- + #Status Ok + #$@ = txt desc + elif (( $1 == 0 )); then - ainput_string+=("Completed") Print_Ok - Print_Input_String 2 - echo -e "" + Print_Input_String 1 - else + #Status failed + #$@ = txt desc + elif (( $1 == 1 )); then - ainput_string+=("An issue has occured") Print_Failed - Print_Input_String 2 - echo -e "" + Print_Input_String 1 - fi + #Status Info + #$@ = txt desc + elif (( $1 == 2 )); then - #-------------------------------------------------------------------------------------- - #Status Ok - #$@ = txt desc - elif (( $1 == 0 )); then + echo -ne " $bracket_string_l\e[0mInfo\e[0m$bracket_string_r" + echo -ne "\e[90m" + Print_Input_String 1 + echo -ne "\e[0m" - Print_Ok - Print_Input_String 1 - - #Status failed - #$@ = txt desc - elif (( $1 == 1 )); then + fi - Print_Failed - Print_Input_String 1 + echo -e "" + #----------------------------------------------------------------------------------- + unset ainput_string + #----------------------------------------------------------------------------------- + } - #Status Info - #$@ = txt desc - elif (( $1 == 2 )); then + Error_Check(){ - echo -ne " $bracket_string_l\e[0mInfo\e[0m$bracket_string_r" - echo -ne "\e[90m" - Print_Input_String 1 - echo -ne "\e[0m" + #Grab exit code in case of failure + exit_code=$? + if (( $exit_code != 0 )); then - fi + dietpi-notify 1 "($exit_code): Script aborted" + exit $exit_code - echo -e "" - #----------------------------------------------------------------------------------- - unset ainput_string - #----------------------------------------------------------------------------------- -} + else -Error_Check(){ + dietpi-notify 2 "($exit_code): Passed" + fi - #Grab exit code in case of failure - exit_code=$? - if (( $exit_code != 0 )); then + } - dietpi-notify 1 "($exit_code): Script aborted" - exit $exit_code + #Apt-get + AGI(){ - else + local string="$@" - dietpi-notify 2 "($exit_code): Passed" - fi + local force_WHIP_OPTIONs='--force-yes' -} + if (( $DISTRO >= 4 )); then -#Apt-get -AGI(){ + force_WHIP_OPTIONs='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' - local string="$@" - - local force_WHIP_OPTIONs='--force-yes' + fi - if (( $DISTRO >= 4 )); then + DEBIAN_FRONTEND=noninteractive $(which apt) install -y $force_WHIP_OPTIONs $string - force_WHIP_OPTIONs='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' + } - fi + #Whiptail + WHIP_BACKTITLE='DietPi-Prep' + WHIP_TITLE=0 + WHIP_DESC=0 + WHIP_MENU_ARRAY=0 + WHIP_RETURN_VALUE=0 + WHIP_DEFAULT_ITEM=0 + WHIP_OPTION=0 + WHIP_CHOICE=0 + Run_Whiptail(){ - DEBIAN_FRONTEND=noninteractive $(which apt) install -y $force_WHIP_OPTIONs $string + WHIP_OPTION=$(whiptail --title "$WHIP_TITLE" --menu "$WHIP_DESC" --default-item "$WHIP_DEFAULT_ITEM" --backtitle "$WHIP_BACKTITLE" 20 80 12 "${WHIP_MENU_ARRAY[@]}" 3>&1 1>&2 2>&3) + WHIP_CHOICE=$? + if (( $WHIP_CHOICE == 0 )); then -} + WHIP_RETURN_VALUE=$WHIP_OPTION -AGP(){ + else - local string="$@" - if (( $DISTRO >= 4 )); then + dietpi-notify 1 'No choices detected, aborting' + exit 0 - string+=' --allow-change-held-packages' + fi - fi + #delete [] + unset WHIP_MENU_ARRAY - #DEBUG: Dry run for testing - string+=' --dry-run' + } - $(which apt) purge -y $string + #------------------------------------------------------------------------------------------------ + #------------------------------------------------------------------------------------------------ + #------------------------------------------------------------------------------------------------ + # MAIN LOOP + #------------------------------------------------------------------------------------------------ + #------------------------------------------------------------------------------------------------ + #------------------------------------------------------------------------------------------------ -} + #------------------------------------------------------------------------------------------------ + dietpi-notify 0 'Step 1: Initial prep to allow this script to function:' + #------------------------------------------------------------------------------------------------ + dietpi-notify 2 'Updating APT:' -#Whiptail -WHIP_BACKTITLE='DietPi-Prep' -WHIP_TITLE=0 -WHIP_DESC=0 -WHIP_MENU_ARRAY=0 -WHIP_RETURN_VALUE=0 -WHIP_DEFAULT_ITEM=0 -WHIP_OPTION=0 -WHIP_CHOICE=0 -Run_Whiptail(){ + apt-get clean + Error_Check - WHIP_OPTION=$(whiptail --title "$WHIP_TITLE" --menu "$WHIP_DESC" --default-item "$WHIP_DEFAULT_ITEM" --backtitle "$WHIP_BACKTITLE" 22 80 14 "${WHIP_MENU_ARRAY[@]}" 3>&1 1>&2 2>&3) - WHIP_CHOICE=$? - if (( $WHIP_CHOICE == 0 )); then + apt-get update + Error_Check - WHIP_RETURN_VALUE=$WHIP_OPTION + dietpi-notify 2 'Installing core packages, required for this script to function:' - else + AGI wget unzip whiptail + Error_Check - dietpi-notify 1 'No choices detected, aborting' - exit 0 + #------------------------------------------------------------------------------------------------ + dietpi-notify 0 'Step 2: Hardware selection:' + #------------------------------------------------------------------------------------------------ + + WHIP_TITLE='Hardware selection:' + WHIP_DESC='Please select the current device this is being installed on:' + WHIP_DEFAULT_ITEM=0 + WHIP_MENU_ARRAY=( + + '110' 'RoseapplePi' + '100' 'Asus Tinker Board' + '90' 'A20-OLinuXino-MICRO' + '80' 'Cubieboard 3' + '71' 'Beagle Bone Black' + '70' 'Sparky SBC' + '66' 'NanoPi M1 Plus' + '65' 'NanoPi NEO 2' + '64' 'NanoPi NEO Air' + '63' 'NanoPi M1/T1' + '62' 'NanoPi M3/T3' + '61' 'NanoPi M2/T2' + '60' 'NanoPi Neo' + '51' 'BananaPi Pro (Lemaker)' + '50' 'BananaPi M2+ (sinovoip)' + '43' 'Rock64' + '42' 'Pine A64+ (2048mb)' + '41' 'Pine A64+ (1024mb)' + '40' 'Pine A64 (512mb)' + '38' 'OrangePi PC 2' + '37' 'OrangePi Prime' + '36' 'OrangePi Win' + '35' 'OrangePi Zero Plus 2 (H3/H5)' + '34' 'OrangePi Plus' + '33' 'OrangePi Lite' + '32' 'OrangePi Zero (H2+)' + '31' 'OrangePi One' + '30' 'OrangePi PC' + '21' 'x86_64 Native PC' + '20' 'x86_64 VMware/VirtualBox' + '13' 'oDroid U3' + '12' 'oDroid C2' + '11' 'oDroid XU3/4' + '10' 'oDroid C1' + '3' 'Raspberry Pi 3' + '2' 'Raspberry Pi 2' + '1' 'Raspberry Pi 1/Zero (512mb)' + '0' 'Raspberry Pi 1 (256mb)' + + ) + + Run_Whiptail + HW_MODEL=$WHIP_RETURN_VALUE + + dietpi-notify 2 "Setting HW_MODEL index of: $HW_MODEL" + dietpi-notify 2 "CPU ARCH = $HW_ARCH : $HW_ARCH_DESCRIPTION" + + #------------------------------------------------------------------------------------------------ + dietpi-notify 0 'Step 3: Distro selection / APT prep:' + #------------------------------------------------------------------------------------------------ + + WHIP_TITLE='Distro Selection:' + WHIP_DESC='Please select a distro to install on this system. Selecting a distro that is older than the current installed on system, is not supported.' + WHIP_DEFAULT_ITEM=4 + WHIP_MENU_ARRAY=( + + '3' 'jessie' + '4' 'stretch (Recommended)' + #'5' 'buster' #Disabled: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351600497 + + ) + + Run_Whiptail + DISTRO=$WHIP_RETURN_VALUE + + if (( $DISTRO == 3 )); then + + DISTRO_NAME='jessie' + + elif (( $DISTRO == 4 )); then + + DISTRO_NAME='stretch' + + elif (( $DISTRO == 5 )); then + + DISTRO_NAME='buster' fi - #delete [] - unset WHIP_MENU_ARRAY - -} - -#------------------------------------------------------------------------------------------------ -#------------------------------------------------------------------------------------------------ -#------------------------------------------------------------------------------------------------ -# MAIN LOOP -#------------------------------------------------------------------------------------------------ -#------------------------------------------------------------------------------------------------ -#------------------------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------------------------ -#Step 1: Initial Critical Prep -#------------------------------------------------------------------------------------------------ - -############### -dietpi-notify 0 'Updating APT' - -apt-get clean -Error_Check - -apt-get update -Error_Check - -############### -dietpi-notify 0 'Installing core packages, required for this script to function' -AGI wget unzip whiptail -Error_Check - -#------------------------------------------------------------------------------------------------ -#Step 2: Hardware selection -#------------------------------------------------------------------------------------------------ -############### -dietpi-notify 0 'Hardware selection' - -WHIP_TITLE='Hardware selection' -WHIP_DESC='Please select the current device this is being installed on:' -WHIP_DEFAULT_ITEM=0 -WHIP_MENU_ARRAY=( - - '110' 'RoseapplePi' - '100' 'Asus Tinker Board' - '90' 'A20-OLinuXino-MICRO' - '80' 'Cubieboard 3' - '71' 'Beagle Bone Black' - '70' 'Sparky SBC' - '66' 'NanoPi M1 Plus' - '65' 'NanoPi NEO 2' - '64' 'NanoPi NEO Air' - '63' 'NanoPi M1/T1' - '62' 'NanoPi M3/T3' - '61' 'NanoPi M2/T2' - '60' 'NanoPi Neo' - '51' 'BananaPi Pro (Lemaker)' - '50' 'BananaPi M2+ (sinovoip)' - '43' 'Rock64' - '42' 'Pine A64+ (2048mb)' - '41' 'Pine A64+ (1024mb)' - '40' 'Pine A64 (512mb)' - '38' 'OrangePi PC 2' - '37' 'OrangePi Prime' - '36' 'OrangePi Win' - '35' 'OrangePi Zero Plus 2 (H3/H5)' - '34' 'OrangePi Plus' - '33' 'OrangePi Lite' - '32' 'OrangePi Zero (H2+)' - '31' 'OrangePi One' - '30' 'OrangePi PC' - '21' 'x86_64 Native PC' - '20' 'x86_64 VMware/VirtualBox' - '13' 'oDroid U3' - '12' 'oDroid C2' - '11' 'oDroid XU3/4' - '10' 'oDroid C1' - '3' 'Raspberry Pi 3' - '2' 'Raspberry Pi 2' - '1' 'Raspberry Pi 1/Zero (512mb)' - '0' 'Raspberry Pi 1 (256mb)' - -) - -Run_Whiptail -HW_MODEL=$WHIP_RETURN_VALUE - -dietpi-notify 2 "Setting HW_MODEL index of: $HW_MODEL" -dietpi-notify 2 "CPU ARCH = $HW_ARCH : $HW_ARCH_DESCRIPTION" - -#------------------------------------------------------------------------------------------------ -#Step 3: Distro Selection + APT prep -#------------------------------------------------------------------------------------------------ -############### -dietpi-notify 0 'Distro selection' - -WHIP_TITLE='Distro Selection' -WHIP_DESC='Please select a distro to install on this system. Selecting a distro that is older than the current installed on system, is not supported.' -WHIP_DEFAULT_ITEM=4 -WHIP_MENU_ARRAY=( - - '3' 'jessie' - '4' 'stretch' - '5' 'buster' - -) - -Run_Whiptail -DISTRO=$WHIP_RETURN_VALUE - -if (( $DISTRO == 3 )); then - - DISTRO_NAME='jessie' - -elif (( $DISTRO == 4 )); then - - DISTRO_NAME='stretch' - -elif (( $DISTRO == 5 )); then - - DISTRO_NAME='buster' - -fi + dietpi-notify 2 'Removing conflicting apt sources.list.d' -############### -dietpi-notify 0 'Removing conflicting apt sources.list.d' + #rm /etc/apt/sources.list.d/* &> /dev/null #Probably a bad idea + rm /etc/apt/sources.list.d/deb-multimedia.list &> /dev/null #meveric -#rm /etc/apt/sources.list.d/* &> /dev/null #Probably a bad idea -rm /etc/apt/sources.list.d/deb-multimedia.list &> /dev/null #meveric -echo 0 #always pass -Error_Check -############### -dietpi-notify 0 "Setting APT sources.list: $DISTRO_NAME $DISTRO" + dietpi-notify 2 "Setting APT sources.list: $DISTRO_NAME $DISTRO" -if (( $HW_MODEL < 10 )); then + if (( $HW_MODEL < 10 )); then - cat << _EOF_ > /etc/apt/sources.list + cat << _EOF_ > /etc/apt/sources.list deb https://www.mirrorservice.org/sites/archive.raspbian.org/raspbian $DISTRO_NAME main contrib non-free rpi _EOF_ - cat << _EOF_ > /etc/apt/sources.list.d/raspi.list + cat << _EOF_ > /etc/apt/sources.list.d/raspi.list deb https://archive.raspberrypi.org/debian/ $DISTRO_NAME main ui _EOF_ -else + else - cat << _EOF_ > /etc/apt/sources.list + cat << _EOF_ > /etc/apt/sources.list deb http://ftp.debian.org/debian/ $DISTRO_NAME main contrib non-free deb http://ftp.debian.org/debian/ $DISTRO_NAME-updates main contrib non-free deb http://security.debian.org $DISTRO_NAME/updates main contrib non-free deb http://ftp.debian.org/debian/ $DISTRO_NAME-backports main contrib non-free _EOF_ -fi -Error_Check - -#NB: Apt mirror will get overwritten by: /DietPi/dietpi/func/dietpi-set_software apt-mirror default : during finalize. - + fi + Error_Check -############### -# - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files -dietpi-notify 0 "Marking all packages as auto installed first, to allow allow effective autoremove afterwards" + #NB: Apt mirror will get overwritten by: /DietPi/dietpi/func/dietpi-set_software apt-mirror default : during finalize. -apt-mark auto $(apt-mark showmanual) -Error_Check + # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files + dietpi-notify 2 "Marking all packages as auto installed first, to allow allow effective autoremove afterwards" + apt-mark auto $(apt-mark showmanual) + Error_Check -############### -# - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files -dietpi-notify 0 "Temporary disable automatic recommends/suggests installation and allow them to be autoremoved:" + # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files + dietpi-notify 2 "Temporary disable automatic recommends/suggests installation and allow them to be autoremoved:" -cat << _EOF_ > /etc/apt/apt.conf.d/99norecommends + cat << _EOF_ > /etc/apt/apt.conf.d/99norecommends APT::Install-Recommends "false"; APT::Install-Suggests "false"; APT::AutoRemove::RecommendsImportant "false"; APT::AutoRemove::SuggestsImportant "false"; _EOF_ -Error_Check - + Error_Check -############### -dietpi-notify 0 "Forcing use of existing apt configs if available" + dietpi-notify 2 "Forcing use of existing apt configs if available" -cat << _EOF_ > /etc/apt/apt.conf.d/local + cat << _EOF_ > /etc/apt/apt.conf.d/local Dpkg::options { "--force-confdef"; "--force-confold"; } _EOF_ -Error_Check - - -############### -dietpi-notify 0 "Updating APT for $DISTRO_NAME" - -apt-get clean -Error_Check - -apt-get update -Error_Check - - -#------------------------------------------------------------------------------------------------ -#Step 4: APT removals -#------------------------------------------------------------------------------------------------ -# - DietPi list of minimal required packages which must be installed: -# dpkg --get-selections | awk '{print $1}' | sed 's/:armhf//g' | sed "s/^/'/g" | sed "s/$/'/g" -aPACKAGES_REQUIRED_INSTALL=( - - 'acl' - 'adduser' - 'apt' - 'apt-transport-https' - 'apt-utils' - 'base-files' - 'base-passwd' - 'bash' - 'bash-completion' - 'bc' - 'bsdmainutils' - 'bsdutils' - 'bzip2' - 'ca-certificates' - 'console-common' - 'console-data' - 'console-setup' - 'console-setup-linux' - 'coreutils' - 'cpio' - 'crda' - 'cron' - 'curl' - 'dash' - 'dbus' - 'debconf' - 'debian-archive-keyring' - 'debianutils' - 'diffutils' - 'dmidecode' - 'dmsetup' - 'dosfstools' - 'dphys-swapfile' - 'dpkg' - 'e2fslibs' - 'e2fsprogs' - 'ethtool' - 'fake-hwclock' - 'fbset' - 'findutils' - 'firmware-atheros' - 'firmware-brcm80211' - 'firmware-ralink' - 'firmware-realtek' - 'firmware-misc-nonfree' - 'fuse' - 'gnupg' - 'gpgv' - 'grep' - 'groff-base' - 'gzip' - 'hdparm' - 'hfsplus' - 'hostname' - 'htop' - 'ifupdown' - 'init' - 'init-system-helpers' - 'initramfs-tools' - 'initscripts' - 'insserv' - 'iproute2' - 'iputils-ping' - 'isc-dhcp-client' - 'isc-dhcp-common' - 'iw' - 'kbd' - 'keyboard-configuration' - 'klibc-utils' - 'kmod' - 'less' - 'locales' - 'login' - 'lsb-base' - 'mawk' - 'mount' - 'multiarch-support' - 'nano' - 'ncurses-base' - 'ncurses-bin' - 'net-tools' - 'ntfs-3g' - 'ntp' - 'p7zip-full' - 'parted' - 'passwd' - 'perl-base' - 'procps' - 'psmisc' - 'readline-common' - 'resolvconf' - 'rfkill' #Used by some onboard WiFi chipsets - 'sed' - 'sensible-utils' - 'startpar' - 'sudo' - 'systemd' - 'systemd-sysv' - 'sysvinit-utils' - 'tar' - 'tzdata' - 'udev' - 'unzip' - 'usbutils' - 'util-linux' - 'wget' - 'whiptail' - 'wireless-regdb' - 'wireless-tools' - 'wpasupplicant' - 'wput' - 'zip' - -) - -# - HW_ARCH specific required packages -# x86_64 -if (( $HW_ARCH == 10 )); then - - aPACKAGES_REQUIRED_INSTALL+=('linux-image-amd64') - aPACKAGES_REQUIRED_INSTALL+=('intel-microcode') - aPACKAGES_REQUIRED_INSTALL+=('amd64-microcode') - aPACKAGES_REQUIRED_INSTALL+=('firmware-linux-nonfree') - aPACKAGES_REQUIRED_INSTALL+=('grub-efi-amd64') - -fi - -# - HW_MODEL specific required packages -# RPi -if (( $HW_MODEL < 10 )); then - - aPACKAGES_REQUIRED_INSTALL+=('libraspberrypi-bin') - aPACKAGES_REQUIRED_INSTALL+=('libraspberrypi0') - aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-bootloader') - aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-kernel') - aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-sys-mods') - aPACKAGES_REQUIRED_INSTALL+=('raspbian-archive-keyring') - aPACKAGES_REQUIRED_INSTALL+=('raspi-copies-and-fills') - -# Odroid C2 -elif (( $HW_MODEL == 12 )); then - - aPACKAGES_REQUIRED_INSTALL+=('linux-image-arm64-odroid-c2') - -# Odroid XU3/4 -elif (( $HW_MODEL == 11 )); then - - #aPACKAGES_REQUIRED_INSTALL+=('linux-image-4.9-armhf-odroid-xu3') - aPACKAGES_REQUIRED_INSTALL+=('linux-image-armhf-odroid-xu3') - -# Odroid C1 -elif (( $HW_MODEL == 10 )); then - - aPACKAGES_REQUIRED_INSTALL+=('linux-image-armhf-odroid-c1') - -# Rock64 -elif (( $HW_MODEL == 43 )); then - - aPACKAGES_REQUIRED_INSTALL+=('linux-rock64-package') - -# BBB -elif (( $HW_MODEL == 71 )); then + Error_Check - aPACKAGES_REQUIRED_INSTALL+=('device-tree-compiler') - -fi + dietpi-notify 2 "Updating APT for $DISTRO_NAME:" + apt-get clean + Error_Check -############### -dietpi-notify 0 "Generating list of minimal packages required for DietPi installation" + apt-get update + Error_Check -INSTALL_PACKAGES='' -for ((i=0; i<${#aPACKAGES_REQUIRED_INSTALL[@]}; i++)) -do - # One line INSTALL_PACKAGES so we can use it later. - INSTALL_PACKAGES+="${aPACKAGES_REQUIRED_INSTALL[$i]} " + #------------------------------------------------------------------------------------------------ + dietpi-notify 0 'Step 4: APT removals:' + #------------------------------------------------------------------------------------------------ + + # - DietPi list of minimal required packages which must be installed: + # dpkg --get-selections | awk '{print $1}' | sed 's/:armhf//g' | sed "s/^/'/g" | sed "s/$/'/g" + aPACKAGES_REQUIRED_INSTALL=( + + 'acl' + 'adduser' + 'apt' + 'apt-transport-https' + 'apt-utils' + 'base-files' + 'base-passwd' + 'bash' + 'bash-completion' + 'bc' + 'bsdmainutils' + 'bsdutils' + 'bzip2' + 'ca-certificates' + 'console-common' + 'console-data' + 'console-setup' + 'console-setup-linux' + 'coreutils' + 'cpio' + 'crda' + 'cron' + 'curl' + 'dash' + 'dbus' + 'debconf' + 'debian-archive-keyring' + 'debianutils' + 'diffutils' + 'dmidecode' + 'dmsetup' + 'dosfstools' + 'dphys-swapfile' + 'dpkg' + 'e2fslibs' + 'e2fsprogs' + 'ethtool' + 'fake-hwclock' + 'fbset' + 'findutils' + 'firmware-atheros' + 'firmware-brcm80211' + 'firmware-ralink' + 'firmware-realtek' + 'firmware-misc-nonfree' + 'fuse' + 'gnupg' + 'gpgv' + 'grep' + 'groff-base' + 'gzip' + 'hdparm' + 'hfsplus' + 'hostname' + 'htop' + 'ifupdown' + 'init' + 'init-system-helpers' + 'initramfs-tools' + 'initscripts' + 'insserv' + 'iproute2' + 'iputils-ping' + 'isc-dhcp-client' + 'isc-dhcp-common' + 'iw' + 'kbd' + 'keyboard-configuration' + 'klibc-utils' + 'kmod' + 'less' + 'locales' + 'login' + 'lsb-base' + 'mawk' + 'mount' + 'multiarch-support' + 'nano' + 'ncurses-base' + 'ncurses-bin' + 'net-tools' + 'ntfs-3g' + 'ntp' + 'p7zip-full' + 'parted' + 'passwd' + 'perl-base' + 'procps' + 'psmisc' + 'readline-common' + 'resolvconf' + 'rfkill' #Used by some onboard WiFi chipsets + 'rsync' #dietpi-backup + 'sed' + 'sensible-utils' + 'startpar' + 'sudo' + 'systemd' + 'systemd-sysv' + 'sysvinit-utils' + 'tar' + 'tzdata' + 'udev' + 'unzip' + 'usbutils' + 'util-linux' + 'wget' + 'whiptail' + 'wireless-regdb' + 'wireless-tools' + 'wpasupplicant' + 'wput' + 'zip' + + ) + + # - HW_ARCH specific required packages + # x86_64 + if (( $HW_ARCH == 10 )); then + + aPACKAGES_REQUIRED_INSTALL+=('linux-image-amd64') + aPACKAGES_REQUIRED_INSTALL+=('intel-microcode') + aPACKAGES_REQUIRED_INSTALL+=('amd64-microcode') + aPACKAGES_REQUIRED_INSTALL+=('firmware-linux-nonfree') + aPACKAGES_REQUIRED_INSTALL+=('grub-efi-amd64') -done + fi -# - delete[] -unset aPACKAGES_REQUIRED_INSTALL + # - HW_MODEL specific required packages + # RPi + if (( $HW_MODEL < 10 )); then -dietpi-notify 2 "The following packages will be installed\n$INSTALL_PACKAGES" + aPACKAGES_REQUIRED_INSTALL+=('libraspberrypi-bin') + aPACKAGES_REQUIRED_INSTALL+=('libraspberrypi0') + aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-bootloader') + aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-kernel') + aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-sys-mods') + aPACKAGES_REQUIRED_INSTALL+=('raspbian-archive-keyring') + aPACKAGES_REQUIRED_INSTALL+=('raspi-copies-and-fills') + # Odroid C2 + elif (( $HW_MODEL == 12 )); then -############### -dietpi-notify 0 "Marking required DietPi packages and manually installed" + aPACKAGES_REQUIRED_INSTALL+=('linux-image-arm64-odroid-c2') -apt-mark manual $INSTALL_PACKAGES -Error_Check + # Odroid XU3/4 + elif (( $HW_MODEL == 11 )); then + #aPACKAGES_REQUIRED_INSTALL+=('linux-image-4.9-armhf-odroid-xu3') + aPACKAGES_REQUIRED_INSTALL+=('linux-image-armhf-odroid-xu3') -############### -dietpi-notify 0 "Purging APT with autoremoval" + # Odroid C1 + elif (( $HW_MODEL == 10 )); then -apt-get autoremove --purge #-y -Error_Check + aPACKAGES_REQUIRED_INSTALL+=('linux-image-armhf-odroid-c1') + # Rock64 + elif (( $HW_MODEL == 43 )); then -exit + aPACKAGES_REQUIRED_INSTALL+=('linux-rock64-package') + # BBB + elif (( $HW_MODEL == 71 )); then -#------------------------------------------------------------------------------------------------ -#Step 5: APT Installations -#------------------------------------------------------------------------------------------------ + aPACKAGES_REQUIRED_INSTALL+=('device-tree-compiler') #Kern + aPACKAGES_REQUIRED_INSTALL+=('dosfstools') #EMMC transfer -############### -dietpi-notify 0 "Upgrading existing APT installed packages to latest" + fi -DEBIAN_FRONTEND='noninteractive' apt-get dist-upgrade -y -Error_Check + dietpi-notify 2 "Generating list of minimal packages, required for DietPi installation:" -#???: WHIP_OPTIONal Reinstall OpenSSH (for updating dietpi scripts etc). Gets removed during finalise. -# apt-get install openssh-server -y -# echo -e "PermitRootLogin yes" >> /etc/ssh/sshd_config -# systemctl restart ssh -#??? + INSTALL_PACKAGES='' + for ((i=0; i<${#aPACKAGES_REQUIRED_INSTALL[@]}; i++)) + do + # One line INSTALL_PACKAGES so we can use it later. + INSTALL_PACKAGES+="${aPACKAGES_REQUIRED_INSTALL[$i]} " -############### -dietpi-notify 0 "Disabling swapfile generation for dphys-swapfile during install" + done -echo -e "CONF_SWAPSIZE=0" > /etc/dphys-swapfile -Error_Check + # - delete[] + unset aPACKAGES_REQUIRED_INSTALL + dietpi-notify 2 "Marking required DietPi packages and manually installed:" -############### -dietpi-notify 0 "Installing core DietPi pre-req APT packages" + apt-mark manual $INSTALL_PACKAGES + Error_Check -AGI $INSTALL_PACKAGES -Error_Check + dietpi-notify 2 "Purging APT with autoremoval:" + apt-get autoremove --purge -y + Error_Check -############### -dietpi-notify 0 "Onboard Bluetooth selection" -WHIP_TITLE='Bluetooth Required' -WHIP_DESC='Please select an option' -WHIP_DEFAULT_ITEM=0 -WHIP_MENU_ARRAY=( + #------------------------------------------------------------------------------------------------ + dietpi-notify 0 'Step 5: APT Installations:' + #------------------------------------------------------------------------------------------------ - '0' 'BT not required, do not install.' - '1' 'Device has onboard BT, and/or, I require BT functionality.' + dietpi-notify 2 "Upgrading existing APT installed packages:" -) + DEBIAN_FRONTEND='noninteractive' apt-get dist-upgrade -y + Error_Check -Run_Whiptail -if (( $WHIP_RETURN_VALUE == 1 )); then + #???: WHIP_OPTIONal Reinstall OpenSSH (for updating dietpi scripts etc). Gets removed during finalise. + # apt-get install openssh-server -y + # echo -e "PermitRootLogin yes" >> /etc/ssh/sshd_config + # systemctl restart ssh + #??? - ############### - dietpi-notify 0 "Installing Bluetooth packages" + dietpi-notify 2 "Disabling swapfile generation for dphys-swapfile during install" - AGI bluetooth bluez-firmware + echo -e "CONF_SWAPSIZE=0" > /etc/dphys-swapfile Error_Check -fi - -if (( $HW_MODEL < 10 )); then - ############### - dietpi-notify 0 "Installing Bluetooth packages specific to RPi" + dietpi-notify 2 "Installing core DietPi pre-req APT packages" + dietpi-notify 2 "The following packages will be installed\n$INSTALL_PACKAGES" - AGI pi-bluetooth libraspberrypi-bin + AGI $INSTALL_PACKAGES Error_Check -fi - + dietpi-notify 2 "Onboard Bluetooth selection" -############### -# - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files -dietpi-notify 0 "Enable auto install of recommendations again, in case it is necessary somewhere:" + WHIP_TITLE='Bluetooth Required?' + WHIP_DESC='Please select an option' + WHIP_DEFAULT_ITEM=0 + WHIP_MENU_ARRAY=( -rm /etc/apt/apt-conf.d/99norecommends &> /dev/null + '0' 'BT not required, do not install.' + '1' 'Device has onboard BT, and/or, I require BT functionality.' + ) -#------------------------------------------------------------------------------------------------ -#Step 6: Download DietPi sourcecode -#------------------------------------------------------------------------------------------------ -############### -INTERNET_ADDRESS='https://github.com/Fourdee/DietPi/archive/testing.zip' #NB: testing until this is stable in master -dietpi-notify 0 "Checking connection to $INTERNET_ADDRESS" -Check_Connection "$INTERNET_ADDRESS" -Error_Check + Run_Whiptail + if (( $WHIP_RETURN_VALUE == 1 )); then + dietpi-notify 2 "Installing Bluetooth packages" -############### -dietpi-notify 0 "Downloading DietPi sourcecode" + AGI bluetooth bluez-firmware + Error_Check -wget "$INTERNET_ADDRESS" -O package.zip -Error_Check + fi -############### -dietpi-notify 0 "Extracting DietPi sourcecode" - -unzip package.zip -Error_Check -rm package.zip + if (( $HW_MODEL < 10 )); then + dietpi-notify 2 "Installing Bluetooth packages specific to RPi" -############### -dietpi-notify 0 "Removing files not required" + AGI pi-bluetooth + Error_Check -# Remove files we do not require, or want to overwrite in /boot -rm DietPi-*/CHANGELOG.txt -rm DietPi-*/PREP_SYSTEM_FOR_DIETPI.sh -rm DietPi-*/TESTING-BRANCH.md -rm DietPi-*/uEnv.txt # Pine 64, use existing on system. + fi + # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files + dietpi-notify 2 "Returning installation of recommends back to default" -############### -dietpi-notify 0 "Creating /boot" + rm /etc/apt/apt-conf.d/99norecommends &> /dev/null -mkdir -p /boot -Error_Check + #------------------------------------------------------------------------------------------------ + dietpi-notify 0 'Step 6: Downloading and installing DietPi sourcecode' + #------------------------------------------------------------------------------------------------ + INTERNET_ADDRESS='https://github.com/Fourdee/DietPi/archive/testing.zip' #NB: testing until this is stable in master + dietpi-notify 2 "Checking connection to $INTERNET_ADDRESS" + Check_Connection "$INTERNET_ADDRESS" + Error_Check -############### -dietpi-notify 0 "Moving to /boot" + wget "$INTERNET_ADDRESS" -O package.zip + Error_Check -# - HW specific boot.ini uenv.txt -if (( $HW_MODEL == 10 )); then + dietpi-notify 2 "Extracting DietPi sourcecode" - mv DietPi-*/boot_c1.ini /boot/boot.ini + unzip package.zip Error_Check -fi - -if (( $HW_MODEL == 11 )); then + rm package.zip - mv DietPi-*/boot_xu4.ini /boot/boot.ini - Error_Check + dietpi-notify 2 "Removing files not required" -fi + # Remove files we do not require, or want to overwrite in /boot + rm DietPi-*/CHANGELOG.txt + rm DietPi-*/PREP_SYSTEM_FOR_DIETPI.sh + rm DietPi-*/TESTING-BRANCH.md + rm DietPi-*/uEnv.txt # Pine 64, use existing on system. -if (( $HW_MODEL == 12 )); then + dietpi-notify 2 "Creating /boot" - mv DietPi-*/boot_c2.ini /boot/boot.ini + mkdir -p /boot Error_Check -fi - -rm DietPi-*/*.ini + dietpi-notify 2 "Moving to /boot" -cp -R DietPi-*/* /boot/ -Error_Check + # - HW specific boot.ini uenv.txt + if (( $HW_MODEL == 10 )); then + mv DietPi-*/boot_c1.ini /boot/boot.ini + Error_Check -############### -dietpi-notify 0 "Cleaning up extracted files" + elif (( $HW_MODEL == 11 )); then -rm -R DietPi-* -Error_Check + mv DietPi-*/boot_xu4.ini /boot/boot.ini + Error_Check + elif (( $HW_MODEL == 12 )); then -############### -dietpi-notify 0 "Setting execute permissions for /boot/dietpi" + mv DietPi-*/boot_c2.ini /boot/boot.ini + Error_Check -chmod +x -R /boot/dietpi -Error_Check + fi -#------------------------------------------------------------------------------------------------ -#Step 7: Prep DietPi ENV -#------------------------------------------------------------------------------------------------ -############### -dietpi-notify 0 "Prep system for DietPi ENV" + rm DietPi-*/*.ini + cp -R DietPi-*/* /boot/ + Error_Check -############### -dietpi-notify 0 "Deleting list of known users, not required by DietPi" + dietpi-notify 2 "Cleaning up extracted files" -userdel -f pi &> /dev/null -userdel -f test &> /dev/null #armbian -userdel -f odroid &> /dev/null -userdel -f rock64 &> /dev/null -userdel -f linaro &> /dev/null #ASUS TB -userdel -f dietpi &> /dev/null -userdel -f debian &> /dev/null #BBB + rm -R DietPi-* + Error_Check -############### -dietpi-notify 0 "Removing misc files/folders, not required by DietPi" + dietpi-notify 2 "Setting execute permissions for /boot/dietpi" -rm -R /home &> /dev/null -rm -R /media &> /dev/null + chmod -R +x /boot/dietpi + Error_Check -rm -R /usr/share/fonts/* &> /dev/null -rm -R /usr/share/icons/* &> /dev/null + #------------------------------------------------------------------------------------------------ + dietpi-notify 0 "Step 7: Prep system for DietPi ENV:" + #------------------------------------------------------------------------------------------------ -#rm /etc/apt/sources.list.d/armbian.list -rm /etc/init.d/resize2fs &> /dev/null -rm /etc/update-motd.d/* &> /dev/null # ARMbian + dietpi-notify 2 "Deleting list of known users, not required by DietPi" -systemctl disable firstrun &> /dev/null -rm /etc/init.d/firstrun &> /dev/null # ARMbian + userdel -f pi &> /dev/null + userdel -f test &> /dev/null #armbian + userdel -f odroid &> /dev/null + userdel -f rock64 &> /dev/null + userdel -f linaro &> /dev/null #ASUS TB + userdel -f dietpi &> /dev/null + userdel -f debian &> /dev/null #BBB -# - Disable ARMbian's log2ram: https://github.com/Fourdee/DietPi/issues/781 -systemctl disable log2ram.service &> /dev/null -systemctl stop log2ram.service &> /dev/null -rm /usr/local/sbin/log2ram &> /dev/null -rm /etc/systemd/system/log2ram.service &> /dev/null -systemctl daemon-reload &> /dev/null -rm /etc/cron.hourly/log2ram &> /dev/null + dietpi-notify 2 "Removing misc files/folders, not required by DietPi" -rm /etc/init.d/cpu_governor &> /dev/null# Meveric -rm /etc/systemd/system/cpu_governor.service &> /dev/null# Meveric + rm -R /home &> /dev/null + rm -R /media &> /dev/null -# -Disable ARMbian's resize service (not automatically removed by ARMbian scripts...) -systemctl disable resize2fs &> /dev/null -rm /etc/systemd/system/resize2fs.service &> /dev/null + rm -R /usr/share/fonts/* &> /dev/null + rm -R /usr/share/icons/* &> /dev/null -# -ARMbian-config -rm /etc/profile.d/check_first_login_reboot.sh &> /dev/null + #rm /etc/apt/sources.list.d/armbian.list + rm /etc/init.d/resize2fs &> /dev/null + rm /etc/update-motd.d/* &> /dev/null # ARMbian + systemctl disable firstrun &> /dev/null + rm /etc/init.d/firstrun &> /dev/null # ARMbian -############### -dietpi-notify 0 "Setting UID bit for sudo" + # - Disable ARMbian's log2ram: https://github.com/Fourdee/DietPi/issues/781 + systemctl disable log2ram.service &> /dev/null + systemctl stop log2ram.service &> /dev/null + rm /usr/local/sbin/log2ram &> /dev/null + rm /etc/systemd/system/log2ram.service &> /dev/null + systemctl daemon-reload &> /dev/null + rm /etc/cron.hourly/log2ram &> /dev/null -# - https://github.com/Fourdee/DietPi/issues/794 -chmod 4755 /usr/bin/sudo -Error_Check + rm /etc/init.d/cpu_governor &> /dev/null# Meveric + rm /etc/systemd/system/cpu_governor.service &> /dev/null# Meveric + # -Disable ARMbian's resize service (not automatically removed by ARMbian scripts...) + systemctl disable resize2fs &> /dev/null + rm /etc/systemd/system/resize2fs.service &> /dev/null -############### -dietpi-notify 0 "Creating DietPi system directories" + # -ARMbian-config + rm /etc/profile.d/check_first_login_reboot.sh &> /dev/null -# - Create DietPi common folders -mkdir /DietPi -Error_Check + dietpi-notify 2 "Setting UID bit for sudo" -mkdir -p /etc/dietpi -Error_Check + # - https://github.com/Fourdee/DietPi/issues/794 + chmod 4755 /usr/bin/sudo + Error_Check -mkdir -p /mnt/dietpi_userdata -Error_Check + dietpi-notify 2 "Creating DietPi system directories" -mkdir -p /mnt/samba -Error_Check + # - Create DietPi common folders + mkdir -p /DietPi + Error_Check -mkdir -p /mnt/ftp_client -Error_Check + mkdir -p /etc/dietpi + Error_Check -mkdir -p /mnt/nfs_client -Error_Check + mkdir -p /mnt/dietpi_userdata + Error_Check -echo -e "Samba client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking WHIP_OPTIONs: NAS/Misc menu" > /mnt/samba/readme.txt -echo -e "FTP client mount can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking WHIP_OPTIONs: NAS/Misc menu" > /mnt/ftp_client/readme.txt -echo -e "NFS client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking WHIP_OPTIONs: NAS/Misc menu" > /mnt/nfs_client/readme.txt + mkdir -p /mnt/samba + Error_Check + mkdir -p /mnt/ftp_client + Error_Check -############### -dietpi-notify 0 "Deleting all log files /var/log. Please ignore any errors, its fine :)" + mkdir -p /mnt/nfs_client + Error_Check -/boot/dietpi/dietpi-logclear 2 + echo -e "Samba client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking WHIP_OPTIONs: NAS/Misc menu" > /mnt/samba/readme.txt + echo -e "FTP client mount can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking WHIP_OPTIONs: NAS/Misc menu" > /mnt/ftp_client/readme.txt + echo -e "NFS client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking WHIP_OPTIONs: NAS/Misc menu" > /mnt/nfs_client/readme.txt + dietpi-notify 2 "Deleting all log files /var/log" -############### -dietpi-notify 0 "Generating DietPi /etc/fstab" + /boot/dietpi/dietpi-logclear 2 &> /dev/null # As this will report missing vars, however, its fine, does not break functionality. -/boot/dietpi/dietpi-drive_manager 4 -Error_Check + dietpi-notify 2 "Generating DietPi /etc/fstab" + /boot/dietpi/dietpi-drive_manager 4 + Error_Check -############### -dietpi-notify 0 "Installing and starting DietPi-RAMdisk service" + dietpi-notify 2 "Installing and starting DietPi-RAMdisk service" -cat << _EOF_ > /etc/systemd/system/dietpi-ramdisk.service + cat << _EOF_ > /etc/systemd/system/dietpi-ramdisk.service [Unit] Description=DietPi-RAMdisk After=local-fs.target @@ -924,17 +834,15 @@ ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramdisk 1' [Install] WantedBy=local-fs.target _EOF_ -systemctl enable dietpi-ramdisk.service -systemctl daemon-reload -systemctl start dietpi-ramdisk.service -Error_Check - + systemctl enable dietpi-ramdisk.service + systemctl daemon-reload + systemctl start dietpi-ramdisk.service + Error_Check -############### -dietpi-notify 0 "Installing and starting DietPi-RAMlog service" + dietpi-notify 2 "Installing and starting DietPi-RAMlog service" -# DietPi-Ramlog -cat << _EOF_ > /etc/systemd/system/dietpi-ramlog.service + # DietPi-Ramlog + cat << _EOF_ > /etc/systemd/system/dietpi-ramlog.service [Unit] Description=DietPi-RAMlog Before=rsyslog.service syslog.service @@ -949,17 +857,15 @@ ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramlog 1' [Install] WantedBy=local-fs.target _EOF_ -systemctl enable dietpi-ramlog.service -systemctl daemon-reload -systemctl start dietpi-ramlog.service -Error_Check - + systemctl enable dietpi-ramlog.service + systemctl daemon-reload + systemctl start dietpi-ramlog.service + Error_Check -############### -dietpi-notify 0 "Installing DietPi boot service" + dietpi-notify 2 "Installing DietPi boot service" -# Boot -cat << _EOF_ > /etc/systemd/system/dietpi-boot.service + # Boot + cat << _EOF_ > /etc/systemd/system/dietpi-boot.service [Unit] Description=DietPi-Boot After=network-online.target network.target networking.service dietpi-ramdisk.service dietpi-ramlog.service @@ -974,18 +880,16 @@ StandardOutput=tty [Install] WantedBy=multi-user.target _EOF_ -systemctl enable dietpi-boot.service -systemctl daemon-reload + systemctl enable dietpi-boot.service + systemctl daemon-reload + dietpi-notify 2 "Installing DietPi /etc/rc.local service" -############### -dietpi-notify 0 "Installing DietPi /etc/rc.local service" + update-rc.d -f rc.local remove &> /dev/null + rm /etc/init.d/rc.local &> /dev/null + rm /lib/systemd/system/rc-local.service &> /dev/null -update-rc.d -f rc.local remove &> /dev/null -rm /etc/init.d/rc.local &> /dev/null -rm /lib/systemd/system/rc-local.service &> /dev/null - -cat << _EOF_ > /etc/systemd/system/rc-local.service + cat << _EOF_ > /etc/systemd/system/rc-local.service [Unit] Description=/etc/rc.local Compatibility After=dietpi-boot.service dietpi-ramdisk.service dietpi-ramlog.service @@ -1000,10 +904,10 @@ RemainAfterExit=yes [Install] WantedBy=multi-user.target _EOF_ -systemctl enable rc-local.service -systemctl daemon-reload + systemctl enable rc-local.service + systemctl daemon-reload -cat << _EOF_ > /etc/rc.local + cat << _EOF_ > /etc/rc.local #!/bin/bash #Precaution: Wait for DietPi Ramdisk to finish while [ ! -f /DietPi/.ramdisk ] @@ -1024,14 +928,12 @@ fi echo -e " Default Login:\n Username = root\n Password = dietpi\n" exit 0 _EOF_ -chmod +x /etc/rc.local -systemctl daemon-reload - + chmod +x /etc/rc.local + systemctl daemon-reload -############### -dietpi-notify 0 "Installing kill-ssh-user-sessions-before-network.service" + dietpi-notify 2 "Installing kill-ssh-user-sessions-before-network.service" -cat << _EOF_ > /etc/systemd/system/kill-ssh-user-sessions-before-network.service + cat << _EOF_ > /etc/systemd/system/kill-ssh-user-sessions-before-network.service [Unit] Description=Shutdown all ssh sessions before network DefaultDependencies=no @@ -1044,28 +946,22 @@ ExecStart=/bin/bash -c 'killall sshd &> /dev/null; killall dropbear &> /dev/null [Install] WantedBy=poweroff.target halt.target reboot.target _EOF_ -systemctl enable kill-ssh-user-sessions-before-network -systemctl daemon-reload - + systemctl enable kill-ssh-user-sessions-before-network + systemctl daemon-reload -############### -dietpi-notify 0 "Installing DietPi Cron jobs" + dietpi-notify 2 "Configuring Cron:" -#Cron jobs -cp /DietPi/dietpi/conf/cron.daily_dietpi /etc/cron.daily/dietpi -Error_Check -chmod +x /etc/cron.daily/dietpi -Error_Check -cp /DietPi/dietpi/conf/cron.hourly_dietpi /etc/cron.hourly/dietpi -Error_Check -chmod +x /etc/cron.hourly/dietpi -Error_Check - - -############### -dietpi-notify 0 "Generating default crontab" + #Cron jobs + cp /DietPi/dietpi/conf/cron.daily_dietpi /etc/cron.daily/dietpi + Error_Check + chmod +x /etc/cron.daily/dietpi + Error_Check + cp /DietPi/dietpi/conf/cron.hourly_dietpi /etc/cron.hourly/dietpi + Error_Check + chmod +x /etc/cron.hourly/dietpi + Error_Check -cat << _EOF_ > /etc/crontab + cat << _EOF_ > /etc/crontab #Please use dietpi-cron to change cron start times SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin @@ -1076,70 +972,81 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 47 1 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 1 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) _EOF_ -Error_Check - - - - - - -exit - - + Error_Check + # - ntp + rm /etc/cron.daily/ntp &> /dev/null + dietpi-notify 2 "Disabling apt-daily services (prevents random APT cache lock):" -#ntp -rm /etc/cron.daily/ntp &> /dev/null -rm /etc/init.d/ntp &> /dev/null + systemctl mask apt-daily.service + systemctl mask apt-daily-upgrade.timer -#Disable automatic updates and management of apt cache. Prevents unexpected lock on Apt cache and therefore failed apt installations. -systemctl mask apt-daily.service -systemctl mask apt-daily-upgrade.timer + dietpi-notify 2 "Setting vm.swappiness=1:" -#/etc/sysctl.conf | Check for a previous entry before adding this -echo -e "vm.swappiness=1" > /etc/sysctl.d/97-dietpi.conf + sed -i 's/vm.swappiness=/d' /etc/sysctl.conf + echo -e "vm.swappiness=1" > /etc/sysctl.d/97-dietpi.conf + Error_Check -#login, -echo -e "\n/DietPi/dietpi/login" >> /root/.bashrc + dietpi-notify 2 "Configuring Network:" -#Network -rm -R /etc/network/interfaces # armbian symlink for bulky network-manager -cp /boot/dietpi/conf/network_interfaces /etc/network/interfaces -/DietPi/dietpi/func/obtain_network_details -# - enable allow-hotplug eth0 after copying. -sed -i "/allow-hotplug eth/c\allow-hotplug eth$(sed -n 1p /DietPi/dietpi/.network)" /etc/network/interfaces + rm -R /etc/network/interfaces &> /dev/null # armbian symlink for bulky network-manager + cp /boot/dietpi/conf/network_interfaces /etc/network/interfaces + /DietPi/dietpi/func/obtain_network_details + Error_Check + # - enable allow-hotplug eth0 after copying. + sed -i "/allow-hotplug eth/c\allow-hotplug eth$(sed -n 1p /DietPi/dietpi/.network)" /etc/network/interfaces + dietpi-notify 2 "Tweaking DHCP timeout:" -#Reduce DHCP request retry count and timeouts: https://github.com/Fourdee/DietPi/issues/711 -sed -i '/^#timeout /d' /etc/dhcp/dhclient.conf -sed -i '/^#retry /d' /etc/dhcp/dhclient.conf -sed -i '/^timeout /d' /etc/dhcp/dhclient.conf -sed -i '/^retry /d' /etc/dhcp/dhclient.conf -cat << _EOF_ >> /etc/dhcp/dhclient.conf + # - Reduce DHCP request retry count and timeouts: https://github.com/Fourdee/DietPi/issues/711 + sed -i '/^#timeout /d' /etc/dhcp/dhclient.conf + sed -i '/^#retry /d' /etc/dhcp/dhclient.conf + sed -i '/^timeout /d' /etc/dhcp/dhclient.conf + sed -i '/^retry /d' /etc/dhcp/dhclient.conf + cat << _EOF_ >> /etc/dhcp/dhclient.conf timeout 10; retry 4; _EOF_ + Error_Check + + dietpi-notify 2 "Tweaking network naming:" + + # - Prefer to use wlan/eth naming for networked devices (eg: stretch) + ln -sf /dev/null /etc/systemd/network/99-default.link + #??? x86_64 + # kernel cmd line with GRUB + # /etc/default/grub [replace] GRUB_CMDLINE_LINUX="net.ifnames=0" + # GRUB_TIMEOUT=0 + #??? -#Hosts -cat << _EOF_ > /etc/hosts + dietpi-notify 2 "Configuring Hosts:" + + cat << _EOF_ > /etc/hosts 127.0.0.1 localhost 127.0.1.1 DietPi ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters _EOF_ + Error_Check -cat << _EOF_ > /etc/hostname + cat << _EOF_ > /etc/hostname DietPi _EOF_ + Error_Check + + + dietpi-notify 2 "Configuring htop:" + + # NB: Also done in finalize + mkdir -p /root/.config/htop + cp /DietPi/dietpi/conf/htoprc /root/.config/htop/htoprc -#htop cfg -mkdir -p /root/.config/htop -cp /boot/dietpi/conf/htoprc /root/.config/htop/htoprc -#hdparm -cat << _EOF_ >> /etc/hdparm.conf + dietpi-notify 2 "Configuring hdparm:" + + cat << _EOF_ >> /etc/hdparm.conf #DietPi external USB drive. Power management settings. /dev/sda { @@ -1150,8 +1057,11 @@ cat << _EOF_ >> /etc/hdparm.conf apm = 254 } _EOF_ + Error_Check + + dietpi-notify 2 "Configuring bash:" -cat << _EOF_ >> /etc/bash.bashrc + cat << _EOF_ >> /etc/bash.bashrc #LANG export \$(cat /etc/default/locale | grep LANG=) @@ -1199,65 +1109,77 @@ treesize() ' } _EOF_ + Error_Check + # - login, + sed -i '/DietPi/d' /root/.bashrc #prevents dupes + echo -e "\n/DietPi/dietpi/login" >> /root/.bashrc + Error_Check -#fakehwclock - allow times in the past -sed -i "/FORCE=/c\FORCE=force" /etc/default/fake-hwclock - -#wifi dongles | move to dietpi-set_hardware wifi -# echo -e "options 8192cu rtw_power_mgnt=0" > /etc/modprobe.d/8192cu.conf -# 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 - + dietpi-notify 2 "Configuring fakehwclock:" -#Set swapfile size -echo -e "CONF_SWAPSIZE=0" > /etc/dphys-swapfile + # - allow times in the past + sed -i "/FORCE=/c\FORCE=force" /etc/default/fake-hwclock -#nano /etc/systemd/logind.conf -#NAutoVTs=1 + dietpi-notify 2 "Configuring serial consoles:" -#nano /etc/default/console-setup -#Reduce gettys ACTIVE_CONSOLES="/dev/tty[1-2]" + # - Disable serial console + /DietPi/dietpi/func/dietpi-set_hardware serialconsole disable -systemctl disable getty@tty[2-6].service -#systemctl disable serial-getty@ttyS0.service + dietpi-notify 2 "Configuring ntpd:" -#NTPd default - Disable systemd's version -systemctl disable systemd-timesyncd + systemctl disable systemd-timesyncd + rm /etc/init.d/ntp &> /dev/null -#+ARMbian increase console verbose -sed -i '/verbosity=/c\verbosity=7' /boot/armbianEnv.txt + dietpi-notify 2 "Configuring regional settings (TZ/Locale/Keyboard):" + #TODO: automate these... + dpkg-reconfigure tzdata #Europe > London + dpkg-reconfigure keyboard-configuration #Keyboard must be plugged in for this to work! + dpkg-reconfigure locales # en_GB.UTF8 as default and only installed locale -dpkg-reconfigure tzdata #Europe > London -dpkg-reconfigure keyboard-configuration #Keyboard must be plugged in for this to work! -dpkg-reconfigure locales # en_GB.UTF8 as default and only installed locale -#Pump default locale into sys env: https://github.com/Fourdee/DietPi/issues/825 -cat << _EOF_ > /etc/environment + # - Pump default locale into sys env: https://github.com/Fourdee/DietPi/issues/825 + cat << _EOF_ > /etc/environment LC_ALL=en_GB.UTF-8 LANG=en_GB.UTF-8 _EOF_ + Error_Check + + #HW_ARCH specific + dietpi-notify 2 "Applying HW_ARCH specific tweaks:" -#Prefer to use wlan/eth naming for networked devices (eg: stretch) -ln -sf /dev/null /etc/systemd/network/99-default.link -#??? x86_64 -# kernel cmd line with GRUB -# /etc/default/grub [replace] GRUB_CMDLINE_LINUX="net.ifnames=0" -# GRUB_TIMEOUT=0 -#??? - -#??? Native PC, add i386 support by default -dpkg --add-architecture i386 -apt-get update -#??? - -#??? ARMbian OPi Zero 2: https://github.com/Fourdee/DietPi/issues/876#issuecomment-294350580 -echo -e "blacklist bmp085" > /etc/modprobe.d/bmp085.conf -#??? - -#??? Sparky SBC ONLY: Blacklist GPU and touch screen modules: https://github.com/Fourdee/DietPi/issues/699#issuecomment-271362441 -cat << _EOF_ > /etc/modprobe.d/disable_sparkysbc_touchscreen.conf + if (( $HW_ARCH == 10 )); then + + # - i386 APT support + dpkg --add-architecture i386 + apt-get update + + # - Disable nouveau: https://github.com/Fourdee/DietPi/issues/1244 // http://dietpi.com/phpbb/viewtopic.php?f=11&t=2462&p=9688#p9688 + cat << _EOF_ > /etc/modprobe.d/blacklist-nouveau.conf +blacklist nouveau +blacklist lbm-nouveau +options nouveau modeset=0 +alias nouveau off +alias lbm-nouveau off +_EOF_ + echo -e "options nouveau modeset=0" > /etc/modprobe.d/nouveau-kms.conf + update-initramfs -u + + fi + + #HW_MODEL specific + dietpi-notify 2 "Appling HW_MODEL specific tweaks:" + + # - ARMbian OPi Zero 2: https://github.com/Fourdee/DietPi/issues/876#issuecomment-294350580 + if (( $HW_MODEL == 35 )); then + + echo -e "blacklist bmp085" > /etc/modprobe.d/bmp085.conf + + # - Sparky SBC ONLY: Blacklist GPU and touch screen modules: https://github.com/Fourdee/DietPi/issues/699#issuecomment-271362441 + elif (( $HW_MODEL == 70 )); then + + cat << _EOF_ > /etc/modprobe.d/disable_sparkysbc_touchscreen.conf blacklist owl_camera blacklist gsensor_stk8313 blacklist ctp_ft5x06 @@ -1266,72 +1188,59 @@ blacklist gsensor_bma222 blacklist gsensor_mir3da _EOF_ -cat << _EOF_ > /etc/modprobe.d/disable_sparkysbc_gpu.conf + cat << _EOF_ > /etc/modprobe.d/disable_sparkysbc_gpu.conf blacklist pvrsrvkm blacklist drm blacklist videobuf2_vmalloc blacklist bc_example _EOF_ -#??? -#??? RPI ONLY: Scroll lock fix for RPi by Midwan: https://github.com/Fourdee/DietPi/issues/474#issuecomment-243215674 -cat << _EOF_ > /etc/udev/rules.d/50-leds.rules + # - RPI: Scroll lock fix for RPi by Midwan: https://github.com/Fourdee/DietPi/issues/474#issuecomment-243215674 + elif (( $HW_MODEL < 10 )); then + + cat << _EOF_ > /etc/udev/rules.d/50-leds.rules ACTION=="add", SUBSYSTEM=="leds", ENV{DEVPATH}=="*/input*::scrolllock", ATTR{trigger}="kbd-scrollock" _EOF_ -#??? -#??? PINE (and possibily others): Cursor fix for FB -cat << _EOF_ >> "$HOME"/.bashrc + # - PINE64 (and possibily others): Cursor fix for FB + elif (( $HW_MODEL >= 40 && $HW_MODEL <= 42 )); then + + cat << _EOF_ >> "$HOME"/.bashrc infocmp > terminfo.txt sed -i -e 's/?0c/?112c/g' -e 's/?8c/?48;0;64c/g' terminfo.txt tic terminfo.txt tput cnorm _EOF_ -#??? + # - XU4 FFMPEG fix. Prefer debian.org over Meveric for backports: https://github.com/Fourdee/DietPi/issues/1273 + elif (( $HW_MODEL == 11 )); then -#??? XU4 FFMPEG fix. Prefer debian.org over Meveric for backports: https://github.com/Fourdee/DietPi/issues/1273 -cat << _EOF_ > /etc/apt/preferences.d/backports + cat << _EOF_ > /etc/apt/preferences.d/backports Package: * Pin: release a=jessie-backports Pin: origin "fuzon.co.uk" Pin-Priority: 99 _EOF_ -#??? -#??? x86_64 -# Disable nouveau: https://github.com/Fourdee/DietPi/issues/1244 // http://dietpi.com/phpbb/viewtopic.php?f=11&t=2462&p=9688#p9688 -cat << _EOF_ > /etc/modprobe.d/blacklist-nouveau.conf -blacklist nouveau -blacklist lbm-nouveau -options nouveau modeset=0 -alias nouveau off -alias lbm-nouveau off -_EOF_ -echo -e "options nouveau modeset=0" > /etc/modprobe.d/nouveau-kms.conf -update-initramfs -u -#??? + fi + # - ARMbian increase console verbose + sed -i '/verbosity=/c\verbosity=7' /boot/armbianEnv.txt &> /dev/null -#------------------------------------------------------------------------------------------------ -#A Unique HW_MODEL index will need to be assigned and coded into the DietPi sourcecode. -# If you are not creating a pull request for this, then: -# -# Email: -# Address='daniel.knight@dietpi.com' -# Subject title='Unique HW_MODEL Index Request [DEVICENAME]' | Where DEVICENAME could be 'Odroid C3' -#------------------------------------------------------------------------------------------------ -#Once you have the updated sourcecode, update the file '/DietPi/dietpi/dietpi-obtain_hw_model' + #------------------------------------------------------------------------------------------------ + dietpi-notify 0 "Step 8: Finalise system for first run of DietPi:" + #------------------------------------------------------------------------------------------------ -#??? Does this device have a unique HW ID index and file? check /DietPi/dietpi/dietpi-obtain_hw_model -echo ID > /etc/.dietpi_hw_model_identifier + #Finalise system + /DietPi/dietpi/finalise -#Finalise system -/DietPi/dietpi/finalise + dietpi-notify 0 "Completed, disk can now be saved to .img for later use, or, reboot system to start first run of DietPi:" -#Power off system + #Power off system -#Read image + #Read image -#Resize 2nd parition to mininum size +50MB + #Resize rootfs parition to mininum size +50MB + +} diff --git a/dietpi/finalise b/dietpi/finalise index c41f7f31b8..4e5bcd4d8c 100644 --- a/dietpi/finalise +++ b/dietpi/finalise @@ -1,17 +1,17 @@ #!/bin/bash { - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ # DietPi Finalise # - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ # Created by Daniel Knight / daniel.knight@dietpi.com / dietpi.com # - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ # # Info: # - Preps the system for saving an image file, and, setting up for 1st use. # NB: Use of this script will drop WiFi connections, use ETH only. - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. LANG=en_GB.UTF-8 @@ -23,30 +23,30 @@ wget https://raw.githubusercontent.com/Fourdee/DietPi/master/dietpi/.version -O /tmp/masterversion IMAGE_VERSION=$(cat /tmp/masterversion) - #///////////////////////////////////////////////////////////////////////////////////// + #------------------------------------------------------------------------------------------------ #Obtain Pi/Odroid Model - #///////////////////////////////////////////////////////////////////////////////////// + #------------------------------------------------------------------------------------------------ /DietPi/dietpi/dietpi-obtain_hw_model HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ #Stop services /DietPi/dietpi/dietpi-services stop #Disable services /DietPi/dietpi/dietpi-services dietpi_controlled - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ #Unmount Drives umount /dev/sda[1-9] - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ # Clean Apt + cache #Remove packages - apt-get purge openssh-client openssh-server alsa-utils rsync stress -y + apt-get purge openssh-client openssh-server alsa-utils stress -y # + rpi apt-get purge -y rpi-update @@ -57,12 +57,6 @@ # - set to start on next boot sed -i '/NO_START=1/c\NO_START=0' /etc/default/dropbear - #BBB required for EMMC transfer - if (( $HW_MODEL == 71 )); then - - apt-get install -y dosfstools rsync - - fi #Clear cache apt-get clean @@ -70,18 +64,17 @@ #rm /var/lib/dpkg/info/* #issue... #dpkg: warning: files list file for package 'libdbus-1-3:armhf' missing; assuming package has no files currently installed - # - Set default apt mirrors /DietPi/dietpi/func/dietpi-set_software apt-mirror default # - Clear deb-multimedia (meveric's images, seems to be pulled in via his kernel package updates) rm /etc/apt/sources.list.d/deb-multimedia.list - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ #Sudo UID bit: https://github.com/Fourdee/DietPi/issues/794 chmod 4755 /usr/bin/sudo - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ #Delete/Cleanup # - general folders rm -R /media @@ -112,18 +105,18 @@ rm /var/cache/debconf/*-old - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ #Disable/Remove Swapfile (saves 100mb in final image) /DietPi/dietpi/func/dietpi-set_dphys-swapfile 0 /var/swap # - Reset config - echo -e "CONF_SWAPSIZE=100" > /etc/dphys-swapfile + echo -e "CONF_SWAPSIZE=0" > /etc/dphys-swapfile echo -e "CONF_SWAPFILE=/var/swap" >> /etc/dphys-swapfile - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ # Disable Autologin/Autostart rm /etc/systemd/system/getty@tty1.service.d/autologin.conf - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ #Reset FSTAB /DietPi/dietpi/dietpi-drive_manager 4 @@ -138,7 +131,7 @@ fi - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ # Reset cmdline.txt / boot.ini / dietpi.txt #Set Pi Config.txt back to normal wget https://raw.githubusercontent.com/Fourdee/DietPi/testing/config.txt -O /DietPi/config.txt @@ -175,13 +168,12 @@ #Set dietpi.txt back to normal wget https://raw.githubusercontent.com/Fourdee/DietPi/testing/dietpi.txt -O /DietPi/dietpi.txt - #??? BBB disable swapfile gen + #BBB disable swapfile gen if (( $HW_MODEL == 71 )); then sed -i '/Swapfile_Size=/c\Swapfile_Size=0' /DietPi/dietpi.txt fi - #??? # Update README.MD wget https://raw.githubusercontent.com/Fourdee/DietPi/testing/README.md -O /boot/README.md @@ -190,7 +182,7 @@ # - Remove root delay sed -i "s/ rootdelay=10//g" /boot/cmdline.txt - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ #Reset Networking /DietPi/dietpi/func/dietpi-set_hardware wifimodules enable # Must be enabled to set. /DietPi/dietpi/func/dietpi-set_hardware wificountrycode GB @@ -236,36 +228,36 @@ DietPi _EOF_ - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ #Htop cfg + mkdir -p /root/.config/htop cp /DietPi/dietpi/conf/htoprc /root/.config/htop/htoprc - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ #Kernel # - Disable installed flags rm /etc/dietpi/.* # - RPi install DietPi kernel by default - #NB: Done during patches. - # if (( $HW_MODEL < 10 )); then + if (( $HW_MODEL < 10 )); then - # /DietPi/dietpi/func/dietpi-set_hardware kernel dietpi_rpi + /DietPi/dietpi/func/dietpi-set_hardware kernel dietpi_rpi - # fi + fi - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ #Disable serial console /DietPi/dietpi/func/dietpi-set_hardware serialconsole disable - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ #Disable soundcards /DietPi/dietpi/func/dietpi-set_hardware soundcard none - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ #Set CPU govs /DietPi/dietpi/dietpi-cpu_set - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ #Logs/Automation /DietPi/dietpi/dietpi-logclear 2 @@ -282,11 +274,11 @@ _EOF_ rm /root/DietPi-Automation.log rm /boot/Automation_Format_My_Usb_Drive - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ #Create DietPi user: https://github.com/Fourdee/DietPi/issues/796 /DietPi/dietpi/func/dietpi-set_software useradd dietpi - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ # Reset DietPi generated files rm /DietPi/dietpi/.* @@ -302,19 +294,18 @@ _EOF_ # Set Init .install_stage to -3 (first boot) echo -3 > /DietPi/dietpi/.install_stage - #??? BBB skip FS_partition + # BBB skip FS_partition if (( $HW_MODEL == 71 )); then echo -2 > /DietPi/dietpi/.install_stage fi - #??? # Remove server_version / patch_file (downloads fresh from dietpi-update) rm /DietPi/dietpi/patch_file rm /DietPi/dietpi/server_version - #//////////////////////////////////// + #------------------------------------------------------------------------------------------------ #setup DietPi specific mount folders rm -R /mnt/dietpi-backup rm -R /mnt/dietpi-sync @@ -326,20 +317,28 @@ _EOF_ #unmount umount /mnt/samba if (( ! $(df | grep -ci -m1 '/mnt/samba') )); then + rm -R /mnt/samba mkdir -p /mnt/samba echo -e "Samba client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config" > /mnt/samba/readme.txt + else + echo -e "\nWARN: samba is mounted, please unmount and run this script again." + fi umount /mnt/ftp_client if (( ! $(df | grep -ci -m1 '/mnt/ftp_client') )); then + rm -R /mnt/ftp_client mkdir -p /mnt/ftp_client echo -e "FTP client mount can be installed and setup by DietPi-Config.\nSimply run: dietpi-config" > /mnt/ftp_client/readme.txt + else + echo -e "\nWARN: ftp_client is mounted, please unmount and run this script again." + fi #TRIM root FS @@ -350,7 +349,7 @@ _EOF_ #Sync DietPi RAMdisk to Disk now #systemctl restart dietpi-ramdisk # causes reboot on sparky????/ due to rm *. on dietpi globals? - echo -e "Check and delete all non-required folders in /root/.xxxxxx" + echo -e 'Check and delete all non-required folders in /root/.xxxxxx' ls -lha /lib/modules #----------------------------------------------------------------------------------- From 3e6e3d35db7a214ff9dc5d60c8a9ed948e9fcd78 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 14 Dec 2017 06:21:40 +0000 Subject: [PATCH 023/390] v160 DietPi-Set_Hardware | Sparky SBC: enable aotg.aotg1_speed compatibility setting for USB 1.1, when USB-DAC configured: https://github.com/Fourdee/DietPi/issues/1301 --- CHANGELOG.txt | 1 + dietpi/func/dietpi-set_hardware | 9 +++++++++ dietpi/patch_file | 11 +++++++++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 47880c16ef..ca40761c18 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ v160 Image Modifications: Changes / Improvements / Optimizations: +DietPi-Set_Hardware | Sparky SBC: enable aotg.aotg1_speed compatibility setting for USB 1.1, when USB-DAC configured: https://github.com/Fourdee/DietPi/issues/1301 Bug Fixes: DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi drop during software installs/updates etc: https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480 diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index ab5ee6c8b9..dae224387b 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1840,6 +1840,8 @@ _EOF_ SOUNDCARD_TARGET_DEVICE=1 amixer -c 0 sset 'audio output mode switch' 'hdmi' + sed -i 's/aotg.aotg1_speed=1/aotg.aotg1_speed=0/' /DietPi/uEnv.txt + } Soundcard_Reset_PineA64(){ @@ -1928,6 +1930,13 @@ _EOF_ SOUNDCARD_TARGET_DEVICE=0 + # - SparkySBC, enable aotg.aotg1_speed compatibility setting for USB 1.1, when USB-DAC configured: https://github.com/Fourdee/DietPi/issues/1301 + if (( $HW_MODEL == 70 )); then + + sed -i 's/aotg.aotg1_speed=0/aotg.aotg1_speed=1/' /DietPi/uEnv.txt + + fi + ;; #RPi ------------------------------------------------------------------------------- diff --git a/dietpi/patch_file b/dietpi/patch_file index bff92a5452..1d60c01bf5 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2920,10 +2920,10 @@ _EOF_ #NB: After v160, dietpi-update will do this prior to each update /DietPi/dietpi/func/dietpi-set_software verify_dietpi.txt #------------------------------------------------------------------------------- - #Sparky SBC kernel patches - # Updated kernel which resolves HQplayer playback issues. + #Sparky SBC patches if (( $HW_MODEL == 70 )); then + # Updated kernel which resolves HQplayer playback issues. wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dragon_fly_check/uImage -O /boot/uImage wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dragon_fly_check/3.10.38.bz2 -O package.tar tar xvf package.tar -C /lib/modules/ @@ -2934,6 +2934,13 @@ uenvcmd=setenv os_type linux; bootargs=earlyprintk clk_ignore_unused selinux=0 scandelay console=tty0 loglevel=1 real_rootflag=rw root=/dev/mmcblk0p2 rootwait init=/lib/systemd/systemd aotg.urb_fix=1 aotg.aotg1_speed=0 _EOF_ + # enable aotg.aotg1_speed compatibility setting for USB 1.1, when USB-DAC configured: https://github.com/Fourdee/DietPi/issues/1301 + if (( $(grep -ci -m1 '^soundcard=usb-dac' /DietPi/dietpi.txt) )); then + + sed -i 's/aotg.aotg1_speed=0/aotg.aotg1_speed=1/' /DietPi/uEnv.txt + + fi + fi #------------------------------------------------------------------------------- #Reinstalls | Moved from v159 From c61e9a0cbe62acfee67914b94ed206195659458e Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 15 Dec 2017 01:07:39 +0000 Subject: [PATCH 024/390] v160 + DietPi-Software | WiFi Hotspot (Stretch): Resolved an issue where hostapd would fail to run due to missing libssl1.0.0 lib, not available in repos: https://github.com/Fourdee/DietPi/issues/1299 + Minor fix for drive manager --- CHANGELOG.txt | 2 +- dietpi/dietpi-drive_manager | 10 +++++++--- dietpi/dietpi-software | 40 +++++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ca40761c18..7711db463d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,12 +8,12 @@ DietPi-Set_Hardware | Sparky SBC: enable aotg.aotg1_speed compatibility setting Bug Fixes: DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi drop during software installs/updates etc: https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480 +DietPi-Software | WiFi Hotspot (Stretch): Resolved an issue where hostapd would fail to run due to missing libssl1.0.0 lib, not available in repos: https://github.com/Fourdee/DietPi/issues/1299 DietPi-Software | Shairport-sync (Stretch): Resolved an issue where this would fail to install, due to pre-req URLS becomming invalid: https://github.com/Fourdee/DietPi/issues/1303 DietPi-Software | Plex Media Server: Resolved uninstall to include /var/lib/plexmediaserver in removal (which is not completed via apt purge). DietPi-Update | dietpi.txt is now checked for missing entries, and, will now be patched during the update: https://github.com/Fourdee/DietPi/issues/1292#issuecomment-350818969 Sparky SBC | Kernel patch will be applied which resolves issues with HQPlayer playback: https://www.computeraudiophile.com/forums/topic/32132-allo-sparky-usbridge/?do=findComment&comment=753100 - Allo Web Interface v4: Sparky SBC: Matrix Audio X-SPDIF 2, native DSD is now added to kernel, many thanks @sudeep: https://github.com/sparkysbc/Linux/pull/3 diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 6a66ca2f71..53ee2df7d6 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -36,14 +36,18 @@ fi - HW_MODEL=$(cat /etc/.dietpi_hw_model_identifier) - HW_NAME='PREP_SYSTEM_FOR_DIETPI.sh' + HW_MODEL=0 + HW_NAME='NULL' - if [ -d /DietPi/dietpi ]; then + if [ -f /DietPi/dietpi/.hw_model ]; then HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) HW_NAME=$(sed -n 2p /DietPi/dietpi/.hw_model) + elif [ -f /etc/.dietpi_hw_model_identifier ]; then + + HW_MODEL=$(cat /etc/.dietpi_hw_model_identifier) + fi #Grab Input (valid interger) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d69a54cf84..58ce85fd29 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5879,6 +5879,46 @@ _EOF_ #Enable wifi modules /DietPi/dietpi/func/dietpi-set_hardware wifimodules enable + # - Stretch, libssl1.0.0 no longer available: https://github.com/Fourdee/DietPi/issues/1299 + # Possibly only needed for RPi, however, no harm in installing, cover all bases. + if (( $DISTRO >= 4 )); then + + INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/' + + # - ARMv6/7 + if (( $HW_ARCH == 1 || $HW_ARCH == 2 )); then + + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_armhf.deb' + + # - ARM64 + elif (( $HW_ARCH == 3 )); then + + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_arm64.deb' + + # - x86_64 + elif (( $HW_ARCH == 10 )); then + + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_amd64.deb' + + fi + + /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + + #Install + if (( $? == 0 )); then + + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb + + else + + Error_NoConnection_NoInstall + + fi + + fi + else Error_NoConnection_NoInstall From d412d553bb2be91e37912996635894baa4f66d10 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 15 Dec 2017 01:16:59 +0000 Subject: [PATCH 025/390] v160 + DietPi-Software | NAA Daemon: Updated to latest (3.5.2-36). Existing installs will be patched automatically: https://github.com/Fourdee/DietPi/issues/1305 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 2 +- dietpi/patch_file | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7711db463d..ad6dc5212e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ Image Modifications: Changes / Improvements / Optimizations: DietPi-Set_Hardware | Sparky SBC: enable aotg.aotg1_speed compatibility setting for USB 1.1, when USB-DAC configured: https://github.com/Fourdee/DietPi/issues/1301 +DietPi-Software | NAA Daemon: Updated to latest (3.5.2-36). Existing installs will be patched automatically: https://github.com/Fourdee/DietPi/issues/1305 Bug Fixes: DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi drop during software installs/updates etc: https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 58ce85fd29..bd7364402f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5278,7 +5278,7 @@ _EOF_ fi - apackages+=('https://www.signalyst.eu/bins/naa/linux/stretch/networkaudiod_3.5.1-35_armhf.deb') + apackages+=('https://www.signalyst.eu/bins/naa/linux/stretch/networkaudiod_3.5.2-36_armhf.deb') # - check online for ((i=0; i<${#apackages[@]}; i++)) diff --git a/dietpi/patch_file b/dietpi/patch_file index 7192125f80..e67eca65f0 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2974,8 +2974,12 @@ _EOF_ #Reinstalls | Moved from v159 # Allo GUI (full) # MPD + # NAA Daemon + # NC + # OC # Squeezelite # YMPD + # update-rc.d ympd remove &> /dev/null # switch to systemD rm /etc/init.d/ympd &> /dev/null # switch to systemD @@ -2984,7 +2988,7 @@ _EOF_ sudo -u www-data php /var/www/owncloud/occ maintenance:mode --on &> /dev/null sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on &> /dev/null - /DietPi/dietpi/dietpi-software reinstall 159 128 114 47 36 32 + /DietPi/dietpi/dietpi-software reinstall 159 128 124 114 47 36 32 #------------------------------------------------------------------------------- fi From f6c8873e01d40fdcf5eafdbfeb28d0dc4af6fbf6 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 15 Dec 2017 01:35:55 +0000 Subject: [PATCH 026/390] v160 + https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 --- PREP_SYSTEM_FOR_DIETPI.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 8a27453d39..3c777fef85 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -358,6 +358,13 @@ _EOF_ fi Error_Check + # Buster, remove backports: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 + if (( $DISTRO == 5 )); then + + sed -i '/backports/d' /etc/apt/sources.list + + fi + #NB: Apt mirror will get overwritten by: /DietPi/dietpi/func/dietpi-set_software apt-mirror default : during finalize. # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files From ed22ea25c2a00a13d7321402cbc65e235f2e0254 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 15 Dec 2017 01:55:47 +0000 Subject: [PATCH 027/390] v160 + Move mariadb patch to v159 update code: https://github.com/Fourdee/DietPi/pull/1280 --- dietpi/patch_file | 57 ++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index e67eca65f0..e09a37cecc 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2913,34 +2913,6 @@ _EOF_ fi #------------------------------------------------------------------------------- - if grep -q 'aSOFTWARE_INSTALL_STATE\[86\]=2' /DietPi/dietpi/.installed && (( $DISTRO > 3 )); then - - apt -y install mariadb-server - apt -y purge mysql-server default-mysql-server - sed -i 's/aSOFTWARE_INSTALL_STATE\[86\]=2/aSOFTWARE_INSTALL_STATE\[86\]=0/' /DietPi/dietpi/.installed - sed -i 's/aSOFTWARE_INSTALL_STATE\[88\]=0/aSOFTWARE_INSTALL_STATE\[88\]=2/' /DietPi/dietpi/.installed - # Also manually switch webstacks to MariaDB: - if grep -q 'aSOFTWARE_INSTALL_STATE\[74\]=2' /DietPi/dietpi/.installed; then - - sed -i 's/aSOFTWARE_INSTALL_STATE\[74\]=2/aSOFTWARE_INSTALL_STATE\[74\]=0/' /DietPi/dietpi/.installed - sed -i 's/aSOFTWARE_INSTALL_STATE\[76\]=0/aSOFTWARE_INSTALL_STATE\[76\]=2/' /DietPi/dietpi/.installed - - fi - if grep -q 'aSOFTWARE_INSTALL_STATE\[77\]=2' /DietPi/dietpi/.installed; then - - sed -i 's/aSOFTWARE_INSTALL_STATE\[77\]=2/aSOFTWARE_INSTALL_STATE\[77\]=0/' /DietPi/dietpi/.installed - sed -i 's/aSOFTWARE_INSTALL_STATE\[79\]=0/aSOFTWARE_INSTALL_STATE\[79\]=2/' /DietPi/dietpi/.installed - - fi - if grep -q 'aSOFTWARE_INSTALL_STATE\[80\]=2' /DietPi/dietpi/.installed; then - - sed -i 's/aSOFTWARE_INSTALL_STATE\[80\]=2/aSOFTWARE_INSTALL_STATE\[80\]=0/' /DietPi/dietpi/.installed - sed -i 's/aSOFTWARE_INSTALL_STATE\[82\]=0/aSOFTWARE_INSTALL_STATE\[82\]=2/' /DietPi/dietpi/.installed - - fi - - fi - #------------------------------------------------------------------------------- elif (( $VERSION_CURRENT == 159 )); then #------------------------------------------------------------------------------- @@ -2969,6 +2941,35 @@ _EOF_ fi + fi + #------------------------------------------------------------------------------- + #@MichaIng Move Stretch instances from MySQL to MariaDB: https://github.com/Fourdee/DietPi/pull/1280 + if grep -q 'aSOFTWARE_INSTALL_STATE\[86\]=2' /DietPi/dietpi/.installed && (( $DISTRO > 3 )); then + + apt -y install mariadb-server + apt -y purge mysql-server default-mysql-server + sed -i 's/aSOFTWARE_INSTALL_STATE\[86\]=2/aSOFTWARE_INSTALL_STATE\[86\]=0/' /DietPi/dietpi/.installed + sed -i 's/aSOFTWARE_INSTALL_STATE\[88\]=0/aSOFTWARE_INSTALL_STATE\[88\]=2/' /DietPi/dietpi/.installed + # Also manually switch webstacks to MariaDB: + if grep -q 'aSOFTWARE_INSTALL_STATE\[74\]=2' /DietPi/dietpi/.installed; then + + sed -i 's/aSOFTWARE_INSTALL_STATE\[74\]=2/aSOFTWARE_INSTALL_STATE\[74\]=0/' /DietPi/dietpi/.installed + sed -i 's/aSOFTWARE_INSTALL_STATE\[76\]=0/aSOFTWARE_INSTALL_STATE\[76\]=2/' /DietPi/dietpi/.installed + + fi + if grep -q 'aSOFTWARE_INSTALL_STATE\[77\]=2' /DietPi/dietpi/.installed; then + + sed -i 's/aSOFTWARE_INSTALL_STATE\[77\]=2/aSOFTWARE_INSTALL_STATE\[77\]=0/' /DietPi/dietpi/.installed + sed -i 's/aSOFTWARE_INSTALL_STATE\[79\]=0/aSOFTWARE_INSTALL_STATE\[79\]=2/' /DietPi/dietpi/.installed + + fi + if grep -q 'aSOFTWARE_INSTALL_STATE\[80\]=2' /DietPi/dietpi/.installed; then + + sed -i 's/aSOFTWARE_INSTALL_STATE\[80\]=2/aSOFTWARE_INSTALL_STATE\[80\]=0/' /DietPi/dietpi/.installed + sed -i 's/aSOFTWARE_INSTALL_STATE\[82\]=0/aSOFTWARE_INSTALL_STATE\[82\]=2/' /DietPi/dietpi/.installed + + fi + fi #------------------------------------------------------------------------------- #Reinstalls | Moved from v159 From 1611ee6b787f07ad475bfa3375573db3ae6f6e8a Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 15 Dec 2017 02:11:11 +0000 Subject: [PATCH 028/390] v160 + DietPi-Software | Resolved an issue where MariaDB would fail to uninstall correctly: https://github.com/Fourdee/DietPi/pull/1280 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ad6dc5212e..fc3186ef61 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -12,6 +12,7 @@ DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi DietPi-Software | WiFi Hotspot (Stretch): Resolved an issue where hostapd would fail to run due to missing libssl1.0.0 lib, not available in repos: https://github.com/Fourdee/DietPi/issues/1299 DietPi-Software | Shairport-sync (Stretch): Resolved an issue where this would fail to install, due to pre-req URLS becomming invalid: https://github.com/Fourdee/DietPi/issues/1303 DietPi-Software | Plex Media Server: Resolved uninstall to include /var/lib/plexmediaserver in removal (which is not completed via apt purge). +DietPi-Software | Resolved an issue where MariaDB would fail to uninstall correctly: https://github.com/Fourdee/DietPi/pull/1280 DietPi-Update | dietpi.txt is now checked for missing entries, and, will now be patched during the update: https://github.com/Fourdee/DietPi/issues/1292#issuecomment-350818969 Sparky SBC | Kernel patch will be applied which resolves issues with HQPlayer playback: https://www.computeraudiophile.com/forums/topic/32132-allo-sparky-usbridge/?do=findComment&comment=753100 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index bd7364402f..53dd655439 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -13297,7 +13297,7 @@ _EOF_ AGP lighttpd - elif (( $1 == 86 || $i == 88 )); then + elif (( $1 == 86 || $1 == 88 )); then AGP mysql-server mysql-client From d01b1515c3000752fb8b77990111832fd5189a34 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 15 Dec 2017 03:13:41 +0000 Subject: [PATCH 029/390] v160 Tweaks based on @MichaIng feedback: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351888843 --- PREP_SYSTEM_FOR_DIETPI.sh | 72 +++++++++++++-------------------------- 1 file changed, 24 insertions(+), 48 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 3c777fef85..17263be0b6 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -303,13 +303,12 @@ WHIP_TITLE='Distro Selection:' WHIP_DESC='Please select a distro to install on this system. Selecting a distro that is older than the current installed on system, is not supported.' WHIP_DEFAULT_ITEM=4 - WHIP_MENU_ARRAY=( + WHIP_MENU_ARRAY=('4' 'stretch (recommended)') + if (( $HW_MODEL >= 10 )); then - '3' 'jessie' - '4' 'stretch (Recommended)' - #'5' 'buster' #Disabled: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351600497 + WHIP_MENU_ARRAY+=('5' 'buster (testing only, not officially suppoted)') - ) + fi Run_Whiptail DISTRO=$WHIP_RETURN_VALUE @@ -411,96 +410,59 @@ _EOF_ # dpkg --get-selections | awk '{print $1}' | sed 's/:armhf//g' | sed "s/^/'/g" | sed "s/$/'/g" aPACKAGES_REQUIRED_INSTALL=( - 'acl' 'adduser' 'apt' 'apt-transport-https' 'apt-utils' 'base-files' - 'base-passwd' 'bash' 'bash-completion' 'bc' - 'bsdmainutils' 'bsdutils' 'bzip2' 'ca-certificates' - 'console-common' - 'console-data' 'console-setup' - 'console-setup-linux' - 'coreutils' 'cpio' 'crda' 'cron' 'curl' - 'dash' 'dbus' 'debconf' - 'debian-archive-keyring' 'debianutils' - 'diffutils' - 'dmidecode' - 'dmsetup' - 'dosfstools' + 'dosfstools' # DietPi-Drive_Manager 'dphys-swapfile' 'dpkg' - 'e2fslibs' - 'e2fsprogs' 'ethtool' 'fake-hwclock' 'fbset' - 'findutils' 'firmware-atheros' 'firmware-brcm80211' 'firmware-ralink' 'firmware-realtek' - 'firmware-misc-nonfree' 'fuse' - 'gnupg' 'gpgv' 'grep' - 'groff-base' 'gzip' 'hdparm' 'hfsplus' 'hostname' 'htop' 'ifupdown' - 'init' - 'init-system-helpers' 'initramfs-tools' - 'initscripts' - 'insserv' - 'iproute2' 'iputils-ping' 'isc-dhcp-client' - 'isc-dhcp-common' 'iw' - 'kbd' - 'keyboard-configuration' - 'klibc-utils' - 'kmod' - 'less' 'locales' - 'login' - 'lsb-base' 'mawk' - 'mount' - 'multiarch-support' 'nano' - 'ncurses-base' - 'ncurses-bin' 'net-tools' 'ntfs-3g' 'ntp' 'p7zip-full' 'parted' 'passwd' - 'perl-base' 'procps' 'psmisc' - 'readline-common' 'resolvconf' 'rfkill' #Used by some onboard WiFi chipsets 'rsync' #dietpi-backup @@ -510,7 +472,6 @@ _EOF_ 'sudo' 'systemd' 'systemd-sysv' - 'sysvinit-utils' 'tar' 'tzdata' 'udev' @@ -519,7 +480,6 @@ _EOF_ 'util-linux' 'wget' 'whiptail' - 'wireless-regdb' 'wireless-tools' 'wpasupplicant' 'wput' @@ -527,6 +487,19 @@ _EOF_ ) + # - Keyring specific: + # Raspbian + if (( $HW_MODEL < 10 )); then + + aPACKAGES_REQUIRED_INSTALL+=('raspbian-archive-keyring') + + # Debian + else + + aPACKAGES_REQUIRED_INSTALL+=('debian-archive-keyring') + + fi + # - HW_ARCH specific required packages # x86_64 if (( $HW_ARCH == 10 )); then @@ -535,7 +508,9 @@ _EOF_ aPACKAGES_REQUIRED_INSTALL+=('intel-microcode') aPACKAGES_REQUIRED_INSTALL+=('amd64-microcode') aPACKAGES_REQUIRED_INSTALL+=('firmware-linux-nonfree') + aPACKAGES_REQUIRED_INSTALL+=('firmware-misc-nonfree') aPACKAGES_REQUIRED_INSTALL+=('grub-efi-amd64') + #aPACKAGES_REQUIRED_INSTALL+=('dmidecode') fi @@ -548,7 +523,6 @@ _EOF_ aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-bootloader') aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-kernel') aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-sys-mods') - aPACKAGES_REQUIRED_INSTALL+=('raspbian-archive-keyring') aPACKAGES_REQUIRED_INSTALL+=('raspi-copies-and-fills') # Odroid C2 @@ -594,16 +568,18 @@ _EOF_ # - delete[] unset aPACKAGES_REQUIRED_INSTALL - dietpi-notify 2 "Marking required DietPi packages and manually installed:" + dietpi-notify 2 "Marking required packages as manually installed:" apt-mark manual $INSTALL_PACKAGES Error_Check dietpi-notify 2 "Purging APT with autoremoval:" - apt-get autoremove --purge -y + apt-get autoremove --purge #-y Error_Check + exit + #------------------------------------------------------------------------------------------------ dietpi-notify 0 'Step 5: APT Installations:' From d3c56cc80a68628e49c144b45faa059d03bbede4 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 15 Dec 2017 03:51:21 +0000 Subject: [PATCH 030/390] v160 + Remove debug --- PREP_SYSTEM_FOR_DIETPI.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 17263be0b6..80b80c246a 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -575,11 +575,9 @@ _EOF_ dietpi-notify 2 "Purging APT with autoremoval:" - apt-get autoremove --purge #-y + apt-get autoremove --purge -y Error_Check - exit - #------------------------------------------------------------------------------------------------ dietpi-notify 0 'Step 5: APT Installations:' From 70a0ab2306a0ad7ce1d418add60ba66f3060715a Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 15 Dec 2017 04:18:54 +0000 Subject: [PATCH 031/390] v160 + Resolve dietpi-drive_manager fstab generation. + Revert rsync back to install on demand: https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 1 - dietpi/dietpi-drive_manager | 14 +++++++++++--- dietpi/finalise | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 80b80c246a..40de77f9c3 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -465,7 +465,6 @@ _EOF_ 'psmisc' 'resolvconf' 'rfkill' #Used by some onboard WiFi chipsets - 'rsync' #dietpi-backup 'sed' 'sensible-utils' 'startpar' diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 53ee2df7d6..88d954bda8 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -204,17 +204,25 @@ elif [ -n "${aDRIVE_UUID[$i]}" ]; then #Ignore master partition tables / drives with no UUID # create one - local fp_target="/mnt/${aDRIVE_UUID[$i]}" + aDRIVE_MOUNT_TARGET[$i]="/mnt/${aDRIVE_UUID[$i]}" /DietPi/dietpi/func/dietpi-notify 2 "Creating UUID fstab entry: ${aDRIVE_MOUNT_SOURCE[$i]}" + # Check if the drive is already mounted (but not set in fstab) and use existing mount target + if (( $(df -P | grep -ci -m1 "${aDRIVE_MOUNT_SOURCE[$i]}") )); then + + aDRIVE_MOUNT_TARGET[$i]=$(df -P | grep -m1 "${aDRIVE_MOUNT_SOURCE[$i]}" | awk '{print $NF}') + /DietPi/dietpi/func/dietpi-notify 2 " - Drive is currently mounted, using existing mount location: ${aDRIVE_MOUNT_TARGET[$i]}" + + fi + + # remove any previous/disabled entries for drive sed -i "\@^${aDRIVE_MOUNT_SOURCE[$i]}[[:space:]]@d" "$FP_TEMP_FSTAB" sed -i "\@^UUID=${aDRIVE_UUID[$i]}[[:space:]]@d" "$FP_TEMP_FSTAB" - echo -e "UUID=${aDRIVE_UUID[$i]} $fp_target auto defaults,noatime,nofail,x-systemd.automount 0 0" >> "$FP_TEMP_FSTAB" + echo -e "UUID=${aDRIVE_UUID[$i]} ${aDRIVE_MOUNT_TARGET[$i]} auto defaults,noatime,nofail,x-systemd.automount 0 0" >> "$FP_TEMP_FSTAB" - aDRIVE_MOUNT_TARGET[$i]="$fp_target" aDRIVE_ISAVAILABLE[$i]=1 aDRIVE_ISUUIDMOUNT[$i]=1 diff --git a/dietpi/finalise b/dietpi/finalise index 4e5bcd4d8c..f999927f02 100644 --- a/dietpi/finalise +++ b/dietpi/finalise @@ -46,7 +46,7 @@ #------------------------------------------------------------------------------------------------ # Clean Apt + cache #Remove packages - apt-get purge openssh-client openssh-server alsa-utils stress -y + apt-get purge openssh-client openssh-server alsa-utils rsync stress -y # + rpi apt-get purge -y rpi-update From e79fc42fd66a2b1959b9e4d0d202bf73871b0736 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 15 Dec 2017 06:12:07 +0000 Subject: [PATCH 032/390] v160 https://github.com/Fourdee/DietPi/issues/1285 + Check for existing DietPi installs and prep it + Merged Finalize into PREP + Fix for RPi drive_manager 4 --- PREP_SYSTEM_FOR_DIETPI.sh | 291 ++++++++++++++++++++++---- dietpi/dietpi-drive_manager | 15 +- dietpi/finalise | 358 -------------------------------- dietpi/func/dietpi-set_software | 13 +- 4 files changed, 272 insertions(+), 405 deletions(-) delete mode 100644 dietpi/finalise diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 40de77f9c3..8d7a82593b 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -224,6 +224,39 @@ #------------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------------ + #------------------------------------------------------------------------------------------------ + dietpi-notify 0 'Step 0: Detecting existing DietPi system:' + #------------------------------------------------------------------------------------------------ + if [ -f /DietPi/dietpi/.installed ]; then + + dietpi-notify 2 'DietPi system found, running pre-prep' + + # - Stop services + /DietPi/dietpi/dietpi-services stop + /DietPi/dietpi/dietpi-services dietpi_controlled + + systemctl stop dietpi-ramlog + Error_Check + systemctl stop dietpi-ramdisk + Error_Check + + # - Delete any previous exsiting data + rm -R /mnt/dietpi-backup &> /dev/null + rm -R /mnt/dietpi-sync &> /dev/null + rm -R /mnt/dietpi_userdata &> /dev/null + + rm -R /etc/dietpi/logs &> /dev/null + rm /root/DietPi-Automation.log &> /dev/null + + rm /boot/Automation_Format_My_Usb_Drive &> /dev/null + + else + + dietpi-notify 2 'Non-DietPi system' + + fi + + #------------------------------------------------------------------------------------------------ dietpi-notify 0 'Step 1: Initial prep to allow this script to function:' #------------------------------------------------------------------------------------------------ @@ -296,6 +329,8 @@ dietpi-notify 2 "Setting HW_MODEL index of: $HW_MODEL" dietpi-notify 2 "CPU ARCH = $HW_ARCH : $HW_ARCH_DESCRIPTION" + echo -e "$HW_MODEL" > /etc/.dietpi_hw_model_identifier + #------------------------------------------------------------------------------------------------ dietpi-notify 0 'Step 3: Distro selection / APT prep:' #------------------------------------------------------------------------------------------------ @@ -335,36 +370,7 @@ dietpi-notify 2 "Setting APT sources.list: $DISTRO_NAME $DISTRO" - if (( $HW_MODEL < 10 )); then - - cat << _EOF_ > /etc/apt/sources.list -deb https://www.mirrorservice.org/sites/archive.raspbian.org/raspbian $DISTRO_NAME main contrib non-free rpi -_EOF_ - - cat << _EOF_ > /etc/apt/sources.list.d/raspi.list -deb https://archive.raspberrypi.org/debian/ $DISTRO_NAME main ui -_EOF_ - - else - - cat << _EOF_ > /etc/apt/sources.list -deb http://ftp.debian.org/debian/ $DISTRO_NAME main contrib non-free -deb http://ftp.debian.org/debian/ $DISTRO_NAME-updates main contrib non-free -deb http://security.debian.org $DISTRO_NAME/updates main contrib non-free -deb http://ftp.debian.org/debian/ $DISTRO_NAME-backports main contrib non-free -_EOF_ - - fi - Error_Check - - # Buster, remove backports: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 - if (( $DISTRO == 5 )); then - - sed -i '/backports/d' /etc/apt/sources.list - - fi - - #NB: Apt mirror will get overwritten by: /DietPi/dietpi/func/dietpi-set_software apt-mirror default : during finalize. + /DietPi/dietpi/func/dietpi-set_software apt-mirror default # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files dietpi-notify 2 "Marking all packages as auto installed first, to allow allow effective autoremove afterwards" @@ -694,7 +700,6 @@ _EOF_ Error_Check fi - rm DietPi-*/*.ini cp -R DietPi-*/* /boot/ @@ -724,11 +729,31 @@ _EOF_ userdel -f dietpi &> /dev/null userdel -f debian &> /dev/null #BBB - dietpi-notify 2 "Removing misc files/folders, not required by DietPi" + dietpi-notify 2 "Removing misc files/folders/services, not required by DietPi" rm -R /home &> /dev/null rm -R /media &> /dev/null + rm -R /selinux &> /dev/null + + # - sourcecode (linux-headers etc) + rm -R /usr/src/* &> /dev/null + + # - root + rm -R /root/.cache/* &> /dev/null + rm -R /root/.local/* &> /dev/null + rm -R /root/.config/* &> /dev/null + + # - documentation folders + rm -R /usr/share/man &> /dev/null + rm -R /usr/share/doc &> /dev/null + rm -R /usr/share/doc-base &> /dev/null + rm -R /usr/share/calendar &> /dev/null + + # - Previous debconfs + rm /var/cache/debconf/*-old &> /dev/null + + # - Fonts rm -R /usr/share/fonts/* &> /dev/null rm -R /usr/share/icons/* &> /dev/null @@ -750,11 +775,11 @@ _EOF_ rm /etc/init.d/cpu_governor &> /dev/null# Meveric rm /etc/systemd/system/cpu_governor.service &> /dev/null# Meveric - # -Disable ARMbian's resize service (not automatically removed by ARMbian scripts...) + # - Disable ARMbian's resize service (not automatically removed by ARMbian scripts...) systemctl disable resize2fs &> /dev/null rm /etc/systemd/system/resize2fs.service &> /dev/null - # -ARMbian-config + # - ARMbian-config rm /etc/profile.d/check_first_login_reboot.sh &> /dev/null dietpi-notify 2 "Setting UID bit for sudo" @@ -765,11 +790,10 @@ _EOF_ dietpi-notify 2 "Creating DietPi system directories" - # - Create DietPi common folders mkdir -p /DietPi Error_Check - mkdir -p /etc/dietpi + mkdir -p /etc/dietpi/logs Error_Check mkdir -p /mnt/dietpi_userdata @@ -784,9 +808,9 @@ _EOF_ mkdir -p /mnt/nfs_client Error_Check - echo -e "Samba client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking WHIP_OPTIONs: NAS/Misc menu" > /mnt/samba/readme.txt - echo -e "FTP client mount can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking WHIP_OPTIONs: NAS/Misc menu" > /mnt/ftp_client/readme.txt - echo -e "NFS client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking WHIP_OPTIONs: NAS/Misc menu" > /mnt/nfs_client/readme.txt + echo -e "Samba client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking option: NAS/Misc menu" > /mnt/samba/readme.txt + echo -e "FTP client mount can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking option: NAS/Misc menu" > /mnt/ftp_client/readme.txt + echo -e "NFS client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking option: NAS/Misc menu" > /mnt/nfs_client/readme.txt dietpi-notify 2 "Deleting all log files /var/log" @@ -797,6 +821,20 @@ _EOF_ /boot/dietpi/dietpi-drive_manager 4 Error_Check + # - HW Specific: + # RPi requires PARTUUID for USB write: https://github.com/Fourdee/DietPi/issues/970 + if (( $HW_MODEL < 10 )); then + + PARTUUID_CURRENT=$(blkid /dev/mmcblk0p1 -s PARTUUID -o value) + sed -i "s#^/dev/mmcblk0p1#PARTUUID=$PARTUUID_CURRENT#g" /etc/fstab + + PARTUUID_CURRENT=$(blkid /dev/mmcblk0p2 -s PARTUUID -o value) + sed -i "s#^/dev/mmcblk0p2#PARTUUID=$PARTUUID_CURRENT#g" /etc/fstab + + systemctl daemon-reload + + fi + dietpi-notify 2 "Installing and starting DietPi-RAMdisk service" cat << _EOF_ > /etc/systemd/system/dietpi-ramdisk.service @@ -863,6 +901,10 @@ _EOF_ systemctl enable dietpi-boot.service systemctl daemon-reload + dietpi-notify 2 'Updating DietPi globals' + + /DietPi/dietpi/dietpi-obtain_hw_model + dietpi-notify 2 "Installing DietPi /etc/rc.local service" update-rc.d -f rc.local remove &> /dev/null @@ -974,8 +1016,19 @@ _EOF_ cp /boot/dietpi/conf/network_interfaces /etc/network/interfaces /DietPi/dietpi/func/obtain_network_details Error_Check + # - enable allow-hotplug eth0 after copying. sed -i "/allow-hotplug eth/c\allow-hotplug eth$(sed -n 1p /DietPi/dietpi/.network)" /etc/network/interfaces + # - Remove all predefined eth*/wlan* adapter rules + rm /etc/udev/rules.d/70-persistent-net.rules &> /dev/null + rm /etc/udev/rules.d/70-persistant-net.rules &> /dev/null + + # - Add pre-up lines for wifi on OrangePi Zero + if (( $HW_MODEL == 32 )); then + + sed -i '/iface wlan0 inet dhcp/apre-up modprobe xradio_wlan\npre-up iwconfig wlan0 power on' /etc/network/interfaces + + fi dietpi-notify 2 "Tweaking DHCP timeout:" @@ -1019,11 +1072,9 @@ _EOF_ dietpi-notify 2 "Configuring htop:" - # NB: Also done in finalize mkdir -p /root/.config/htop cp /DietPi/dietpi/conf/htoprc /root/.config/htop/htoprc - dietpi-notify 2 "Configuring hdparm:" cat << _EOF_ >> /etc/hdparm.conf @@ -1212,8 +1263,162 @@ _EOF_ dietpi-notify 0 "Step 8: Finalise system for first run of DietPi:" #------------------------------------------------------------------------------------------------ - #Finalise system - /DietPi/dietpi/finalise + dietpi-notify 2 'Configuring Services' + + /DietPi/dietpi/dietpi-services stop + /DietPi/dietpi/dietpi-services dietpi_controlled + + dietpi-notify 2 'Installing Dropbear by default' + + AGI dropbear + # set to start on next boot + sed -i '/NO_START=1/c\NO_START=0' /etc/default/dropbear + + dietpi-notify 2 'Clearing APT cache' + + apt-get clean + rm -R /var/lib/apt/lists/* -vf #lists cache: remove partial folder also, automatically gets regenerated on apt-get update + #rm /var/lib/dpkg/info/* #issue... + #dpkg: warning: files list file for package 'libdbus-1-3:armhf' missing; assuming package has no files currently installed + + dietpi-notify 2 'Running general cleanup of misc files' + + # - general folders + rm -R /tmp/* &> /dev/null + + # - Remove Bash History file + rm ~/.bash_history &> /dev/null + + # - Nano histroy file + rm ~/.nano_history &> /dev/null + + dietpi-notify 2 'Disabling swapfile' + + /DietPi/dietpi/func/dietpi-set_dphys-swapfile 0 /var/swap + # - Reset config + echo -e "CONF_SWAPSIZE=0" > /etc/dphys-swapfile + echo -e "CONF_SWAPFILE=/var/swap" >> /etc/dphys-swapfile + + # BBB disable swapfile gen + if (( $HW_MODEL == 71 )); then + + sed -i '/Swapfile_Size=/c\Swapfile_Size=0' /DietPi/dietpi.txt + + fi + + dietpi-notify 2 'Resetting boot.ini, config.txt, cmdline.txt etc' + + # - PineA64 - delete ethaddr from uEnv.txt file + if (( $HW_MODEL >= 40 && $HW_MODEL <= 42 )); then + + sed -i '/^ethaddr/ d' /boot/uEnv.txt + + fi + + # - Set Pi cmdline.txt back to normal + sed -i "s/ rootdelay=10//g" /boot/cmdline.txt + + dietpi-notify 2 'Generating default wpa_supplicant.conf' + + /DietPi/dietpi/func/dietpi-set_hardware wificreds set + + dietpi-notify 2 'Disabling generic WiFi/BT by default' + + /DietPi/dietpi/func/dietpi-set_hardware bluetooth disable + /DietPi/dietpi/func/dietpi-set_hardware wifimodules disable + + dietpi-notify 2 'Enabling onboard WiFi modules by default' + + /DietPi/dietpi/func/dietpi-set_hardware wifimodules onboard_enable + + dietpi-notify 2 'Configuring IP version preferences' + + /DietPi/dietpi/func/dietpi-set_hardware preferipversion auto + + dietpi-notify 2 'Configuring kernels' + + # - Disable installed flags + rm /etc/dietpi/.* + + # - RPi install DietPi kernel by default + if (( $HW_MODEL < 10 )); then + + /DietPi/dietpi/func/dietpi-set_hardware kernel dietpi_rpi + + fi + + dietpi-notify 2 'Disabling soundcards by default' + + /DietPi/dietpi/func/dietpi-set_hardware soundcard none + + dietpi-notify 2 'Setting default CPU gov' + + /DietPi/dietpi/dietpi-cpu_set + + dietpi-notify 2 'Clearing log files' + + /DietPi/dietpi/dietpi-logclear 2 + + dietpi-notify 2 'Deleting DietPi-RAMlog storage' + + rm -R /etc/dietpi/dietpi-ramlog/storage &> /dev/null + + dietpi-notify 2 'Deleting NTP drift file' + + rm /var/lib/ntp/ntp.drift &> /dev/null + + dietpi-notify 2 'Creating DietPi default user' + + /DietPi/dietpi/func/dietpi-set_software useradd dietpi + + dietpi-notify 2 'Resetting DietPi generated globals/files' + + rm /DietPi/dietpi/.* + + dietpi-notify 2 'Storing current image version /etc/.dietpi_image_version' + + echo -e "$IMAGE_VERSION" > /etc/.dietpi_image_version + + dietpi-notify 2 'Setting DietPi-Autostart to console' + + echo 0 > /DietPi/dietpi/.dietpi-autostart_index + + dietpi-notify 2 'Creating our update file (used on 1st run to check for DietPi updates)' + + echo -1 > /DietPi/dietpi/.update_stage + + dietpi-notify 2 'Set Init .install_stage to -3 (first boot)' + + echo -3 > /DietPi/dietpi/.install_stage + + # BBB skip FS_partition + if (( $HW_MODEL == 71 )); then + + echo -2 > /DietPi/dietpi/.install_stage + + fi + + dietpi-notify 2 'Remove server_version / patch_file (downloads fresh from dietpi-update)' + + rm /DietPi/dietpi/patch_file + rm /DietPi/dietpi/server_version + + # - HW Specific + # RPi remove saved HW_MODEL , allowing obtain-hw_model to auto detect RPi model + if (( $HW_MODEL < 10 )); then + + rm /etc/.dietpi_hw_model_identifier + + fi + + #TRIM root FS + sync + fstrim -v / + sync + + dietpi-notify 2 'Please check and delete all non-required folders in /root/.xxxxxx' + dietpi-notify 2 'Please delete outdated modules' + ls -lha /lib/modules dietpi-notify 0 "Completed, disk can now be saved to .img for later use, or, reboot system to start first run of DietPi:" diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 88d954bda8..1e28e810d9 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -209,13 +209,23 @@ /DietPi/dietpi/func/dietpi-notify 2 "Creating UUID fstab entry: ${aDRIVE_MOUNT_SOURCE[$i]}" # Check if the drive is already mounted (but not set in fstab) and use existing mount target - if (( $(df -P | grep -ci -m1 "${aDRIVE_MOUNT_SOURCE[$i]}") )); then + if (( $(df -P | grep -ci -m1 "${aDRIVE_MOUNT_SOURCE[$i]}[[:space:]]") )); then - aDRIVE_MOUNT_TARGET[$i]=$(df -P | grep -m1 "${aDRIVE_MOUNT_SOURCE[$i]}" | awk '{print $NF}') /DietPi/dietpi/func/dietpi-notify 2 " - Drive is currently mounted, using existing mount location: ${aDRIVE_MOUNT_TARGET[$i]}" + aDRIVE_MOUNT_TARGET[$i]=$(df -P | grep -m1 "${aDRIVE_MOUNT_SOURCE[$i]}[[:space:]]" | awk '{print $NF}') + fi + # - NB: RPi, rootFS source is reported as /dev/root in df, hard code for it + if (( $HW_MODEL < 10 )) && + [ "${aDRIVE_MOUNT_SOURCE[$i]}" = '/dev/mmcblk0p2' ]; then + + aDRIVE_MOUNT_TARGET[$i]='/' + + /DietPi/dietpi/func/dietpi-notify 2 " - Drive is currently mounted, using existing mount location: ${aDRIVE_MOUNT_TARGET[$i]}" + + fi # remove any previous/disabled entries for drive sed -i "\@^${aDRIVE_MOUNT_SOURCE[$i]}[[:space:]]@d" "$FP_TEMP_FSTAB" @@ -223,7 +233,6 @@ echo -e "UUID=${aDRIVE_UUID[$i]} ${aDRIVE_MOUNT_TARGET[$i]} auto defaults,noatime,nofail,x-systemd.automount 0 0" >> "$FP_TEMP_FSTAB" - aDRIVE_ISAVAILABLE[$i]=1 aDRIVE_ISUUIDMOUNT[$i]=1 diff --git a/dietpi/finalise b/dietpi/finalise deleted file mode 100644 index f999927f02..0000000000 --- a/dietpi/finalise +++ /dev/null @@ -1,358 +0,0 @@ -#!/bin/bash -{ - #------------------------------------------------------------------------------------------------ - # DietPi Finalise - # - #------------------------------------------------------------------------------------------------ - # Created by Daniel Knight / daniel.knight@dietpi.com / dietpi.com - # - #------------------------------------------------------------------------------------------------ - # - # Info: - # - Preps the system for saving an image file, and, setting up for 1st use. - # NB: Use of this script will drop WiFi connections, use ETH only. - #------------------------------------------------------------------------------------------------ - - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - - #Use version of master branch - wget https://raw.githubusercontent.com/Fourdee/DietPi/master/dietpi/.version -O /tmp/masterversion - IMAGE_VERSION=$(cat /tmp/masterversion) - - #------------------------------------------------------------------------------------------------ - #Obtain Pi/Odroid Model - #------------------------------------------------------------------------------------------------ - - /DietPi/dietpi/dietpi-obtain_hw_model - - HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) - DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) - - #------------------------------------------------------------------------------------------------ - #Stop services - /DietPi/dietpi/dietpi-services stop - - #Disable services - /DietPi/dietpi/dietpi-services dietpi_controlled - - #------------------------------------------------------------------------------------------------ - #Unmount Drives - umount /dev/sda[1-9] - - #------------------------------------------------------------------------------------------------ - # Clean Apt + cache - #Remove packages - apt-get purge openssh-client openssh-server alsa-utils rsync stress -y - # + rpi - apt-get purge -y rpi-update - - apt-get autoremove -y --purge - - #Install dropbear - apt-get install -y dropbear - # - set to start on next boot - sed -i '/NO_START=1/c\NO_START=0' /etc/default/dropbear - - - #Clear cache - apt-get clean - rm -R /var/lib/apt/lists/* -vf #lists cache: remove partial folder also, automatically gets regenerated on apt-get update - #rm /var/lib/dpkg/info/* #issue... - #dpkg: warning: files list file for package 'libdbus-1-3:armhf' missing; assuming package has no files currently installed - - # - Set default apt mirrors - /DietPi/dietpi/func/dietpi-set_software apt-mirror default - - # - Clear deb-multimedia (meveric's images, seems to be pulled in via his kernel package updates) - rm /etc/apt/sources.list.d/deb-multimedia.list - - #------------------------------------------------------------------------------------------------ - #Sudo UID bit: https://github.com/Fourdee/DietPi/issues/794 - chmod 4755 /usr/bin/sudo - - #------------------------------------------------------------------------------------------------ - #Delete/Cleanup - # - general folders - rm -R /media - rm -R /tmp/* - rm -R /selinux - # + sourcecode (linux-headers etc) - rm -R /usr/src/* - - # - root - rm -R /root/.cache/* - rm -R /root/.local/* - rm -R /root/.config/* - # + Reapply htop config - mkdir -p /root/.config/htop - cp /boot/dietpi/conf/htoprc /root/.config/htop/htoprc - - # - documentation folders - rm -R /usr/share/man - rm -R /usr/share/doc - rm -R /usr/share/doc-base - rm -R /usr/share/calendar - - # - Remove Bash History file - rm ~/.bash_history - - # - Nano histroy file - rm ~/.nano_history - - rm /var/cache/debconf/*-old - - #------------------------------------------------------------------------------------------------ - #Disable/Remove Swapfile (saves 100mb in final image) - /DietPi/dietpi/func/dietpi-set_dphys-swapfile 0 /var/swap - # - Reset config - echo -e "CONF_SWAPSIZE=0" > /etc/dphys-swapfile - echo -e "CONF_SWAPFILE=/var/swap" >> /etc/dphys-swapfile - - #------------------------------------------------------------------------------------------------ - # Disable Autologin/Autostart - rm /etc/systemd/system/getty@tty1.service.d/autologin.conf - - #------------------------------------------------------------------------------------------------ - #Reset FSTAB - /DietPi/dietpi/dietpi-drive_manager 4 - - # RPi requires PARTUUID for USB write: https://github.com/Fourdee/DietPi/issues/970 - if (( $HW_MODEL < 10 )); then - - PARTUUID_CURRENT=$(blkid /dev/mmcblk0p1 -s PARTUUID -o value) - sed -i "s#^/dev/mmcblk0p1#PARTUUID=$PARTUUID_CURRENT#g" /etc/fstab - - PARTUUID_CURRENT=$(blkid /dev/mmcblk0p2 -s PARTUUID -o value) - sed -i "s#^/dev/mmcblk0p2#PARTUUID=$PARTUUID_CURRENT#g" /etc/fstab - - fi - - #------------------------------------------------------------------------------------------------ - # Reset cmdline.txt / boot.ini / dietpi.txt - #Set Pi Config.txt back to normal - wget https://raw.githubusercontent.com/Fourdee/DietPi/testing/config.txt -O /DietPi/config.txt - - /DietPi/dietpi/func/dietpi-set_hardware i2c disable - - sed -i "/temp_limit=/c\temp_limit=65" /DietPi/config.txt - - - # ODROID's - Set boot.ini back to normal - if (( $HW_MODEL == 10 )); then - - wget https://raw.githubusercontent.com/Fourdee/DietPi/testing/boot_c1.ini -O /DietPi/boot.ini - - elif (( $HW_MODEL == 11 )); then - - wget https://raw.githubusercontent.com/Fourdee/DietPi/testing/boot_xu4.ini -O /DietPi/boot.ini - - elif (( $HW_MODEL == 12 )); then - - wget https://raw.githubusercontent.com/Fourdee/DietPi/testing/boot_c2.ini -O /DietPi/boot.ini - - fi - - systemctl mask cpu_governor #Meveric's images - - # PineA64 - delete ethaddr from uEnv.txt file - if (( $HW_MODEL >= 40 && $HW_MODEL <= 42 )); then - - sed -i '/^ethaddr/ d' /boot/uEnv.txt - - fi - - #Set dietpi.txt back to normal - wget https://raw.githubusercontent.com/Fourdee/DietPi/testing/dietpi.txt -O /DietPi/dietpi.txt - - #BBB disable swapfile gen - if (( $HW_MODEL == 71 )); then - - sed -i '/Swapfile_Size=/c\Swapfile_Size=0' /DietPi/dietpi.txt - - fi - - # Update README.MD - wget https://raw.githubusercontent.com/Fourdee/DietPi/testing/README.md -O /boot/README.md - - # Set Pi cmdline.txt back to normal - # - Remove root delay - sed -i "s/ rootdelay=10//g" /boot/cmdline.txt - - #------------------------------------------------------------------------------------------------ - #Reset Networking - /DietPi/dietpi/func/dietpi-set_hardware wifimodules enable # Must be enabled to set. - /DietPi/dietpi/func/dietpi-set_hardware wificountrycode GB - iw reg get - - #Copy Network Interface conf - cp /DietPi/dietpi/conf/network_interfaces /etc/network/interfaces - # Generate stock wpa_supplicant.conf - /DietPi/dietpi/func/dietpi-set_hardware wificreds set - - #Add pre-up lines for wifi on OrangePi Zero - if (( $HW_MODEL == 32 )); then - - sed -i '/iface wlan0 inet dhcp/apre-up modprobe xradio_wlan\npre-up iwconfig wlan0 power on' /etc/network/interfaces - - fi - - # Remove all predefined eth*/wlan* adapter rules - rm /etc/udev/rules.d/70-persistent-net.rules - rm /etc/udev/rules.d/70-persistant-net.rules - - # Disable wifi and bluetooth modules on all devices. - /DietPi/dietpi/func/dietpi-set_hardware bluetooth disable - /DietPi/dietpi/func/dietpi-set_hardware wifimodules disable - - # Enable onboard WiFi chips by default (removes them from blacklist) - /DietPi/dietpi/func/dietpi-set_hardware wifimodules onboard_enable - - # Disable forced eth speed if set - /DietPi/dietpi/func/dietpi-set_hardware eth-forcespeed disable - - # Reset IP version pref - /DietPi/dietpi/func/dietpi-set_hardware preferipversion auto - - #Set Hostname - cat << _EOF_ > /etc/hosts -127.0.0.1 localhost -127.0.1.1 DietPi -_EOF_ - - cat << _EOF_ > /etc/hostname -DietPi -_EOF_ - - - #------------------------------------------------------------------------------------------------ - #Htop cfg - mkdir -p /root/.config/htop - cp /DietPi/dietpi/conf/htoprc /root/.config/htop/htoprc - - #------------------------------------------------------------------------------------------------ - #Kernel - # - Disable installed flags - rm /etc/dietpi/.* - - # - RPi install DietPi kernel by default - if (( $HW_MODEL < 10 )); then - - /DietPi/dietpi/func/dietpi-set_hardware kernel dietpi_rpi - - fi - - #------------------------------------------------------------------------------------------------ - #Disable serial console - /DietPi/dietpi/func/dietpi-set_hardware serialconsole disable - - #------------------------------------------------------------------------------------------------ - #Disable soundcards - /DietPi/dietpi/func/dietpi-set_hardware soundcard none - - #------------------------------------------------------------------------------------------------ - #Set CPU govs - /DietPi/dietpi/dietpi-cpu_set - - #------------------------------------------------------------------------------------------------ - #Logs/Automation - /DietPi/dietpi/dietpi-logclear 2 - - # Clear DietPi-Ramlog storage - rm -R /etc/dietpi/dietpi-ramlog/storage - - # DietPi logs, excluded from /var/log (due to ramlog clear) - rm -R /etc/dietpi/logs - - # ntp delete drift file - rm /var/lib/ntp/ntp.drift - - # DietPi-Automation - rm /root/DietPi-Automation.log - rm /boot/Automation_Format_My_Usb_Drive - - #------------------------------------------------------------------------------------------------ - #Create DietPi user: https://github.com/Fourdee/DietPi/issues/796 - /DietPi/dietpi/func/dietpi-set_software useradd dietpi - - #------------------------------------------------------------------------------------------------ - # Reset DietPi generated files - rm /DietPi/dietpi/.* - - echo -e "$IMAGE_VERSION" > /DietPi/dietpi/.version - echo -e "$IMAGE_VERSION" > /etc/.dietpi_image_version - - # .dietpi-autostart_index Console - echo 0 > /DietPi/dietpi/.dietpi-autostart_index - - # Create our update file (used on 1st run to check for DietPi updates) - echo -1 > /DietPi/dietpi/.update_stage - - # Set Init .install_stage to -3 (first boot) - echo -3 > /DietPi/dietpi/.install_stage - - # BBB skip FS_partition - if (( $HW_MODEL == 71 )); then - - echo -2 > /DietPi/dietpi/.install_stage - - fi - - # Remove server_version / patch_file (downloads fresh from dietpi-update) - rm /DietPi/dietpi/patch_file - rm /DietPi/dietpi/server_version - - #------------------------------------------------------------------------------------------------ - #setup DietPi specific mount folders - rm -R /mnt/dietpi-backup - rm -R /mnt/dietpi-sync - rm -R /mnt/dietpi_userdata - - mkdir -p /mnt/dietpi_userdata - mkdir -p /etc/dietpi/logs - - #unmount - umount /mnt/samba - if (( ! $(df | grep -ci -m1 '/mnt/samba') )); then - - rm -R /mnt/samba - mkdir -p /mnt/samba - echo -e "Samba client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config" > /mnt/samba/readme.txt - - else - - echo -e "\nWARN: samba is mounted, please unmount and run this script again." - - fi - - umount /mnt/ftp_client - if (( ! $(df | grep -ci -m1 '/mnt/ftp_client') )); then - - rm -R /mnt/ftp_client - mkdir -p /mnt/ftp_client - echo -e "FTP client mount can be installed and setup by DietPi-Config.\nSimply run: dietpi-config" > /mnt/ftp_client/readme.txt - - else - - echo -e "\nWARN: ftp_client is mounted, please unmount and run this script again." - - fi - - #TRIM root FS - sync - fstrim -v / - sync - - #Sync DietPi RAMdisk to Disk now - #systemctl restart dietpi-ramdisk # causes reboot on sparky????/ due to rm *. on dietpi globals? - - echo -e 'Check and delete all non-required folders in /root/.xxxxxx' - ls -lha /lib/modules - - #----------------------------------------------------------------------------------- - exit - #----------------------------------------------------------------------------------- -} diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 573cc4af63..acacf84ef3 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -86,6 +86,10 @@ $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entrie apt_distro='stretch' + elif (( $DISTRO == 5 )); then + + apt_distro='buster' + fi # - Set defaults? @@ -120,13 +124,20 @@ _EOF_ # - Set debian else - cat << _EOF_ > /etc/apt/sources.list + cat << _EOF_ > /etc/apt/sources.list deb $INPUT_MODE_VALUE $apt_distro main contrib non-free deb $INPUT_MODE_VALUE $apt_distro-updates main contrib non-free deb http://security.debian.org $apt_distro/updates main contrib non-free deb $INPUT_MODE_VALUE $apt_distro-backports main contrib non-free _EOF_ + # Buster, remove backports: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 + if (( $DISTRO == 5 )); then + + sed -i '/backports/d' /etc/apt/sources.list + + fi + # Update dietpi.txt entry sed -i "/Apt_Debian_Mirror=/c\Apt_Debian_Mirror=$INPUT_MODE_VALUE" /DietPi/dietpi.txt From e4167eac992c72d9b8be7db405378971b807344f Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 15 Dec 2017 06:13:32 +0000 Subject: [PATCH 033/390] v160 + minor --- PREP_SYSTEM_FOR_DIETPI.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 8d7a82593b..6f05081704 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1263,17 +1263,18 @@ _EOF_ dietpi-notify 0 "Step 8: Finalise system for first run of DietPi:" #------------------------------------------------------------------------------------------------ - dietpi-notify 2 'Configuring Services' - - /DietPi/dietpi/dietpi-services stop - /DietPi/dietpi/dietpi-services dietpi_controlled - dietpi-notify 2 'Installing Dropbear by default' AGI dropbear # set to start on next boot sed -i '/NO_START=1/c\NO_START=0' /etc/default/dropbear + dietpi-notify 2 'Configuring Services' + + /DietPi/dietpi/dietpi-services stop + /DietPi/dietpi/dietpi-services dietpi_controlled + + dietpi-notify 2 'Clearing APT cache' apt-get clean From 01086dd5c188192491f2320678bac3ba65fbadd4 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 15 Dec 2017 06:46:38 +0000 Subject: [PATCH 034/390] v160 + Fix PARTUUID fstab for RPi: https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 6f05081704..02950ada81 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -826,10 +826,12 @@ _EOF_ if (( $HW_MODEL < 10 )); then PARTUUID_CURRENT=$(blkid /dev/mmcblk0p1 -s PARTUUID -o value) - sed -i "s#^/dev/mmcblk0p1#PARTUUID=$PARTUUID_CURRENT#g" /etc/fstab + UUID_CURRENT=$(blkid /dev/mmcblk0p1 -s UUID -o value) + sed -i "s#^UUID=$UUID_CURRENT#PARTUUID=$PARTUUID_CURRENT#g" /etc/fstab PARTUUID_CURRENT=$(blkid /dev/mmcblk0p2 -s PARTUUID -o value) - sed -i "s#^/dev/mmcblk0p2#PARTUUID=$PARTUUID_CURRENT#g" /etc/fstab + UUID_CURRENT=$(blkid /dev/mmcblk0p2 -s UUID -o value) + sed -i "s#^UUID=$UUID_CURRENT#PARTUUID=$PARTUUID_CURRENT#g" /etc/fstab systemctl daemon-reload @@ -1274,7 +1276,6 @@ _EOF_ /DietPi/dietpi/dietpi-services stop /DietPi/dietpi/dietpi-services dietpi_controlled - dietpi-notify 2 'Clearing APT cache' apt-get clean From 348383467aabc8093546d8b5ece36dc3c2021bf5 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 15 Dec 2017 23:32:01 +0100 Subject: [PATCH 035/390] PREP_SYSTEM_FOR_DIETPI.sh | Automate tuning + Read initial distro version from /etc/os-release to allow correct API options and possible other specific commands. Just allow known versions, that we can test. + Readded Jessie distro selection, for testing and to allow people to stay on their oldstable release, if somehow needed. We can remove this again, after Jessie support needs to be dropped due to maintenance effort. + Reducing APT list to minimal, based on dependencies: This does not autoremove any further package: tested on Jessie, ... WIP + Switching back to gnupg, as it is really needed by apt-key add! + Adding dropbear, is it will be installed anyway and to prevent issues, if script is executed via SSH, even I didn't face them during temporary dropbear uninstallation. + Choose correct grub package based on first partition table. + Switch DietPi conf.d name style die 99dietpi_ + Minor wording, also based on personal preferenced :P --- PREP_SYSTEM_FOR_DIETPI.sh | 204 +++++++++++++++++++------------------- 1 file changed, 101 insertions(+), 103 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 02950ada81..24b6514983 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -27,8 +27,32 @@ #Globals #------------------------------------------------------------------------------------------------ #System - DISTRO=4 - DISTRO_NAME='stretch' + if grep -q 'wheezy' /etc/os-release; then + + DISTRO=2 + DISTRO_NAME='wheezy' + + elif grep -q 'jessie' /etc/os-release; then + + DISTRO=3 + DISTRO_NAME='jessie' + + elif grep -q 'stretch' /etc/os-release; then + + DISTRO=4 + DISTRO_NAME='stretch' + + elif grep -q 'buster' /etc/os-release; then + + DISTRO=5 + DISTRO_NAME='buster' + + else + + echo -e 'Error: Unknown or unsupported distribution version, abording...\n' + exit + + fi HW_MODEL=0 HW_ARCH_DESCRIPTION=$(uname -m) if [ "$HW_ARCH_DESCRIPTION" = "armv6l" ]; then @@ -49,7 +73,7 @@ else - echo -e "Unknown HW_ARCH $HW_ARCH_DESCRIPTION, aborting" + echo -e "Error: Unknown or unsupported CPU architecture $HW_ARCH_DESCRIPTION, aborting...\n" exit fi @@ -338,10 +362,13 @@ WHIP_TITLE='Distro Selection:' WHIP_DESC='Please select a distro to install on this system. Selecting a distro that is older than the current installed on system, is not supported.' WHIP_DEFAULT_ITEM=4 - WHIP_MENU_ARRAY=('4' 'stretch (recommended)') + WHIP_MENU_ARRAY=( + '3' 'Jessie (oldstable, just if you need to avoid upgrade to current release)' + '4' 'Stretch (current stable release, recommended)' + ) if (( $HW_MODEL >= 10 )); then - WHIP_MENU_ARRAY+=('5' 'buster (testing only, not officially suppoted)') + WHIP_MENU_ARRAY+=('5' 'Buster (testing only, not officially suppoted)') fi @@ -381,7 +408,7 @@ # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files dietpi-notify 2 "Temporary disable automatic recommends/suggests installation and allow them to be autoremoved:" - cat << _EOF_ > /etc/apt/apt.conf.d/99norecommends + cat << _EOF_ > /etc/apt/apt.conf.d/99dietpi_norecommends APT::Install-Recommends "false"; APT::Install-Suggests "false"; APT::AutoRemove::RecommendsImportant "false"; @@ -391,7 +418,7 @@ _EOF_ dietpi-notify 2 "Forcing use of existing apt configs if available" - cat << _EOF_ > /etc/apt/apt.conf.d/local + cat << _EOF_ > /etc/apt/apt.conf.d/99dietpi_forceconf Dpkg::options { "--force-confdef"; "--force-confold"; @@ -413,98 +440,62 @@ _EOF_ #------------------------------------------------------------------------------------------------ # - DietPi list of minimal required packages which must be installed: - # dpkg --get-selections | awk '{print $1}' | sed 's/:armhf//g' | sed "s/^/'/g" | sed "s/$/'/g" + # dpkg --get-selections | awk '{print $1}' | sed 's/:a....//g' | sed "s/^/'/g" | sed "s/$/'/g" aPACKAGES_REQUIRED_INSTALL=( - 'adduser' - 'apt' - 'apt-transport-https' - 'apt-utils' - 'base-files' - 'bash' - 'bash-completion' - 'bc' - 'bsdutils' - 'bzip2' - 'ca-certificates' - 'console-setup' - 'cpio' - 'crda' - 'cron' - 'curl' - 'dbus' - 'debconf' - 'debianutils' - 'dosfstools' # DietPi-Drive_Manager - 'dphys-swapfile' - 'dpkg' - 'ethtool' - 'fake-hwclock' - 'fbset' - 'firmware-atheros' - 'firmware-brcm80211' - 'firmware-ralink' - 'firmware-realtek' - 'fuse' - 'gpgv' - 'grep' - 'gzip' - 'hdparm' - 'hfsplus' - 'hostname' - 'htop' - 'ifupdown' - 'initramfs-tools' - 'iputils-ping' - 'isc-dhcp-client' - 'iw' - 'locales' - 'mawk' - 'nano' - 'net-tools' - 'ntfs-3g' - 'ntp' - 'p7zip-full' - 'parted' - 'passwd' - 'procps' - 'psmisc' - 'resolvconf' - 'rfkill' #Used by some onboard WiFi chipsets - 'sed' - 'sensible-utils' - 'startpar' - 'sudo' - 'systemd' - 'systemd-sysv' - 'tar' - 'tzdata' - 'udev' - 'unzip' - 'usbutils' - 'util-linux' - 'wget' - 'whiptail' - 'wireless-tools' - 'wpasupplicant' - 'wput' - 'zip' + 'apt-transport-https' # Allows https sources in ATP + 'apt-utils' # Allows debconf to preconfigure APT packages before installing + 'bash-completion' # Auto completes a wide list of bash commands + 'bc' # Floating point calculation within bash + 'bzip2' # .bz2 wrapper + 'ca-certificates' # Adds known ca-certificates, necessary to practically access https sources + 'console-setup' # DietPi-Config keyboard configuration + 'crda' # WiFi related + 'cron' # background job scheduler + 'curl' # Web address testing, downloading, uploading etc. + 'dbus' # System message bus + 'debconf' # APT package configuration, e.g. 'debconf-set-selections' + 'dosfstools' # DietPi-Drive_Manager + fat (boot) drive file system check + 'dphys-swapfile' # Swap file management + 'dropbear' # DietPi sefault SSH-Client + 'ethtool' # Ethernet link checking + 'fake-hwclock' # Hardware clock emulation, to allow correct timestamps during boot before network time sync + 'fbset' # DietPi-Config display settings + 'firmware-atheros' # WiFi dongle firmware + 'firmware-brcm80211' # WiFi dongle firmware + 'firmware-ralink' # WiFi dongle firmware + 'firmware-realtek' # WiFi dongle firmware + 'gnupg' # apt-key add + 'hdparm' # Drive power management adjustment + 'hfsplus' # DietPi-Drive_Manager NTS (MacOS) file system support + 'htop' # System monitor + 'initramfs-tools' # RAM file system initialization + 'iputils-ping' # ping command + 'isc-dhcp-client' # DHCP client + 'iw' # WiFi related + 'locales' # Support locales, necessary for DietPi scripts, as we use enGB.UTF8 as default language + 'nano' # Simple text editor + 'net-tools' # DietPi-Boot: Network tools, ifconfig, route etc. + 'ntfs-3g' # DietPi-Drive_Manager NTPS (Windows) file system support + 'ntp' # Network time syncronization + 'p7zip-full' # .7z wrapper + 'parted' # DietPi-Boot + DietPi-Drive_Manager + 'psmisc' # DietPi-Boot + DietPi-Software: e.g. killall + 'resolvconf' # System name server updater + 'rfkill' # WiFi related: Used by some onboard WiFi chipsets + 'sudo' # DietPi-Software + general use + 'tzdata' # Time zone data for system clock, auto summer/winter time adjustment + 'unzip' # .zip unwrapper + 'usbutils' # DietPi-Software + DietPi-Bugreport: e.g. lsusb + 'wget' # download + 'whiptail' # DietPi dialogs + 'wireless-tools' # WiFi related + 'wpasupplicant' # WiFi related + 'wput' # upload + 'zip' # .zip wrapper ) - # - Keyring specific: - # Raspbian - if (( $HW_MODEL < 10 )); then - - aPACKAGES_REQUIRED_INSTALL+=('raspbian-archive-keyring') - - # Debian - else - - aPACKAGES_REQUIRED_INSTALL+=('debian-archive-keyring') - - fi - # - HW_ARCH specific required packages # x86_64 if (( $HW_ARCH == 10 )); then @@ -513,9 +504,17 @@ _EOF_ aPACKAGES_REQUIRED_INSTALL+=('intel-microcode') aPACKAGES_REQUIRED_INSTALL+=('amd64-microcode') aPACKAGES_REQUIRED_INSTALL+=('firmware-linux-nonfree') - aPACKAGES_REQUIRED_INSTALL+=('firmware-misc-nonfree') - aPACKAGES_REQUIRED_INSTALL+=('grub-efi-amd64') + #aPACKAGES_REQUIRED_INSTALL+=('firmware-misc-nonfree') #aPACKAGES_REQUIRED_INSTALL+=('dmidecode') + if (( $(fdisk -l $1 | grep "Disklabel type:" | awk '{ print $3 }') == 'dos' )); then + + aPACKAGES_REQUIRED_INSTALL+=('grub2') + + else + + aPACKAGES_REQUIRED_INSTALL+=('grub-efi-amd64') + + fi fi @@ -524,9 +523,9 @@ _EOF_ if (( $HW_MODEL < 10 )); then aPACKAGES_REQUIRED_INSTALL+=('libraspberrypi-bin') - aPACKAGES_REQUIRED_INSTALL+=('libraspberrypi0') - aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-bootloader') - aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-kernel') + #aPACKAGES_REQUIRED_INSTALL+=('libraspberrypi0') + #aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-bootloader') + #aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-kernel') aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-sys-mods') aPACKAGES_REQUIRED_INSTALL+=('raspi-copies-and-fills') @@ -555,7 +554,6 @@ _EOF_ elif (( $HW_MODEL == 71 )); then aPACKAGES_REQUIRED_INSTALL+=('device-tree-compiler') #Kern - aPACKAGES_REQUIRED_INSTALL+=('dosfstools') #EMMC transfer fi @@ -618,8 +616,8 @@ _EOF_ WHIP_DEFAULT_ITEM=0 WHIP_MENU_ARRAY=( - '0' 'BT not required, do not install.' - '1' 'Device has onboard BT, and/or, I require BT functionality.' + '0' 'I don't require Bluetooth, do not install.' + '1' 'Device has onboard Bluetooth and/or I require Bluetooth functionality.' ) @@ -647,7 +645,7 @@ _EOF_ # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files dietpi-notify 2 "Returning installation of recommends back to default" - rm /etc/apt/apt-conf.d/99norecommends &> /dev/null + rm /etc/apt/apt-conf.d/99dietpi_norecommends &> /dev/null #------------------------------------------------------------------------------------------------ dietpi-notify 0 'Step 6: Downloading and installing DietPi sourcecode' From c4a148aa7f2b0dc6fcf4407a8705fdc306b1b4ba Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 15 Dec 2017 23:53:20 +0100 Subject: [PATCH 036/390] v160 + Use double quotes around string with single quite inside ;)! --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 24b6514983..fcebdbad18 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -616,7 +616,7 @@ _EOF_ WHIP_DEFAULT_ITEM=0 WHIP_MENU_ARRAY=( - '0' 'I don't require Bluetooth, do not install.' + '0' "I don't require Bluetooth, do not install." '1' 'Device has onboard Bluetooth and/or I require Bluetooth functionality.' ) From beb7a875e347745e46a10e4352432abf563ad0da Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 16 Dec 2017 00:47:14 +0100 Subject: [PATCH 037/390] v160 + Starting Buster implementation, experimental! --- dietpi/dietpi-software | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 53dd655439..beb240802f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -64,6 +64,10 @@ DISTRO_NAME='stretch' + elif (( $DISTRO == 5 )); then + + DISTRO_NAME='buster' + fi #///////////////////////////////////////////////////////////////////////////////////// @@ -4285,15 +4289,7 @@ _EOF_ fi - if (( $DISTRO == 3 )); then - - binary_name+='_jessie' - - else - - binary_name+='_stretch' - - fi + binary_name+="_$DISTRO_NAME" mv "$binary_name" /usr/bin/ympd chmod +x /usr/bin/ympd @@ -5303,7 +5299,7 @@ _EOF_ AGI libasound2 # - Stretch, install additional packages - if (( $DISTRO == 4 )); then + if (( $DISTRO >= 4 )); then AGI gcc-6-base libstdc++6 @@ -6313,6 +6309,11 @@ _EOF_ INSTALL_URL_ADDRESS+='9.0' + elif (( $DISTRO == 5 )); then + + # http://download.opensuse.org/repositories/home:/emby/Debian_Next/ + INSTALL_URL_ADDRESS+='Next' + fi INSTALL_URL_ADDRESS+='/' @@ -8459,10 +8460,14 @@ _EOF_ # 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 + if (( $DISTRO >= 4 )); then + AGI libmariadbclient-dev + fi # Setup the user account information @@ -8915,7 +8920,9 @@ _EOF_ #Configure fastcgi for PHP-FPM local fp_php_fpm_sock='/var/run/php/php7.0-fpm.sock' if (( $DISTRO == 3 )); then + fp_php_fpm_sock='/var/run/php5-fpm.sock' + fi cat << _EOF_ > /etc/lighttpd/conf-available/15-fastcgi-php.conf From 4e78626a55efacd8809763ffd87e48a1c55562e8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 16 Dec 2017 01:14:05 +0100 Subject: [PATCH 038/390] v160 + Use APT $force_options consequently based on distro. --- dietpi/dietpi-software | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index beb240802f..c47a83ddd3 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -14474,7 +14474,14 @@ _EOF_ Banner_Setup Banner_Apt_Update # - Set noninteractive | Allows automation for some software - DEBIAN_FRONTEND='noninteractive' apt-get upgrade -y --force-yes + local force_options='--force-yes' + + if (( $DISTRO >= 4 )); then + + force_options='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' + + fi + DEBIAN_FRONTEND='noninteractive' apt-get upgrade -y $force_options #Generate dir for dietpi-software installed "non-service" based control scripts mkdir -p /etc/dietpi/dietpi-software/services From 922a9d383b7bda6a7456f0684a7b6327bcfc3871 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 16 Dec 2017 01:29:37 +0000 Subject: [PATCH 039/390] v160 + Fix incorrect use of local outside function --- dietpi/boot | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dietpi/boot b/dietpi/boot index d2117f8e92..a4c05ca28d 100644 --- a/dietpi/boot +++ b/dietpi/boot @@ -439,19 +439,19 @@ _EOF_ fi # - Set root password? - root_password=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_Global_Password=' | sed 's/.*=//') - if [ -n "$root_password" ]; then + ROOT_PASSWORD=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_Global_Password=' | sed 's/.*=//') + if [ -n "$ROOT_PASSWORD" ]; then - chpasswd <<< "root:$root_password" - chpasswd <<< "dietpi:$root_password" + chpasswd <<< "root:$ROOT_PASSWORD" + chpasswd <<< "dietpi:$ROOT_PASSWORD" fi # - Set apt mirror - local target_repo='Apt_Debian_Mirror' + TARGET_REPO='Apt_Debian_Mirror' if (( $HW_MODEL < 10 )); then - target_repo='Apt_Raspbian_Mirror' + TARGET_REPO='Apt_Raspbian_Mirror' fi From 4872db3c3fb8d6f24e9fb29e88a5a20519cbd01a Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 16 Dec 2017 01:59:25 +0000 Subject: [PATCH 040/390] v160 + DietPi-Banner | IP: Will now also list the active network adapter used (eg: eth0/wlan0) --- CHANGELOG.txt | 1 + dietpi/dietpi-banner | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fc3186ef61..e2748b31d0 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ v160 Image Modifications: Changes / Improvements / Optimizations: +DietPi-Banner | IP: Will now also list the active network adapter used (eg: eth0/wlan0) DietPi-Set_Hardware | Sparky SBC: enable aotg.aotg1_speed compatibility setting for USB 1.1, when USB-DAC configured: https://github.com/Fourdee/DietPi/issues/1301 DietPi-Software | NAA Daemon: Updated to latest (3.5.2-36). Existing installs will be patched automatically: https://github.com/Fourdee/DietPi/issues/1305 diff --git a/dietpi/dietpi-banner b/dietpi/dietpi-banner index d92b591bfd..c0c20acbbd 100644 --- a/dietpi/dietpi-banner +++ b/dietpi/dietpi-banner @@ -36,10 +36,12 @@ IMAGE_ADDITIONAL_CREDITS=$(sed -n 8p /DietPi/dietpi/.hw_model) IP_ADDRESS=$(sed -n 4p /DietPi/dietpi/.network) + IP_ADAPTER=$(sed -n 3p /DietPi/dietpi/.network) Update_Ip_Address(){ /DietPi/dietpi/func/obtain_network_details IP_ADDRESS=$(sed -n 4p /DietPi/dietpi/.network) + IP_ADAPTER=$(sed -n 3p /DietPi/dietpi/.network) } @@ -51,14 +53,14 @@ IPAddress_Print(){ - #Try to obtain IP if missing + #Try to re-obtain IP if missing if [ ! -n "$IP_ADDRESS" ]; then Update_Ip_Address fi - echo -e " \e[39;49;1mIP Address\e[0m \e[90m| $IP_ADDRESS\e[0m\n \e[38;5;154m───────────────────────────────────────\e[0m" + echo -e " \e[39;49;1mIP $IP_ADAPTER\e[0m \e[90m| $IP_ADDRESS\e[0m\n \e[38;5;154m───────────────────────────────────────\e[0m" } From 8148dc7b27e3b44a4246d00c2e64d32eceaa86ce Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 16 Dec 2017 02:15:02 +0000 Subject: [PATCH 041/390] v160 + Minor: https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 02950ada81..d774c1f093 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -245,9 +245,9 @@ rm -R /mnt/dietpi-sync &> /dev/null rm -R /mnt/dietpi_userdata &> /dev/null - rm -R /etc/dietpi/logs &> /dev/null - rm /root/DietPi-Automation.log &> /dev/null + rm -R /etc/dietpi &> /dev/null + rm /root/DietPi-Automation.log &> /dev/null rm /boot/Automation_Format_My_Usb_Drive &> /dev/null else @@ -1008,7 +1008,7 @@ _EOF_ dietpi-notify 2 "Setting vm.swappiness=1:" - sed -i 's/vm.swappiness=/d' /etc/sysctl.conf + sed -i '/vm.swappiness=/d' /etc/sysctl.conf echo -e "vm.swappiness=1" > /etc/sysctl.d/97-dietpi.conf Error_Check @@ -1345,6 +1345,7 @@ _EOF_ # - RPi install DietPi kernel by default if (( $HW_MODEL < 10 )); then + rm -R /lib/modules/* # Remove all modules from all kernels, ensures our kernel is installed. /DietPi/dietpi/func/dietpi-set_hardware kernel dietpi_rpi fi From df233313e39afc0dde12677ea90d007ec4f3fff8 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 16 Dec 2017 02:43:57 +0000 Subject: [PATCH 042/390] v160 + testing: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351928873 --- dietpi/dietpi-drive_manager | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 1e28e810d9..fe14b7be70 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -200,10 +200,9 @@ /DietPi/dietpi/func/dietpi-notify 2 "Detected PARTUUID mount: ${aDRIVE_MOUNT_SOURCE[$i]} > ${aDRIVE_MOUNT_TARGET[$i]}" - # - Drive mount does not exist + # - Active drive mount does not exist in fstab, create one elif [ -n "${aDRIVE_UUID[$i]}" ]; then #Ignore master partition tables / drives with no UUID - # create one aDRIVE_MOUNT_TARGET[$i]="/mnt/${aDRIVE_UUID[$i]}" /DietPi/dietpi/func/dietpi-notify 2 "Creating UUID fstab entry: ${aDRIVE_MOUNT_SOURCE[$i]}" @@ -217,9 +216,9 @@ fi - # - NB: RPi, rootFS source is reported as /dev/root in df, hard code for it - if (( $HW_MODEL < 10 )) && - [ "${aDRIVE_MOUNT_SOURCE[$i]}" = '/dev/mmcblk0p2' ]; then + # Always check for rootFS device and set target + # - EG: RPi, rootFS source is reported as /dev/root in df scrapes. + if [ "${aDRIVE_MOUNT_SOURCE[$i]}" = "$(findmnt / -o source -n)" ]; then aDRIVE_MOUNT_TARGET[$i]='/' @@ -231,7 +230,16 @@ sed -i "\@^${aDRIVE_MOUNT_SOURCE[$i]}[[:space:]]@d" "$FP_TEMP_FSTAB" sed -i "\@^UUID=${aDRIVE_UUID[$i]}[[:space:]]@d" "$FP_TEMP_FSTAB" - echo -e "UUID=${aDRIVE_UUID[$i]} ${aDRIVE_MOUNT_TARGET[$i]} auto defaults,noatime,nofail,x-systemd.automount 0 0" >> "$FP_TEMP_FSTAB" + local mount_options='defaults,noatime,nofail,discard' + + # Disable x-systemd.automount for RootFS, breaks FS_partition + if [ "${aDRIVE_MOUNT_TARGET[$i]}" != '/' ]; then + + mount_options+=',x-systemd.automount' + + fi + + echo -e "UUID=${aDRIVE_UUID[$i]} ${aDRIVE_MOUNT_TARGET[$i]} auto $mount_options 0 0" >> "$FP_TEMP_FSTAB" aDRIVE_ISAVAILABLE[$i]=1 aDRIVE_ISUUIDMOUNT[$i]=1 From 54b657fefa42f74788954278a53417ef816e82ce Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 16 Dec 2017 02:46:23 +0000 Subject: [PATCH 043/390] v160 + minor tweak --- dietpi/dietpi-drive_manager | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index fe14b7be70..9b6b15e101 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -207,16 +207,8 @@ /DietPi/dietpi/func/dietpi-notify 2 "Creating UUID fstab entry: ${aDRIVE_MOUNT_SOURCE[$i]}" - # Check if the drive is already mounted (but not set in fstab) and use existing mount target - if (( $(df -P | grep -ci -m1 "${aDRIVE_MOUNT_SOURCE[$i]}[[:space:]]") )); then - - /DietPi/dietpi/func/dietpi-notify 2 " - Drive is currently mounted, using existing mount location: ${aDRIVE_MOUNT_TARGET[$i]}" - - aDRIVE_MOUNT_TARGET[$i]=$(df -P | grep -m1 "${aDRIVE_MOUNT_SOURCE[$i]}[[:space:]]" | awk '{print $NF}') - - fi - # Always check for rootFS device and set target + # Always check for rootFS device and set target manually # - EG: RPi, rootFS source is reported as /dev/root in df scrapes. if [ "${aDRIVE_MOUNT_SOURCE[$i]}" = "$(findmnt / -o source -n)" ]; then @@ -224,6 +216,13 @@ /DietPi/dietpi/func/dietpi-notify 2 " - Drive is currently mounted, using existing mount location: ${aDRIVE_MOUNT_TARGET[$i]}" + # Check if the drive is already mounted (but not set in fstab) and use existing mount target + elif (( $(df -P | grep -ci -m1 "${aDRIVE_MOUNT_SOURCE[$i]}[[:space:]]") )); then + + /DietPi/dietpi/func/dietpi-notify 2 " - Drive is currently mounted, using existing mount location: ${aDRIVE_MOUNT_TARGET[$i]}" + + aDRIVE_MOUNT_TARGET[$i]=$(df -P | grep -m1 "${aDRIVE_MOUNT_SOURCE[$i]}[[:space:]]" | awk '{print $NF}') + fi # remove any previous/disabled entries for drive From d152b0707213df512db00c26bf84e83fe2102d1c Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 16 Dec 2017 02:53:32 +0000 Subject: [PATCH 044/390] v160 + minor --- dietpi/dietpi-drive_manager | 1 - 1 file changed, 1 deletion(-) diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 9b6b15e101..d617c87e8b 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -207,7 +207,6 @@ /DietPi/dietpi/func/dietpi-notify 2 "Creating UUID fstab entry: ${aDRIVE_MOUNT_SOURCE[$i]}" - # Always check for rootFS device and set target manually # - EG: RPi, rootFS source is reported as /dev/root in df scrapes. if [ "${aDRIVE_MOUNT_SOURCE[$i]}" = "$(findmnt / -o source -n)" ]; then From 673b0435b3f59a8ccc28f62eb4000b10d2ab78ba Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 16 Dec 2017 03:19:26 +0000 Subject: [PATCH 045/390] v160 + Use DISTRO_TARGET index to avoid future script confusion (eg: AGI): https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 60 ++++++++++++++++++--------------- dietpi/func/dietpi-set_software | 18 ++++++++-- 2 files changed, 47 insertions(+), 31 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index e289d4e5eb..ce193523e8 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -27,32 +27,37 @@ #Globals #------------------------------------------------------------------------------------------------ #System + DISTRO=0 + DISTRO_NAME='' + DISTRO_TARGET=0 + DISTRO_TARGET_NAME='' if grep -q 'wheezy' /etc/os-release; then - DISTRO=2 - DISTRO_NAME='wheezy' + DISTRO=2 + DISTRO_NAME='wheezy' - elif grep -q 'jessie' /etc/os-release; then + elif grep -q 'jessie' /etc/os-release; then - DISTRO=3 - DISTRO_NAME='jessie' + DISTRO=3 + DISTRO_NAME='jessie' - elif grep -q 'stretch' /etc/os-release; then + elif grep -q 'stretch' /etc/os-release; then - DISTRO=4 - DISTRO_NAME='stretch' + DISTRO=4 + DISTRO_NAME='stretch' - elif grep -q 'buster' /etc/os-release; then + elif grep -q 'buster' /etc/os-release; then - DISTRO=5 - DISTRO_NAME='buster' + DISTRO=5 + DISTRO_NAME='buster' - else + else - echo -e 'Error: Unknown or unsupported distribution version, abording...\n' - exit + echo -e 'Error: Unknown or unsupported distribution version, abording...\n' + exit + + fi - fi HW_MODEL=0 HW_ARCH_DESCRIPTION=$(uname -m) if [ "$HW_ARCH_DESCRIPTION" = "armv6l" ]; then @@ -361,7 +366,7 @@ WHIP_TITLE='Distro Selection:' WHIP_DESC='Please select a distro to install on this system. Selecting a distro that is older than the current installed on system, is not supported.' - WHIP_DEFAULT_ITEM=4 + WHIP_DEFAULT_ITEM=$DISTRO WHIP_MENU_ARRAY=( '3' 'Jessie (oldstable, just if you need to avoid upgrade to current release)' '4' 'Stretch (current stable release, recommended)' @@ -373,19 +378,18 @@ fi Run_Whiptail - DISTRO=$WHIP_RETURN_VALUE + DISTRO_TARGET=$WHIP_RETURN_VALUE + if (( $DISTRO_TARGET == 3 )); then - if (( $DISTRO == 3 )); then + DISTRO_TARGET_NAME='jessie' - DISTRO_NAME='jessie' + elif (( $DISTRO_TARGET == 4 )); then - elif (( $DISTRO == 4 )); then + DISTRO_TARGET_NAME='stretch' - DISTRO_NAME='stretch' + elif (( $DISTRO_TARGET == 5 )); then - elif (( $DISTRO == 5 )); then - - DISTRO_NAME='buster' + DISTRO_TARGET_NAME='buster' fi @@ -395,9 +399,9 @@ rm /etc/apt/sources.list.d/deb-multimedia.list &> /dev/null #meveric - dietpi-notify 2 "Setting APT sources.list: $DISTRO_NAME $DISTRO" + dietpi-notify 2 "Setting APT sources.list: $DISTRO_TARGET_NAME $DISTRO_TARGET" - /DietPi/dietpi/func/dietpi-set_software apt-mirror default + /DietPi/dietpi/func/dietpi-set_software apt-mirror $DISTRO_TARGET # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files dietpi-notify 2 "Marking all packages as auto installed first, to allow allow effective autoremove afterwards" @@ -426,7 +430,7 @@ Dpkg::options { _EOF_ Error_Check - dietpi-notify 2 "Updating APT for $DISTRO_NAME:" + dietpi-notify 2 "Updating APT for $DISTRO_TARGET_NAME:" apt-get clean Error_Check @@ -476,7 +480,7 @@ _EOF_ 'locales' # Support locales, necessary for DietPi scripts, as we use enGB.UTF8 as default language 'nano' # Simple text editor 'net-tools' # DietPi-Boot: Network tools, ifconfig, route etc. - 'ntfs-3g' # DietPi-Drive_Manager NTPS (Windows) file system support + 'ntfs-3g' # DietPi-Drive_Manager NTPS (Windows) file system support 'ntp' # Network time syncronization 'p7zip-full' # .7z wrapper 'parted' # DietPi-Boot + DietPi-Drive_Manager diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index acacf84ef3..487155f9e0 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -17,7 +17,7 @@ Available commands $FP_SCRIPT allo eth_dhcp / eth_static $FP_SCRIPT useradd X=create user with name X and default permissions, using global DietPi password (dietpi) $FP_SCRIPT userdel X=delete user with name X -$FP_SCRIPT apt-mirror url/default +$FP_SCRIPT apt-mirror url/default/INT_DISTRO_INDEX $FP_SCRIPT ntpd-mirror url/default $FP_SCRIPT ntpd-mode configures NTPD mode (eg: ntp/systemd) $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entries if required @@ -81,7 +81,19 @@ $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entrie if [ -n "$INPUT_MODE_VALUE" ]; then - local apt_distro='jessie' #3 + local apt_distro=0 + + # - INT, set target distro index and use defaults + if [[ $INPUT_MODE_VALUE =~ ^-?[0-9]+$ ]]; then + + DISTRO=$INPUT_MODE_VALUE + + fi + + if (( $DISTRO == 3 )); then + + apt_distro='jessie' + if (( $DISTRO == 4 )); then apt_distro='stretch' @@ -93,7 +105,7 @@ $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entrie fi # - Set defaults? - if [ "$INPUT_MODE_VALUE" = "default" ]; then + if [ "$INPUT_MODE_VALUE" = "default" ] || [[ $INPUT_MODE_VALUE =~ ^-?[0-9]+$ ]]; then if (( $HW_MODEL < 10 )); then From 4c6d2b227960039bddd0d9ff062df76282d53001 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 16 Dec 2017 03:28:53 +0000 Subject: [PATCH 046/390] v160 + DietPi script does not exist at this stage. Add code for /etc/apt/sources.list gen: https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 35 ++++++++++++++++++++++++++++++--- dietpi/func/dietpi-set_software | 18 +++-------------- 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index ce193523e8..d9c882604f 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -53,7 +53,7 @@ else - echo -e 'Error: Unknown or unsupported distribution version, abording...\n' + echo -e 'Error: Unknown or unsupported distribution version, aborting...\n' exit fi @@ -78,7 +78,7 @@ else - echo -e "Error: Unknown or unsupported CPU architecture $HW_ARCH_DESCRIPTION, aborting...\n" + dietpi-notify 1 "Unknown or unsupported CPU architecture $HW_ARCH_DESCRIPTION, aborting..." exit fi @@ -401,7 +401,36 @@ dietpi-notify 2 "Setting APT sources.list: $DISTRO_TARGET_NAME $DISTRO_TARGET" - /DietPi/dietpi/func/dietpi-set_software apt-mirror $DISTRO_TARGET + # - Set raspbian + if (( $HW_MODEL < 10 )); then + + cat << _EOF_ > /etc/apt/sources.list +deb https://www.mirrorservice.org/sites/archive.raspbian.org/raspbian $DISTRO_TARGET_NAME main contrib non-free rpi +_EOF_ + + cat << _EOF_ > /etc/apt/sources.list.d/raspi.list +deb https://archive.raspberrypi.org/debian/ $DISTRO_TARGET_NAME main ui +_EOF_ + + + # - Set debian + else + + cat << _EOF_ > /etc/apt/sources.list +deb http://ftp.debian.org/debian/ $DISTRO_TARGET_NAME main contrib non-free +deb http://ftp.debian.org/debian/ $DISTRO_TARGET_NAME-updates main contrib non-free +deb http://security.debian.org $DISTRO_TARGET_NAME/updates main contrib non-free +deb http://ftp.debian.org/debian/ $DISTRO_TARGET_NAME-backports main contrib non-free +_EOF_ + + # Buster, remove backports: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 + if (( $DISTRO_TARGET == 5 )); then + + sed -i '/backports/d' /etc/apt/sources.list + + fi + + fi # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files dietpi-notify 2 "Marking all packages as auto installed first, to allow allow effective autoremove afterwards" diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 487155f9e0..acacf84ef3 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -17,7 +17,7 @@ Available commands $FP_SCRIPT allo eth_dhcp / eth_static $FP_SCRIPT useradd X=create user with name X and default permissions, using global DietPi password (dietpi) $FP_SCRIPT userdel X=delete user with name X -$FP_SCRIPT apt-mirror url/default/INT_DISTRO_INDEX +$FP_SCRIPT apt-mirror url/default $FP_SCRIPT ntpd-mirror url/default $FP_SCRIPT ntpd-mode configures NTPD mode (eg: ntp/systemd) $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entries if required @@ -81,19 +81,7 @@ $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entrie if [ -n "$INPUT_MODE_VALUE" ]; then - local apt_distro=0 - - # - INT, set target distro index and use defaults - if [[ $INPUT_MODE_VALUE =~ ^-?[0-9]+$ ]]; then - - DISTRO=$INPUT_MODE_VALUE - - fi - - if (( $DISTRO == 3 )); then - - apt_distro='jessie' - + local apt_distro='jessie' #3 if (( $DISTRO == 4 )); then apt_distro='stretch' @@ -105,7 +93,7 @@ $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entrie fi # - Set defaults? - if [ "$INPUT_MODE_VALUE" = "default" ] || [[ $INPUT_MODE_VALUE =~ ^-?[0-9]+$ ]]; then + if [ "$INPUT_MODE_VALUE" = "default" ]; then if (( $HW_MODEL < 10 )); then From b22ed9e31c2d0ca799b2054bc9c3d06a04a5d1d3 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 16 Dec 2017 04:15:16 +0000 Subject: [PATCH 047/390] v160 + https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index d9c882604f..3184c6be42 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -398,7 +398,6 @@ #rm /etc/apt/sources.list.d/* &> /dev/null #Probably a bad idea rm /etc/apt/sources.list.d/deb-multimedia.list &> /dev/null #meveric - dietpi-notify 2 "Setting APT sources.list: $DISTRO_TARGET_NAME $DISTRO_TARGET" # - Set raspbian @@ -412,7 +411,6 @@ _EOF_ deb https://archive.raspberrypi.org/debian/ $DISTRO_TARGET_NAME main ui _EOF_ - # - Set debian else @@ -467,6 +465,9 @@ _EOF_ apt-get update Error_Check + # - Distro is now target + DISTRO=$DISTRO_TARGET + #------------------------------------------------------------------------------------------------ dietpi-notify 0 'Step 4: APT removals:' From 4574c9b3ab70fb36914e8f2d1c6652a564e84757 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 16 Dec 2017 04:22:04 +0000 Subject: [PATCH 048/390] v160 + Reordering to resolve: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352159530 --- PREP_SYSTEM_FOR_DIETPI.sh | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 3184c6be42..77e841fcbe 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -430,6 +430,18 @@ _EOF_ fi + dietpi-notify 2 "Updating APT for $DISTRO_TARGET_NAME:" + + apt-get clean + Error_Check + + apt-get update + Error_Check + + # - Distro is now target + DISTRO=$DISTRO_TARGET + DISTRO_NAME=$DISTRO_TARGET_NAME + # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files dietpi-notify 2 "Marking all packages as auto installed first, to allow allow effective autoremove afterwards" @@ -457,17 +469,6 @@ Dpkg::options { _EOF_ Error_Check - dietpi-notify 2 "Updating APT for $DISTRO_TARGET_NAME:" - - apt-get clean - Error_Check - - apt-get update - Error_Check - - # - Distro is now target - DISTRO=$DISTRO_TARGET - #------------------------------------------------------------------------------------------------ dietpi-notify 0 'Step 4: APT removals:' From 9af918befdfe29072b1a93b5a1974f1fb595209f Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 16 Dec 2017 06:00:15 +0000 Subject: [PATCH 049/390] v160 + DietPi-Boot | Improved the method of initial FS_partition and FS_expansion during 1st run, via systemD services. 'fs_force_resize=' in dietpi.txt is no longer supported: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352159930 --- CHANGELOG.txt | 2 +- PREP_SYSTEM_FOR_DIETPI.sh | 107 ++++++++++++++++++++++++++++++++++---- dietpi.txt | 3 -- dietpi/boot | 101 ++--------------------------------- dietpi/dietpi-config | 2 +- dietpi/dietpi-software | 2 +- dietpi/patch_file | 10 ---- 7 files changed, 104 insertions(+), 123 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e2748b31d0..3b80ea30d9 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ v160 Image Modifications: Changes / Improvements / Optimizations: +DietPi-Boot | Improved the method of initial FS_partition and FS_expansion during 1st run, via systemD services. 'fs_force_resize=' in dietpi.txt is no longer supported: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352159930 DietPi-Banner | IP: Will now also list the active network adapter used (eg: eth0/wlan0) DietPi-Set_Hardware | Sparky SBC: enable aotg.aotg1_speed compatibility setting for USB 1.1, when USB-DAC configured: https://github.com/Fourdee/DietPi/issues/1301 DietPi-Software | NAA Daemon: Updated to latest (3.5.2-36). Existing installs will be patched automatically: https://github.com/Fourdee/DietPi/issues/1305 @@ -193,7 +194,6 @@ Rock64 | Now available for beta testing: https://github.com/Fourdee/DietPi/issue Changes / Improvements / Optimizations: General | RPi: Kernel updated to 4.9.40. Includes improved driver support for Allo Piano and DiGi One: https://github.com/raspberrypi/linux/pull/2149 -General | dietpi.txt: Added an dev option to force a resize + expansion on rootfs partition for next boot (fs_force_resize=1) General | RT kernel for RPi is now available, can be installed with "/DietPi/dietpi/func/dietpi-set_hardware kernel dietpi_rpi_rt" General | Reworked the disabled modules for Sparky. Disables touchscreen and GPU modules (thanks @sudeep). General | Sparky Image updated to Stretch, includes kernel update for DSD256/512 support. diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 77e841fcbe..b86f9a7db8 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1,11 +1,11 @@ #!/bin/bash { #------------------------------------------------------------------------------------------------ - # Setup a Debian installation, for DietPi. - # - PRE-REQ - # System currently running a Debian image (ideally minimal) - # System with active eth0 connection - # No USB drives attached + # Optimize current Debian installation and prep for DietPi installation. + #------------------------------------------------------------------------------------------------ + # REQUIREMENTS + # - Currently running Debian (ideally minimal, eg: Raspbian Lite-ish =)) ) + # - Active eth0 connection #------------------------------------------------------------------------------------------------ # DO NOT USE. Currently under testing. #------------------------------------------------------------------------------------------------ @@ -1423,9 +1423,9 @@ _EOF_ echo -1 > /DietPi/dietpi/.update_stage - dietpi-notify 2 'Set Init .install_stage to -3 (first boot)' + dietpi-notify 2 'Set Init .install_stage to -1 (first boot)' - echo -3 > /DietPi/dietpi/.install_stage + echo -1 > /DietPi/dietpi/.install_stage # BBB skip FS_partition if (( $HW_MODEL == 71 )); then @@ -1436,8 +1436,8 @@ _EOF_ dietpi-notify 2 'Remove server_version / patch_file (downloads fresh from dietpi-update)' - rm /DietPi/dietpi/patch_file - rm /DietPi/dietpi/server_version + rm /DietPi/dietpi/patch_file &> /dev/null + rm /DietPi/dietpi/server_version &> /dev/null # - HW Specific # RPi remove saved HW_MODEL , allowing obtain-hw_model to auto detect RPi model @@ -1447,7 +1447,94 @@ _EOF_ fi - #TRIM root FS + dietpi-notify 2 'Generating dietpi-fs_partition_resize for first boot' + + cat << _EOF_ > /etc/systemd/system/dietpi-fs_partition_resize.service +[Unit] +Description=dietpi-fs_partition_resize +Before=dietpi-ramdisk.service + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/bin/bash -c '/etc/dietpi/fs_partition_resize.sh | tee /etc/dietpi/logs/fs_partition_resize.log' +StandardOutput=tty + +[Install] +WantedBy=local-fs.target +_EOF_ + systemctl enable dietpi-fs_partition_resize.service + systemctl daemon-reload + + cat << _EOF_ > /etc/dietpi/fs_partition_resize.sh +#!/bin/bash + +systemctl disable dietpi-fs_partition_resize.service +systemctl daemon-reload + +TARGET_PARTITION=\$(findmnt / -o source -n | sed 's/.*p//') +TARGET_DEV=\$(findmnt / -o source -n) + +# - MMCBLK[0-9]p[0-9] scrape +if [[ "\$TARGET_DEV" = *"mmcblk"* ]]; then + + TARGET_DEV=\$(findmnt / -o source -n | sed 's/p[0-9]\$//') + +# - Everything else scrape (eg: /dev/sdX[0-9]) +else + + TARGET_DEV=\$(findmnt / -o source -n | sed 's/[0-9]\$//') + +fi + +cat << _EOF_1 | fdisk \$TARGET_DEV +p +d +\$TARGET_PARTITION +n +p +\$TARGET_PARTITION +\$(parted \$TARGET_DEV -ms unit s p | grep ':ext4::;' | sed 's/:/ /g' | sed 's/s//g' | awk '{ print \$2 }') + +p +w + +_EOF_1 + +reboot + +_EOF_ + chmod +x /etc/dietpi/fs_partition_resize.sh + + + dietpi-notify 2 'Generating dietpi-fs_partition_expand for subsequent boot' + + cat << _EOF_ > /etc/systemd/system/dietpi-fs_expand.service +[Unit] +Description=dietpi-fs_expand +Before=dietpi-ramdisk.service + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/bin/bash -c 'resize2fs \$(findmnt / -o source -n) | tee /etc/dietpi/logs/fs_expand.log; systemctl disable dietpi-fs_expand.service; systemctl daemon-reload' +StandardOutput=tty + +[Install] +WantedBy=local-fs.target +_EOF_ + systemctl enable dietpi-fs_expand.service + systemctl daemon-reload + + + # systemctl start dietpi-fs_partition_resize.service + # systemctl status dietpi-fs_partition_resize.service -l + # cat /etc/dietpi/logs/fs_partition_resize.log + + # + + + dietpi-notify 2 'Sync changes to disk and TRIM rootFS' sync fstrim -v / sync diff --git a/dietpi.txt b/dietpi.txt index e81150a588..03684bc38e 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -217,8 +217,5 @@ dietpi_nextcloud_username=admin gitbranch=master gitforkowner=Fourdee -#Forces a partition resize + expansion of rootfs on next boot. (0=disabled, 1=enabled) -fs_force_resize=0 - # - Max size of rootfs resize (%) rootfs_resize_limit=100 diff --git a/dietpi/boot b/dietpi/boot index a4c05ca28d..036a8cf4b0 100644 --- a/dietpi/boot +++ b/dietpi/boot @@ -28,9 +28,7 @@ DISTRO=0 HW_CPUID=0 - FS_FORCED_EXPANSION=$(cat /DietPi/dietpi.txt | grep -m1 '^fs_force_resize=' | sed 's/.*=//') - - # -3 = first boot / -2 = partition / -1 = filesystem / 0 = run dietpi-software at login / 1 = completed + # -1 = first boot / 0 = run dietpi-software at login / 1 = completed DIETPI_INSTALL_STAGE=$(cat /DietPi/dietpi/.install_stage) Read_Hw_Model(){ @@ -94,63 +92,6 @@ fi } - FS_Partition(){ - - #Force filesystem sync - sync - - local rootfs_resize_limit=$(cat /DietPi/dietpi.txt | grep -m1 '^rootfs_resize_limit=' | sed 's/.*=//') - - local target_partition=$(findmnt / -o source -n | sed 's/.*p//') - local target_dev=$(findmnt / -o source -n) - - # - MMCBLK[0-9]p[0-9] scrape - if [[ "$target_dev" = *"mmcblk"* ]]; then - - target_dev=$(findmnt / -o source -n | sed 's/p[0-9]$//') - - # - Everything else scrape (eg: /dev/sdX[0-9]) - else - - target_dev=$(findmnt / -o source -n | sed 's/[0-9]$//') - - fi - - if (( $rootfs_resize_limit < 100 )); then - - parted -s $target_dev unit % resizepart $target_partition $rootfs_resize_limit% || parted $target_dev unit % resizepart $target_partition Yes $rootfs_resize_limit% - - else - - cat << _EOF_ | fdisk $target_dev -p -d -$target_partition -n -p -$target_partition -$(parted $target_dev -ms unit s p | grep ':ext4::;' | sed 's/:/ /g' | sed 's/s//g' | awk '{ print $2 }') - -p -w - -_EOF_ - - fi - - } - - FS_Expand(){ - - #Force filesystem sync - sync - - #Resize RootFS to new partition size - local target_dev=$(findmnt / -o source -n) - resize2fs $target_dev - - } - Apply_DietPi_FirstRun_Settings(){ #---------------------------------------------------------------- @@ -375,29 +316,9 @@ _EOF_ # Init Run_Init - #---------------------------------------------------------------- - #Filesystem expansion only (eg: for pre-installed images) - if (( $FS_FORCED_EXPANSION == 1 )); then - - FS_Partition - - sed -i '/fs_force_resize=/c\fs_force_resize=2' /DietPi/dietpi.txt - - reboot - #---------------------------------------------------------------- #Normal Boot - elif (( $DIETPI_INSTALL_STAGE == 1 )); then - - if (( $FS_FORCED_EXPANSION == 2 )); then - - FS_Expand - - sed -i '/fs_force_resize=/c\fs_force_resize=0' /DietPi/dietpi.txt - - /DietPi/dietpi/func/dietpi-set_dphys-swapfile $(cat /DietPi/dietpi.txt | grep -m1 '^Swapfile_Size=' | sed 's/.*=//' ) - - fi + if (( $DIETPI_INSTALL_STAGE == 1 )); then Wait_For_Valid_Network_Connection @@ -412,8 +333,8 @@ _EOF_ /DietPi/dietpi/dietpi-banner 1 #---------------------------------------------------------------- - #Filesystem prep, stage 1/2 - elif (( $DIETPI_INSTALL_STAGE == -3 )); then + #First run prep + elif (( $DIETPI_INSTALL_STAGE == -1 )); then # Set RPi v1 safe overclocking profile (900mhz) RPi_Set_Clock_Speeds @@ -469,20 +390,6 @@ _EOF_ fi - FS_Partition - - echo -2 > /DietPi/dietpi/.install_stage - - reboot - - #---------------------------------------------------------------- - #Filesystem prep, stage 2/2 - elif (( $DIETPI_INSTALL_STAGE == -2 )); then - - #Expand rootFS - FS_Expand - echo -1 > /DietPi/dietpi/.install_stage - #Enable/Create swapfile. /DietPi/dietpi/func/dietpi-set_dphys-swapfile $(cat /DietPi/dietpi.txt | grep -m1 '^Swapfile_Size=' | sed 's/.*=//' ) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index fc331b03de..81c02c2a92 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -42,7 +42,7 @@ #///////////////////////////////////////////////////////////////////////////////////// #Obtain Install Stage Index (File always exists - is set with finalized) #///////////////////////////////////////////////////////////////////////////////////// - # -3 = first boot / -2 = partition / -1 = filesystem / 0 = run dietpi-software at login / 1 = completed + # -1 = first boot / 0 = run dietpi-software at login / 1 = completed DIETPI_INSTALL_STAGE=$(cat /DietPi/dietpi/.install_stage) #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index c47a83ddd3..a62ee286e1 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -48,7 +48,7 @@ #///////////////////////////////////////////////////////////////////////////////////// #Obtain Install Stage Index #///////////////////////////////////////////////////////////////////////////////////// - # -3 = first boot / -2 = partition / -1 = filesystem / 0 = run dietpi-software at login / 1 = completed + # -1 = first boot / 0 = run dietpi-software at login / 1 = completed DIETPI_INSTALL_STAGE=$(cat /DietPi/dietpi/.install_stage) #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/patch_file b/dietpi/patch_file index e09a37cecc..e769b5d966 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2677,16 +2677,6 @@ _EOF_ #Deb multimedia repo remove for ALL installs: https://github.com/Fourdee/DietPi/issues/1096#issuecomment-318076721 rm /etc/apt/sources.list.d/deb-multimedia.list &> /dev/null #------------------------------------------------------------------------------- - #FS forced resize option (dev use) - if (( ! $(cat /DietPi/dietpi.txt | grep -ci -m1 '^fs_force_resize=') )); then - - cat << _EOF_ >> /DietPi/dietpi.txt -#Forces a partition resize + expansion of rootfs on next boot. (0=disabled, 1=enabled) -fs_force_resize=0 -_EOF_ - - fi - #------------------------------------------------------------------------------- #Fix error log on disabled IPv6: https://github.com/Fourdee/DietPi/issues/1119 sed -i '/net.ipv6.conf.all.disable_ipv6 /c\' /etc/sysctl.conf sed -i '/net.ipv6.conf.default.disable_ipv6 /c\' /etc/sysctl.conf From 5d67e5c690b65b9144f49c50a7e2cc36cec4b460 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 16 Dec 2017 06:13:36 +0000 Subject: [PATCH 050/390] v160 + minor https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352159930 --- PREP_SYSTEM_FOR_DIETPI.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index b86f9a7db8..8708a6e44e 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1463,8 +1463,9 @@ StandardOutput=tty [Install] WantedBy=local-fs.target _EOF_ - systemctl enable dietpi-fs_partition_resize.service systemctl daemon-reload + systemctl enable dietpi-fs_partition_resize.service + Error_Check cat << _EOF_ > /etc/dietpi/fs_partition_resize.sh #!/bin/bash @@ -1504,8 +1505,9 @@ _EOF_1 reboot _EOF_ + Error_Check chmod +x /etc/dietpi/fs_partition_resize.sh - + Error_Check dietpi-notify 2 'Generating dietpi-fs_partition_expand for subsequent boot' @@ -1523,18 +1525,18 @@ StandardOutput=tty [Install] WantedBy=local-fs.target _EOF_ - systemctl enable dietpi-fs_expand.service systemctl daemon-reload + systemctl enable dietpi-fs_expand.service + Error_Check - + # #debug # systemctl start dietpi-fs_partition_resize.service # systemctl status dietpi-fs_partition_resize.service -l # cat /etc/dietpi/logs/fs_partition_resize.log - # - dietpi-notify 2 'Sync changes to disk and TRIM rootFS' + sync fstrim -v / sync From 313116417a3878ab94c61d47c562aa5b02d2c0ce Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 16 Dec 2017 06:19:40 +0000 Subject: [PATCH 051/390] v160 + https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352164346 --- PREP_SYSTEM_FOR_DIETPI.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 8708a6e44e..364f12e4ae 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -558,9 +558,9 @@ _EOF_ if (( $HW_MODEL < 10 )); then aPACKAGES_REQUIRED_INSTALL+=('libraspberrypi-bin') - #aPACKAGES_REQUIRED_INSTALL+=('libraspberrypi0') - #aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-bootloader') - #aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-kernel') + aPACKAGES_REQUIRED_INSTALL+=('libraspberrypi0') + aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-bootloader') + aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-kernel') aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-sys-mods') aPACKAGES_REQUIRED_INSTALL+=('raspi-copies-and-fills') @@ -667,7 +667,6 @@ _EOF_ fi - if (( $HW_MODEL < 10 )); then dietpi-notify 2 "Installing Bluetooth packages specific to RPi" From 8a3afd93cebca510e155f26b802abadb13358e75 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 16 Dec 2017 06:44:54 +0000 Subject: [PATCH 052/390] v160 + boot logging: https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 364f12e4ae..6551de2fe9 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -270,6 +270,8 @@ Error_Check # - Delete any previous exsiting data + rm -R /DietPi/* + rm -R /mnt/dietpi-backup &> /dev/null rm -R /mnt/dietpi-sync &> /dev/null rm -R /mnt/dietpi_userdata &> /dev/null @@ -917,6 +919,7 @@ _EOF_ dietpi-notify 2 "Installing DietPi boot service" # Boot + # - DEBUGGING enabled: tee /etc/dietpi/logs/dietpi-boot.log cat << _EOF_ > /etc/systemd/system/dietpi-boot.service [Unit] Description=DietPi-Boot @@ -926,7 +929,7 @@ Requires=dietpi-ramdisk.service [Service] Type=oneshot RemainAfterExit=yes -ExecStart=/bin/bash -c '/DietPi/dietpi/boot' +ExecStart=/bin/bash -c '/DietPi/dietpi/boot | tee /etc/dietpi/logs/dietpi-boot.log' StandardOutput=tty [Install] @@ -1426,13 +1429,6 @@ _EOF_ echo -1 > /DietPi/dietpi/.install_stage - # BBB skip FS_partition - if (( $HW_MODEL == 71 )); then - - echo -2 > /DietPi/dietpi/.install_stage - - fi - dietpi-notify 2 'Remove server_version / patch_file (downloads fresh from dietpi-update)' rm /DietPi/dietpi/patch_file &> /dev/null @@ -1448,6 +1444,7 @@ _EOF_ dietpi-notify 2 'Generating dietpi-fs_partition_resize for first boot' + #??? BBB skip this??? cat << _EOF_ > /etc/systemd/system/dietpi-fs_partition_resize.service [Unit] Description=dietpi-fs_partition_resize @@ -1518,7 +1515,7 @@ Before=dietpi-ramdisk.service [Service] Type=oneshot RemainAfterExit=no -ExecStart=/bin/bash -c 'resize2fs \$(findmnt / -o source -n) | tee /etc/dietpi/logs/fs_expand.log; systemctl disable dietpi-fs_expand.service; systemctl daemon-reload' +ExecStart=/bin/bash -c "resize2fs \$(findmnt / -o source -n) | tee /etc/dietpi/logs/fs_expand.log; systemctl disable dietpi-fs_expand.service; systemctl daemon-reload" StandardOutput=tty [Install] From 5ed3418b10f1d2a5eb99ae1bfc987a10ba34bfdb Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 16 Dec 2017 06:55:21 +0000 Subject: [PATCH 053/390] v160 + Tweaks + testing: https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 6551de2fe9..225f702a2b 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -271,6 +271,7 @@ # - Delete any previous exsiting data rm -R /DietPi/* + rm -R /boot/dietpi rm -R /mnt/dietpi-backup &> /dev/null rm -R /mnt/dietpi-sync &> /dev/null @@ -666,15 +667,14 @@ _EOF_ AGI bluetooth bluez-firmware Error_Check + if (( $HW_MODEL < 10 )); then - fi - - if (( $HW_MODEL < 10 )); then + dietpi-notify 2 "Installing Bluetooth packages specific to RPi" - dietpi-notify 2 "Installing Bluetooth packages specific to RPi" + AGI pi-bluetooth + Error_Check - AGI pi-bluetooth - Error_Check + fi fi @@ -1533,6 +1533,11 @@ _EOF_ dietpi-notify 2 'Sync changes to disk and TRIM rootFS' + systemctl stop dietpi-ramlog + Error_Check + systemctl stop dietpi-ramdisk + Error_Check + sync fstrim -v / sync From 59e201aead5bcc4563b5f7a0909c96b22e90110d Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 16 Dec 2017 07:38:42 +0000 Subject: [PATCH 054/390] v160 + DietPi-Software | Mosquitto (Stretch): Resolved issue with failed install, due to unavailable pre-req libs in Debian/Mosq repos: https://github.com/Fourdee/DietPi/issues/1306 --- CHANGELOG.txt | 1 + PREP_SYSTEM_FOR_DIETPI.sh | 2 +- dietpi/dietpi-software | 75 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 3b80ea30d9..53303c8fd1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,6 +8,7 @@ DietPi-Boot | Improved the method of initial FS_partition and FS_expansion durin DietPi-Banner | IP: Will now also list the active network adapter used (eg: eth0/wlan0) DietPi-Set_Hardware | Sparky SBC: enable aotg.aotg1_speed compatibility setting for USB 1.1, when USB-DAC configured: https://github.com/Fourdee/DietPi/issues/1301 DietPi-Software | NAA Daemon: Updated to latest (3.5.2-36). Existing installs will be patched automatically: https://github.com/Fourdee/DietPi/issues/1305 +DietPi-Software | Mosquitto (Stretch): Resolved issue with failed install, due to unavailable pre-req libs in Debian/Mosq repos: https://github.com/Fourdee/DietPi/issues/1306 Bug Fixes: DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi drop during software installs/updates etc: https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 225f702a2b..292046cbab 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -262,7 +262,6 @@ # - Stop services /DietPi/dietpi/dietpi-services stop - /DietPi/dietpi/dietpi-services dietpi_controlled systemctl stop dietpi-ramlog Error_Check @@ -397,6 +396,7 @@ fi dietpi-notify 2 'Removing conflicting apt sources.list.d' + # NB: Apt sources will get overwritten during 1st run, via boot script andn dietpi.txt entry #rm /etc/apt/sources.list.d/* &> /dev/null #Probably a bad idea rm /etc/apt/sources.list.d/deb-multimedia.list &> /dev/null #meveric diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a62ee286e1..f9cd413d58 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5208,6 +5208,81 @@ _EOF_ fi + #Pre-Req stretch + # - libssl1.0.0 no longer available: https://github.com/Fourdee/DietPi/issues/1299 + if (( $DISTRO >= 4 )); then + + INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/' + + # - ARMv6/7 + if (( $HW_ARCH == 1 || $HW_ARCH == 2 )); then + + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_armhf.deb' + + # - ARM64 + elif (( $HW_ARCH == 3 )); then + + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_arm64.deb' + + # - x86_64 + elif (( $HW_ARCH == 10 )); then + + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_amd64.deb' + + fi + + /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + + #Install + if (( $? == 0 )); then + + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb + + else + + Error_NoConnection_NoInstall + + fi + + # - libwebsockets3 no longer available: https://github.com/Fourdee/DietPi/issues/1299 + INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/' + + # - ARMv6/7 + if (( $HW_ARCH == 1 || $HW_ARCH == 2 )); then + + INSTALL_URL_ADDRESS+='libwebsockets3_1.2.2-1_armhf.deb' + + # - ARM64 + elif (( $HW_ARCH == 3 )); then + + INSTALL_URL_ADDRESS+='libwebsockets3_1.2.2-1_arm64.deb' + + # - x86_64 + elif (( $HW_ARCH == 10 )); then + + INSTALL_URL_ADDRESS+='libwebsockets3_1.2.2-1_amd64.deb' + + fi + + /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + + #Install + if (( $? == 0 )); then + + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb + + else + + Error_NoConnection_NoInstall + + fi + + fi + apt-get update AGI mosquitto From 8eea30ccdd1064bd501c2b939fe0c96167631506 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 17 Dec 2017 03:22:20 +0000 Subject: [PATCH 055/390] v160 + Force RPi kernel install: https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- dietpi/func/dietpi-set_hardware | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 292046cbab..27c499f83c 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1381,7 +1381,7 @@ _EOF_ if (( $HW_MODEL < 10 )); then rm -R /lib/modules/* # Remove all modules from all kernels, ensures our kernel is installed. - /DietPi/dietpi/func/dietpi-set_hardware kernel dietpi_rpi + /DietPi/dietpi/func/dietpi-set_hardware kernel dietpi_rpi_forced #forced, incase of kernel version match which would prevent install fi diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index dae224387b..e630365c4b 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -494,8 +494,9 @@ _EOF_ local update_required=1 local current_kernel='4.9.62-' - #Avoid updating main kernel, if latest is already installed - if (( $(uname -r | grep -ci -m1 "$current_kernel") )); then + #Avoid updating main kernel, if latest is already installed, and forced flag not used + if [[ "$INPUT_DEVICE_VALUE" != *"_forced"* ]] && + (( $(uname -r | grep -ci -m1 "$current_kernel") )); then update_required=0 From 1a17042580294abe31c1444582148fed95d9ec16 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 17 Dec 2017 03:29:05 +0000 Subject: [PATCH 056/390] v160 DietPi-Software | Aira2 (Stretch): Resolved installation, now used APT installation: https://github.com/Fourdee/DietPi/issues/1310 DietPi-Software | PHP-FPM: Increased from "$CPU_CORES_TOTAL" to "pm.max_children = $(( $CPU_CORES_TOTAL * 3 ))". This should avoid failed forking of PHP-FPM processes/requests : https://github.com/Fourdee/DietPi/issues/1298 --- CHANGELOG.txt | 2 ++ dietpi/dietpi-software | 66 +++++++++++++++++++++++------------------- 2 files changed, 39 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 53303c8fd1..1d4b1c2ff0 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -9,6 +9,7 @@ DietPi-Banner | IP: Will now also list the active network adapter used (eg: eth0 DietPi-Set_Hardware | Sparky SBC: enable aotg.aotg1_speed compatibility setting for USB 1.1, when USB-DAC configured: https://github.com/Fourdee/DietPi/issues/1301 DietPi-Software | NAA Daemon: Updated to latest (3.5.2-36). Existing installs will be patched automatically: https://github.com/Fourdee/DietPi/issues/1305 DietPi-Software | Mosquitto (Stretch): Resolved issue with failed install, due to unavailable pre-req libs in Debian/Mosq repos: https://github.com/Fourdee/DietPi/issues/1306 +DietPi-Software | PHP-FPM: Increased from "$CPU_CORES_TOTAL" to "pm.max_children = $(( $CPU_CORES_TOTAL * 3 ))". This should avoid failed forking of PHP-FPM processes/requests : https://github.com/Fourdee/DietPi/issues/1298 Bug Fixes: DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi drop during software installs/updates etc: https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480 @@ -16,6 +17,7 @@ DietPi-Software | WiFi Hotspot (Stretch): Resolved an issue where hostapd would DietPi-Software | Shairport-sync (Stretch): Resolved an issue where this would fail to install, due to pre-req URLS becomming invalid: https://github.com/Fourdee/DietPi/issues/1303 DietPi-Software | Plex Media Server: Resolved uninstall to include /var/lib/plexmediaserver in removal (which is not completed via apt purge). DietPi-Software | Resolved an issue where MariaDB would fail to uninstall correctly: https://github.com/Fourdee/DietPi/pull/1280 +DietPi-Software | Aira2 (Stretch): Resolved installation, now used APT installation: https://github.com/Fourdee/DietPi/issues/1310 DietPi-Update | dietpi.txt is now checked for missing entries, and, will now be patched during the update: https://github.com/Fourdee/DietPi/issues/1292#issuecomment-350818969 Sparky SBC | Kernel patch will be applied which resolves issues with HQPlayer playback: https://www.computeraudiophile.com/forums/topic/32132-allo-sparky-usbridge/?do=findComment&comment=753100 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f9cd413d58..9bda8a7532 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6691,47 +6691,55 @@ _EOF_ Banner_Installing - #aria2 binary - INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/aria2_' + if (( $DISTRO >= 4 )); then - # - armv6 - if (( $HW_ARCH == 1 )); then + AGI aria2 - INSTALL_URL_ADDRESS+='armv6.7z' + else - # - armv7+ - elif (( $HW_ARCH == 2 )); then + #aria2 binary + INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/aria2_' - INSTALL_URL_ADDRESS+='armv7.7z' + # - armv6 + if (( $HW_ARCH == 1 )); then - # - arm64 - elif (( $HW_ARCH == 3 )); then + INSTALL_URL_ADDRESS+='armv6.7z' - INSTALL_URL_ADDRESS+='arm64.7z' + # - armv7+ + elif (( $HW_ARCH == 2 )); then - # - x86_64 - elif (( $HW_ARCH == 10 )); then + INSTALL_URL_ADDRESS+='armv7.7z' - INSTALL_URL_ADDRESS+='x86_64.7z' + # - arm64 + elif (( $HW_ARCH == 3 )); then - fi + INSTALL_URL_ADDRESS+='arm64.7z' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then + # - x86_64 + elif (( $HW_ARCH == 10 )); then - # - prereqs - AGI libc-ares2 + INSTALL_URL_ADDRESS+='x86_64.7z' - wget "$INSTALL_URL_ADDRESS" -O package.7z - 7z x -y package.7z - rm package.7z + fi - mv aria2_* /usr/local/bin/aria2c - chmod +x /usr/local/bin/aria2c + /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + if (( $? == 0 )); then - else + # - prereqs + AGI libc-ares2 - Error_NoConnection_NoInstall + wget "$INSTALL_URL_ADDRESS" -O package.7z + 7z x -y package.7z + rm package.7z + + mv aria2_* /usr/local/bin/aria2c + chmod +x /usr/local/bin/aria2c + + else + + Error_NoConnection_NoInstall + + fi fi @@ -9044,7 +9052,7 @@ _EOF_ sed -i '/cgi.fix_pathinfo=/c\cgi.fix_pathinfo=1' "$FP_PHP_BASE_DIR"/fpm/php.ini # - PHP-FPM optimizations based on total cores - sed -i "/pm.max_children = /c\pm.max_children = $CPU_CORES_TOTAL" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf + sed -i "/pm.max_children = /c\pm.max_children = $(( $CPU_CORES_TOTAL * 3 ))" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf sed -i "/pm.start_servers = /c\pm.start_servers = $CPU_CORES_TOTAL" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf sed -i "/pm.min_spare_servers = /c\pm.min_spare_servers = $CPU_CORES_TOTAL" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf sed -i "/pm.max_spare_servers = /c\pm.max_spare_servers = $CPU_CORES_TOTAL" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf @@ -13530,11 +13538,11 @@ _EOF_ elif (( $1 == 132 )); then rm /etc/systemd/system/aria2.service - rm /usr/local/bin/aria2c - rm -R /var/www/aria2 + AGP aria2 + elif (( $1 == 133 )); then rm /etc/systemd/system/yacy.service From cb28077c3a5042ab67e95e6e31789b71fe217432 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 17 Dec 2017 03:34:53 +0000 Subject: [PATCH 057/390] v160 + Stretch binary diff location: https://github.com/Fourdee/DietPi/issues/1310 --- CHANGELOG.txt | 4 ++-- dietpi/dietpi-software | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 1d4b1c2ff0..99aa7a1fa8 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,7 +8,6 @@ DietPi-Boot | Improved the method of initial FS_partition and FS_expansion durin DietPi-Banner | IP: Will now also list the active network adapter used (eg: eth0/wlan0) DietPi-Set_Hardware | Sparky SBC: enable aotg.aotg1_speed compatibility setting for USB 1.1, when USB-DAC configured: https://github.com/Fourdee/DietPi/issues/1301 DietPi-Software | NAA Daemon: Updated to latest (3.5.2-36). Existing installs will be patched automatically: https://github.com/Fourdee/DietPi/issues/1305 -DietPi-Software | Mosquitto (Stretch): Resolved issue with failed install, due to unavailable pre-req libs in Debian/Mosq repos: https://github.com/Fourdee/DietPi/issues/1306 DietPi-Software | PHP-FPM: Increased from "$CPU_CORES_TOTAL" to "pm.max_children = $(( $CPU_CORES_TOTAL * 3 ))". This should avoid failed forking of PHP-FPM processes/requests : https://github.com/Fourdee/DietPi/issues/1298 Bug Fixes: @@ -16,8 +15,9 @@ DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi DietPi-Software | WiFi Hotspot (Stretch): Resolved an issue where hostapd would fail to run due to missing libssl1.0.0 lib, not available in repos: https://github.com/Fourdee/DietPi/issues/1299 DietPi-Software | Shairport-sync (Stretch): Resolved an issue where this would fail to install, due to pre-req URLS becomming invalid: https://github.com/Fourdee/DietPi/issues/1303 DietPi-Software | Plex Media Server: Resolved uninstall to include /var/lib/plexmediaserver in removal (which is not completed via apt purge). -DietPi-Software | Resolved an issue where MariaDB would fail to uninstall correctly: https://github.com/Fourdee/DietPi/pull/1280 +DietPi-Software | MariaDB: Resolved an issue where MariaDB would fail to uninstall correctly: https://github.com/Fourdee/DietPi/pull/1280 DietPi-Software | Aira2 (Stretch): Resolved installation, now used APT installation: https://github.com/Fourdee/DietPi/issues/1310 +DietPi-Software | Mosquitto (Stretch): Resolved issue with failed install, due to unavailable pre-req libs in Debian/Mosq repos: https://github.com/Fourdee/DietPi/issues/1306 DietPi-Update | dietpi.txt is now checked for missing entries, and, will now be patched during the update: https://github.com/Fourdee/DietPi/issues/1292#issuecomment-350818969 Sparky SBC | Kernel patch will be applied which resolves issues with HQPlayer playback: https://www.computeraudiophile.com/forums/topic/32132-allo-sparky-usbridge/?do=findComment&comment=753100 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 9bda8a7532..7b53756987 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11968,14 +11968,12 @@ Description=DietPi Aria2 [Service] Type=simple -ExecStart=/usr/local/bin/aria2c --enable-rpc --rpc-listen-all --rpc-secret=$GLOBAL_PW --dir=$FP_DIETPI_USERDATA_DIRECTORY/$FOLDER_DOWNLOADS +ExecStart=$(which aria2c) --enable-rpc --rpc-listen-all --rpc-secret=$GLOBAL_PW --dir=$FP_DIETPI_USERDATA_DIRECTORY/$FOLDER_DOWNLOADS [Install] WantedBy=multi-user.target _EOF_ - systemctl daemon-reload - fi #SYNCTHING From abd2eaa136786f9fadcac4e5abb98782d872a923 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 17 Dec 2017 06:16:32 +0000 Subject: [PATCH 058/390] v160 + Initial first pass: https://github.com/Fourdee/DietPi/issues/1311 --- dietpi/dietpi-software | 30 +++++----- dietpi/func/dietpi-globals | 118 +++++++++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+), 15 deletions(-) create mode 100644 dietpi/func/dietpi-globals diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 7b53756987..4be5ffa048 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -267,7 +267,7 @@ _EOF_ #Run Installation Flag (1 = run installs) GOSTARTINSTALL=0 - INSTALL_URL_ADDRESS="" + INSTALL_URL_ADDRESS='' INSTALL_DESCRIPTION='DietPi' #Special installation Vars @@ -329,15 +329,15 @@ _EOF_ TOTAL_SOFTWARE_INDEXS=0 TOTAL_SOFTWARE_INDEXS_HARDLIMIT=171 #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 @@ -2682,8 +2682,8 @@ _EOF_ for ((i=0; i<$TOTAL_SOFTWARE_INDEXS; i++)) do - if (( ${aSOFTWARE_REQUIRES_USERINPUT[$i]} && - ${aSOFTWARE_INSTALL_STATE[$i]} == 1 )); then + if (( ${aSOFTWARE_INSTALL_STATE[$i]} == 1 && + ${aSOFTWARE_REQUIRES_USERINPUT[$i]} )); then # - Disable aSOFTWARE_INSTALL_STATE[$i]=0 @@ -9361,7 +9361,7 @@ innodb_file_per_table=1 _EOF_ # Check if we really do fresh installation: local oc_is_fresh=1 - if [ -d /mnt/dietpi_userdata/mysql/owncloud ]; then + if [ -d "$FP_DIETPI_USERDATA_DIRECTORY"/mysql/owncloud ]; then oc_is_fresh=0 @@ -9534,7 +9534,7 @@ innodb_file_per_table=1 _EOF_ # Check if we really do fresh installation: local nc_is_fresh=1 - if [ -d /mnt/dietpi_userdata/mysql/nextcloud ]; then + if [ -d "$FP_DIETPI_USERDATA_DIRECTORY"/mysql/nextcloud ]; then nc_is_fresh=0 @@ -12669,8 +12669,8 @@ After=network.target [Service] Type=simple User=root -Environment=ROON_DATAROOT=/mnt/dietpi_userdata/roonserver -ExecStart=/mnt/dietpi_userdata/roonserver/start.sh +Environment=ROON_DATAROOT=$FP_DIETPI_USERDATA_DIRECTORY/roonserver +ExecStart=$FP_DIETPI_USERDATA_DIRECTORY/roonserver/start.sh [Install] WantedBy=multi-user.target @@ -12725,7 +12725,7 @@ _EOF_ # Create simple mandatory default configuration file cat << _EOF_ >> /etc/default/minio # Default file path -MINIO_VOLUMES="/mnt/dietpi_userdata/minio-data" +MINIO_VOLUMES="$FP_DIETPI_USERDATA_DIRECTORY/minio-data" # Use if you want to run Minio on a custom port. # MINIO_OPTS="--address :9199" # Access Key of the server. @@ -13196,7 +13196,7 @@ _EOF_ 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 + ln -sf "$FP_DIETPI_USERDATA_DIRECTORY"/voice-recognizer-raspi/assistant.json /home/dietpi/assistant.json # - Generate cache dir mkdir -p /home/dietpi/.cache/voice-recognizer diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals new file mode 100644 index 0000000000..8069a95a22 --- /dev/null +++ b/dietpi/func/dietpi-globals @@ -0,0 +1,118 @@ +#!/bin/bash +{ + #//////////////////////////////////// + # DietPi-Globals + # + #//////////////////////////////////// + # Created by Daniel Knight / daniel.knight@dietpi.com / dietpi.com + # + #//////////////////////////////////// + # + # Info: + # - Allows export of shared DietPi global variables into current bash session, and, other scripts + # Notes: + # - . /DietPi/dietpi/func/dietpi-globals > $HOME/.bashrc + #//////////////////////////////////// + + #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. + LANG=en_GB.UTF-8 + + /DietPi/dietpi/func/dietpi-notify 2 'Updating DietPi-Globals, please wait...' + + #----------------------------------------------------------------------------------- + # Hardware Details + #----------------------------------------------------------------------------------- + #Update + if [ "$1" = 'update_hw_details' ] || + [ ! -f /DietPi/dietpi/.hw_model ]; then + + /DietPi/dietpi/dietpi-obtain_hw_model + + fi + + #Globals + HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) + HW_MODEL_DESCRIPTION=$(sed -n 2p /DietPi/dietpi/.hw_model) + HW_ARCH=$(sed -n 6p /DietPi/dietpi/.hw_model) + DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) + DISTRO_NAME='jessie' + if (( $DISTRO == 4 )); then + + DISTRO_NAME='stretch' + + elif (( $DISTRO == 5 )); then + + DISTRO_NAME='buster' + + fi + #HW_CPU_CORES=$(nproc --all) + + + #----------------------------------------------------------------------------------- + # User-Data + #----------------------------------------------------------------------------------- + FP_DIETPI_USERDATA_DIRECTORY='/mnt/dietpi_userdata' + + #----------------------------------------------------------------------------------- + # APT + #----------------------------------------------------------------------------------- + FP_LOG_APT='/etc/dietpi/logs/dietpi-software_apt.log' + EXITCODE_APT=0 #only way I found of exporting the exit code, once the command is run. + + AGI(){ + + local string="$@" + local force_options='' + + if (( $DISTRO >= 4 )); then + + force_options='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' + + else + + force_options='--force-yes' + + fi + + #-qq can add a slight period of appearing nothing is happening, lets inform user + /DietPi/dietpi/func/dietpi-notify 2 "APT is processing, please wait...\n" + DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $force_options $string 2>&1 | tee "$FP_LOG_APT" + EXITCODE_APT=${PIPESTATUS[0]} + + } + + #apt-get purge + AGP(){ + + local string="$@" + if (( $DISTRO >= 4 )); then + + string+=' --allow-change-held-packages' + + fi + + apt-get purge -y $string + EXITCODE_APT=${PIPESTATUS[0]} + + } + + #apt-get autoremove + AGA(){ + + apt-get autoremove --purge -y + EXITCODE_APT=${PIPESTATUS[0]} + + } + + #apt-get install -f + AGF(){ + + DEBIAN_FRONTEND=noninteractive apt-get install -f -y $force_options 2>&1 | tee "$FP_LOG_APT" + EXITCODE_APT=${PIPESTATUS[0]} + + } + + #----------------------------------------------------------------------------------- + /DietPi/dietpi/func/dietpi-notify 0 'DietPi-Globals\n' + #----------------------------------------------------------------------------------- +} From 03af04404eeb0e0d6d6cfd176421b60ba5597bf0 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 17 Dec 2017 07:06:13 +0000 Subject: [PATCH 059/390] v160 + Globals test with dietpi-software: https://github.com/Fourdee/DietPi/issues/1311 --- CHANGELOG.txt | 1 + PREP_SYSTEM_FOR_DIETPI.sh | 7 +- dietpi/dietpi-drive_manager | 4 +- dietpi/dietpi-software | 553 +++++++++++++++++------------------- dietpi/func/dietpi-globals | 50 +++- dietpi/patch_file | 14 + 6 files changed, 320 insertions(+), 309 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 99aa7a1fa8..395c95eca8 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ Image Modifications: Changes / Improvements / Optimizations: DietPi-Boot | Improved the method of initial FS_partition and FS_expansion during 1st run, via systemD services. 'fs_force_resize=' in dietpi.txt is no longer supported: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352159930 DietPi-Banner | IP: Will now also list the active network adapter used (eg: eth0/wlan0) +DietPi-Globals | Global variables and functions are now exported during login. Please see the sourcecode for more information: https://github.com/Fourdee/DietPi/issues/1311 DietPi-Set_Hardware | Sparky SBC: enable aotg.aotg1_speed compatibility setting for USB 1.1, when USB-DAC configured: https://github.com/Fourdee/DietPi/issues/1301 DietPi-Software | NAA Daemon: Updated to latest (3.5.2-36). Existing installs will be patched automatically: https://github.com/Fourdee/DietPi/issues/1305 DietPi-Software | PHP-FPM: Increased from "$CPU_CORES_TOTAL" to "pm.max_children = $(( $CPU_CORES_TOTAL * 3 ))". This should avoid failed forking of PHP-FPM processes/requests : https://github.com/Fourdee/DietPi/issues/1298 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 27c499f83c..06aaa9bbcb 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1129,6 +1129,7 @@ _EOF_ dietpi-notify 2 "Configuring bash:" + #NB: we need to clear existing DietPi entries, then update with new cat << _EOF_ >> /etc/bash.bashrc #LANG export \$(cat /etc/default/locale | grep LANG=) @@ -1181,7 +1182,11 @@ _EOF_ # - login, sed -i '/DietPi/d' /root/.bashrc #prevents dupes - echo -e "\n/DietPi/dietpi/login" >> /root/.bashrc + cat << _EOF_ >> /root/.bashrc +/DietPi/dietpi/login +. /DietPi/dietpi/func/dietpi-globals +_EOF_ + Error_Check dietpi-notify 2 "Configuring fakehwclock:" diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index d617c87e8b..2c86523de1 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -639,12 +639,12 @@ if (( $(mount | grep -m1 '[[:space:]]/[[:space:]]' | grep -ci -m1 '(ro,') )); then /DietPi/dietpi/func/dietpi-notify 1 "RootFS is currently set to R/O." - /DietPi/dietpi/func/dietpi-notify 2 "DietPi requires RootFS R/W access. Please run 'dietpi-drive_manager' to re-enable." + /DietPi/dietpi/func/dietpi-notify 2 "DietPi requires RootFS R/W access. Please run 'dietpi-drive_manager' to re-enable.\n" EXIT_CODE=1 else - /DietPi/dietpi/func/dietpi-notify 0 "RootFS R/W access." + /DietPi/dietpi/func/dietpi-notify 0 "RootFS R/W access.\n" fi diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 4be5ffa048..b6518ccc30 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -23,52 +23,10 @@ # - /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. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - - #Exit path for non-root logins. - if (( $UID != 0 )); then - - /DietPi/dietpi/func/dietpi-notify 1 'Error: Root privileges required. Please run the command with "sudo"\n' - exit - - fi - - #RootFS RW check - /DietPi/dietpi/dietpi-drive_manager 3 - if (( $? != 0 )); then - - exit - - fi - - #///////////////////////////////////////////////////////////////////////////////////// - #Obtain Install Stage Index - #///////////////////////////////////////////////////////////////////////////////////// - # -1 = first boot / 0 = run dietpi-software at login / 1 = completed - DIETPI_INSTALL_STAGE=$(cat /DietPi/dietpi/.install_stage) - - #///////////////////////////////////////////////////////////////////////////////////// - #Hardware Details - #///////////////////////////////////////////////////////////////////////////////////// - HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) # 0=1(256) 1=1(512) 2=2(1024) - HW_MODEL_DESCRIPTION=$(sed -n 2p /DietPi/dietpi/.hw_model) - HW_ARCH=$(sed -n 6p /DietPi/dietpi/.hw_model) - CPU_CORES_TOTAL=$(nproc --all) - DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) - DISTRO_NAME='jessie' - if (( $DISTRO == 4 )); then - - DISTRO_NAME='stretch' - - elif (( $DISTRO == 5 )); then - - DISTRO_NAME='buster' - - fi + #Import DietPi-Globals + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + CHECK_ROOTFS_RW #///////////////////////////////////////////////////////////////////////////////////// #Filepath @@ -78,10 +36,7 @@ FP_DIETPIAUTOMATION_LOG='/root/DietPi-Automation.log' - FP_APT_LOG='/etc/dietpi/logs/dietpi-software_apt.log' - #Used to set user/personal data directories (eg: usbdrive) - FP_DIETPI_USERDATA_DIRECTORY='/mnt/dietpi_userdata' FP_DIETPI_DEDICATED_USBDRIVE='' #Uninstall temp file @@ -3374,26 +3329,26 @@ _EOF_ Create_UserContent_Folders(){ - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/"$FOLDER_MUSIC" - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/"$FOLDER_PICTURES" - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/"$FOLDER_VIDEO" - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/"$FOLDER_DOWNLOADS" + mkdir -p "$FP_DIETPI_USERDATA"/"$FOLDER_MUSIC" + mkdir -p "$FP_DIETPI_USERDATA"/"$FOLDER_PICTURES" + mkdir -p "$FP_DIETPI_USERDATA"/"$FOLDER_VIDEO" + mkdir -p "$FP_DIETPI_USERDATA"/"$FOLDER_DOWNLOADS" } Download_Test_Media(){ - if [ ! -f "$FP_DIETPI_USERDATA_DIRECTORY/$FOLDER_MUSIC"/fourdee_tech.ogg ]; then + if [ ! -f "$FP_DIETPI_USERDATA/$FOLDER_MUSIC"/fourdee_tech.ogg ]; then #Grab My test music - wget http://dietpi.com/downloads/audio/fourdee_tech.ogg -O "$FP_DIETPI_USERDATA_DIRECTORY/$FOLDER_MUSIC"/fourdee_tech.ogg - #wget http://dietpi.com/downloads/audio/fourdee_space.mp3 -O "$FP_DIETPI_USERDATA_DIRECTORY/$FOLDER_MUSIC"/fourdee_space.mp3 + wget http://dietpi.com/downloads/audio/fourdee_tech.ogg -O "$FP_DIETPI_USERDATA/$FOLDER_MUSIC"/fourdee_tech.ogg + #wget http://dietpi.com/downloads/audio/fourdee_space.mp3 -O "$FP_DIETPI_USERDATA/$FOLDER_MUSIC"/fourdee_space.mp3 #Grab Absolute Radio Streams - wget http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=vrbb -O "$FP_DIETPI_USERDATA_DIRECTORY/$FOLDER_MUSIC"/Absolute-Radio.pls - wget http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=a8bb -O "$FP_DIETPI_USERDATA_DIRECTORY/$FOLDER_MUSIC"/Absolute-Radio-80s.pls - wget http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=a9bb -O "$FP_DIETPI_USERDATA_DIRECTORY/$FOLDER_MUSIC"/Absolute-Radio-90s.pls - wget http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=a0bb -O "$FP_DIETPI_USERDATA_DIRECTORY/$FOLDER_MUSIC"/Absolute-Radio-00s.pls + wget http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=vrbb -O "$FP_DIETPI_USERDATA/$FOLDER_MUSIC"/Absolute-Radio.pls + wget http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=a8bb -O "$FP_DIETPI_USERDATA/$FOLDER_MUSIC"/Absolute-Radio-80s.pls + wget http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=a9bb -O "$FP_DIETPI_USERDATA/$FOLDER_MUSIC"/Absolute-Radio-90s.pls + wget http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=a0bb -O "$FP_DIETPI_USERDATA/$FOLDER_MUSIC"/Absolute-Radio-00s.pls fi @@ -3414,7 +3369,7 @@ _EOF_ #-qq can add a slight period of appearing nothing is happening, lets inform user /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" + DEBIAN_FRONTEND=noninteractive $APT_BINARY install -y -qq $force_options $string 2>&1 | tee "$FP_LOG_APT" local result=${PIPESTATUS[0]} if (( $result != 0 )); then @@ -3442,7 +3397,7 @@ _EOF_ #apt-get install -f AGF(){ - DEBIAN_FRONTEND=noninteractive $APT_BINARY install -f -y $force_options 2>&1 | tee "$FP_APT_LOG" + DEBIAN_FRONTEND=noninteractive $APT_BINARY install -f -y $force_options 2>&1 | tee "$FP_LOG_APT" local result=${PIPESTATUS[0]} if (( $result != 0 )); then @@ -3580,8 +3535,8 @@ _EOF_ # git clone --depth=1 "$INSTALL_URL_ADDRESS" # # # - Move HTPC Manager to a 'better' location - # mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/htpc-manager - # mv "$HOME"/HTPC-Manager/* "$FP_DIETPI_USERDATA_DIRECTORY"/htpc-manager/ + # mkdir -p "$FP_DIETPI_USERDATA"/htpc-manager + # mv "$HOME"/HTPC-Manager/* "$FP_DIETPI_USERDATA"/htpc-manager/ # rm -R "$HOME"/HTPC-Manager # # else @@ -4105,7 +4060,7 @@ _EOF_ # - compile cd "$HOME"/libzmq - ./autogen.sh && ./configure && make -j $CPU_CORES_TOTAL + ./autogen.sh && ./configure && make -j $HW_CPU_CORES make check && make install && ldconfig cd "$HOME"/pynacl @@ -4559,7 +4514,7 @@ _EOF_ #Download binaries # - Backup existing autostart.uae for user - mv "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/conf/autostart.uae "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/conf/autostart_pre-dietpi-update.uae &> /dev/null + mv "$FP_DIETPI_USERDATA"/amiberry/conf/autostart.uae "$FP_DIETPI_USERDATA"/amiberry/conf/autostart_pre-dietpi-update.uae &> /dev/null wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z -o/etc @@ -4588,7 +4543,7 @@ _EOF_ AGI libsdl-mixer1.2 libsdl1.2debian libphysfs1 wget "$INSTALL_URL_ADDRESS" -O package.7z - 7z x -y package.7z -o"$FP_DIETPI_USERDATA_DIRECTORY" + 7z x -y package.7z -o"$FP_DIETPI_USERDATA" rm package.7z else @@ -4638,7 +4593,7 @@ _EOF_ cd urbackup-server-* ./configure - make -j $CPU_CORES_TOTAL + make -j $HW_CPU_CORES make install sed -i "/ExecStart=/c ExecStart=/usr/local/bin/urbackupsrv run --config /etc/default/urbackupsrv --no-consoletime" urbackup-server.service @@ -4655,7 +4610,7 @@ _EOF_ wget "$INSTALL_URL_ADDRESS" -O package.deb - echo -e "urbackup-server urbackup/backuppath string $FP_DIETPI_USERDATA_DIRECTORY/urbackup" | debconf-set-selections + echo -e "urbackup-server urbackup/backuppath string $FP_DIETPI_USERDATA/urbackup" | debconf-set-selections dpkg -i package.deb apt-get -f install -y @@ -5487,7 +5442,7 @@ _EOF_ #Pre-reqs AGI libpcre3-dev libssl-dev #Compile and install - make -j $CPU_CORES_TOTAL TARGET=linux2628 CPU=generic USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 USE_LINUX_SPLICE=1 + make -j $HW_CPU_CORES TARGET=linux2628 CPU=generic USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 USE_LINUX_SPLICE=1 make install mkdir /etc/haproxy @@ -6570,8 +6525,8 @@ _EOF_ #prereqs AGI python python3 supervisor rdiff-backup screen rsync - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/mineos - cd "$FP_DIETPI_USERDATA_DIRECTORY"/mineos + mkdir -p "$FP_DIETPI_USERDATA"/mineos + cd "$FP_DIETPI_USERDATA"/mineos git clone https://github.com/hexparrot/mineos-node.git minecraft cd minecraft @@ -7181,7 +7136,7 @@ _EOF_ INSTALL_URL_ADDRESS+='/download/0.0.3-alpha/spotify-connect-web_0.0.3-alpha.tar.gz' wget "$INSTALL_URL_ADDRESS" -O package.tar - tar zxvf package.tar -C "$FP_DIETPI_USERDATA_DIRECTORY"/ + tar zxvf package.tar -C "$FP_DIETPI_USERDATA"/ rm package.tar else @@ -7414,8 +7369,8 @@ _EOF_ INSTALL_URL_ADDRESS+='/download/nzbget-latest-bin-linux.run' wget "$INSTALL_URL_ADDRESS" -O package.run - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/nzbget - sh package.run --destdir "$FP_DIETPI_USERDATA_DIRECTORY"/nzbget + mkdir -p "$FP_DIETPI_USERDATA"/nzbget + sh package.run --destdir "$FP_DIETPI_USERDATA"/nzbget rm package.run else @@ -7445,8 +7400,8 @@ _EOF_ git clone --depth=1 "$INSTALL_URL_ADDRESS" # - Move HTPC Manager to a 'better' location - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/htpc-manager - mv "$HOME"/HTPC-Manager/* "$FP_DIETPI_USERDATA_DIRECTORY"/htpc-manager/ + mkdir -p "$FP_DIETPI_USERDATA"/htpc-manager + mv "$HOME"/HTPC-Manager/* "$FP_DIETPI_USERDATA"/htpc-manager/ rm -R "$HOME"/HTPC-Manager # - psutil for system stats @@ -7471,9 +7426,9 @@ _EOF_ AGI python python-dev git clone "$INSTALL_URL_ADDRESS" - mv OctoPrint* "$FP_DIETPI_USERDATA_DIRECTORY"/octoprint + mv OctoPrint* "$FP_DIETPI_USERDATA"/octoprint - cd "$FP_DIETPI_USERDATA_DIRECTORY"/octoprint + cd "$FP_DIETPI_USERDATA"/octoprint python setup.py install cd "$HOME" @@ -7502,7 +7457,7 @@ _EOF_ tar xvf package.tar rm package.tar - mv RoonServer "$FP_DIETPI_USERDATA_DIRECTORY"/roonserver + mv RoonServer "$FP_DIETPI_USERDATA"/roonserver else @@ -7575,7 +7530,7 @@ _EOF_ adduser --system --group minio-user # Create default data directory & grant minio-user proper access - mkdir "$FP_DIETPI_USERDATA_DIRECTORY"/minio-data + mkdir "$FP_DIETPI_USERDATA"/minio-data fi @@ -7692,10 +7647,10 @@ _EOF_ if (( $? == 0 )); then # - Data storage / user data - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/gitea/gitea-repositories + mkdir -p "$FP_DIETPI_USERDATA"/gitea/gitea-repositories - wget "$INSTALL_URL_ADDRESS" -O "$FP_DIETPI_USERDATA_DIRECTORY"/gitea/gitea - chmod +x "$FP_DIETPI_USERDATA_DIRECTORY"/gitea/gitea + wget "$INSTALL_URL_ADDRESS" -O "$FP_DIETPI_USERDATA"/gitea/gitea + chmod +x "$FP_DIETPI_USERDATA"/gitea/gitea else @@ -7904,8 +7859,8 @@ libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - git clone "$INSTALL_URL_ADDRESS" "$FP_DIETPI_USERDATA_DIRECTORY"/voice-recognizer-raspi - cd "$FP_DIETPI_USERDATA_DIRECTORY"/voice-recognizer-raspi + git clone "$INSTALL_URL_ADDRESS" "$FP_DIETPI_USERDATA"/voice-recognizer-raspi + cd "$FP_DIETPI_USERDATA"/voice-recognizer-raspi pip3 install --upgrade pip virtualenv virtualenv --system-site-packages -p python3 env @@ -7919,7 +7874,7 @@ libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc fi # - Services - sed -i "s#/home/pi#$FP_DIETPI_USERDATA_DIRECTORY#g" systemd/voice-recognizer.service + sed -i "s#/home/pi#$FP_DIETPI_USERDATA#g" systemd/voice-recognizer.service sed -i "/^User=/c\User=dietpi" systemd/voice-recognizer.service cp systemd/voice-recognizer.service /etc/systemd/system/ @@ -8739,7 +8694,7 @@ _EOF_ Install_Apply_Permissions(){ #Not all permissions are listed here. - # - Only ones which are shared across programs, and/or located inside FP_DIETPI_USERDATA_DIRECTORY that require non-root permissions. + # - Only ones which are shared across programs, and/or located inside FP_DIETPI_USERDATA that require non-root permissions. #- /var/www / www-data chown -R www-data:www-data /var/www @@ -8750,42 +8705,42 @@ _EOF_ chmod -R 777 /var/www/ompd/stream #(required for streaming files) chmod -R 777 /var/www/ompd/cache #(required for downloading files) - #Apply non-root permissions for files and folders in FP_DIETPI_USERDATA_DIRECTORY + #Apply non-root permissions for files and folders in FP_DIETPI_USERDATA # - dietpi user chown -R dietpi:dietpi /home/dietpi - chown -R dietpi:dietpi "$FP_DIETPI_USERDATA_DIRECTORY" - chmod -R 775 "$FP_DIETPI_USERDATA_DIRECTORY" + chown -R dietpi:dietpi "$FP_DIETPI_USERDATA" + chmod -R 775 "$FP_DIETPI_USERDATA" # + for symlinked locations - chown -R dietpi:dietpi "$FP_DIETPI_USERDATA_DIRECTORY"/* - chmod -R 775 "$FP_DIETPI_USERDATA_DIRECTORY"/* + chown -R dietpi:dietpi "$FP_DIETPI_USERDATA"/* + chmod -R 775 "$FP_DIETPI_USERDATA"/* # - MPD - chown -R mpd:audio "$FP_DIETPI_USERDATA_DIRECTORY"/.mpd_cache + chown -R mpd:audio "$FP_DIETPI_USERDATA"/.mpd_cache # - MySQL data store - chown -R mysql:mysql "$FP_DIETPI_USERDATA_DIRECTORY"/mysql - chmod -R 770 "$FP_DIETPI_USERDATA_DIRECTORY"/mysql + chown -R mysql:mysql "$FP_DIETPI_USERDATA"/mysql + chmod -R 770 "$FP_DIETPI_USERDATA"/mysql - chown -R mineos:mineos "$FP_DIETPI_USERDATA_DIRECTORY"/mineos/serverdata - chown -R urbackup:urbackup "$FP_DIETPI_USERDATA_DIRECTORY"/urbackup - #chown -R couchpotato:couchpotato "$FP_DIETPI_USERDATA_DIRECTORY"/couchpotato + chown -R mineos:mineos "$FP_DIETPI_USERDATA"/mineos/serverdata + chown -R urbackup:urbackup "$FP_DIETPI_USERDATA"/urbackup + #chown -R couchpotato:couchpotato "$FP_DIETPI_USERDATA"/couchpotato # - www-data - chown -R www-data:www-data "$FP_DIETPI_USERDATA_DIRECTORY"/dietpicam - chown -R www-data:www-data "$FP_DIETPI_USERDATA_DIRECTORY"/pydio_data - chown -R www-data:www-data "$FP_DIETPI_USERDATA_DIRECTORY"/owncloud_data - chown -R www-data:www-data "$FP_DIETPI_USERDATA_DIRECTORY"/nextcloud_data + chown -R www-data:www-data "$FP_DIETPI_USERDATA"/dietpicam + chown -R www-data:www-data "$FP_DIETPI_USERDATA"/pydio_data + chown -R www-data:www-data "$FP_DIETPI_USERDATA"/owncloud_data + chown -R www-data:www-data "$FP_DIETPI_USERDATA"/nextcloud_data # - Home Assistant Permissions #chown -R homeassistant:dietpi /home/homeassistant/.homeassistant - #chown -R dietpi:dietpi "$FP_DIETPI_USERDATA_DIRECTORY"/homeassistant + #chown -R dietpi:dietpi "$FP_DIETPI_USERDATA"/homeassistant # - Minio - chown -R minio-user:minio-user "$FP_DIETPI_USERDATA_DIRECTORY"/minio-data + chown -R minio-user:minio-user "$FP_DIETPI_USERDATA"/minio-data # - FuguHub - chown -R bd:bd "$FP_DIETPI_USERDATA_DIRECTORY"/fuguhub-data/ + chown -R bd:bd "$FP_DIETPI_USERDATA"/fuguhub-data/ } @@ -8917,7 +8872,7 @@ _EOF_ cat << _EOF_ > /etc/apache2/mods-available/mpm_event.conf -StartServers $CPU_CORES_TOTAL +StartServers $HW_CPU_CORES MinSpareThreads 1 MaxSpareThreads 8 ThreadLimit 16 @@ -8929,9 +8884,9 @@ _EOF_ cat << _EOF_ > /etc/apache2/mods-available/mpm_prefork.conf -StartServers $CPU_CORES_TOTAL +StartServers $HW_CPU_CORES MinSpareServers 1 -MaxSpareServers $CPU_CORES_TOTAL +MaxSpareServers $HW_CPU_CORES MaxRequestWorkers 50 MaxConnectionsPerChild 0 @@ -8939,7 +8894,7 @@ _EOF_ cat << _EOF_ > /etc/apache2/mods-available/mpm_worker.conf -StartServers $CPU_CORES_TOTAL +StartServers $HW_CPU_CORES MinSpareThreads 1 MaxSpareThreads 8 ThreadLimit 16 @@ -8976,7 +8931,7 @@ _EOF_ fi # - CPU core count - sed -i "/worker_processes/c\worker_processes $CPU_CORES_TOTAL;" /etc/nginx/nginx.conf + sed -i "/worker_processes/c\worker_processes $HW_CPU_CORES;" /etc/nginx/nginx.conf #Default site cp /DietPi/dietpi/conf/nginx.site-available-default /etc/nginx/sites-available/default @@ -9052,10 +9007,10 @@ _EOF_ sed -i '/cgi.fix_pathinfo=/c\cgi.fix_pathinfo=1' "$FP_PHP_BASE_DIR"/fpm/php.ini # - PHP-FPM optimizations based on total cores - sed -i "/pm.max_children = /c\pm.max_children = $(( $CPU_CORES_TOTAL * 3 ))" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf - sed -i "/pm.start_servers = /c\pm.start_servers = $CPU_CORES_TOTAL" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf - sed -i "/pm.min_spare_servers = /c\pm.min_spare_servers = $CPU_CORES_TOTAL" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf - sed -i "/pm.max_spare_servers = /c\pm.max_spare_servers = $CPU_CORES_TOTAL" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf + sed -i "/pm.max_children = /c\pm.max_children = $(( $HW_CPU_CORES * 3 ))" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf + sed -i "/pm.start_servers = /c\pm.start_servers = $HW_CPU_CORES" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf + sed -i "/pm.min_spare_servers = /c\pm.min_spare_servers = $HW_CPU_CORES" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf + sed -i "/pm.max_spare_servers = /c\pm.max_spare_servers = $HW_CPU_CORES" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf # - Enviroment PHP settings: sed -i "/env\[HOSTNAME\]/c\env\[HOSTNAME\] = \$HOSTNAME" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf @@ -9187,18 +9142,18 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[86]} == 1 || ${aSOFTWARE_INSTALL_STATE[88]} == 1 )); then - if [ "$(readlink /var/lib/mysql)" != "$FP_DIETPI_USERDATA_DIRECTORY/mysql" ]; then + if [ "$(readlink /var/lib/mysql)" != "$FP_DIETPI_USERDATA/mysql" ]; then systemctl stop mysql # - Create target dir - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/mysql + mkdir -p "$FP_DIETPI_USERDATA"/mysql # - copy - cp -R /var/lib/mysql/* "$FP_DIETPI_USERDATA_DIRECTORY"/mysql/ + cp -R /var/lib/mysql/* "$FP_DIETPI_USERDATA"/mysql/ if (( $? != 0 )); then - /DietPi/dietpi/func/dietpi-notify 1 "Moving of MySQL data store failed to $FP_DIETPI_USERDATA_DIRECTORY/mysql. DietPi-Software will now exit" + /DietPi/dietpi/func/dietpi-notify 1 "Moving of MySQL data store failed to $FP_DIETPI_USERDATA/mysql. DietPi-Software will now exit" Exit_Destroy fi @@ -9206,7 +9161,7 @@ _EOF_ rm -R /var/lib/mysql # - Symlink - ln -sf "$FP_DIETPI_USERDATA_DIRECTORY"/mysql /var/lib/mysql + ln -sf "$FP_DIETPI_USERDATA"/mysql /var/lib/mysql chown mysql:mysql /var/lib/mysql @@ -9361,7 +9316,7 @@ innodb_file_per_table=1 _EOF_ # Check if we really do fresh installation: local oc_is_fresh=1 - if [ -d "$FP_DIETPI_USERDATA_DIRECTORY"/mysql/owncloud ]; then + if [ -d "$FP_DIETPI_USERDATA"/mysql/owncloud ]; then oc_is_fresh=0 @@ -9375,7 +9330,7 @@ _EOF_ local config_php='/var/www/owncloud/config/config.php' # Terminal installation: - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/owncloud_data + mkdir -p "$FP_DIETPI_USERDATA"/owncloud_data Install_Apply_Permissions &> /dev/null local username=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_nextcloud_username=' | sed 's/.*=//') if [ ! -n "$username" ]; then @@ -9386,7 +9341,7 @@ _EOF_ systemctl start mysql # For MariaDB, temporary database admin user needs to be created, as 'root' uses unix_socket login, which cannot be accessed by sudo -u www-data. mysql -uroot -p"$GLOBAL_PW" -e "grant all privileges on *.* to 'tmp_root'@'localhost' identified by '$GLOBAL_PW' with grant option" - grep -q "'installed' => true," $config_php 2>/dev/null || occ maintenance:install --no-interaction --database "mysql" --database-name "owncloud" --database-user "tmp_root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$FP_DIETPI_USERDATA_DIRECTORY/owncloud_data" + grep -q "'installed' => true," $config_php 2>/dev/null || occ maintenance:install --no-interaction --database "mysql" --database-name "owncloud" --database-user "tmp_root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$FP_DIETPI_USERDATA/owncloud_data" mysql -uroot -p"$GLOBAL_PW" -e "drop user 'tmp_root'@'localhost'" # Enable MySQL 4-byte support for new installations only, to prevent risky database conversion tasks: @@ -9534,7 +9489,7 @@ innodb_file_per_table=1 _EOF_ # Check if we really do fresh installation: local nc_is_fresh=1 - if [ -d "$FP_DIETPI_USERDATA_DIRECTORY"/mysql/nextcloud ]; then + if [ -d "$FP_DIETPI_USERDATA"/mysql/nextcloud ]; then nc_is_fresh=0 @@ -9548,7 +9503,7 @@ _EOF_ local config_php='/var/www/nextcloud/config/config.php' # Terminal installation: - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/nextcloud_data + mkdir -p "$FP_DIETPI_USERDATA"/nextcloud_data Install_Apply_Permissions &> /dev/null local username=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_nextcloud_username=' | sed 's/.*=//') if [ ! -n "$username" ]; then @@ -9559,7 +9514,7 @@ _EOF_ systemctl start mysql # For MariaDB, temporary database admin user needs to be created, as 'root' uses unix_socket login, which cannot be accessed by sudo -u www-data. mysql -uroot -p"$GLOBAL_PW" -e "grant all privileges on *.* to 'tmp_root'@'localhost' identified by '$GLOBAL_PW' with grant option" - grep -q "'installed' => true," $config_php 2>/dev/null || ncc maintenance:install --no-interaction --database "mysql" --database-name "nextcloud" --database-user "tmp_root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$FP_DIETPI_USERDATA_DIRECTORY/nextcloud_data" + grep -q "'installed' => true," $config_php 2>/dev/null || ncc maintenance:install --no-interaction --database "mysql" --database-name "nextcloud" --database-user "tmp_root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$FP_DIETPI_USERDATA/nextcloud_data" mysql -uroot -p"$GLOBAL_PW" -e "drop user 'tmp_root'@'localhost'" # Enable MySQL 4-byte support for new installations only, to prevent risky database conversion tasks: @@ -9663,7 +9618,7 @@ _EOF_ "blocklist-url": "http://www.example.com/blocklist", "cache-size-mb": 48, "dht-enabled": true, - "download-dir": "$FP_DIETPI_USERDATA_DIRECTORY/downloads", + "download-dir": "$FP_DIETPI_USERDATA/downloads", "download-limit": 100, "download-limit-enabled": false, "download-queue-enabled": true, @@ -9671,7 +9626,7 @@ _EOF_ "encryption": 2, "idle-seeding-limit": 1, "idle-seeding-limit-enabled": true, - "incomplete-dir": "$FP_DIETPI_USERDATA_DIRECTORY/bt-inprogress", + "incomplete-dir": "$FP_DIETPI_USERDATA/bt-inprogress", "incomplete-dir-enabled": false, "lpd-enabled": false, "max-peers-global": 8, @@ -9763,7 +9718,7 @@ _EOF_ chown -R mpd:audio /var/log/mpd # cache - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/.mpd_cache + mkdir -p "$FP_DIETPI_USERDATA"/.mpd_cache #MPD service/confs cat << _EOF_ > /etc/default/mpd @@ -9826,7 +9781,7 @@ _EOF_ sed -i "/root/c\#root" /etc/ftpusers cp /DietPi/dietpi/conf/proftpd.conf /etc/proftpd/proftpd.conf - sed -i "/DefaultRoot /c\DefaultRoot $FP_DIETPI_USERDATA_DIRECTORY" /etc/proftpd/proftpd.conf + sed -i "/DefaultRoot /c\DefaultRoot $FP_DIETPI_USERDATA" /etc/proftpd/proftpd.conf fi @@ -9837,7 +9792,7 @@ _EOF_ echo -e "dietpi\ndietpi" | smbpasswd -s -a root cp /DietPi/dietpi/conf/smb.conf /etc/samba/smb.conf - sed -i "/path = /c\path = $FP_DIETPI_USERDATA_DIRECTORY" /etc/samba/smb.conf + sed -i "/path = /c\path = $FP_DIETPI_USERDATA" /etc/samba/smb.conf fi @@ -9848,7 +9803,7 @@ _EOF_ sed -i '/root/c\#root' /etc/ftpusers cp /DietPi/dietpi/conf/vsftpd.conf /etc/vsftpd.conf - sed -i "/^local_root=/c\local_root=$FP_DIETPI_USERDATA_DIRECTORY" /etc/vsftpd.conf + sed -i "/^local_root=/c\local_root=$FP_DIETPI_USERDATA" /etc/vsftpd.conf fi @@ -9857,7 +9812,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then cat << _EOF_ > /etc/exports -$FP_DIETPI_USERDATA_DIRECTORY *(rw,async,no_root_squash,fsid=0,crossmnt,no_subtree_check) +$FP_DIETPI_USERDATA *(rw,async,no_root_squash,fsid=0,crossmnt,no_subtree_check) _EOF_ fi @@ -9887,20 +9842,20 @@ _EOF_ INSTALLING_INDEX=121 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/roon + mkdir -p "$FP_DIETPI_USERDATA"/roon cp /DietPi/dietpi/conf/roonbridge.service /etc/systemd/system/roonbridge.service # - Move logfiles to /var/log/ (dietpi-ramlog) # Remove any previous folders to clear for symlink - rm -R "$FP_DIETPI_USERDATA_DIRECTORY"/roon/RoonBridge/Logs &> /dev/null - rm -R "$FP_DIETPI_USERDATA_DIRECTORY"/roon/RAATServer/Logs &> /dev/null + rm -R "$FP_DIETPI_USERDATA"/roon/RoonBridge/Logs &> /dev/null + rm -R "$FP_DIETPI_USERDATA"/roon/RAATServer/Logs &> /dev/null - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/roon/RoonBridge - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/roon/RAATServer + mkdir -p "$FP_DIETPI_USERDATA"/roon/RoonBridge + mkdir -p "$FP_DIETPI_USERDATA"/roon/RAATServer - ln -sf /var/log "$FP_DIETPI_USERDATA_DIRECTORY"/roon/RoonBridge/Logs - ln -sf /var/log "$FP_DIETPI_USERDATA_DIRECTORY"/roon/RAATServer/Logs + ln -sf /var/log "$FP_DIETPI_USERDATA"/roon/RoonBridge/Logs + ln -sf /var/log "$FP_DIETPI_USERDATA"/roon/RAATServer/Logs fi @@ -9908,7 +9863,7 @@ _EOF_ INSTALLING_INDEX=122 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/node-red + mkdir -p "$FP_DIETPI_USERDATA"/node-red cat << _EOF_ > /etc/systemd/system/node-red.service [Unit] @@ -9917,14 +9872,14 @@ Description=Node-Red [Service] Type=simple User=root -ExecStart=/usr/local/bin/node-red -u $FP_DIETPI_USERDATA_DIRECTORY/node-red +ExecStart=/usr/local/bin/node-red -u $FP_DIETPI_USERDATA/node-red [Install] WantedBy=multi-user.target _EOF_ #Symlink to home dir: https://github.com/Fourdee/DietPi/issues/1256 - ln -sf "$FP_DIETPI_USERDATA_DIRECTORY"/node-red "$HOME"/.node-red + ln -sf "$FP_DIETPI_USERDATA"/node-red "$HOME"/.node-red fi @@ -9997,15 +9952,15 @@ _EOF_ sed -i "/User=/c\User=root" /lib/systemd/system/mopidy.service # - conf - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/mopidy/cache - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/mopidy/data + mkdir -p "$FP_DIETPI_USERDATA"/mopidy/cache + mkdir -p "$FP_DIETPI_USERDATA"/mopidy/data mkdir -p ~/.config/mopidy cat << _EOF_ > ~/.config/mopidy/mopidy.conf [core] -cache_dir = $FP_DIETPI_USERDATA_DIRECTORY/mopidy/cache +cache_dir = $FP_DIETPI_USERDATA/mopidy/cache config_dir = /etc/mopidy -data_dir = $FP_DIETPI_USERDATA_DIRECTORY/mopidy/data +data_dir = $FP_DIETPI_USERDATA/mopidy/data [logging] config_file = /etc/mopidy/logging.conf @@ -10094,7 +10049,7 @@ _EOF_ cp /DietPi/dietpi/conf/minidlna.conf /etc/minidlna.conf #Setup data directories - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/.MiniDLNA_Cache + mkdir -p "$FP_DIETPI_USERDATA"/.MiniDLNA_Cache fi @@ -10130,65 +10085,65 @@ _EOF_ chmod -R +x /etc/amiberry #Create userdata/rom directories and symlink from /etc/amiberry/ - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry + mkdir -p "$FP_DIETPI_USERDATA"/amiberry #Copy default configs, then setup symlinks from Uae4ARM folders to userdata. # - Conf - cp -R /etc/amiberry/conf "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/ + cp -R /etc/amiberry/conf "$FP_DIETPI_USERDATA"/amiberry/ rm -R /etc/amiberry/conf &> /dev/null - ln -sf "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/conf /etc/amiberry/conf + ln -sf "$FP_DIETPI_USERDATA"/amiberry/conf /etc/amiberry/conf # - Disks rm -R /etc/amiberry/disks &> /dev/null - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/disks - ln -sf "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/disks /etc/amiberry/disks + mkdir -p "$FP_DIETPI_USERDATA"/amiberry/disks + ln -sf "$FP_DIETPI_USERDATA"/amiberry/disks /etc/amiberry/disks # - floppy_images rm -R /etc/amiberry/floppy_images &> /dev/null - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/floppy_images - ln -sf "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/floppy_images /etc/amiberry/floppy_images - cat << _EOF_ > "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/floppy_images/dir.txt + mkdir -p "$FP_DIETPI_USERDATA"/amiberry/floppy_images + ln -sf "$FP_DIETPI_USERDATA"/amiberry/floppy_images /etc/amiberry/floppy_images + cat << _EOF_ > "$FP_DIETPI_USERDATA"/amiberry/floppy_images/dir.txt Put your Amiga floopy images (*.adf) in this directory. _EOF_ # - HDF rm -R /etc/amiberry/hdf &> /dev/null - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/hdf - ln -sf "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/hdf /etc/amiberry/hdf + mkdir -p "$FP_DIETPI_USERDATA"/amiberry/hdf + ln -sf "$FP_DIETPI_USERDATA"/amiberry/hdf /etc/amiberry/hdf # - Kickstarts rm -R /etc/amiberry/kickstarts &> /dev/null - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/kickstarts - ln -sf "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/kickstarts /etc/amiberry/kickstarts - cat << _EOF_ > "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/kickstarts/dir.txt + mkdir -p "$FP_DIETPI_USERDATA"/amiberry/kickstarts + ln -sf "$FP_DIETPI_USERDATA"/amiberry/kickstarts /etc/amiberry/kickstarts + cat << _EOF_ > "$FP_DIETPI_USERDATA"/amiberry/kickstarts/dir.txt Put your Kickstart Roms (*.rom) in this directory. They should be named accordingly depending on version: kick12.rom , kick13.rom , kick20.rom, kick31.rom _EOF_ # - Savestates rm -R /etc/amiberry/savestates &> /dev/null - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/savestates - ln -sf "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/savestates /etc/amiberry/savestates - cat << _EOF_ > "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/savestates/dir.txt + mkdir -p "$FP_DIETPI_USERDATA"/amiberry/savestates + ln -sf "$FP_DIETPI_USERDATA"/amiberry/savestates /etc/amiberry/savestates + cat << _EOF_ > "$FP_DIETPI_USERDATA"/amiberry/savestates/dir.txt Saved states will be stored here. _EOF_ # - Screenshots rm -R /etc/amiberry/screenshots &> /dev/null - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/screenshots - ln -sf "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/screenshots /etc/amiberry/screenshots - cat << _EOF_ > "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/screenshots/dir.txt + mkdir -p "$FP_DIETPI_USERDATA"/amiberry/screenshots + ln -sf "$FP_DIETPI_USERDATA"/amiberry/screenshots /etc/amiberry/screenshots + cat << _EOF_ > "$FP_DIETPI_USERDATA"/amiberry/screenshots/dir.txt Screenshots will be stored here. _EOF_ #Uae4arm does not support browsing symlinks (https://github.com/Fourdee/DietPi/issues/474#issuecomment-242973839) # So we need to change config file default paths to actual userdata location: - local fp_userdata_actual=$(readlink "$FP_DIETPI_USERDATA_DIRECTORY") # Only returns a value if symlink exists (eg: off SDcard) + local fp_userdata_actual=$(readlink "$FP_DIETPI_USERDATA") # Only returns a value if symlink exists (eg: off SDcard) if [ -n "$fp_userdata_actual" ]; then - sed -i "s:$FP_DIETPI_USERDATA_DIRECTORY:$fp_userdata_actual:g" "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/conf/adfdir.conf - sed -i "s:$FP_DIETPI_USERDATA_DIRECTORY:$fp_userdata_actual:g" "$FP_DIETPI_USERDATA_DIRECTORY"/amiberry/conf/autostart.uae + sed -i "s:$FP_DIETPI_USERDATA:$fp_userdata_actual:g" "$FP_DIETPI_USERDATA"/amiberry/conf/adfdir.conf + sed -i "s:$FP_DIETPI_USERDATA:$fp_userdata_actual:g" "$FP_DIETPI_USERDATA"/amiberry/conf/autostart.uae fi @@ -10287,16 +10242,16 @@ _EOF_ rm -R "$HOME"/.d1x-rebirth &> /dev/null rm -R "$HOME"/.d2x-rebirth &> /dev/null - ln -sf "$FP_DIETPI_USERDATA_DIRECTORY"/dxx-rebirth/descent_1_profiles "$HOME"/.d1x-rebirth - ln -sf "$FP_DIETPI_USERDATA_DIRECTORY"/dxx-rebirth/descent_2_profiles "$HOME"/.d2x-rebirth + ln -sf "$FP_DIETPI_USERDATA"/dxx-rebirth/descent_1_profiles "$HOME"/.d1x-rebirth + ln -sf "$FP_DIETPI_USERDATA"/dxx-rebirth/descent_2_profiles "$HOME"/.d2x-rebirth #+exe - chmod +x -R "$FP_DIETPI_USERDATA_DIRECTORY"/dxx-rebirth/* + chmod +x -R "$FP_DIETPI_USERDATA"/dxx-rebirth/* #Alias if (( ! $(cat /etc/bash.bashrc | grep -ci -m1 'dxx-rebirth') )); then - sed -i "/#DietPi Additions/a alias dxx-rebirth='$FP_DIETPI_USERDATA_DIRECTORY/dxx-rebirth/run.sh'" /etc/bash.bashrc + sed -i "/#DietPi Additions/a alias dxx-rebirth='$FP_DIETPI_USERDATA/dxx-rebirth/run.sh'" /etc/bash.bashrc fi @@ -10304,8 +10259,8 @@ _EOF_ mkdir -p "$HOME"/Desktop mkdir -p /usr/share/applications - ln -s "$FP_DIETPI_USERDATA_DIRECTORY"/dxx-rebirth/dxx-rebirth.desktop "$HOME"/Desktop/dxx-rebirth.desktop - ln -s "$FP_DIETPI_USERDATA_DIRECTORY"/dxx-rebirth/dxx-rebirth.desktop /usr/share/applications/dxx-rebirth.desktop + ln -s "$FP_DIETPI_USERDATA"/dxx-rebirth/dxx-rebirth.desktop "$HOME"/Desktop/dxx-rebirth.desktop + ln -s "$FP_DIETPI_USERDATA"/dxx-rebirth/dxx-rebirth.desktop /usr/share/applications/dxx-rebirth.desktop fi @@ -10342,7 +10297,7 @@ _EOF_ cp /DietPi/dietpi/conf/raspimjpeg.service /etc/dietpi/dietpi-software/services/raspimjpeg.service # - Setup Data directory - local dietpicam_media_directory=$FP_DIETPI_USERDATA_DIRECTORY + local dietpicam_media_directory=$FP_DIETPI_USERDATA mkdir -p "$dietpicam_media_directory"/dietpicam rm -R /var/www/dietpicam/media @@ -10452,7 +10407,7 @@ _EOF_ cat << _EOF_ > /etc/default/subsonic SUBSONIC_USER=root -SUBSONIC_ARGS="--quiet --pidfile=/run/subsonic.pid --max-memory=$subsonic_memory_max --default-music-folder=$FP_DIETPI_USERDATA_DIRECTORY/$FOLDER_MUSIC --default-podcast-folder=$FP_DIETPI_USERDATA_DIRECTORY/$FOLDER_MUSIC --default-playlist-folder=$FP_DIETPI_USERDATA_DIRECTORY/$FOLDER_MUSIC" +SUBSONIC_ARGS="--quiet --pidfile=/run/subsonic.pid --max-memory=$subsonic_memory_max --default-music-folder=$FP_DIETPI_USERDATA/$FOLDER_MUSIC --default-podcast-folder=$FP_DIETPI_USERDATA/$FOLDER_MUSIC --default-playlist-folder=$FP_DIETPI_USERDATA/$FOLDER_MUSIC" _EOF_ #Grab our test media for user @@ -11022,7 +10977,7 @@ _EOF_ echo '' >> /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn #Copy client file to userdata location - cp /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn "$FP_DIETPI_USERDATA_DIRECTORY"/ + cp /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn "$FP_DIETPI_USERDATA"/ # - and /boot partition cp /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn /boot/ @@ -11275,7 +11230,7 @@ _EOF_ /DietPi/dietpi/func/create_mysql_db pydio "$GLOBAL_PW" root "$GLOBAL_PW" #Setup Data directory - local target_data_dir="$FP_DIETPI_USERDATA_DIRECTORY/pydio_data" + local target_data_dir="$FP_DIETPI_USERDATA/pydio_data" # - Generate user data dir mkdir -p "$target_data_dir" @@ -11444,7 +11399,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then #Cap total connections - local max_users=$(( $CPU_CORES_TOTAL * 8 )) + local max_users=$(( $HW_CPU_CORES * 8 )) sed -i "/users=/c\users=$max_users" /etc/mumble-server.ini #Name the root channel @@ -11533,16 +11488,16 @@ _EOF_ killall -w node &> /dev/null killall -w nodejs &> /dev/null - ln -sf "$FP_DIETPI_USERDATA_DIRECTORY"/mineos/minecraft/mineos_console.js /usr/local/bin/mineos + ln -sf "$FP_DIETPI_USERDATA"/mineos/minecraft/mineos_console.js /usr/local/bin/mineos - cp "$FP_DIETPI_USERDATA_DIRECTORY"/mineos/minecraft/mineos.conf /etc/mineos.conf + cp "$FP_DIETPI_USERDATA"/mineos/minecraft/mineos.conf /etc/mineos.conf # - setup SSL cert - cd "$FP_DIETPI_USERDATA_DIRECTORY"/mineos/minecraft + cd "$FP_DIETPI_USERDATA"/mineos/minecraft ./generate-sslcert.sh # - Supervisor service - cp "$FP_DIETPI_USERDATA_DIRECTORY"/mineos/minecraft/init/supervisor_conf /etc/supervisor/conf.d/mineos.conf + cp "$FP_DIETPI_USERDATA"/mineos/minecraft/init/supervisor_conf /etc/supervisor/conf.d/mineos.conf cd "$HOME" @@ -11551,20 +11506,20 @@ _EOF_ echo -e "dietpi\ndietpi\n" | passwd mineos # - Move server data storage to userdata dir (High disk writes) - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/mineos/serverdata + mkdir -p "$FP_DIETPI_USERDATA"/mineos/serverdata mkdir -p /var/games #sometimes this is not created by mineos after installation... Ensures symlink creation does not fail. - cp -R /var/games/minecraft/* "$FP_DIETPI_USERDATA_DIRECTORY"/mineos/serverdata/ #Folder does not exist during installation, as of 18/09/16 + cp -R /var/games/minecraft/* "$FP_DIETPI_USERDATA"/mineos/serverdata/ #Folder does not exist during installation, as of 18/09/16 rm -R /var/games/minecraft - ln -sf "$FP_DIETPI_USERDATA_DIRECTORY"/mineos/serverdata /var/games/minecraft + ln -sf "$FP_DIETPI_USERDATA"/mineos/serverdata /var/games/minecraft chown -R mineos:mineos /var/games/minecraft # - correct the node filepath for supervisor mineos sed -i '/^command=/c\command=/usr/local/bin/node webui.js' /etc/supervisor/conf.d/mineos.conf - # - Set directory to FP_DIETPI_USERDATA_DIRECTORY - sed -i "/^directory=/c\directory=$FP_DIETPI_USERDATA_DIRECTORY/mineos/minecraft" /etc/supervisor/conf.d/mineos.conf + # - Set directory to FP_DIETPI_USERDATA + sed -i "/^directory=/c\directory=$FP_DIETPI_USERDATA/mineos/minecraft" /etc/supervisor/conf.d/mineos.conf supervisorctl reload @@ -11575,7 +11530,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then # - Data storage / user data - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/gogs-repo + mkdir -p "$FP_DIETPI_USERDATA"/gogs-repo # - sqldb /DietPi/dietpi/func/create_mysql_db gogs "$GLOBAL_PW" root "$GLOBAL_PW" @@ -11633,9 +11588,9 @@ Bittorrent\MaxUploadsPerTorrent=$(Optimize_BitTorrent 3) WebUI\Port=1340 WebUI\Enabled=true General\Locale=en_GB -Downloads\SavePath=$FP_DIETPI_USERDATA_DIRECTORY/downloads +Downloads\SavePath=$FP_DIETPI_USERDATA/downloads Downloads\TempPathEnabled=false -Downloads\TempPath=$FP_DIETPI_USERDATA_DIRECTORY/downloads +Downloads\TempPath=$FP_DIETPI_USERDATA/downloads Downloads\ScanDirs=@Invalid() Downloads\DownloadInScanDirs=@Invalid() Downloads\TorrentExportDir= @@ -11814,7 +11769,7 @@ _EOF_ chmod 400 /etc/.rutorrent-htaccess # - Session folder - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/downloads/.session + mkdir -p "$FP_DIETPI_USERDATA"/downloads/.session # - Service using screen | '/usr/bin/rtorrent &> /var/log/rtorrent.log &' doesnt work, hangs program after 5 seconds cat << _EOF_ > /etc/systemd/system/rtorrent.service @@ -11864,12 +11819,12 @@ download_rate = 0 upload_rate = 0 # Default directory to save the downloaded torrents. -directory = $FP_DIETPI_USERDATA_DIRECTORY/downloads +directory = $FP_DIETPI_USERDATA/downloads # Default session directory. Make sure you don't run multiple instance # of rtorrent using the same session directory. Perhaps using a # relative path? -session = $FP_DIETPI_USERDATA_DIRECTORY/downloads/.session +session = $FP_DIETPI_USERDATA/downloads/.session # Close torrents when diskspace is low. schedule = low_diskspace,5,60,close_low_diskspace=1000M @@ -11968,7 +11923,7 @@ Description=DietPi Aria2 [Service] Type=simple -ExecStart=$(which aria2c) --enable-rpc --rpc-listen-all --rpc-secret=$GLOBAL_PW --dir=$FP_DIETPI_USERDATA_DIRECTORY/$FOLDER_DOWNLOADS +ExecStart=$(which aria2c) --enable-rpc --rpc-listen-all --rpc-secret=$GLOBAL_PW --dir=$FP_DIETPI_USERDATA/$FOLDER_DOWNLOADS [Install] WantedBy=multi-user.target @@ -11981,8 +11936,8 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then # - Generate dir's - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/syncthing - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/syncthing_data + mkdir -p "$FP_DIETPI_USERDATA"/syncthing + mkdir -p "$FP_DIETPI_USERDATA"/syncthing_data # Logs/Binary mkdir -p /var/log/syncthing @@ -11991,22 +11946,22 @@ _EOF_ chown -R dietpi:dietpi /etc/syncthing # - run syncthing to create cert/config and exit - /etc/syncthing/syncthing -generate="$FP_DIETPI_USERDATA_DIRECTORY"/syncthing + /etc/syncthing/syncthing -generate="$FP_DIETPI_USERDATA"/syncthing # - Disable automatic upgrades - sed -i '/<\/autoUpgradeIntervalH>/c\ 0<\/autoUpgradeIntervalH>' "$FP_DIETPI_USERDATA_DIRECTORY"/syncthing/config.xml + sed -i '/<\/autoUpgradeIntervalH>/c\ 0<\/autoUpgradeIntervalH>' "$FP_DIETPI_USERDATA"/syncthing/config.xml # - Allow external access (LAN). - sed -i '/:8384<\/address>/c\
0.0.0.0:8384<\/address>' "$FP_DIETPI_USERDATA_DIRECTORY"/syncthing/config.xml + sed -i '/:8384<\/address>/c\
0.0.0.0:8384<\/address>' "$FP_DIETPI_USERDATA"/syncthing/config.xml # - Set default folder - sed -i '/label=\"Default Folder/c\ ' "$FP_DIETPI_USERDATA_DIRECTORY"/syncthing/config.xml + sed -i '/label=\"Default Folder/c\ ' "$FP_DIETPI_USERDATA"/syncthing/config.xml # - Disable browser starting - sed -i '/<\/startBrowser>/c\ false<\/startBrowser>' "$FP_DIETPI_USERDATA_DIRECTORY"/syncthing/config.xml + sed -i '/<\/startBrowser>/c\ false<\/startBrowser>' "$FP_DIETPI_USERDATA"/syncthing/config.xml # - Enable filesystem watcher (previously inotify) - sed -i 's/fsWatcherEnabled=\"false\"/fsWatcherEnabled=\"true\"/g' "$FP_DIETPI_USERDATA_DIRECTORY"/syncthing/config.xml + sed -i 's/fsWatcherEnabled=\"false\"/fsWatcherEnabled=\"true\"/g' "$FP_DIETPI_USERDATA"/syncthing/config.xml #services cat << _EOF_ > /etc/systemd/system/syncthing.service @@ -12016,7 +11971,7 @@ After=network.target [Service] Type=simple -ExecStart=/etc/syncthing/syncthing -logfile=/var/log/syncthing/syncthing.log -logflags=3 -home=$FP_DIETPI_USERDATA_DIRECTORY/syncthing +ExecStart=/etc/syncthing/syncthing -logfile=/var/log/syncthing/syncthing.log -logflags=3 -home=$FP_DIETPI_USERDATA/syncthing User=dietpi [Install] @@ -12032,7 +11987,7 @@ _EOF_ INSTALLING_INDEX=111 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/urbackup/urbackup_tmp_files + mkdir -p "$FP_DIETPI_USERDATA"/urbackup/urbackup_tmp_files #As we have /tmp mounted to RAM, change tmp locations sed -i '/DAEMON_TMPDIR=/c\DAEMON_TMPDIR="/var/tmp"' /etc/default/urbackupsrv @@ -12046,7 +12001,7 @@ _EOF_ INSTALLING_INDEX=116 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/sickrage + mkdir -p "$FP_DIETPI_USERDATA"/sickrage cat << _EOF_ > /etc/systemd/system/sickrage.service [Unit] @@ -12058,7 +12013,7 @@ User=root Group=root Type=forking GuessMainPID=no -ExecStart=/usr/bin/python /etc/sickrage/SickBeard.py -q --daemon --nolaunch --datadir=$FP_DIETPI_USERDATA_DIRECTORY/sickrage +ExecStart=/usr/bin/python /etc/sickrage/SickBeard.py -q --daemon --nolaunch --datadir=$FP_DIETPI_USERDATA/sickrage #ExecStop=/usr/bin/killall -w SickBeard.py [Install] @@ -12073,7 +12028,7 @@ _EOF_ # Wait for SickRage to generate its default config.ini, else, it will just overwrite our config.ini. local max_loops=10 local current_loop=0 - while [ ! -f "$FP_DIETPI_USERDATA_DIRECTORY/sickrage/config.ini" ] + while [ ! -f "$FP_DIETPI_USERDATA/sickrage/config.ini" ] do /DietPi/dietpi/func/dietpi-notify 2 "Waiting for SickRage to finish 1st run prep, please wait..." @@ -12092,8 +12047,8 @@ _EOF_ systemctl stop sickrage - cp "$FP_DIETPI_USERDATA_DIRECTORY"/sickrage/config.ini "$FP_DIETPI_USERDATA_DIRECTORY"/sickrage/config.ini.default - wget http://dietpi.com/downloads/conf/sickrage_dietpi_config.ini -O "$FP_DIETPI_USERDATA_DIRECTORY"/sickrage/config.ini + cp "$FP_DIETPI_USERDATA"/sickrage/config.ini "$FP_DIETPI_USERDATA"/sickrage/config.ini.default + wget http://dietpi.com/downloads/conf/sickrage_dietpi_config.ini -O "$FP_DIETPI_USERDATA"/sickrage/config.ini fi @@ -12117,15 +12072,15 @@ WantedBy=multi-user.target _EOF_ # - userdirs - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/tonido/sync - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/tonido/syncdata + mkdir -p "$FP_DIETPI_USERDATA"/tonido/sync + mkdir -p "$FP_DIETPI_USERDATA"/tonido/syncdata # symlink - cp -R "$HOME"/tonido "$FP_DIETPI_USERDATA_DIRECTORY"/ + cp -R "$HOME"/tonido "$FP_DIETPI_USERDATA"/ rm -R "$HOME"/tonido - ln -sf "$FP_DIETPI_USERDATA_DIRECTORY"/tonido "$HOME"/tonido - ln -sf "$FP_DIETPI_USERDATA_DIRECTORY"/tonido/sync "$HOME"/TonidoSync - ln -sf "$FP_DIETPI_USERDATA_DIRECTORY"/tonido/syncdata "$HOME"/TonidoSyncData + ln -sf "$FP_DIETPI_USERDATA"/tonido "$HOME"/tonido + ln -sf "$FP_DIETPI_USERDATA"/tonido/sync "$HOME"/TonidoSync + ln -sf "$FP_DIETPI_USERDATA"/tonido/syncdata "$HOME"/TonidoSyncData # - armv7 switch if (( $HW_ARCH == 2 )); then @@ -12256,7 +12211,7 @@ description = DarkIce on DietPi url = http://localhost genre = none public = no -#localDumpFile = $FP_DIETPI_USERDATA_DIRECTORY/darkice_recording.ogg +#localDumpFile = $FP_DIETPI_USERDATA/darkice_recording.ogg _EOF_ #SystemD service for Darkice @@ -12284,10 +12239,10 @@ _EOF_ # - service local fp_java_binary=$(which java) - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/blynk + mkdir -p "$FP_DIETPI_USERDATA"/blynk CONFIG_FILE_URL_ADDRESS='https://raw.githubusercontent.com/blynkkk/blynk-server/master/server/core/src/main/resources/server.properties' - wget "$CONFIG_URL_ADDRESS" -O "$FP_DIETPI_USERDATA_DIRECTORY"/blynk/server.properties - sed -i "/data.folder=/c\data.folder=$FP_DIETPI_USERDATA_DIRECTORY/blynk" "$FP_DIETPI_USERDATA_DIRECTORY"/blynk/server.properties + wget "$CONFIG_URL_ADDRESS" -O "$FP_DIETPI_USERDATA"/blynk/server.properties + sed -i "/data.folder=/c\data.folder=$FP_DIETPI_USERDATA/blynk" "$FP_DIETPI_USERDATA"/blynk/server.properties cat << _EOF_ > /etc/systemd/system/blynkserver.service [Unit] @@ -12296,7 +12251,7 @@ After=network.target [Service] Type=simple -ExecStart=$fp_java_binary -jar /etc/blynkserver/server.jar -serverConfig $FP_DIETPI_USERDATA_DIRECTORY/blynk/server.properties +ExecStart=$fp_java_binary -jar /etc/blynkserver/server.jar -serverConfig $FP_DIETPI_USERDATA/blynk/server.properties [Install] WantedBy=multi-user.target @@ -12318,8 +12273,8 @@ _EOF_ mkdir -p /etc/motioneye cp /usr/local/share/motioneye/extra/motioneye.conf.sample /etc/motioneye/motioneye.conf - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/motioneye - sed -i "/^media_path/c\media_path $FP_DIETPI_USERDATA_DIRECTORY/motioneye" /etc/motioneye/motioneye.conf + mkdir -p "$FP_DIETPI_USERDATA"/motioneye + sed -i "/^media_path/c\media_path $FP_DIETPI_USERDATA/motioneye" /etc/motioneye/motioneye.conf # service cp /usr/local/share/motioneye/extra/motioneye.systemd-unit-local /etc/systemd/system/motioneye.service @@ -12396,10 +12351,10 @@ _EOF_ sleep 2 #additional wait, config being overwritten after below changes: http://dietpi.com/phpbb/viewtopic.php?f=11&t=1848&p=7085#p7082 - sed -i "/^download_dir =/c\download_dir = $FP_DIETPI_USERDATA_DIRECTORY/downloads/incomplete" /etc/sabnzbd/sabnzbd.ini - sed -i "/^complete_dir =/c\complete_dir = $FP_DIETPI_USERDATA_DIRECTORY/downloads/complete" /etc/sabnzbd/sabnzbd.ini - sed -i "/^nzb_backup_dir =/c\nzb_backup_dir = $FP_DIETPI_USERDATA_DIRECTORY/downloads/sabnzbd_nzb_backup" /etc/sabnzbd/sabnzbd.ini - sed -i "/^admin_dir =/c\admin_dir = $FP_DIETPI_USERDATA_DIRECTORY/downloads/sabnzbd_admin" /etc/sabnzbd/sabnzbd.ini + sed -i "/^download_dir =/c\download_dir = $FP_DIETPI_USERDATA/downloads/incomplete" /etc/sabnzbd/sabnzbd.ini + sed -i "/^complete_dir =/c\complete_dir = $FP_DIETPI_USERDATA/downloads/complete" /etc/sabnzbd/sabnzbd.ini + sed -i "/^nzb_backup_dir =/c\nzb_backup_dir = $FP_DIETPI_USERDATA/downloads/sabnzbd_nzb_backup" /etc/sabnzbd/sabnzbd.ini + sed -i "/^admin_dir =/c\admin_dir = $FP_DIETPI_USERDATA/downloads/sabnzbd_admin" /etc/sabnzbd/sabnzbd.ini sed -i "/^log_dir =/c\log_dir = /var/log" /etc/sabnzbd/sabnzbd.ini sed -i "/^log_level =/c\log_level = 0" /etc/sabnzbd/sabnzbd.ini #err only sed -i "/^refresh_rate =/c\refresh_rate = 2" /etc/sabnzbd/sabnzbd.ini @@ -12418,8 +12373,8 @@ After=sound.target [Service] Type=simple -WorkingDirectory=$FP_DIETPI_USERDATA_DIRECTORY/spotify-connect-web -ExecStart=$FP_DIETPI_USERDATA_DIRECTORY/spotify-connect-web/spotify-connect-web +WorkingDirectory=$FP_DIETPI_USERDATA/spotify-connect-web +ExecStart=$FP_DIETPI_USERDATA/spotify-connect-web/spotify-connect-web [Install] WantedBy=multi-user.target @@ -12434,10 +12389,10 @@ _EOF_ cp /etc/couchpotato/init/ubuntu.default /etc/default/couchpotato sed -i "/CP_USER=/c\CP_USER=root" /etc/default/couchpotato sed -i "/CP_HOME=/c\CP_HOME=/etc/couchpotato" /etc/default/couchpotato - sed -i "/CP_DATA=/c\CP_DATA=$FP_DIETPI_USERDATA_DIRECTORY/couchpotato" /etc/default/couchpotato + sed -i "/CP_DATA=/c\CP_DATA=$FP_DIETPI_USERDATA/couchpotato" /etc/default/couchpotato - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/couchpotato - #useradd -d "$FP_DIETPI_USERDATA_DIRECTORY"/couchpotato couchpotato + mkdir -p "$FP_DIETPI_USERDATA"/couchpotato + #useradd -d "$FP_DIETPI_USERDATA"/couchpotato couchpotato cp /etc/couchpotato/init/ubuntu /etc/init.d/couchpotato @@ -12535,14 +12490,14 @@ _EOF_ INSTALLING_INDEX=146 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/plexpy + mkdir -p "$FP_DIETPI_USERDATA"/plexpy cat << _EOF_ > /etc/systemd/system/plexpy.service [Unit] Description=PlexPy - Stats for Plex Media Server usage [Service] -ExecStart=/opt/plexpy/PlexPy.py --quiet --daemon --nolaunch --config /opt/plexpy/config.ini --datadir $FP_DIETPI_USERDATA_DIRECTORY/plexpy +ExecStart=/opt/plexpy/PlexPy.py --quiet --daemon --nolaunch --config /opt/plexpy/config.ini --datadir $FP_DIETPI_USERDATA/plexpy GuessMainPID=no Type=forking User=root @@ -12581,27 +12536,27 @@ _EOF_ INSTALLING_INDEX=149 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - sed -i "/MainDir=/c\MainDir=$FP_DIETPI_USERDATA_DIRECTORY/downloads" "$FP_DIETPI_USERDATA_DIRECTORY"/nzbget/nzbget.conf - sed -i "/DestDir=/c\DestDir=$FP_DIETPI_USERDATA_DIRECTORY/downloads/complete" "$FP_DIETPI_USERDATA_DIRECTORY"/nzbget/nzbget.conf + sed -i "/MainDir=/c\MainDir=$FP_DIETPI_USERDATA/downloads" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/DestDir=/c\DestDir=$FP_DIETPI_USERDATA/downloads/complete" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf - sed -i "/LogFile=/c\LogFile=/var/log/nzbget.log" "$FP_DIETPI_USERDATA_DIRECTORY"/nzbget/nzbget.conf + sed -i "/LogFile=/c\LogFile=/var/log/nzbget.log" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf - sed -i "/ControlUsername=/c\ControlUsername=root" "$FP_DIETPI_USERDATA_DIRECTORY"/nzbget/nzbget.conf - sed -i "/ControlPassword=/c\ControlPassword=$GLOBAL_PW" "$FP_DIETPI_USERDATA_DIRECTORY"/nzbget/nzbget.conf + sed -i "/ControlUsername=/c\ControlUsername=root" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/ControlPassword=/c\ControlPassword=$GLOBAL_PW" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf # Optimizations - sed -i "/Server1.Cipher=/c\Server1.Cipher=RC4-MD5" "$FP_DIETPI_USERDATA_DIRECTORY"/nzbget/nzbget.conf - sed -i "/CrcCheck=/c\CrcCheck=no" "$FP_DIETPI_USERDATA_DIRECTORY"/nzbget/nzbget.conf - sed -i "/ParScan=/c\ParScan=limited" "$FP_DIETPI_USERDATA_DIRECTORY"/nzbget/nzbget.conf - sed -i "/ParThreads=/c\ParThreads=$CPU_CORES_TOTAL" "$FP_DIETPI_USERDATA_DIRECTORY"/nzbget/nzbget.conf + sed -i "/Server1.Cipher=/c\Server1.Cipher=RC4-MD5" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/CrcCheck=/c\CrcCheck=no" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/ParScan=/c\ParScan=limited" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/ParThreads=/c\ParThreads=$HW_CPU_CORES" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf - sed -i "/DebugTarget=/c\DebugTarget=none" "$FP_DIETPI_USERDATA_DIRECTORY"/nzbget/nzbget.conf - sed -i "/CrashTrace=/c\CrashTrace=no" "$FP_DIETPI_USERDATA_DIRECTORY"/nzbget/nzbget.conf - sed -i "/DetailTarget=/c\DetailTarget=none" "$FP_DIETPI_USERDATA_DIRECTORY"/nzbget/nzbget.conf + sed -i "/DebugTarget=/c\DebugTarget=none" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/CrashTrace=/c\CrashTrace=no" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/DetailTarget=/c\DetailTarget=none" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf - sed -i "/ParBuffer=/c\ParBuffer=$(Optimize_BitTorrent 0)" "$FP_DIETPI_USERDATA_DIRECTORY"/nzbget/nzbget.conf - sed -i "/ArticleCache=/c\ArticleCache=$(Optimize_BitTorrent 0)" "$FP_DIETPI_USERDATA_DIRECTORY"/nzbget/nzbget.conf - sed -i "/WriteBuffer=/c\WriteBuffer=$(Optimize_BitTorrent 0)" "$FP_DIETPI_USERDATA_DIRECTORY"/nzbget/nzbget.conf + sed -i "/ParBuffer=/c\ParBuffer=$(Optimize_BitTorrent 0)" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/ArticleCache=/c\ArticleCache=$(Optimize_BitTorrent 0)" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/WriteBuffer=/c\WriteBuffer=$(Optimize_BitTorrent 0)" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf cat << _EOF_ > /etc/systemd/system/nzbget.service [Unit] @@ -12610,8 +12565,8 @@ Description=NZBget [Service] Type=forking User=root -WorkingDirectory=$FP_DIETPI_USERDATA_DIRECTORY/nzbget -ExecStart=$FP_DIETPI_USERDATA_DIRECTORY/nzbget/nzbget -D +WorkingDirectory=$FP_DIETPI_USERDATA/nzbget +ExecStart=$FP_DIETPI_USERDATA/nzbget/nzbget -D [Install] WantedBy=multi-user.target @@ -12630,7 +12585,7 @@ After=network.target [Service] Type=simple -ExecStart=/usr/bin/python $FP_DIETPI_USERDATA_DIRECTORY/htpc-manager/Htpc.py +ExecStart=/usr/bin/python $FP_DIETPI_USERDATA/htpc-manager/Htpc.py [Install] WantedBy=multi-user.target @@ -12669,8 +12624,8 @@ After=network.target [Service] Type=simple User=root -Environment=ROON_DATAROOT=$FP_DIETPI_USERDATA_DIRECTORY/roonserver -ExecStart=$FP_DIETPI_USERDATA_DIRECTORY/roonserver/start.sh +Environment=ROON_DATAROOT=$FP_DIETPI_USERDATA/roonserver +ExecStart=$FP_DIETPI_USERDATA/roonserver/start.sh [Install] WantedBy=multi-user.target @@ -12682,11 +12637,11 @@ _EOF_ INSTALLING_INDEX=156 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/steam - mv "$HOME"/.steam/* "$FP_DIETPI_USERDATA_DIRECTORY"/steam/ + mkdir -p "$FP_DIETPI_USERDATA"/steam + mv "$HOME"/.steam/* "$FP_DIETPI_USERDATA"/steam/ rm -R "$HOME"/.steam - ln -sf "$FP_DIETPI_USERDATA_DIRECTORY"/steam "$HOME"/.steam + ln -sf "$FP_DIETPI_USERDATA"/steam "$HOME"/.steam fi @@ -12712,8 +12667,8 @@ _EOF_ # Link to the default ha location for the homeassistant user, this makes # the configuration avaliable for the user to edit. Configuration generated # when service is started at /home/homeassistant/.homeassistant - mkdir "$FP_DIETPI_USERDATA_DIRECTORY"/homeassistant - ln -sf "$FP_DIETPI_USERDATA_DIRECTORY"/homeassistant /home/homeassistant/.homeassistant + mkdir "$FP_DIETPI_USERDATA"/homeassistant + ln -sf "$FP_DIETPI_USERDATA"/homeassistant /home/homeassistant/.homeassistant fi #------------------------------------------------------------------- @@ -12725,7 +12680,7 @@ _EOF_ # Create simple mandatory default configuration file cat << _EOF_ >> /etc/default/minio # Default file path -MINIO_VOLUMES="$FP_DIETPI_USERDATA_DIRECTORY/minio-data" +MINIO_VOLUMES="$FP_DIETPI_USERDATA/minio-data" # Use if you want to run Minio on a custom port. # MINIO_OPTS="--address :9199" # Access Key of the server. @@ -12744,13 +12699,13 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then # Create directory for docker containers - mkdir "$FP_DIETPI_USERDATA_DIRECTORY"/docker-data + mkdir "$FP_DIETPI_USERDATA"/docker-data # stop service systemctl stop docker.service # Set container(s) locations in /lib/systemd/system/docker.service - sed -i "/ExecStart=\/usr\/bin\/dockerd/c\ExecStart=\/usr\/bin\/dockerd -g $FP_DIETPI_USERDATA_DIRECTORY\/docker-data -H fd:\/\/" /lib/systemd/system/docker.service + sed -i "/ExecStart=\/usr\/bin\/dockerd/c\ExecStart=\/usr\/bin\/dockerd -g $FP_DIETPI_USERDATA\/docker-data -H fd:\/\/" /lib/systemd/system/docker.service fi @@ -12761,21 +12716,21 @@ _EOF_ # Setup Filestore DietPi appropriate # IF already present just create symlink - if [ ! -f "$FP_DIETPI_USERDATA_DIRECTORY"/fuguhub-data/ ]; then + if [ ! -f "$FP_DIETPI_USERDATA"/fuguhub-data/ ]; then # Move installed filestore to dietpi folder - mkdir "$FP_DIETPI_USERDATA_DIRECTORY"/fuguhub-data/ - mv /home/bd/disk/* "$FP_DIETPI_USERDATA_DIRECTORY"/fuguhub-data/ + mkdir "$FP_DIETPI_USERDATA"/fuguhub-data/ + mv /home/bd/disk/* "$FP_DIETPI_USERDATA"/fuguhub-data/ # Removed 'actual' folder to make way for symlink rm -r /home/bd/disk # Create symlink - ln -s "$FP_DIETPI_USERDATA_DIRECTORY"/fuguhub-data /home/bd/disk + ln -s "$FP_DIETPI_USERDATA"/fuguhub-data /home/bd/disk # Set permissions - # setfacl -R -m u:bd:rwx "$FP_DIETPI_USERDATA_DIRECTORY"/fuguhub-data/ + # setfacl -R -m u:bd:rwx "$FP_DIETPI_USERDATA"/fuguhub-data/ else # Removed 'actual' folder to make way for symlink rm -r /home/bd/disk # Create symlink - ln -s "$FP_DIETPI_USERDATA_DIRECTORY"/fuguhub-data /home/bd/disk + ln -s "$FP_DIETPI_USERDATA"/fuguhub-data /home/bd/disk fi fi @@ -12814,9 +12769,9 @@ Description=Gitea (Git with a cup of tea) [Service] Type=simple User=dietpi -WorkingDirectory=$FP_DIETPI_USERDATA_DIRECTORY/gitea/gitea-repositories -ExecStart=$FP_DIETPI_USERDATA_DIRECTORY/gitea/gitea web -Environment=USER=dietpi HOME=$FP_DIETPI_USERDATA_DIRECTORY/gitea +WorkingDirectory=$FP_DIETPI_USERDATA/gitea/gitea-repositories +ExecStart=$FP_DIETPI_USERDATA/gitea/gitea web +Environment=USER=dietpi HOME=$FP_DIETPI_USERDATA/gitea [Install] WantedBy=multi-user.target @@ -13196,7 +13151,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then # - Symlink userdata location for assistant.json - ln -sf "$FP_DIETPI_USERDATA_DIRECTORY"/voice-recognizer-raspi/assistant.json /home/dietpi/assistant.json + ln -sf "$FP_DIETPI_USERDATA"/voice-recognizer-raspi/assistant.json /home/dietpi/assistant.json # - Generate cache dir mkdir -p /home/dietpi/.cache/voice-recognizer @@ -13399,7 +13354,7 @@ _EOF_ # - SQL store rm -R /var/lib/mysql - rm -R "$FP_DIETPI_USERDATA_DIRECTORY"/mysql + rm -R "$FP_DIETPI_USERDATA"/mysql elif (( $1 == 87 )); then @@ -13444,7 +13399,7 @@ _EOF_ systemctl start mysql mysql -uroot -p"$GLOBAL_PW" -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")@$(grep -m1 "'dbhost'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" mysql -uroot -p"$GLOBAL_PW" -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" - mysqldump --lock-tables -uroot -p"$GLOBAL_PW" owncloud > "$FP_DIETPI_USERDATA_DIRECTORY"/owncloud_data/mysql_backup.sql + mysqldump --lock-tables -uroot -p"$GLOBAL_PW" owncloud > "$FP_DIETPI_USERDATA"/owncloud_data/mysql_backup.sql mysqladmin -u root -p"$GLOBAL_PW" drop owncloud -f # Purge APT package AGP owncloud-files owncloud owncloud-deps @@ -13467,7 +13422,7 @@ _EOF_ systemctl start mysql 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/,//")" mysql -uroot -p"$GLOBAL_PW" -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" - mysqldump --lock-tables -uroot -p"$GLOBAL_PW" nextcloud > "$FP_DIETPI_USERDATA_DIRECTORY"/nextcloud_data/mysql_backup.sql + mysqldump --lock-tables -uroot -p"$GLOBAL_PW" nextcloud > "$FP_DIETPI_USERDATA"/nextcloud_data/mysql_backup.sql mysqladmin -u root -p"$GLOBAL_PW" drop nextcloud -f # Remove Nextcloud installation folder rm -R /var/www/nextcloud @@ -13486,7 +13441,7 @@ _EOF_ AGP mpd libmpdclient2 userdel -f mpd &> /dev/null rm /lib/systemd/system/mpd.service - rm -R "$FP_DIETPI_USERDATA_DIRECTORY"/.mpd_cache + rm -R "$FP_DIETPI_USERDATA"/.mpd_cache elif (( $1 == 121 )); then @@ -13497,7 +13452,7 @@ _EOF_ rm /etc/systemd/system/node-red.service rm "$HOME"/.node-red - rm -R "$FP_DIETPI_USERDATA_DIRECTORY"/node-red + rm -R "$FP_DIETPI_USERDATA"/node-red elif (( $1 == 123 )); then @@ -13602,13 +13557,13 @@ _EOF_ elif (( $1 == 141 )); then - rm -R "$FP_DIETPI_USERDATA_DIRECTORY"/spotify-connect-web + rm -R "$FP_DIETPI_USERDATA"/spotify-connect-web rm /etc/systemd/system/spotify-connect-web.service elif (( $1 == 142 )); then rm -R /etc/couchpotato - rm -R "$FP_DIETPI_USERDATA_DIRECTORY"/couchpotato + rm -R "$FP_DIETPI_USERDATA"/couchpotato rm /etc/init.d/couchpotato #userdel -f couchpotato @@ -13637,7 +13592,7 @@ _EOF_ elif (( $1 == 146 )); then rm -R /opt/plexpy - rm -R "$FP_DIETPI_USERDATA_DIRECTORY"/plexpy + rm -R "$FP_DIETPI_USERDATA"/plexpy rm /etc/systemd/system/plexpy.service elif (( $1 == 147 )); then @@ -13651,12 +13606,12 @@ _EOF_ elif (( $1 == 149 )); then - rm -R "$FP_DIETPI_USERDATA_DIRECTORY"/nzbget + rm -R "$FP_DIETPI_USERDATA"/nzbget rm /etc/systemd/system/nzbget.service elif (( $1 == 155 )); then - rm -R "$FP_DIETPI_USERDATA_DIRECTORY"/htpc-manager + rm -R "$FP_DIETPI_USERDATA"/htpc-manager rm /etc/systemd/system/htpc-manager.service elif (( $1 == 150 )); then @@ -13676,21 +13631,21 @@ _EOF_ elif (( $1 == 153 )); then - rm -R "$FP_DIETPI_USERDATA_DIRECTORY"/octoprint + rm -R "$FP_DIETPI_USERDATA"/octoprint rm $(which octoprint) rm -R "$HOME"/.octoprint rm /etc/systemd/system/octoprint.service elif (( $1 == 154 )); then - rm -R "$FP_DIETPI_USERDATA_DIRECTORY"/roonserver + rm -R "$FP_DIETPI_USERDATA"/roonserver rm /etc/systemd/system/roonserver.service elif (( $1 == 156 )); then AGP steam rm -R "$HOME"/.steam - rm -R "$FP_DIETPI_USERDATA_DIRECTORY"/steam + rm -R "$FP_DIETPI_USERDATA"/steam elif (( $1 == 119 )); then @@ -14099,7 +14054,7 @@ _EOF_ rm -R /etc/syncthing rm /usr/bin/syncthing &> /dev/null # DietPi v158 <= rm /etc/systemd/system/syncthing.service - rm -R "$FP_DIETPI_USERDATA_DIRECTORY"/syncthing + rm -R "$FP_DIETPI_USERDATA"/syncthing elif (( $1 == 116 )); then @@ -14137,9 +14092,9 @@ _EOF_ elif (( $1 == 112 )); then - rm "$FP_DIETPI_USERDATA_DIRECTORY"/dxx-rebirth/* - rm -R "$FP_DIETPI_USERDATA_DIRECTORY"/dxx-rebirth/descent_1_game - rm -R "$FP_DIETPI_USERDATA_DIRECTORY"/dxx-rebirth/descent_2_game + rm "$FP_DIETPI_USERDATA"/dxx-rebirth/* + rm -R "$FP_DIETPI_USERDATA"/dxx-rebirth/descent_1_game + rm -R "$FP_DIETPI_USERDATA"/dxx-rebirth/descent_2_game sed -i '/dxx-rebirth/d' /etc/bash.bashrc #Remove symlinks @@ -14175,7 +14130,7 @@ _EOF_ rm /etc/systemd/system/gitea.service # Delete data - rm -R "$FP_DIETPI_USERDATA_DIRECTORY"/gitea + rm -R "$FP_DIETPI_USERDATA"/gitea rm -R /var/log/gitea # drop/delete database @@ -14200,7 +14155,7 @@ _EOF_ elif (( $1 == 169 )); then - rm -R "$FP_DIETPI_USERDATA_DIRECTORY"/voice-recognizer-raspi + rm -R "$FP_DIETPI_USERDATA"/voice-recognizer-raspi rm /etc/systemd/system/voice-recognizer.service rm /etc/systemd/system/alsa-init.service rm -R /home/dietpi/assistant.json @@ -14249,7 +14204,7 @@ _EOF_ fi # delete data files - dietpi - rm -r "$FP_DIETPI_USERDATA_DIRECTORY"/docker-data + rm -r "$FP_DIETPI_USERDATA"/docker-data # remove default unused folder rm -r /var/lib/docker @@ -14540,7 +14495,7 @@ _EOF_ #Simluated apt installation to check for failures related to apt-cache. /DietPi/dietpi/func/dietpi-notify 2 "Running apt simulation to check for errors, please wait..." local package_to_test='bash-doc' - apt-get install $package_to_test -qq -s -y 2>&1 | tee "$FP_APT_LOG" + apt-get install $package_to_test -qq -s -y 2>&1 | tee "$FP_LOG_APT" local result=${PIPESTATUS[0]} /DietPi/dietpi/func/dietpi-notify -1 $result "Apt simulation |" @@ -15271,19 +15226,19 @@ _EOF_ if [ "$1" = "simulation" ]; then - ERROR_TEXT="Apt-get simulation has failed.\n - Apt log = $(echo -e $FP_APT_LOG)\n\nDietPi-Software will now exit." + ERROR_TEXT="Apt-get simulation has failed.\n - Apt log = $(echo -e $FP_LOG_APT)\n\nDietPi-Software will now exit." Error_Display else - ERROR_TEXT="Apt-get has failed:\n - Apt string = $string\n - Error code = $result\n - Software Title = ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}\n - Apt log = $(echo -e $FP_APT_LOG)\n\nPlease report this issue to DietPi (INCLUDING THE APT LOG) so it can be investigated.\n\nDietPi-Software will now exit." + ERROR_TEXT="Apt-get has failed:\n - Apt string = $string\n - Error code = $result\n - Software Title = ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}\n - Apt log = $(echo -e $FP_LOG_APT)\n\nPlease report this issue to DietPi (INCLUDING THE APT LOG) so it can be investigated.\n\nDietPi-Software will now exit." Error_Display fi /DietPi/dietpi/func/dietpi-notify 1 "The apt cache may be corrupt, apt mirror offline, or you have held broken packages. DietPi-Software will now exit.\n" - /DietPi/dietpi/func/dietpi-notify 2 "Apt Log:\n$(cat $FP_APT_LOG)\n" + /DietPi/dietpi/func/dietpi-notify 2 "Apt Log:\n$(cat $FP_LOG_APT)\n" /DietPi/dietpi/func/dietpi-notify 2 "Please try:" /DietPi/dietpi/func/dietpi-notify 2 "- Fixing apt package errors with 'apt-get install -f'" @@ -15500,7 +15455,7 @@ _EOF_ user_data_location_description="USB Drive | $user_data_location_current" - elif [ "$user_data_location_current" = "$FP_DIETPI_USERDATA_DIRECTORY" ]; then + elif [ "$user_data_location_current" = "$FP_DIETPI_USERDATA" ]; then user_data_location_description="SD/EMMC | $user_data_location_current" diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 8069a95a22..59a8741318 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -12,17 +12,54 @@ # - Allows export of shared DietPi global variables into current bash session, and, other scripts # Notes: # - . /DietPi/dietpi/func/dietpi-globals > $HOME/.bashrc + # - . /DietPi/dietpi/func/dietpi-globals > for each script that uses these globals #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. + /DietPi/dietpi/func/dietpi-notify 2 'Updating DietPi-Globals, please wait...' + + #----------------------------------------------------------------------------------- + # Core var's, functions, enviroment checks. Used at start of all scripts + #----------------------------------------------------------------------------------- + #Prevent incorrect parsing with non-english locales. LANG=en_GB.UTF-8 - /DietPi/dietpi/func/dietpi-notify 2 'Updating DietPi-Globals, please wait...' + #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 + cd "$HOME" + + CHECK_ROOT_USER(){ + + if (( $UID != 0 )); then + + /DietPi/dietpi/func/dietpi-notify 1 'Error: Root privileges required. Please run the command with "sudo"\n' + exit 1 + + fi + + } + + CHECK_ROOTFS_RW(){ + + #RootFS RW check + /DietPi/dietpi/dietpi-drive_manager 3 + if (( $? != 0 )); then + + /DietPi/dietpi/func/dietpi-notify 1 'Error: RootFS is currently Read Only, unable to continue.\n' + exit 1 + + fi + + } + + #----------------------------------------------------------------------------------- + # Install stage + #----------------------------------------------------------------------------------- + # -1 = first boot / 0 = run dietpi-software at login / 1 = completed + DIETPI_INSTALL_STAGE=$(cat /DietPi/dietpi/.install_stage) #----------------------------------------------------------------------------------- # Hardware Details #----------------------------------------------------------------------------------- - #Update + #Update? if [ "$1" = 'update_hw_details' ] || [ ! -f /DietPi/dietpi/.hw_model ]; then @@ -45,13 +82,12 @@ DISTRO_NAME='buster' fi - #HW_CPU_CORES=$(nproc --all) - + HW_CPU_CORES=$(nproc --all) #----------------------------------------------------------------------------------- - # User-Data + # DietPi User-Data #----------------------------------------------------------------------------------- - FP_DIETPI_USERDATA_DIRECTORY='/mnt/dietpi_userdata' + FP_DIETPI_USERDATA='/mnt/dietpi_userdata' #----------------------------------------------------------------------------------- # APT diff --git a/dietpi/patch_file b/dietpi/patch_file index e769b5d966..e2ffbac441 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2981,6 +2981,20 @@ _EOF_ /DietPi/dietpi/dietpi-software reinstall 159 128 124 114 47 36 32 #------------------------------------------------------------------------------- + #DietPi-Globals: https://github.com/Fourdee/DietPi/issues/1311 + if (( ! $(grep -ci -m1 'dietpi-globals' /root/.bashrc) )); then + + cat << _EOF_ >> /root/.bashrc +. /DietPi/dietpi/func/dietpi-globals +_EOF_ + + cat << _EOF_ >> /home/dietpi/.bashrc +. /DietPi/dietpi/func/dietpi-globals +_EOF_ + chown dietpi:dietpi /home/dietpi/.bashrc + + fi + #------------------------------------------------------------------------------- fi From 874383bf3373e1cd105f4dd11176b07f1320797f Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 17 Dec 2017 08:13:36 +0000 Subject: [PATCH 060/390] v160 + Switch to DietPi-Global imports in all scripts (excluding those within the script itself): https://github.com/Fourdee/DietPi/issues/1311 --- dietpi/boot | 28 ++---------- dietpi/dietpi-autostart | 15 +++---- dietpi/dietpi-backup | 30 +++---------- dietpi/dietpi-banner | 11 ++--- dietpi/dietpi-bugreport | 10 ++--- dietpi/dietpi-cleaner | 20 +++------ dietpi/dietpi-cloudshell | 22 +++------- dietpi/dietpi-config | 61 ++++++--------------------- dietpi/dietpi-cpu_set | 14 +++--- dietpi/dietpi-cpuinfo | 28 ++++++------ dietpi/dietpi-cron | 19 ++------- dietpi/dietpi-drive_manager | 33 +++------------ dietpi/dietpi-funtime | 10 ++--- dietpi/dietpi-launcher | 26 +++--------- dietpi/dietpi-letsencrypt | 36 ++++++---------- dietpi/dietpi-logclear | 12 +++--- dietpi/dietpi-morsecode | 11 +++-- dietpi/dietpi-obtain_hw_model | 4 ++ dietpi/dietpi-process_tool | 13 +++--- dietpi/dietpi-ramdisk | 5 +++ dietpi/dietpi-ramlog | 4 ++ dietpi/dietpi-services | 12 +++--- dietpi/dietpi-software | 3 +- dietpi/dietpi-survey | 9 ++-- dietpi/dietpi-sync | 28 +++--------- dietpi/dietpi-update | 28 +++--------- dietpi/func/change_hostname | 10 ++--- dietpi/func/check_connection | 8 ++-- dietpi/func/create_mysql_db | 11 +++-- dietpi/func/dietpi-globals | 14 +++--- dietpi/func/dietpi-led_control | 11 +++-- dietpi/func/dietpi-notify | 8 ++-- dietpi/func/dietpi-optimal_mtu | 11 +++-- dietpi/func/dietpi-set_curlftpfs | 11 +++-- dietpi/func/dietpi-set_dphys-swapfile | 9 ++-- dietpi/func/dietpi-set_hardware | 46 ++++++-------------- dietpi/func/dietpi-set_nfsclient | 11 +++-- dietpi/func/dietpi-set_smbclient | 12 +++--- dietpi/func/dietpi-set_software | 32 +++----------- dietpi/func/dietpi-set_userdata | 9 ++-- dietpi/func/obtain_network_details | 8 ++-- dietpi/func/run_ntpd | 9 ++-- dietpi/login | 17 +++----- dietpi/misc/dietpi-justboom | 29 +++---------- dietpi/misc/start_kodi | 14 ++---- dietpi/patch_file | 24 +++-------- 46 files changed, 253 insertions(+), 543 deletions(-) diff --git a/dietpi/boot b/dietpi/boot index 036a8cf4b0..20eac2d9ee 100644 --- a/dietpi/boot +++ b/dietpi/boot @@ -13,32 +13,15 @@ # - activates on boot from /etc/init.d/dietpi-service #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals update_hw_details + #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// #Globals #///////////////////////////////////////////////////////////////////////////////////// FP_LOGFILE='/var/log/dietpi-boot.log' - HW_MODEL=0 - DISTRO=0 - HW_CPUID=0 - - # -1 = first boot / 0 = run dietpi-software at login / 1 = completed - DIETPI_INSTALL_STAGE=$(cat /DietPi/dietpi/.install_stage) - - Read_Hw_Model(){ - - HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) - DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) - HW_CPUID=$(sed -n 9p /DietPi/dietpi/.hw_model) - - } - RPi_Set_Clock_Speeds(){ #RPi's @@ -249,11 +232,6 @@ #Update NTP /DietPi/dietpi/func/run_ntpd & #---------------------------------------------------------------- - #Write HW model and details to file - /DietPi/dietpi/dietpi-obtain_hw_model - #Read Hw model - Read_Hw_Model - #---------------------------------------------------------------- #Apply LED triggers if set /DietPi/dietpi/func/dietpi-led_control 1 & #---------------------------------------------------------------- diff --git a/dietpi/dietpi-autostart b/dietpi/dietpi-autostart index c9c1394e8d..7dece6ebb3 100644 --- a/dietpi/dietpi-autostart +++ b/dietpi/dietpi-autostart @@ -16,20 +16,18 @@ # - dietpi-autostart int (set value only) #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - #Grab Input (valid interger) INPUT=-1 if [[ $1 =~ ^-?[0-9]+$ ]]; then + INPUT=$1 + fi - DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) - HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// # MENUS @@ -246,7 +244,6 @@ _EOF_ } - #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index 99cf62bf5a..e7886ee94a 100644 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -22,34 +22,18 @@ # - /DietPi/dietpi/dietpi-backup 1 /mnt/MyDirectoryTarget = Backup #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - - #Exit path for non-root logins. - if (( $UID != 0 )); then - - /DietPi/dietpi/func/dietpi-notify 1 'Error: Root privileges required. Please run the command with "sudo"\n' - exit - - fi - - #RootFS RW check - /DietPi/dietpi/dietpi-drive_manager 3 - if (( $? != 0 )); then - - exit - - fi - - #Grab Input (valid interger) + #Grab Input INPUT=0 if [[ $1 =~ ^-?[0-9]+$ ]]; then INPUT=$1 fi + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + CHECK_ROOTFS_RW + #Import DietPi-Globals --------------------------------------------------------------- + #///////////////////////////////////////////////////////////////////////////////////// # MENUS #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-banner b/dietpi/dietpi-banner index c0c20acbbd..f0c53cfa36 100644 --- a/dietpi/dietpi-banner +++ b/dietpi/dietpi-banner @@ -17,22 +17,19 @@ # - dietpi-banner 1 = top section and credits + clear #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - INPUT=0 if [[ $1 =~ ^-?[0-9]+$ ]]; then INPUT=$1 fi + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + #Import DietPi-Globals --------------------------------------------------------------- + #///////////////////////////////////////////////////////////////////////////////////// #Globals #///////////////////////////////////////////////////////////////////////////////////// DIETPI_VERSION=$(cat /DietPi/dietpi/.version) - HW_MODEL_DESCRIPTION=$(sed -n 2p /DietPi/dietpi/.hw_model) IMAGE_ADDITIONAL_CREDITS=$(sed -n 8p /DietPi/dietpi/.hw_model) IP_ADDRESS=$(sed -n 4p /DietPi/dietpi/.network) diff --git a/dietpi/dietpi-bugreport b/dietpi/dietpi-bugreport index 1d4af6fc6d..1b094885dd 100644 --- a/dietpi/dietpi-bugreport +++ b/dietpi/dietpi-bugreport @@ -13,11 +13,11 @@ # - Generates MACADDRESS_BUGNUMBER.zip and uploads to dietpi.com #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + CHECK_ROOTFS_RW + #Import DietPi-Globals --------------------------------------------------------------- # - byte UPLOAD_FILESIZE_LIMIT=83886080 diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index cc4808ee8a..d5bc78cac6 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -16,26 +16,18 @@ # /DietPi/dietpi/dietpi-cleaner 2 = Run All cleaners (no menu). #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - - #Exit path for non-root logins. - if (( $UID != 0 )); then - - /DietPi/dietpi/func/dietpi-notify 1 'Error: Root privileges required. Please run the command with "sudo"\n' - exit - - fi - #Grab Input (valid interger) INPUT=0 if [[ $1 =~ ^-?[0-9]+$ ]]; then INPUT=$1 fi + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + CHECK_ROOTFS_RW + #Import DietPi-Globals --------------------------------------------------------------- + #///////////////////////////////////////////////////////////////////////////////////// # Globals #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-cloudshell b/dietpi/dietpi-cloudshell index ec7dc5e4ad..e60b75124c 100644 --- a/dietpi/dietpi-cloudshell +++ b/dietpi/dietpi-cloudshell @@ -17,28 +17,16 @@ # dietpi-cloudshell 2 = Run + Skip intro #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - - #Exit path for non-root logins. - if (( $UID != 0 )); then - - /DietPi/dietpi/func/dietpi-notify 1 'Error: Root privileges required. Please run the command with "sudo"\n' - exit - - fi - #Grab Input (valid interger) INPUT=0 if [[ $1 =~ ^-?[0-9]+$ ]]; then INPUT=$1 fi - HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) - CPU_CORES=$(nproc --all) + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + #Import DietPi-Globals --------------------------------------------------------------- #Version DIETPI_CLOUDSHELL_VERSION=9 @@ -386,7 +374,7 @@ done < $FP_TEMP #ps returns usage of each core, so we devide the total by #n cores - CPU_USAGE=$(echo "scale=0;$CPU_USAGE / $CPU_CORES" | bc -l ) + CPU_USAGE=$(echo "scale=0;$CPU_USAGE / $HW_CPU_CORES" | bc -l ) # TOP (accurate) # Fails to output in low screen res (https://github.com/Fourdee/DietPi/issues/203#issuecomment-189711968) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 81c02c2a92..47a59656c2 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -17,57 +17,35 @@ # - iEXITONBACK - 1=Exit DietPi-Config when going back to previous menu (applied to TARGETMENUINDEX 8 only!!) #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - - #Exit path for non-root logins. - if (( $UID != 0 )); then - - /DietPi/dietpi/func/dietpi-notify 1 'Error: Root privileges required. Please run the command with "sudo"\n' - exit - + #Grab Inputs + # - target MENU INDEX (valid interger) + if [[ $1 =~ ^-?[0-9]+$ ]]; then + TARGETMENUID=$1 fi - - #RootFS RW check - /DietPi/dietpi/dietpi-drive_manager 3 - if (( $? != 0 )); then - - exit - + # - Exit DietPi-Config when going back to previous menu? + if [[ $2 =~ ^-?[0-9]+$ ]]; then + EXITONBACK=$2 + TEXT_MENU_BACK="Exit" fi - #///////////////////////////////////////////////////////////////////////////////////// - #Obtain Install Stage Index (File always exists - is set with finalized) - #///////////////////////////////////////////////////////////////////////////////////// - # -1 = first boot / 0 = run dietpi-software at login / 1 = completed - DIETPI_INSTALL_STAGE=$(cat /DietPi/dietpi/.install_stage) + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + CHECK_ROOTFS_RW + #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// #Obtain Hardware Details #///////////////////////////////////////////////////////////////////////////////////// - HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) - HW_MODEL_DESCRIPTION=$(sed -n 2p /DietPi/dietpi/.hw_model) - DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) - HW_CPUID=$(sed -n 9p /DietPi/dietpi/.hw_model) HW_ONBOARD_WIFI=$(sed -n 10p /DietPi/dietpi/.hw_model) - FP_CPU_SCALING_GOV='/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors' - #///////////////////////////////////////////////////////////////////////////////////// - #Obtain Install Stage Index - #///////////////////////////////////////////////////////////////////////////////////// - # see /DietPi/dietpi/boot for info - DIETPI_INSTALL_STAGE=$(cat /DietPi/dietpi/.install_stage) - #///////////////////////////////////////////////////////////////////////////////////// #Obtain Installed software #///////////////////////////////////////////////////////////////////////////////////// Load_Installed_Software(){ - if [[ -f /DietPi/dietpi/.installed ]]; then + if [ -f /DietPi/dietpi/.installed ]; then . /DietPi/dietpi/.installed fi @@ -96,17 +74,6 @@ TEXT_MENU_BACK="Back" - #Grab target MENU INDEX (valid interger) - if [[ $1 =~ ^-?[0-9]+$ ]]; then - TARGETMENUID=$1 - fi - - #Exit DietPi-Config when going back to previous menu? - if [[ $2 =~ ^-?[0-9]+$ ]]; then - EXITONBACK=$2 - TEXT_MENU_BACK="Exit" - fi - WHIP_BACKTITLE='DietPi-Config' WHIP_TITLE='DietPi-Config' WHIP_QUESTION='DietPi-Config' diff --git a/dietpi/dietpi-cpu_set b/dietpi/dietpi-cpu_set index daac6da53b..7cd65aafc4 100644 --- a/dietpi/dietpi-cpu_set +++ b/dietpi/dietpi-cpu_set @@ -14,13 +14,10 @@ # - Sets CPU governor user prefs | throttle up percent etc #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - - HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + #Import DietPi-Globals --------------------------------------------------------------- #Exit path for VM if (( $HW_MODEL == 20 )); then @@ -30,7 +27,6 @@ fi - CPU_CORES=$(nproc --all) CPU_GOVERNOR=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_governor=' | sed 's/.*=//') CPU_MAX_FREQ=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_max_frequency=' | sed 's/.*=//') CPU_MIN_FREQ=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_min_frequency=' | sed 's/.*=//') @@ -184,7 +180,7 @@ Check_GPU_Gov_Available #Apply CPU0 gov to all cores (if required) - Apply_CPU_Gov "$CPU_GOVERNOR" 0 $CPU_CORES + Apply_CPU_Gov "$CPU_GOVERNOR" 0 $HW_CPU_CORES /DietPi/dietpi/func/dietpi-notify 0 "CPU gov applied: $CPU_GOVERNOR\n" diff --git a/dietpi/dietpi-cpuinfo b/dietpi/dietpi-cpuinfo index 93764bd388..542bf173ed 100644 --- a/dietpi/dietpi-cpuinfo +++ b/dietpi/dietpi-cpuinfo @@ -10,23 +10,27 @@ # # Info: # - Prints CPU information - + # # Usage: # - /DietPi/dietpi/dietpi-cpuinfo Obtain stats and print # - /DietPi/dietpi/dietpi-cpuinfo 1 Returns current CPU temp # - /DietPi/dietpi/dietpi-cpuinfo 2 Generates file of available, ordered scaling freq's "$FP_CPU_SCALINGAVAILABLE_FREQ" #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 + #Grab Input + INPUT=0 + if [[ $1 =~ ^-?[0-9]+$ ]]; then - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" + INPUT=$1 - #Exit path for VM - HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) - HW_CPUID=$(sed -n 9p /DietPi/dietpi/.hw_model) + fi + + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + #Import DietPi-Globals --------------------------------------------------------------- + #Exit path for VM if (( $HW_MODEL == 20 )); then echo -e "\nNotice: CPU information is not available for VM.\n" @@ -34,14 +38,6 @@ fi - #Grab Input - INPUT=0 - if [[ $1 =~ ^-?[0-9]+$ ]]; then - - INPUT=$1 - - fi - #Funcs CPU_USAGE=0 CPU_GOV_CURRENT='Unknown' diff --git a/dietpi/dietpi-cron b/dietpi/dietpi-cron index ff8e4a2ebf..c61d2c2659 100644 --- a/dietpi/dietpi-cron +++ b/dietpi/dietpi-cron @@ -15,21 +15,10 @@ # - /DietPi/dietpi/dietpi-cron #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - - #Exit path for non-root logins. - if (( $UID != 0 )); then - - /DietPi/dietpi/func/dietpi-notify 1 'Error: Root privileges required. Please run the command with "sudo"\n' - exit - - fi - - DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// #Globals diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 2c86523de1..13b49d4a3d 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -22,40 +22,17 @@ # NB: This script does not support quoted/string UUID entries in /etc/fstab. #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - - #Exit path for non-root logins. - if (( $UID != 0 )); then - - /DietPi/dietpi/func/dietpi-notify 1 'Error: Root privileges required. Please run the command with "sudo"\n' - exit - - fi - - HW_MODEL=0 - HW_NAME='NULL' - - if [ -f /DietPi/dietpi/.hw_model ]; then - - HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) - HW_NAME=$(sed -n 2p /DietPi/dietpi/.hw_model) - - elif [ -f /etc/.dietpi_hw_model_identifier ]; then - - HW_MODEL=$(cat /etc/.dietpi_hw_model_identifier) - - fi - #Grab Input (valid interger) INPUT=0 if [[ $1 =~ ^-?[0-9]+$ ]]; then INPUT=$1 fi + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + #Import DietPi-Globals --------------------------------------------------------------- + EXIT_CODE=0 PROGRAM_NAME='DietPi-Drive Manager' diff --git a/dietpi/dietpi-funtime b/dietpi/dietpi-funtime index 62c464c989..6ca7f732a5 100644 --- a/dietpi/dietpi-funtime +++ b/dietpi/dietpi-funtime @@ -16,17 +16,15 @@ # - Called from bordum, or, /DietPi/dietpi/dietpi-funtime iMODE #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - INPUT=0 if [[ $1 =~ ^-?[0-9]+$ ]]; then INPUT=$1 fi + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + #Import DietPi-Globals --------------------------------------------------------------- + #///////////////////////////////////////////////////////////////////////////////////// #Funtime_0 processing #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-launcher b/dietpi/dietpi-launcher index c47ccc4bca..3d25609873 100644 --- a/dietpi/dietpi-launcher +++ b/dietpi/dietpi-launcher @@ -14,27 +14,11 @@ # #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - - #Exit path for non-root logins. - if (( $UID != 0 )); then - - /DietPi/dietpi/func/dietpi-notify 1 'Error: Root privileges required. Please run the command with "sudo"\n' - exit - - fi - - #RootFS RW check - /DietPi/dietpi/dietpi-drive_manager 3 - if (( $? != 0 )); then - - exit - - fi + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + CHECK_ROOTFS_RW + #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// # MENUS diff --git a/dietpi/dietpi-letsencrypt b/dietpi/dietpi-letsencrypt index cc5b790d41..698d0bdbf4 100644 --- a/dietpi/dietpi-letsencrypt +++ b/dietpi/dietpi-letsencrypt @@ -17,27 +17,17 @@ # - /DietPi/dietpi/dietpi-letsencrypt 1 = Create/Renew/Apply cert #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - - #Exit path for non-root logins. - if (( $UID != 0 )); then - - /DietPi/dietpi/func/dietpi-notify 1 'Error: Root privileges required. Please run the command with "sudo"\n' - exit - - fi - - #Grab Input (valid interger) + #Grab Input INPUT=0 if [[ $1 =~ ^-?[0-9]+$ ]]; then INPUT=$1 fi - DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + CHECK_ROOTFS_RW + #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// #Globals @@ -194,19 +184,19 @@ _EOF_ #------------------------------------------------------------------------------------------------------ # Nginx - + elif (( $DP_WEBSERVER_INDEX == 2 )); then - + local nginx_defaultsite="/etc/nginx/sites-available/default" - + # Apply domain name sed -i "/server_name/c\ server_name $LETSENCRYPT_DOMAIN;" "$nginx_defaultsite" - + #Restart nginx to apply ServerName changes. systemctl restart nginx local cli_redirect="--no-redirect" - + if (( $LETSENCRYPT_REDIRECT )); then cli_redirect="--redirect" @@ -215,8 +205,8 @@ _EOF_ #Cert me up Nginx $DP_LETSENCRYPT_BINARY --duplicate --agree-tos $cli_redirect --rsa-key-size $LETSENCRYPT_KEYSIZE --email $LETSENCRYPT_EMAIL -d $LETSENCRYPT_DOMAIN - - + + #------------------------------------------------------------------------------------------------------ #Minio elif (( $DP_WEBSERVER_INDEX == 3 )); then diff --git a/dietpi/dietpi-logclear b/dietpi/dietpi-logclear index 23d8671823..a7e6c775dd 100644 --- a/dietpi/dietpi-logclear +++ b/dietpi/dietpi-logclear @@ -16,12 +16,6 @@ # - dietpi-logclear 2 | Delete all logs in $FILEPATH_LOGFOLDER and backups. #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - INPUT=-1 if [[ $1 =~ ^-?[0-9]+$ ]]; then @@ -29,6 +23,11 @@ fi + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + #Import DietPi-Globals --------------------------------------------------------------- + #//////////////////////////////////////////////////////////////// # Global #//////////////////////////////////////////////////////////////// @@ -62,7 +61,6 @@ #//////////////////////////////////////////////////////////////// # Process log files. #//////////////////////////////////////////////////////////////// - Process_Logfiles(){ #----------------------------------------------------------------------------------- diff --git a/dietpi/dietpi-morsecode b/dietpi/dietpi-morsecode index 51d01a4dc5..bba958d757 100644 --- a/dietpi/dietpi-morsecode +++ b/dietpi/dietpi-morsecode @@ -17,12 +17,6 @@ # - dietpi-morsecode 2 = Output to ALSA (sound) #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - #At the end of the day, if your using this, your probably in a life threating situation. #I doubt your Transmission downloads, or webserver is going to be more important. #So, Lets change the nice to -10 (High priority) ;) @@ -33,6 +27,11 @@ INPUT=$1 fi + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + #Import DietPi-Globals --------------------------------------------------------------- + #///////////////////////////////////////////////////////////////////////////////////// # Output Data #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-obtain_hw_model b/dietpi/dietpi-obtain_hw_model index 50417a7bcd..35f1bdcb83 100644 --- a/dietpi/dietpi-obtain_hw_model +++ b/dietpi/dietpi-obtain_hw_model @@ -96,6 +96,10 @@ # HW_MANUFACTURER_NAME #//////////////////////////////////// + #Import DietPi-Globals --------------------------------------------------------------- + #. /DietPi/dietpi/func/dietpi-globals + #Import DietPi-Globals --------------------------------------------------------------- + #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. LANG=en_GB.UTF-8 diff --git a/dietpi/dietpi-process_tool b/dietpi/dietpi-process_tool index 8650abac75..400e1a4c94 100644 --- a/dietpi/dietpi-process_tool +++ b/dietpi/dietpi-process_tool @@ -17,13 +17,7 @@ # dietpi-process_tool 1 = Apply #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - - #Grab Input (valid interger) + #Grab Input INPUT=0 if [[ $1 =~ ^-?[0-9]+$ ]]; then @@ -31,6 +25,11 @@ fi + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + #Import DietPi-Globals --------------------------------------------------------------- + #///////////////////////////////////////////////////////////////////////////////////// # Globals #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-ramdisk b/dietpi/dietpi-ramdisk index 610736f574..89b43db7fb 100644 --- a/dietpi/dietpi-ramdisk +++ b/dietpi/dietpi-ramdisk @@ -20,6 +20,7 @@ # - /DietPi/dietpi/dietpi-ramdisk 1 = Copy from /DietPi (ram) to /boot (disk) #//////////////////////////////////// + #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. LANG=en_GB.UTF-8 @@ -32,6 +33,10 @@ INPUT=$1 fi + #Import DietPi-Globals --------------------------------------------------------------- + #. /DietPi/dietpi/func/dietpi-globals + #Import DietPi-Globals --------------------------------------------------------------- + FILEPATH_RAM="/DietPi" FILEPATH_DISK="/boot" diff --git a/dietpi/dietpi-ramlog b/dietpi/dietpi-ramlog index 434b911e64..5c2b965cc2 100644 --- a/dietpi/dietpi-ramlog +++ b/dietpi/dietpi-ramlog @@ -31,6 +31,10 @@ INPUT=$1 fi + #Import DietPi-Globals --------------------------------------------------------------- + #. /DietPi/dietpi/func/dietpi-globals + #Import DietPi-Globals --------------------------------------------------------------- + FILEPATH_DIETPI_RAMLOG_SAVE='/etc/dietpi/dietpi-ramlog/storage' #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index 67dff0fe3d..5a8b03c8ec 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -20,16 +20,14 @@ - enable/disable servicename (single service, SystemD) - mask/unmask servicename (single service, SystemD)' - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - + #Grab Inputs INPUT_MODE="$1" INPUT_S2="$2" - DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + #Import DietPi-Globals --------------------------------------------------------------- aSERVICE_NAME=( 'cron' diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index b6518ccc30..705f937e9f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -23,10 +23,11 @@ # - /DietPi/dietpi/dietpi-software setpermissions #Sets shared permissions for /var/www and userdata folders. #//////////////////////////////////// - #Import DietPi-Globals + #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals CHECK_ROOT_USER CHECK_ROOTFS_RW + #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// #Filepath diff --git a/dietpi/dietpi-survey b/dietpi/dietpi-survey index 1e39675856..0db44e1c89 100644 --- a/dietpi/dietpi-survey +++ b/dietpi/dietpi-survey @@ -22,11 +22,10 @@ # $FILENAME_FORMAT.txt #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + #Import DietPi-Globals --------------------------------------------------------------- SURVEY_VERSION=3 SURVEY_SENTCOUNT=1 diff --git a/dietpi/dietpi-sync b/dietpi/dietpi-sync index cd389e73d0..c8bb2f4b37 100644 --- a/dietpi/dietpi-sync +++ b/dietpi/dietpi-sync @@ -17,34 +17,18 @@ # - /DietPi/dietpi/dietpi-sync 1 = Sync #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - - #Exit path for non-root logins. - if (( $UID != 0 )); then - - /DietPi/dietpi/func/dietpi-notify 1 'Error: Root privileges required. Please run the command with "sudo"\n' - exit - - fi - - #RootFS RW check - /DietPi/dietpi/dietpi-drive_manager 3 - if (( $? != 0 )); then - - exit - - fi - #Grab Input (valid interger) INPUT=0 if [[ $1 =~ ^-?[0-9]+$ ]]; then INPUT=$1 fi + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + CHECK_ROOTFS_RW + #Import DietPi-Globals --------------------------------------------------------------- + #///////////////////////////////////////////////////////////////////////////////////// # MENUS #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 6e216bfe66..482c8eb2fa 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -19,28 +19,6 @@ # - dietpi-update 2 = Check for updates. print server_version to /DietPi/dietpi/.update_available (-1=new image required) #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - - #Exit path for non-root logins. - if (( $UID != 0 )); then - - /DietPi/dietpi/func/dietpi-notify 1 'Error: Root privileges required. Please run the command with "sudo"\n' - exit - - fi - - #RootFS RW check - /DietPi/dietpi/dietpi-drive_manager 3 - if (( $? != 0 )); then - - exit - - fi - INPUT=0 if [[ $1 =~ ^-?[0-9]+$ ]]; then @@ -48,6 +26,12 @@ fi + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + CHECK_ROOTFS_RW + #Import DietPi-Globals --------------------------------------------------------------- + #///////////////////////////////////////////////////////////////////////////////////// #GIT Branch | master / testing #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/func/change_hostname b/dietpi/func/change_hostname index 355a260396..02d402ba92 100644 --- a/dietpi/func/change_hostname +++ b/dietpi/func/change_hostname @@ -17,11 +17,11 @@ # - /DietPi/dietpi/func/change_hostname sNEWHOSTNAME #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + CHECK_ROOTFS_RW + #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// #Change Hostname diff --git a/dietpi/func/check_connection b/dietpi/func/check_connection index 666e4a8dd7..a7de1849f4 100644 --- a/dietpi/func/check_connection +++ b/dietpi/func/check_connection @@ -18,11 +18,9 @@ # - /DietPi/dietpi/func/check_connection sURL #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + #Import DietPi-Globals --------------------------------------------------------------- INTERNET_ADDRESS=$1 TIMEOUT=10 diff --git a/dietpi/func/create_mysql_db b/dietpi/func/create_mysql_db index 36031c8297..98fb086143 100644 --- a/dietpi/func/create_mysql_db +++ b/dietpi/func/create_mysql_db @@ -13,17 +13,16 @@ # - mysqladmin -u root -pdietpi drop phpbb3 -f #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - DATABASE_NAME="$1" MYSQL_ROOT_PW="$2" DATABASE_USER="$3" DATABASE_PW="$4" + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + #Import DietPi-Globals --------------------------------------------------------------- + #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 59a8741318..2efe85826e 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -15,10 +15,10 @@ # - . /DietPi/dietpi/func/dietpi-globals > for each script that uses these globals #//////////////////////////////////// - /DietPi/dietpi/func/dietpi-notify 2 'Updating DietPi-Globals, please wait...' + #/DietPi/dietpi/func/dietpi-notify 2 'Updating DietPi-Globals, please wait...' #----------------------------------------------------------------------------------- - # Core var's, functions, enviroment checks. Used at start of all scripts + # Core var's, functions, environment checks. Used at start of all scripts. #----------------------------------------------------------------------------------- #Prevent incorrect parsing with non-english locales. LANG=en_GB.UTF-8 @@ -51,7 +51,7 @@ } #----------------------------------------------------------------------------------- - # Install stage + # DietPi First-Run Stage #----------------------------------------------------------------------------------- # -1 = first boot / 0 = run dietpi-software at login / 1 = completed DIETPI_INSTALL_STAGE=$(cat /DietPi/dietpi/.install_stage) @@ -67,10 +67,12 @@ fi - #Globals HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) HW_MODEL_DESCRIPTION=$(sed -n 2p /DietPi/dietpi/.hw_model) HW_ARCH=$(sed -n 6p /DietPi/dietpi/.hw_model) + HW_CPU_CORES=$(nproc --all) + HW_CPUID=$(sed -n 9p /DietPi/dietpi/.hw_model) + DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) DISTRO_NAME='jessie' if (( $DISTRO == 4 )); then @@ -82,8 +84,6 @@ DISTRO_NAME='buster' fi - HW_CPU_CORES=$(nproc --all) - #----------------------------------------------------------------------------------- # DietPi User-Data #----------------------------------------------------------------------------------- @@ -149,6 +149,6 @@ } #----------------------------------------------------------------------------------- - /DietPi/dietpi/func/dietpi-notify 0 'DietPi-Globals\n' + #/DietPi/dietpi/func/dietpi-notify 0 'DietPi-Globals\n' #----------------------------------------------------------------------------------- } diff --git a/dietpi/func/dietpi-led_control b/dietpi/func/dietpi-led_control index df826594a3..c54a033ae8 100644 --- a/dietpi/func/dietpi-led_control +++ b/dietpi/func/dietpi-led_control @@ -16,12 +16,6 @@ # - /DietPi/dietpi/func/dietpi-led_control 1 Apply from savefile #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - #Grab Input INPUT=0 if [[ $1 =~ ^-?[0-9]+$ ]]; then @@ -30,6 +24,11 @@ fi + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + #Import DietPi-Globals --------------------------------------------------------------- + FP_SETTINGS='/DietPi/dietpi/.dietpi-led_control' aLED_NAME=0 diff --git a/dietpi/func/dietpi-notify b/dietpi/func/dietpi-notify index 300002caea..86b1f117e4 100644 --- a/dietpi/func/dietpi-notify +++ b/dietpi/func/dietpi-notify @@ -15,11 +15,9 @@ # - /DietPi/dietpi/func/dietpi-notify #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + #Import DietPi-Globals --------------------------------------------------------------- aINPUT_STRING=("$@") diff --git a/dietpi/func/dietpi-optimal_mtu b/dietpi/func/dietpi-optimal_mtu index 72474118cb..3e744aca1e 100644 --- a/dietpi/func/dietpi-optimal_mtu +++ b/dietpi/func/dietpi-optimal_mtu @@ -15,17 +15,16 @@ # - dietpi-optimal_mtu URL/IP address | Tests using the provided URL/IP #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - + #Grab Input URL='www.google.com' if [ "$1" != "" ]; then URL="$1" fi + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + #Import DietPi-Globals --------------------------------------------------------------- + MTU_SIZE=1500 TEST_MTU_SIZE=0 SUCCESS=0 diff --git a/dietpi/func/dietpi-set_curlftpfs b/dietpi/func/dietpi-set_curlftpfs index 7fedfa3a22..4af53140aa 100644 --- a/dietpi/func/dietpi-set_curlftpfs +++ b/dietpi/func/dietpi-set_curlftpfs @@ -19,17 +19,16 @@ # - /DietPi/dietpi/func/dietpi-set_curlftpfs 1 = Apply and mount using settings in dietpi.txt #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - + #Grab Input INPUT=0 if [[ $1 =~ ^-?[0-9]+$ ]]; then INPUT=$1 fi + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + #Import DietPi-Globals --------------------------------------------------------------- + #///////////////////////////////////////////////////////////////////////////////////// #curlftpfs data #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/func/dietpi-set_dphys-swapfile b/dietpi/func/dietpi-set_dphys-swapfile index f32e7afda3..f6f5658699 100644 --- a/dietpi/func/dietpi-set_dphys-swapfile +++ b/dietpi/func/dietpi-set_dphys-swapfile @@ -21,11 +21,10 @@ # - /DietPi/dietpi/func/dietpi-set_dphys-swapfile >=2 /var/swap = Enable + Set Size + Set new Location (also deletes previous swapfile) #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + #Import DietPi-Globals --------------------------------------------------------------- SWAP_SIZE_CURRENT=$(cat /etc/dphys-swapfile | grep -m1 '^CONF_SWAPSIZE=' | sed 's/.*=//') SWAP_LOCATION_CURRENT=$(cat /etc/dphys-swapfile | grep -m1 '^CONF_SWAPFILE=' | sed 's/.*=//') diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index e630365c4b..ef14bf89a6 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -32,27 +32,25 @@ $FP_SCRIPT lcdpanel target_panel (none to remove all) " #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 + #Grab Inputs + INPUT_DEVICE_NAME=$(echo -e "$1" | tr '[:upper:]' '[:lower:]') + INPUT_DEVICE_VALUE=$(echo -e "$2" | tr '[:upper:]' '[:lower:]') + # - support for 0/1 inputs for enable/disable + if [ "$INPUT_DEVICE_VALUE" = "1" ]; then - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" + INPUT_DEVICE_VALUE='enable' - #Exit path for non-root logins. - if (( $UID != 0 )); then + elif [ "$INPUT_DEVICE_VALUE" = "0" ]; then - /DietPi/dietpi/func/dietpi-notify 1 'Error: Root privileges required. Please run the command with "sudo"\n' - exit + INPUT_DEVICE_VALUE='disable' fi - #RootFS RW check - /DietPi/dietpi/dietpi-drive_manager 3 - if (( $? != 0 )); then - - exit - - fi + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + CHECK_ROOTFS_RW + #Import DietPi-Globals --------------------------------------------------------------- #Semi support non-dietpi Raspbian FP_RPI_CONFIG='/DietPi/config.txt' @@ -62,26 +60,8 @@ $FP_SCRIPT lcdpanel target_panel (none to remove all) fi - INPUT_DEVICE_NAME=$(echo -e "$1" | tr '[:upper:]' '[:lower:]') - INPUT_DEVICE_VALUE=$(echo -e "$2" | tr '[:upper:]' '[:lower:]') - - #support for 0/1 inputs for enable/disable - if [ "$INPUT_DEVICE_VALUE" = "1" ]; then - - INPUT_DEVICE_VALUE='enable' - - elif [ "$INPUT_DEVICE_VALUE" = "0" ]; then - - INPUT_DEVICE_VALUE='disable' - - fi - EXIT_CODE=0 - HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) - HW_ARCH=$(sed -n 6p /DietPi/dietpi/.hw_model) - DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) - HW_CPUID=$(sed -n 9p /DietPi/dietpi/.hw_model) HW_ONBOARD_WIFI=$(sed -n 10p /DietPi/dietpi/.hw_model) Unknown_Input_Name(){ diff --git a/dietpi/func/dietpi-set_nfsclient b/dietpi/func/dietpi-set_nfsclient index 6ccfa0699b..022540ce30 100644 --- a/dietpi/func/dietpi-set_nfsclient +++ b/dietpi/func/dietpi-set_nfsclient @@ -19,17 +19,16 @@ # - /DietPi/dietpi/func/dietpi-set_nfsclient 1 = Apply and mount using settings in dietpi.txt #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - INPUT=0 if [[ $1 =~ ^-?[0-9]+$ ]]; then INPUT=$1 fi + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + #Import DietPi-Globals --------------------------------------------------------------- + #///////////////////////////////////////////////////////////////////////////////////// #curlftpfs data #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/func/dietpi-set_smbclient b/dietpi/func/dietpi-set_smbclient index 775c658324..e1b37a7646 100644 --- a/dietpi/func/dietpi-set_smbclient +++ b/dietpi/func/dietpi-set_smbclient @@ -19,17 +19,17 @@ # - /DietPi/dietpi/func/dietpi-set_smbclient 1 = Apply and mount using settings in dietpi.txt #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - + #Grab Input INPUT=0 if [[ $1 =~ ^-?[0-9]+$ ]]; then INPUT=$1 fi + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + #Import DietPi-Globals --------------------------------------------------------------- + #///////////////////////////////////////////////////////////////////////////////////// #smbclient data #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index acacf84ef3..b928bed46c 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -24,28 +24,7 @@ $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entrie " #//////////////////////////////////// - #Exit path for non-root logins. - if (( $UID != 0 )); then - - /DietPi/dietpi/func/dietpi-notify 1 'Error: Root privileges required. Please run the command with "sudo"\n' - exit - - fi - - #RootFS RW check - /DietPi/dietpi/dietpi-drive_manager 3 - if (( $? != 0 )); then - - exit - - fi - - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - + #Grab inputs INPUT_MODE_NAME="$1" INPUT_MODE_VALUE="$2" @@ -54,10 +33,13 @@ $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entrie INPUT_ADDITIONAL_3="$5" INPUT_ADDITIONAL_4="$6" - EXIT_CODE=0 + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + CHECK_ROOTFS_RW + #Import DietPi-Globals --------------------------------------------------------------- - HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) - DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) + EXIT_CODE=0 Unknown_Input_Name(){ diff --git a/dietpi/func/dietpi-set_userdata b/dietpi/func/dietpi-set_userdata index 90dee30e96..745b5b94ea 100644 --- a/dietpi/func/dietpi-set_userdata +++ b/dietpi/func/dietpi-set_userdata @@ -18,11 +18,10 @@ # - /DietPi/dietpi/func/dietpi-set_userdata SOURCE_DIRECTORY TARGET_DIRECTORY | Setup user data directory, move data if needed. if TARGET_DIRECTORY='auto' , auto target location.Returns 1 if failed. #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + #Import DietPi-Globals --------------------------------------------------------------- EXIT_CODE=0 diff --git a/dietpi/func/obtain_network_details b/dietpi/func/obtain_network_details index 0da82f9975..bf2584025d 100644 --- a/dietpi/func/obtain_network_details +++ b/dietpi/func/obtain_network_details @@ -24,11 +24,9 @@ # - IP Address #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// # Global diff --git a/dietpi/func/run_ntpd b/dietpi/func/run_ntpd index 326aa69a87..18b9866675 100644 --- a/dietpi/func/run_ntpd +++ b/dietpi/func/run_ntpd @@ -18,11 +18,10 @@ # - /DietPi/dietpi/func/run_ntpd status blocking mode (max Xs), wait for exit code of NTPD and return it. Launches ntpd if process and exit file does not exist #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + #Import DietPi-Globals --------------------------------------------------------------- INPUT_MODE=$1 diff --git a/dietpi/login b/dietpi/login index f3917b9cb1..67b8d1e2a8 100644 --- a/dietpi/login +++ b/dietpi/login @@ -14,27 +14,20 @@ # - requires /DietPi/dietpi/.install_stage to have a value of 0 for it to run /DietPi/dietpi/dietpi-software (active after /dietpi/boot has completed filesystem expansion) #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - #Exit Paths # - SCP connection exit path. Fix for dumb or unset TERM provided by tdaitx export TERM=${TERM:-dumb} if [ "$TERM" = "dumb" ]; then - exit - fi - - # - Exit path for non-root logins. - if (( $UID != 0 )); then - /DietPi/dietpi/func/dietpi-notify 1 'Error: Root privileges required. Please run the command with "sudo"\n' exit fi + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + #Import DietPi-Globals --------------------------------------------------------------- + #///////////////////////////////////////////////////////////////////////////////////// #Globals #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/misc/dietpi-justboom b/dietpi/misc/dietpi-justboom index ea7883b9c6..342ec2586a 100644 --- a/dietpi/misc/dietpi-justboom +++ b/dietpi/misc/dietpi-justboom @@ -14,29 +14,11 @@ # - /DietPi/dietpi/misc/dietpi-justboom #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - - #Exit path for non-root logins. - if (( $UID != 0 )); then - - /DietPi/dietpi/func/dietpi-notify 1 'Error: Root privileges required. Please run the command with "sudo"\n' - exit - - fi - - #RootFS RW check - /DietPi/dietpi/dietpi-drive_manager 3 - if (( $? != 0 )); then - - exit - - fi - - HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + CHECK_ROOTFS_RW + #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// #Globals @@ -50,7 +32,6 @@ fi - # - MPD OUTPUT_FREQ_CURRENT=0 OUTPUT_FREQ_TARGET=0 diff --git a/dietpi/misc/start_kodi b/dietpi/misc/start_kodi index 0d3e17e29c..59efcbb898 100644 --- a/dietpi/misc/start_kodi +++ b/dietpi/misc/start_kodi @@ -18,17 +18,9 @@ # - startkodi (if alias is created in /etc/bash.bashrc) #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" - - #///////////////////////////////////////////////////////////////////////////////////// - #Globals - #///////////////////////////////////////////////////////////////////////////////////// - HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) - DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals + #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// # Main Loop diff --git a/dietpi/patch_file b/dietpi/patch_file index e2ffbac441..3b2885677f 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -16,23 +16,17 @@ # - /DietPi/dietpi/patch_file iCurrentVersion iServerVersion #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 + #Grab input + VERSION_CURRENT=$1 + VERSION_SERVER=$2 - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 - cd "$HOME" + #Import DietPi-Globals --------------------------------------------------------------- + . /DietPi/dietpi/func/dietpi-globals update_hw_details + #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// #Globals #///////////////////////////////////////////////////////////////////////////////////// - VERSION_CURRENT=$1 - VERSION_SERVER=$2 - - HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) - HW_MODEL_DESCRIPTION=$(sed -n 2p /DietPi/dietpi/.hw_model) - DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) - HW_ARCH=$(sed -n 6p /DietPi/dietpi/.hw_model) - ALLO_GUI_IMAGE=0 if [ -f /DietPi/dietpi/.installed ] && (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 '^aSOFTWARE_INSTALL_STATE\[159\]=2') )); then @@ -85,12 +79,6 @@ } - #///////////////////////////////////////////////////////////////////////////////////// - # Main - #///////////////////////////////////////////////////////////////////////////////////// - #Always update HW_* indexs - /DietPi/dietpi/dietpi-obtain_hw_model - #///////////////////////////////////////////////////////////////////////////////////// #Emergency Patch System: # This runs before all standard incremental patches. Useful for when shi* hits the ... From 63b9fd1b3d44705651e9a53ac81d5e0887b213a5 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 17 Dec 2017 09:28:37 +0000 Subject: [PATCH 061/390] v160 + General | Start of FHS compliance: https://github.com/Fourdee/DietPi/issues/1297#issuecomment-352241193 --- CHANGELOG.txt | 7 ++++--- PREP_SYSTEM_FOR_DIETPI.sh | 22 +++++++++++----------- dietpi/boot | 3 ++- dietpi/dietpi-bugreport | 2 +- dietpi/dietpi-ramdisk | 3 +-- dietpi/dietpi-ramlog | 2 +- dietpi/dietpi-update | 2 +- dietpi/func/dietpi-globals | 14 +++++++++----- dietpi/login | 2 +- dietpi/patch_file | 34 +++++++++++++++++++++++++++++----- 10 files changed, 60 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 395c95eca8..bf35d7e6cd 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ v160 Image Modifications: Changes / Improvements / Optimizations: +General | Start of FHS compliance: https://github.com/Fourdee/DietPi/issues/1297#issuecomment-352241193 DietPi-Boot | Improved the method of initial FS_partition and FS_expansion during 1st run, via systemD services. 'fs_force_resize=' in dietpi.txt is no longer supported: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352159930 DietPi-Banner | IP: Will now also list the active network adapter used (eg: eth0/wlan0) DietPi-Globals | Global variables and functions are now exported during login. Please see the sourcecode for more information: https://github.com/Fourdee/DietPi/issues/1311 @@ -47,8 +48,8 @@ DietPi-Config | WiFi: Now uses the wpa_supplicant.conf method to setup WiFi conn DietPi-Backup | "Full Backup" Mode is now the default for fresh DietPi installations. This is mainly due to MySQL data now being in the DietPi userdata directory. DietPi-Config | Tools > Benchmarks: Added ability to benchmark CPU performance based on bash + integer: https://github.com/Fourdee/DietPi/issues/1253#issuecomment-346881878 DietPi-Config | Time sync modes: NTP is now uninstalled when SystemD timedatectl is enabled. Reinstalled on demand. Timedatectl pool servers are now also set: https://github.com/Fourdee/DietPi/issues/1208#issuecomment-343762480 -DietPi-Software | First run setup, now logged to /etc/dietpi/logs/dietpi-firstrun-setup.log. -DietPi-Software | APT log: Moved to /etc/dietpi/logs/dietpi-software_apt.log, to prevent RAMlog clearing log during automated installations. +DietPi-Software | First run setup, now logged to /var/lib/dietpi/logs/dietpi-firstrun-setup.log. +DietPi-Software | APT log: Moved to /var/lib/dietpi/logs/dietpi-software_apt.log, to prevent RAMlog clearing log during automated installations. DietPi-Software | MPD (Stretch): Install updated to 0.20.11. Also supports native DSD playback (thanks to @sudeep and PJotr), when "Native" output freq/bit is set: https://github.com/Fourdee/DietPi/issues/1236 DietPi-Software | moOde: MPD now installed via pre-built binaries. Will reduce install time: https://github.com/Fourdee/DietPi/issues/1223#issuecomment-345265290 DietPi-Software | Nextcloud: Large installation rework, featuring redis file locking, system cron jobs, automatic maintenance, optimized webserver stack configs and others: https://github.com/Fourdee/DietPi/issues/1067 @@ -135,7 +136,7 @@ General | Improved notifications for when DietPi is installing system with autom General | DietPi RPi Kernel: Updated to 4.9.52 General | RPi Stretch: Updated, matching official release of 2017-09-07-raspbian-stretch-lite General | DietPi-Automation: "AUTO_Global_Password=" in "dietpi.txt" will also be applied to the "dietpi" user account. Please note this will only take effect on v157 and higher DietPi images, due to "boot" script requiring an update: https://github.com/Fourdee/DietPi/issues/1134 -DietPi-Update | Added logging for updates > /etc/dietpi/logs/dietpi-update.log +DietPi-Update | Added logging for updates > /var/lib/dietpi/logs/dietpi-update.log DietPi-LetsEncrypt | Added support for Nginx on Stretch. Many thanks to @Bridouz for contributing this: https://github.com/Fourdee/DietPi/pull/1166 DietPi-Software | Apache2 + NextCloud: Various optimizations. For new installations only. Many thanks to @MichaIng for this contribution: https://github.com/Fourdee/DietPi/issues/1067 DietPi-Software | Allo Web Interface: Hidden from software list for now, please use pre-made images: http://dietpi.com/phpbb/viewtopic.php?f=8&t=2317#p8868 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 06aaa9bbcb..b643b2adba 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -277,6 +277,7 @@ rm -R /mnt/dietpi_userdata &> /dev/null rm -R /etc/dietpi &> /dev/null + rm -R /var/lib/dietpi &> /dev/null rm /root/DietPi-Automation.log &> /dev/null rm /boot/Automation_Format_My_Usb_Drive &> /dev/null @@ -827,7 +828,7 @@ _EOF_ mkdir -p /DietPi Error_Check - mkdir -p /etc/dietpi/logs + mkdir -p /var/lib/dietpi/logs Error_Check mkdir -p /mnt/dietpi_userdata @@ -881,15 +882,15 @@ After=local-fs.target [Service] Type=forking RemainAfterExit=yes -ExecStartPre=/bin/mkdir -p /etc/dietpi/logs -ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramdisk 0' -ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramdisk 1' +ExecStartPre=/bin/mkdir -p /var/lib/dietpi/logs +ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramdisk 0 | tee -a /var/lib/dietpi/logs/dietpi-ramdisk.log' +ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramdisk 1 | tee -a /var/lib/dietpi/logs/dietpi-ramdisk.log' [Install] WantedBy=local-fs.target _EOF_ - systemctl enable dietpi-ramdisk.service systemctl daemon-reload + systemctl enable dietpi-ramdisk.service systemctl start dietpi-ramdisk.service Error_Check @@ -911,15 +912,14 @@ ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramlog 1' [Install] WantedBy=local-fs.target _EOF_ - systemctl enable dietpi-ramlog.service systemctl daemon-reload + systemctl enable dietpi-ramlog.service systemctl start dietpi-ramlog.service Error_Check dietpi-notify 2 "Installing DietPi boot service" # Boot - # - DEBUGGING enabled: tee /etc/dietpi/logs/dietpi-boot.log cat << _EOF_ > /etc/systemd/system/dietpi-boot.service [Unit] Description=DietPi-Boot @@ -929,7 +929,7 @@ Requires=dietpi-ramdisk.service [Service] Type=oneshot RemainAfterExit=yes -ExecStart=/bin/bash -c '/DietPi/dietpi/boot | tee /etc/dietpi/logs/dietpi-boot.log' +ExecStart=/bin/bash -c '/DietPi/dietpi/boot' StandardOutput=tty [Install] @@ -1458,7 +1458,7 @@ Before=dietpi-ramdisk.service [Service] Type=oneshot RemainAfterExit=no -ExecStart=/bin/bash -c '/etc/dietpi/fs_partition_resize.sh | tee /etc/dietpi/logs/fs_partition_resize.log' +ExecStart=/bin/bash -c '/etc/dietpi/fs_partition_resize.sh | tee /var/lib/dietpi/logs/fs_partition_resize.log' StandardOutput=tty [Install] @@ -1520,7 +1520,7 @@ Before=dietpi-ramdisk.service [Service] Type=oneshot RemainAfterExit=no -ExecStart=/bin/bash -c "resize2fs \$(findmnt / -o source -n) | tee /etc/dietpi/logs/fs_expand.log; systemctl disable dietpi-fs_expand.service; systemctl daemon-reload" +ExecStart=/bin/bash -c "resize2fs \$(findmnt / -o source -n) | tee /var/lib/dietpi/logs/fs_expand.log; systemctl disable dietpi-fs_expand.service; systemctl daemon-reload" StandardOutput=tty [Install] @@ -1533,7 +1533,7 @@ _EOF_ # #debug # systemctl start dietpi-fs_partition_resize.service # systemctl status dietpi-fs_partition_resize.service -l - # cat /etc/dietpi/logs/fs_partition_resize.log + # cat /var/lib/dietpi/logs/fs_partition_resize.log dietpi-notify 2 'Sync changes to disk and TRIM rootFS' diff --git a/dietpi/boot b/dietpi/boot index 20eac2d9ee..5b8eef2fcd 100644 --- a/dietpi/boot +++ b/dietpi/boot @@ -14,7 +14,8 @@ #//////////////////////////////////// #Import DietPi-Globals --------------------------------------------------------------- - . /DietPi/dietpi/func/dietpi-globals update_hw_details + /DietPi/dietpi/dietpi-obtain_hw_model # Running for the 1st time + . /DietPi/dietpi/func/dietpi-globals #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-bugreport b/dietpi/dietpi-bugreport index 1b094885dd..1505bfc01f 100644 --- a/dietpi/dietpi-bugreport +++ b/dietpi/dietpi-bugreport @@ -123,7 +123,7 @@ _EOF_ # - DietPi scripts / logs "/DietPi/*" "/boot/*" - "/etc/dietpi/logs/*" + "/var/lib/dietpi/logs/*" # - confs "/etc/X11/xorg.conf" diff --git a/dietpi/dietpi-ramdisk b/dietpi/dietpi-ramdisk index 89b43db7fb..8ebd31fd28 100644 --- a/dietpi/dietpi-ramdisk +++ b/dietpi/dietpi-ramdisk @@ -20,7 +20,6 @@ # - /DietPi/dietpi/dietpi-ramdisk 1 = Copy from /DietPi (ram) to /boot (disk) #//////////////////////////////////// - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. LANG=en_GB.UTF-8 @@ -52,7 +51,7 @@ #Main Loop #///////////////////////////////////////////////////////////////////////////////////// - #/etc/dietpi/logs/dietpi-ramdisk.log + #/var/lib/dietpi/logs/dietpi-ramdisk.log #Copy to Ram if (( $INPUT == 0 )); then diff --git a/dietpi/dietpi-ramlog b/dietpi/dietpi-ramlog index 5c2b965cc2..0ce4c951dd 100644 --- a/dietpi/dietpi-ramlog +++ b/dietpi/dietpi-ramlog @@ -35,7 +35,7 @@ #. /DietPi/dietpi/func/dietpi-globals #Import DietPi-Globals --------------------------------------------------------------- - FILEPATH_DIETPI_RAMLOG_SAVE='/etc/dietpi/dietpi-ramlog/storage' + FILEPATH_DIETPI_RAMLOG_SAVE='/var/lib/dietpi/dietpi-ramlog_store' #///////////////////////////////////////////////////////////////////////////////////// #Funcs diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 482c8eb2fa..bfbdb86997 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -41,7 +41,7 @@ #///////////////////////////////////////////////////////////////////////////////////// #UPDATE Vars #///////////////////////////////////////////////////////////////////////////////////// - FP_LOG='/etc/dietpi/logs/dietpi-update.log' + FP_LOG='/var/lib/dietpi/logs/dietpi-update.log' DIETPIUPDATE_VERSION_CURRENT=5 # Version of dietpi-update / set server_version line two to value++ and obsolete previous dietpi-update scripts DIETPIUPDATE_VERSION_REQUIRED=0 diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 2efe85826e..d839720a77 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -60,8 +60,7 @@ # Hardware Details #----------------------------------------------------------------------------------- #Update? - if [ "$1" = 'update_hw_details' ] || - [ ! -f /DietPi/dietpi/.hw_model ]; then + if [ ! -f /DietPi/dietpi/.hw_model ]; then /DietPi/dietpi/dietpi-obtain_hw_model @@ -92,7 +91,7 @@ #----------------------------------------------------------------------------------- # APT #----------------------------------------------------------------------------------- - FP_LOG_APT='/etc/dietpi/logs/dietpi-software_apt.log' + FP_LOG_APT='/var/lib/dietpi/logs/dietpi-software_apt.log' EXITCODE_APT=0 #only way I found of exporting the exit code, once the command is run. AGI(){ @@ -111,6 +110,7 @@ fi #-qq can add a slight period of appearing nothing is happening, lets inform user + /DietPi/dietpi/func/dietpi-notify 2 "APT installation for: $string" /DietPi/dietpi/func/dietpi-notify 2 "APT is processing, please wait...\n" DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $force_options $string 2>&1 | tee "$FP_LOG_APT" EXITCODE_APT=${PIPESTATUS[0]} @@ -121,13 +121,15 @@ AGP(){ local string="$@" + local options='' if (( $DISTRO >= 4 )); then - string+=' --allow-change-held-packages' + options+=' --allow-change-held-packages' fi - apt-get purge -y $string + /DietPi/dietpi/func/dietpi-notify 2 "APT removal for: $string" + apt-get purge -y $string $options EXITCODE_APT=${PIPESTATUS[0]} } @@ -135,6 +137,7 @@ #apt-get autoremove AGA(){ + /DietPi/dietpi/func/dietpi-notify 2 "APT autoremove + purge" apt-get autoremove --purge -y EXITCODE_APT=${PIPESTATUS[0]} @@ -143,6 +146,7 @@ #apt-get install -f AGF(){ + /DietPi/dietpi/func/dietpi-notify 2 "APT fix" DEBIAN_FRONTEND=noninteractive apt-get install -f -y $force_options 2>&1 | tee "$FP_LOG_APT" EXITCODE_APT=${PIPESTATUS[0]} diff --git a/dietpi/login b/dietpi/login index 67b8d1e2a8..23705a5ba0 100644 --- a/dietpi/login +++ b/dietpi/login @@ -34,7 +34,7 @@ HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) DIETPI_INSTALL_STAGE=$(cat /DietPi/dietpi/.install_stage) - FP_DIETPI_FIRSTRUNSETUP_LOG='/etc/dietpi/logs/dietpi-firstrun-setup.log' + FP_DIETPI_FIRSTRUNSETUP_LOG='/var/lib/dietpi/logs/dietpi-firstrun-setup.log' #///////////////////////////////////////////////////////////////////////////////////// #DietPi-Autostart diff --git a/dietpi/patch_file b/dietpi/patch_file index 3b2885677f..c5fe11fa75 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -21,7 +21,8 @@ VERSION_SERVER=$2 #Import DietPi-Globals --------------------------------------------------------------- - . /DietPi/dietpi/func/dietpi-globals update_hw_details + /DietPi/dietpi/dietpi-obtain_hw_model # Always update + . /DietPi/dietpi/func/dietpi-globals #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -2273,9 +2274,9 @@ After=local-fs.target [Service] Type=forking RemainAfterExit=yes -ExecStartPre=/bin/mkdir -p /etc/dietpi/logs -ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramdisk 0 &>> /etc/dietpi/logs/dietpi-ramdisk.log' -ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramdisk 1 &>> /etc/dietpi/logs/dietpi-ramdisk.log' +ExecStartPre=/bin/mkdir -p /var/lib/dietpi/logs +ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramdisk 0 &>> /var/lib/dietpi/logs/dietpi-ramdisk.log' +ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramdisk 1 &>> /var/lib/dietpi/logs/dietpi-ramdisk.log' [Install] WantedBy=local-fs.target @@ -2518,7 +2519,7 @@ After=local-fs.target [Service] Type=forking RemainAfterExit=yes -ExecStartPre=/bin/mkdir -p /etc/dietpi/logs +ExecStartPre=/bin/mkdir -p /var/lib/dietpi/logs ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramdisk 0' ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramdisk 1' @@ -2983,6 +2984,29 @@ _EOF_ fi #------------------------------------------------------------------------------- + #FHS logfiles: https://github.com/Fourdee/DietPi/issues/1297 + rm -R /etc/dietpi/dietpi-ramlog + mkdir -p /var/lib/dietpi/logs + + # - Updated services + cat << _EOF_ > /etc/systemd/system/dietpi-ramdisk.service +[Unit] +Description=DietPi-RAMdisk +After=local-fs.target + +[Service] +Type=forking +RemainAfterExit=yes +ExecStartPre=/bin/mkdir -p /var/lib/dietpi/logs +ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramdisk 0 | tee -a /var/lib/dietpi/logs/dietpi-ramdisk.log' +ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramdisk 1 | tee -a /var/lib/dietpi/logs/dietpi-ramdisk.log' + +[Install] +WantedBy=local-fs.target +_EOF_ + systemctl daemon-reload + systemctl enable dietpi-ramdisk.service + #------------------------------------------------------------------------------- fi From 326dc600f0c68fde7e37db81d6324c6c23bd857b Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 17 Dec 2017 10:03:12 +0000 Subject: [PATCH 062/390] v160 + Rename to support error checking for AGI etc: https://github.com/Fourdee/DietPi/issues/1311 --- dietpi/dietpi-software | 620 ++++++++++++++++++++--------------------- 1 file changed, 300 insertions(+), 320 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 705f937e9f..ba48071f1f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3356,24 +3356,12 @@ _EOF_ } #apt-get install - AGI(){ + APT_INSTALL(){ local string="$@" - local force_options='--force-yes' - - if (( $DISTRO >= 4 )); then - - force_options='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' - - fi - - #-qq can add a slight period of appearing nothing is happening, lets inform user - /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_LOG_APT" - - local result=${PIPESTATUS[0]} - if (( $result != 0 )); then + AGI $string + if (( $EXITCODE_APT != 0 )); then Error_AptGet_Failed @@ -3382,26 +3370,18 @@ _EOF_ } #apt-get purge - AGP(){ + APT_PURGE(){ local string="$@" - if (( $DISTRO >= 4 )); then - - string+=' --allow-change-held-packages' - - fi - - $APT_BINARY purge -y $string + AGP $string } #apt-get install -f - AGF(){ - - DEBIAN_FRONTEND=noninteractive $APT_BINARY install -f -y $force_options 2>&1 | tee "$FP_LOG_APT" + APT_FIX(){ - local result=${PIPESTATUS[0]} - if (( $result != 0 )); then + AGF + if (( $EXITCODE_APT != 0 )); then Error_AptGet_Failed @@ -3530,7 +3510,7 @@ _EOF_ # if (( $? == 0 )); then # # #Install Python and PIP - # AGI python python-pip python-imaging + # APT_INSTALL python python-pip python-imaging # # cd "$HOME" # git clone --depth=1 "$INSTALL_URL_ADDRESS" @@ -3564,7 +3544,7 @@ _EOF_ if (( $? == 0 )); then - AGI lxde upower policykit-1 iceweasel p7zip-full --no-install-recommends + APT_INSTALL lxde upower policykit-1 iceweasel p7zip-full --no-install-recommends #upower policykit-1. Needed for LXDE logout menu item to show shutdown/restart ...... else @@ -3588,7 +3568,7 @@ _EOF_ if (( $? == 0 )); then - AGI mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full --no-install-recommends + APT_INSTALL mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full --no-install-recommends else @@ -3611,7 +3591,7 @@ _EOF_ if (( $? == 0 )); then - AGI x-window-system-core wmaker gnustep gnustep-devel gnustep-games libc-dbg upower policykit-1 iceweasel p7zip-full --no-install-recommends + APT_INSTALL x-window-system-core wmaker gnustep gnustep-devel gnustep-games libc-dbg upower policykit-1 iceweasel p7zip-full --no-install-recommends else @@ -3634,7 +3614,7 @@ _EOF_ if (( $? == 0 )); then - AGI xfce4 xfce4-terminal gnome-icon-theme tango-icon-theme iceweasel p7zip-full --no-install-recommends + APT_INSTALL xfce4 xfce4-terminal gnome-icon-theme tango-icon-theme iceweasel p7zip-full --no-install-recommends else @@ -3650,7 +3630,7 @@ _EOF_ Banner_Installing - AGI xrdp + APT_INSTALL xrdp fi @@ -3700,7 +3680,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI transmission-daemon + APT_INSTALL transmission-daemon fi @@ -3711,7 +3691,7 @@ _EOF_ Banner_Installing echo -e "proftpd-basic shared/proftpd/inetd_or_standalone select standalone" | debconf-set-selections - AGI proftpd-basic + APT_INSTALL proftpd-basic fi @@ -3720,7 +3700,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI samba samba-common-bin --no-install-recommends + APT_INSTALL samba samba-common-bin --no-install-recommends fi @@ -3730,7 +3710,7 @@ _EOF_ Banner_Installing - AGI vsftpd --no-install-recommends + APT_INSTALL vsftpd --no-install-recommends fi @@ -3740,7 +3720,7 @@ _EOF_ Banner_Installing - AGI nfs-kernel-server nfs-common ucf rpcbind + APT_INSTALL nfs-kernel-server nfs-common ucf rpcbind fi @@ -3749,7 +3729,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI apache2 + APT_INSTALL apache2 fi @@ -3758,7 +3738,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI nginx xml-core --no-install-recommends + APT_INSTALL nginx xml-core --no-install-recommends fi @@ -3767,7 +3747,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI lighttpd + APT_INSTALL lighttpd fi @@ -3780,7 +3760,7 @@ _EOF_ debconf-set-selections <<< "mysql-server mysql-server/root_password password $GLOBAL_PW" debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $GLOBAL_PW" - AGI mysql-server + APT_INSTALL mysql-server # Fix depricated key_buffer -> key_buffer_size per MySQL 5.x notification sed -i 's/^key_buffer[[:space:]]/key_buffer_size /g' /etc/mysql/my.cnf @@ -3796,7 +3776,7 @@ _EOF_ Banner_Installing - AGI mariadb-server + APT_INSTALL mariadb-server fi @@ -3805,7 +3785,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI sqlite3 + APT_INSTALL sqlite3 fi @@ -3814,11 +3794,11 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI redis-server + APT_INSTALL redis-server #Redis php module | == 2 to check for existing installs, if == 1, then module will be installed together with PHP, to prevent dependency installations if (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )); then - AGI "$PHP_APT_PACKAGE_NAME"-redis + APT_INSTALL "$PHP_APT_PACKAGE_NAME"-redis fi @@ -3833,28 +3813,28 @@ _EOF_ #Install base PHP packages/modules. if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then - AGI "$PHP_APT_PACKAGE_NAME" libapache2-mod-"$PHP_APT_PACKAGE_NAME" + APT_INSTALL "$PHP_APT_PACKAGE_NAME" libapache2-mod-"$PHP_APT_PACKAGE_NAME" else - AGI "$PHP_APT_PACKAGE_NAME"-fpm "$PHP_APT_PACKAGE_NAME"-cgi "$PHP_APT_PACKAGE_NAME"-xsl + APT_INSTALL "$PHP_APT_PACKAGE_NAME"-fpm "$PHP_APT_PACKAGE_NAME"-cgi "$PHP_APT_PACKAGE_NAME"-xsl fi #php-common modules, used by most web software - AGI "$PHP_APT_PACKAGE_NAME"-curl "$PHP_APT_PACKAGE_NAME"-gd "$PHP_APT_PACKAGE_NAME"-apcu "$PHP_APT_PACKAGE_NAME"-mcrypt + APT_INSTALL "$PHP_APT_PACKAGE_NAME"-curl "$PHP_APT_PACKAGE_NAME"-gd "$PHP_APT_PACKAGE_NAME"-apcu "$PHP_APT_PACKAGE_NAME"-mcrypt # + stretch extras if (( $DISTRO >= 4 )); then - AGI "$PHP_APT_PACKAGE_NAME"-mbstring "$PHP_APT_PACKAGE_NAME"-zip "$PHP_APT_PACKAGE_NAME"-xml + APT_INSTALL "$PHP_APT_PACKAGE_NAME"-mbstring "$PHP_APT_PACKAGE_NAME"-zip "$PHP_APT_PACKAGE_NAME"-xml fi #php-SQL modules if (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 )); then - AGI "$PHP_APT_PACKAGE_NAME"-mysql + APT_INSTALL "$PHP_APT_PACKAGE_NAME"-mysql fi @@ -3862,11 +3842,11 @@ _EOF_ if (( $DISTRO < 4 )); then #For <= Jessie, php5-mysqlnd provides the newer mysql client libraries compared to php5-mysql. - AGI "$PHP_APT_PACKAGE_NAME"-mysqlnd + APT_INSTALL "$PHP_APT_PACKAGE_NAME"-mysqlnd else #For >= Stretch, php(7.X)-mysqlnd does not exist, thus php-mysql need to be installed: https://packages.debian.org/de/stretch/php-mysql - AGI "$PHP_APT_PACKAGE_NAME"-mysql + APT_INSTALL "$PHP_APT_PACKAGE_NAME"-mysql fi @@ -3874,14 +3854,14 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[87]} >= 1 )); then - AGI "$PHP_APT_PACKAGE_NAME"-sqlite* #wildcard for version (eg:3) + APT_INSTALL "$PHP_APT_PACKAGE_NAME"-sqlite* #wildcard for version (eg:3) fi #Redis php module | >= 1 to check for existing installs (2) if (( ${aSOFTWARE_INSTALL_STATE[91]} >= 1 )); then - AGI "$PHP_APT_PACKAGE_NAME"-redis + APT_INSTALL "$PHP_APT_PACKAGE_NAME"-redis fi @@ -3916,7 +3896,7 @@ _EOF_ fi - AGI phpmyadmin + APT_INSTALL phpmyadmin fi @@ -3937,8 +3917,8 @@ _EOF_ if (( $? == 0 )); then #libupnp6 for net discov with upnp/avahi - AGI libupnp6 - AGI libmpdclient2 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file --no-install-recommends + APT_INSTALL libupnp6 + APT_INSTALL libmpdclient2 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file --no-install-recommends wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb @@ -3952,7 +3932,7 @@ _EOF_ else - AGI mpd + APT_INSTALL mpd fi @@ -3989,7 +3969,7 @@ _EOF_ if (( $? == 0 )); then #Prereqs - AGI libmpdclient2 libflac8 libyajl2 libavahi-client3 libvorbisfile3 libwavpack1 libmad0 libmpg123-0 libopus0 libavformat57 libfaad2 libcdio-paranoia1 libiso9660-8 libshout3 libid3tag0 + APT_INSTALL libmpdclient2 libflac8 libyajl2 libavahi-client3 libvorbisfile3 libwavpack1 libmad0 libmpg123-0 libopus0 libavformat57 libfaad2 libcdio-paranoia1 libiso9660-8 libshout3 libid3tag0 apt-mark unhold mpd &> /dev/null #??? Not required for dpkg -i installs @@ -4045,10 +4025,10 @@ _EOF_ if (( $? == 0 )); then - AGI libsodium-dev automake autoconf pkg-config libtool libssl-dev libffi-dev python-dev openssl libzmq3-dev + APT_INSTALL libsodium-dev automake autoconf pkg-config libtool libssl-dev libffi-dev python-dev openssl libzmq3-dev #Not required. - #AGI software-properties-common + #APT_INSTALL software-properties-common #add-apt-repository -y ppa:chris-lea/libsodium #apt-get update @@ -4140,7 +4120,7 @@ _EOF_ if (( $? == 0 )); then # Install necessary PHP modules: https://doc.owncloud.org/server/latest/admin_manual/installation/source_installation.html#php-extensions - AGI "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis + APT_INSTALL "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis if [ ! -f /etc/apt/sources.list.d/owncloud.list ] && [ ! -d /var/www/owncloud ]; then @@ -4164,7 +4144,7 @@ _EOF_ # Install APT package just, if we have ownCloud's own up to date repository. if [ -f /etc/apt/sources.list.d/owncloud.list ]; then - apt-get update && AGI owncloud-files + apt-get update && APT_INSTALL owncloud-files fi @@ -4189,7 +4169,7 @@ _EOF_ if (( $? == 0 )); then # Install 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"-redis + APT_INSTALL "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis if [ ! -d /var/www/nextcloud ]; then @@ -4336,7 +4316,7 @@ _EOF_ if (( $? == 0 )); then - AGI libpulse0 libfftw3-3 + APT_INSTALL libpulse0 libfftw3-3 wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb @@ -4369,14 +4349,14 @@ _EOF_ wget https://apt.mopidy.com/jessie.list -O /etc/apt/sources.list.d/mopidy.list apt-get update - AGI mopidy + APT_INSTALL mopidy #ARMv8 #NB: No ARM64 packages currently exist in mopidy repo. So it will throw a minor error when updating apt. #Mopidy web client extensions not loading in webpage... # if (( $HW_ARCH == 3 )); then - # AGI build-essential python-dev + # APT_INSTALL build-essential python-dev # pip install mopidy #no effect, claims already upto date. # fi @@ -4400,29 +4380,29 @@ _EOF_ #Odroids if (( $HW_MODEL >= 10 )) && (( $HW_MODEL < 20 )); then - AGI kodi-odroid + APT_INSTALL kodi-odroid #XU4 - requires pulse audio (fixes corrupt sound) if (( $HW_MODEL == 11 )); then - AGI pulseaudio --no-install-recommends + APT_INSTALL pulseaudio --no-install-recommends fi #Everything else else - AGI kodi + APT_INSTALL kodi fi # - libcurl3-gnutls required for C2. But lets apply to all: https://github.com/Fourdee/DietPi/issues/446 - AGI libcurl3-gnutls + APT_INSTALL libcurl3-gnutls # - Add NFS support for kodi if (( $DISTRO == 3 )); then - AGI libnfs4 + APT_INSTALL libnfs4 fi @@ -4448,7 +4428,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI minidlna + APT_INSTALL minidlna fi @@ -4506,12 +4486,12 @@ _EOF_ #Install if (( $? == 0 )); then - AGI alsa-oss joystick libsdl-image1.2 libsdl-ttf2.0-0 libsdl-gfx1.2-5 libguichan-0.8.1-1* libguichan-allegro-0.8.1-1* libguichan-sdl-0.8.1-1* libguichan-opengl-0.8.1-1* libjpgalleg4.4 libxml2 libmpg123-0 + APT_INSTALL alsa-oss joystick libsdl-image1.2 libsdl-ttf2.0-0 libsdl-gfx1.2-5 libguichan-0.8.1-1* libguichan-allegro-0.8.1-1* libguichan-sdl-0.8.1-1* libguichan-opengl-0.8.1-1* libjpgalleg4.4 libxml2 libmpg123-0 #libmpeg2-4 # Required for dev branch # + SDL2 - AGI libpng12-0 libflac8 libmpg123-0 libgoogle-perftools4 libfreetype6 libxxf86vm1 + APT_INSTALL libpng12-0 libflac8 libmpg123-0 libgoogle-perftools4 libfreetype6 libxxf86vm1 #Download binaries # - Backup existing autostart.uae for user @@ -4541,7 +4521,7 @@ _EOF_ #Install if (( $? == 0 )); then - AGI libsdl-mixer1.2 libsdl1.2debian libphysfs1 + APT_INSTALL libsdl-mixer1.2 libsdl1.2debian libphysfs1 wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z -o"$FP_DIETPI_USERDATA" @@ -4585,7 +4565,7 @@ _EOF_ #ARMv8 source build if (( $HW_ARCH == 3 )); then - AGI build-essential zlib1g-dev libcurl4-openssl-dev libcrypto++-dev sqlite3 + APT_INSTALL build-essential zlib1g-dev libcurl4-openssl-dev libcrypto++-dev sqlite3 wget "$INSTALL_URL_ADDRESS" -O package.tar tar xzvf package.tar @@ -4640,7 +4620,7 @@ _EOF_ #Install if (( $? == 0 )); then - AGI ibsdl1.2debian libsdl-net1.2 --no-install-recommends + APT_INSTALL ibsdl1.2debian libsdl-net1.2 --no-install-recommends #Download binaries wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -4669,7 +4649,7 @@ _EOF_ if (( $? == 0 )); then #Install pre-reqs - AGI gpac motion + APT_INSTALL gpac motion #Get source/binaries and extract wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -4718,7 +4698,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI deluged deluge-web deluge-webui deluge-console + APT_INSTALL deluged deluge-web deluge-webui deluge-console fi @@ -4728,7 +4708,7 @@ _EOF_ Banner_Installing - AGI python + APT_INSTALL python #Download Grasshopper local grasshopper_directory='/var/www' @@ -4791,7 +4771,7 @@ _EOF_ wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb - AGF + APT_FIX rm package.deb @@ -4816,13 +4796,13 @@ _EOF_ echo -e "deb $INSTALL_URL_ADDRESS erasmus main" > /etc/apt/sources.list.d/openmediavault.list apt-get update - AGI openmediavault-keyring + APT_INSTALL openmediavault-keyring debconf-set-selections <<< "openmediavault openmediavault/run-initsystem note" debconf-set-selections <<< "postfix postfix/main_mailer_type select No configuration" apt-get update - AGI openmediavault postfix + APT_INSTALL openmediavault postfix else @@ -4863,7 +4843,7 @@ _EOF_ Banner_Installing - AGI darkice icecast2 + APT_INSTALL darkice icecast2 fi @@ -4904,7 +4884,7 @@ _EOF_ if (( $? == 0 )); then # - Pre-reqs: https://github.com/Fourdee/DietPi/issues/1282#issuecomment-350490524 - AGI "$PHP_APT_PACKAGE_NAME"-cgi "$PHP_APT_PACKAGE_NAME"-sqlite* + APT_INSTALL "$PHP_APT_PACKAGE_NAME"-cgi "$PHP_APT_PACKAGE_NAME"-sqlite* # - Check free available memory. Increase swapfile size to prevent gravity running out of mem. if (( $(free -m | grep -m1 'Mem:' | awk '{print $4}') < 512 )); then @@ -4954,7 +4934,7 @@ _EOF_ /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - #AGI lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 + #APT_INSTALL lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 #Install SubSonic 5.3 wget "$INSTALL_URL_ADDRESS" -O package.deb @@ -4979,7 +4959,7 @@ _EOF_ /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - #AGI lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 + #APT_INSTALL lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 #Install SubSonic 6.0 wget "$INSTALL_URL_ADDRESS" -O package.deb @@ -5033,12 +5013,12 @@ _EOF_ # >= v111 image if [ -f /etc/.dietpi_image_version ]; then - AGI python-rpi.gpio python3-rpi.gpio + APT_INSTALL python-rpi.gpio python3-rpi.gpio # - < v111 Bug in older DietPi images with sources.list | Use pip, as offical repo = python3-rpi.gpio: Depends: python3 (< 3.3) but 3.4.2-2 is to be installed else - AGI python3-pip + APT_INSTALL python3-pip pip3 install RPi.GPIO fi @@ -5126,12 +5106,12 @@ _EOF_ Banner_Installing - AGI python python3 + APT_INSTALL python python3 # - RPi, pre-reqs GPIO control for Node-Red if (( $HW_MODEL < 10 )); then - AGI python-rpi.gpio + APT_INSTALL python-rpi.gpio fi @@ -5241,7 +5221,7 @@ _EOF_ apt-get update - AGI mosquitto + APT_INSTALL mosquitto else @@ -5269,7 +5249,7 @@ _EOF_ wget "$INSTALL_URL_ADDRESS" -O /etc/blynkserver/server.jar # - Install Blynk JS Libary - AGI python + APT_INSTALL python npm install -g onoff npm install -g blynk-library @@ -5327,12 +5307,12 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then # - Prereqs - AGI libasound2 + APT_INSTALL libasound2 # - Stretch, install additional packages if (( $DISTRO >= 4 )); then - AGI gcc-6-base libstdc++6 + APT_INSTALL gcc-6-base libstdc++6 fi @@ -5360,7 +5340,7 @@ _EOF_ Banner_Installing - AGI tomcat8 + APT_INSTALL tomcat8 fi @@ -5375,7 +5355,7 @@ _EOF_ if (( $? == 0 )); then #Python dev, pre-reqs - AGI python-dev python-setuptools --no-install-recommends + APT_INSTALL python-dev python-setuptools --no-install-recommends #Install WEBIOPI wget "$INSTALL_URL_ADDRESS" -O package.tar @@ -5441,7 +5421,7 @@ _EOF_ cd haproxy-* #Pre-reqs - AGI libpcre3-dev libssl-dev + APT_INSTALL libpcre3-dev libssl-dev #Compile and install make -j $HW_CPU_CORES TARGET=linux2628 CPU=generic USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 USE_LINUX_SPLICE=1 make install @@ -5484,7 +5464,7 @@ _EOF_ rm package.deb #https://github.com/Fourdee/DietPi/issues/736 - AGF + APT_FIX #Stop service service logitechmediaserver stop @@ -5493,7 +5473,7 @@ _EOF_ # 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 + # APT_INSTALL yasm git build-essential automake cpanminus nasm libxml-parser-perl libexpat1-dev libgif-dev zlib1g-dev libjpeg-dev libpng-dev # + ARMv6 cpan @@ -5506,8 +5486,8 @@ _EOF_ # + ARM64 cpan elif (( $HW_ARCH == 3 )); then - AGI libxml-parser-perl - AGI zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev # shared libs needed for Image::Scale@0.08 + APT_INSTALL libxml-parser-perl + APT_INSTALL zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev # shared libs needed for Image::Scale@0.08 wget http://dietpi.com/downloads/binaries/all/DietPi-LMS7.9-CPAN_arm64.zip -O package.zip unzip -o package.zip -d /usr/share/squeezeboxserver @@ -5554,7 +5534,7 @@ _EOF_ Banner_Installing - AGI tightvncserver x11vnc --no-install-recommends + APT_INSTALL tightvncserver x11vnc --no-install-recommends fi @@ -5564,12 +5544,12 @@ _EOF_ Banner_Installing - AGI vnc4server x11vnc --no-install-recommends + APT_INSTALL vnc4server x11vnc --no-install-recommends # - Stretch+ if (( $DISTRO >= 4 )); then - AGI tigervnc-common + APT_INSTALL tigervnc-common fi @@ -5602,7 +5582,7 @@ _EOF_ # fi # - Available in Raspbian apt - AGI realvnc-vnc-server + APT_INSTALL realvnc-vnc-server fi @@ -5614,7 +5594,7 @@ _EOF_ touch /var/log/auth.log #: https://github.com/Fourdee/DietPi/issues/475#issuecomment-310873879 - AGI fail2ban --no-install-recommends + APT_INSTALL fail2ban --no-install-recommends fi @@ -5713,7 +5693,7 @@ _EOF_ Banner_Installing - AGI openvpn easy-rsa iptables + APT_INSTALL openvpn easy-rsa iptables fi @@ -5730,7 +5710,7 @@ _EOF_ #Install if (( $? == 0 )); then - AGI lsb-release + APT_INSTALL lsb-release # - Requires underpriv user: https://github.com/Fourdee/DietPi/issues/570#issuecomment-255588307 useradd pivpn @@ -5777,17 +5757,17 @@ _EOF_ if (( $DISTRO >= 4 )); then - AGI certbot + APT_INSTALL certbot if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then - AGI python-certbot-apache + APT_INSTALL python-certbot-apache fi if (( ${aSOFTWARE_INSTALL_STATE[85]} >= 1 )); then - AGI python-certbot-nginx + APT_INSTALL python-certbot-nginx fi @@ -5839,7 +5819,7 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - AGI hostapd isc-dhcp-server iptables libnl-3-200 + APT_INSTALL hostapd isc-dhcp-server iptables libnl-3-200 wget "$INSTALL_URL_ADDRESS" -O package.zip unzip -o package.zip @@ -5962,7 +5942,7 @@ _EOF_ Banner_Installing # - Prereqs - AGI tor + APT_INSTALL tor fi @@ -6002,10 +5982,10 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - AGI openssl libsoxr0 libavahi-client3 libtool libconfig9 libpopt0 libdaemon0 --no-install-recommends + APT_INSTALL openssl libsoxr0 libavahi-client3 libtool libconfig9 libpopt0 libdaemon0 --no-install-recommends # This occured on C2: shairport-sync : Depends: libpopt-dev but it is not installed - #AGI libpopt-dev + #APT_INSTALL libpopt-dev wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z -o/ @@ -6072,7 +6052,7 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - AGI brutefir + APT_INSTALL brutefir wget -r -nH --cut-dirs=2 --no-parent --reject="index.htm*" -e robots=off "$INSTALL_URL_ADDRESS" mv BruteFIR /etc/ @@ -6124,7 +6104,7 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - AGI squeezelite + APT_INSTALL squeezelite # - Overwrite binary with latest version: wget "$INSTALL_URL_ADDRESS" -O package.7z @@ -6182,7 +6162,7 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - AGI minicom python-serial python-configobj --no-install-recommends + APT_INSTALL minicom python-serial python-configobj --no-install-recommends pip install paho-mqtt pydispatcher wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -6268,7 +6248,7 @@ _EOF_ if (( $? == 0 )); then # - For compression - AGI --no-install-recommends zlib1g-dev + APT_INSTALL --no-install-recommends zlib1g-dev wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb @@ -6314,7 +6294,7 @@ _EOF_ Banner_Installing - AGI mumble-server + APT_INSTALL mumble-server fi @@ -6397,7 +6377,7 @@ _EOF_ fi - AGI emby-server embymagick + APT_INSTALL emby-server embymagick else @@ -6451,12 +6431,12 @@ _EOF_ dpkg --add-architecture armhf apt-get update - AGI binutils:armhf plexmediaserver-installer:armhf + APT_INSTALL binutils:armhf plexmediaserver-installer:armhf #ARM32 else - AGI plexmediaserver-installer + APT_INSTALL plexmediaserver-installer fi @@ -6524,7 +6504,7 @@ _EOF_ if (( $? == 0 )); then #prereqs - AGI python python3 supervisor rdiff-backup screen rsync + APT_INSTALL python python3 supervisor rdiff-backup screen rsync mkdir -p "$FP_DIETPI_USERDATA"/mineos cd "$FP_DIETPI_USERDATA"/mineos @@ -6595,7 +6575,7 @@ _EOF_ Banner_Installing - AGI qbittorrent-nox + APT_INSTALL qbittorrent-nox fi @@ -6611,16 +6591,16 @@ _EOF_ #Install if (( $? == 0 )); then - AGI rtorrent screen #mediainfo + APT_INSTALL rtorrent screen #mediainfo #Raspbian unrar free if (( $HW_MODEL < 10 )); then - AGI unrar-free #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 + APT_INSTALL unrar-free #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 else - AGI unrar #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 + APT_INSTALL unrar #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 fi @@ -6649,7 +6629,7 @@ _EOF_ if (( $DISTRO >= 4 )); then - AGI aria2 + APT_INSTALL aria2 else @@ -6682,7 +6662,7 @@ _EOF_ if (( $? == 0 )); then # - prereqs - AGI libc-ares2 + APT_INSTALL libc-ares2 wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z @@ -6732,16 +6712,16 @@ _EOF_ #Install if (( $? == 0 )); then - AGI python libxslt1.1 libxml2 python-openssl python-xmltodict + APT_INSTALL python libxslt1.1 libxml2 python-openssl python-xmltodict #Raspbian unrar free if (( $HW_MODEL < 10 )); then - AGI unrar-free + APT_INSTALL unrar-free else - AGI unrar + APT_INSTALL unrar fi @@ -6855,7 +6835,7 @@ _EOF_ /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - AGI libpng12-0 libfontconfig1 + APT_INSTALL libpng12-0 libfontconfig1 wget "$INSTALL_URL_ADDRESS" -O package.tar mkdir /etc/tonido @@ -6881,11 +6861,11 @@ _EOF_ if (( $HW_MODEL < 10 )); then - AGI chromium-browser + APT_INSTALL chromium-browser else - AGI chromium + APT_INSTALL chromium fi @@ -6914,11 +6894,11 @@ _EOF_ # - Odroid's, 'apt-get install -f' removes chromium package, rather than install required deps... if (( $HW_MODEL >= 10 && $HW_MODEL < 20 )); then - AGI libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7 + APT_INSTALL libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7 else - AGF + APT_FIX fi @@ -6970,7 +6950,7 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - AGI v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev libx264-142 libavcodec56 libavformat56 libmysqlclient18 libswscale3 libpq5 + APT_INSTALL v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev libx264-142 libavcodec56 libavformat56 libmysqlclient18 libswscale3 libpq5 # - Motion wget "$INSTALL_URL_ADDRESS" -O package.deb @@ -6990,9 +6970,9 @@ _EOF_ else # - Prereqs - AGI v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev + APT_INSTALL v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev - AGI motion + APT_INSTALL motion # - Motioneye pip install motioneye @@ -7021,7 +7001,7 @@ _EOF_ wget -q -O - https://davesteele.github.io/key-366150CE.pub.txt | apt-key add - apt-get update - AGI cloudprint-service + APT_INSTALL cloudprint-service else @@ -7031,7 +7011,7 @@ _EOF_ else - AGI cloudprint-service + APT_INSTALL cloudprint-service fi @@ -7094,15 +7074,15 @@ _EOF_ if (( $? == 0 )); then #prereqs - AGI par2 python-dev libffi-dev libssl-dev + APT_INSTALL par2 python-dev libffi-dev libssl-dev if (( $HW_MODEL < 10 )); then - AGI unrar-free + APT_INSTALL unrar-free else - AGI unrar + APT_INSTALL unrar fi @@ -7158,7 +7138,7 @@ _EOF_ /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - AGI libffi-dev libssl-dev python-lxml python3-lxml + APT_INSTALL libffi-dev libssl-dev python-lxml python3-lxml wget "$INSTALL_URL_ADDRESS" -O package.zip unzip -o package.zip @@ -7190,7 +7170,7 @@ _EOF_ #Install if (( $? == 0 )); then - AGI python + APT_INSTALL python wget "$INSTALL_URL_ADDRESS" -O package.zip unzip -o package.zip @@ -7235,7 +7215,7 @@ _EOF_ fi apt-get update - AGI nzbdrone + APT_INSTALL nzbdrone fi @@ -7252,7 +7232,7 @@ _EOF_ #Install if (( $? == 0 )); then - AGI mono-devel mediainfo sqlite3 libmono-cil-dev + APT_INSTALL mono-devel mediainfo sqlite3 libmono-cil-dev wget $( curl -s "$INSTALL_URL_ADDRESS" | grep linux.tar.gz | grep browser_download_url | head -1 | cut -d \" -f 4 ) -O package.tar tar -xf package.tar -C /opt/ @@ -7279,7 +7259,7 @@ _EOF_ #Install if (( $? == 0 )); then - AGI python + APT_INSTALL python git clone --depth=1 "$INSTALL_URL_ADDRESS" @@ -7306,7 +7286,7 @@ _EOF_ #Install if (( $? == 0 )); then - AGI mono-devel + APT_INSTALL mono-devel wget $( curl -s "$INSTALL_URL_ADDRESS" | grep Jackett.Binaries.Mono.tar.gz | grep browser_download_url | head -1 | cut -d \" -f 4 ) -O package.tar tar -xvf package.tar @@ -7344,7 +7324,7 @@ _EOF_ apt-get update - AGI mediacenter22 + APT_INSTALL mediacenter22 else @@ -7395,7 +7375,7 @@ _EOF_ if (( $? == 0 )); then #Install Python and PIP - AGI python python-pip python-imaging python-dev + APT_INSTALL python python-pip python-imaging python-dev cd "$HOME" git clone --depth=1 "$INSTALL_URL_ADDRESS" @@ -7424,7 +7404,7 @@ _EOF_ if (( $? == 0 )); then - AGI python python-dev + APT_INSTALL python python-dev git clone "$INSTALL_URL_ADDRESS" mv OctoPrint* "$FP_DIETPI_USERDATA"/octoprint @@ -7452,7 +7432,7 @@ _EOF_ if (( $? == 0 )); then - AGI libav-tools cifs-utils + APT_INSTALL libav-tools cifs-utils wget "$INSTALL_URL_ADDRESS" -O package.tar tar xvf package.tar @@ -7476,7 +7456,7 @@ _EOF_ debconf-set-selections <<< "steam steam/question select I AGREE" - AGI steam + APT_INSTALL steam fi @@ -7712,7 +7692,7 @@ _EOF_ /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - AGI libupnp6 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-alsa + APT_INSTALL 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 @@ -7750,7 +7730,7 @@ _EOF_ echo -e "deb https://dtcooper.github.io/raspotify jessie main" > /etc/apt/sources.list.d/raspotify.list apt-get update - AGI raspotify + APT_INSTALL raspotify else @@ -7776,23 +7756,23 @@ _EOF_ #Pre-Reqs ----------------------------------------------------------------------- # Core packages - AGI rpi-update mpc memcached $PHP_APT_PACKAGE_NAME-memcache \ + APT_INSTALL 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 + APT_INSTALL dnsmasq hostapd # BT - AGI bluez bluez-firmware \ + APT_INSTALL 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 + APT_INSTALL pi-bluetooth fi @@ -7906,7 +7886,7 @@ libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc Banner_Installing - AGI alsa-utils + APT_INSTALL alsa-utils #Apply soundcard local soundcard=$(cat /DietPi/dietpi.txt | grep -m1 'soundcard=' | sed 's/.*=//') @@ -7937,7 +7917,7 @@ libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc Banner_Installing #Xserver Prereqs (ALL) - AGI xcompmgr xterm xinit xauth xserver-xorg dbus-x11 xfonts-base x11-xserver-utils x11-common x11-utils --no-install-recommends + APT_INSTALL xcompmgr xterm xinit xauth xserver-xorg dbus-x11 xfonts-base x11-xserver-utils x11-common x11-utils --no-install-recommends #Improve performance on all desktops and devices (eg: removes window lag in desktops) by limiting compositions mkdir -p /etc/xdg/autostart @@ -7957,11 +7937,11 @@ _EOF_ #Odroid C2 elif (( $HW_MODEL == 12 )); then - AGI aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump-odroid --no-install-recommends + APT_INSTALL aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump-odroid --no-install-recommends #cp /DietPi/dietpi/conf/xorg_c2.conf /etc/X11/xorg.conf # FBTURBO C2, provides much better desktop performance over Mali DDX: http://forum.odroid.com/viewtopic.php?f=138&t=19948&p=169808#p169808 - AGI xf86-video-fbturbo-odroid + APT_INSTALL xf86-video-fbturbo-odroid cat << _EOF_ > /etc/X11/xorg.conf Section "Device" Identifier "FBTurbo" @@ -7975,14 +7955,14 @@ _EOF_ #Odroid XU4 elif (( $HW_MODEL == 11 )); then - AGI firmware-samsung xf86-video-armsoc-odroid malit628-odroid --no-install-recommends + APT_INSTALL firmware-samsung xf86-video-armsoc-odroid malit628-odroid --no-install-recommends cp /DietPi/dietpi/conf/xorg_xu4.conf /etc/X11/xorg.conf #Odroid C1 elif (( $HW_MODEL == 10 )); then - AGI aml-libs-odroid xf86-video-mali-odroid libump-odroid mali450-odroid --no-install-recommends + APT_INSTALL aml-libs-odroid xf86-video-mali-odroid libump-odroid mali450-odroid --no-install-recommends cp /DietPi/dietpi/conf/xorg_c1.conf /etc/X11/xorg.conf @@ -8041,10 +8021,10 @@ _EOF_ Banner_Installing #Install - AGI nvidia-driver nvidia-xconfig + APT_INSTALL nvidia-driver nvidia-xconfig # + i386 OpenGL - AGI libgl1-nvidia-glx:i386 + APT_INSTALL libgl1-nvidia-glx:i386 fi @@ -8054,7 +8034,7 @@ _EOF_ Banner_Installing - AGI avahi-daemon + APT_INSTALL avahi-daemon fi @@ -8062,7 +8042,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI build-essential make autoconf automake --no-install-recommends + APT_INSTALL build-essential make autoconf automake --no-install-recommends fi @@ -8070,7 +8050,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI ntp + APT_INSTALL ntp # Remove service, as DietPi ntpd-mode launches the binary with custom commands systemctl stop ntp @@ -8084,7 +8064,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI git --no-install-recommends + APT_INSTALL git --no-install-recommends fi @@ -8092,7 +8072,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI vifm + APT_INSTALL vifm fi @@ -8100,7 +8080,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI vim + APT_INSTALL vim fi @@ -8108,7 +8088,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI vim-tiny + APT_INSTALL vim-tiny fi @@ -8116,7 +8096,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI neovim + APT_INSTALL neovim fi @@ -8124,7 +8104,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI emacs + APT_INSTALL emacs fi @@ -8132,7 +8112,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI iperf + APT_INSTALL iperf fi @@ -8140,7 +8120,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI mc + APT_INSTALL mc fi @@ -8148,7 +8128,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI jed + APT_INSTALL jed fi @@ -8156,7 +8136,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI iftop + APT_INSTALL iftop fi @@ -8164,7 +8144,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI iptraf + APT_INSTALL iptraf fi @@ -8172,7 +8152,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI mtr-tiny + APT_INSTALL mtr-tiny fi @@ -8180,7 +8160,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI nload + APT_INSTALL nload fi @@ -8188,7 +8168,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI tcpdump + APT_INSTALL tcpdump fi @@ -8196,7 +8176,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI openssh-client + APT_INSTALL openssh-client fi @@ -8208,7 +8188,7 @@ _EOF_ #Remove Information file rm /mnt/samba/readme.txt &> /dev/null - AGI smbclient cifs-utils --no-install-recommends + APT_INSTALL smbclient cifs-utils --no-install-recommends fi @@ -8220,7 +8200,7 @@ _EOF_ #Remove information file rm /mnt/ftp_client/readme.txt &> /dev/null - AGI curlftpfs + APT_INSTALL curlftpfs fi @@ -8232,7 +8212,7 @@ _EOF_ #Remove information file rm /mnt/nfs_client/readme.txt &> /dev/null - AGI nfs-common + APT_INSTALL nfs-common fi @@ -8240,7 +8220,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI dropbear + APT_INSTALL dropbear #set to start on next boot sed -i '/NO_START=1/c\NO_START=0' /etc/default/dropbear @@ -8251,7 +8231,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI openssh-server --no-install-recommends + APT_INSTALL openssh-server --no-install-recommends # - Remove all references before adding the entry: https://github.com/Fourdee/DietPi/issues/604 @@ -8294,7 +8274,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI logrotate --no-install-recommends + APT_INSTALL logrotate --no-install-recommends fi @@ -8302,7 +8282,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI rsyslog --no-install-recommends + APT_INSTALL rsyslog --no-install-recommends fi @@ -8334,7 +8314,7 @@ _EOF_ #Everything else else - AGI ffmpeg + APT_INSTALL ffmpeg fi @@ -8348,7 +8328,7 @@ _EOF_ # - Raspbian if (( $HW_MODEL < 10 )); then - AGI oracle-java8-jdk + APT_INSTALL oracle-java8-jdk # - Debian. Add repo else @@ -8364,7 +8344,7 @@ _EOF_ # - Accept the license: https://github.com/Fourdee/DietPi/issues/298 debconf-set-selections <<< "oracle-java8-installer shared/accepted-oracle-license-v1-1 boolean true" - AGI oracle-java8-installer + APT_INSTALL oracle-java8-installer fi @@ -8409,13 +8389,13 @@ _EOF_ if (( $? == 0 )); then # - Preqs - AGI python python-dev + APT_INSTALL python python-dev wget "$INSTALL_URL_ADDRESS" -O install.py python ./install.py rm install.py - AGI python-pip python3-pip + APT_INSTALL python-pip python3-pip else @@ -8436,7 +8416,7 @@ _EOF_ if (( $? == 0 )); then - #AGI libxss1 #if using SDL2+rpi5 + #APT_INSTALL libxss1 #if using SDL2+rpi5 wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z -osdl2_rpi @@ -8474,7 +8454,7 @@ _EOF_ apt-get update - AGI mono-runtime + APT_INSTALL mono-runtime fi @@ -8497,15 +8477,15 @@ _EOF_ /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 + APT_INSTALL 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 + APT_INSTALL libmysqlclient-dev fi if (( $DISTRO >= 4 )); then - AGI libmariadbclient-dev + APT_INSTALL libmariadbclient-dev fi @@ -11685,7 +11665,7 @@ _EOF_ a2enmod rewrite #install scgi module - AGI libapache2-mod-scgi + APT_INSTALL libapache2-mod-scgi htpasswd -cb /etc/.rutorrent-htaccess root "$GLOBAL_PW" cat << _EOF_ > /var/www/rutorrent/.htaccess @@ -13297,55 +13277,55 @@ _EOF_ elif (( $1 == 23 )); then - AGP lxde lxde-* upower policykit-1 iceweasel p7zip-full + APT_PURGE lxde lxde-* upower policykit-1 iceweasel p7zip-full elif (( $1 == 24 )); then - AGP mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full + APT_PURGE mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full elif (( $1 == 26 )); then - AGP x-window-system-core wmaker gnustep gnustep-devel gnustep-games upower policykit-1 iceweasel p7zip-full + APT_PURGE x-window-system-core wmaker gnustep gnustep-devel gnustep-games upower policykit-1 iceweasel p7zip-full elif (( $1 == 25 )); then - AGP xfce4 gnome-icon-theme tango-icon-theme iceweasel p7zip-full + APT_PURGE xfce4 gnome-icon-theme tango-icon-theme iceweasel p7zip-full elif (( $1 == 22 )); then - AGP quiterss + APT_PURGE quiterss elif (( $1 == 30 )); then - AGP nomachine + APT_PURGE nomachine elif (( $1 == 29 )); then - AGP xrdp + APT_PURGE xrdp elif (( $1 == 44 )); then - AGP transmission-daemon + APT_PURGE transmission-daemon rm /etc/init.d/transmission-daemon &> /dev/null rm /etc/systemd/system/transmission-daemon.service &> /dev/null elif (( $1 == 83 )); then - AGP apache2 + APT_PURGE apache2 elif (( $1 == 85 )); then - AGP nginx + APT_PURGE nginx elif (( $1 == 84 )); then - AGP lighttpd + APT_PURGE lighttpd elif (( $1 == 86 || $1 == 88 )); then - AGP mysql-server mysql-client + APT_PURGE mysql-server mysql-client - AGP mariadb-server mariadb-client + APT_PURGE mariadb-server mariadb-client # - custom confs rm /etc/mysql/conf.d/reduce_resources.cnf @@ -13359,17 +13339,17 @@ _EOF_ elif (( $1 == 87 )); then - AGP sqlite3 + APT_PURGE sqlite3 elif (( $1 == 91 )); then - AGP "$PHP_APT_PACKAGE_NAME"-redis redis-server redis-tools + APT_PURGE "$PHP_APT_PACKAGE_NAME"-redis redis-server redis-tools elif (( $1 == 89 )); then rm "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf rm "$FP_PHP_BASE_DIR"/mods-available/dietpi.ini 2> /dev/null - AGP "$PHP_APT_PACKAGE_NAME"-* libapache2-mod-"$PHP_APT_PACKAGE_NAME" + APT_PURGE "$PHP_APT_PACKAGE_NAME"-* libapache2-mod-"$PHP_APT_PACKAGE_NAME" rm /var/www/phpinfo.php rm /var/www/apc.php rm /var/www/opcache.php @@ -13378,7 +13358,7 @@ _EOF_ elif (( $1 == 90 )); then - AGP phpmyadmin + APT_PURGE phpmyadmin elif (( $1 == 54 )); then @@ -13403,7 +13383,7 @@ _EOF_ mysqldump --lock-tables -uroot -p"$GLOBAL_PW" owncloud > "$FP_DIETPI_USERDATA"/owncloud_data/mysql_backup.sql mysqladmin -u root -p"$GLOBAL_PW" drop owncloud -f # Purge APT package - AGP owncloud-files owncloud owncloud-deps + APT_PURGE owncloud-files owncloud owncloud-deps # Remove ownCloud installation folder rm -R /var/www/owncloud # Remove ownCloud repo @@ -13430,7 +13410,7 @@ _EOF_ elif (( $1 == 115 )); then - AGP webmin + APT_PURGE webmin elif (( $1 == 32 )); then @@ -13439,7 +13419,7 @@ _EOF_ elif (( $1 == 128 )); then - AGP mpd libmpdclient2 + APT_PURGE mpd libmpdclient2 userdel -f mpd &> /dev/null rm /lib/systemd/system/mpd.service rm -R "$FP_DIETPI_USERDATA"/.mpd_cache @@ -13457,20 +13437,20 @@ _EOF_ elif (( $1 == 123 )); then - AGP mosquitto + APT_PURGE mosquitto rm /etc/apt/sources.list.d/mosquitto-*.list elif (( $1 == 124 )); then - AGP networkaudiod + APT_PURGE networkaudiod elif (( $1 == 125 )); then - AGP tomcat8 + APT_PURGE tomcat8 elif (( $1 == 126 )); then - AGP openmediavault + APT_PURGE openmediavault rm /etc/apt/sources.list.d/openmediavault.list elif (( $1 == 129 )); then @@ -13481,7 +13461,7 @@ _EOF_ elif (( $1 == 130 )); then - AGP python-pip python3-pip + APT_PURGE python-pip python3-pip elif (( $1 == 131 )); then @@ -13495,7 +13475,7 @@ _EOF_ rm /usr/local/bin/aria2c rm -R /var/www/aria2 - AGP aria2 + APT_PURGE aria2 elif (( $1 == 133 )); then @@ -13516,13 +13496,13 @@ _EOF_ elif (( $1 == 135 )); then - AGP darkice icecast2 + APT_PURGE darkice icecast2 rm /etc/systemd/system/darkice.service elif (( $1 == 136 )); then - AGP motion + APT_PURGE motion rm -R /etc/motioneye @@ -13532,7 +13512,7 @@ _EOF_ elif (( $1 == 137 )); then - AGP cloudprint-service + APT_PURGE cloudprint-service if (( $DISTRO == 3 )); then rm /etc/apt/sources.list.d/cloudprint.list @@ -13554,7 +13534,7 @@ _EOF_ elif (( $1 == 140 )); then - AGP libsdl2 libsdl2-image libsdl2-mixer libsdl2-net libsdl2-ttf libsmpeg2 + APT_PURGE libsdl2 libsdl2-image libsdl2-mixer libsdl2-net libsdl2-ttf libsmpeg2 elif (( $1 == 141 )); then @@ -13580,7 +13560,7 @@ _EOF_ elif (( $1 == 144 )); then - AGP nzbdrone + APT_PURGE nzbdrone rm /etc/systemd/system/sonarr.service rm /etc/apt/sources.list.d/sonarr.list apt-get update @@ -13603,7 +13583,7 @@ _EOF_ elif (( $1 == 148 )); then - AGP mediacenter22 + APT_PURGE mediacenter22 elif (( $1 == 149 )); then @@ -13617,18 +13597,18 @@ _EOF_ elif (( $1 == 150 )); then - #AGP mono-runtime #shared lib + #APT_PURGE mono-runtime #shared lib rm /etc/apt/sources.list.d/mono-xamarin.list apt-get update elif (( $1 == 151 )); then - AGP nvidia-driver nvidia-xconfig libgl1-nvidia-glx:i386 + APT_PURGE nvidia-driver nvidia-xconfig libgl1-nvidia-glx:i386 elif (( $1 == 152 )); then - AGP avahi-daemon + APT_PURGE avahi-daemon elif (( $1 == 153 )); then @@ -13644,45 +13624,45 @@ _EOF_ elif (( $1 == 156 )); then - AGP steam + APT_PURGE steam rm -R "$HOME"/.steam rm -R "$FP_DIETPI_USERDATA"/steam elif (( $1 == 119 )); then - AGP cava + APT_PURGE cava rm "$HOME/.config/cava/config" rm "$HOME/cava.psf" elif (( $1 == 118 )); then - AGP mopidy + APT_PURGE mopidy rm /etc/apt/sources.list.d/mopidy.list pip uninstall -y Mopidy-MusicBox-Webclient Mopidy-Local-Images elif (( $1 == 31 )); then - AGP kodi + APT_PURGE kodi #+Odroids - AGP kodi-odroid + APT_PURGE kodi-odroid rm /usr/share/applications/kodi.desktop rm ~/Desktop/kodi.desktop elif (( $1 == 39 )); then - AGP minidlna + APT_PURGE minidlna elif (( $1 == 51 )); then - AGP ibsdl1.2debian libsdl-net1.2 + APT_PURGE ibsdl1.2debian libsdl-net1.2 rm -R /usr/local/games/opentyrian rm /usr/share/applications/opentyrian.desktop rm ~/Desktop/opentyrian.desktop elif (( $1 == 59 )); then - AGP gpac + APT_PURGE gpac rm -R /var/www/dietpicam rm /opt/vc/bin/raspimjpeg rm /usr/bin/raspimjpeg @@ -13691,25 +13671,25 @@ _EOF_ elif (( $1 == 45 )); then - AGP deluged deluge-web deluge-webui deluge-console + APT_PURGE deluged deluge-web deluge-webui deluge-console rm /etc/dietpi/dietpi-software/services/deluge.service rm -R ~/.config/deluge elif (( $1 == 94 )); then - AGP proftpd-basic + APT_PURGE proftpd-basic elif (( $1 == 96 )); then - AGP samba samba-common-bin + APT_PURGE samba samba-common-bin elif (( $1 == 95 )); then - AGP vsftpd + APT_PURGE vsftpd elif (( $1 == 109 )); then - AGP nfs-kernel-server + APT_PURGE nfs-kernel-server elif (( $1 == 67 )); then @@ -13727,7 +13707,7 @@ _EOF_ elif (( $1 == 93 )); then - AGP dnsmasq + APT_PURGE dnsmasq pihole uninstall #https://github.com/Fourdee/DietPi/issues/753 @@ -13743,7 +13723,7 @@ _EOF_ elif (( $1 == 33 || $1 == 34 )); then - AGP subsonic + APT_PURGE subsonic rm -R /var/subsonic elif (( $1 == 71 )); then @@ -13762,7 +13742,7 @@ _EOF_ rm "$HOME"/weaved_setup.bin # Remot3.it - AGP weavedconnectd + APT_PURGE weavedconnectd elif (( $1 == 62 )); then @@ -13787,11 +13767,11 @@ _EOF_ rm -r /etc/haproxy #Shared dev libraries. Leave these installed - #AGP libpcre3-dev libssl-dev + #APT_PURGE libpcre3-dev libssl-dev elif (( $1 == 35 )); then - AGP logitechmediaserver + APT_PURGE logitechmediaserver rm /etc/dietpi/dietpi-software/services/squeezeboxserver.service rm -R /var/lib/squeezeboxserver rm -R /usr/share/squeezeboxserver @@ -13802,11 +13782,11 @@ _EOF_ elif (( $1 == 27 || $1 == 28 || $1 == 120 )); then - AGP tightvncserver - AGP vnc4server - AGP x11vnc - AGP realvnc-vnc-server - AGP tigervnc-* + APT_PURGE tightvncserver + APT_PURGE vnc4server + APT_PURGE x11vnc + APT_PURGE realvnc-vnc-server + APT_PURGE tigervnc-* rm /etc/systemd/system/vncserver.service rm /etc/init.d/vncserver @@ -13821,7 +13801,7 @@ _EOF_ elif (( $1 == 73 )); then - AGP fail2ban + APT_PURGE fail2ban elif (( $1 == 64 )); then @@ -13848,14 +13828,14 @@ _EOF_ elif (( $1 == 97 )); then - AGP openvpn + APT_PURGE openvpn rm -R /etc/openvpn &> /dev/null elif (( $1 == 92 )); then if (( $DISTRO >= 4 )); then - AGP python-certbot-apache python-certbot-nginx certbot + APT_PURGE python-certbot-apache python-certbot-nginx certbot fi @@ -13864,11 +13844,11 @@ _EOF_ elif (( $1 == 69 )); then - AGP python-rpi.gpio python3-rpi.gpio + APT_PURGE python-rpi.gpio python3-rpi.gpio elif (( $1 == 72 )); then - AGP i2c-tools + APT_PURGE i2c-tools #Disable /DietPi/dietpi/func/dietpi-set_hardware i2c disable @@ -13878,7 +13858,7 @@ _EOF_ elif (( $1 == 60 )); then - AGP hostapd isc-dhcp-server + APT_PURGE hostapd isc-dhcp-server rm /etc/dhcp/dhcpd.conf &> /dev/null rm /etc/hostapd/hostapd.conf &> /dev/null @@ -13916,19 +13896,19 @@ _EOF_ elif (( $1 == 61 )); then - AGP tor + APT_PURGE tor # - uninstall WIFIHOTSPOT ALSO. Due to IPtables needing reset. Uninstall_Software 60 elif (( $1 == 37 )); then - AGP shairport-sync* + APT_PURGE shairport-sync* userdel -f shairport-sync elif (( $1 == 38 )); then - AGP brutefir + APT_PURGE brutefir rm -R /etc/BruteFIR rm /etc/dietpi/dietpi-software/services/brutefir.service @@ -13947,7 +13927,7 @@ _EOF_ elif (( $1 == 36 )); then - AGP squeezelite + APT_PURGE squeezelite rm -R /usr/bin/squeezelite* rm /etc/systemd/system/squeezelite.service @@ -13960,7 +13940,7 @@ _EOF_ elif (( $1 == 66 )); then - AGP rpimonitor + APT_PURGE rpimonitor elif (( $1 == 57 )); then @@ -13979,7 +13959,7 @@ _EOF_ groupdel netdata #1.2.0+ - AGP netdata + APT_PURGE netdata #1.0.0 rm /usr/sbin/netdata @@ -13992,11 +13972,11 @@ _EOF_ elif (( $1 == 43 )); then - AGP mumble-server + APT_PURGE mumble-server elif (( $1 == 41 )); then - AGP emby-server + APT_PURGE emby-server rm /etc/apt/sources.list.d/emby-server.list apt-get update @@ -14008,7 +13988,7 @@ _EOF_ elif (( $1 == 42 )); then - AGP plexmediaserver + APT_PURGE plexmediaserver rm -R /var/lib/plexmediaserver @@ -14045,7 +14025,7 @@ _EOF_ elif (( $1 == 46 )); then - AGP qbittorrent-nox + APT_PURGE qbittorrent-nox rm /etc/systemd/system/qbittorrent.service rm -R "$HOME"/.config/qBittorrent @@ -14064,7 +14044,7 @@ _EOF_ elif (( $1 == 107 )); then - AGP rtorrent + APT_PURGE rtorrent rm -R /var/www/rutorrent rm "$HOME"/.rtorrent.rc rm /etc/systemd/system/rtorrent.service @@ -14111,7 +14091,7 @@ _EOF_ rm /etc/chromium.d/custom_flags rm "$HOME"/.chromium-browser.init - AGP chromium + APT_PURGE chromium elif (( $1 == 157)); then @@ -14146,7 +14126,7 @@ _EOF_ elif (( $1 == 167 )); then - AGP raspotify + APT_PURGE raspotify rm /etc/apt/sources.list.d/raspotify.list apt-get update @@ -14164,7 +14144,7 @@ _EOF_ elif (( $1 == 170 )); then Reset_NTPD - AGP ntp + APT_PURGE ntp elif (( $1 == 158 )); then @@ -14198,10 +14178,10 @@ _EOF_ if (( $HW_ARCH == 10 )); then # remove docker and all its unused dependencies - x86_64 package name is different - AGP docker-ce + APT_PURGE docker-ce else # remove docker and all its unused dependencies - ARM package name - AGP docker-engine + APT_PURGE docker-engine fi # delete data files - dietpi @@ -14219,7 +14199,7 @@ _EOF_ elif (( $1 == 163 )); then - AGP gmrender + APT_PURGE gmrender rm /etc/systemd/system/gmrender.service elif (( $1 == 159 || $1 == 160 )); then @@ -14235,57 +14215,57 @@ _EOF_ elif (( $1 == 15 )); then - AGP tcpdump + APT_PURGE tcpdump elif (( $1 == 14 )); then - AGP nload + APT_PURGE nload elif (( $1 == 13 )); then - AGP mtr-tiny + APT_PURGE mtr-tiny elif (( $1 == 11 )); then - AGP iptraf + APT_PURGE iptraf elif (( $1 == 10 )); then - AGP iftop + APT_PURGE iftop elif (( $1 == 19 )); then - AGP jed + APT_PURGE jed elif (( $1 == 3 )); then - AGP mc + APT_PURGE mc elif (( $1 == 18 )); then - AGP emacs + APT_PURGE emacs elif (( $1 == 20 || $i == 21 )); then - AGP vim vim-tiny + APT_PURGE vim vim-tiny elif (( $1 == 127 )); then - AGP neovim + APT_PURGE neovim elif (( $1 == 0 )); then #This also removes OpenSSH server. So lets check OpenSSH server isnt installed before hand. if (( $(dpkg -l | grep -ci -m1 'openssh-server') == 0 )); then - AGP openssh-client + APT_PURGE openssh-client fi elif (( $1 == 1 )); then umount -f /mnt/samba - AGP smbclient + APT_PURGE smbclient #Disable in fstab sed -i '/\/mnt\/samba/c\#\/mnt\/samba . Please use dietpi-config and the Networking Options: NAS menu to setup this mount' /etc/fstab #Add info file for installation method. @@ -14293,7 +14273,7 @@ _EOF_ elif (( $1 == 111 )); then - AGP urbackup-server + APT_PURGE urbackup-server #+sourcebuild rm /etc/systemd/system/urbackupsrv.service @@ -14311,7 +14291,7 @@ _EOF_ #nfs-kernel-server depends on nfs-common if (( ${aSOFTWARE_INSTALL_STATE[109]} == 0 )); then - AGP nfs-common + APT_PURGE nfs-common fi @@ -14323,28 +14303,28 @@ _EOF_ elif (( $1 == 16 )); then - AGP build-essential + APT_PURGE build-essential elif (( $1 == 17 )); then - AGP git + APT_PURGE git elif (( $1 == 5 )); then - AGP alsa-utils + APT_PURGE alsa-utils #DietPi-JustBoom, remove bash alias for config panel: sed -i '/dietpi-justboom/d' /etc/bash.bashrc &> /dev/null elif (( $1 == 6 )); then - AGP xcompmgr xinit xauth xserver-xorg xfonts-base x11-xserver-utils x11-common x11-utils + APT_PURGE xcompmgr xinit xauth xserver-xorg xfonts-base x11-xserver-utils x11-common x11-utils rm /etc/xdg/autostart/xcompmgr.desktop elif (( $1 == 2 )); then umount -f /mnt/ftp_client - AGP curlftpfs + APT_PURGE curlftpfs #Disable in fstab sed -i '/\/mnt\/ftp_client/c\#\/mnt\/ftp_client . Please use dietpi-config and the Networking Options: NAS menu to setup this mount' /etc/fstab @@ -14354,23 +14334,23 @@ _EOF_ elif (( $1 == 7 )); then - AGP ffmpeg + APT_PURGE ffmpeg # + RPi - AGP libx264 libmp3lame libfdk-aac + APT_PURGE libx264 libmp3lame libfdk-aac elif (( $1 == 8 )); then - AGP oracle-java8-* + APT_PURGE oracle-java8-* rm /etc/apt/sources.list.d/webupd8team-java.list apt-get update elif (( $1 == 104 )); then - AGP dropbear* #stretch | dropbear-initramfs dropbear-run + APT_PURGE dropbear* #stretch | dropbear-initramfs dropbear-run elif (( $1 == 105 )); then - AGP openssh-* + APT_PURGE openssh-* # This also clears Openssh-client aSOFTWARE_INSTALL_STATE[0]=0 @@ -14381,15 +14361,15 @@ _EOF_ elif (( $1 == 101 )); then - AGP logrotate + APT_PURGE logrotate elif (( $1 == 102 )); then - AGP rsyslog + APT_PURGE rsyslog elif (( $1 == 9 )); then - AGP nodejs + APT_PURGE nodejs # - old install via repo if [ -f /etc/apt/sources.list.d/nodesource_nodejs.list ]; then @@ -14403,7 +14383,7 @@ _EOF_ elif (( $1 == 4 )); then - AGP vifm + APT_PURGE vifm else From 001aaf2c37b6c0e885288d67b34b3505206e6010 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 17 Dec 2017 10:37:56 +0000 Subject: [PATCH 063/390] v160 + Minor, revised function names to match those of Global: https://github.com/Fourdee/DietPi/issues/1311 --- dietpi/dietpi-software | 598 ++++++++++++++++++------------------- dietpi/func/dietpi-globals | 8 + 2 files changed, 303 insertions(+), 303 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index ba48071f1f..9e52384483 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -202,14 +202,6 @@ _EOF_ #Reboot after installation has finished. DISABLE_REBOOT=0 - #Support for apt-fast: https://github.com/Fourdee/DietPi/issues/698 - APT_BINARY='apt-get' - if [ -f /usr/bin/apt-fast ]; then - - APT_BINARY='apt-fast' - - fi - #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 @@ -3356,7 +3348,7 @@ _EOF_ } #apt-get install - APT_INSTALL(){ + AGI_ERROR_CHECKED(){ local string="$@" @@ -3370,7 +3362,7 @@ _EOF_ } #apt-get purge - APT_PURGE(){ + AGP_ERROR_CHECKED(){ local string="$@" AGP $string @@ -3378,7 +3370,7 @@ _EOF_ } #apt-get install -f - APT_FIX(){ + AGF_ERROR_CHECKED(){ AGF if (( $EXITCODE_APT != 0 )); then @@ -3510,7 +3502,7 @@ _EOF_ # if (( $? == 0 )); then # # #Install Python and PIP - # APT_INSTALL python python-pip python-imaging + # AGI_ERROR_CHECKED python python-pip python-imaging # # cd "$HOME" # git clone --depth=1 "$INSTALL_URL_ADDRESS" @@ -3544,7 +3536,7 @@ _EOF_ if (( $? == 0 )); then - APT_INSTALL lxde upower policykit-1 iceweasel p7zip-full --no-install-recommends + AGI_ERROR_CHECKED lxde upower policykit-1 iceweasel p7zip-full --no-install-recommends #upower policykit-1. Needed for LXDE logout menu item to show shutdown/restart ...... else @@ -3568,7 +3560,7 @@ _EOF_ if (( $? == 0 )); then - APT_INSTALL mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full --no-install-recommends + AGI_ERROR_CHECKED mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full --no-install-recommends else @@ -3591,7 +3583,7 @@ _EOF_ if (( $? == 0 )); then - APT_INSTALL x-window-system-core wmaker gnustep gnustep-devel gnustep-games libc-dbg upower policykit-1 iceweasel p7zip-full --no-install-recommends + AGI_ERROR_CHECKED x-window-system-core wmaker gnustep gnustep-devel gnustep-games libc-dbg upower policykit-1 iceweasel p7zip-full --no-install-recommends else @@ -3614,7 +3606,7 @@ _EOF_ if (( $? == 0 )); then - APT_INSTALL xfce4 xfce4-terminal gnome-icon-theme tango-icon-theme iceweasel p7zip-full --no-install-recommends + AGI_ERROR_CHECKED xfce4 xfce4-terminal gnome-icon-theme tango-icon-theme iceweasel p7zip-full --no-install-recommends else @@ -3630,7 +3622,7 @@ _EOF_ Banner_Installing - APT_INSTALL xrdp + AGI_ERROR_CHECKED xrdp fi @@ -3680,7 +3672,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL transmission-daemon + AGI_ERROR_CHECKED transmission-daemon fi @@ -3691,7 +3683,7 @@ _EOF_ Banner_Installing echo -e "proftpd-basic shared/proftpd/inetd_or_standalone select standalone" | debconf-set-selections - APT_INSTALL proftpd-basic + AGI_ERROR_CHECKED proftpd-basic fi @@ -3700,7 +3692,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL samba samba-common-bin --no-install-recommends + AGI_ERROR_CHECKED samba samba-common-bin --no-install-recommends fi @@ -3710,7 +3702,7 @@ _EOF_ Banner_Installing - APT_INSTALL vsftpd --no-install-recommends + AGI_ERROR_CHECKED vsftpd --no-install-recommends fi @@ -3720,7 +3712,7 @@ _EOF_ Banner_Installing - APT_INSTALL nfs-kernel-server nfs-common ucf rpcbind + AGI_ERROR_CHECKED nfs-kernel-server nfs-common ucf rpcbind fi @@ -3729,7 +3721,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL apache2 + AGI_ERROR_CHECKED apache2 fi @@ -3738,7 +3730,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL nginx xml-core --no-install-recommends + AGI_ERROR_CHECKED nginx xml-core --no-install-recommends fi @@ -3747,7 +3739,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL lighttpd + AGI_ERROR_CHECKED lighttpd fi @@ -3760,7 +3752,7 @@ _EOF_ debconf-set-selections <<< "mysql-server mysql-server/root_password password $GLOBAL_PW" debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $GLOBAL_PW" - APT_INSTALL mysql-server + AGI_ERROR_CHECKED mysql-server # Fix depricated key_buffer -> key_buffer_size per MySQL 5.x notification sed -i 's/^key_buffer[[:space:]]/key_buffer_size /g' /etc/mysql/my.cnf @@ -3776,7 +3768,7 @@ _EOF_ Banner_Installing - APT_INSTALL mariadb-server + AGI_ERROR_CHECKED mariadb-server fi @@ -3785,7 +3777,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL sqlite3 + AGI_ERROR_CHECKED sqlite3 fi @@ -3794,11 +3786,11 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL redis-server + AGI_ERROR_CHECKED redis-server #Redis php module | == 2 to check for existing installs, if == 1, then module will be installed together with PHP, to prevent dependency installations if (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )); then - APT_INSTALL "$PHP_APT_PACKAGE_NAME"-redis + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-redis fi @@ -3813,28 +3805,28 @@ _EOF_ #Install base PHP packages/modules. if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then - APT_INSTALL "$PHP_APT_PACKAGE_NAME" libapache2-mod-"$PHP_APT_PACKAGE_NAME" + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME" libapache2-mod-"$PHP_APT_PACKAGE_NAME" else - APT_INSTALL "$PHP_APT_PACKAGE_NAME"-fpm "$PHP_APT_PACKAGE_NAME"-cgi "$PHP_APT_PACKAGE_NAME"-xsl + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-fpm "$PHP_APT_PACKAGE_NAME"-cgi "$PHP_APT_PACKAGE_NAME"-xsl fi #php-common modules, used by most web software - APT_INSTALL "$PHP_APT_PACKAGE_NAME"-curl "$PHP_APT_PACKAGE_NAME"-gd "$PHP_APT_PACKAGE_NAME"-apcu "$PHP_APT_PACKAGE_NAME"-mcrypt + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-curl "$PHP_APT_PACKAGE_NAME"-gd "$PHP_APT_PACKAGE_NAME"-apcu "$PHP_APT_PACKAGE_NAME"-mcrypt # + stretch extras if (( $DISTRO >= 4 )); then - APT_INSTALL "$PHP_APT_PACKAGE_NAME"-mbstring "$PHP_APT_PACKAGE_NAME"-zip "$PHP_APT_PACKAGE_NAME"-xml + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mbstring "$PHP_APT_PACKAGE_NAME"-zip "$PHP_APT_PACKAGE_NAME"-xml fi #php-SQL modules if (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 )); then - APT_INSTALL "$PHP_APT_PACKAGE_NAME"-mysql + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mysql fi @@ -3842,11 +3834,11 @@ _EOF_ if (( $DISTRO < 4 )); then #For <= Jessie, php5-mysqlnd provides the newer mysql client libraries compared to php5-mysql. - APT_INSTALL "$PHP_APT_PACKAGE_NAME"-mysqlnd + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mysqlnd else #For >= Stretch, php(7.X)-mysqlnd does not exist, thus php-mysql need to be installed: https://packages.debian.org/de/stretch/php-mysql - APT_INSTALL "$PHP_APT_PACKAGE_NAME"-mysql + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mysql fi @@ -3854,14 +3846,14 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[87]} >= 1 )); then - APT_INSTALL "$PHP_APT_PACKAGE_NAME"-sqlite* #wildcard for version (eg:3) + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-sqlite* #wildcard for version (eg:3) fi #Redis php module | >= 1 to check for existing installs (2) if (( ${aSOFTWARE_INSTALL_STATE[91]} >= 1 )); then - APT_INSTALL "$PHP_APT_PACKAGE_NAME"-redis + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-redis fi @@ -3896,7 +3888,7 @@ _EOF_ fi - APT_INSTALL phpmyadmin + AGI_ERROR_CHECKED phpmyadmin fi @@ -3917,8 +3909,8 @@ _EOF_ if (( $? == 0 )); then #libupnp6 for net discov with upnp/avahi - APT_INSTALL libupnp6 - APT_INSTALL libmpdclient2 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file --no-install-recommends + AGI_ERROR_CHECKED libupnp6 + AGI_ERROR_CHECKED libmpdclient2 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file --no-install-recommends wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb @@ -3932,7 +3924,7 @@ _EOF_ else - APT_INSTALL mpd + AGI_ERROR_CHECKED mpd fi @@ -3969,7 +3961,7 @@ _EOF_ if (( $? == 0 )); then #Prereqs - APT_INSTALL libmpdclient2 libflac8 libyajl2 libavahi-client3 libvorbisfile3 libwavpack1 libmad0 libmpg123-0 libopus0 libavformat57 libfaad2 libcdio-paranoia1 libiso9660-8 libshout3 libid3tag0 + AGI_ERROR_CHECKED libmpdclient2 libflac8 libyajl2 libavahi-client3 libvorbisfile3 libwavpack1 libmad0 libmpg123-0 libopus0 libavformat57 libfaad2 libcdio-paranoia1 libiso9660-8 libshout3 libid3tag0 apt-mark unhold mpd &> /dev/null #??? Not required for dpkg -i installs @@ -4025,10 +4017,10 @@ _EOF_ if (( $? == 0 )); then - APT_INSTALL libsodium-dev automake autoconf pkg-config libtool libssl-dev libffi-dev python-dev openssl libzmq3-dev + AGI_ERROR_CHECKED libsodium-dev automake autoconf pkg-config libtool libssl-dev libffi-dev python-dev openssl libzmq3-dev #Not required. - #APT_INSTALL software-properties-common + #AGI_ERROR_CHECKED software-properties-common #add-apt-repository -y ppa:chris-lea/libsodium #apt-get update @@ -4120,7 +4112,7 @@ _EOF_ if (( $? == 0 )); then # Install necessary PHP modules: https://doc.owncloud.org/server/latest/admin_manual/installation/source_installation.html#php-extensions - APT_INSTALL "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis if [ ! -f /etc/apt/sources.list.d/owncloud.list ] && [ ! -d /var/www/owncloud ]; then @@ -4144,7 +4136,7 @@ _EOF_ # Install APT package just, if we have ownCloud's own up to date repository. if [ -f /etc/apt/sources.list.d/owncloud.list ]; then - apt-get update && APT_INSTALL owncloud-files + apt-get update && AGI_ERROR_CHECKED owncloud-files fi @@ -4169,7 +4161,7 @@ _EOF_ if (( $? == 0 )); then # Install necessary PHP modules: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - APT_INSTALL "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis if [ ! -d /var/www/nextcloud ]; then @@ -4316,7 +4308,7 @@ _EOF_ if (( $? == 0 )); then - APT_INSTALL libpulse0 libfftw3-3 + AGI_ERROR_CHECKED libpulse0 libfftw3-3 wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb @@ -4349,14 +4341,14 @@ _EOF_ wget https://apt.mopidy.com/jessie.list -O /etc/apt/sources.list.d/mopidy.list apt-get update - APT_INSTALL mopidy + AGI_ERROR_CHECKED mopidy #ARMv8 #NB: No ARM64 packages currently exist in mopidy repo. So it will throw a minor error when updating apt. #Mopidy web client extensions not loading in webpage... # if (( $HW_ARCH == 3 )); then - # APT_INSTALL build-essential python-dev + # AGI_ERROR_CHECKED build-essential python-dev # pip install mopidy #no effect, claims already upto date. # fi @@ -4380,29 +4372,29 @@ _EOF_ #Odroids if (( $HW_MODEL >= 10 )) && (( $HW_MODEL < 20 )); then - APT_INSTALL kodi-odroid + AGI_ERROR_CHECKED kodi-odroid #XU4 - requires pulse audio (fixes corrupt sound) if (( $HW_MODEL == 11 )); then - APT_INSTALL pulseaudio --no-install-recommends + AGI_ERROR_CHECKED pulseaudio --no-install-recommends fi #Everything else else - APT_INSTALL kodi + AGI_ERROR_CHECKED kodi fi # - libcurl3-gnutls required for C2. But lets apply to all: https://github.com/Fourdee/DietPi/issues/446 - APT_INSTALL libcurl3-gnutls + AGI_ERROR_CHECKED libcurl3-gnutls # - Add NFS support for kodi if (( $DISTRO == 3 )); then - APT_INSTALL libnfs4 + AGI_ERROR_CHECKED libnfs4 fi @@ -4428,7 +4420,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL minidlna + AGI_ERROR_CHECKED minidlna fi @@ -4486,12 +4478,12 @@ _EOF_ #Install if (( $? == 0 )); then - APT_INSTALL alsa-oss joystick libsdl-image1.2 libsdl-ttf2.0-0 libsdl-gfx1.2-5 libguichan-0.8.1-1* libguichan-allegro-0.8.1-1* libguichan-sdl-0.8.1-1* libguichan-opengl-0.8.1-1* libjpgalleg4.4 libxml2 libmpg123-0 + AGI_ERROR_CHECKED alsa-oss joystick libsdl-image1.2 libsdl-ttf2.0-0 libsdl-gfx1.2-5 libguichan-0.8.1-1* libguichan-allegro-0.8.1-1* libguichan-sdl-0.8.1-1* libguichan-opengl-0.8.1-1* libjpgalleg4.4 libxml2 libmpg123-0 #libmpeg2-4 # Required for dev branch # + SDL2 - APT_INSTALL libpng12-0 libflac8 libmpg123-0 libgoogle-perftools4 libfreetype6 libxxf86vm1 + AGI_ERROR_CHECKED libpng12-0 libflac8 libmpg123-0 libgoogle-perftools4 libfreetype6 libxxf86vm1 #Download binaries # - Backup existing autostart.uae for user @@ -4521,7 +4513,7 @@ _EOF_ #Install if (( $? == 0 )); then - APT_INSTALL libsdl-mixer1.2 libsdl1.2debian libphysfs1 + AGI_ERROR_CHECKED libsdl-mixer1.2 libsdl1.2debian libphysfs1 wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z -o"$FP_DIETPI_USERDATA" @@ -4565,7 +4557,7 @@ _EOF_ #ARMv8 source build if (( $HW_ARCH == 3 )); then - APT_INSTALL build-essential zlib1g-dev libcurl4-openssl-dev libcrypto++-dev sqlite3 + AGI_ERROR_CHECKED build-essential zlib1g-dev libcurl4-openssl-dev libcrypto++-dev sqlite3 wget "$INSTALL_URL_ADDRESS" -O package.tar tar xzvf package.tar @@ -4620,7 +4612,7 @@ _EOF_ #Install if (( $? == 0 )); then - APT_INSTALL ibsdl1.2debian libsdl-net1.2 --no-install-recommends + AGI_ERROR_CHECKED ibsdl1.2debian libsdl-net1.2 --no-install-recommends #Download binaries wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -4649,7 +4641,7 @@ _EOF_ if (( $? == 0 )); then #Install pre-reqs - APT_INSTALL gpac motion + AGI_ERROR_CHECKED gpac motion #Get source/binaries and extract wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -4698,7 +4690,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL deluged deluge-web deluge-webui deluge-console + AGI_ERROR_CHECKED deluged deluge-web deluge-webui deluge-console fi @@ -4708,7 +4700,7 @@ _EOF_ Banner_Installing - APT_INSTALL python + AGI_ERROR_CHECKED python #Download Grasshopper local grasshopper_directory='/var/www' @@ -4771,7 +4763,7 @@ _EOF_ wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb - APT_FIX + AGF_ERROR_CHECKED rm package.deb @@ -4796,13 +4788,13 @@ _EOF_ echo -e "deb $INSTALL_URL_ADDRESS erasmus main" > /etc/apt/sources.list.d/openmediavault.list apt-get update - APT_INSTALL openmediavault-keyring + AGI_ERROR_CHECKED openmediavault-keyring debconf-set-selections <<< "openmediavault openmediavault/run-initsystem note" debconf-set-selections <<< "postfix postfix/main_mailer_type select No configuration" apt-get update - APT_INSTALL openmediavault postfix + AGI_ERROR_CHECKED openmediavault postfix else @@ -4843,7 +4835,7 @@ _EOF_ Banner_Installing - APT_INSTALL darkice icecast2 + AGI_ERROR_CHECKED darkice icecast2 fi @@ -4884,7 +4876,7 @@ _EOF_ if (( $? == 0 )); then # - Pre-reqs: https://github.com/Fourdee/DietPi/issues/1282#issuecomment-350490524 - APT_INSTALL "$PHP_APT_PACKAGE_NAME"-cgi "$PHP_APT_PACKAGE_NAME"-sqlite* + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-cgi "$PHP_APT_PACKAGE_NAME"-sqlite* # - Check free available memory. Increase swapfile size to prevent gravity running out of mem. if (( $(free -m | grep -m1 'Mem:' | awk '{print $4}') < 512 )); then @@ -4934,7 +4926,7 @@ _EOF_ /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - #APT_INSTALL lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 + #AGI_ERROR_CHECKED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 #Install SubSonic 5.3 wget "$INSTALL_URL_ADDRESS" -O package.deb @@ -4959,7 +4951,7 @@ _EOF_ /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - #APT_INSTALL lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 + #AGI_ERROR_CHECKED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 #Install SubSonic 6.0 wget "$INSTALL_URL_ADDRESS" -O package.deb @@ -5013,12 +5005,12 @@ _EOF_ # >= v111 image if [ -f /etc/.dietpi_image_version ]; then - APT_INSTALL python-rpi.gpio python3-rpi.gpio + AGI_ERROR_CHECKED python-rpi.gpio python3-rpi.gpio # - < v111 Bug in older DietPi images with sources.list | Use pip, as offical repo = python3-rpi.gpio: Depends: python3 (< 3.3) but 3.4.2-2 is to be installed else - APT_INSTALL python3-pip + AGI_ERROR_CHECKED python3-pip pip3 install RPi.GPIO fi @@ -5106,12 +5098,12 @@ _EOF_ Banner_Installing - APT_INSTALL python python3 + AGI_ERROR_CHECKED python python3 # - RPi, pre-reqs GPIO control for Node-Red if (( $HW_MODEL < 10 )); then - APT_INSTALL python-rpi.gpio + AGI_ERROR_CHECKED python-rpi.gpio fi @@ -5221,7 +5213,7 @@ _EOF_ apt-get update - APT_INSTALL mosquitto + AGI_ERROR_CHECKED mosquitto else @@ -5249,7 +5241,7 @@ _EOF_ wget "$INSTALL_URL_ADDRESS" -O /etc/blynkserver/server.jar # - Install Blynk JS Libary - APT_INSTALL python + AGI_ERROR_CHECKED python npm install -g onoff npm install -g blynk-library @@ -5307,12 +5299,12 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then # - Prereqs - APT_INSTALL libasound2 + AGI_ERROR_CHECKED libasound2 # - Stretch, install additional packages if (( $DISTRO >= 4 )); then - APT_INSTALL gcc-6-base libstdc++6 + AGI_ERROR_CHECKED gcc-6-base libstdc++6 fi @@ -5340,7 +5332,7 @@ _EOF_ Banner_Installing - APT_INSTALL tomcat8 + AGI_ERROR_CHECKED tomcat8 fi @@ -5355,7 +5347,7 @@ _EOF_ if (( $? == 0 )); then #Python dev, pre-reqs - APT_INSTALL python-dev python-setuptools --no-install-recommends + AGI_ERROR_CHECKED python-dev python-setuptools --no-install-recommends #Install WEBIOPI wget "$INSTALL_URL_ADDRESS" -O package.tar @@ -5421,7 +5413,7 @@ _EOF_ cd haproxy-* #Pre-reqs - APT_INSTALL libpcre3-dev libssl-dev + AGI_ERROR_CHECKED libpcre3-dev libssl-dev #Compile and install make -j $HW_CPU_CORES TARGET=linux2628 CPU=generic USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 USE_LINUX_SPLICE=1 make install @@ -5464,7 +5456,7 @@ _EOF_ rm package.deb #https://github.com/Fourdee/DietPi/issues/736 - APT_FIX + AGF_ERROR_CHECKED #Stop service service logitechmediaserver stop @@ -5473,7 +5465,7 @@ _EOF_ # Compile pre-req CPAN modules??? # if (( $DISTRO >= 4 )); then - # APT_INSTALL yasm git build-essential automake cpanminus nasm libxml-parser-perl libexpat1-dev libgif-dev zlib1g-dev libjpeg-dev libpng-dev + # AGI_ERROR_CHECKED yasm git build-essential automake cpanminus nasm libxml-parser-perl libexpat1-dev libgif-dev zlib1g-dev libjpeg-dev libpng-dev # + ARMv6 cpan @@ -5486,8 +5478,8 @@ _EOF_ # + ARM64 cpan elif (( $HW_ARCH == 3 )); then - APT_INSTALL libxml-parser-perl - APT_INSTALL zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev # shared libs needed for Image::Scale@0.08 + AGI_ERROR_CHECKED libxml-parser-perl + AGI_ERROR_CHECKED zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev # shared libs needed for Image::Scale@0.08 wget http://dietpi.com/downloads/binaries/all/DietPi-LMS7.9-CPAN_arm64.zip -O package.zip unzip -o package.zip -d /usr/share/squeezeboxserver @@ -5534,7 +5526,7 @@ _EOF_ Banner_Installing - APT_INSTALL tightvncserver x11vnc --no-install-recommends + AGI_ERROR_CHECKED tightvncserver x11vnc --no-install-recommends fi @@ -5544,12 +5536,12 @@ _EOF_ Banner_Installing - APT_INSTALL vnc4server x11vnc --no-install-recommends + AGI_ERROR_CHECKED vnc4server x11vnc --no-install-recommends # - Stretch+ if (( $DISTRO >= 4 )); then - APT_INSTALL tigervnc-common + AGI_ERROR_CHECKED tigervnc-common fi @@ -5582,7 +5574,7 @@ _EOF_ # fi # - Available in Raspbian apt - APT_INSTALL realvnc-vnc-server + AGI_ERROR_CHECKED realvnc-vnc-server fi @@ -5594,7 +5586,7 @@ _EOF_ touch /var/log/auth.log #: https://github.com/Fourdee/DietPi/issues/475#issuecomment-310873879 - APT_INSTALL fail2ban --no-install-recommends + AGI_ERROR_CHECKED fail2ban --no-install-recommends fi @@ -5693,7 +5685,7 @@ _EOF_ Banner_Installing - APT_INSTALL openvpn easy-rsa iptables + AGI_ERROR_CHECKED openvpn easy-rsa iptables fi @@ -5710,7 +5702,7 @@ _EOF_ #Install if (( $? == 0 )); then - APT_INSTALL lsb-release + AGI_ERROR_CHECKED lsb-release # - Requires underpriv user: https://github.com/Fourdee/DietPi/issues/570#issuecomment-255588307 useradd pivpn @@ -5757,17 +5749,17 @@ _EOF_ if (( $DISTRO >= 4 )); then - APT_INSTALL certbot + AGI_ERROR_CHECKED certbot if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then - APT_INSTALL python-certbot-apache + AGI_ERROR_CHECKED python-certbot-apache fi if (( ${aSOFTWARE_INSTALL_STATE[85]} >= 1 )); then - APT_INSTALL python-certbot-nginx + AGI_ERROR_CHECKED python-certbot-nginx fi @@ -5819,7 +5811,7 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - APT_INSTALL hostapd isc-dhcp-server iptables libnl-3-200 + AGI_ERROR_CHECKED hostapd isc-dhcp-server iptables libnl-3-200 wget "$INSTALL_URL_ADDRESS" -O package.zip unzip -o package.zip @@ -5942,7 +5934,7 @@ _EOF_ Banner_Installing # - Prereqs - APT_INSTALL tor + AGI_ERROR_CHECKED tor fi @@ -5982,10 +5974,10 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - APT_INSTALL openssl libsoxr0 libavahi-client3 libtool libconfig9 libpopt0 libdaemon0 --no-install-recommends + AGI_ERROR_CHECKED openssl libsoxr0 libavahi-client3 libtool libconfig9 libpopt0 libdaemon0 --no-install-recommends # This occured on C2: shairport-sync : Depends: libpopt-dev but it is not installed - #APT_INSTALL libpopt-dev + #AGI_ERROR_CHECKED libpopt-dev wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z -o/ @@ -6052,7 +6044,7 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - APT_INSTALL brutefir + AGI_ERROR_CHECKED brutefir wget -r -nH --cut-dirs=2 --no-parent --reject="index.htm*" -e robots=off "$INSTALL_URL_ADDRESS" mv BruteFIR /etc/ @@ -6104,7 +6096,7 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - APT_INSTALL squeezelite + AGI_ERROR_CHECKED squeezelite # - Overwrite binary with latest version: wget "$INSTALL_URL_ADDRESS" -O package.7z @@ -6162,7 +6154,7 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - APT_INSTALL minicom python-serial python-configobj --no-install-recommends + AGI_ERROR_CHECKED minicom python-serial python-configobj --no-install-recommends pip install paho-mqtt pydispatcher wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -6248,7 +6240,7 @@ _EOF_ if (( $? == 0 )); then # - For compression - APT_INSTALL --no-install-recommends zlib1g-dev + AGI_ERROR_CHECKED --no-install-recommends zlib1g-dev wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb @@ -6294,7 +6286,7 @@ _EOF_ Banner_Installing - APT_INSTALL mumble-server + AGI_ERROR_CHECKED mumble-server fi @@ -6377,7 +6369,7 @@ _EOF_ fi - APT_INSTALL emby-server embymagick + AGI_ERROR_CHECKED emby-server embymagick else @@ -6431,12 +6423,12 @@ _EOF_ dpkg --add-architecture armhf apt-get update - APT_INSTALL binutils:armhf plexmediaserver-installer:armhf + AGI_ERROR_CHECKED binutils:armhf plexmediaserver-installer:armhf #ARM32 else - APT_INSTALL plexmediaserver-installer + AGI_ERROR_CHECKED plexmediaserver-installer fi @@ -6504,7 +6496,7 @@ _EOF_ if (( $? == 0 )); then #prereqs - APT_INSTALL python python3 supervisor rdiff-backup screen rsync + AGI_ERROR_CHECKED python python3 supervisor rdiff-backup screen rsync mkdir -p "$FP_DIETPI_USERDATA"/mineos cd "$FP_DIETPI_USERDATA"/mineos @@ -6575,7 +6567,7 @@ _EOF_ Banner_Installing - APT_INSTALL qbittorrent-nox + AGI_ERROR_CHECKED qbittorrent-nox fi @@ -6591,16 +6583,16 @@ _EOF_ #Install if (( $? == 0 )); then - APT_INSTALL rtorrent screen #mediainfo + AGI_ERROR_CHECKED rtorrent screen #mediainfo #Raspbian unrar free if (( $HW_MODEL < 10 )); then - APT_INSTALL unrar-free #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 + AGI_ERROR_CHECKED unrar-free #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 else - APT_INSTALL unrar #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 + AGI_ERROR_CHECKED unrar #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 fi @@ -6629,7 +6621,7 @@ _EOF_ if (( $DISTRO >= 4 )); then - APT_INSTALL aria2 + AGI_ERROR_CHECKED aria2 else @@ -6662,7 +6654,7 @@ _EOF_ if (( $? == 0 )); then # - prereqs - APT_INSTALL libc-ares2 + AGI_ERROR_CHECKED libc-ares2 wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z @@ -6712,16 +6704,16 @@ _EOF_ #Install if (( $? == 0 )); then - APT_INSTALL python libxslt1.1 libxml2 python-openssl python-xmltodict + AGI_ERROR_CHECKED python libxslt1.1 libxml2 python-openssl python-xmltodict #Raspbian unrar free if (( $HW_MODEL < 10 )); then - APT_INSTALL unrar-free + AGI_ERROR_CHECKED unrar-free else - APT_INSTALL unrar + AGI_ERROR_CHECKED unrar fi @@ -6835,7 +6827,7 @@ _EOF_ /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - APT_INSTALL libpng12-0 libfontconfig1 + AGI_ERROR_CHECKED libpng12-0 libfontconfig1 wget "$INSTALL_URL_ADDRESS" -O package.tar mkdir /etc/tonido @@ -6861,11 +6853,11 @@ _EOF_ if (( $HW_MODEL < 10 )); then - APT_INSTALL chromium-browser + AGI_ERROR_CHECKED chromium-browser else - APT_INSTALL chromium + AGI_ERROR_CHECKED chromium fi @@ -6894,11 +6886,11 @@ _EOF_ # - Odroid's, 'apt-get install -f' removes chromium package, rather than install required deps... if (( $HW_MODEL >= 10 && $HW_MODEL < 20 )); then - APT_INSTALL libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7 + AGI_ERROR_CHECKED libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7 else - APT_FIX + AGF_ERROR_CHECKED fi @@ -6950,7 +6942,7 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - APT_INSTALL v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev libx264-142 libavcodec56 libavformat56 libmysqlclient18 libswscale3 libpq5 + AGI_ERROR_CHECKED v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev libx264-142 libavcodec56 libavformat56 libmysqlclient18 libswscale3 libpq5 # - Motion wget "$INSTALL_URL_ADDRESS" -O package.deb @@ -6970,9 +6962,9 @@ _EOF_ else # - Prereqs - APT_INSTALL v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev + AGI_ERROR_CHECKED v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev - APT_INSTALL motion + AGI_ERROR_CHECKED motion # - Motioneye pip install motioneye @@ -7001,7 +6993,7 @@ _EOF_ wget -q -O - https://davesteele.github.io/key-366150CE.pub.txt | apt-key add - apt-get update - APT_INSTALL cloudprint-service + AGI_ERROR_CHECKED cloudprint-service else @@ -7011,7 +7003,7 @@ _EOF_ else - APT_INSTALL cloudprint-service + AGI_ERROR_CHECKED cloudprint-service fi @@ -7074,15 +7066,15 @@ _EOF_ if (( $? == 0 )); then #prereqs - APT_INSTALL par2 python-dev libffi-dev libssl-dev + AGI_ERROR_CHECKED par2 python-dev libffi-dev libssl-dev if (( $HW_MODEL < 10 )); then - APT_INSTALL unrar-free + AGI_ERROR_CHECKED unrar-free else - APT_INSTALL unrar + AGI_ERROR_CHECKED unrar fi @@ -7138,7 +7130,7 @@ _EOF_ /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - APT_INSTALL libffi-dev libssl-dev python-lxml python3-lxml + AGI_ERROR_CHECKED libffi-dev libssl-dev python-lxml python3-lxml wget "$INSTALL_URL_ADDRESS" -O package.zip unzip -o package.zip @@ -7170,7 +7162,7 @@ _EOF_ #Install if (( $? == 0 )); then - APT_INSTALL python + AGI_ERROR_CHECKED python wget "$INSTALL_URL_ADDRESS" -O package.zip unzip -o package.zip @@ -7215,7 +7207,7 @@ _EOF_ fi apt-get update - APT_INSTALL nzbdrone + AGI_ERROR_CHECKED nzbdrone fi @@ -7232,7 +7224,7 @@ _EOF_ #Install if (( $? == 0 )); then - APT_INSTALL mono-devel mediainfo sqlite3 libmono-cil-dev + AGI_ERROR_CHECKED mono-devel mediainfo sqlite3 libmono-cil-dev wget $( curl -s "$INSTALL_URL_ADDRESS" | grep linux.tar.gz | grep browser_download_url | head -1 | cut -d \" -f 4 ) -O package.tar tar -xf package.tar -C /opt/ @@ -7259,7 +7251,7 @@ _EOF_ #Install if (( $? == 0 )); then - APT_INSTALL python + AGI_ERROR_CHECKED python git clone --depth=1 "$INSTALL_URL_ADDRESS" @@ -7286,7 +7278,7 @@ _EOF_ #Install if (( $? == 0 )); then - APT_INSTALL mono-devel + AGI_ERROR_CHECKED mono-devel wget $( curl -s "$INSTALL_URL_ADDRESS" | grep Jackett.Binaries.Mono.tar.gz | grep browser_download_url | head -1 | cut -d \" -f 4 ) -O package.tar tar -xvf package.tar @@ -7324,7 +7316,7 @@ _EOF_ apt-get update - APT_INSTALL mediacenter22 + AGI_ERROR_CHECKED mediacenter22 else @@ -7375,7 +7367,7 @@ _EOF_ if (( $? == 0 )); then #Install Python and PIP - APT_INSTALL python python-pip python-imaging python-dev + AGI_ERROR_CHECKED python python-pip python-imaging python-dev cd "$HOME" git clone --depth=1 "$INSTALL_URL_ADDRESS" @@ -7404,7 +7396,7 @@ _EOF_ if (( $? == 0 )); then - APT_INSTALL python python-dev + AGI_ERROR_CHECKED python python-dev git clone "$INSTALL_URL_ADDRESS" mv OctoPrint* "$FP_DIETPI_USERDATA"/octoprint @@ -7432,7 +7424,7 @@ _EOF_ if (( $? == 0 )); then - APT_INSTALL libav-tools cifs-utils + AGI_ERROR_CHECKED libav-tools cifs-utils wget "$INSTALL_URL_ADDRESS" -O package.tar tar xvf package.tar @@ -7456,7 +7448,7 @@ _EOF_ debconf-set-selections <<< "steam steam/question select I AGREE" - APT_INSTALL steam + AGI_ERROR_CHECKED steam fi @@ -7692,7 +7684,7 @@ _EOF_ /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - APT_INSTALL libupnp6 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-alsa + AGI_ERROR_CHECKED 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 @@ -7730,7 +7722,7 @@ _EOF_ echo -e "deb https://dtcooper.github.io/raspotify jessie main" > /etc/apt/sources.list.d/raspotify.list apt-get update - APT_INSTALL raspotify + AGI_ERROR_CHECKED raspotify else @@ -7756,23 +7748,23 @@ _EOF_ #Pre-Reqs ----------------------------------------------------------------------- # Core packages - APT_INSTALL rpi-update mpc memcached $PHP_APT_PACKAGE_NAME-memcache \ + AGI_ERROR_CHECKED 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 - APT_INSTALL dnsmasq hostapd + AGI_ERROR_CHECKED dnsmasq hostapd # BT - APT_INSTALL bluez bluez-firmware \ + AGI_ERROR_CHECKED 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 - APT_INSTALL pi-bluetooth + AGI_ERROR_CHECKED pi-bluetooth fi @@ -7886,7 +7878,7 @@ libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc Banner_Installing - APT_INSTALL alsa-utils + AGI_ERROR_CHECKED alsa-utils #Apply soundcard local soundcard=$(cat /DietPi/dietpi.txt | grep -m1 'soundcard=' | sed 's/.*=//') @@ -7917,7 +7909,7 @@ libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc Banner_Installing #Xserver Prereqs (ALL) - APT_INSTALL xcompmgr xterm xinit xauth xserver-xorg dbus-x11 xfonts-base x11-xserver-utils x11-common x11-utils --no-install-recommends + AGI_ERROR_CHECKED xcompmgr xterm xinit xauth xserver-xorg dbus-x11 xfonts-base x11-xserver-utils x11-common x11-utils --no-install-recommends #Improve performance on all desktops and devices (eg: removes window lag in desktops) by limiting compositions mkdir -p /etc/xdg/autostart @@ -7937,11 +7929,11 @@ _EOF_ #Odroid C2 elif (( $HW_MODEL == 12 )); then - APT_INSTALL aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump-odroid --no-install-recommends + AGI_ERROR_CHECKED aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump-odroid --no-install-recommends #cp /DietPi/dietpi/conf/xorg_c2.conf /etc/X11/xorg.conf # FBTURBO C2, provides much better desktop performance over Mali DDX: http://forum.odroid.com/viewtopic.php?f=138&t=19948&p=169808#p169808 - APT_INSTALL xf86-video-fbturbo-odroid + AGI_ERROR_CHECKED xf86-video-fbturbo-odroid cat << _EOF_ > /etc/X11/xorg.conf Section "Device" Identifier "FBTurbo" @@ -7955,14 +7947,14 @@ _EOF_ #Odroid XU4 elif (( $HW_MODEL == 11 )); then - APT_INSTALL firmware-samsung xf86-video-armsoc-odroid malit628-odroid --no-install-recommends + AGI_ERROR_CHECKED firmware-samsung xf86-video-armsoc-odroid malit628-odroid --no-install-recommends cp /DietPi/dietpi/conf/xorg_xu4.conf /etc/X11/xorg.conf #Odroid C1 elif (( $HW_MODEL == 10 )); then - APT_INSTALL aml-libs-odroid xf86-video-mali-odroid libump-odroid mali450-odroid --no-install-recommends + AGI_ERROR_CHECKED aml-libs-odroid xf86-video-mali-odroid libump-odroid mali450-odroid --no-install-recommends cp /DietPi/dietpi/conf/xorg_c1.conf /etc/X11/xorg.conf @@ -8021,10 +8013,10 @@ _EOF_ Banner_Installing #Install - APT_INSTALL nvidia-driver nvidia-xconfig + AGI_ERROR_CHECKED nvidia-driver nvidia-xconfig # + i386 OpenGL - APT_INSTALL libgl1-nvidia-glx:i386 + AGI_ERROR_CHECKED libgl1-nvidia-glx:i386 fi @@ -8034,7 +8026,7 @@ _EOF_ Banner_Installing - APT_INSTALL avahi-daemon + AGI_ERROR_CHECKED avahi-daemon fi @@ -8042,7 +8034,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL build-essential make autoconf automake --no-install-recommends + AGI_ERROR_CHECKED build-essential make autoconf automake --no-install-recommends fi @@ -8050,7 +8042,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL ntp + AGI_ERROR_CHECKED ntp # Remove service, as DietPi ntpd-mode launches the binary with custom commands systemctl stop ntp @@ -8064,7 +8056,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL git --no-install-recommends + AGI_ERROR_CHECKED git --no-install-recommends fi @@ -8072,7 +8064,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL vifm + AGI_ERROR_CHECKED vifm fi @@ -8080,7 +8072,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL vim + AGI_ERROR_CHECKED vim fi @@ -8088,7 +8080,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL vim-tiny + AGI_ERROR_CHECKED vim-tiny fi @@ -8096,7 +8088,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL neovim + AGI_ERROR_CHECKED neovim fi @@ -8104,7 +8096,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL emacs + AGI_ERROR_CHECKED emacs fi @@ -8112,7 +8104,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL iperf + AGI_ERROR_CHECKED iperf fi @@ -8120,7 +8112,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL mc + AGI_ERROR_CHECKED mc fi @@ -8128,7 +8120,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL jed + AGI_ERROR_CHECKED jed fi @@ -8136,7 +8128,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL iftop + AGI_ERROR_CHECKED iftop fi @@ -8144,7 +8136,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL iptraf + AGI_ERROR_CHECKED iptraf fi @@ -8152,7 +8144,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL mtr-tiny + AGI_ERROR_CHECKED mtr-tiny fi @@ -8160,7 +8152,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL nload + AGI_ERROR_CHECKED nload fi @@ -8168,7 +8160,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL tcpdump + AGI_ERROR_CHECKED tcpdump fi @@ -8176,7 +8168,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL openssh-client + AGI_ERROR_CHECKED openssh-client fi @@ -8188,7 +8180,7 @@ _EOF_ #Remove Information file rm /mnt/samba/readme.txt &> /dev/null - APT_INSTALL smbclient cifs-utils --no-install-recommends + AGI_ERROR_CHECKED smbclient cifs-utils --no-install-recommends fi @@ -8200,7 +8192,7 @@ _EOF_ #Remove information file rm /mnt/ftp_client/readme.txt &> /dev/null - APT_INSTALL curlftpfs + AGI_ERROR_CHECKED curlftpfs fi @@ -8212,7 +8204,7 @@ _EOF_ #Remove information file rm /mnt/nfs_client/readme.txt &> /dev/null - APT_INSTALL nfs-common + AGI_ERROR_CHECKED nfs-common fi @@ -8220,7 +8212,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL dropbear + AGI_ERROR_CHECKED dropbear #set to start on next boot sed -i '/NO_START=1/c\NO_START=0' /etc/default/dropbear @@ -8231,7 +8223,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL openssh-server --no-install-recommends + AGI_ERROR_CHECKED openssh-server --no-install-recommends # - Remove all references before adding the entry: https://github.com/Fourdee/DietPi/issues/604 @@ -8274,7 +8266,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL logrotate --no-install-recommends + AGI_ERROR_CHECKED logrotate --no-install-recommends fi @@ -8282,7 +8274,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - APT_INSTALL rsyslog --no-install-recommends + AGI_ERROR_CHECKED rsyslog --no-install-recommends fi @@ -8314,7 +8306,7 @@ _EOF_ #Everything else else - APT_INSTALL ffmpeg + AGI_ERROR_CHECKED ffmpeg fi @@ -8328,7 +8320,7 @@ _EOF_ # - Raspbian if (( $HW_MODEL < 10 )); then - APT_INSTALL oracle-java8-jdk + AGI_ERROR_CHECKED oracle-java8-jdk # - Debian. Add repo else @@ -8344,7 +8336,7 @@ _EOF_ # - Accept the license: https://github.com/Fourdee/DietPi/issues/298 debconf-set-selections <<< "oracle-java8-installer shared/accepted-oracle-license-v1-1 boolean true" - APT_INSTALL oracle-java8-installer + AGI_ERROR_CHECKED oracle-java8-installer fi @@ -8389,13 +8381,13 @@ _EOF_ if (( $? == 0 )); then # - Preqs - APT_INSTALL python python-dev + AGI_ERROR_CHECKED python python-dev wget "$INSTALL_URL_ADDRESS" -O install.py python ./install.py rm install.py - APT_INSTALL python-pip python3-pip + AGI_ERROR_CHECKED python-pip python3-pip else @@ -8416,7 +8408,7 @@ _EOF_ if (( $? == 0 )); then - #APT_INSTALL libxss1 #if using SDL2+rpi5 + #AGI_ERROR_CHECKED libxss1 #if using SDL2+rpi5 wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z -osdl2_rpi @@ -8454,7 +8446,7 @@ _EOF_ apt-get update - APT_INSTALL mono-runtime + AGI_ERROR_CHECKED mono-runtime fi @@ -8477,15 +8469,15 @@ _EOF_ /DietPi/dietpi/func/dietpi-notify 2 "HA_PYTHON_VERSION: $HA_PYTHON_VERSION" # Install needed libraries - APT_INSTALL 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 + AGI_ERROR_CHECKED 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 - APT_INSTALL libmysqlclient-dev + AGI_ERROR_CHECKED libmysqlclient-dev fi if (( $DISTRO >= 4 )); then - APT_INSTALL libmariadbclient-dev + AGI_ERROR_CHECKED libmariadbclient-dev fi @@ -11665,7 +11657,7 @@ _EOF_ a2enmod rewrite #install scgi module - APT_INSTALL libapache2-mod-scgi + AGI_ERROR_CHECKED libapache2-mod-scgi htpasswd -cb /etc/.rutorrent-htaccess root "$GLOBAL_PW" cat << _EOF_ > /var/www/rutorrent/.htaccess @@ -13277,55 +13269,55 @@ _EOF_ elif (( $1 == 23 )); then - APT_PURGE lxde lxde-* upower policykit-1 iceweasel p7zip-full + AGP_ERROR_CHECKED lxde lxde-* upower policykit-1 iceweasel p7zip-full elif (( $1 == 24 )); then - APT_PURGE mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full + AGP_ERROR_CHECKED mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full elif (( $1 == 26 )); then - APT_PURGE x-window-system-core wmaker gnustep gnustep-devel gnustep-games upower policykit-1 iceweasel p7zip-full + AGP_ERROR_CHECKED x-window-system-core wmaker gnustep gnustep-devel gnustep-games upower policykit-1 iceweasel p7zip-full elif (( $1 == 25 )); then - APT_PURGE xfce4 gnome-icon-theme tango-icon-theme iceweasel p7zip-full + AGP_ERROR_CHECKED xfce4 gnome-icon-theme tango-icon-theme iceweasel p7zip-full elif (( $1 == 22 )); then - APT_PURGE quiterss + AGP_ERROR_CHECKED quiterss elif (( $1 == 30 )); then - APT_PURGE nomachine + AGP_ERROR_CHECKED nomachine elif (( $1 == 29 )); then - APT_PURGE xrdp + AGP_ERROR_CHECKED xrdp elif (( $1 == 44 )); then - APT_PURGE transmission-daemon + AGP_ERROR_CHECKED transmission-daemon rm /etc/init.d/transmission-daemon &> /dev/null rm /etc/systemd/system/transmission-daemon.service &> /dev/null elif (( $1 == 83 )); then - APT_PURGE apache2 + AGP_ERROR_CHECKED apache2 elif (( $1 == 85 )); then - APT_PURGE nginx + AGP_ERROR_CHECKED nginx elif (( $1 == 84 )); then - APT_PURGE lighttpd + AGP_ERROR_CHECKED lighttpd elif (( $1 == 86 || $1 == 88 )); then - APT_PURGE mysql-server mysql-client + AGP_ERROR_CHECKED mysql-server mysql-client - APT_PURGE mariadb-server mariadb-client + AGP_ERROR_CHECKED mariadb-server mariadb-client # - custom confs rm /etc/mysql/conf.d/reduce_resources.cnf @@ -13339,17 +13331,17 @@ _EOF_ elif (( $1 == 87 )); then - APT_PURGE sqlite3 + AGP_ERROR_CHECKED sqlite3 elif (( $1 == 91 )); then - APT_PURGE "$PHP_APT_PACKAGE_NAME"-redis redis-server redis-tools + AGP_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-redis redis-server redis-tools elif (( $1 == 89 )); then rm "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf rm "$FP_PHP_BASE_DIR"/mods-available/dietpi.ini 2> /dev/null - APT_PURGE "$PHP_APT_PACKAGE_NAME"-* libapache2-mod-"$PHP_APT_PACKAGE_NAME" + AGP_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-* libapache2-mod-"$PHP_APT_PACKAGE_NAME" rm /var/www/phpinfo.php rm /var/www/apc.php rm /var/www/opcache.php @@ -13358,7 +13350,7 @@ _EOF_ elif (( $1 == 90 )); then - APT_PURGE phpmyadmin + AGP_ERROR_CHECKED phpmyadmin elif (( $1 == 54 )); then @@ -13383,7 +13375,7 @@ _EOF_ mysqldump --lock-tables -uroot -p"$GLOBAL_PW" owncloud > "$FP_DIETPI_USERDATA"/owncloud_data/mysql_backup.sql mysqladmin -u root -p"$GLOBAL_PW" drop owncloud -f # Purge APT package - APT_PURGE owncloud-files owncloud owncloud-deps + AGP_ERROR_CHECKED owncloud-files owncloud owncloud-deps # Remove ownCloud installation folder rm -R /var/www/owncloud # Remove ownCloud repo @@ -13410,7 +13402,7 @@ _EOF_ elif (( $1 == 115 )); then - APT_PURGE webmin + AGP_ERROR_CHECKED webmin elif (( $1 == 32 )); then @@ -13419,7 +13411,7 @@ _EOF_ elif (( $1 == 128 )); then - APT_PURGE mpd libmpdclient2 + AGP_ERROR_CHECKED mpd libmpdclient2 userdel -f mpd &> /dev/null rm /lib/systemd/system/mpd.service rm -R "$FP_DIETPI_USERDATA"/.mpd_cache @@ -13437,20 +13429,20 @@ _EOF_ elif (( $1 == 123 )); then - APT_PURGE mosquitto + AGP_ERROR_CHECKED mosquitto rm /etc/apt/sources.list.d/mosquitto-*.list elif (( $1 == 124 )); then - APT_PURGE networkaudiod + AGP_ERROR_CHECKED networkaudiod elif (( $1 == 125 )); then - APT_PURGE tomcat8 + AGP_ERROR_CHECKED tomcat8 elif (( $1 == 126 )); then - APT_PURGE openmediavault + AGP_ERROR_CHECKED openmediavault rm /etc/apt/sources.list.d/openmediavault.list elif (( $1 == 129 )); then @@ -13461,7 +13453,7 @@ _EOF_ elif (( $1 == 130 )); then - APT_PURGE python-pip python3-pip + AGP_ERROR_CHECKED python-pip python3-pip elif (( $1 == 131 )); then @@ -13475,7 +13467,7 @@ _EOF_ rm /usr/local/bin/aria2c rm -R /var/www/aria2 - APT_PURGE aria2 + AGP_ERROR_CHECKED aria2 elif (( $1 == 133 )); then @@ -13496,13 +13488,13 @@ _EOF_ elif (( $1 == 135 )); then - APT_PURGE darkice icecast2 + AGP_ERROR_CHECKED darkice icecast2 rm /etc/systemd/system/darkice.service elif (( $1 == 136 )); then - APT_PURGE motion + AGP_ERROR_CHECKED motion rm -R /etc/motioneye @@ -13512,7 +13504,7 @@ _EOF_ elif (( $1 == 137 )); then - APT_PURGE cloudprint-service + AGP_ERROR_CHECKED cloudprint-service if (( $DISTRO == 3 )); then rm /etc/apt/sources.list.d/cloudprint.list @@ -13534,7 +13526,7 @@ _EOF_ elif (( $1 == 140 )); then - APT_PURGE libsdl2 libsdl2-image libsdl2-mixer libsdl2-net libsdl2-ttf libsmpeg2 + AGP_ERROR_CHECKED libsdl2 libsdl2-image libsdl2-mixer libsdl2-net libsdl2-ttf libsmpeg2 elif (( $1 == 141 )); then @@ -13560,7 +13552,7 @@ _EOF_ elif (( $1 == 144 )); then - APT_PURGE nzbdrone + AGP_ERROR_CHECKED nzbdrone rm /etc/systemd/system/sonarr.service rm /etc/apt/sources.list.d/sonarr.list apt-get update @@ -13583,7 +13575,7 @@ _EOF_ elif (( $1 == 148 )); then - APT_PURGE mediacenter22 + AGP_ERROR_CHECKED mediacenter22 elif (( $1 == 149 )); then @@ -13597,18 +13589,18 @@ _EOF_ elif (( $1 == 150 )); then - #APT_PURGE mono-runtime #shared lib + #AGP_ERROR_CHECKED mono-runtime #shared lib rm /etc/apt/sources.list.d/mono-xamarin.list apt-get update elif (( $1 == 151 )); then - APT_PURGE nvidia-driver nvidia-xconfig libgl1-nvidia-glx:i386 + AGP_ERROR_CHECKED nvidia-driver nvidia-xconfig libgl1-nvidia-glx:i386 elif (( $1 == 152 )); then - APT_PURGE avahi-daemon + AGP_ERROR_CHECKED avahi-daemon elif (( $1 == 153 )); then @@ -13624,45 +13616,45 @@ _EOF_ elif (( $1 == 156 )); then - APT_PURGE steam + AGP_ERROR_CHECKED steam rm -R "$HOME"/.steam rm -R "$FP_DIETPI_USERDATA"/steam elif (( $1 == 119 )); then - APT_PURGE cava + AGP_ERROR_CHECKED cava rm "$HOME/.config/cava/config" rm "$HOME/cava.psf" elif (( $1 == 118 )); then - APT_PURGE mopidy + AGP_ERROR_CHECKED mopidy rm /etc/apt/sources.list.d/mopidy.list pip uninstall -y Mopidy-MusicBox-Webclient Mopidy-Local-Images elif (( $1 == 31 )); then - APT_PURGE kodi + AGP_ERROR_CHECKED kodi #+Odroids - APT_PURGE kodi-odroid + AGP_ERROR_CHECKED kodi-odroid rm /usr/share/applications/kodi.desktop rm ~/Desktop/kodi.desktop elif (( $1 == 39 )); then - APT_PURGE minidlna + AGP_ERROR_CHECKED minidlna elif (( $1 == 51 )); then - APT_PURGE ibsdl1.2debian libsdl-net1.2 + AGP_ERROR_CHECKED ibsdl1.2debian libsdl-net1.2 rm -R /usr/local/games/opentyrian rm /usr/share/applications/opentyrian.desktop rm ~/Desktop/opentyrian.desktop elif (( $1 == 59 )); then - APT_PURGE gpac + AGP_ERROR_CHECKED gpac rm -R /var/www/dietpicam rm /opt/vc/bin/raspimjpeg rm /usr/bin/raspimjpeg @@ -13671,25 +13663,25 @@ _EOF_ elif (( $1 == 45 )); then - APT_PURGE deluged deluge-web deluge-webui deluge-console + AGP_ERROR_CHECKED deluged deluge-web deluge-webui deluge-console rm /etc/dietpi/dietpi-software/services/deluge.service rm -R ~/.config/deluge elif (( $1 == 94 )); then - APT_PURGE proftpd-basic + AGP_ERROR_CHECKED proftpd-basic elif (( $1 == 96 )); then - APT_PURGE samba samba-common-bin + AGP_ERROR_CHECKED samba samba-common-bin elif (( $1 == 95 )); then - APT_PURGE vsftpd + AGP_ERROR_CHECKED vsftpd elif (( $1 == 109 )); then - APT_PURGE nfs-kernel-server + AGP_ERROR_CHECKED nfs-kernel-server elif (( $1 == 67 )); then @@ -13707,7 +13699,7 @@ _EOF_ elif (( $1 == 93 )); then - APT_PURGE dnsmasq + AGP_ERROR_CHECKED dnsmasq pihole uninstall #https://github.com/Fourdee/DietPi/issues/753 @@ -13723,7 +13715,7 @@ _EOF_ elif (( $1 == 33 || $1 == 34 )); then - APT_PURGE subsonic + AGP_ERROR_CHECKED subsonic rm -R /var/subsonic elif (( $1 == 71 )); then @@ -13742,7 +13734,7 @@ _EOF_ rm "$HOME"/weaved_setup.bin # Remot3.it - APT_PURGE weavedconnectd + AGP_ERROR_CHECKED weavedconnectd elif (( $1 == 62 )); then @@ -13767,11 +13759,11 @@ _EOF_ rm -r /etc/haproxy #Shared dev libraries. Leave these installed - #APT_PURGE libpcre3-dev libssl-dev + #AGP_ERROR_CHECKED libpcre3-dev libssl-dev elif (( $1 == 35 )); then - APT_PURGE logitechmediaserver + AGP_ERROR_CHECKED logitechmediaserver rm /etc/dietpi/dietpi-software/services/squeezeboxserver.service rm -R /var/lib/squeezeboxserver rm -R /usr/share/squeezeboxserver @@ -13782,11 +13774,11 @@ _EOF_ elif (( $1 == 27 || $1 == 28 || $1 == 120 )); then - APT_PURGE tightvncserver - APT_PURGE vnc4server - APT_PURGE x11vnc - APT_PURGE realvnc-vnc-server - APT_PURGE tigervnc-* + AGP_ERROR_CHECKED tightvncserver + AGP_ERROR_CHECKED vnc4server + AGP_ERROR_CHECKED x11vnc + AGP_ERROR_CHECKED realvnc-vnc-server + AGP_ERROR_CHECKED tigervnc-* rm /etc/systemd/system/vncserver.service rm /etc/init.d/vncserver @@ -13801,7 +13793,7 @@ _EOF_ elif (( $1 == 73 )); then - APT_PURGE fail2ban + AGP_ERROR_CHECKED fail2ban elif (( $1 == 64 )); then @@ -13828,14 +13820,14 @@ _EOF_ elif (( $1 == 97 )); then - APT_PURGE openvpn + AGP_ERROR_CHECKED openvpn rm -R /etc/openvpn &> /dev/null elif (( $1 == 92 )); then if (( $DISTRO >= 4 )); then - APT_PURGE python-certbot-apache python-certbot-nginx certbot + AGP_ERROR_CHECKED python-certbot-apache python-certbot-nginx certbot fi @@ -13844,11 +13836,11 @@ _EOF_ elif (( $1 == 69 )); then - APT_PURGE python-rpi.gpio python3-rpi.gpio + AGP_ERROR_CHECKED python-rpi.gpio python3-rpi.gpio elif (( $1 == 72 )); then - APT_PURGE i2c-tools + AGP_ERROR_CHECKED i2c-tools #Disable /DietPi/dietpi/func/dietpi-set_hardware i2c disable @@ -13858,7 +13850,7 @@ _EOF_ elif (( $1 == 60 )); then - APT_PURGE hostapd isc-dhcp-server + AGP_ERROR_CHECKED hostapd isc-dhcp-server rm /etc/dhcp/dhcpd.conf &> /dev/null rm /etc/hostapd/hostapd.conf &> /dev/null @@ -13896,19 +13888,19 @@ _EOF_ elif (( $1 == 61 )); then - APT_PURGE tor + AGP_ERROR_CHECKED tor # - uninstall WIFIHOTSPOT ALSO. Due to IPtables needing reset. Uninstall_Software 60 elif (( $1 == 37 )); then - APT_PURGE shairport-sync* + AGP_ERROR_CHECKED shairport-sync* userdel -f shairport-sync elif (( $1 == 38 )); then - APT_PURGE brutefir + AGP_ERROR_CHECKED brutefir rm -R /etc/BruteFIR rm /etc/dietpi/dietpi-software/services/brutefir.service @@ -13927,7 +13919,7 @@ _EOF_ elif (( $1 == 36 )); then - APT_PURGE squeezelite + AGP_ERROR_CHECKED squeezelite rm -R /usr/bin/squeezelite* rm /etc/systemd/system/squeezelite.service @@ -13940,7 +13932,7 @@ _EOF_ elif (( $1 == 66 )); then - APT_PURGE rpimonitor + AGP_ERROR_CHECKED rpimonitor elif (( $1 == 57 )); then @@ -13959,7 +13951,7 @@ _EOF_ groupdel netdata #1.2.0+ - APT_PURGE netdata + AGP_ERROR_CHECKED netdata #1.0.0 rm /usr/sbin/netdata @@ -13972,11 +13964,11 @@ _EOF_ elif (( $1 == 43 )); then - APT_PURGE mumble-server + AGP_ERROR_CHECKED mumble-server elif (( $1 == 41 )); then - APT_PURGE emby-server + AGP_ERROR_CHECKED emby-server rm /etc/apt/sources.list.d/emby-server.list apt-get update @@ -13988,7 +13980,7 @@ _EOF_ elif (( $1 == 42 )); then - APT_PURGE plexmediaserver + AGP_ERROR_CHECKED plexmediaserver rm -R /var/lib/plexmediaserver @@ -14025,7 +14017,7 @@ _EOF_ elif (( $1 == 46 )); then - APT_PURGE qbittorrent-nox + AGP_ERROR_CHECKED qbittorrent-nox rm /etc/systemd/system/qbittorrent.service rm -R "$HOME"/.config/qBittorrent @@ -14044,7 +14036,7 @@ _EOF_ elif (( $1 == 107 )); then - APT_PURGE rtorrent + AGP_ERROR_CHECKED rtorrent rm -R /var/www/rutorrent rm "$HOME"/.rtorrent.rc rm /etc/systemd/system/rtorrent.service @@ -14091,7 +14083,7 @@ _EOF_ rm /etc/chromium.d/custom_flags rm "$HOME"/.chromium-browser.init - APT_PURGE chromium + AGP_ERROR_CHECKED chromium elif (( $1 == 157)); then @@ -14126,7 +14118,7 @@ _EOF_ elif (( $1 == 167 )); then - APT_PURGE raspotify + AGP_ERROR_CHECKED raspotify rm /etc/apt/sources.list.d/raspotify.list apt-get update @@ -14144,7 +14136,7 @@ _EOF_ elif (( $1 == 170 )); then Reset_NTPD - APT_PURGE ntp + AGP_ERROR_CHECKED ntp elif (( $1 == 158 )); then @@ -14178,10 +14170,10 @@ _EOF_ if (( $HW_ARCH == 10 )); then # remove docker and all its unused dependencies - x86_64 package name is different - APT_PURGE docker-ce + AGP_ERROR_CHECKED docker-ce else # remove docker and all its unused dependencies - ARM package name - APT_PURGE docker-engine + AGP_ERROR_CHECKED docker-engine fi # delete data files - dietpi @@ -14199,7 +14191,7 @@ _EOF_ elif (( $1 == 163 )); then - APT_PURGE gmrender + AGP_ERROR_CHECKED gmrender rm /etc/systemd/system/gmrender.service elif (( $1 == 159 || $1 == 160 )); then @@ -14215,57 +14207,57 @@ _EOF_ elif (( $1 == 15 )); then - APT_PURGE tcpdump + AGP_ERROR_CHECKED tcpdump elif (( $1 == 14 )); then - APT_PURGE nload + AGP_ERROR_CHECKED nload elif (( $1 == 13 )); then - APT_PURGE mtr-tiny + AGP_ERROR_CHECKED mtr-tiny elif (( $1 == 11 )); then - APT_PURGE iptraf + AGP_ERROR_CHECKED iptraf elif (( $1 == 10 )); then - APT_PURGE iftop + AGP_ERROR_CHECKED iftop elif (( $1 == 19 )); then - APT_PURGE jed + AGP_ERROR_CHECKED jed elif (( $1 == 3 )); then - APT_PURGE mc + AGP_ERROR_CHECKED mc elif (( $1 == 18 )); then - APT_PURGE emacs + AGP_ERROR_CHECKED emacs elif (( $1 == 20 || $i == 21 )); then - APT_PURGE vim vim-tiny + AGP_ERROR_CHECKED vim vim-tiny elif (( $1 == 127 )); then - APT_PURGE neovim + AGP_ERROR_CHECKED neovim elif (( $1 == 0 )); then #This also removes OpenSSH server. So lets check OpenSSH server isnt installed before hand. if (( $(dpkg -l | grep -ci -m1 'openssh-server') == 0 )); then - APT_PURGE openssh-client + AGP_ERROR_CHECKED openssh-client fi elif (( $1 == 1 )); then umount -f /mnt/samba - APT_PURGE smbclient + AGP_ERROR_CHECKED smbclient #Disable in fstab sed -i '/\/mnt\/samba/c\#\/mnt\/samba . Please use dietpi-config and the Networking Options: NAS menu to setup this mount' /etc/fstab #Add info file for installation method. @@ -14273,7 +14265,7 @@ _EOF_ elif (( $1 == 111 )); then - APT_PURGE urbackup-server + AGP_ERROR_CHECKED urbackup-server #+sourcebuild rm /etc/systemd/system/urbackupsrv.service @@ -14291,7 +14283,7 @@ _EOF_ #nfs-kernel-server depends on nfs-common if (( ${aSOFTWARE_INSTALL_STATE[109]} == 0 )); then - APT_PURGE nfs-common + AGP_ERROR_CHECKED nfs-common fi @@ -14303,28 +14295,28 @@ _EOF_ elif (( $1 == 16 )); then - APT_PURGE build-essential + AGP_ERROR_CHECKED build-essential elif (( $1 == 17 )); then - APT_PURGE git + AGP_ERROR_CHECKED git elif (( $1 == 5 )); then - APT_PURGE alsa-utils + AGP_ERROR_CHECKED alsa-utils #DietPi-JustBoom, remove bash alias for config panel: sed -i '/dietpi-justboom/d' /etc/bash.bashrc &> /dev/null elif (( $1 == 6 )); then - APT_PURGE xcompmgr xinit xauth xserver-xorg xfonts-base x11-xserver-utils x11-common x11-utils + AGP_ERROR_CHECKED xcompmgr xinit xauth xserver-xorg xfonts-base x11-xserver-utils x11-common x11-utils rm /etc/xdg/autostart/xcompmgr.desktop elif (( $1 == 2 )); then umount -f /mnt/ftp_client - APT_PURGE curlftpfs + AGP_ERROR_CHECKED curlftpfs #Disable in fstab sed -i '/\/mnt\/ftp_client/c\#\/mnt\/ftp_client . Please use dietpi-config and the Networking Options: NAS menu to setup this mount' /etc/fstab @@ -14334,23 +14326,23 @@ _EOF_ elif (( $1 == 7 )); then - APT_PURGE ffmpeg + AGP_ERROR_CHECKED ffmpeg # + RPi - APT_PURGE libx264 libmp3lame libfdk-aac + AGP_ERROR_CHECKED libx264 libmp3lame libfdk-aac elif (( $1 == 8 )); then - APT_PURGE oracle-java8-* + AGP_ERROR_CHECKED oracle-java8-* rm /etc/apt/sources.list.d/webupd8team-java.list apt-get update elif (( $1 == 104 )); then - APT_PURGE dropbear* #stretch | dropbear-initramfs dropbear-run + AGP_ERROR_CHECKED dropbear* #stretch | dropbear-initramfs dropbear-run elif (( $1 == 105 )); then - APT_PURGE openssh-* + AGP_ERROR_CHECKED openssh-* # This also clears Openssh-client aSOFTWARE_INSTALL_STATE[0]=0 @@ -14361,15 +14353,15 @@ _EOF_ elif (( $1 == 101 )); then - APT_PURGE logrotate + AGP_ERROR_CHECKED logrotate elif (( $1 == 102 )); then - APT_PURGE rsyslog + AGP_ERROR_CHECKED rsyslog elif (( $1 == 9 )); then - APT_PURGE nodejs + AGP_ERROR_CHECKED nodejs # - old install via repo if [ -f /etc/apt/sources.list.d/nodesource_nodejs.list ]; then @@ -14383,7 +14375,7 @@ _EOF_ elif (( $1 == 4 )); then - APT_PURGE vifm + AGP_ERROR_CHECKED vifm else diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index d839720a77..ae1ddcd999 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -94,6 +94,14 @@ FP_LOG_APT='/var/lib/dietpi/logs/dietpi-software_apt.log' EXITCODE_APT=0 #only way I found of exporting the exit code, once the command is run. + #Support for apt-fast: https://github.com/Fourdee/DietPi/issues/698 + # APT_BINARY='apt-get' + # if [ -f /usr/bin/apt-fast ]; then + + # APT_BINARY='apt-fast' + + # fi + AGI(){ local string="$@" From 59eda2c7e153968463bbc39c55abe199fe9883d3 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 18 Dec 2017 06:47:59 +0000 Subject: [PATCH 064/390] v160 + Continued: https://github.com/Fourdee/DietPi/issues/1311 https://github.com/Fourdee/DietPi/issues/1297 https://github.com/Fourdee/DietPi/issues/1285 --- CHANGELOG.txt | 2 +- PREP_SYSTEM_FOR_DIETPI.sh | 271 +------------------------ dietpi/dietpi-autostart | 15 +- dietpi/dietpi-ramdisk | 6 +- dietpi/dietpi-ramlog | 4 +- dietpi/func/dietpi-globals | 4 +- dietpi/func/dietpi-set_env | 395 +++++++++++++++++++++++++++++++++++++ dietpi/patch_file | 28 +-- 8 files changed, 425 insertions(+), 300 deletions(-) create mode 100644 dietpi/func/dietpi-set_env diff --git a/CHANGELOG.txt b/CHANGELOG.txt index bf35d7e6cd..d784b5b2ce 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -353,7 +353,7 @@ General | ASUS TB: Image has been updated, brings it up to Debian Stretch and la General | Stretch: Now installs Chromium via apt. General | DietPi RPi Kernel: Updated to 4.9: https://github.com/Fourdee/DietPi/issues/936 General | rpi_boardinfo: Has been removed from DietPi scripts. Now contained within dietpi-obtain_hw_model: https://github.com/Fourdee/DietPi/issues/936#issuecomment-301055299 -DietPi-Autostart | Added ability to select "custom", editing script located in /etc/dietpi/autostart.sh, to launch any command during boot: https://github.com/Fourdee/DietPi/issues/916 +DietPi-Autostart | Added ability to select "custom", editing script located in /var/lib/dietpi/dietpi-autostart/custom.sh, to launch any command during boot: https://github.com/Fourdee/DietPi/issues/916 DietPi-Config | Display Options: Added ability to enter MPEG2/VC1 keys for RPi: https://github.com/Fourdee/DietPi/issues/885 DietPi-Config | WiFi Hotspot: Added ability to toggle on/off state of hotspot: https://github.com/Fourdee/DietPi/issues/924 DietPi-Drive_Manager | Added support for setting Read Only/Read Write filesystems: https://github.com/Fourdee/DietPi/issues/229 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index b643b2adba..82a34f90be 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -278,6 +278,7 @@ rm -R /etc/dietpi &> /dev/null rm -R /var/lib/dietpi &> /dev/null + rm -R /var/tmp/dietpi &> /dev/null rm /root/DietPi-Automation.log &> /dev/null rm /boot/Automation_Format_My_Usb_Drive &> /dev/null @@ -817,30 +818,9 @@ _EOF_ # - ARMbian-config rm /etc/profile.d/check_first_login_reboot.sh &> /dev/null - dietpi-notify 2 "Setting UID bit for sudo" + dietpi-notify 2 "Creating DietPi core environment" - # - https://github.com/Fourdee/DietPi/issues/794 - chmod 4755 /usr/bin/sudo - Error_Check - - dietpi-notify 2 "Creating DietPi system directories" - - mkdir -p /DietPi - Error_Check - - mkdir -p /var/lib/dietpi/logs - Error_Check - - mkdir -p /mnt/dietpi_userdata - Error_Check - - mkdir -p /mnt/samba - Error_Check - - mkdir -p /mnt/ftp_client - Error_Check - - mkdir -p /mnt/nfs_client + /boot/dietpi/func/dietpi-set_core_environment Error_Check echo -e "Samba client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking option: NAS/Misc menu" > /mnt/samba/readme.txt @@ -872,181 +852,20 @@ _EOF_ fi - dietpi-notify 2 "Installing and starting DietPi-RAMdisk service" + dietpi-notify 2 "Starting DietPi-RAMdisk service" - cat << _EOF_ > /etc/systemd/system/dietpi-ramdisk.service -[Unit] -Description=DietPi-RAMdisk -After=local-fs.target - -[Service] -Type=forking -RemainAfterExit=yes -ExecStartPre=/bin/mkdir -p /var/lib/dietpi/logs -ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramdisk 0 | tee -a /var/lib/dietpi/logs/dietpi-ramdisk.log' -ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramdisk 1 | tee -a /var/lib/dietpi/logs/dietpi-ramdisk.log' - -[Install] -WantedBy=local-fs.target -_EOF_ - systemctl daemon-reload - systemctl enable dietpi-ramdisk.service systemctl start dietpi-ramdisk.service Error_Check - dietpi-notify 2 "Installing and starting DietPi-RAMlog service" - - # DietPi-Ramlog - cat << _EOF_ > /etc/systemd/system/dietpi-ramlog.service -[Unit] -Description=DietPi-RAMlog -Before=rsyslog.service syslog.service -After=local-fs.target - -[Service] -Type=forking -RemainAfterExit=yes -ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramlog 0' -ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramlog 1' + dietpi-notify 2 "Starting DietPi-RAMlog service" -[Install] -WantedBy=local-fs.target -_EOF_ - systemctl daemon-reload - systemctl enable dietpi-ramlog.service systemctl start dietpi-ramlog.service Error_Check - dietpi-notify 2 "Installing DietPi boot service" - - # Boot - cat << _EOF_ > /etc/systemd/system/dietpi-boot.service -[Unit] -Description=DietPi-Boot -After=network-online.target network.target networking.service dietpi-ramdisk.service dietpi-ramlog.service -Requires=dietpi-ramdisk.service - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/bin/bash -c '/DietPi/dietpi/boot' -StandardOutput=tty - -[Install] -WantedBy=multi-user.target -_EOF_ - systemctl enable dietpi-boot.service - systemctl daemon-reload - dietpi-notify 2 'Updating DietPi globals' /DietPi/dietpi/dietpi-obtain_hw_model - dietpi-notify 2 "Installing DietPi /etc/rc.local service" - - update-rc.d -f rc.local remove &> /dev/null - rm /etc/init.d/rc.local &> /dev/null - rm /lib/systemd/system/rc-local.service &> /dev/null - - cat << _EOF_ > /etc/systemd/system/rc-local.service -[Unit] -Description=/etc/rc.local Compatibility -After=dietpi-boot.service dietpi-ramdisk.service dietpi-ramlog.service -Requires=dietpi-boot.service dietpi-ramdisk.service - -[Service] -Type=idle -ExecStart=/etc/rc.local -StandardOutput=tty -RemainAfterExit=yes - -[Install] -WantedBy=multi-user.target -_EOF_ - systemctl enable rc-local.service - systemctl daemon-reload - - 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" -exit 0 -_EOF_ - chmod +x /etc/rc.local - systemctl daemon-reload - - dietpi-notify 2 "Installing kill-ssh-user-sessions-before-network.service" - - 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 - -[Service] -Type=oneshot -ExecStart=/bin/bash -c 'killall sshd &> /dev/null; killall dropbear &> /dev/null' - -[Install] -WantedBy=poweroff.target halt.target reboot.target -_EOF_ - systemctl enable kill-ssh-user-sessions-before-network - systemctl daemon-reload - - dietpi-notify 2 "Configuring Cron:" - - #Cron jobs - cp /DietPi/dietpi/conf/cron.daily_dietpi /etc/cron.daily/dietpi - Error_Check - chmod +x /etc/cron.daily/dietpi - Error_Check - cp /DietPi/dietpi/conf/cron.hourly_dietpi /etc/cron.hourly/dietpi - Error_Check - chmod +x /etc/cron.hourly/dietpi - Error_Check - - cat << _EOF_ > /etc/crontab -#Please use dietpi-cron to change cron start times -SHELL=/bin/sh -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin - -# m h dom mon dow user command -17 * * * * root cd / && run-parts --report /etc/cron.hourly -25 1 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) -47 1 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) -52 1 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) -_EOF_ - Error_Check - - # - ntp - rm /etc/cron.daily/ntp &> /dev/null - - dietpi-notify 2 "Disabling apt-daily services (prevents random APT cache lock):" - - systemctl mask apt-daily.service - systemctl mask apt-daily-upgrade.timer - - dietpi-notify 2 "Setting vm.swappiness=1:" - - sed -i '/vm.swappiness=/d' /etc/sysctl.conf - echo -e "vm.swappiness=1" > /etc/sysctl.d/97-dietpi.conf - Error_Check - dietpi-notify 2 "Configuring Network:" rm -R /etc/network/interfaces &> /dev/null # armbian symlink for bulky network-manager @@ -1067,7 +886,7 @@ _EOF_ fi - dietpi-notify 2 "Tweaking DHCP timeout:" + $FP_SCRIPTS/dietpi/func/dietpi-notify 2 "Tweaking DHCP timeout:" # - Reduce DHCP request retry count and timeouts: https://github.com/Fourdee/DietPi/issues/711 sed -i '/^#timeout /d' /etc/dhcp/dhclient.conf @@ -1078,17 +897,6 @@ _EOF_ timeout 10; retry 4; _EOF_ - Error_Check - - dietpi-notify 2 "Tweaking network naming:" - - # - Prefer to use wlan/eth naming for networked devices (eg: stretch) - ln -sf /dev/null /etc/systemd/network/99-default.link - #??? x86_64 - # kernel cmd line with GRUB - # /etc/default/grub [replace] GRUB_CMDLINE_LINUX="net.ifnames=0" - # GRUB_TIMEOUT=0 - #??? dietpi-notify 2 "Configuring Hosts:" @@ -1106,7 +914,6 @@ DietPi _EOF_ Error_Check - dietpi-notify 2 "Configuring htop:" mkdir -p /root/.config/htop @@ -1127,68 +934,6 @@ _EOF_ _EOF_ Error_Check - dietpi-notify 2 "Configuring bash:" - - #NB: we need to clear existing DietPi entries, then update with new - cat << _EOF_ >> /etc/bash.bashrc -#LANG -export \$(cat /etc/default/locale | grep LANG=) - -#Define a default LD_LIBRARY_PATH for all systems -export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/opt/vc/lib - -#DietPi Additions -alias sudo='sudo ' # https://github.com/Fourdee/DietPi/issues/424 -alias dietpi-process_tool='/DietPi/dietpi/dietpi-process_tool' -alias dietpi-letsencrypt='/DietPi/dietpi/dietpi-letsencrypt' -alias dietpi-autostart='/DietPi/dietpi/dietpi-autostart' -alias dietpi-cron='/DietPi/dietpi/dietpi-cron' -alias dietpi-launcher='/DietPi/dietpi/dietpi-launcher' -alias dietpi-cleaner='/DietPi/dietpi/dietpi-cleaner' -alias dietpi-morsecode='/DietPi/dietpi/dietpi-morsecode' -alias dietpi-sync='/DietPi/dietpi/dietpi-sync' -alias dietpi-backup='/DietPi/dietpi/dietpi-backup' -alias dietpi-bugreport='/DietPi/dietpi/dietpi-bugreport' -alias dietpi-services='/DietPi/dietpi/dietpi-services' -alias dietpi-config='/DietPi/dietpi/dietpi-config' -alias dietpi-software='/DietPi/dietpi/dietpi-software' -alias dietpi-update='/DietPi/dietpi/dietpi-update' -alias dietpi-drive_manager='/DietPi/dietpi/dietpi-drive_manager' -alias emulationstation='/opt/retropie/supplementary/emulationstation/emulationstation' -alias opentyrian='/usr/local/games/opentyrian/run' - -alias cpu='/DietPi/dietpi/dietpi-cpuinfo' -alias dietpi-logclear='/DietPi/dietpi/dietpi-logclear' -treesize() -{ - du -k --max-depth=1 | sort -nr | awk ' - BEGIN { - split("KB,MB,GB,TB", Units, ","); - } - { - u = 1; - while (\$1 >= 1024) - { - \$1 = \$1 / 1024; - u += 1; - } - \$1 = sprintf("%.1f %s", \$1, Units[u]); - print \$0; - } - ' -} -_EOF_ - Error_Check - - # - login, - sed -i '/DietPi/d' /root/.bashrc #prevents dupes - cat << _EOF_ >> /root/.bashrc -/DietPi/dietpi/login -. /DietPi/dietpi/func/dietpi-globals -_EOF_ - - Error_Check - dietpi-notify 2 "Configuring fakehwclock:" # - allow times in the past @@ -1410,10 +1155,6 @@ _EOF_ rm /var/lib/ntp/ntp.drift &> /dev/null - dietpi-notify 2 'Creating DietPi default user' - - /DietPi/dietpi/func/dietpi-set_software useradd dietpi - dietpi-notify 2 'Resetting DietPi generated globals/files' rm /DietPi/dietpi/.* diff --git a/dietpi/dietpi-autostart b/dietpi/dietpi-autostart index 7dece6ebb3..22c128bbc6 100644 --- a/dietpi/dietpi-autostart +++ b/dietpi/dietpi-autostart @@ -72,14 +72,14 @@ cat << _EOF_ > /etc/systemd/system/dietpi-autostart_custom.service [Unit] -Description=DietPi autostart (Custom /etc/dietpi/autostart.sh) +Description=DietPi autostart (Custom /var/lib/dietpi/dietpi-autostart/custom.sh) After=dietpi-boot.service dietpi-ramdisk.service dietpi-ramlog.service rc-local.service Requires=dietpi-boot.service dietpi-ramdisk.service [Service] Type=idle ExecStartPre=/bin/bash /DietPi/dietpi/func/dietpi-notify 0 'Starting DietPi-Autostart (Custom) script' -ExecStart=/bin/bash -c /etc/dietpi/autostart.sh +ExecStart=/bin/bash -c /var/lib/dietpi/dietpi-autostart/custom.sh StandardOutput=tty RemainAfterExit=yes @@ -174,7 +174,7 @@ _EOF_ '13' 'AmiBerry SDL2: Standard boot' '10' 'CAVA Spectrum' '11' 'Chromium: Without desktop' - '14' 'Custom: /etc/dietpi/autostart.sh' + '14' 'Custom: /var/lib/dietpi/dietpi-autostart/custom.sh' '2' 'Desktops: Automatic login (recommended)' '16' 'Desktops: LightDM login prompt' '5' 'DietPi-Cloudshell' @@ -206,9 +206,10 @@ _EOF_ if (( $OPTION == 14 )); then # create template - if [ ! -f /etc/dietpi/autostart.sh ]; then + if [ ! -f /var/lib/dietpi/dietpi-autostart/custom.sh ]; then - cat << _EOF_ > /etc/dietpi/autostart.sh + mkdir -p /var/lib/dietpi/dietpi-autostart + cat << _EOF_ > /var/lib/dietpi/dietpi-autostart/custom.sh #!/bin/bash #---Examples--- @@ -225,9 +226,11 @@ _EOF_ _EOF_ + chmod +x /var/lib/dietpi/dietpi-autostart/custom.sh + # Service - whiptail --title "Custom: /etc/dietpi/autostart.sh" --msgbox "A template script has been created:\n - /etc/dietpi/autostart.sh\n\nPlease edit this file and enter the required commands you wish to launch. DietPi will then execute this script during boot." --backtitle "$WHIP_BACKTITLE" 14 70 + whiptail --title "Custom: /var/lib/dietpi/dietpi-autostart/custom.sh" --msgbox "A template script has been created:\n - /var/lib/dietpi/dietpi-autostart/custom.sh\n\nPlease edit this file and enter the required commands you wish to launch. DietPi will then execute this script during boot." --backtitle "$WHIP_BACKTITLE" 14 70 fi diff --git a/dietpi/dietpi-ramdisk b/dietpi/dietpi-ramdisk index 8ebd31fd28..267ffadc05 100644 --- a/dietpi/dietpi-ramdisk +++ b/dietpi/dietpi-ramdisk @@ -29,11 +29,13 @@ INPUT=0 if [[ $1 =~ ^-?[0-9]+$ ]]; then + INPUT=$1 + fi #Import DietPi-Globals --------------------------------------------------------------- - #. /DietPi/dietpi/func/dietpi-globals + #. /DietPi/dietpi/func/dietpi-globals # Not compatible until dietpi-boot.service #Import DietPi-Globals --------------------------------------------------------------- FILEPATH_RAM="/DietPi" @@ -51,8 +53,6 @@ #Main Loop #///////////////////////////////////////////////////////////////////////////////////// - #/var/lib/dietpi/logs/dietpi-ramdisk.log - #Copy to Ram if (( $INPUT == 0 )); then diff --git a/dietpi/dietpi-ramlog b/dietpi/dietpi-ramlog index 0ce4c951dd..5707a18695 100644 --- a/dietpi/dietpi-ramlog +++ b/dietpi/dietpi-ramlog @@ -32,7 +32,7 @@ fi #Import DietPi-Globals --------------------------------------------------------------- - #. /DietPi/dietpi/func/dietpi-globals + #. /DietPi/dietpi/func/dietpi-globals # Not compatible until dietpi-boot.service #Import DietPi-Globals --------------------------------------------------------------- FILEPATH_DIETPI_RAMLOG_SAVE='/var/lib/dietpi/dietpi-ramlog_store' @@ -95,7 +95,7 @@ rm -R "$FILEPATH_DIETPI_RAMLOG_SAVE" #Generate Storage Directory - mkdir -p "$FILEPATH_DIETPI_RAMLOG_SAVE" &> /dev/null + mkdir -p "$FILEPATH_DIETPI_RAMLOG_SAVE" #Copy logfile attributes and ownership to storage (not file contents) cp -R -p --attributes-only /var/log/* "$FILEPATH_DIETPI_RAMLOG_SAVE"/ diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index ae1ddcd999..d4558475fa 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -84,9 +84,11 @@ fi #----------------------------------------------------------------------------------- - # DietPi User-Data + # DietPi specific directories #----------------------------------------------------------------------------------- FP_DIETPI_USERDATA='/mnt/dietpi_userdata' + #FP_DIETPI_VAR_LIB='/var/lib/dietpi' + #FP_DIETPI_VAR_TMP='/var/tmp/dietpi' #----------------------------------------------------------------------------------- # APT diff --git a/dietpi/func/dietpi-set_env b/dietpi/func/dietpi-set_env new file mode 100644 index 0000000000..424d6b80b5 --- /dev/null +++ b/dietpi/func/dietpi-set_env @@ -0,0 +1,395 @@ +#!/bin/bash +{ + #//////////////////////////////////// + # DietPi Function: + # - Configures core/basic folders/permissions/services etc for DietPi a environment + # + #//////////////////////////////////// + # Created by Daniel Knight / daniel.knight@dietpi.com / dietpi.com + # + #//////////////////////////////////// + # + # Info: + # - Script does not require a DietPi ready system to exec, can be used in PREP_SYSTEM + # - DietPi sourcecode must exist in /boot or /DietPi + # - Not everything for the DietPi env is contained here, only the core/critial stuff, to prevent dupe code in patches/PREP_SYSTEM + # + # Usage: + # - /boot/dietpi/func/dietpi-set_core_environment + # - /DietPi/dietpi/func/dietpi-set_core_environment + #//////////////////////////////////// + + #Import DietPi-Globals ------------------------------------------------------------- + #. $FP_SCRIPTS/dietpi/func/dietpi-globals # Not required/compatible + #Import DietPi-Globals ------------------------------------------------------------- + + if (( $UID != 0 )); then + + echo -e 'Error: Root privileges required. Please run the command with "sudo"\n' + exit 1 + + fi + + FP_SCRIPTS='/boot' + if [ -d /DietPi ]; then + + FP_SCRIPTS='/DietPi' + + fi + + DIETPI_USERNAME='dietpi' + DIETPI_PASSWORD='dietpi' + + #Near copy of useradd in dietpi-set_software, however, to support use in non-dietpi ready system, we manually need it here. + Create_DietPi_User(){ + + mkdir -p /home + useradd -m -s /bin/bash "$DIETPI_USERNAME" + chpasswd <<< "$DIETPI_USERNAME:$DIETPI_PASSWORD" + + # Copy existing profile/bashrc + cp /root/.profile /home/$DIETPI_USERNAME/ + cp /root/.bashrc /home/$DIETPI_USERNAME/ + + # Sudo up dietpi login script + sed -i '/^\/DietPi\/dietpi\/login/c\sudo \/DietPi\/dietpi\/login' /home/$DIETPI_USERNAME/.bashrc + + chown -R $DIETPI_USERNAME:$DIETPI_USERNAME /home/$DIETPI_USERNAME + + # Allow sudo without pw + if (( ! $(cat /etc/sudoers | grep -ci -m1 "^$DIETPI_USERNAME[[:space:]]") )); then + + cat << _EOF_ >> /etc/sudoers +$DIETPI_USERNAME ALL=NOPASSWD: ALL +_EOF_ + + fi + + # 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 + + usermod -a -G ${group_array[$i]} $DIETPI_USERNAME &> /dev/null + + done + + unset group_array + + } + + #/////////////////////////////////////////////////////////////////////////////////// + # Main Loop + #/////////////////////////////////////////////////////////////////////////////////// + $FP_SCRIPTS/dietpi/func/dietpi-notify 0 "Creating core DietPi environment, please wait..." + + #----------------------------------------------------------------------------------- + #Bash + + $FP_SCRIPTS/dietpi/func/dietpi-notify 2 "Configuring .bashrc:" + + sed -i '/DietPi/d' /root/.bashrc + cat << _EOF_ >> /root/.bashrc +/DietPi/dietpi/login +. /DietPi/dietpi/func/dietpi-globals +_EOF_ + + $FP_SCRIPTS/dietpi/func/dietpi-notify 2 "Configuring /etc/bash.bashrc:" + + sed -i '/#DietPi_Entries/,$d' /etc/bash.bashrc + sed -i '/LANG=/,$d' /etc/bash.bashrc # pre v160 images + cat << _EOF_ >> /etc/bash.bashrc +#DietPi_Entries +# - LANG +export \$(cat /etc/default/locale | grep LANG=) + +# - Define a default LD_LIBRARY_PATH for all systems +export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/opt/vc/lib + +# - DietPi Scripts +alias sudo='sudo ' # https://github.com/Fourdee/DietPi/issues/424 +alias dietpi-process_tool='/DietPi/dietpi/dietpi-process_tool' +alias dietpi-letsencrypt='/DietPi/dietpi/dietpi-letsencrypt' +alias dietpi-autostart='/DietPi/dietpi/dietpi-autostart' +alias dietpi-cron='/DietPi/dietpi/dietpi-cron' +alias dietpi-launcher='/DietPi/dietpi/dietpi-launcher' +alias dietpi-cleaner='/DietPi/dietpi/dietpi-cleaner' +alias dietpi-morsecode='/DietPi/dietpi/dietpi-morsecode' +alias dietpi-sync='/DietPi/dietpi/dietpi-sync' +alias dietpi-backup='/DietPi/dietpi/dietpi-backup' +alias dietpi-bugreport='/DietPi/dietpi/dietpi-bugreport' +alias dietpi-services='/DietPi/dietpi/dietpi-services' +alias dietpi-config='/DietPi/dietpi/dietpi-config' +alias dietpi-software='/DietPi/dietpi/dietpi-software' +alias dietpi-update='/DietPi/dietpi/dietpi-update' +alias dietpi-drive_manager='/DietPi/dietpi/dietpi-drive_manager' +alias emulationstation='/opt/retropie/supplementary/emulationstation/emulationstation' +alias opentyrian='/usr/local/games/opentyrian/run' + +alias cpu='/DietPi/dietpi/dietpi-cpuinfo' +alias dietpi-logclear='/DietPi/dietpi/dietpi-logclear' + +# - Treesize +treesize() +{ + du -k --max-depth=1 | sort -nr | awk ' + BEGIN { + split("KB,MB,GB,TB", Units, ","); + } + { + u = 1; + while (\$1 >= 1024) + { + \$1 = \$1 / 1024; + u += 1; + } + \$1 = sprintf("%.1f %s", \$1, Units[u]); + print \$0; + } + ' +} +_EOF_ + + #----------------------------------------------------------------------------------- + #Create_DietPi_User + + $FP_SCRIPTS/dietpi/func/dietpi-notify 2 'Creating DietPi User Account:' + + Create_DietPi_User + + #----------------------------------------------------------------------------------- + #UID bit for sudo + # - https://github.com/Fourdee/DietPi/issues/794 + + $FP_SCRIPTS/dietpi/func/dietpi-notify 2 'Configuring Sudo UID bit:' + + chmod 4755 $(which sudo) + + #----------------------------------------------------------------------------------- + #Dir's + + $FP_SCRIPTS/dietpi/func/dietpi-notify 2 'Configuring DietPi Directories:' + + # - /etc/dietpi , in process of moving this over to /var/lib/dietpi and /var/tmp/dietpi + mkdir -p /etc/dietpi + + # - /var/lib/dietpi : Core storage for installed non-standard APT software, outside of /mnt/dietpi_userdata + mkdir -p /var/lib/dietpi + chown dietpi:dietpi /var/lib/dietpi + chmod 660 /var/lib/dietpi + + # -/var/tmp/dietpi : Temp storage saved during reboots, eg: logs outside of /var/log + mkdir -p /var/tmp/dietpi/logs + chown dietpi:dietpi /var/tmp/dietpi + chmod 660 /var/tmp/dietpi + + # - /DietPi RAMdisk + mkdir -p /DietPi + chown dietpi:dietpi /DietPi + chmod 660 /DietPi + + # - /mnt/dietpi_userdata : DietPi userdata + mkdir -p /mnt/dietpi_userdata + chown dietpi:dietpi /mnt/dietpi_userdata + chmod 660 /mnt/dietpi_userdata + + # - Networked drives + mkdir -p /mnt/samba + mkdir -p /mnt/ftp_client + mkdir -p /mnt/nfs_client + + #----------------------------------------------------------------------------------- + #Services + + $FP_SCRIPTS/dietpi/func/dietpi-notify 2 'Configuring DietPi Services:' + + cat << _EOF_ > /etc/systemd/system/dietpi-ramdisk.service +[Unit] +Description=DietPi-RAMdisk +Before=rsyslog.service syslog.service +After=local-fs.target + +[Service] +Type=forking +RemainAfterExit=yes +ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramdisk 0 | tee -a /var/tmp/dietpi/logs/dietpi-ramdisk.log' +ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramdisk 1 | tee -a /var/tmp/dietpi/logs/dietpi-ramdisk.log' + +[Install] +WantedBy=local-fs.target +_EOF_ + systemctl daemon-reload + systemctl enable dietpi-ramdisk.service + + cat << _EOF_ > /etc/systemd/system/dietpi-ramlog.service +[Unit] +Description=DietPi-RAMlog +Before=rsyslog.service syslog.service +After=local-fs.target + +[Service] +Type=forking +RemainAfterExit=yes +ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramlog 0' +ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramlog 1' + +[Install] +WantedBy=local-fs.target +_EOF_ + systemctl daemon-reload + systemctl enable dietpi-ramlog.service + + cat << _EOF_ > /etc/systemd/system/dietpi-boot.service +[Unit] +Description=DietPi-Boot +After=network-online.target network.target networking.service dietpi-ramdisk.service dietpi-ramlog.service +Requires=dietpi-ramdisk.service + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/bin/bash -c '/DietPi/dietpi/boot' +StandardOutput=tty + +[Install] +WantedBy=multi-user.target +_EOF_ + systemctl enable dietpi-boot.service + systemctl daemon-reload + + update-rc.d -f rc.local remove &> /dev/null + rm /etc/init.d/rc.local &> /dev/null + rm /lib/systemd/system/rc-local.service &> /dev/null + cat << _EOF_ > /etc/systemd/system/rc-local.service +[Unit] +Description=/etc/rc.local Compatibility +After=dietpi-boot.service dietpi-ramdisk.service dietpi-ramlog.service +Requires=dietpi-boot.service dietpi-ramdisk.service + +[Service] +Type=idle +ExecStart=/etc/rc.local +StandardOutput=tty +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target +_EOF_ + systemctl enable rc-local.service + systemctl daemon-reload + + 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" +exit 0 +_EOF_ + chmod +x /etc/rc.local + systemctl daemon-reload + + 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 + +[Service] +Type=oneshot +ExecStart=/bin/bash -c 'killall sshd &> /dev/null; killall dropbear &> /dev/null' + +[Install] +WantedBy=poweroff.target halt.target reboot.target +_EOF_ + systemctl daemon-reload + systemctl enable kill-ssh-user-sessions-before-network + + #----------------------------------------------------------------------------------- + #Cron Jobs + + $FP_SCRIPTS/dietpi/func/dietpi-notify 2 "Configuring Cron:" + + cp $FP_SCRIPTS/dietpi/conf/cron.daily_dietpi /etc/cron.daily/dietpi + chmod +x /etc/cron.daily/dietpi + cp $FP_SCRIPTS/dietpi/conf/cron.hourly_dietpi /etc/cron.hourly/dietpi + chmod +x /etc/cron.hourly/dietpi + + cat << _EOF_ > /etc/crontab +#Please use dietpi-cron to change cron start times +SHELL=/bin/sh +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +# m h dom mon dow user command +17 * * * * root cd / && run-parts --report /etc/cron.hourly +25 1 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) +47 1 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) +52 1 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) +_EOF_ + + # - ntp + rm /etc/cron.daily/ntp &> /dev/null + + #----------------------------------------------------------------------------------- + #Network + + $FP_SCRIPTS/dietpi/func/dietpi-notify 2 "Configuring: Prefer wlan/eth naming for networked devices:" + + # - Prefer to use wlan/eth naming for networked devices (eg: stretch) + ln -sf /dev/null /etc/systemd/network/99-default.link + #??? x86_64 + # kernel cmd line with GRUB + # /etc/default/grub [replace] GRUB_CMDLINE_LINUX="net.ifnames=0" + # GRUB_TIMEOUT=0 + #??? + + #----------------------------------------------------------------------------------- + #MISC + + $FP_SCRIPTS/dietpi/func/dietpi-notify 2 "Disabling apt-daily services (prevents random APT cache lock):" + + systemctl mask apt-daily.service &> /dev/null + systemctl mask apt-daily-upgrade.timer &> /dev/null + + $FP_SCRIPTS/dietpi/func/dietpi-notify 2 "Setting vm.swappiness=1:" + + sed -i '/vm.swappiness=/d' /etc/sysctl.conf + echo -e "vm.swappiness=1" > /etc/sysctl.d/97-dietpi.conf + + #----------------------------------------------------------------------------------- + $FP_SCRIPTS/dietpi/func/dietpi-notify 0 "Completed DietPi core environment" + exit + #----------------------------------------------------------------------------------- +} \ No newline at end of file diff --git a/dietpi/patch_file b/dietpi/patch_file index c5fe11fa75..dbc0ffcf29 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2984,29 +2984,13 @@ _EOF_ fi #------------------------------------------------------------------------------- - #FHS logfiles: https://github.com/Fourdee/DietPi/issues/1297 - rm -R /etc/dietpi/dietpi-ramlog - mkdir -p /var/lib/dietpi/logs + #FHS changes: https://github.com/Fourdee/DietPi/issues/1297 + /DietPi/dietpi/func/dietpi-set_core_environment - # - Updated services - cat << _EOF_ > /etc/systemd/system/dietpi-ramdisk.service -[Unit] -Description=DietPi-RAMdisk -After=local-fs.target - -[Service] -Type=forking -RemainAfterExit=yes -ExecStartPre=/bin/mkdir -p /var/lib/dietpi/logs -ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramdisk 0 | tee -a /var/lib/dietpi/logs/dietpi-ramdisk.log' -ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramdisk 1 | tee -a /var/lib/dietpi/logs/dietpi-ramdisk.log' - -[Install] -WantedBy=local-fs.target -_EOF_ - systemctl daemon-reload - systemctl enable dietpi-ramdisk.service - #------------------------------------------------------------------------------- + # - DietPi-autostart custom script moved + mkdir -p /var/lib/dietpi/dietpi-autostart &> /dev/null + mv /etc/dietpi/autostart.sh /var/lib/dietpi/dietpi-autostart/custom.sh &> /dev/null + #------------------------------------------------------------------------------- fi From e96fc0aaa1bc9bbf12ecad41eb9c48eaf566af56 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 18 Dec 2017 07:03:08 +0000 Subject: [PATCH 065/390] v160 Correct name... --- dietpi/func/{dietpi-set_env => dietpi-set_core_environment} | 5 +++++ 1 file changed, 5 insertions(+) rename dietpi/func/{dietpi-set_env => dietpi-set_core_environment} (98%) diff --git a/dietpi/func/dietpi-set_env b/dietpi/func/dietpi-set_core_environment similarity index 98% rename from dietpi/func/dietpi-set_env rename to dietpi/func/dietpi-set_core_environment index 424d6b80b5..ed1958f51e 100644 --- a/dietpi/func/dietpi-set_env +++ b/dietpi/func/dietpi-set_core_environment @@ -197,6 +197,11 @@ _EOF_ chown dietpi:dietpi /var/lib/dietpi chmod 660 /var/lib/dietpi + # Storage locations for program specifc additional data + mkdir -p /var/lib/dietpi/dietpi-autostart + mkdir -p /var/lib/dietpi/dietpi-config + mkdir -p /var/lib/dietpi/dietpi-software + # -/var/tmp/dietpi : Temp storage saved during reboots, eg: logs outside of /var/log mkdir -p /var/tmp/dietpi/logs chown dietpi:dietpi /var/tmp/dietpi From 2c9b5b3fe094fbba3a2c4dcbf9d0ca8764821c01 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 18 Dec 2017 07:05:58 +0000 Subject: [PATCH 066/390] v160 + minor fix --- dietpi/func/dietpi-set_core_environment | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index ed1958f51e..08d479fafe 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -31,7 +31,7 @@ fi FP_SCRIPTS='/boot' - if [ -d /DietPi ]; then + if [ -f /DietPi/dietpi/dietpi-software ]; then FP_SCRIPTS='/DietPi' From 3f09cdbd654766951c0a12a34ce09aee55505242 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 18 Dec 2017 07:13:49 +0000 Subject: [PATCH 067/390] v160 + minor : https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- dietpi/dietpi-drive_manager | 9 +++++++-- dietpi/func/dietpi-globals | 11 +++++++++-- dietpi/func/dietpi-set_core_environment | 2 +- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 82a34f90be..2e6a652b75 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -886,7 +886,7 @@ _EOF_ fi - $FP_SCRIPTS/dietpi/func/dietpi-notify 2 "Tweaking DHCP timeout:" + dietpi-notify 2 "Tweaking DHCP timeout:" # - Reduce DHCP request retry count and timeouts: https://github.com/Fourdee/DietPi/issues/711 sed -i '/^#timeout /d' /etc/dhcp/dhclient.conf diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 13b49d4a3d..12b94498ef 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -29,8 +29,13 @@ fi #Import DietPi-Globals --------------------------------------------------------------- - . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER + # - Avoid loading on non-dietpi system + if [ -f /DietPi/dietpi/func/dietpi-globals ]; then + + . /DietPi/dietpi/func/dietpi-globals + CHECK_ROOT_USER + + fi #Import DietPi-Globals --------------------------------------------------------------- EXIT_CODE=0 diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index d4558475fa..fb4bf489ee 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -15,7 +15,14 @@ # - . /DietPi/dietpi/func/dietpi-globals > for each script that uses these globals #//////////////////////////////////// - #/DietPi/dietpi/func/dietpi-notify 2 'Updating DietPi-Globals, please wait...' + #Non-configured DietPi system, simply exit. + if [ ! -f /DietPi/dietpi/func/dietpi-globals ]; then + + exit 0 + + fi + + /DietPi/dietpi/func/dietpi-notify 2 'Updating DietPi-Globals, please wait...' #----------------------------------------------------------------------------------- # Core var's, functions, environment checks. Used at start of all scripts. @@ -163,6 +170,6 @@ } #----------------------------------------------------------------------------------- - #/DietPi/dietpi/func/dietpi-notify 0 'DietPi-Globals\n' + /DietPi/dietpi/func/dietpi-notify 0 'DietPi-Globals\n' #----------------------------------------------------------------------------------- } diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index 08d479fafe..9602b70d1b 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -100,7 +100,7 @@ _EOF_ #/////////////////////////////////////////////////////////////////////////////////// # Main Loop #/////////////////////////////////////////////////////////////////////////////////// - $FP_SCRIPTS/dietpi/func/dietpi-notify 0 "Creating core DietPi environment, please wait..." + $FP_SCRIPTS/dietpi/func/dietpi-notify 2 "Creating core DietPi environment, please wait..." #----------------------------------------------------------------------------------- #Bash From 3b65b0a4542437df73a509e72c497d6067d0ad59 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 18 Dec 2017 07:21:53 +0000 Subject: [PATCH 068/390] v160 + minor https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 2e6a652b75..5f08737fc5 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -254,7 +254,9 @@ #------------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------------ + dietpi-notify 2 '-----------------------------------------------------------------------------------' dietpi-notify 0 'Step 0: Detecting existing DietPi system:' + dietpi-notify 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ if [ -f /DietPi/dietpi/.installed ]; then @@ -291,7 +293,9 @@ #------------------------------------------------------------------------------------------------ + dietpi-notify 2 '-----------------------------------------------------------------------------------' dietpi-notify 0 'Step 1: Initial prep to allow this script to function:' + dietpi-notify 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ dietpi-notify 2 'Updating APT:' @@ -307,7 +311,9 @@ Error_Check #------------------------------------------------------------------------------------------------ + dietpi-notify 2 '-----------------------------------------------------------------------------------' dietpi-notify 0 'Step 2: Hardware selection:' + dietpi-notify 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ WHIP_TITLE='Hardware selection:' @@ -365,7 +371,9 @@ echo -e "$HW_MODEL" > /etc/.dietpi_hw_model_identifier #------------------------------------------------------------------------------------------------ + dietpi-notify 2 '-----------------------------------------------------------------------------------' dietpi-notify 0 'Step 3: Distro selection / APT prep:' + dietpi-notify 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ WHIP_TITLE='Distro Selection:' @@ -476,7 +484,9 @@ _EOF_ #------------------------------------------------------------------------------------------------ + dietpi-notify 2 '-----------------------------------------------------------------------------------' dietpi-notify 0 'Step 4: APT removals:' + dietpi-notify 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ # - DietPi list of minimal required packages which must be installed: @@ -623,7 +633,9 @@ _EOF_ #------------------------------------------------------------------------------------------------ + dietpi-notify 2 '-----------------------------------------------------------------------------------' dietpi-notify 0 'Step 5: APT Installations:' + dietpi-notify 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ dietpi-notify 2 "Upgrading existing APT installed packages:" @@ -686,7 +698,9 @@ _EOF_ rm /etc/apt/apt-conf.d/99dietpi_norecommends &> /dev/null #------------------------------------------------------------------------------------------------ + dietpi-notify 2 '-----------------------------------------------------------------------------------' dietpi-notify 0 'Step 6: Downloading and installing DietPi sourcecode' + dietpi-notify 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ INTERNET_ADDRESS='https://github.com/Fourdee/DietPi/archive/testing.zip' #NB: testing until this is stable in master @@ -752,7 +766,9 @@ _EOF_ Error_Check #------------------------------------------------------------------------------------------------ + dietpi-notify 2 '-----------------------------------------------------------------------------------' dietpi-notify 0 "Step 7: Prep system for DietPi ENV:" + dietpi-notify 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ dietpi-notify 2 "Deleting list of known users, not required by DietPi" @@ -1047,7 +1063,9 @@ _EOF_ #------------------------------------------------------------------------------------------------ + dietpi-notify 2 '-----------------------------------------------------------------------------------' dietpi-notify 0 "Step 8: Finalise system for first run of DietPi:" + dietpi-notify 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ dietpi-notify 2 'Installing Dropbear by default' From d94176ca567057969862c2b0c44cbe4bafc8dc4a Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 18 Dec 2017 07:26:34 +0000 Subject: [PATCH 069/390] v160 + log location correction: https://github.com/Fourdee/DietPi/issues/1297 --- CHANGELOG.txt | 6 +++--- PREP_SYSTEM_FOR_DIETPI.sh | 6 +++--- dietpi/dietpi-bugreport | 2 +- dietpi/dietpi-update | 2 +- dietpi/func/dietpi-globals | 2 +- dietpi/login | 2 +- dietpi/patch_file | 8 ++++---- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d784b5b2ce..17df9968f4 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -48,8 +48,8 @@ DietPi-Config | WiFi: Now uses the wpa_supplicant.conf method to setup WiFi conn DietPi-Backup | "Full Backup" Mode is now the default for fresh DietPi installations. This is mainly due to MySQL data now being in the DietPi userdata directory. DietPi-Config | Tools > Benchmarks: Added ability to benchmark CPU performance based on bash + integer: https://github.com/Fourdee/DietPi/issues/1253#issuecomment-346881878 DietPi-Config | Time sync modes: NTP is now uninstalled when SystemD timedatectl is enabled. Reinstalled on demand. Timedatectl pool servers are now also set: https://github.com/Fourdee/DietPi/issues/1208#issuecomment-343762480 -DietPi-Software | First run setup, now logged to /var/lib/dietpi/logs/dietpi-firstrun-setup.log. -DietPi-Software | APT log: Moved to /var/lib/dietpi/logs/dietpi-software_apt.log, to prevent RAMlog clearing log during automated installations. +DietPi-Software | First run setup, now logged to /var/tmp/dietpi/logs/dietpi-firstrun-setup.log. +DietPi-Software | APT log: Moved to /var/tmp/dietpi/logs/dietpi-software_apt.log, to prevent RAMlog clearing log during automated installations. DietPi-Software | MPD (Stretch): Install updated to 0.20.11. Also supports native DSD playback (thanks to @sudeep and PJotr), when "Native" output freq/bit is set: https://github.com/Fourdee/DietPi/issues/1236 DietPi-Software | moOde: MPD now installed via pre-built binaries. Will reduce install time: https://github.com/Fourdee/DietPi/issues/1223#issuecomment-345265290 DietPi-Software | Nextcloud: Large installation rework, featuring redis file locking, system cron jobs, automatic maintenance, optimized webserver stack configs and others: https://github.com/Fourdee/DietPi/issues/1067 @@ -136,7 +136,7 @@ General | Improved notifications for when DietPi is installing system with autom General | DietPi RPi Kernel: Updated to 4.9.52 General | RPi Stretch: Updated, matching official release of 2017-09-07-raspbian-stretch-lite General | DietPi-Automation: "AUTO_Global_Password=" in "dietpi.txt" will also be applied to the "dietpi" user account. Please note this will only take effect on v157 and higher DietPi images, due to "boot" script requiring an update: https://github.com/Fourdee/DietPi/issues/1134 -DietPi-Update | Added logging for updates > /var/lib/dietpi/logs/dietpi-update.log +DietPi-Update | Added logging for updates > /var/tmp/dietpi/logs/dietpi-update.log DietPi-LetsEncrypt | Added support for Nginx on Stretch. Many thanks to @Bridouz for contributing this: https://github.com/Fourdee/DietPi/pull/1166 DietPi-Software | Apache2 + NextCloud: Various optimizations. For new installations only. Many thanks to @MichaIng for this contribution: https://github.com/Fourdee/DietPi/issues/1067 DietPi-Software | Allo Web Interface: Hidden from software list for now, please use pre-made images: http://dietpi.com/phpbb/viewtopic.php?f=8&t=2317#p8868 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 5f08737fc5..5207f51cb8 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1217,7 +1217,7 @@ Before=dietpi-ramdisk.service [Service] Type=oneshot RemainAfterExit=no -ExecStart=/bin/bash -c '/etc/dietpi/fs_partition_resize.sh | tee /var/lib/dietpi/logs/fs_partition_resize.log' +ExecStart=/bin/bash -c '/etc/dietpi/fs_partition_resize.sh | tee /var/tmp/dietpi/logs/fs_partition_resize.log' StandardOutput=tty [Install] @@ -1279,7 +1279,7 @@ Before=dietpi-ramdisk.service [Service] Type=oneshot RemainAfterExit=no -ExecStart=/bin/bash -c "resize2fs \$(findmnt / -o source -n) | tee /var/lib/dietpi/logs/fs_expand.log; systemctl disable dietpi-fs_expand.service; systemctl daemon-reload" +ExecStart=/bin/bash -c "resize2fs \$(findmnt / -o source -n) | tee /var/tmp/dietpi/logs/fs_expand.log; systemctl disable dietpi-fs_expand.service; systemctl daemon-reload" StandardOutput=tty [Install] @@ -1292,7 +1292,7 @@ _EOF_ # #debug # systemctl start dietpi-fs_partition_resize.service # systemctl status dietpi-fs_partition_resize.service -l - # cat /var/lib/dietpi/logs/fs_partition_resize.log + # cat /var/tmp/dietpi/logs/fs_partition_resize.log dietpi-notify 2 'Sync changes to disk and TRIM rootFS' diff --git a/dietpi/dietpi-bugreport b/dietpi/dietpi-bugreport index 1505bfc01f..3f779dd08e 100644 --- a/dietpi/dietpi-bugreport +++ b/dietpi/dietpi-bugreport @@ -123,7 +123,7 @@ _EOF_ # - DietPi scripts / logs "/DietPi/*" "/boot/*" - "/var/lib/dietpi/logs/*" + "/var/tmp/dietpi/logs/*" # - confs "/etc/X11/xorg.conf" diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index bfbdb86997..208827afa5 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -41,7 +41,7 @@ #///////////////////////////////////////////////////////////////////////////////////// #UPDATE Vars #///////////////////////////////////////////////////////////////////////////////////// - FP_LOG='/var/lib/dietpi/logs/dietpi-update.log' + FP_LOG='/var/tmp/dietpi/logs/dietpi-update.log' DIETPIUPDATE_VERSION_CURRENT=5 # Version of dietpi-update / set server_version line two to value++ and obsolete previous dietpi-update scripts DIETPIUPDATE_VERSION_REQUIRED=0 diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index fb4bf489ee..057acc77b7 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -100,7 +100,7 @@ #----------------------------------------------------------------------------------- # APT #----------------------------------------------------------------------------------- - FP_LOG_APT='/var/lib/dietpi/logs/dietpi-software_apt.log' + FP_LOG_APT='/var/tmp/dietpi/logs/dietpi-software_apt.log' EXITCODE_APT=0 #only way I found of exporting the exit code, once the command is run. #Support for apt-fast: https://github.com/Fourdee/DietPi/issues/698 diff --git a/dietpi/login b/dietpi/login index 23705a5ba0..e05d612ca6 100644 --- a/dietpi/login +++ b/dietpi/login @@ -34,7 +34,7 @@ HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) DIETPI_INSTALL_STAGE=$(cat /DietPi/dietpi/.install_stage) - FP_DIETPI_FIRSTRUNSETUP_LOG='/var/lib/dietpi/logs/dietpi-firstrun-setup.log' + FP_DIETPI_FIRSTRUNSETUP_LOG='/var/tmp/dietpi/logs/dietpi-firstrun-setup.log' #///////////////////////////////////////////////////////////////////////////////////// #DietPi-Autostart diff --git a/dietpi/patch_file b/dietpi/patch_file index dbc0ffcf29..1370db0f51 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2274,9 +2274,9 @@ After=local-fs.target [Service] Type=forking RemainAfterExit=yes -ExecStartPre=/bin/mkdir -p /var/lib/dietpi/logs -ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramdisk 0 &>> /var/lib/dietpi/logs/dietpi-ramdisk.log' -ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramdisk 1 &>> /var/lib/dietpi/logs/dietpi-ramdisk.log' +ExecStartPre=/bin/mkdir -p /var/tmp/dietpi/logs +ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramdisk 0 &>> /var/tmp/dietpi/logs/dietpi-ramdisk.log' +ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramdisk 1 &>> /var/tmp/dietpi/logs/dietpi-ramdisk.log' [Install] WantedBy=local-fs.target @@ -2519,7 +2519,7 @@ After=local-fs.target [Service] Type=forking RemainAfterExit=yes -ExecStartPre=/bin/mkdir -p /var/lib/dietpi/logs +ExecStartPre=/bin/mkdir -p /var/tmp/dietpi/logs ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramdisk 0' ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramdisk 1' From c0e92972cc21e7e7611f52721b1646f5db01363e Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 18 Dec 2017 07:47:58 +0000 Subject: [PATCH 070/390] v160 https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352345816 --- dietpi/func/dietpi-globals | 4 ++-- dietpi/func/dietpi-set_core_environment | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 057acc77b7..fc13b4a8a3 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -22,7 +22,7 @@ fi - /DietPi/dietpi/func/dietpi-notify 2 'Updating DietPi-Globals, please wait...' + #/DietPi/dietpi/func/dietpi-notify 2 'Updating DietPi-Globals, please wait...' #----------------------------------------------------------------------------------- # Core var's, functions, environment checks. Used at start of all scripts. @@ -170,6 +170,6 @@ } #----------------------------------------------------------------------------------- - /DietPi/dietpi/func/dietpi-notify 0 'DietPi-Globals\n' + #/DietPi/dietpi/func/dietpi-notify 0 'DietPi-Globals\n' #----------------------------------------------------------------------------------- } diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index 9602b70d1b..a62faa6fc4 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -202,7 +202,7 @@ _EOF_ mkdir -p /var/lib/dietpi/dietpi-config mkdir -p /var/lib/dietpi/dietpi-software - # -/var/tmp/dietpi : Temp storage saved during reboots, eg: logs outside of /var/log + # - /var/tmp/dietpi : Temp storage saved during reboots, eg: logs outside of /var/log mkdir -p /var/tmp/dietpi/logs chown dietpi:dietpi /var/tmp/dietpi chmod 660 /var/tmp/dietpi From 93244bf957e061cfbeb73626161caeaffc930ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Loureiro?= Date: Mon, 18 Dec 2017 16:36:10 +0000 Subject: [PATCH 071/390] Small update to dietpi-service help dialog --- dietpi/dietpi-services | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index f87498de6d..43b9595f65 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -14,7 +14,7 @@ # - /DietPi/dietpi/dietpi-services $AVAILABLE_OPTIONS #//////////////////////////////////// AVAILABLE_OPTIONS=' - - start/stop/restart (all services, known to DietPi) + - start/stop/restart/status (all services, known to DietPi) - start/stop/restart servicename (single service, SystemD) - systemd_controlled/dietpi_controlled (all services, known to DietPi) - enable/disable servicename (single service, SystemD) From 84cc5ec4b1398f8d121c612784ce3c3b3ffc6166 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 19 Dec 2017 04:45:32 +0100 Subject: [PATCH 072/390] DietPi-Software | ownCloud/Nextcloud: Remove -p option on MariaDB command ... as on Jessie, MariaDB (with unix_socket authentication enabled) does not only ignore the password, but denies access, if password option is used. --- dietpi/dietpi-software | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 9e52384483..458d9d2a9d 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9313,9 +9313,11 @@ _EOF_ fi systemctl start mysql # For MariaDB, temporary database admin user needs to be created, as 'root' uses unix_socket login, which cannot be accessed by sudo -u www-data. - mysql -uroot -p"$GLOBAL_PW" -e "grant all privileges on *.* to 'tmp_root'@'localhost' identified by '$GLOBAL_PW' with grant option" + local mysql_cmd='mysql -uroot' + (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 )) && mysql_cmd+=" -p$GLOBAL_PW" + $mysql_cmd -e "grant all privileges on *.* to 'tmp_root'@'localhost' identified by '$GLOBAL_PW' with grant option" grep -q "'installed' => true," $config_php 2>/dev/null || occ maintenance:install --no-interaction --database "mysql" --database-name "owncloud" --database-user "tmp_root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$FP_DIETPI_USERDATA/owncloud_data" - mysql -uroot -p"$GLOBAL_PW" -e "drop user 'tmp_root'@'localhost'" + $mysql_cmd -e "drop user 'tmp_root'@'localhost'" # Enable MySQL 4-byte support for new installations only, to prevent risky database conversion tasks: if (( $oc_is_fresh == 1 )); then @@ -9486,9 +9488,11 @@ _EOF_ fi systemctl start mysql # For MariaDB, temporary database admin user needs to be created, as 'root' uses unix_socket login, which cannot be accessed by sudo -u www-data. - mysql -uroot -p"$GLOBAL_PW" -e "grant all privileges on *.* to 'tmp_root'@'localhost' identified by '$GLOBAL_PW' with grant option" + local mysql_cmd='mysql -uroot' + (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 )) && mysql_cmd+=" -p$GLOBAL_PW" + $mysql_cmd -e "grant all privileges on *.* to 'tmp_root'@'localhost' identified by '$GLOBAL_PW' with grant option" grep -q "'installed' => true," $config_php 2>/dev/null || ncc maintenance:install --no-interaction --database "mysql" --database-name "nextcloud" --database-user "tmp_root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$FP_DIETPI_USERDATA/nextcloud_data" - mysql -uroot -p"$GLOBAL_PW" -e "drop user 'tmp_root'@'localhost'" + $mysql_cmd -e "drop user 'tmp_root'@'localhost'" # Enable MySQL 4-byte support for new installations only, to prevent risky database conversion tasks: if (( $nc_is_fresh == 1 )); then @@ -13370,10 +13374,12 @@ _EOF_ rm /etc/nginx/sites-dietpi/owncloud.config 2>/dev/null # Drop MySQL/MariaDB user and database systemctl start mysql - mysql -uroot -p"$GLOBAL_PW" -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")@$(grep -m1 "'dbhost'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" - mysql -uroot -p"$GLOBAL_PW" -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" - mysqldump --lock-tables -uroot -p"$GLOBAL_PW" owncloud > "$FP_DIETPI_USERDATA"/owncloud_data/mysql_backup.sql - mysqladmin -u root -p"$GLOBAL_PW" drop owncloud -f + local mysql_auth='-uroot' + (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 )) && mysql_auth+=" -p$GLOBAL_PW" + mysql "$mysql_auth" -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")@$(grep -m1 "'dbhost'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" + mysql "$mysql_auth" -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" + mysqldump --lock-tables "$mysql_auth" owncloud > "$FP_DIETPI_USERDATA"/owncloud_data/mysql_backup.sql + mysqladmin "$mysql_auth" drop owncloud -f # Purge APT package AGP_ERROR_CHECKED owncloud-files owncloud owncloud-deps # Remove ownCloud installation folder @@ -13393,10 +13399,12 @@ _EOF_ rm /etc/nginx/sites-dietpi/nextcloud.config 2>/dev/null # Drop MySQL/MariaDB user and database systemctl start mysql - 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/,//")" - mysql -uroot -p"$GLOBAL_PW" -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" - mysqldump --lock-tables -uroot -p"$GLOBAL_PW" nextcloud > "$FP_DIETPI_USERDATA"/nextcloud_data/mysql_backup.sql - mysqladmin -u root -p"$GLOBAL_PW" drop nextcloud -f + local mysql_auth='-uroot' + (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 )) && mysql_auth+=" -p$GLOBAL_PW" + mysql "$mysql_auth" -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/,//")" + mysql "$mysql_auth" -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" + mysqldump --lock-tables "$mysql_auth" nextcloud > "$FP_DIETPI_USERDATA"/nextcloud_data/mysql_backup.sql + mysqladmin "$mysql_auth" drop nextcloud -f # Remove Nextcloud installation folder rm -R /var/www/nextcloud From e28a6cd30b146f677c47d3c07b4da835feecb953 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 19 Dec 2017 05:42:24 +0000 Subject: [PATCH 073/390] v160 + AGX rollout + dietpi-notify rollout https://github.com/Fourdee/DietPi/issues/1311#issuecomment-352638142 --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- dietpi/boot | 6 +- dietpi/dietpi-autostart | 2 +- dietpi/dietpi-backup | 44 ++--- dietpi/dietpi-bugreport | 2 +- dietpi/dietpi-cleaner | 2 +- dietpi/dietpi-cloudshell | 2 +- dietpi/dietpi-config | 57 +++--- dietpi/dietpi-cpu_set | 20 +- dietpi/dietpi-cpuinfo | 2 +- dietpi/dietpi-drive_manager | 68 +++---- dietpi/dietpi-letsencrypt | 14 +- dietpi/dietpi-logclear | 8 +- dietpi/dietpi-process_tool | 10 +- dietpi/dietpi-ramdisk | 6 +- dietpi/dietpi-services | 20 +- dietpi/dietpi-software | 245 ++++++++++++------------ dietpi/dietpi-sync | 4 +- dietpi/dietpi-update | 55 +++--- dietpi/func/check_connection | 6 +- dietpi/func/create_mysql_db | 4 +- dietpi/func/dietpi-globals | 240 ++++++++++++++++++++--- dietpi/func/dietpi-led_control | 8 +- dietpi/func/dietpi-notify | 134 ------------- dietpi/func/dietpi-set_core_environment | 45 ++--- dietpi/func/dietpi-set_dphys-swapfile | 12 +- dietpi/func/dietpi-set_hardware | 70 +++---- dietpi/func/dietpi-set_software | 18 +- dietpi/func/dietpi-set_userdata | 26 +-- dietpi/func/run_ntpd | 18 +- dietpi/login | 6 +- dietpi/misc/dietpi-justboom | 6 +- dietpi/patch_file | 115 +++++------ 33 files changed, 656 insertions(+), 621 deletions(-) delete mode 100644 dietpi/func/dietpi-notify diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 5207f51cb8..b26c02702c 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -878,7 +878,7 @@ _EOF_ systemctl start dietpi-ramlog.service Error_Check - dietpi-notify 2 'Updating DietPi globals' + dietpi-notify 2 'Updating DietPi HW_INFO' /DietPi/dietpi/dietpi-obtain_hw_model diff --git a/dietpi/boot b/dietpi/boot index 5b8eef2fcd..77af3bcc31 100644 --- a/dietpi/boot +++ b/dietpi/boot @@ -196,18 +196,18 @@ if (( $loop_count >= $max_loops )); then - /DietPi/dietpi/func/dietpi-notify 1 "$(date) | Valid connection wait timed out." | tee -a "$FP_LOGFILE" + dietpi-notify 1 "$(date) | Valid connection wait timed out." | tee -a "$FP_LOGFILE" break elif (( ! $(route | awk '{print $4}' | grep -ci -m1 'UG') )); then - /DietPi/dietpi/func/dietpi-notify 2 "$(date) | Waiting for valid connection, before continuing boot | Mode=$boot_wait_for_network" | tee -a "$FP_LOGFILE" + dietpi-notify 2 "$(date) | Waiting for valid connection, before continuing boot | Mode=$boot_wait_for_network" | tee -a "$FP_LOGFILE" sleep 1 else # - Update network details (for IP in dietpi-banner etc..) - /DietPi/dietpi/func/dietpi-notify 0 "$(date) | Valid connection found." | tee -a "$FP_LOGFILE" + dietpi-notify 0 "$(date) | Valid connection found." | tee -a "$FP_LOGFILE" /DietPi/dietpi/func/obtain_network_details # Mount all drives again (eg: network shares) diff --git a/dietpi/dietpi-autostart b/dietpi/dietpi-autostart index 22c128bbc6..05e17d2227 100644 --- a/dietpi/dietpi-autostart +++ b/dietpi/dietpi-autostart @@ -78,7 +78,7 @@ Requires=dietpi-boot.service dietpi-ramdisk.service [Service] Type=idle -ExecStartPre=/bin/bash /DietPi/dietpi/func/dietpi-notify 0 'Starting DietPi-Autostart (Custom) script' +ExecStartPre=/bin/bash echo -e 'Starting DietPi-Autostart (Custom) script' ExecStart=/bin/bash -c /var/lib/dietpi/dietpi-autostart/custom.sh StandardOutput=tty RemainAfterExit=yes diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index e7886ee94a..b73a685cd7 100644 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -236,7 +236,7 @@ #///////////////////////////////////////////////////////////////////////////////////// Error_Filesystem_Not_Supported(){ - /DietPi/dietpi/func/dietpi-notify 1 "Filesystem not supported in $FP_TARGET_BACKUP" + dietpi-notify 1 "Filesystem not supported in $FP_TARGET_BACKUP" if (( $INPUT == 0 )); then whiptail --title "Error" --msgbox "$FP_TARGET_BACKUP Has a filesystem of: $TARGET_FILESYSTEM_TYPE, and is not supported.\n\nThe filesystem must be EXT2/3/4 for symlink compatibility." --backtitle "$WHIP_BACKTITLE" 11 70 @@ -246,7 +246,7 @@ Error_Not_Mnt_Directory(){ - /DietPi/dietpi/func/dietpi-notify 1 "Target directory is not inside /mnt ($FP_TARGET_BACKUP)" + dietpi-notify 1 "Target directory is not inside /mnt ($FP_TARGET_BACKUP)" if (( $INPUT == 0 )); then whiptail --title "Directory not supported" --msgbox "$FP_TARGET_BACKUP\n\nYour current location is not supported.\nThe location must be inside the /mnt/* directory.\n - eg: /mnt/dietpi-backup" --backtitle "$WHIP_BACKTITLE" 11 70 @@ -256,7 +256,7 @@ Error_DietpiUserdata_Directory(){ - /DietPi/dietpi/func/dietpi-notify 1 "Target directory can not be contained within DietPi user data location ($FP_TARGET_BACKUP)" + dietpi-notify 1 "Target directory can not be contained within DietPi user data location ($FP_TARGET_BACKUP)" if (( $INPUT == 0 )); then whiptail --title "Directory not supported" --msgbox "$FP_TARGET_BACKUP\n\nYour current location is not supported.\nTarget directory can not be contained within DietPi user data location (/mnt/dietpi_userdata)" --backtitle "$WHIP_BACKTITLE" 13 70 @@ -266,7 +266,7 @@ Error_Rsync_Already_Running(){ - /DietPi/dietpi/func/dietpi-notify 1 "Another Rsync process is already running." + dietpi-notify 1 "Another Rsync process is already running." echo -e "$RSYNC_MODE_TEXT failed: $(date +"%d-%m-%Y_%H%M"). Rsync is already running." >> "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_SYSTEM" #Menu @@ -278,7 +278,7 @@ Error_Rsync_Failed(){ - /DietPi/dietpi/func/dietpi-notify 1 "$RSYNC_MODE_TEXT failed." + dietpi-notify 1 "$RSYNC_MODE_TEXT failed." #Menu if (( $INPUT == 0 )); then @@ -425,7 +425,7 @@ _EOF_ RSYNC_MODE_TEXT="Backup" - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Backup "$RSYNC_MODE_TEXT" + dietpi-notify 3 DietPi-Backup "$RSYNC_MODE_TEXT" #Check valid FS Check_Supported_Directory_Location @@ -459,7 +459,7 @@ _EOF_ Services_Stop - /DietPi/dietpi/func/dietpi-notify 2 "Backing up to: $FP_TARGET_BACKUP" + dietpi-notify 2 "Backing up to: $FP_TARGET_BACKUP" BACKUP_RESTORE_FAILED=0 @@ -473,12 +473,12 @@ _EOF_ if (( $? == 0 )); then - /DietPi/dietpi/func/dietpi-notify 0 "$RSYNC_MODE_TEXT Completed.\n" + dietpi-notify 0 "$RSYNC_MODE_TEXT Completed.\n" echo -e "$RSYNC_MODE_TEXT Completed : $(Print_Date)" >> "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_SYSTEM" else - /DietPi/dietpi/func/dietpi-notify 1 "$RSYNC_MODE_TEXT FAILED.\n" + dietpi-notify 1 "$RSYNC_MODE_TEXT FAILED.\n" echo -e "$RSYNC_MODE_TEXT FAILED : $(Print_Date)" >> "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_SYSTEM" BACKUP_RESTORE_FAILED=1 break @@ -494,12 +494,12 @@ _EOF_ if (( $? == 0 )); then - /DietPi/dietpi/func/dietpi-notify 0 "$RSYNC_MODE_TEXT Completed.\n" + dietpi-notify 0 "$RSYNC_MODE_TEXT Completed.\n" echo -e "$RSYNC_MODE_TEXT Completed : $(Print_Date)" >> "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_USERDATA" else - /DietPi/dietpi/func/dietpi-notify 1 "$RSYNC_MODE_TEXT FAILED.\n" + dietpi-notify 1 "$RSYNC_MODE_TEXT FAILED.\n" echo -e "$RSYNC_MODE_TEXT FAILED : $(Print_Date)" >> "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_USERDATA" BACKUP_RESTORE_FAILED=1 break @@ -542,7 +542,7 @@ _EOF_ RSYNC_MODE_TEXT="Restore" - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Backup "$RSYNC_MODE_TEXT" + dietpi-notify 3 DietPi-Backup "$RSYNC_MODE_TEXT" #Check valid FS Check_Supported_Directory_Location @@ -553,8 +553,8 @@ _EOF_ #Error: Backup not found if [ ! -f "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_SYSTEM" ]; then - /DietPi/dietpi/func/dietpi-notify 2 "No Backup was found in $FP_TARGET_BACKUP" - /DietPi/dietpi/func/dietpi-notify 1 "$RSYNC_MODE_TEXT Failed.\n" + dietpi-notify 2 "No Backup was found in $FP_TARGET_BACKUP" + dietpi-notify 1 "$RSYNC_MODE_TEXT Failed.\n" if (( $INPUT == 0 )); then whiptail --title "$RSYNC_MODE_TEXT failed" --msgbox "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_SYSTEM does not exist\n\nHave you created a backup?" --backtitle "$WHIP_BACKTITLE" 11 70 fi @@ -572,7 +572,7 @@ _EOF_ Services_Stop - /DietPi/dietpi/func/dietpi-notify 2 "Restoring from: $FP_TARGET_BACKUP" + dietpi-notify 2 "Restoring from: $FP_TARGET_BACKUP" BACKUP_RESTORE_FAILED=0 @@ -585,12 +585,12 @@ _EOF_ rsync $RSYNC_RUN_OPTIONS_SYSTEM_BACKUP "$FP_TARGET_BACKUP"/dietpi-backup_system/ "$FP_SOURCE_SYSTEM" if (( $? == 0 )); then - /DietPi/dietpi/func/dietpi-notify 0 "$RSYNC_MODE_TEXT Completed.\n" + dietpi-notify 0 "$RSYNC_MODE_TEXT Completed.\n" echo -e "$RSYNC_MODE_TEXT Completed : $(Print_Date)" >> "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_SYSTEM" else - /DietPi/dietpi/func/dietpi-notify 1 "$RSYNC_MODE_TEXT FAILED.\n" + dietpi-notify 1 "$RSYNC_MODE_TEXT FAILED.\n" echo -e "$RSYNC_MODE_TEXT FAILED : $(Print_Date)" >> "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_SYSTEM" BACKUP_RESTORE_FAILED=1 break @@ -608,12 +608,12 @@ _EOF_ rsync $RSYNC_RUN_OPTIONS_USERDATA_BACKUP "$FP_TARGET_BACKUP"/dietpi-backup_userdata/ "$FP_SOURCE_USERDATA_ACTUAL"/ if (( $? == 0 )); then - /DietPi/dietpi/func/dietpi-notify 0 "$RSYNC_MODE_TEXT Completed.\n" + dietpi-notify 0 "$RSYNC_MODE_TEXT Completed.\n" echo -e "$RSYNC_MODE_TEXT Completed : $(Print_Date)" >> "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_USERDATA" else - /DietPi/dietpi/func/dietpi-notify 1 "$RSYNC_MODE_TEXT FAILED.\n" + dietpi-notify 1 "$RSYNC_MODE_TEXT FAILED.\n" echo -e "$RSYNC_MODE_TEXT FAILED : $(Print_Date)" >> "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_USERDATA" BACKUP_RESTORE_FAILED=1 break @@ -622,7 +622,7 @@ _EOF_ else - /DietPi/dietpi/func/dietpi-notify 2 "$RSYNC_MODE_TEXT: No backup exists, skipping...\n" + dietpi-notify 2 "$RSYNC_MODE_TEXT: No backup exists, skipping...\n" fi @@ -664,10 +664,10 @@ _EOF_ #Rsync if (( ! $(dpkg --get-selections | grep -ci -m1 '^rsync[[[:space:]]') )); then - /DietPi/dietpi/func/dietpi-notify 2 "Installing Rsync, please wait....\n" + dietpi-notify 2 "Installing Rsync, please wait....\n" sleep 1 - apt-get install rsync -y + AGI rsync fi diff --git a/dietpi/dietpi-bugreport b/dietpi/dietpi-bugreport index 3f779dd08e..8207b45125 100644 --- a/dietpi/dietpi-bugreport +++ b/dietpi/dietpi-bugreport @@ -283,7 +283,7 @@ _EOF_ # - upload to server else - /DietPi/dietpi/func/dietpi-notify 2 "Uploading bug report, please wait..." + dietpi-notify 2 "Uploading bug report, please wait..." wput --timeout=10th-4 --tries=1 --waitretry=2 -B -u "$FILE_GENERATED_ZIP" ftp://"$FTP_USER":"$FTP_PASS"@"$FTP_ADDR" BUG_REPORT_COMPLETED=1 diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index d5bc78cac6..c560047139 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -469,7 +469,7 @@ apt-get clean rm /var/lib/apt/lists/* -vf - apt-get update + AGUP fi diff --git a/dietpi/dietpi-cloudshell b/dietpi/dietpi-cloudshell index e60b75124c..c8b103dd51 100644 --- a/dietpi/dietpi-cloudshell +++ b/dietpi/dietpi-cloudshell @@ -459,7 +459,7 @@ #kill - /DietPi/dietpi/func/dietpi-notify 1 "DF failed, unable to obtain drive data" + dietpi-notify 1 "DF failed, unable to obtain drive data" sleep 2 kill $pid diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 47a59656c2..c152cf8656 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1317,7 +1317,7 @@ if (( $(dpkg -l | grep -ci -m1 'rpi-update') == 0 )); then echo -e "\n DietPi: Installing rpi-update, please wait...\n" - apt-get install -y rpi-update + AGI rpi-update fi @@ -1334,7 +1334,7 @@ CHOICE=$? if (( $CHOICE == 0 )); then - apt-get dist-upgrade -y + AGDUG fi @@ -1346,7 +1346,7 @@ CHOICE=$? if (( $CHOICE == 0 )); then - apt-get dist-upgrade -y + AGDUG fi @@ -2410,7 +2410,7 @@ _EOF_ #dhclient -r #Drop Connections - /DietPi/dietpi/func/dietpi-notify 2 "Dropping connections, please wait..." + dietpi-notify 2 "Dropping connections, please wait..." ifdown eth$ETH_INDEX &> /dev/null ifdown wlan$WIFI_INDEX &> /dev/null @@ -2431,7 +2431,7 @@ _EOF_ fi #Restart Networking - /DietPi/dietpi/func/dietpi-notify 2 'Restarting networking services, please wait...' + dietpi-notify 2 'Restarting networking services, please wait...' systemctl daemon-reload systemctl restart networking @@ -3405,19 +3405,19 @@ ADAPTER="wlan$WIFI_INDEX" TICKRATE=10 while true do -/DietPi/dietpi/func/dietpi-notify 2 "Checking connnection for: \$ADAPTER" +dietpi-notify 2 "Checking connnection for: \$ADAPTER" ping -I \$ADAPTER -c 1 \$URL_PING if (( \$? != 0 )); then -/DietPi/dietpi/func/dietpi-notify 2 "Detected connection loss: \$ADAPTER. Reconnecting" +dietpi-notify 2 "Detected connection loss: \$ADAPTER. Reconnecting" ifdown "\$ADAPTER" sleep 1 ifup "\$ADAPTER" -/DietPi/dietpi/func/dietpi-notify 0 'Completed' +dietpi-notify 0 'Completed' else -/DietPi/dietpi/func/dietpi-notify 0 "Connection \$ADAPTER" +dietpi-notify 0 "Connection \$ADAPTER" fi @@ -3881,9 +3881,9 @@ _EOF_ #Run benchmark if (( $run_benchmark == 1 )); then - /DietPi/dietpi/func/dietpi-notify 2 "Performing $text_info_test_name benchmark, please wait..." + dietpi-notify 2 "Performing $text_info_test_name benchmark, please wait..." - /DietPi/dietpi/func/dietpi-notify 2 "Testing Seq Write Speed ($benchmark_filesize MB)" + dietpi-notify 2 "Testing Seq Write Speed ($benchmark_filesize MB)" if (( $DISTRO == 3 )); then @@ -3898,7 +3898,7 @@ _EOF_ # - Clear cache sync echo 3 > /proc/sys/vm/drop_caches - /DietPi/dietpi/func/dietpi-notify 2 "Testing Seq Read Speed ($benchmark_filesize MB)" + dietpi-notify 2 "Testing Seq Read Speed ($benchmark_filesize MB)" if (( $DISTRO == 3 )); then @@ -3944,25 +3944,25 @@ _EOF_ # if (( ! $(dpkg --get-selections | grep -ci -m1 '^sysbench[[:space:]]') )); then - # /DietPi/dietpi/func/dietpi-notify 2 "Installing Sysbench, please wait..." - # apt-get install sysbench -y + # dietpi-notify 2 "Installing Sysbench, please wait..." + # AGI sysbench # fi /DietPi/dietpi/dietpi-services stop - # /DietPi/dietpi/func/dietpi-notify 0 "Running Sysbench with max prime of $CPUBENCH_INT_MAX, please wait..." + # dietpi-notify 0 "Running Sysbench with max prime of $CPUBENCH_INT_MAX, please wait..." # local fp_log_sysbench='/tmp/.fp_log_sysbench' # sysbench --test=cpu --num-threads=$(nproc --all) --cpu-max-prime=$CPUBENCH_INT_MAX --validate=on run | tee -a "$fp_log_sysbench" - # /DietPi/dietpi/func/dietpi-notify 0 "Sysbench completed" + # dietpi-notify 0 "Sysbench completed" # CPUBENCH_TIME=$(grep -m1 'total time' "$fp_log_sysbench" | awk '{print $NF}') # rm "$fp_log_sysbench" - /DietPi/dietpi/func/dietpi-notify 0 "Running DietPi-CPU Benchmark with max value of 1000000 over $(nproc --all) cores, please wait..." + dietpi-notify 0 "Running DietPi-CPU Benchmark with max value of 1000000 over $(nproc --all) cores, please wait..." cat << _EOF_ > /tmp/dietpi-bench #!/bin/bash @@ -4681,15 +4681,15 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ #install stress if (( ! $(dpkg --get-selections | grep -ci -m1 '^stress') )); then - /DietPi/dietpi/func/dietpi-notify 2 'Installing Stress' - /DietPi/dietpi/func/dietpi-notify 2 'Please wait...' + dietpi-notify 2 'Installing Stress' + dietpi-notify 2 'Please wait...' - apt-get install -y stress + AGI stress fi - /DietPi/dietpi/func/dietpi-notify 3 Stress_Test "Running stress test for $STRESS_TEST_DURATION seconds" - /DietPi/dietpi/func/dietpi-notify 2 'To terminate, type: killall -w stress' + dietpi-notify 3 Stress_Test "Running stress test for $STRESS_TEST_DURATION seconds" + dietpi-notify 2 'To terminate, type: killall -w stress' local start_time=$(date) local start_time_epoch=$(date +%s) @@ -4768,8 +4768,8 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ - Max Temp : $STRESS_TEST_RESULTS_TEMP_MAX 'c - log : $fp_log" - /DietPi/dietpi/func/dietpi-notify 0 'Stress Test Completed' - /DietPi/dietpi/func/dietpi-notify 2 "$output_string" + dietpi-notify 0 'Stress Test Completed' + dietpi-notify 2 "$output_string" whiptail --title "$WHIP_TITLE" --msgbox "Stress test results:\n$output_string" --backtitle "$WHIP_BACKTITLE" 14 65 @@ -5000,13 +5000,12 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ /DietPi/dietpi/func/dietpi-set_software apt-mirror $OPTION # - test it - /DietPi/dietpi/func/dietpi-notify 2 "Updating Apt, please wait..." + dietpi-notify 2 "Updating Apt, please wait..." - apt-get update - local result=$? - if (( $result != 0 )); then + AGUP + if (( $EXITCODE_APT != 0 )); then - whiptail --title "Apt Error:" --msgbox "Failed to update apt, exit code: $result\nPlease try another Apt mirror." --backtitle "$WHIP_BACKTITLE" 8 65 + whiptail --title "Apt Error:" --msgbox "Failed to update apt, exit code: $EXITCODE_APT\nPlease try another Apt mirror." --backtitle "$WHIP_BACKTITLE" 8 65 fi diff --git a/dietpi/dietpi-cpu_set b/dietpi/dietpi-cpu_set index 7cd65aafc4..6e89606903 100644 --- a/dietpi/dietpi-cpu_set +++ b/dietpi/dietpi-cpu_set @@ -36,7 +36,7 @@ #Check if target Gov is available on system. if (( ! $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors | grep -ci -m1 "$CPU_GOVERNOR") )); then - /DietPi/dietpi/func/dietpi-notify 1 "CPU gov: $CPU_GOVERNOR, not supported by kernel" + dietpi-notify 1 "CPU gov: $CPU_GOVERNOR, not supported by kernel" if (( $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors | grep -ci -m1 'ondemand') )); then @@ -52,7 +52,7 @@ fi - /DietPi/dietpi/func/dietpi-notify 2 "Switching to CPU gov: $CPU_GOVERNOR" + dietpi-notify 2 "Switching to CPU gov: $CPU_GOVERNOR" # - Update dietpi.txt sed -i "/^cpu_governor=/c\cpu_governor=$CPU_GOVERNOR" /DietPi/dietpi.txt @@ -86,7 +86,7 @@ done - /DietPi/dietpi/func/dietpi-notify 2 "Setting CPU max freq: $CPU_MAX_FREQ MHz" + dietpi-notify 2 "Setting CPU max freq: $CPU_MAX_FREQ MHz" fi @@ -103,7 +103,7 @@ done - /DietPi/dietpi/func/dietpi-notify 2 "Setting CPU min freq: $CPU_MIN_FREQ MHz" + dietpi-notify 2 "Setting CPU min freq: $CPU_MIN_FREQ MHz" fi @@ -115,7 +115,7 @@ #Set hispeed_load, if available on system (eg: XU4 kernel lacks this feature) if [ -f /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load ]; then - /DietPi/dietpi/func/dietpi-notify 2 "Setting go_hispeed_load: $cpu_throttle_up_percent %" + dietpi-notify 2 "Setting go_hispeed_load: $cpu_throttle_up_percent %" echo "$cpu_throttle_up_percent" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load fi @@ -126,9 +126,9 @@ local cpu_ondemand_sampling_rate=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_ondemand_sampling_rate' | sed 's/.*=//') local cpu_ondemand_sampling_down_factor=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_ondemand_sampling_down_factor' | sed 's/.*=//') - /DietPi/dietpi/func/dietpi-notify 2 "Setting up_threshold: $cpu_throttle_up_percent %" - /DietPi/dietpi/func/dietpi-notify 2 "Setting sampling_rate: $cpu_ondemand_sampling_rate microseconds" - /DietPi/dietpi/func/dietpi-notify 2 "Setting sampling_down_factor: $cpu_ondemand_sampling_down_factor" + dietpi-notify 2 "Setting up_threshold: $cpu_throttle_up_percent %" + dietpi-notify 2 "Setting sampling_rate: $cpu_ondemand_sampling_rate microseconds" + dietpi-notify 2 "Setting sampling_down_factor: $cpu_ondemand_sampling_down_factor" #Check for different possible locations # All @@ -175,14 +175,14 @@ # Main Loop #///////////////////////////////////////////////////////////////////////////////////// #----------------------------------------------------------------------------------- - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Cpu_Set "Applying CPU gov" + dietpi-notify 3 DietPi-Cpu_Set "Applying CPU gov" #----------------------------------------------------------------------------------- Check_GPU_Gov_Available #Apply CPU0 gov to all cores (if required) Apply_CPU_Gov "$CPU_GOVERNOR" 0 $HW_CPU_CORES - /DietPi/dietpi/func/dietpi-notify 0 "CPU gov applied: $CPU_GOVERNOR\n" + dietpi-notify 0 "CPU gov applied: $CPU_GOVERNOR\n" #----------------------------------------------------------------------------------- exit diff --git a/dietpi/dietpi-cpuinfo b/dietpi/dietpi-cpuinfo index 542bf173ed..988a23bb32 100644 --- a/dietpi/dietpi-cpuinfo +++ b/dietpi/dietpi-cpuinfo @@ -256,7 +256,7 @@ echo -e "" #CPU scaling may bump up with script - /DietPi/dietpi/func/dietpi-notify 2 'CPU current frequency, may be affected by this script, due to the processing required to run it.\n' + dietpi-notify 2 'CPU current frequency, may be affected by this script, due to the processing required to run it.\n' } diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 12b94498ef..541ba5043c 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -118,7 +118,7 @@ init=0 - /DietPi/dietpi/func/dietpi-notify 2 "Detecting drives, please wait..." + dietpi-notify 2 "Detecting drives, please wait..." #Copy FSTAB to ram, faster exe cp /etc/fstab "$FP_TEMP_FSTAB" @@ -160,7 +160,7 @@ aDRIVE_MOUNT_TARGET[$i]=$drive_mount_target_dev aDRIVE_ISAVAILABLE[$i]=1 - /DietPi/dietpi/func/dietpi-notify 2 "Detected /dev mount: ${aDRIVE_MOUNT_SOURCE[$i]} > ${aDRIVE_MOUNT_TARGET[$i]}" + dietpi-notify 2 "Detected /dev mount: ${aDRIVE_MOUNT_SOURCE[$i]} > ${aDRIVE_MOUNT_TARGET[$i]}" # - check UUID elif [ -n "$drive_mount_target_uuid" ]; then @@ -170,7 +170,7 @@ aDRIVE_ISAVAILABLE[$i]=1 aDRIVE_ISUUIDMOUNT[$i]=1 - /DietPi/dietpi/func/dietpi-notify 2 "Detected UUID mount: ${aDRIVE_MOUNT_SOURCE[$i]} > ${aDRIVE_MOUNT_TARGET[$i]}" + dietpi-notify 2 "Detected UUID mount: ${aDRIVE_MOUNT_SOURCE[$i]} > ${aDRIVE_MOUNT_TARGET[$i]}" # - check PARTUUID elif [ -n "$drive_mount_target_partuuid" ]; then @@ -180,14 +180,14 @@ aDRIVE_ISAVAILABLE[$i]=1 aDRIVE_ISUUIDMOUNT[$i]=1 - /DietPi/dietpi/func/dietpi-notify 2 "Detected PARTUUID mount: ${aDRIVE_MOUNT_SOURCE[$i]} > ${aDRIVE_MOUNT_TARGET[$i]}" + dietpi-notify 2 "Detected PARTUUID mount: ${aDRIVE_MOUNT_SOURCE[$i]} > ${aDRIVE_MOUNT_TARGET[$i]}" # - Active drive mount does not exist in fstab, create one elif [ -n "${aDRIVE_UUID[$i]}" ]; then #Ignore master partition tables / drives with no UUID aDRIVE_MOUNT_TARGET[$i]="/mnt/${aDRIVE_UUID[$i]}" - /DietPi/dietpi/func/dietpi-notify 2 "Creating UUID fstab entry: ${aDRIVE_MOUNT_SOURCE[$i]}" + dietpi-notify 2 "Creating UUID fstab entry: ${aDRIVE_MOUNT_SOURCE[$i]}" # Always check for rootFS device and set target manually # - EG: RPi, rootFS source is reported as /dev/root in df scrapes. @@ -195,12 +195,12 @@ aDRIVE_MOUNT_TARGET[$i]='/' - /DietPi/dietpi/func/dietpi-notify 2 " - Drive is currently mounted, using existing mount location: ${aDRIVE_MOUNT_TARGET[$i]}" + dietpi-notify 2 " - Drive is currently mounted, using existing mount location: ${aDRIVE_MOUNT_TARGET[$i]}" # Check if the drive is already mounted (but not set in fstab) and use existing mount target elif (( $(df -P | grep -ci -m1 "${aDRIVE_MOUNT_SOURCE[$i]}[[:space:]]") )); then - /DietPi/dietpi/func/dietpi-notify 2 " - Drive is currently mounted, using existing mount location: ${aDRIVE_MOUNT_TARGET[$i]}" + dietpi-notify 2 " - Drive is currently mounted, using existing mount location: ${aDRIVE_MOUNT_TARGET[$i]}" aDRIVE_MOUNT_TARGET[$i]=$(df -P | grep -m1 "${aDRIVE_MOUNT_SOURCE[$i]}[[:space:]]" | awk '{print $NF}') @@ -230,7 +230,7 @@ if (( ${aDRIVE_ISAVAILABLE[$i]} )) && [ ! -d "${aDRIVE_MOUNT_TARGET[$i]}" ]; then - /DietPi/dietpi/func/dietpi-notify 2 "Creating mount folder for ${aDRIVE_MOUNT_TARGET[$i]}" + dietpi-notify 2 "Creating mount folder for ${aDRIVE_MOUNT_TARGET[$i]}" mkdir -p "${aDRIVE_MOUNT_TARGET[$i]}" fi @@ -246,7 +246,7 @@ #--------------------------------------------------------------- - /DietPi/dietpi/func/dietpi-notify 2 "Processing drive information, please wait..." + dietpi-notify 2 "Processing drive information, please wait..." #ROOTFS location FP_ROOTFS_SOURCE=$(df -P | grep -m1 '[[:space:]]/$' | awk '{print $1}') @@ -337,13 +337,13 @@ INDEX_DRIVE_BEING_EDITED=$i - /DietPi/dietpi/func/dietpi-notify 2 "RootFS is currently set to R/O. $PROGRAM_NAME requires R/W access." + dietpi-notify 2 "RootFS is currently set to R/O. $PROGRAM_NAME requires R/W access." whiptail --title "RootFS is R/O" --yesno "RootFS is currently set to 'Read Only'. DietPi-Drive_Manager requires 'Read Write' access to function.\n\nWould you like to renable 'Read Write' access on RootFS?" --backtitle "$PROGRAM_NAME" --defaultno 14 75 if (( $? == 0 )); then Toggle_WriteMode - /DietPi/dietpi/func/dietpi-notify 0 "RootFS R/W now enabled." + dietpi-notify 0 "RootFS R/W now enabled." # reinit init=1 @@ -352,8 +352,8 @@ /DietPi/dietpi/dietpi-services start - /DietPi/dietpi/func/dietpi-notify 0 "RootFS currently set to R/O." - /DietPi/dietpi/func/dietpi-notify 2 "Please run 'dietpi-drive_manager' again, if you want to re-enable RootFS R/W." + dietpi-notify 0 "RootFS currently set to R/O." + dietpi-notify 2 "Please run 'dietpi-drive_manager' again, if you want to re-enable RootFS R/W." Destroy exit @@ -409,7 +409,7 @@ fi - /DietPi/dietpi/func/dietpi-notify 2 "Partition table target: $parition_table_type" + dietpi-notify 2 "Partition table target: $parition_table_type" parted -s "$drivepath_no_partitions" mklabel "$parition_table_type" parted -a optimal "$drivepath_no_partitions" mkpart primary 0% 100% @@ -504,17 +504,17 @@ # - install rsync if (( ! $(dpkg --get-selections | grep -ci -m1 '^rsync[[[:space:]]') )); then - /DietPi/dietpi/func/dietpi-notify 2 "Installing Rsync, please wait...\n" + dietpi-notify 2 "Installing Rsync, please wait...\n" sleep 1 - apt-get install rsync -y + AGI rsync fi rsync -paxv --exclude '/lost+found' / "${aDRIVE_MOUNT_TARGET[$INDEX_DRIVE_BEING_EDITED]}"/ if (( $? != 0 )); then - /DietPi/dietpi/func/dietpi-notify 1 'Rsync has failed, RootFS transfer has been aborted.' + dietpi-notify 1 'Rsync has failed, RootFS transfer has been aborted.' # revert FSTAB changes cp /etc/fstab.bak /etc/fstab @@ -563,7 +563,7 @@ # global min limit (MB) local free_space_limit=500 - /DietPi/dietpi/func/dietpi-notify 2 'Checking available free space on RootFS, please wait...' + dietpi-notify 2 'Checking available free space on RootFS, please wait...' #Find rootfs for ((i=0; i<$MAX_DRIVES; i++)) @@ -582,15 +582,15 @@ whiptail --title "Insufficient free space" --msgbox "$message" --backtitle "$PROGRAM_NAME" 14 70 - /DietPi/dietpi/func/dietpi-notify 1 "Insufficient free space on RootFS. $free_space_current MB available, $free_space_limit MB required" - /DietPi/dietpi/func/dietpi-notify 1 'Aborting' + dietpi-notify 1 "Insufficient free space on RootFS. $free_space_current MB available, $free_space_limit MB required" + dietpi-notify 1 'Aborting' # export EXIT_CODE=1 else - /DietPi/dietpi/func/dietpi-notify 0 "$free_space_current MB available, $free_space_limit MB required" + dietpi-notify 0 "$free_space_current MB available, $free_space_limit MB required" fi @@ -610,23 +610,23 @@ # echo 0 > "$fp_test_file" # if (( $? != 0 )); then - # /DietPi/dietpi/func/dietpi-notify 1 "RootFS is currently set to R/O." + # dietpi-notify 1 "RootFS is currently set to R/O." # EXIT_CODE=1 # fi # rm "$fp_test_file" &> /dev/null - /DietPi/dietpi/func/dietpi-notify 2 "Checking RootFS R/W access. Please wait..." + dietpi-notify 2 "Checking RootFS R/W access. Please wait..." if (( $(mount | grep -m1 '[[:space:]]/[[:space:]]' | grep -ci -m1 '(ro,') )); then - /DietPi/dietpi/func/dietpi-notify 1 "RootFS is currently set to R/O." - /DietPi/dietpi/func/dietpi-notify 2 "DietPi requires RootFS R/W access. Please run 'dietpi-drive_manager' to re-enable.\n" + dietpi-notify 1 "RootFS is currently set to R/O." + dietpi-notify 2 "DietPi requires RootFS R/W access. Please run 'dietpi-drive_manager' to re-enable.\n" EXIT_CODE=1 else - /DietPi/dietpi/func/dietpi-notify 0 "RootFS R/W access.\n" + dietpi-notify 0 "RootFS R/W access.\n" fi @@ -1158,22 +1158,22 @@ if (( $OPTION == 3 && ! $(dpkg --get-selections | grep -ci -m1 '^hfsutils') )); then - /DietPi/dietpi/func/dietpi-notify 2 "Installing additional packages for HFS+ support, please wait..." - apt-get install -y hfsplus hfsprogs hfsutils + dietpi-notify 2 "Installing additional packages for HFS+ support, please wait..." + AGI hfsplus hfsprogs hfsutils # - btrfs install packages elif (( $OPTION == 4 && ! $(dpkg --get-selections | grep -ci -m1 '^btrfs-tools') )); then - /DietPi/dietpi/func/dietpi-notify 2 "Installing additional packages for BTRFS support, please wait..." - apt-get install -y btrfs-tools + dietpi-notify 2 "Installing additional packages for BTRFS support, please wait..." + AGI btrfs-tools # - f2fs install packages elif (( $OPTION == 5 && ! $(dpkg --get-selections | grep -ci -m1 '^f2fs-tools') )); then - /DietPi/dietpi/func/dietpi-notify 2 "Installing additional packages for F2FS support, please wait..." - apt-get install -y f2fs-tools + dietpi-notify 2 "Installing additional packages for F2FS support, please wait..." + AGI f2fs-tools fi @@ -1240,7 +1240,7 @@ local drive_manager_selection="$OPTION" - /DietPi/dietpi/func/dietpi-notify 0 "Drive mount selected: $drive_manager_selection" + dietpi-notify 0 "Drive mount selected: $drive_manager_selection" echo -e "$drive_manager_selection" > "$FP_DRIVE_MANAGER_SELECTION" fi @@ -1327,7 +1327,7 @@ _EOF_ #Prevent VM image from running core script elif (( $HW_MODEL == 20 )); then - /DietPi/dietpi/func/dietpi-notify 1 "$PROGRAM_NAME is not currently supported on VM images" + dietpi-notify 1 "$PROGRAM_NAME is not currently supported on VM images" #Drive Manager else diff --git a/dietpi/dietpi-letsencrypt b/dietpi/dietpi-letsencrypt index 698d0bdbf4..46faa97c05 100644 --- a/dietpi/dietpi-letsencrypt +++ b/dietpi/dietpi-letsencrypt @@ -52,7 +52,7 @@ Run_Lets_Encrypt(){ - /DietPi/dietpi/func/dietpi-notify 3 "$PROGRAM_NAME" "Running cert" + dietpi-notify 3 "$PROGRAM_NAME" "Running cert" #Conditions that must be met before allowing run local run_conditions_met=1 @@ -63,7 +63,7 @@ if (( $(ps aux | grep -ci -m1 '[a]pache') )); then DP_WEBSERVER_INDEX=0 - /DietPi/dietpi/func/dietpi-notify 0 "Apache2 webserver detected" + dietpi-notify 0 "Apache2 webserver detected" if (( $DISTRO >= 4 )); then DP_LETSENCRYPT_BINARY="$DP_LETSENCRYPT_BINARY --apache" fi @@ -71,12 +71,12 @@ elif (( $(ps aux | grep -ci -m1 '[l]ighttpd') )); then DP_WEBSERVER_INDEX=1 - /DietPi/dietpi/func/dietpi-notify 0 "Lighttpd webserver detected" + dietpi-notify 0 "Lighttpd webserver detected" elif (( $(ps aux | grep -ci -m1 '[n]ginx') )); then DP_WEBSERVER_INDEX=2 - /DietPi/dietpi/func/dietpi-notify 0 "Nginx webserver detected" + dietpi-notify 0 "Nginx webserver detected" if (( $DISTRO >= 4 )); then DP_LETSENCRYPT_BINARY="$DP_LETSENCRYPT_BINARY --nginx" fi @@ -84,7 +84,7 @@ elif (( $(ps aux | grep -ci -m1 '[m]inio') )); then DP_WEBSERVER_INDEX=3 - /DietPi/dietpi/func/dietpi-notify 0 "Minio S3 server detected" + dietpi-notify 0 "Minio S3 server detected" else @@ -468,8 +468,8 @@ _EOF_ #Menu if (( $INPUT == 0 )); then - /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." + dietpi-notify 1 "Certbot binary not found ( $DP_LETSENCRYPT_BINARY )" + dietpi-notify 2 "Please install Certbot with DietPi-Software before running this program." read -p "Press any key to continue....." else diff --git a/dietpi/dietpi-logclear b/dietpi/dietpi-logclear index a7e6c775dd..a2777965c1 100644 --- a/dietpi/dietpi-logclear +++ b/dietpi/dietpi-logclear @@ -124,7 +124,7 @@ fi - /DietPi/dietpi/func/dietpi-notify 2 'Clearing log entries for PiHole, that are not from today, please wait...' + dietpi-notify 2 'Clearing log entries for PiHole, that are not from today, please wait...' sed -i '/'"$month_day_today"'/!d' /var/log/pihole.log pihole_restart_required=1 @@ -137,7 +137,7 @@ # - 5mb should be more than enough for 1+ days of pihole logs if (( $FILESIZE_BYTES >= 5242880 )); then - /DietPi/dietpi/func/dietpi-notify 2 "${ARRAY_LOG_FILEPATH[$i]} has exceeded 5MB, clearing, please wait..." + dietpi-notify 2 "${ARRAY_LOG_FILEPATH[$i]} has exceeded 5MB, clearing, please wait..." # RAMlog mode 2: if (( $INPUT == 0 )); then @@ -162,7 +162,7 @@ #restart PiHole if we modified the log file if (( $pihole_restart_required )); then - /DietPi/dietpi/func/dietpi-notify 2 'PiHole logs have been changed, restarting, please wait...' + dietpi-notify 2 'PiHole logs have been changed, restarting, please wait...' systemctl stop pihole-FTL systemctl stop dnsmasq sleep 1 @@ -238,7 +238,7 @@ #//////////////////////////////////////////////////////////////// #---------------------------------------------------------------- - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Logclear "Welcome" + dietpi-notify 3 DietPi-Logclear "Welcome" #---------------------------------------------------------------- #How to use print. if (( $INPUT == -1 )); then diff --git a/dietpi/dietpi-process_tool b/dietpi/dietpi-process_tool index 400e1a4c94..8a34cae3a1 100644 --- a/dietpi/dietpi-process_tool +++ b/dietpi/dietpi-process_tool @@ -52,11 +52,11 @@ Apply_Process_Tool(){ - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Process_Tool Apply + dietpi-notify 3 DietPi-Process_Tool Apply local status_text="" - local status_text_ok="$(/DietPi/dietpi/func/dietpi-notify 0)" - local status_text_failed="$(/DietPi/dietpi/func/dietpi-notify 1)" + local status_text_ok="$(dietpi-notify 0)" + local status_text_failed="$(dietpi-notify 1)" for ((i=0; i<$MAX_PROGRAMS; i++)) do @@ -77,7 +77,7 @@ # - Check if PID exists (this can occur with programs like netdata that run as root initally, create a new process under a different user, then terminate the original root process. if (( ! $( ps ax | awk '{print $1}' | grep -ci -m1 "${aPID[$i]}") )); then - /DietPi/dietpi/func/dietpi-notify 2 PID "${aPID[$i]}" no longer exists + dietpi-notify 2 PID "${aPID[$i]}" no longer exists else @@ -829,7 +829,7 @@ elif (( $INPUT == 1 )); then Apply_Process_Tool - /DietPi/dietpi/func/dietpi-notify -1 ${EXIT_CODE:=0} "$PROGRAM_NAME |" + dietpi-notify -1 ${EXIT_CODE:=0} "$PROGRAM_NAME |" fi #----------------------------------------------------------------------------------- diff --git a/dietpi/dietpi-ramdisk b/dietpi/dietpi-ramdisk index 267ffadc05..cde1e56db7 100644 --- a/dietpi/dietpi-ramdisk +++ b/dietpi/dietpi-ramdisk @@ -53,7 +53,7 @@ #Main Loop #///////////////////////////////////////////////////////////////////////////////////// - #Copy to Ram + #Start: Copy to Ram if (( $INPUT == 0 )); then if [ ! -f /DietPi/.ramdisk ]; then @@ -98,7 +98,7 @@ fi - #Copy everything back to DISK + #Stop: Copy everything back to DISK elif (( $INPUT == 1 )); then echo -e "$(date) | DietPi-Ramdisk: Stopping" @@ -115,7 +115,7 @@ # rm -R "$FILEPATH_DISK"/dietpi #: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298241622 #Copy DietPi to Disk with files from RAM - cp -Rf "$FILEPATH_RAM"/* /boot + cp -Rf "$FILEPATH_RAM"/* /boot/ #remove active flag. rm /DietPi/.ramdisk &> /dev/null diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index 5a8b03c8ec..a487676f21 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -186,12 +186,12 @@ #ok if (( $3 == 0 || $3 == 5 )); then - echo -e "\e[1A$(/DietPi/dietpi/func/dietpi-notify 0)\e[0m $1 : $2" + echo -e "\e[1A$(dietpi-notify 0)\e[0m $1 : $2" #failed else - echo -e "\e[1A$(/DietPi/dietpi/func/dietpi-notify 1)\e[0m $1 : $2" + echo -e "\e[1A$(dietpi-notify 1)\e[0m $1 : $2" fi @@ -325,7 +325,7 @@ # Main #///////////////////////////////////////////////////////////////////////////////////// #Info - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Services "$INPUT_MODE" + dietpi-notify 3 DietPi-Services "$INPUT_MODE" #Obtain an array of available services installed on system. Populate_Available_Array @@ -384,11 +384,11 @@ systemctl $SYSTEMD_CMD $INPUT_S2 if (( $? == 0 )); then - /DietPi/dietpi/func/dietpi-notify 0 "$INPUT_MODE $INPUT_S2" + dietpi-notify 0 "$INPUT_MODE $INPUT_S2" else - /DietPi/dietpi/func/dietpi-notify 1 "$INPUT_MODE $INPUT_S2" + dietpi-notify 1 "$INPUT_MODE $INPUT_S2" fi @@ -419,16 +419,16 @@ if [[ "$STATUS" =~ .*'failed'.* ]]; then - /DietPi/dietpi/func/dietpi-notify 1 "$STATUS" + dietpi-notify 1 "$STATUS" systemctl status "${aSERVICE_NAME[$i]}" -l --no-pager elif [[ "$STATUS" =~ .*'inactive'.* ]]; then - /DietPi/dietpi/func/dietpi-notify 2 "$STATUS" + dietpi-notify 2 "$STATUS" else - /DietPi/dietpi/func/dietpi-notify 0 "$STATUS" + dietpi-notify 0 "$STATUS" fi @@ -450,11 +450,11 @@ systemctl $INPUT_MODE $INPUT_S2 &> /dev/null if (( $? == 0 )); then - /DietPi/dietpi/func/dietpi-notify 0 "$INPUT_MODE $INPUT_S2" + dietpi-notify 0 "$INPUT_MODE $INPUT_S2" else - /DietPi/dietpi/func/dietpi-notify 1 "$INPUT_MODE $INPUT_S2" + dietpi-notify 1 "$INPUT_MODE $INPUT_S2" fi diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 9e52384483..1a47b60acc 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -115,7 +115,7 @@ _EOF_ fi #Load Software states - /DietPi/dietpi/func/dietpi-notify 2 "Reading database, please wait..." + dietpi-notify 2 "Reading database, please wait..." #Load if [ -f "$fp_target" ]; then @@ -2636,8 +2636,8 @@ _EOF_ # - Disable aSOFTWARE_INSTALL_STATE[$i]=0 - /DietPi/dietpi/func/dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[$i]}: Requires user input and can not be automated." - /DietPi/dietpi/func/dietpi-notify 1 "${aSOFTWARE_WHIP_NAME[$i]}: Will not be installed. Please run 'dietpi-software' to install." + dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[$i]}: Requires user input and can not be automated." + dietpi-notify 1 "${aSOFTWARE_WHIP_NAME[$i]}: Will not be installed. Please run 'dietpi-software' to install." fi @@ -2650,7 +2650,7 @@ _EOF_ #Work out which additional software we need to install Install_Flag_Prereq_Software(){ - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Software "Checking for prerequisite software" + dietpi-notify 3 DietPi-Software "Checking for prerequisite software" #------------------------------------------------------------------------- #Pre-req software, for items that do not have their own array aSOFTWARE_REQUIRES_SOFTWARENAME @@ -2696,16 +2696,16 @@ _EOF_ #aSOFTWARE_INSTALL_STATE[37]=1 # Shairport Sync # Disabled/optional #aSOFTWARE_INSTALL_STATE[60]=1 # WiFi Hotspot # Installed as per moOde docs - /DietPi/dietpi/func/dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[128]} will be installed" + dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[128]} will be installed" aSOFTWARE_INSTALL_STATE[128]=1 # MPD - /DietPi/dietpi/func/dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[78]} will be installed" + 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" + 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" + dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[96]} will be installed" aSOFTWARE_INSTALL_STATE[96]=1 # Samba Server fi @@ -2732,7 +2732,7 @@ _EOF_ aSOFTWARE_INSTALL_STATE[$index]=1 #aSOFTWARE_WHIP_NAME - /DietPi/dietpi/func/dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[$index]} will be installed" + dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[$index]} will be installed" fi @@ -2748,7 +2748,7 @@ _EOF_ aSOFTWARE_INSTALL_STATE[150]=1 - /DietPi/dietpi/func/dietpi-notify 2 "Mono runtime libary will be installed" + dietpi-notify 2 "Mono runtime libary will be installed" fi @@ -2761,7 +2761,7 @@ _EOF_ aSOFTWARE_INSTALL_STATE[140]=1 - /DietPi/dietpi/func/dietpi-notify 2 "SDL2 will be installed" + dietpi-notify 2 "SDL2 will be installed" fi @@ -2781,7 +2781,7 @@ _EOF_ aSOFTWARE_INSTALL_STATE[130]=1 - /DietPi/dietpi/func/dietpi-notify 2 "Python-Pip will be installed" + dietpi-notify 2 "Python-Pip will be installed" fi @@ -2800,7 +2800,7 @@ _EOF_ # - Flag for install aSOFTWARE_INSTALL_STATE[128]=1 - /DietPi/dietpi/func/dietpi-notify 2 "MPD will be installed" + dietpi-notify 2 "MPD will be installed" fi @@ -2814,7 +2814,7 @@ _EOF_ aSOFTWARE_INSTALL_STATE[94]=1 - /DietPi/dietpi/func/dietpi-notify 2 "ProFTP will be installed" + dietpi-notify 2 "ProFTP will be installed" fi @@ -2823,7 +2823,7 @@ _EOF_ aSOFTWARE_INSTALL_STATE[96]=1 - /DietPi/dietpi/func/dietpi-notify 2 "Samba Server will be installed" + dietpi-notify 2 "Samba Server will be installed" fi @@ -2837,7 +2837,7 @@ _EOF_ aSOFTWARE_INSTALL_STATE[91]=1 - /DietPi/dietpi/func/dietpi-notify 2 "Redis will be installed" + dietpi-notify 2 "Redis will be installed" fi @@ -2928,25 +2928,25 @@ _EOF_ #WEBSERVER_APACHE aSOFTWARE_INSTALL_STATE[83]=1 - /DietPi/dietpi/func/dietpi-notify 2 "Apache2 will be installed" + dietpi-notify 2 "Apache2 will be installed" elif (( $INDEX_WEBSERVER_TARGET == -1 )); then #WEBSERVER_NGINX aSOFTWARE_INSTALL_STATE[85]=1 - /DietPi/dietpi/func/dietpi-notify 2 "Nginx will be installed" + dietpi-notify 2 "Nginx will be installed" elif (( $INDEX_WEBSERVER_TARGET == -2 )); then #WEBSERVER_LIGHTTPD aSOFTWARE_INSTALL_STATE[84]=1 - /DietPi/dietpi/func/dietpi-notify 2 "Lighttpd will be installed" + dietpi-notify 2 "Lighttpd will be installed" fi # - Always install WEBSERVER_PHP aSOFTWARE_INSTALL_STATE[89]=1 - /DietPi/dietpi/func/dietpi-notify 2 "PHP will be installed" + dietpi-notify 2 "PHP will be installed" fi @@ -2970,7 +2970,7 @@ _EOF_ #WEBSERVER_MARIADB as new default aSOFTWARE_INSTALL_STATE[88]=1 - /DietPi/dietpi/func/dietpi-notify 2 "MariaDB will be installed" + dietpi-notify 2 "MariaDB will be installed" fi @@ -2990,7 +2990,7 @@ _EOF_ #WEBSERVER_SQLITE aSOFTWARE_INSTALL_STATE[87]=1 - /DietPi/dietpi/func/dietpi-notify 2 "SQlite will be installed" + dietpi-notify 2 "SQlite will be installed" break @@ -3091,19 +3091,19 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[86]} == 2 )); then aSOFTWARE_INSTALL_STATE[88]=0 - /DietPi/dietpi/func/dietpi-notify 2 "MySQL is already installed, MariaDB install has been disabled" + dietpi-notify 2 "MySQL is already installed, MariaDB install has been disabled" # MariaDB installed elif (( ${aSOFTWARE_INSTALL_STATE[88]} == 2 )); then aSOFTWARE_INSTALL_STATE[86]=0 - /DietPi/dietpi/func/dietpi-notify 2 "MariaDB is already installed, MySQL install has been disabled" + dietpi-notify 2 "MariaDB is already installed, MySQL install has been disabled" # Both selected for install, disable MySQL else aSOFTWARE_INSTALL_STATE[86]=0 - /DietPi/dietpi/func/dietpi-notify 2 "MySQL and MariaDB are selected for install. MySQL has been de-selected to prevent incompatible MySQL + MariaDB installation" + dietpi-notify 2 "MySQL and MariaDB are selected for install. MySQL has been de-selected to prevent incompatible MySQL + MariaDB installation" fi @@ -3123,7 +3123,7 @@ _EOF_ ! ${aSOFTWARE_INSTALL_STATE[26]} )); then aSOFTWARE_INSTALL_STATE[23]=1 - /DietPi/dietpi/func/dietpi-notify 2 "LXDE desktop will be installed" + dietpi-notify 2 "LXDE desktop will be installed" fi @@ -3143,7 +3143,7 @@ _EOF_ # - Flag for install aSOFTWARE_INSTALL_STATE[17]=1 - /DietPi/dietpi/func/dietpi-notify 2 "Git will be installed" + dietpi-notify 2 "Git will be installed" break @@ -3161,7 +3161,7 @@ _EOF_ # - Flag for install aSOFTWARE_INSTALL_STATE[16]=1 - /DietPi/dietpi/func/dietpi-notify 2 "Build-Essential will be installed" + dietpi-notify 2 "Build-Essential will be installed" break @@ -3179,7 +3179,7 @@ _EOF_ # - Flag for install aSOFTWARE_INSTALL_STATE[102]=1 - /DietPi/dietpi/func/dietpi-notify 2 "Rsyslog will be installed" + dietpi-notify 2 "Rsyslog will be installed" break @@ -3197,7 +3197,7 @@ _EOF_ # - Flag for install aSOFTWARE_INSTALL_STATE[7]=1 - /DietPi/dietpi/func/dietpi-notify 2 "FFmpeg will be installed" + dietpi-notify 2 "FFmpeg will be installed" break @@ -3215,7 +3215,7 @@ _EOF_ # - Flag for install aSOFTWARE_INSTALL_STATE[8]=1 - /DietPi/dietpi/func/dietpi-notify 2 "Oracle Java will be installed" + dietpi-notify 2 "Oracle Java will be installed" break @@ -3233,7 +3233,7 @@ _EOF_ # - Flag for install aSOFTWARE_INSTALL_STATE[9]=1 - /DietPi/dietpi/func/dietpi-notify 2 "NodeJS will be installed" + dietpi-notify 2 "NodeJS will be installed" break @@ -3251,7 +3251,7 @@ _EOF_ # - Flag for install aSOFTWARE_INSTALL_STATE[5]=1 - /DietPi/dietpi/func/dietpi-notify 2 "Alsa will be installed" + dietpi-notify 2 "Alsa will be installed" break @@ -3269,7 +3269,7 @@ _EOF_ # - Flag for install aSOFTWARE_INSTALL_STATE[6]=1 - /DietPi/dietpi/func/dietpi-notify 2 "Xserver will be installed" + dietpi-notify 2 "Xserver will be installed" break @@ -4022,7 +4022,7 @@ _EOF_ #Not required. #AGI_ERROR_CHECKED software-properties-common #add-apt-repository -y ppa:chris-lea/libsodium - #apt-get update + #AGUP pip install cryptography @@ -4136,7 +4136,8 @@ _EOF_ # Install APT package just, if we have ownCloud's own up to date repository. if [ -f /etc/apt/sources.list.d/owncloud.list ]; then - apt-get update && AGI_ERROR_CHECKED owncloud-files + AGUP + AGI_ERROR_CHECKED owncloud-files fi @@ -4340,7 +4341,7 @@ _EOF_ wget -q -O - "$INSTALL_URL_ADDRESS" | apt-key add - wget https://apt.mopidy.com/jessie.list -O /etc/apt/sources.list.d/mopidy.list - apt-get update + AGUP AGI_ERROR_CHECKED mopidy #ARMv8 @@ -4401,13 +4402,13 @@ _EOF_ # - CEC support | * due to C2 having libcec3v4, rpi has libcec3. # XU4 package conflict: https://github.com/Fourdee/DietPi/issues/554 # Due to the vast differences in libcec naming across devices, if CEC fails to install, do not terminate DietPi install. - apt-get install -y libcec3* - if (( $? != 0 )); then + AGI libcec3* + if (( $EXITCODE_APT != 0 )); then - apt-get install -y libcec3 - if (( $? != 0 )); then + AGI libcec3 + if (( $EXITCODE_APT != 0 )); then - /DietPi/dietpi/func/dietpi-notify 2 "libcec3 failed to install." + dietpi-notify 2 "libcec3 failed to install." fi @@ -4786,14 +4787,14 @@ _EOF_ if (( $? == 0 )); then echo -e "deb $INSTALL_URL_ADDRESS erasmus main" > /etc/apt/sources.list.d/openmediavault.list - apt-get update + AGUP AGI_ERROR_CHECKED openmediavault-keyring debconf-set-selections <<< "openmediavault openmediavault/run-initsystem note" debconf-set-selections <<< "postfix postfix/main_mailer_type select No configuration" - apt-get update + AGUP AGI_ERROR_CHECKED openmediavault postfix else @@ -4884,7 +4885,7 @@ _EOF_ if [ -f /etc/dphys-swapfile ] && (( $(grep 'CONF_SWAPSIZE=' /etc/dphys-swapfile | sed 's/.*=//') < 512 )); then - /DietPi/dietpi/func/dietpi-notify 2 "Increasing swapfile size to 512MB before running gravity.sh, please wait...\n" + dietpi-notify 2 "Increasing swapfile size to 512MB before running gravity.sh, please wait...\n" /DietPi/dietpi/func/dietpi-set_dphys-swapfile 512 fi @@ -4901,7 +4902,7 @@ _EOF_ local exit_code=$? if (( $exit_code != 0 )); then - /DietPi/dietpi/func/dietpi-notify 1 "Pi-Hole exited with code ($exit_code) and is not installed." + dietpi-notify 1 "Pi-Hole exited with code ($exit_code) and is not installed." aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]=0 fi @@ -5211,7 +5212,7 @@ _EOF_ fi - apt-get update + AGUP AGI_ERROR_CHECKED mosquitto @@ -6331,7 +6332,7 @@ _EOF_ wget "$INSTALL_URL_ADDRESS"Release.key apt-key add - < Release.key rm Release.key - apt-get update + AGUP #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 @@ -6416,13 +6417,13 @@ _EOF_ echo -e "deb [arch=armhf] $INSTALL_URL_ADDRESS $DISTRO_NAME main" > /etc/apt/sources.list.d/plex.list wget -O - "$INSTALL_URL_ADDRESS"dev2day-pms.gpg.key | apt-key add - - apt-get update + AGUP #ARMv8: Install 32bit binaries if (( $HW_ARCH == 3 )); then dpkg --add-architecture armhf - apt-get update + AGUP AGI_ERROR_CHECKED binutils:armhf plexmediaserver-installer:armhf #ARM32 @@ -6991,7 +6992,7 @@ _EOF_ echo -e "deb $INSTALL_URL_ADDRESS cloudprint-jessie main" > /etc/apt/sources.list.d/cloudprint.list wget -q -O - https://davesteele.github.io/key-366150CE.pub.txt | apt-key add - - apt-get update + AGUP AGI_ERROR_CHECKED cloudprint-service @@ -7205,7 +7206,7 @@ _EOF_ echo -e "deb https://apt.sonarr.tv/ master main" > /etc/apt/sources.list.d/sonarr.list fi - apt-get update + AGUP AGI_ERROR_CHECKED nzbdrone @@ -7314,7 +7315,7 @@ _EOF_ wget -q -O - http://dist.jriver.com/mediacenter@jriver.com.gpg.key | apt-key add - wget "$INSTALL_URL_ADDRESS" -O /etc/apt/sources.list.d/mediacenter22.list - apt-get update + AGUP AGI_ERROR_CHECKED mediacenter22 @@ -7720,7 +7721,7 @@ _EOF_ 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 + AGUP AGI_ERROR_CHECKED raspotify @@ -8331,7 +8332,7 @@ deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main _EOF_ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 - apt-get update + AGUP # - Accept the license: https://github.com/Fourdee/DietPi/issues/298 debconf-set-selections <<< "oracle-java8-installer shared/accepted-oracle-license-v1-1 boolean true" @@ -8444,7 +8445,7 @@ _EOF_ fi - apt-get update + AGUP AGI_ERROR_CHECKED mono-runtime @@ -8462,11 +8463,11 @@ _EOF_ 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" + dietpi-notify 2 "HA_USER: $HA_USER" + dietpi-notify 2 "HA_USERROOT: $HA_USERROOT" + dietpi-notify 2 "HA_SRVROOT: $HA_SRVROOT" + dietpi-notify 2 "HA_PYENV_ACTIVATION: $HA_PYENV_ACTIVATION" + dietpi-notify 2 "HA_PYTHON_VERSION: $HA_PYTHON_VERSION" # Install needed libraries AGI_ERROR_CHECKED 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 @@ -8564,7 +8565,7 @@ _EOF_ fi #Inform user (From testing, stopping SSH server services does not disconnect user, however, just incase it does in the future) - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Software "Stopping SSH servers" + dietpi-notify 3 DietPi-Software "Stopping SSH servers" #stop all SSH server services service ssh stop &> /dev/null @@ -9126,7 +9127,7 @@ _EOF_ cp -R /var/lib/mysql/* "$FP_DIETPI_USERDATA"/mysql/ if (( $? != 0 )); then - /DietPi/dietpi/func/dietpi-notify 1 "Moving of MySQL data store failed to $FP_DIETPI_USERDATA/mysql. DietPi-Software will now exit" + dietpi-notify 1 "Moving of MySQL data store failed to $FP_DIETPI_USERDATA/mysql. DietPi-Software will now exit" Exit_Destroy fi @@ -10440,7 +10441,7 @@ ExecStartPre=/usr/bin/setterm --term linux --blank 0 --powersave off --cursor of ExecStart=/bin/bash -c '/DietPi/dietpi/dietpi-cloudshell 1' ExecStop=/usr/bin/setterm --reset -ExecStop=/bin/bash -c '/DietPi/dietpi/func/dietpi-notify 0 DietPi-Cloudshell terminated, have a nice day!' +ExecStop=/bin/bash -c 'dietpi-notify 0 DietPi-Cloudshell terminated, have a nice day!' [Install] WantedBy=multi-user.target @@ -10860,7 +10861,7 @@ export KEY_NAME="DietPi_OpenVPN_Server" _EOF_ #Create Server Cert Auth - /DietPi/dietpi/func/dietpi-notify 2 "Generating unique OpenVPN certificates and keys. Please wait...\n" + dietpi-notify 2 "Generating unique OpenVPN certificates and keys. Please wait...\n" openssl dhparam -out /etc/openvpn/dh"$key_size".pem "$key_size" #Build Server certs/keys @@ -11995,7 +11996,7 @@ _EOF_ #Grab our premade config: # SickRage must be run at least once, or it will simply overwrite our config - /DietPi/dietpi/func/dietpi-notify 2 "Configuring SickRage, please wait..." + dietpi-notify 2 "Configuring SickRage, please wait..." systemctl start sickrage # Wait for SickRage to generate its default config.ini, else, it will just overwrite our config.ini. @@ -12004,14 +12005,14 @@ _EOF_ while [ ! -f "$FP_DIETPI_USERDATA/sickrage/config.ini" ] do - /DietPi/dietpi/func/dietpi-notify 2 "Waiting for SickRage to finish 1st run prep, please wait..." + dietpi-notify 2 "Waiting for SickRage to finish 1st run prep, please wait..." sleep 1 ((current_loop++)) if (( $current_loop >= $max_loops )); then - /DietPi/dietpi/func/dietpi-notify 1 "Timed-out waiting for SickRage to generate config.ini" + dietpi-notify 1 "Timed-out waiting for SickRage to generate config.ini" break fi @@ -12310,7 +12311,7 @@ _EOF_ rm /etc/sabnzbd/sabnzbd.ini &> /dev/null systemctl start sabnzbd - /DietPi/dietpi/func/dietpi-notify 2 "Generating initial config, please wait..." + dietpi-notify 2 "Generating initial config, please wait..." while [ ! -f /etc/sabnzbd/sabnzbd.ini ] do @@ -12874,7 +12875,7 @@ do if (( \$(gpio -g read 17) == 1 )); then - /DietPi/dietpi/func/dietpi-notify 0 "AudioPhonics Pi-SPC: Power off requested. Shutting down system." + dietpi-notify 0 "AudioPhonics Pi-SPC: Power off requested. Shutting down system." sudo poweroff #sudo shutdown -h -P now break @@ -13066,7 +13067,7 @@ _EOF_ while [ ! -f /DietPi/.ramdisk ] do - /DietPi/dietpi/func/dietpi-notify 2 "Waiting for DietPi-RAMDISK to finish mounting DietPi to RAM..." + dietpi-notify 2 "Waiting for DietPi-RAMDISK to finish mounting DietPi to RAM..." sleep 1 done @@ -13235,10 +13236,10 @@ _EOF_ #---------------------------------------------------------------------- #Inform User - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Software "Uninstall" + dietpi-notify 3 DietPi-Software "Uninstall" echo -e "" - /DietPi/dietpi/func/dietpi-notify 0 "Uninstalling ${aSOFTWARE_WHIP_NAME[$1]}: ${aSOFTWARE_WHIP_DESC[$1]}\n" + dietpi-notify 0 "Uninstalling ${aSOFTWARE_WHIP_NAME[$1]}: ${aSOFTWARE_WHIP_DESC[$1]}\n" #Was a uninstall event trigged? local valid_input=1 @@ -13508,7 +13509,7 @@ _EOF_ if (( $DISTRO == 3 )); then rm /etc/apt/sources.list.d/cloudprint.list - apt-get update + AGUP fi @@ -13555,7 +13556,7 @@ _EOF_ AGP_ERROR_CHECKED nzbdrone rm /etc/systemd/system/sonarr.service rm /etc/apt/sources.list.d/sonarr.list - apt-get update + AGUP elif (( $1 == 145 )); then @@ -13592,7 +13593,7 @@ _EOF_ #AGP_ERROR_CHECKED mono-runtime #shared lib rm /etc/apt/sources.list.d/mono-xamarin.list - apt-get update + AGUP elif (( $1 == 151 )); then @@ -13971,7 +13972,7 @@ _EOF_ AGP_ERROR_CHECKED emby-server rm /etc/apt/sources.list.d/emby-server.list - apt-get update + AGUP elif (( $1 == 58 )); then @@ -13985,7 +13986,7 @@ _EOF_ rm -R /var/lib/plexmediaserver rm /etc/apt/sources.list.d/plex.list &> /dev/null - apt-get update + AGUP elif (( $1 == 52 )); then @@ -14120,7 +14121,7 @@ _EOF_ AGP_ERROR_CHECKED raspotify rm /etc/apt/sources.list.d/raspotify.list - apt-get update + AGUP elif (( $1 == 168 )); then @@ -14334,7 +14335,7 @@ _EOF_ AGP_ERROR_CHECKED oracle-java8-* rm /etc/apt/sources.list.d/webupd8team-java.list - apt-get update + AGUP elif (( $1 == 104 )); then @@ -14367,7 +14368,7 @@ _EOF_ if [ -f /etc/apt/sources.list.d/nodesource_nodejs.list ]; then rm /etc/apt/sources.list.d/nodesource_nodejs.list - apt-get update + AGUP fi @@ -14379,7 +14380,7 @@ _EOF_ else - /DietPi/dietpi/func/dietpi-notify 2 "Software index $1 is unknown, or, has no removal code." + dietpi-notify 2 "Software index $1 is unknown, or, has no removal code." valid_input=0 fi @@ -14402,7 +14403,7 @@ _EOF_ Uninstall_Software_Finalize(){ #Purge - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Software "Removing packages that are no longer required" + dietpi-notify 3 DietPi-Software "Removing packages that are no longer required" apt-get autoremove --purge -y @@ -14463,15 +14464,15 @@ _EOF_ #Always clean and update apt, before running installs. apt-get clean - apt-get update + AGUP #Simluated apt installation to check for failures related to apt-cache. - /DietPi/dietpi/func/dietpi-notify 2 "Running apt simulation to check for errors, please wait..." + dietpi-notify 2 "Running apt simulation to check for errors, please wait..." local package_to_test='bash-doc' apt-get install $package_to_test -qq -s -y 2>&1 | tee "$FP_LOG_APT" local result=${PIPESTATUS[0]} - /DietPi/dietpi/func/dietpi-notify -1 $result "Apt simulation |" + dietpi-notify -1 $result "Apt simulation |" if (( $result != 0 )); then @@ -14568,7 +14569,7 @@ _EOF_ #Apply Language (Locale) if [ "$AUTOINSTALL_LANGUAGE" != "en_GB" ]; then - /DietPi/dietpi/func/dietpi-notify 2 "Setting Locale $AUTOINSTALL_LANGUAGE. Please wait...\n" + dietpi-notify 2 "Setting Locale $AUTOINSTALL_LANGUAGE. Please wait...\n" #Enable user setting sed -i "/$AUTOINSTALL_LANGUAGE.UTF-8/c $AUTOINSTALL_LANGUAGE.UTF-8 UTF-8" /etc/locale.gen @@ -14584,7 +14585,7 @@ _EOF_ #Apply Keyboard if [ "$AUTOINSTALL_KEYBOARD" != "gb" ]; then - /DietPi/dietpi/func/dietpi-notify 2 "Setting Keyboard $AUTOINSTALL_KEYBOARD. Please wait...\n" + dietpi-notify 2 "Setting Keyboard $AUTOINSTALL_KEYBOARD. Please wait...\n" sed -i '/XKBLAYOUT=/c XKBLAYOUT="'"$AUTOINSTALL_KEYBOARD"'"' /etc/default/keyboard #systemctl restart keyboard-setup @@ -14708,7 +14709,7 @@ _EOF_ #Automated install if (( $AUTOINSTALL_ENABLED >= 1 )); then - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Software "Running automated installation" + dietpi-notify 3 DietPi-Software "Running automated installation" #Skip dietpi-software menu TARGETMENUID=-1 @@ -14727,7 +14728,7 @@ _EOF_ aSOFTWARE_INSTALL_STATE[$index]=1 - /DietPi/dietpi/func/dietpi-notify 2 "Automation: ${aSOFTWARE_WHIP_NAME[$index]}. Flagged for installation." + dietpi-notify 2 "Automation: ${aSOFTWARE_WHIP_NAME[$index]}. Flagged for installation." fi @@ -14756,7 +14757,7 @@ _EOF_ echo 1 > /DietPi/dietpi/.update_stage #Update APT - apt-get update + AGUP #Check for updates and apply if needed (1=force apply updates). /DietPi/dietpi/dietpi-update 1 @@ -14815,13 +14816,13 @@ _EOF_ if (( $current_loop >= $max_loops )); then - /DietPi/dietpi/func/dietpi-notify 1 "Connection test failed. $INTERNET_URL_TEST" + dietpi-notify 1 "Connection test failed. $INTERNET_URL_TEST" Exit_Destroy else - /DietPi/dietpi/func/dietpi-notify 2 "Testing connection to $INTERNET_URL_TEST" - /DietPi/dietpi/func/dietpi-notify 2 "Attempt ($current_loop / $max_loops), please wait..." + dietpi-notify 2 "Testing connection to $INTERNET_URL_TEST" + dietpi-notify 2 "Attempt ($current_loop / $max_loops), please wait..." fi @@ -14853,13 +14854,13 @@ _EOF_ #Install software and exit. if [ "$1" = "install" ] || [ "$1" = "reinstall" ] || [ "$1" = "uninstall" ] ; then - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Software "Automated $1" + dietpi-notify 3 DietPi-Software "Automated $1" sleep 1 # - Make sure we have at least one entry if [ -z "$2" ]; then - /DietPi/dietpi/func/dietpi-notify 1 "Please enter a software index ID, or, choice system INDEX_*_TARGET=-?" + dietpi-notify 1 "Please enter a software index ID, or, choice system INDEX_*_TARGET=-?" else @@ -14906,14 +14907,14 @@ _EOF_ aSOFTWARE_INSTALL_STATE[$i]=1 GOSTARTINSTALL=1 - /DietPi/dietpi/func/dietpi-notify 0 "Reinstalling ${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}" + dietpi-notify 0 "Reinstalling ${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}" sleep 1 else - /DietPi/dietpi/func/dietpi-notify 2 "$i: ${aSOFTWARE_WHIP_NAME[$i]} is not currently installed" - /DietPi/dietpi/func/dietpi-notify 2 "The program must be installed, before reinstall can be used" - /DietPi/dietpi/func/dietpi-notify 0 "No changes applied for: ${aSOFTWARE_WHIP_NAME[$i]}" + dietpi-notify 2 "$i: ${aSOFTWARE_WHIP_NAME[$i]} is not currently installed" + dietpi-notify 2 "The program must be installed, before reinstall can be used" + dietpi-notify 0 "No changes applied for: ${aSOFTWARE_WHIP_NAME[$i]}" fi @@ -14924,13 +14925,13 @@ _EOF_ aSOFTWARE_INSTALL_STATE[$i]=1 GOSTARTINSTALL=1 - /DietPi/dietpi/func/dietpi-notify 0 "Installing ${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}" + dietpi-notify 0 "Installing ${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}" sleep 0.5 else - /DietPi/dietpi/func/dietpi-notify 2 "$i: ${aSOFTWARE_WHIP_NAME[$i]} is already installed" - /DietPi/dietpi/func/dietpi-notify 0 "No changes applied for: ${aSOFTWARE_WHIP_NAME[$i]}" + dietpi-notify 2 "$i: ${aSOFTWARE_WHIP_NAME[$i]} is already installed" + dietpi-notify 0 "No changes applied for: ${aSOFTWARE_WHIP_NAME[$i]}" fi @@ -14946,7 +14947,7 @@ _EOF_ elif [ "$1" = "setpermissions" ]; then Install_Apply_Permissions &> /dev/null - /DietPi/dietpi/func/dietpi-notify 0 "Set permissions completed" + dietpi-notify 0 "Set permissions completed" #List unique software names and ID's elif [ "$1" = "list" ]; then @@ -15145,7 +15146,7 @@ _EOF_ else - /DietPi/dietpi/func/dietpi-notify 2 "Unknown command $1" + dietpi-notify 2 "Unknown command $1" fi @@ -15209,15 +15210,15 @@ _EOF_ fi - /DietPi/dietpi/func/dietpi-notify 1 "The apt cache may be corrupt, apt mirror offline, or you have held broken packages. DietPi-Software will now exit.\n" + dietpi-notify 1 "The apt cache may be corrupt, apt mirror offline, or you have held broken packages. DietPi-Software will now exit.\n" - /DietPi/dietpi/func/dietpi-notify 2 "Apt Log:\n$(cat $FP_LOG_APT)\n" + dietpi-notify 2 "Apt Log:\n$(cat $FP_LOG_APT)\n" - /DietPi/dietpi/func/dietpi-notify 2 "Please try:" - /DietPi/dietpi/func/dietpi-notify 2 "- Fixing apt package errors with 'apt-get install -f'" - /DietPi/dietpi/func/dietpi-notify 2 "- Change apt mirror: 'dietpi-config' > 'Networking: NAS/MISC' > 'Apt Mirror'" - /DietPi/dietpi/func/dietpi-notify 2 "- Clear and refresh apt 'apt-get update'" - /DietPi/dietpi/func/dietpi-notify 2 "- If problems persist, please create a Git ticket so DietPi can investigate the issue:\n - https://github.com/Fourdee/DietPi/issues\n" + dietpi-notify 2 "Please try:" + dietpi-notify 2 "- Fixing apt package errors with 'apt-get install -f'" + dietpi-notify 2 "- Change apt mirror: 'dietpi-config' > 'Networking: NAS/MISC' > 'Apt Mirror'" + dietpi-notify 2 "- Clear and refresh apt 'AGUP'" + dietpi-notify 2 "- If problems persist, please create a Git ticket so DietPi can investigate the issue:\n - https://github.com/Fourdee/DietPi/issues\n" Exit_Destroy @@ -16445,17 +16446,17 @@ _EOF_ Banner_Installing(){ - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Software "Install software" + dietpi-notify 3 DietPi-Software "Install software" echo -e " ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}" - /DietPi/dietpi/func/dietpi-notify 2 "Please wait...\n" + dietpi-notify 2 "Please wait...\n" /DietPi/dietpi/dietpi-funtime 0 } Banner_Apt_Update(){ - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Software "Update & upgrade APT" + dietpi-notify 3 DietPi-Software "Update & upgrade APT" sleep 1 } @@ -16464,23 +16465,23 @@ _EOF_ if (( ! $DISABLE_REBOOT )); then - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Software "Installation completed" + dietpi-notify 3 DietPi-Software "Installation completed" echo -e "\n The system will now reboot. \n This completes the DietPi-Software installation.\n" /DietPi/dietpi/dietpi-funtime 0 sleep 3 else - /DietPi/dietpi/func/dietpi-notify 0 "DietPi-Software installation completed." + dietpi-notify 0 "DietPi-Software installation completed." fi } Banner_Configs(){ - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Software "Optimize and configure software" - /DietPi/dietpi/func/dietpi-notify 2 "Applying DietPi optimizations and configurations for $HW_MODEL_DESCRIPTION" - /DietPi/dietpi/func/dietpi-notify 2 "Please wait...\n" + dietpi-notify 3 DietPi-Software "Optimize and configure software" + dietpi-notify 2 "Applying DietPi optimizations and configurations for $HW_MODEL_DESCRIPTION" + dietpi-notify 2 "Please wait...\n" /DietPi/dietpi/dietpi-funtime 0 #List software due for configuration @@ -16489,7 +16490,7 @@ _EOF_ # if (( ${aSOFTWARE_INSTALL_STATE[$i]} == 1 )); then - # /DietPi/dietpi/func/dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}" + # dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}" # fi @@ -16518,7 +16519,7 @@ _EOF_ # Main Loop #///////////////////////////////////////////////////////////////////////////////////// #-------------------------------------------------------------------------------------- - /DietPi/dietpi/func/dietpi-notify 2 "Initializing database, please wait..." + dietpi-notify 2 "Initializing database, please wait..." #-------------------------------------------------------------------------------------- #Init software arrays diff --git a/dietpi/dietpi-sync b/dietpi/dietpi-sync index c8bb2f4b37..c66a2f4d31 100644 --- a/dietpi/dietpi-sync +++ b/dietpi/dietpi-sync @@ -470,7 +470,7 @@ mode='Dry Run' fi - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Sync "$mode" + dietpi-notify 3 DietPi-Sync "$mode" } @@ -579,7 +579,7 @@ echo -e "\n\nInstalling Rsync, please wait....\n\n" sleep 1 - apt-get install rsync -y + AGI rsync fi diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 208827afa5..419386815b 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -84,7 +84,7 @@ URL_MIRROR_INDEX=$i - /DietPi/dietpi/func/dietpi-notify 2 "Checking Mirror : ${URL_MIRROR_SERVERVERSION[$i]}" + dietpi-notify 2 "Checking Mirror : ${URL_MIRROR_SERVERVERSION[$i]}" curl -k -L ${URL_MIRROR_SERVERVERSION[$i]} > "$FILEPATH_TEMP"/server_version if (( $? == 0 )); then @@ -96,19 +96,19 @@ if [[ $VERSION_SERVER =~ ^-?[0-9]+$ ]]; then SERVER_ONLINE=1 - /DietPi/dietpi/func/dietpi-notify 0 "Using update server: ${URL_MIRROR_SERVERVERSION[$i]}" + dietpi-notify 0 "Using update server: ${URL_MIRROR_SERVERVERSION[$i]}" break else - /DietPi/dietpi/func/dietpi-notify 2 "Invalid server version and/or update file unavailable" + dietpi-notify 2 "Invalid server version and/or update file unavailable" fi else - /DietPi/dietpi/func/dietpi-notify 2 "No response from: ${URL_MIRROR_SERVERVERSION[$i]}" + dietpi-notify 2 "No response from: ${URL_MIRROR_SERVERVERSION[$i]}" fi @@ -134,9 +134,9 @@ UPDATE_AVAILABLE=1 echo -e "" - /DietPi/dietpi/func/dietpi-notify 0 "Update available" - /DietPi/dietpi/func/dietpi-notify 2 "Current Version : $VERSION_CURRENT" - /DietPi/dietpi/func/dietpi-notify 2 "Server Version : $VERSION_SERVER" + dietpi-notify 0 "Update available" + dietpi-notify 2 "Current Version : $VERSION_CURRENT" + dietpi-notify 2 "Server Version : $VERSION_SERVER" #Write update available version to file. echo -e "$VERSION_SERVER" > /DietPi/dietpi/.update_available @@ -145,7 +145,7 @@ else - /DietPi/dietpi/func/dietpi-notify 1 "Unable to access update servers. Please check your connection, then run dietpi-update again." + dietpi-notify 1 "Unable to access update servers. Please check your connection, then run dietpi-update again." exit fi @@ -217,19 +217,19 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok #Run Patch file while (( $VERSION_CURRENT < $VERSION_SERVER )); do - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Update "Updating DietPi" - /DietPi/dietpi/func/dietpi-notify 2 "Current Version : $VERSION_CURRENT" - /DietPi/dietpi/func/dietpi-notify 2 "Server Version : $VERSION_SERVER\n" + dietpi-notify 3 DietPi-Update "Updating DietPi" + dietpi-notify 2 "Current Version : $VERSION_CURRENT" + dietpi-notify 2 "Server Version : $VERSION_SERVER\n" #Run patch file - /DietPi/dietpi/func/dietpi-notify 2 "Patching $VERSION_CURRENT to $(( $VERSION_CURRENT + 1 ))" + dietpi-notify 2 "Patching $VERSION_CURRENT to $(( $VERSION_CURRENT + 1 ))" /DietPi/dietpi/patch_file "$VERSION_CURRENT" "$VERSION_SERVER" #Update Local Version ID ((VERSION_CURRENT++)) echo -e "$VERSION_CURRENT" > /DietPi/dietpi/.version - /DietPi/dietpi/func/dietpi-notify 0 "Patch $VERSION_CURRENT completed\n" + dietpi-notify 0 "Patch $VERSION_CURRENT completed\n" Get_Client_Version @@ -245,7 +245,7 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok #Unable to download file. else - /DietPi/dietpi/func/dietpi-notify 1 "Download failed, unable to run update. Please try running dietpi-update again." + dietpi-notify 1 "Download failed, unable to run update. Please try running dietpi-update again." exit fi @@ -257,7 +257,7 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok #///////////////////////////////////////////////////////////////////////////////////// #---------------------------------------------------------------- #Inform user - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Update "Checking for DietPi updates" + dietpi-notify 3 DietPi-Update "Checking for DietPi updates" #---------------------------------------------------------------- #Create temp directory used in dietpi-update rm -R "$FILEPATH_TEMP" &> /dev/null @@ -291,7 +291,7 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok #Cannot update, Image required whiptail --title "New image required" --msgbox " Your version of DietPi is now obsolete and cannot be updated. \n\n Please download the latest DietPi image:\n - http://dietpi.com/downloads/images \n\n - Current Version : $VERSION_CURRENT \n - Server Version : $VERSION_SERVER \n " 13 70 - /DietPi/dietpi/func/dietpi-notify 1 "Your version of DietPi is now obsolete and cannot be updated." + dietpi-notify 1 "Your version of DietPi is now obsolete and cannot be updated." echo -e "Please download the latest DietPi image:\n - http://dietpi.com/download \n\n - Current Version : $VERSION_CURRENT \n - Server Version : $VERSION_SERVER \n " #Update available @@ -306,9 +306,9 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok #Forced update elif (( $INPUT == 1 )); then - /DietPi/dietpi/func/dietpi-notify 0 "Updates have been found and are being applied, please wait..." - /DietPi/dietpi/func/dietpi-notify 2 "Current Version : $VERSION_CURRENT" - /DietPi/dietpi/func/dietpi-notify 2 "Server Version : $VERSION_SERVER" + dietpi-notify 0 "Updates have been found and are being applied, please wait..." + dietpi-notify 2 "Current Version : $VERSION_CURRENT" + dietpi-notify 2 "Server Version : $VERSION_SERVER" /DietPi/dietpi/dietpi-funtime 0 @@ -325,9 +325,9 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok else echo -e "" - /DietPi/dietpi/func/dietpi-notify 0 "No updates required, your DietPi installation is up to date.\n" - /DietPi/dietpi/func/dietpi-notify 2 "Current Version : $VERSION_CURRENT" - /DietPi/dietpi/func/dietpi-notify 2 "Server Version : $VERSION_SERVER" + dietpi-notify 0 "No updates required, your DietPi installation is up to date.\n" + dietpi-notify 2 "Current Version : $VERSION_CURRENT" + dietpi-notify 2 "Server Version : $VERSION_SERVER" sleep 2 fi @@ -359,11 +359,14 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok #Remove update_available file rm /DietPi/dietpi/.update_available &> /dev/null + #Sync to disk now: http://dietpi.com/phpbb/viewtopic.php?f=9&t=2591 + sync + #Done - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Update "Completed" - /DietPi/dietpi/func/dietpi-notify 2 "Current Version : $VERSION_CURRENT" - /DietPi/dietpi/func/dietpi-notify 2 "Server Version : $VERSION_SERVER" - /DietPi/dietpi/func/dietpi-notify 0 "Update completed" + dietpi-notify 3 DietPi-Update "Completed" + dietpi-notify 2 "Current Version : $VERSION_CURRENT" + dietpi-notify 2 "Server Version : $VERSION_SERVER" + dietpi-notify 0 "Update completed" echo -e "" echo -e "Please reboot your system now, using the command \e[31;49;1mreboot\e[0m" diff --git a/dietpi/func/check_connection b/dietpi/func/check_connection index a7de1849f4..b6c52b9d31 100644 --- a/dietpi/func/check_connection +++ b/dietpi/func/check_connection @@ -32,8 +32,8 @@ # Main Loop #///////////////////////////////////////////////////////////////////////////////////// #----------------------------------------------------------------------------------- - /DietPi/dietpi/func/dietpi-notify 2 "Testing connection to $INTERNET_ADDRESS" - /DietPi/dietpi/func/dietpi-notify 2 "Max duration of $(($TIMEOUT * $RETRYCOUNT)) seconds, please wait..." + dietpi-notify 2 "Testing connection to $INTERNET_ADDRESS" + dietpi-notify 2 "Max duration of $(($TIMEOUT * $RETRYCOUNT)) seconds, please wait..." wget -q --spider --timeout="$TIMEOUT" --tries="$RETRYCOUNT" "$INTERNET_ADDRESS" @@ -41,7 +41,7 @@ #https://github.com/Fourdee/DietPi/issues/352#issuecomment-221013166 EXIT_CODE=$? - /DietPi/dietpi/func/dietpi-notify -1 $EXIT_CODE "Connection test |" + dietpi-notify -1 $EXIT_CODE "Connection test |" #----------------------------------------------------------------------------------- #return exit code diff --git a/dietpi/func/create_mysql_db b/dietpi/func/create_mysql_db index 98fb086143..a95e541843 100644 --- a/dietpi/func/create_mysql_db +++ b/dietpi/func/create_mysql_db @@ -30,12 +30,12 @@ #Start sql if not running. service mysql start &> /dev/null - /DietPi/dietpi/func/dietpi-notify 2 "Creating MySql DB for $DATABASE_NAME\n" + dietpi-notify 2 "Creating MySql DB for $DATABASE_NAME\n" #Generate DB mysql -u root -p$MYSQL_ROOT_PW -e "create database \`$DATABASE_NAME\`;GRANT ALL PRIVILEGES ON \`$DATABASE_NAME\`.* TO $DATABASE_USER@localhost IDENTIFIED BY '$DATABASE_PW';FLUSH PRIVILEGES;" - /DietPi/dietpi/func/dietpi-notify -1 $? "Create database $DATABASE_NAME |" + dietpi-notify -1 $? "Create database $DATABASE_NAME |" #----------------------------------------------------------------------------------- exit diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index fc13b4a8a3..6c5a5d99a4 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -10,6 +10,12 @@ # # Info: # - Allows export of shared DietPi global variables into current bash session, and, other scripts + # + # Excluded scripts, which do NOT load these globals + # - dietpi-ramlog + # - dietpi-ramdisk + # - PREP_SYSTEM_FOR_DIETPI.sh + # # Notes: # - . /DietPi/dietpi/func/dietpi-globals > $HOME/.bashrc # - . /DietPi/dietpi/func/dietpi-globals > for each script that uses these globals @@ -22,10 +28,8 @@ fi - #/DietPi/dietpi/func/dietpi-notify 2 'Updating DietPi-Globals, please wait...' - #----------------------------------------------------------------------------------- - # Core var's, functions, environment checks. Used at start of all scripts. + # Core var's, functions, environment. Used at start of all scripts. #----------------------------------------------------------------------------------- #Prevent incorrect parsing with non-english locales. LANG=en_GB.UTF-8 @@ -33,11 +37,140 @@ #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 cd "$HOME" + #----------------------------------------------------------------------------------- + # DietPi-Notify + #----------------------------------------------------------------------------------- + # $1: + # -1=autodetect_fail_ok + # - $2 = EXIT_CODE + # 0=OK + # - $2 = text + # 1=failed + # - $2 = text + # 2=info + # - $2 = text + # 3=DietPi banner style + # - $2 = txt program name + # - $3 = txt mode + dietpi-notify(){ + + local ainput_string=("$@") + + #header_line="\e[38;5;154m─────────────────────────────────────────────────────\e[0m" + local header_line="\e[90m─────────────────────────────────────────────────────\e[0m" + + local status_text_ok="\e[32mOk\e[0m" + local status_text_failed="\e[31mFailed:\e[0m" + + local bracket_string_l="\e[90m[\e[0m" + local bracket_string_r="\e[90m]\e[0m" + + #Funcs + + Print_Ok(){ + + echo -ne " $bracket_string_l\e[32mOk\e[0m$bracket_string_r" + + } + + Print_Failed(){ + + echo -ne " $bracket_string_l\e[31mFailed\e[0m$bracket_string_r" + + } + + # - Print all input string on same line + # - $1 = start printing from word number $1 + Print_Input_String(){ + + for (( i=$1;i<${#ainput_string[@]} ;i++)) + do + echo -ne " ${ainput_string[${i}]}" + done + + echo -e "" + + # echo -e "SIZE = ${#ainput_string}" + + # ainput_string="$@" + # for (( i=$1;i<${#ainput_string} ;i++)) + # do + # echo -ne "${ainput_string:$i:1}" + # sleep 0.02 + # done + + } + + #-------------------------------------------------------------------------------------- + # Main Loop + #-------------------------------------------------------------------------------------- + #Exit code, print OK or Failed + #$2 = exit code + # - Use this at end of DietPi scripts, EG: dietpi-notify -1 ${EXIT_CODE:=0} + if (( $1 == -1 )); then + + if [ "$2" = "0" ]; then + + ainput_string+=("Completed") + Print_Ok + Print_Input_String 2 + echo -e "" + + else + + ainput_string+=("An issue has occured") + Print_Failed + Print_Input_String 2 + echo -e "" + + fi + + #-------------------------------------------------------------------------------------- + #Status Ok + #$@ = txt desc + elif (( $1 == 0 )); then + + Print_Ok + Print_Input_String 1 + + #Status failed + #$@ = txt desc + elif (( $1 == 1 )); then + + Print_Failed + Print_Input_String 1 + + #Status Info + #$@ = txt desc + elif (( $1 == 2 )); then + + echo -ne " $bracket_string_l\e[0mInfo\e[0m$bracket_string_r" + echo -ne "\e[90m" + Print_Input_String 1 + echo -ne "\e[0m" + + #DietPi banner style + #$2 = txt program name + #$3 = txt mode + elif (( $1 == 3 )); then + + echo -e "\n \e[38;5;154m$2\e[0m" + echo -e "$header_line" + echo -e " \e[90mMode:\e[0m$(Print_Input_String 2)" + echo -e " \e[90mPlease wait...\e[0m\n" + + fi + #----------------------------------------------------------------------------------- + unset ainput_string + #----------------------------------------------------------------------------------- + + } + CHECK_ROOT_USER(){ if (( $UID != 0 )); then - /DietPi/dietpi/func/dietpi-notify 1 'Error: Root privileges required. Please run the command with "sudo"\n' + dietpi-notify 1 'Error: Root privileges required. Please run the command with "sudo"\n' exit 1 fi @@ -50,7 +183,7 @@ /DietPi/dietpi/dietpi-drive_manager 3 if (( $? != 0 )); then - /DietPi/dietpi/func/dietpi-notify 1 'Error: RootFS is currently Read Only, unable to continue.\n' + dietpi-notify 1 'Error: RootFS is currently Read Only, unable to continue.\n' exit 1 fi @@ -66,30 +199,39 @@ #----------------------------------------------------------------------------------- # Hardware Details #----------------------------------------------------------------------------------- - #Update? - if [ ! -f /DietPi/dietpi/.hw_model ]; then + HW_MODEL=0 + HW_MODEL_DESCRIPTION='NULL' + HW_ARCH=0 + HW_CPU_CORES=1 + HW_CPUID=0 - /DietPi/dietpi/dietpi-obtain_hw_model + DISTRO=0 + DISTRO_NAME='NULL' - fi + # - Update + # NB: dietpi-boot service launches dietpi-obtain_hw_model to create the following file + if [ -f /DietPi/dietpi/.hw_model ]; then - HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) - HW_MODEL_DESCRIPTION=$(sed -n 2p /DietPi/dietpi/.hw_model) - HW_ARCH=$(sed -n 6p /DietPi/dietpi/.hw_model) - HW_CPU_CORES=$(nproc --all) - HW_CPUID=$(sed -n 9p /DietPi/dietpi/.hw_model) + HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) + HW_MODEL_DESCRIPTION=$(sed -n 2p /DietPi/dietpi/.hw_model) + HW_ARCH=$(sed -n 6p /DietPi/dietpi/.hw_model) + HW_CPU_CORES=$(nproc --all) + HW_CPUID=$(sed -n 9p /DietPi/dietpi/.hw_model) - DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) - DISTRO_NAME='jessie' - if (( $DISTRO == 4 )); then + DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) + DISTRO_NAME='jessie' + if (( $DISTRO == 4 )); then - DISTRO_NAME='stretch' + DISTRO_NAME='stretch' - elif (( $DISTRO == 5 )); then + elif (( $DISTRO == 5 )); then - DISTRO_NAME='buster' + DISTRO_NAME='buster' + + fi fi + #----------------------------------------------------------------------------------- # DietPi specific directories #----------------------------------------------------------------------------------- @@ -127,8 +269,8 @@ fi #-qq can add a slight period of appearing nothing is happening, lets inform user - /DietPi/dietpi/func/dietpi-notify 2 "APT installation for: $string" - /DietPi/dietpi/func/dietpi-notify 2 "APT is processing, please wait...\n" + dietpi-notify 2 "APT installation for: $string" + dietpi-notify 2 "APT is processing, please wait...\n" DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $force_options $string 2>&1 | tee "$FP_LOG_APT" EXITCODE_APT=${PIPESTATUS[0]} @@ -145,8 +287,8 @@ fi - /DietPi/dietpi/func/dietpi-notify 2 "APT removal for: $string" - apt-get purge -y $string $options + dietpi-notify 2 "APT removal for: $string" + DEBIAN_FRONTEND=noninteractive apt-get purge -y $string $options EXITCODE_APT=${PIPESTATUS[0]} } @@ -154,8 +296,8 @@ #apt-get autoremove AGA(){ - /DietPi/dietpi/func/dietpi-notify 2 "APT autoremove + purge" - apt-get autoremove --purge -y + dietpi-notify 2 "APT autoremove + purge" + DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y EXITCODE_APT=${PIPESTATUS[0]} } @@ -163,13 +305,53 @@ #apt-get install -f AGF(){ - /DietPi/dietpi/func/dietpi-notify 2 "APT fix" - DEBIAN_FRONTEND=noninteractive apt-get install -f -y $force_options 2>&1 | tee "$FP_LOG_APT" + dietpi-notify 2 "APT fix" + DEBIAN_FRONTEND=noninteractive apt-get install -f -y 2>&1 | tee "$FP_LOG_APT" + EXITCODE_APT=${PIPESTATUS[0]} + + } + + #apt-get update + AGUP(){ + + dietpi-notify 2 "APT update" + DEBIAN_FRONTEND=noninteractive apt-get update 2>&1 | tee "$FP_LOG_APT" + EXITCODE_APT=${PIPESTATUS[0]} + + } + + #apt-get upgrade + AGUG(){ + + dietpi-notify 2 "APT upgrade" + DEBIAN_FRONTEND=noninteractive apt-get upgrade -y 2>&1 | tee "$FP_LOG_APT" + EXITCODE_APT=${PIPESTATUS[0]} + + } + + #apt-get dist-upgrade + AGDUG(){ + + local string="$@" + local force_options='' + + if (( $DISTRO >= 4 )); then + + force_options='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' + + else + + force_options='--force-yes' + + fi + + dietpi-notify 2 "APT dist-upgrade" + DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y 2>&1 | tee "$FP_LOG_APT" EXITCODE_APT=${PIPESTATUS[0]} } #----------------------------------------------------------------------------------- - #/DietPi/dietpi/func/dietpi-notify 0 'DietPi-Globals\n' + #dietpi-notify 0 'DietPi-Globals\n' #----------------------------------------------------------------------------------- } diff --git a/dietpi/func/dietpi-led_control b/dietpi/func/dietpi-led_control index c54a033ae8..32e2e8d105 100644 --- a/dietpi/func/dietpi-led_control +++ b/dietpi/func/dietpi-led_control @@ -50,7 +50,7 @@ if (( ${#aLED_NAME[@]} == 0 )); then - /DietPi/dietpi/func/dietpi-notify 1 'Unable to find any supported LEDS on this device.' + dietpi-notify 1 'Unable to find any supported LEDS on this device.' exit fi @@ -61,7 +61,7 @@ rm "$FP_SETTINGS" &> /dev/null - /DietPi/dietpi/func/dietpi-notify 3 DietPi-LED_Control "Applying LED triggers" + dietpi-notify 3 DietPi-LED_Control "Applying LED triggers" for ((i=0; i<${#aLED_NAME[@]}; i++)) do @@ -70,11 +70,11 @@ echo -e "${aLED_SETTING_CURRENT[$i]}" > "/sys/class/leds/${aLED_NAME[$i]}/trigger" if (( $? == 0 )); then - /DietPi/dietpi/func/dietpi-notify 0 "${aLED_NAME[$i]}: ${aLED_SETTING_CURRENT[$i]}" + dietpi-notify 0 "${aLED_NAME[$i]}: ${aLED_SETTING_CURRENT[$i]}" else - /DietPi/dietpi/func/dietpi-notify 1 "${aLED_NAME[$i]}: ${aLED_SETTING_CURRENT[$i]}" + dietpi-notify 1 "${aLED_NAME[$i]}: ${aLED_SETTING_CURRENT[$i]}" fi diff --git a/dietpi/func/dietpi-notify b/dietpi/func/dietpi-notify deleted file mode 100644 index 86b1f117e4..0000000000 --- a/dietpi/func/dietpi-notify +++ /dev/null @@ -1,134 +0,0 @@ -#!/bin/bash -{ - #//////////////////////////////////// - # DietPi Function: - # - #//////////////////////////////////// - # Created by Daniel Knight / daniel.knight@dietpi.com / dietpi.com - # - #//////////////////////////////////// - # - # Info: - # - - # - # Usage: - # - /DietPi/dietpi/func/dietpi-notify - #//////////////////////////////////// - - #Import DietPi-Globals --------------------------------------------------------------- - . /DietPi/dietpi/func/dietpi-globals - #Import DietPi-Globals --------------------------------------------------------------- - - aINPUT_STRING=("$@") - - #HEADER_LINE="\e[38;5;154m─────────────────────────────────────────────────────\e[0m" - HEADER_LINE="\e[90m─────────────────────────────────────────────────────\e[0m" - - STATUS_TEXT_OK="\e[32mOk\e[0m" - STATUS_TEXT_FAILED="\e[31mFailed:\e[0m" - - BRACKET_STRING_L="\e[90m[\e[0m" - BRACKET_STRING_R="\e[90m]\e[0m" - - #Funcs - - Print_Ok(){ - - echo -ne " $BRACKET_STRING_L\e[32mOk\e[0m$BRACKET_STRING_R" - - } - - Print_Failed(){ - - echo -ne " $BRACKET_STRING_L\e[31mFailed\e[0m$BRACKET_STRING_R" - - } - - # - Print all input string on same line - # - $1 = start printing from word number $1 - Print_Input_String(){ - - for (( i=$1;i<${#aINPUT_STRING[@]} ;i++)) - do - echo -ne " ${aINPUT_STRING[${i}]}" - done - - echo -e "" - - # echo -e "SIZE = ${#aINPUT_STRING}" - - # aINPUT_STRING="$@" - # for (( i=$1;i<${#aINPUT_STRING} ;i++)) - # do - # echo -ne "${aINPUT_STRING:$i:1}" - # sleep 0.02 - # done - - } - - #///////////////////////////////////////////////////////////////////////////////////// - # Main Loop - #///////////////////////////////////////////////////////////////////////////////////// - #-------------------------------------------------------------------------------------- - #Exit code, print OK or Failed - #$2 = exit code - # - Use this at end of DietPi scripts, EG: /DietPi/dietpi/func/dietpi-notify -1 ${EXIT_CODE:=0} - if (( $1 == -1 )); then - - if [ "$2" = "0" ]; then - - aINPUT_STRING+=("Completed") - Print_Ok - Print_Input_String 2 - echo -e "" - - else - - aINPUT_STRING+=("An issue has occured") - Print_Failed - Print_Input_String 2 - echo -e "" - - fi - - #-------------------------------------------------------------------------------------- - #Status Ok - #$@ = txt desc - elif (( $1 == 0 )); then - - Print_Ok - Print_Input_String 1 - - #Status failed - #$@ = txt desc - elif (( $1 == 1 )); then - - Print_Failed - Print_Input_String 1 - - #Status Info - #$@ = txt desc - elif (( $1 == 2 )); then - - echo -ne " $BRACKET_STRING_L\e[0mInfo\e[0m$BRACKET_STRING_R" - echo -ne "\e[90m" - Print_Input_String 1 - echo -ne "\e[0m" - - #DietPi banner style - #$2 = txt program name - #$3 = txt mode - elif (( $1 == 3 )); then - - echo -e "\n \e[38;5;154m$2\e[0m" - echo -e "$HEADER_LINE" - echo -e " \e[90mMode:\e[0m$(Print_Input_String 2)" - echo -e " \e[90mPlease wait...\e[0m\n" - - fi - #----------------------------------------------------------------------------------- - unset aINPUT_STRING - #----------------------------------------------------------------------------------- - exit - #----------------------------------------------------------------------------------- -} diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index a62faa6fc4..13c4ef4d9d 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -19,8 +19,16 @@ # - /DietPi/dietpi/func/dietpi-set_core_environment #//////////////////////////////////// + #Support Globals loaded on non-dietpi systems + FP_SCRIPTS='/boot' + if [ -f /DietPi/dietpi/dietpi-software ]; then + + FP_SCRIPTS='/DietPi' + + fi + #Import DietPi-Globals ------------------------------------------------------------- - #. $FP_SCRIPTS/dietpi/func/dietpi-globals # Not required/compatible + . $FP_SCRIPTS/dietpi/func/dietpi-globals # NB: HW_* info not loaded #Import DietPi-Globals ------------------------------------------------------------- if (( $UID != 0 )); then @@ -30,13 +38,6 @@ fi - FP_SCRIPTS='/boot' - if [ -f /DietPi/dietpi/dietpi-software ]; then - - FP_SCRIPTS='/DietPi' - - fi - DIETPI_USERNAME='dietpi' DIETPI_PASSWORD='dietpi' @@ -100,12 +101,12 @@ _EOF_ #/////////////////////////////////////////////////////////////////////////////////// # Main Loop #/////////////////////////////////////////////////////////////////////////////////// - $FP_SCRIPTS/dietpi/func/dietpi-notify 2 "Creating core DietPi environment, please wait..." + dietpi-notify 2 "Creating core DietPi environment, please wait..." #----------------------------------------------------------------------------------- #Bash - $FP_SCRIPTS/dietpi/func/dietpi-notify 2 "Configuring .bashrc:" + dietpi-notify 2 "Configuring .bashrc:" sed -i '/DietPi/d' /root/.bashrc cat << _EOF_ >> /root/.bashrc @@ -113,7 +114,7 @@ _EOF_ . /DietPi/dietpi/func/dietpi-globals _EOF_ - $FP_SCRIPTS/dietpi/func/dietpi-notify 2 "Configuring /etc/bash.bashrc:" + dietpi-notify 2 "Configuring /etc/bash.bashrc:" sed -i '/#DietPi_Entries/,$d' /etc/bash.bashrc sed -i '/LANG=/,$d' /etc/bash.bashrc # pre v160 images @@ -172,7 +173,7 @@ _EOF_ #----------------------------------------------------------------------------------- #Create_DietPi_User - $FP_SCRIPTS/dietpi/func/dietpi-notify 2 'Creating DietPi User Account:' + dietpi-notify 2 'Creating DietPi User Account:' Create_DietPi_User @@ -180,14 +181,14 @@ _EOF_ #UID bit for sudo # - https://github.com/Fourdee/DietPi/issues/794 - $FP_SCRIPTS/dietpi/func/dietpi-notify 2 'Configuring Sudo UID bit:' + dietpi-notify 2 'Configuring Sudo UID bit:' chmod 4755 $(which sudo) #----------------------------------------------------------------------------------- #Dir's - $FP_SCRIPTS/dietpi/func/dietpi-notify 2 'Configuring DietPi Directories:' + dietpi-notify 2 'Configuring DietPi Directories:' # - /etc/dietpi , in process of moving this over to /var/lib/dietpi and /var/tmp/dietpi mkdir -p /etc/dietpi @@ -225,7 +226,7 @@ _EOF_ #----------------------------------------------------------------------------------- #Services - $FP_SCRIPTS/dietpi/func/dietpi-notify 2 'Configuring DietPi Services:' + dietpi-notify 2 'Configuring DietPi Services:' cat << _EOF_ > /etc/systemd/system/dietpi-ramdisk.service [Unit] @@ -308,7 +309,7 @@ _EOF_ while [ ! -f /DietPi/.ramdisk ] do - /DietPi/dietpi/func/dietpi-notify 2 "Waiting for DietPi-RAMDISK to finish mounting DietPi to RAM..." + dietpi-notify 2 "Waiting for DietPi-RAMDISK to finish mounting DietPi to RAM..." sleep 1 done @@ -345,7 +346,7 @@ _EOF_ #----------------------------------------------------------------------------------- #Cron Jobs - $FP_SCRIPTS/dietpi/func/dietpi-notify 2 "Configuring Cron:" + dietpi-notify 2 "Configuring Cron:" cp $FP_SCRIPTS/dietpi/conf/cron.daily_dietpi /etc/cron.daily/dietpi chmod +x /etc/cron.daily/dietpi @@ -370,7 +371,7 @@ _EOF_ #----------------------------------------------------------------------------------- #Network - $FP_SCRIPTS/dietpi/func/dietpi-notify 2 "Configuring: Prefer wlan/eth naming for networked devices:" + dietpi-notify 2 "Configuring: Prefer wlan/eth naming for networked devices:" # - Prefer to use wlan/eth naming for networked devices (eg: stretch) ln -sf /dev/null /etc/systemd/network/99-default.link @@ -383,18 +384,18 @@ _EOF_ #----------------------------------------------------------------------------------- #MISC - $FP_SCRIPTS/dietpi/func/dietpi-notify 2 "Disabling apt-daily services (prevents random APT cache lock):" + dietpi-notify 2 "Disabling apt-daily services (prevents random APT cache lock):" systemctl mask apt-daily.service &> /dev/null systemctl mask apt-daily-upgrade.timer &> /dev/null - $FP_SCRIPTS/dietpi/func/dietpi-notify 2 "Setting vm.swappiness=1:" + dietpi-notify 2 "Setting vm.swappiness=1:" sed -i '/vm.swappiness=/d' /etc/sysctl.conf echo -e "vm.swappiness=1" > /etc/sysctl.d/97-dietpi.conf #----------------------------------------------------------------------------------- - $FP_SCRIPTS/dietpi/func/dietpi-notify 0 "Completed DietPi core environment" + dietpi-notify 0 "Completed DietPi core environment" exit #----------------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/dietpi/func/dietpi-set_dphys-swapfile b/dietpi/func/dietpi-set_dphys-swapfile index f6f5658699..9c90174bf4 100644 --- a/dietpi/func/dietpi-set_dphys-swapfile +++ b/dietpi/func/dietpi-set_dphys-swapfile @@ -42,7 +42,7 @@ SERVICE_MODE="" Delete_Swapfile(){ - /DietPi/dietpi/func/dietpi-notify 2 "Deleting existing swapfile ($SWAP_LOCATION_CURRENT)\n" + dietpi-notify 2 "Deleting existing swapfile ($SWAP_LOCATION_CURRENT)\n" rm "$SWAP_LOCATION_CURRENT" &> /dev/null } @@ -57,7 +57,7 @@ Swap_Disable(){ - /DietPi/dietpi/func/dietpi-notify 3 DietPi Disable swapfile + dietpi-notify 3 DietPi Disable swapfile SWAP_SIZE_TARGET=0 SERVICE_MODE="disable" @@ -70,9 +70,9 @@ Swap_Enable(){ - /DietPi/dietpi/func/dietpi-notify 3 DietPi Generating new swapfile - /DietPi/dietpi/func/dietpi-notify 2 "Size = $SWAP_SIZE_TARGET MB" - /DietPi/dietpi/func/dietpi-notify 2 "Location = $SWAP_LOCATION_TARGET" + dietpi-notify 3 DietPi Generating new swapfile + dietpi-notify 2 "Size = $SWAP_SIZE_TARGET MB" + dietpi-notify 2 "Location = $SWAP_LOCATION_TARGET" SERVICE_MODE="enable" dphys-swapfile swapoff @@ -125,7 +125,7 @@ systemctl "$SERVICE_MODE" dphys-swapfile - /DietPi/dietpi/func/dietpi-notify 2 "Completed\n" + dietpi-notify 2 "Completed\n" fi #----------------------------------------------------------------------------------- diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index ef14bf89a6..6143f21c1d 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -67,7 +67,7 @@ $FP_SCRIPT lcdpanel target_panel (none to remove all) Unknown_Input_Name(){ EXIT_CODE=1 - /DietPi/dietpi/func/dietpi-notify 2 "Unknown input name ($INPUT_DEVICE_NAME). Nothing has been applied." + dietpi-notify 2 "Unknown input name ($INPUT_DEVICE_NAME). Nothing has been applied." echo -e "$AVAIABLE_COMMANDS" @@ -76,7 +76,7 @@ $FP_SCRIPT lcdpanel target_panel (none to remove all) Unknown_Input_Mode(){ EXIT_CODE=1 - /DietPi/dietpi/func/dietpi-notify 2 "Unknown input value ($INPUT_DEVICE_VALUE). Nothing has been applied." + dietpi-notify 2 "Unknown input value ($INPUT_DEVICE_VALUE). Nothing has been applied." } @@ -188,10 +188,10 @@ systemctl enable dietpi-rm_program_usb_boot_mode.service # - LIRC if (( ! $(dpkg --get-selections | grep -ci -m1 '^lirc') )); then - apt-get install -y lirc - if (( $? != 0 )); then + AGI lirc + if (( $EXITCODE_APT != 0 )); then - /DietPi/dietpi/func/dietpi-notify 1 "apt-get install lirc" + dietpi-notify 1 "apt-get install lirc" EXIT_CODE=1 fi @@ -381,7 +381,7 @@ _EOF_ # + MPD control if (( ! $(dpkg --get-selections | grep -ci -m1 '^mpc[[:space:]]') )); then - apt-get install -y mpc + AGI mpc fi @@ -516,7 +516,7 @@ _EOF_ unzip -o package.zip -d / if (( $? != 0 )); then - /DietPi/dietpi/func/dietpi-notify 1 "Failed to extract $INPUT_DEVICE_NAME." + dietpi-notify 1 "Failed to extract $INPUT_DEVICE_NAME." fi @@ -527,13 +527,13 @@ _EOF_ else - /DietPi/dietpi/func/dietpi-notify 1 "Failed to install $INPUT_DEVICE_NAME. $install_url_address may be offline or unreachable." + dietpi-notify 1 "Failed to install $INPUT_DEVICE_NAME. $install_url_address may be offline or unreachable." fi else - /DietPi/dietpi/func/dietpi-notify 2 "$INPUT_DEVICE_NAME: Currently running latest kernel, no updates required." + dietpi-notify 2 "$INPUT_DEVICE_NAME: Currently running latest kernel, no updates required." fi @@ -555,7 +555,7 @@ _EOF_ unzip -o package.zip -d / if (( $? != 0 )); then - /DietPi/dietpi/func/dietpi-notify 1 "Failed to extract kernel $INPUT_DEVICE_NAME." + dietpi-notify 1 "Failed to extract kernel $INPUT_DEVICE_NAME." fi @@ -578,7 +578,7 @@ _EOF_ else - /DietPi/dietpi/func/dietpi-notify 1 "Failed to install $INPUT_DEVICE_NAME. $install_url_address may be offline or unreachable." + dietpi-notify 1 "Failed to install $INPUT_DEVICE_NAME. $install_url_address may be offline or unreachable." fi @@ -644,16 +644,16 @@ _EOF_ /DietPi/dietpi/dietpi-software install 6 # - GL packages - /DietPi/dietpi/func/dietpi-notify 2 "Installing additional OpenGL packages, please wait...\n" + dietpi-notify 2 "Installing additional OpenGL packages, please wait...\n" sleep 1 - apt-get install -y libgl1-mesa-dri mesa-utils + AGI libgl1-mesa-dri mesa-utils sed -i '/dtoverlay=vc4-kms-v3d/d' "$FP_RPI_CONFIG" echo -e "\ndtoverlay=vc4-kms-v3d" >> "$FP_RPI_CONFIG" else - /DietPi/dietpi/func/dietpi-notify 1 "OpenGL requires a RPi 2 or higher" + dietpi-notify 1 "OpenGL requires a RPi 2 or higher" sleep 2 fi @@ -676,7 +676,7 @@ _EOF_ Lcd_Panel_Not_Available_For_Device(){ EXIT_CODE=1 - /DietPi/dietpi/func/dietpi-notify 2 "$INPUT_DEVICE_VALUE is not available for this device. Nothing has been applied." + dietpi-notify 2 "$INPUT_DEVICE_VALUE is not available for this device. Nothing has been applied." } @@ -722,7 +722,7 @@ _EOF_ Lcd_Panel_Xorg_All_Enable(){ #Xinput calibrator - apt-get install -y xinput-calibrator + AGI xinput-calibrator mkdir -p /etc/X11/xorg.conf.d @@ -1068,9 +1068,9 @@ _EOF_ #Check/install pre-reqs if (( $(dpkg -l | grep -ci -m1 'i2c-tools') == 0 )); then - /DietPi/dietpi/func/dietpi-notify 2 "Installing Python-smbus, i2c-tools, pre-reqs.\nPlease wait...\n" + dietpi-notify 2 "Installing Python-smbus, i2c-tools, pre-reqs.\nPlease wait...\n" sleep 1 - apt-get install python-smbus i2c-tools -y + AGI python-smbus i2c-tools fi @@ -1161,7 +1161,7 @@ _EOF_ systemctl stop bluetooth 2> /dev/null if (( $? != 0 )); then - /DietPi/dietpi/func/dietpi-notify 2 "Bluetooth service failed to stop. Is it installed?" + dietpi-notify 2 "Bluetooth service failed to stop. Is it installed?" EXIT_CODE=1 fi @@ -1193,7 +1193,7 @@ _EOF_ systemctl start brcm_patchram_plus 2> /dev/null if (( $? != 0 )); then - /DietPi/dietpi/func/dietpi-notify 2 "brcm_patchram_plus service failed to start. Is it installed?" + dietpi-notify 2 "brcm_patchram_plus service failed to start. Is it installed?" EXIT_CODE=1 fi @@ -1204,7 +1204,7 @@ _EOF_ systemctl start bluetooth 2> /dev/null if (( $? != 0 )); then - /DietPi/dietpi/func/dietpi-notify 2 "Bluetooth service failed to start. Is it installed?" + dietpi-notify 2 "Bluetooth service failed to start. Is it installed?" EXIT_CODE=1 fi @@ -1216,7 +1216,7 @@ _EOF_ # Installed by default as of v142 if (( ! $(dpkg --get-selections | grep -ci -m1 '^pi-bluetooth') )); then - apt-get install -y pi-bluetooth + AGI pi-bluetooth fi @@ -1230,13 +1230,13 @@ _EOF_ if (( $loop_count >= $max_count )); then - /DietPi/dietpi/func/dietpi-notify 1 "hciuart failed to start after $loop_count attempts." + dietpi-notify 1 "hciuart failed to start after $loop_count attempts." EXIT_CODE=1 break else - /DietPi/dietpi/func/dietpi-notify 2 "hciuart failed to start. Attempting to restart it, please wait..." + dietpi-notify 2 "hciuart failed to start. Attempting to restart it, please wait..." ((loop_count++)) sleep 1 @@ -1377,7 +1377,7 @@ _EOF_ done # - Delay. Without this, kernel reports wifi device not found with RPi 3 and Pine A64 addon board, when ran straight after this script. - /DietPi/dietpi/func/dietpi-notify 2 "Please wait, enabling WiFi Modules..." + dietpi-notify 2 "Please wait, enabling WiFi Modules..." sleep 3 #Update our networking file (refresh active wlan index) @@ -1527,7 +1527,7 @@ _EOF_ #systemctl enable serial-getty@*.service # Wildcard does not work, we need to specify each possible tty device name #systemctl enable serial-getty@ttyAMA[0-9].service # Number wildcards do not work, we need to specify each possible tty device number - /DietPi/dietpi/func/dietpi-notify 2 "Enabling known serial-getty services, please wait..." + dietpi-notify 2 "Enabling known serial-getty services, please wait..." systemctl enable serial-getty@.service for ((i=0; i<=$MAX_SERIAL_CONSOLES; i++)) do @@ -1594,7 +1594,7 @@ _EOF_ elif [ "$INPUT_DEVICE_VALUE" = "disable" ]; then #Disable services. Although, this seems to have no effect on the cmdline.txt boot.ini etc serial console entries. They run regardless. But lets do it for consistency. - /DietPi/dietpi/func/dietpi-notify 2 "Disabling known serial-getty services, please wait..." + dietpi-notify 2 "Disabling known serial-getty services, please wait..." systemctl disable serial-getty@.service for ((i=0; i<=$MAX_SERIAL_CONSOLES; i++)) do @@ -1675,11 +1675,11 @@ _EOF_ # - Pre-Reqs for any soundcard if (( ! $(dpkg --get-selections | grep -ci -m1 '^alsa-utils') )); then - /DietPi/dietpi/func/dietpi-notify 2 "Installing alsa-utils. Please wait..." - apt-get install -y alsa-utils + dietpi-notify 2 "Installing alsa-utils. Please wait..." + AGI alsa-utils if (( $? != 0 )); then - /DietPi/dietpi/func/dietpi-notify 1 "Unable to install alsa-utils." + dietpi-notify 1 "Unable to install alsa-utils." fi @@ -1901,7 +1901,7 @@ _EOF_ # - Not found else - /DietPi/dietpi/func/dietpi-notify 1 "Unable to find a USB-DAC on system." + dietpi-notify 1 "Unable to find a USB-DAC on system." EXIT_CODE=1 # - Reset @@ -2075,7 +2075,7 @@ _EOF_ else - /DietPi/dietpi/func/dietpi-notify 1 "Failed to install $INPUT_DEVICE_NAME. $install_url_address may be offline or unreachable." + dietpi-notify 1 "Failed to install $INPUT_DEVICE_NAME. $install_url_address may be offline or unreachable." fi @@ -2269,7 +2269,7 @@ _EOF_ if (( ! $(dpkg --get-selections | grep -ci -m1 '^libasound2-plugin-equal') )); then - apt-get install -y libasound2-plugin-equal + AGI libasound2-plugin-equal fi @@ -2298,7 +2298,7 @@ _EOF_ #----------------------------------------------------------------------------------- #info - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Set_Hardware "$INPUT_DEVICE_NAME ($INPUT_DEVICE_VALUE)" + dietpi-notify 3 DietPi-Set_Hardware "$INPUT_DEVICE_NAME ($INPUT_DEVICE_VALUE)" #----------------------------------------------------------------------------------- if [ "$INPUT_DEVICE_NAME" = "soundcard" ]; then @@ -2372,7 +2372,7 @@ _EOF_ fi #----------------------------------------------------------------------------------- - /DietPi/dietpi/func/dietpi-notify -1 $EXIT_CODE "$INPUT_DEVICE_NAME $INPUT_DEVICE_VALUE |" + dietpi-notify -1 $EXIT_CODE "$INPUT_DEVICE_NAME $INPUT_DEVICE_VALUE |" #----------------------------------------------------------------------------------- exit $EXIT_CODE #----------------------------------------------------------------------------------- diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index b928bed46c..818c0045e6 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -44,7 +44,7 @@ $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entrie Unknown_Input_Name(){ EXIT_CODE=1 - /DietPi/dietpi/func/dietpi-notify 2 "Unknown input name ($INPUT_MODE_NAME). Nothing has been applied." + dietpi-notify 2 "Unknown input name ($INPUT_MODE_NAME). Nothing has been applied." echo -e "$AVAIABLE_COMMANDS" } @@ -52,7 +52,7 @@ $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entrie Unknown_Input_Mode(){ EXIT_CODE=1 - /DietPi/dietpi/func/dietpi-notify 2 "Unknown input value ($INPUT_MODE_VALUE). Nothing has been applied." + dietpi-notify 2 "Unknown input value ($INPUT_MODE_VALUE). Nothing has been applied." } @@ -356,7 +356,7 @@ _EOF_ /DietPi/dietpi/func/check_connection "$INSTALL_URL" if (( $? == 0 )); then - /DietPi/dietpi/func/dietpi-notify 0 "Patching dietpi.txt" + dietpi-notify 0 "Patching dietpi.txt" wget "$INSTALL_URL" -O /tmp/dietpi.txt_patch local entry=0 @@ -374,14 +374,14 @@ _EOF_ # - Patch new entry if required if (( ! $(grep -ci -m1 "^$entry=" /DietPi/dietpi.txt) )); then - /DietPi/dietpi/func/dietpi-notify 2 "Updating dietpi.txt with new entry: $entry=$value" + dietpi-notify 2 "Updating dietpi.txt with new entry: $entry=$value" cat << _EOF_ >> /DietPi/dietpi.txt $entry=$value _EOF_ else - /DietPi/dietpi/func/dietpi-notify 0 "Verified: $entry" + dietpi-notify 0 "Verified: $entry" fi @@ -390,11 +390,11 @@ _EOF_ done < /tmp/dietpi.txt_patch rm /tmp/dietpi.txt_patch - /DietPi/dietpi/func/dietpi-notify 0 "dietpi.txt verification completed" + dietpi-notify 0 "dietpi.txt verification completed" else - /DietPi/dietpi/func/dietpi-notify 1 "Failed to verify dietpi.txt, $INSTALL_URL is offline and/or inaccessible" + dietpi-notify 1 "Failed to verify dietpi.txt, $INSTALL_URL is offline and/or inaccessible" fi @@ -406,7 +406,7 @@ _EOF_ #----------------------------------------------------------------------------------- #info - /DietPi/dietpi/func/dietpi-notify 3 DietPi-Set_Software "$INPUT_MODE_NAME ($INPUT_MODE_VALUE)" + dietpi-notify 3 DietPi-Set_Software "$INPUT_MODE_NAME ($INPUT_MODE_VALUE)" #----------------------------------------------------------------------------------- if [ "$INPUT_MODE_NAME" = "apt-mirror" ]; then @@ -444,7 +444,7 @@ _EOF_ fi #----------------------------------------------------------------------------------- - /DietPi/dietpi/func/dietpi-notify -1 $EXIT_CODE "$INPUT_MODE_NAME $INPUT_MODE_VALUE |" + dietpi-notify -1 $EXIT_CODE "$INPUT_MODE_NAME $INPUT_MODE_VALUE |" #----------------------------------------------------------------------------------- exit $EXIT_CODE #----------------------------------------------------------------------------------- diff --git a/dietpi/func/dietpi-set_userdata b/dietpi/func/dietpi-set_userdata index 745b5b94ea..48485256c6 100644 --- a/dietpi/func/dietpi-set_userdata +++ b/dietpi/func/dietpi-set_userdata @@ -59,8 +59,8 @@ # - Copy source to target, if it contains any files/folders if [ -z "$(find $SOURCE_DIRECTORY -maxdepth 0 -empty)" ]; then - /DietPi/dietpi/func/dietpi-notify 0 "Moving your existing data from $SOURCE_DIRECTORY to $TARGET_DIRECTORY" - /DietPi/dietpi/func/dietpi-notify 2 "Please wait...\n" + dietpi-notify 0 "Moving your existing data from $SOURCE_DIRECTORY to $TARGET_DIRECTORY" + dietpi-notify 2 "Please wait...\n" sleep 1 @@ -77,8 +77,8 @@ if (( $(ls -lha "$fp_test_target" | grep -ci -m1 "www-data") )); then cp_options+='p' - /DietPi/dietpi/func/dietpi-notify 2 "Target filesystem supports user permissions:" - /DietPi/dietpi/func/dietpi-notify 2 " - Attempting to preserve permissions during transfer." + dietpi-notify 2 "Target filesystem supports user permissions:" + dietpi-notify 2 " - Attempting to preserve permissions during transfer." sleep 1 fi @@ -156,10 +156,10 @@ #Run target_to_lowercase=$(echo -e "$TARGET_DIRECTORY" | tr '[:upper:]' '[:lower:]') - /DietPi/dietpi/func/dietpi-notify 3 DietPi Updating user data location - /DietPi/dietpi/func/dietpi-notify 2 " - From : $SOURCE_DIRECTORY" - /DietPi/dietpi/func/dietpi-notify 2 " - To : $TARGET_DIRECTORY" - /DietPi/dietpi/func/dietpi-notify 2 "Please wait..." + dietpi-notify 3 DietPi Updating user data location + dietpi-notify 2 " - From : $SOURCE_DIRECTORY" + dietpi-notify 2 " - To : $TARGET_DIRECTORY" + dietpi-notify 2 "Please wait..." while (( $RUN_MOVE_DATA )); do @@ -231,7 +231,7 @@ #Ensure enough freespace in target FREESPACE_AVAILABLE_TARGET=$(( $(df -Pk "$TARGET_DIRECTORY" | awk '{print $4}' | sed -n 2p) * 1024 )) #bytes - /DietPi/dietpi/func/dietpi-notify 2 "Calculating space required for moving data, please wait..." + dietpi-notify 2 "Calculating space required for moving data, please wait..." FREESPACE_REQUIRED_SOURCE=$(du -cbs "$SOURCE_DIRECTORY" | awk '{print $1}' | sed -n 1p) #bytes echo -e " - Available $FREESPACE_AVAILABLE_TARGET bytes" @@ -262,12 +262,12 @@ # - Info if (( $EXIT_CODE == 0 )); then - /DietPi/dietpi/func/dietpi-notify 2 "$LOGFILE_OUTPUT_TEXT" + dietpi-notify 2 "$LOGFILE_OUTPUT_TEXT" # - Error else - /DietPi/dietpi/func/dietpi-notify 1 "$LOGFILE_OUTPUT_TEXT" + dietpi-notify 1 "$LOGFILE_OUTPUT_TEXT" fi @@ -278,14 +278,14 @@ else - /DietPi/dietpi/func/dietpi-notify 2 User data location setup completed. + dietpi-notify 2 User data location setup completed. echo -e "" fi #----------------------------------------------------------------------------------- - /DietPi/dietpi/func/dietpi-notify -1 ${EXIT_CODE:=0} + dietpi-notify -1 ${EXIT_CODE:=0} #----------------------------------------------------------------------------------- exit $EXIT_CODE #----------------------------------------------------------------------------------- diff --git a/dietpi/func/run_ntpd b/dietpi/func/run_ntpd index 18b9866675..55c5970b1f 100644 --- a/dietpi/func/run_ntpd +++ b/dietpi/func/run_ntpd @@ -35,7 +35,7 @@ #Dont run twice if (( $(ps aux | grep -ci -m1 '[[:space:]][n]tpd[[:space:]]') )); then - /DietPi/dietpi/func/dietpi-notify 2 "NTPD: is already running" + dietpi-notify 2 "NTPD: is already running" else @@ -49,14 +49,14 @@ #NTPD: run, exit when updated. if (( $NTPD_UPDATE_MODE >= 1 && $NTPD_UPDATE_MODE <= 3 )); then - /DietPi/dietpi/func/dietpi-notify 2 "NTPD: Running time sync update ($NTPD_UPDATE_MODE)" + dietpi-notify 2 "NTPD: Running time sync update ($NTPD_UPDATE_MODE)" ntpd -gq -l /var/log/ntpd.log &> /dev/null EXIT_CODE=$? #systemD-timesyncd/other method: assume status is ok else - /DietPi/dietpi/func/dietpi-notify 0 "NTPD: non-NTPD mode detected. Completed" + dietpi-notify 0 "NTPD: non-NTPD mode detected. Completed" EXIT_CODE=0 fi @@ -85,7 +85,7 @@ # Update NTPD if its not running, and, no exit file exists if [ ! -f "$FP_EXIT_CODE" ] && (( ! $(ps aux | grep -ci -m1 '[[:space:]][n]tpd[[:space:]]') )); then - /DietPi/dietpi/func/dietpi-notify 2 "NTPD: Has not yet been launched, running now, please wait..." + dietpi-notify 2 "NTPD: Has not yet been launched, running now, please wait..." Update_NTPD & sleep 1 @@ -96,7 +96,7 @@ else - /DietPi/dietpi/func/dietpi-notify 2 "NTPD: Waiting for completion of time sync ($CURRENT_LOOP/$MAX_LOOPS)" + dietpi-notify 2 "NTPD: Waiting for completion of time sync ($CURRENT_LOOP/$MAX_LOOPS)" sleep 1 ((CURRENT_LOOP++)) @@ -107,7 +107,7 @@ #systemD-timesyncd/other method: assume status is ok else - /DietPi/dietpi/func/dietpi-notify 0 "NTPD: non-NTPD mode detected. Completed" + dietpi-notify 0 "NTPD: non-NTPD mode detected. Completed" EXIT_CODE=0 fi @@ -120,11 +120,11 @@ fi #----------------------------------------------------------------------------------- #Always return status - /DietPi/dietpi/func/dietpi-notify -1 $EXIT_CODE 'NTPD: time sync |' + dietpi-notify -1 $EXIT_CODE 'NTPD: time sync |' if (( $EXIT_CODE != 0 )); then - /DietPi/dietpi/func/dietpi-notify 2 "NTPD: Please check the log file for more information:" - /DietPi/dietpi/func/dietpi-notify 2 "NTPD: /var/log/ntpd.log" + dietpi-notify 2 "NTPD: Please check the log file for more information:" + dietpi-notify 2 "NTPD: /var/log/ntpd.log" fi #----------------------------------------------------------------------------------- diff --git a/dietpi/login b/dietpi/login index e05d612ca6..b5258de56c 100644 --- a/dietpi/login +++ b/dietpi/login @@ -169,7 +169,7 @@ while [ ! -f /DietPi/.ramdisk ] do - /DietPi/dietpi/func/dietpi-notify 2 "Waiting for DietPi-RAMDISK to finish mounting DietPi to RAM..." + dietpi-notify 2 "Waiting for DietPi-RAMDISK to finish mounting DietPi to RAM..." sleep 1 done @@ -202,12 +202,12 @@ # - Automated if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 '^AUTO_Install_Enable=1') )); then - /DietPi/dietpi/func/dietpi-notify 2 'DietPi is currently installing and configuring your system. Please wait for this to complete, check back later.' + dietpi-notify 2 'DietPi is currently installing and configuring your system. Please wait for this to complete, check back later.' else - /DietPi/dietpi/func/dietpi-notify 2 'DietPi-Software is already running on another terminal/screen. Please complete or exit, before continuing.' + dietpi-notify 2 'DietPi-Software is already running on another terminal/screen. Please complete or exit, before continuing.' fi diff --git a/dietpi/misc/dietpi-justboom b/dietpi/misc/dietpi-justboom index 342ec2586a..e7a9445f3f 100644 --- a/dietpi/misc/dietpi-justboom +++ b/dietpi/misc/dietpi-justboom @@ -352,18 +352,18 @@ if [ "$OPTION" = "ALSA Output Info" ]; then - /DietPi/dietpi/func/dietpi-notify 3 DietPi-JustBoom "ALSA Output Info" + dietpi-notify 3 DietPi-JustBoom "ALSA Output Info" local stream_result=$(cat /proc/asound/card*/pcm0p/sub0/hw_params) echo -e "$stream_result" echo -e "" if [ "$stream_result" = "closed" ]; then - /DietPi/dietpi/func/dietpi-notify 1 "Detailed info is only available when audio is being played, play some music first!" + dietpi-notify 1 "Detailed info is only available when audio is being played, play some music first!" fi - /DietPi/dietpi/func/dietpi-notify 0 "Completed, press any key to exit...\n" + dietpi-notify 0 "Completed, press any key to exit...\n" read -p "Press any key to exit..." elif [ "$OPTION" = "Subwoofer Mode" ]; then diff --git a/dietpi/patch_file b/dietpi/patch_file index 1370db0f51..844200ed99 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -43,19 +43,6 @@ fi - #Apt-get upgrade, noninteractive func - AGU(){ - - DEBIAN_FRONTEND='noninteractive' apt-get upgrade -y - - } - - AGDU(){ - - DEBIAN_FRONTEND='noninteractive' apt-get dist-upgrade -y - - } - FP_EMR='/DietPi/dietpi/.patch_emr' EMR_INDEX=0 @@ -92,7 +79,7 @@ if (( ! $(dpkg --get-selections | grep -ci -m1 '^apt-transport-https') )); then - apt-get install -y apt-transport-https + AGI apt-transport-https if (( $? != 0 )); then # - armv7 @@ -208,7 +195,7 @@ #------------------------------------------------------------------------------- #Missing Resolvconf /DietPi/dietpi/dietpi-apt-get_update 1 - apt-get install resolvconf -y + AGI resolvconf #------------------------------------------------------------------------------- #New Bash Alias's if (( $(cat /etc/bash.bashrc | grep -ci -m1 'dietpi-autostart=') == 0 )); then @@ -315,7 +302,7 @@ if [ -f /DietPi/dietpi/.installed ]; then if (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'XSERVERXORG 2') == 1 )); then /DietPi/dietpi/dietpi-apt-get_update 1 - apt-get install dbus-x11 -y + AGI dbus-x11 fi fi #------------------------------------------------------------------------------- @@ -388,7 +375,7 @@ _EOF_ chmod +x /usr/local/bin/chronometer.sh /DietPi/dietpi/dietpi-apt-get_update 1 - apt-get install -y bc + AGI bc fi #------------------------------------------------------------------------------- #DietPi-Software additions @@ -417,7 +404,7 @@ _EOF_ #------------------------------------------------------------------------------- #debconf-get-selections mising from odroid's /DietPi/dietpi/dietpi-apt-get_update 1 - apt-get install -y debconf-utils + AGI debconf-utils #------------------------------------------------------------------------------- elif (( $VERSION_CURRENT == 109 )); then @@ -446,7 +433,7 @@ _EOF_ #------------------------------------------------------------------------------- #BC is now installed by default on all DietPi systems. bc is needed for bash floating point calculations that many scripts rely on. /DietPi/dietpi/dietpi-apt-get_update 1 - apt-get install -y bc + AGI bc #------------------------------------------------------------------------------- #Cloudshell new option | NETWORK_USAGE_CURRENT_OUTPUT_TYPE if [ -f /DietPi/dietpi/.dietpi-cloudshell ]; then @@ -488,7 +475,7 @@ _EOF_ # - Use non-modified hostapd binary from Jessie repo. if (( $HW_MODEL == 3 )) && (( $(dpkg -l | grep -ci -m1 'hostapd') == 1 )); then apt-get remove hostapd -y - apt-get install hostapd -y + AGI hostapd sed -i '/driver=/c\#driver=rtl871xdrv/' /etc/hostapd/hostapd.conf fi #------------------------------------------------------------------------------- @@ -554,8 +541,8 @@ _EOF_ if (( $(dpkg -l | grep -ci -m1 'kodi-odroid') == 1 )); then # - upgrade kodi - apt-get update - AGU + AGUP + AGUG # - Remove pulse audio workaround fix we used. apt-get purge pulseaudio -y @@ -575,7 +562,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #fbset now installed by default - apt-get install -y fbset + AGI fbset #------------------------------------------------------------------------------- elif (( $VERSION_CURRENT == 113 )); then @@ -686,7 +673,7 @@ _EOF_ #------------------------------------------------------------------------------- #Odroid C1 WiFi fix (missing packages): https://github.com/Fourdee/DietPi/issues/273#issuecomment-210410651 if (( $HW_MODEL == 10 )); then - apt-get install -y wireless-regdb iw crda wpasupplicant + AGI wireless-regdb iw crda wpasupplicant fi #------------------------------------------------------------------------------- @@ -709,7 +696,7 @@ _EOF_ chmod +x /etc/cron.hourly/dietpi #------------------------------------------------------------------------------- #ifmetric: https://github.com/Fourdee/DietPi/issues/273#issuecomment-213951519 - apt-get install -y ifmetric + AGI ifmetric if (( $(cat /etc/network/interfaces | grep -ci -m1 '^metric ') == 0 )); then # - eth sed -i "/iface eth$(sed -n 1p /DietPi/dietpi/.network)/a metric 0" /etc/network/interfaces @@ -718,7 +705,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #netplug. Resolves issues with unplugging eth and breaking all connections, when WiFi is also active: https://github.com/Fourdee/DietPi/issues/273#issuecomment-215996025 - apt-get install netplug -y + AGI netplug cat << _EOF_ > /etc/netplug/netplugd.conf eth* wlan* @@ -737,7 +724,7 @@ _EOF_ sed -i "/^#auto wlan$(sed -n 2p /DietPi/dietpi/.network)/c\#allow-hotplug wlan$(sed -n 2p /DietPi/dietpi/.network)" /etc/network/interfaces #------------------------------------------------------------------------------- #apply to all DietPi systems (but targeted at Odroid XU4) - missing WiFi packages. - apt-get install -y wireless-regdb iw crda wpasupplicant + AGI wireless-regdb iw crda wpasupplicant #------------------------------------------------------------------------------- #Missing line at EOF echo -e "" >> /etc/network/interfaces @@ -767,8 +754,8 @@ _EOF_ #------------------------------------------------------------------------------- #Patch PineA64 to include xz-utils for firmware upgrades (only needed w/ alpha v118 image if (( $HW_MODEL >= 40 && $HW_MODEL <= 42 )); then - apt-get update - apt-get install -y --no-install-recommends xz-utils + AGUP + AGI xz-utils /usr/local/sbin/pine64_update_uboot.sh /usr/local/sbin/pine64_update_kernel.sh @@ -963,7 +950,7 @@ _EOF_ DEBIAN_FRONTEND='noninteractive' apt-get autoremove --purge -y # - Because removing 3.14.29 also removes 3.14.65 (most likley same locations) we need to reinstall 3.14.65+ - DEBIAN_FRONTEND='noninteractive' apt-get install -y --reinstall linux-headers-3.14.65+ linux-image-3.14.65+ + AGI --reinstall linux-headers-3.14.65+ linux-image-3.14.65+ wget https://raw.githubusercontent.com/Fourdee/DietPi/e8e0edf7193c61d6084bf252397561081e335dc5/boot_c2.ini -O /DietPi/boot.ini @@ -1063,7 +1050,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #xz-utils missing from some images, required for decompress tar.xz support. - apt-get install -y xz-utils + AGI xz-utils #------------------------------------------------------------------------------- #I left the serial console enabled for all the v120 images (my bad). Disable if not enabled in dietpi.txt if (( ! $(cat /DietPi/dietpi.txt | grep -ci -m1 '^serial_console_enabled=1') )); then @@ -1081,7 +1068,7 @@ _EOF_ if [ -f /DietPi/dietpi/.installed ]; then if (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'XSERVERXORG=2') )); then - apt-get install xterm -y + AGI xterm fi # Mate: https://github.com/Fourdee/DietPi/issues/388 @@ -1117,10 +1104,10 @@ _EOF_ # - Update/Upgrade apt /DietPi/dietpi/dietpi-apt-get_update 2 - AGU + AGUP # - Reinstall all packages, including the X11 additions (xf86-video-mali-odroid libump-odroid) - apt-get install -y xcompmgr aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump-odroid --no-install-recommends + AGI xcompmgr aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump-odroid cp /DietPi/dietpi/conf/xorg_c2.conf /etc/X11/xorg.conf fi @@ -1167,7 +1154,7 @@ _EOF_ #MineOS requires rsync: https://github.com/Fourdee/DietPi/issues/403 if [ -f /DietPi/dietpi/.installed ] && (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'MINEOS=2') )); then - apt-get install -y rsync + AGI rsync fi #------------------------------------------------------------------------------- @@ -1258,7 +1245,7 @@ _EOF_ #Kodi add NFS support: if [ -f /DietPi/dietpi/.installed ] && (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'KODI=2') )); then - apt-get install -y libnfs4 + AGI libnfs4 fi #------------------------------------------------------------------------------- @@ -1278,7 +1265,7 @@ _EOF_ echo "deb http://apt.armbian.com jessie main" > /etc/apt/sources.list.d/armbian.list apt-key adv --keyserver keys.gnupg.net --recv-keys 0x93D6889F9F0E78D5 - apt-get update + AGUP # - remove ye-olde packages apt-get purge -y armbian-firmware @@ -1286,7 +1273,7 @@ _EOF_ #BPi m2+ if (( $HW_MODEL == 50 )); then - apt-get install -y linux-u-boot-bananapim2plus-default linux-firmware-image-sun8i linux-image-sun8i + AGI linux-u-boot-bananapim2plus-default linux-firmware-image-sun8i linux-image-sun8i #OPi PC elif (( $HW_MODEL == 30 )); then @@ -1294,12 +1281,12 @@ _EOF_ # - remove ye-olde packages apt-get purge -y linux-jessie-root-orangepih3 linux-u-boot-orangepih3-default - apt-get install -y linux-u-boot-orangepipc-default linux-firmware-image-sun8i linux-image-sun8i + AGI linux-u-boot-orangepipc-default linux-firmware-image-sun8i linux-image-sun8i #BPi pro elif (( $HW_MODEL == 51 )); then - apt-get install -y linux-image-sun7i linux-firmware-image-sun7i linux-u-boot-bananapipro-default + AGI linux-image-sun7i linux-firmware-image-sun7i linux-u-boot-bananapipro-default fi @@ -1353,7 +1340,7 @@ _EOF_ if [ -f /DietPi/dietpi/.installed ] && (( $( cat /DietPi/dietpi/.installed | grep -ci -m1 '^KODI=2' ) )); then - apt-get install -y libcurl3-gnutls + AGI libcurl3-gnutls fi #------------------------------------------------------------------------------- @@ -1611,7 +1598,7 @@ _EOF_ #------------------------------------------------------------------------------- #C2 v130 image: apt-get update prior to this script has no effect. No apt-cache: https://github.com/Fourdee/DietPi/issues/508#issuecomment-246196842 #NB: Regardless, run for all devices. - apt-get update + AGUP #C2: apt-get upgrade 'uboot' package update without 'linux-image' at the same time = failed boot. #NB: Apply to odroids as we also hold kernel packages for XU4. @@ -1619,7 +1606,7 @@ _EOF_ apt-mark unhold linux-* - DEBIAN_FRONTEND='noninteractive' apt-get dist-upgrade --force-yes -y + AGDUG fi #------------------------------------------------------------------------------- @@ -1655,7 +1642,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #add HFS+ FS support for all DietPi systems by default: https://github.com/Fourdee/DietPi/issues/271#issuecomment-245651818 - apt-get install -y hfsplus #hfsprogs is for format capabilities + AGI hfsplus #hfsprogs is for format capabilities #------------------------------------------------------------------------------- #NFS: https://github.com/Fourdee/DietPi/issues/246 mkdir -p /mnt/nfs_client @@ -1718,7 +1705,7 @@ _EOF_ elif (( $VERSION_CURRENT == 131 )); then #------------------------------------------------------------------------------- #Install p7zip by default on all DietPi systems - apt-get install -y p7zip-full + AGI p7zip-full #------------------------------------------------------------------------------- elif (( $VERSION_CURRENT == 132 )); then @@ -1770,7 +1757,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #ethtool: - apt-get install -y ethtool + AGI ethtool #------------------------------------------------------------------------------- elif (( $VERSION_CURRENT == 133 )); then @@ -1795,14 +1782,14 @@ _EOF_ # - BT modules must be enabled before installation. Else, apt-get install will fail on bluetooth package init. /DietPi/dietpi/func/dietpi-set_hardware bluetooth enable # will fail on bluetooth service start. Expected, as not installed yet. - /DietPi/dietpi/func/dietpi-notify 2 "If the above returns an error, it can safely be ignored as BT isnt installed yet." + dietpi-notify 2 "If the above returns an error, it can safely be ignored as BT isnt installed yet." - apt-get install bluetooth -y + AGI bluetooth # - Disable BT modules, if the user had it disabled before hand: if (( ! $BT_USER_ENABLED )); then - /DietPi/dietpi/func/dietpi-notify 2 "BT was in a disabled state previously, setting back to disabled." + dietpi-notify 2 "BT was in a disabled state previously, setting back to disabled." /DietPi/dietpi/func/dietpi-set_hardware bluetooth disable fi @@ -1907,7 +1894,7 @@ _EOF_ while [ ! -f /DietPi/.ramdisk ] do - /DietPi/dietpi/func/dietpi-notify 2 "Waiting for DietPi-RAMDISK to finish mounting DietPi to RAM..." + dietpi-notify 2 "Waiting for DietPi-RAMDISK to finish mounting DietPi to RAM..." sleep 1 done @@ -2111,8 +2098,8 @@ _EOF_ rm package.deb # - Just incase u6 is outdated by the time this patch is run, lets also update and upgrade apt: - apt-get update - AGU + AGUP + AGDUG fi #------------------------------------------------------------------------------- @@ -2125,7 +2112,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #Apt-transport install by default on all systems: - apt-get install -y apt-transport-https + AGI apt-transport-https #------------------------------------------------------------------------------- elif (( $VERSION_CURRENT == 141 )); then @@ -2151,7 +2138,7 @@ _EOF_ #RPi 3 Bluetooth packages missing: https://github.com/Fourdee/DietPi/issues/693 if (( $HW_MODEL < 10 )); then - apt-get install -y pi-bluetooth --reinstall + AGI --reinstall pi-bluetooth # - Check if previously disabled, and reapply if [ -f /etc/modprobe.d/disable_bt.conf ]; then @@ -2165,7 +2152,7 @@ _EOF_ #Stretch RPi WiFi fix + firmware: https://github.com/Fourdee/DietPi/issues/475#issuecomment-270696515 if (( $DISTRO == 4 && $HW_MODEL < 10 )); then - AGDU + AGDUG wget https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/master/brcm80211/brcm/brcmfmac43430-sdio.txt -O /lib/firmware/brcm/brcmfmac43430-sdio.txt fi @@ -2190,7 +2177,7 @@ _EOF_ #RPi, install common rpi specific binaries by default (eg: raspistill) if (( $HW_MODEL < 10 )); then - apt-get install -y --reinstall --force-yes libraspberrypi-bin + AGI --reinstall libraspberrypi-bin fi #------------------------------------------------------------------------------- @@ -2576,12 +2563,12 @@ _EOF_ systemctl mask apt-daily-upgrade.timer &> /dev/null #------------------------------------------------------------------------------- #Odroid C2 Stretch, missing gnupg, install on all systems by default: https://github.com/Fourdee/DietPi/issues/1032 - apt-get install gnupg -y + AGI gnupg #------------------------------------------------------------------------------- #Firmware for Native PC: https://github.com/Fourdee/DietPi/issues/1007#issuecomment-312442384 if (( $HW_MODEL == 21 )); then - apt-get install firmware-linux-nonfree -y + AGI firmware-linux-nonfree cp /boot/dietpi/conf/htoprc /root/.config/htop/htoprc # Also missing our htop cfg fi @@ -2621,21 +2608,20 @@ _EOF_ fi #------------------------------------------------------------------------------- # Purge unnecessary pciutils package: https://github.com/Fourdee/DietPi/issues/1068 - apt purge -y pciutils + AGP pciutils #------------------------------------------------------------------------------- # RPi Stretch: Switch to new stretch repo on archive.raspberrypi.org: https://github.com/Fourdee/DietPi/issues/1077 if (( $HW_MODEL < 10 && $DISTRO == 4 )); then # RPi + Stretch echo "deb https://archive.raspberrypi.org/debian/ stretch main ui" > /etc/apt/sources.list.d/raspi.list - apt update - AGU - AGDU + AGUP + AGDUG fi #------------------------------------------------------------------------------- #Native PC, add i386 support by default if (( $HW_MODEL == 21 )); then dpkg --add-architecture i386 - apt-get update + AGUP fi #------------------------------------------------------------------------------- @@ -2995,9 +2981,6 @@ _EOF_ fi #------------------------------------------------------------------------------- - #NB: If running apt-get upgrade, use non-interactive function instead: https://github.com/Fourdee/DietPi/issues/689 - # AGU = apt-get upgrade - # AGDU = apt-get dist-upgrade #NB: all if statements must contain at least one command. Prevents bash having a hissy fit :) #------------------------------------------------------------------------------- From d0214d0150b08dfd30f264e0d5b14d506b7cfe89 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 19 Dec 2017 06:20:03 +0000 Subject: [PATCH 074/390] v160 local ```i``` in dietpi-notify, to avoid overwriting host script: https://github.com/Fourdee/DietPi/issues/1311#issuecomment-352638142 --- dietpi/func/dietpi-globals | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 6c5a5d99a4..a29361a535 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -83,9 +83,10 @@ # - $1 = start printing from word number $1 Print_Input_String(){ + local i=0 for (( i=$1;i<${#ainput_string[@]} ;i++)) do - echo -ne " ${ainput_string[${i}]}" + echo -ne ${ainput_string[$i]} done echo -e "" From acad91080ea8b2a4b096048bc125672c1afeb48a Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 19 Dec 2017 06:23:50 +0000 Subject: [PATCH 075/390] v160 + Minor formatting correction, due to debugging --- dietpi/func/dietpi-globals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index a29361a535..d642315460 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -86,7 +86,7 @@ local i=0 for (( i=$1;i<${#ainput_string[@]} ;i++)) do - echo -ne ${ainput_string[$i]} + echo -ne " ${ainput_string[$i]}" done echo -e "" From 59fa99786d78d80f3073a3ca050326216fba74da Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 19 Dec 2017 07:07:09 +0000 Subject: [PATCH 076/390] v160 + @MichaIng PR: https://github.com/Fourdee/DietPi/pull/1318 | https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 --- PREP_SYSTEM_FOR_DIETPI.sh | 35 ++++++++++++++++++++++----------- dietpi/func/dietpi-globals | 2 -- dietpi/func/dietpi-set_software | 30 +++++++++++----------------- 3 files changed, 35 insertions(+), 32 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index b26c02702c..e18b2f63c2 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -78,7 +78,7 @@ else - dietpi-notify 1 "Unknown or unsupported CPU architecture $HW_ARCH_DESCRIPTION, aborting..." + dietpi-notify 1 "Error: Unknown or unsupported CPU architecture $HW_ARCH_DESCRIPTION, aborting..." exit fi @@ -307,7 +307,7 @@ dietpi-notify 2 'Installing core packages, required for this script to function:' - AGI wget unzip whiptail + AGI apt-transport-https wget unzip whiptail Error_Check #------------------------------------------------------------------------------------------------ @@ -428,14 +428,19 @@ _EOF_ else cat << _EOF_ > /etc/apt/sources.list -deb http://ftp.debian.org/debian/ $DISTRO_TARGET_NAME main contrib non-free -deb http://ftp.debian.org/debian/ $DISTRO_TARGET_NAME-updates main contrib non-free -deb http://security.debian.org $DISTRO_TARGET_NAME/updates main contrib non-free -deb http://ftp.debian.org/debian/ $DISTRO_TARGET_NAME-backports main contrib non-free +deb https://deb.debian.org/debian/ $DISTRO_TARGET_NAME main contrib non-free +deb https://deb.debian.org/debian/ $DISTRO_TARGET_NAME-updates main contrib non-free +deb https://deb.debian.org/debian-security/ $DISTRO_TARGET_NAME/updates main contrib non-free +deb https://deb.debian.org/debian/ $DISTRO_TARGET_NAME-backports main contrib non-free _EOF_ + # Jessie, switch to http: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 + if (( $DISTRO_TARGET == 3 )); then + + sed -i 's/https/http/g' /etc/apt/sources.list + # Buster, remove backports: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 - if (( $DISTRO_TARGET == 5 )); then + elif (( $DISTRO_TARGET == 5 )); then sed -i '/backports/d' /etc/apt/sources.list @@ -556,15 +561,19 @@ _EOF_ aPACKAGES_REQUIRED_INSTALL+=('firmware-linux-nonfree') #aPACKAGES_REQUIRED_INSTALL+=('firmware-misc-nonfree') #aPACKAGES_REQUIRED_INSTALL+=('dmidecode') - if (( $(fdisk -l $1 | grep "Disklabel type:" | awk '{ print $3 }') == 'dos' )); then + if [ dpkg --get-selections | grep '^grub2[[:space:]]' ]; then aPACKAGES_REQUIRED_INSTALL+=('grub2') - else + elif [ dpkg --get-selections | grep '^grub-efi-amd64[[:space:]]' ]; then aPACKAGES_REQUIRED_INSTALL+=('grub-efi-amd64') - fi + else + + [ -d /boot/efi ] && aPACKAGES_REQUIRED_INSTALL+=('grub-efi-amd64') || aPACKAGES_REQUIRED_INSTALL+=('grub2') + + fi fi @@ -1121,7 +1130,7 @@ _EOF_ fi # - Set Pi cmdline.txt back to normal - sed -i "s/ rootdelay=10//g" /boot/cmdline.txt + [ -f /boot/cmdline.txt ] && sed -i "s/ rootdelay=10//g" /boot/cmdline.txt dietpi-notify 2 'Generating default wpa_supplicant.conf' @@ -1233,18 +1242,20 @@ _EOF_ systemctl disable dietpi-fs_partition_resize.service systemctl daemon-reload -TARGET_PARTITION=\$(findmnt / -o source -n | sed 's/.*p//') +TARGET_PARTITION=0 TARGET_DEV=\$(findmnt / -o source -n) # - MMCBLK[0-9]p[0-9] scrape if [[ "\$TARGET_DEV" = *"mmcblk"* ]]; then TARGET_DEV=\$(findmnt / -o source -n | sed 's/p[0-9]\$//') + TARGET_PARTITION=\$(findmnt / -o source -n | sed 's/.*p//') # - Everything else scrape (eg: /dev/sdX[0-9]) else TARGET_DEV=\$(findmnt / -o source -n | sed 's/[0-9]\$//') + TARGET_PARTITION=\$(findmnt / -o source -n | sed 's|/dev/sd.||') fi diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index d642315460..891c51f9ef 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -37,9 +37,7 @@ #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 cd "$HOME" - #----------------------------------------------------------------------------------- # DietPi-Notify - #----------------------------------------------------------------------------------- # $1: # -1=autodetect_fail_ok # - $2 = EXIT_CODE diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 818c0045e6..d4955a2088 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -63,17 +63,6 @@ $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entrie if [ -n "$INPUT_MODE_VALUE" ]; then - local apt_distro='jessie' #3 - if (( $DISTRO == 4 )); then - - apt_distro='stretch' - - elif (( $DISTRO == 5 )); then - - apt_distro='buster' - - fi - # - Set defaults? if [ "$INPUT_MODE_VALUE" = "default" ]; then @@ -93,11 +82,11 @@ $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entrie if (( $HW_MODEL < 10 )); then cat << _EOF_ > /etc/apt/sources.list -deb $INPUT_MODE_VALUE $apt_distro main contrib non-free rpi +deb $INPUT_MODE_VALUE $DISTRO_NAME main contrib non-free rpi _EOF_ cat << _EOF_ > /etc/apt/sources.list.d/raspi.list -deb https://archive.raspberrypi.org/debian/ $apt_distro main ui +deb https://archive.raspberrypi.org/debian/ $DISTRO_NAME main ui _EOF_ # Update dietpi.txt entry @@ -107,14 +96,19 @@ _EOF_ else cat << _EOF_ > /etc/apt/sources.list -deb $INPUT_MODE_VALUE $apt_distro main contrib non-free -deb $INPUT_MODE_VALUE $apt_distro-updates main contrib non-free -deb http://security.debian.org $apt_distro/updates main contrib non-free -deb $INPUT_MODE_VALUE $apt_distro-backports main contrib non-free +deb https://deb.debian.org/debian/ $DISTRO_NAME main contrib non-free +deb https://deb.debian.org/debian/ $DISTRO_NAME-updates main contrib non-free +deb https://deb.debian.org/debian-security/ $DISTRO_NAME/updates main contrib non-free +deb https://deb.debian.org/debian/ $DISTRO_NAME-backports main contrib non-free _EOF_ + # Jessie, switch to http: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 + if (( $DISTRO == 3 )); then + + sed -i 's/https/http/g' /etc/apt/sources.list + # Buster, remove backports: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 - if (( $DISTRO == 5 )); then + elif (( $DISTRO == 5 )); then sed -i '/backports/d' /etc/apt/sources.list From d87e17b91a5b7d8cbe2586ea2e489d2cf86d3ae0 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 19 Dec 2017 07:16:34 +0000 Subject: [PATCH 077/390] v160 + DietPi-Drive_Manager | Added support for exFAT, many thanks @MichaIng : https://github.com/Fourdee/DietPi/pull/1312 --- CHANGELOG.txt | 1 + dietpi.txt | 2 +- dietpi/dietpi-drive_manager | 19 ++++++++++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 17df9968f4..d27f07fdab 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -7,6 +7,7 @@ Changes / Improvements / Optimizations: General | Start of FHS compliance: https://github.com/Fourdee/DietPi/issues/1297#issuecomment-352241193 DietPi-Boot | Improved the method of initial FS_partition and FS_expansion during 1st run, via systemD services. 'fs_force_resize=' in dietpi.txt is no longer supported: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352159930 DietPi-Banner | IP: Will now also list the active network adapter used (eg: eth0/wlan0) +DietPi-Drive_Manager | Added support for exFAT, many thanks @MichaIng : https://github.com/Fourdee/DietPi/pull/1312 DietPi-Globals | Global variables and functions are now exported during login. Please see the sourcecode for more information: https://github.com/Fourdee/DietPi/issues/1311 DietPi-Set_Hardware | Sparky SBC: enable aotg.aotg1_speed compatibility setting for USB 1.1, when USB-DAC configured: https://github.com/Fourdee/DietPi/issues/1301 DietPi-Software | NAA Daemon: Updated to latest (3.5.2-36). Existing installs will be patched automatically: https://github.com/Fourdee/DietPi/issues/1305 diff --git a/dietpi.txt b/dietpi.txt index 03684bc38e..b2f2fc4571 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -35,7 +35,7 @@ Ethernet_Force_Speed=0 # >> Misc Options ----------------------------------- #Size of dphys-swapfile to generate (MB) -# 0=Disabled | 1=auto (1GB-RAM = size) | 2+=manual +# 0=Disabled | 1=auto (2GB-RAM = size) | 2+=manual Swapfile_Size=1 # >> Automation Options ----------------------------- diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 541ba5043c..9e46cb9428 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -56,7 +56,7 @@ #Drives MAX_DRIVES=0 FORMAT_GPT=1 # default GPT: https://github.com/Fourdee/DietPi/issues/531. 0=MBR - FORMAT_FILESYSTEM_TYPE=0 #0=ext4 1=ntfs 2=fat32 3=hfs+ 4=btrfs 5=f2fs + FORMAT_FILESYSTEM_TYPE=0 #0=ext4 1=ntfs 2=fat32 3=hfs+ 4=btrfs 5=f2fs 6=exfat FORMAT_RECREATE_PARTITION_TABLE=1 #0=for rootfs transfer FORMAT_COMPLETED=0 FORMAT_PREVIOUS_MOUNT_SOURCE=0 #Used to obtain previous mount source fp, before a format, for rootfs transfer @@ -464,6 +464,11 @@ mkfs.f2fs ${aDRIVE_MOUNT_SOURCE[$INDEX_DRIVE_BEING_EDITED]} + # - Format exFAT + elif (( $FORMAT_FILESYSTEM_TYPE == 6 )); then + + mkfs.exfat ${aDRIVE_MOUNT_SOURCE[$INDEX_DRIVE_BEING_EDITED]} + fi #Remove previous fstab entry and mount location @@ -1105,6 +1110,10 @@ format_type_text='F2FS' + elif (( $FORMAT_FILESYSTEM_TYPE == 6 )); then + + format_type_text='EXFAT' + fi local whiptail_menu_array=() @@ -1145,6 +1154,7 @@ whiptail_menu_array+=("3" ": HFS+ | Mac OS X (Intel Mac default file system)") whiptail_menu_array+=("4" ": BTRFS | Linux (Modern filesystem)") whiptail_menu_array+=("5" ": F2FS | Linux (Flash filesystem)") + whiptail_menu_array+=("6" ": exFAT | Windows (Flash filesystem)") WHIP_TITLE='Filesystem Type?' OPTION=$(whiptail --title "$WHIP_TITLE" --menu "Please select a filesystem type for this format:\n\nEXT4:\nHighly recommended if you plan to use this drive solely on this system (dedicated drive).\n\nNTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU usage during transfers.\n\nFull list of different filesystem types:\nhttp://dietpi.com/phpbb/viewtopic.php?f=8&t=673&p=2898#p2898" --cancel-button "Back" --default-item "$FORMAT_FILESYSTEM_TYPE" --backtitle "$PROGRAM_NAME" 24 70 5 "${whiptail_menu_array[@]}" 3>&1 1>&2 2>&3) @@ -1175,6 +1185,13 @@ dietpi-notify 2 "Installing additional packages for F2FS support, please wait..." AGI f2fs-tools + # - exfat install packages + elif (( $OPTION == 6 && + ! $(dpkg --get-selections | grep -ci -m1 '^exfat-utils') )); then + + dietpi-notify 2 "Installing additional packages for exFAT support, please wait..." + AGI exfat-utils exfat-fuse + fi FORMAT_FILESYSTEM_TYPE=$OPTION From 3da1d589a07d863e007d2fad5241a6133463f29a Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 19 Dec 2017 08:07:33 +0000 Subject: [PATCH 078/390] v160 + notify exit result for AGX commands: https://github.com/Fourdee/DietPi/issues/1311#issuecomment-352666680 --- dietpi/func/dietpi-globals | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 891c51f9ef..4636c0e9e8 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -272,6 +272,7 @@ dietpi-notify 2 "APT is processing, please wait...\n" DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $force_options $string 2>&1 | tee "$FP_LOG_APT" EXITCODE_APT=${PIPESTATUS[0]} + dietpi-notify -1 $EXITCODE_APT 'AGI:' } @@ -289,6 +290,7 @@ dietpi-notify 2 "APT removal for: $string" DEBIAN_FRONTEND=noninteractive apt-get purge -y $string $options EXITCODE_APT=${PIPESTATUS[0]} + dietpi-notify -1 $EXITCODE_APT 'AGP:' } @@ -298,6 +300,7 @@ dietpi-notify 2 "APT autoremove + purge" DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y EXITCODE_APT=${PIPESTATUS[0]} + dietpi-notify -1 $EXITCODE_APT 'AGA:' } @@ -307,6 +310,7 @@ dietpi-notify 2 "APT fix" DEBIAN_FRONTEND=noninteractive apt-get install -f -y 2>&1 | tee "$FP_LOG_APT" EXITCODE_APT=${PIPESTATUS[0]} + dietpi-notify -1 $EXITCODE_APT 'AGF:' } @@ -316,6 +320,7 @@ dietpi-notify 2 "APT update" DEBIAN_FRONTEND=noninteractive apt-get update 2>&1 | tee "$FP_LOG_APT" EXITCODE_APT=${PIPESTATUS[0]} + dietpi-notify -1 $EXITCODE_APT 'AGUP:' } @@ -325,6 +330,7 @@ dietpi-notify 2 "APT upgrade" DEBIAN_FRONTEND=noninteractive apt-get upgrade -y 2>&1 | tee "$FP_LOG_APT" EXITCODE_APT=${PIPESTATUS[0]} + dietpi-notify -1 $EXITCODE_APT 'AGUG:' } @@ -347,6 +353,7 @@ dietpi-notify 2 "APT dist-upgrade" DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y 2>&1 | tee "$FP_LOG_APT" EXITCODE_APT=${PIPESTATUS[0]} + dietpi-notify -1 $EXITCODE_APT 'AGDUG:' } From a14976141bced3017bb3459e33e6e9c7819a333d Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 19 Dec 2017 08:52:40 +0000 Subject: [PATCH 079/390] v160 + admin push test --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d27f07fdab..e269df6c17 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,5 @@ v160 -(xx/12/17) +(xx/01/18) Image Modifications: From a9dd99eb81ed7b9530cc390c5784f8cbd425f02a Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 19 Dec 2017 09:36:38 +0000 Subject: [PATCH 080/390] v160 DietPi-Software | Resolved an issue where APT installations would fail if services were masked. All known DietPi software services, will be enabled/unmasked, before installation: https://github.com/Fourdee/DietPi/issues/1320 --- CHANGELOG.txt | 1 + dietpi/dietpi-services | 67 +++++++++++++++++++++++++++++++----------- dietpi/dietpi-software | 2 ++ 3 files changed, 53 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e269df6c17..714580a7c3 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -15,6 +15,7 @@ DietPi-Software | PHP-FPM: Increased from "$CPU_CORES_TOTAL" to "pm.max_children Bug Fixes: DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi drop during software installs/updates etc: https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480 +DietPi-Software | Resolved an issue where APT installations would fail if services were masked. All known DietPi software services, will be enabled/unmasked, before installation: https://github.com/Fourdee/DietPi/issues/1320 DietPi-Software | WiFi Hotspot (Stretch): Resolved an issue where hostapd would fail to run due to missing libssl1.0.0 lib, not available in repos: https://github.com/Fourdee/DietPi/issues/1299 DietPi-Software | Shairport-sync (Stretch): Resolved an issue where this would fail to install, due to pre-req URLS becomming invalid: https://github.com/Fourdee/DietPi/issues/1303 DietPi-Software | Plex Media Server: Resolved uninstall to include /var/lib/plexmediaserver in removal (which is not completed via apt purge). diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index 76db5c9a3f..2e7d59ff65 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -18,6 +18,7 @@ - start/stop/restart servicename (single service, SystemD) - systemd_controlled/dietpi_controlled (all services, known to DietPi) - enable/disable servicename (single service, SystemD) + - enable/disable all (all services, known to DietPi) - mask/unmask servicename (single service, SystemD)' #Grab Inputs @@ -197,8 +198,11 @@ } + #$1 = mode (eg: start/stop/restart) Set_Running_State(){ + local target_state="$1" + #???????????????????????????????????????????????????????????????????????? # Although this allows for simple service control without using SystemD, we really should convert these to SystemD services. To keep everything consistent, clean, and obtain a correct exit code. #DietPi: Non-service based control for specific dietpi-software installed programs. @@ -217,8 +221,8 @@ echo -e "${aDIETPISERVICE_NAME[$i]}" - ${aDIETPISERVICE_FP[$i]} $INPUT_MODE &> /dev/null - Print_Status $INPUT_MODE ${aDIETPISERVICE_NAME[$i]} $? + ${aDIETPISERVICE_FP[$i]} $target_state &> /dev/null + Print_Status $target_state ${aDIETPISERVICE_NAME[$i]} $? fi @@ -246,7 +250,7 @@ #### ALLO Special #### # - Allo web interface image: Exclude stop on aALLO_EXCLUDED_SERVICES_DURING_STOP service list - if [ -d /var/www/allo ] && [ "$INPUT_MODE" = "stop" ]; then + if [ -d /var/www/allo ] && [ "$target_state" = "stop" ]; then for ((j=0; j<${#aALLO_EXCLUDED_SERVICES_DURING_STOP[@]}; j++)) do @@ -268,9 +272,9 @@ echo -e "${aSERVICE_NAME[$i]}" - systemctl $INPUT_MODE ${aSERVICE_NAME[$i]} &> /dev/null + systemctl $target_state ${aSERVICE_NAME[$i]} &> /dev/null - Print_Status $INPUT_MODE ${aSERVICE_NAME[$i]} $? + Print_Status $target_state ${aSERVICE_NAME[$i]} $? fi @@ -296,8 +300,8 @@ echo -e "${aDIETPISERVICE_NAME[$i]}" - ${aDIETPISERVICE_FP[$i]} $INPUT_MODE &> /dev/null - Print_Status $INPUT_MODE ${aDIETPISERVICE_NAME[$i]} $? + ${aDIETPISERVICE_FP[$i]} $target_state &> /dev/null + Print_Status $target_state ${aDIETPISERVICE_NAME[$i]} $? fi @@ -310,8 +314,8 @@ echo -e "" #Apply process tool settings - if [ "$INPUT_MODE" = "start" ] || - [ "$INPUT_MODE" = "restart" ]; then + if [ "$target_state" = "start" ] || + [ "$target_state" = "restart" ]; then /DietPi/dietpi/dietpi-process_tool 1 @@ -379,16 +383,46 @@ fi - systemctl stop $INPUT_S2 + # - Process ALL known services + if [ "$INPUT_S2" = 'all' ]; then + + if [ "$INPUT_MODE" = "disable" ] || + [ "$INPUT_MODE" = "mask" ]; then + + echo -e "" + Set_Running_State stop + + fi + + for ((i=0; i<${#aSERVICE_NAME[@]}; i++)) + do + + if (( ${aSERVICE_AVAILABLE[$i]} )); then + - systemctl $SYSTEMD_CMD $INPUT_S2 - if (( $? == 0 )); then + dietpi-notify 0 "$INPUT_MODE $INPUT_S2: ${aSERVICE_NAME[$i]}" + systemctl $SYSTEMD_CMD ${aSERVICE_NAME[$i]} + + fi + + done - dietpi-notify 0 "$INPUT_MODE $INPUT_S2" + # - Process user defined single entry via cmd input else - dietpi-notify 1 "$INPUT_MODE $INPUT_S2" + systemctl stop $INPUT_S2 + + systemctl $SYSTEMD_CMD $INPUT_S2 + if (( $? == 0 )); then + + dietpi-notify 0 "$INPUT_MODE $INPUT_S2" + + else + + dietpi-notify 1 "$INPUT_MODE $INPUT_S2" + + fi fi @@ -397,9 +431,8 @@ if [ "$INPUT_MODE" = "unmask" ] || [ "$INPUT_MODE" = "enable" ]; then - INPUT_MODE='start' echo -e "" - Set_Running_State + Set_Running_State start fi @@ -471,7 +504,7 @@ fi - Set_Running_State + Set_Running_State "$INPUT_MODE" # Control ownCloud and Nextcloud maintenance mode: if [ "$INPUT_MODE" = "restart" ] || [ "$INPUT_MODE" = "start" ]; then diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 1a47b60acc..9b06a5b80b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -14450,6 +14450,8 @@ _EOF_ #Disable powersaving on Main screen during installation setterm -blank 0 -powersave off 2> /dev/null #------------------------------------------------------------ + # Unmask all services: https://github.com/Fourdee/DietPi/issues/1320 + /DietPi/dietpi/dietpi-services unmask all # Stop Services /DietPi/dietpi/dietpi-services stop #------------------------------------------------------------ From cff63d7e8e8218bdac4f1111e0f761d376a2c027 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 19 Dec 2017 12:46:43 +0000 Subject: [PATCH 081/390] v160 + Minor --- PREP_SYSTEM_FOR_DIETPI.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index e18b2f63c2..eeead8d217 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -204,15 +204,15 @@ local string="$@" - local force_WHIP_OPTIONs='--force-yes' + local apt_force_options='--force-yes' if (( $DISTRO >= 4 )); then - force_WHIP_OPTIONs='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' + apt_force_options='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' fi - DEBIAN_FRONTEND=noninteractive $(which apt) install -y $force_WHIP_OPTIONs $string + DEBIAN_FRONTEND=noninteractive $(which apt) install -y $apt_force_options $string } From a11322d177a431c55d5d9c72f61eea0e0493d33e Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 19 Dec 2017 13:04:20 +0000 Subject: [PATCH 082/390] v160 + Resolve: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352742808 Could of been error my end, during manual commit of your @MichaIng, apologies if case, converted it to method I use for now. --- PREP_SYSTEM_FOR_DIETPI.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index eeead8d217..ce231d0b52 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -561,11 +561,11 @@ _EOF_ aPACKAGES_REQUIRED_INSTALL+=('firmware-linux-nonfree') #aPACKAGES_REQUIRED_INSTALL+=('firmware-misc-nonfree') #aPACKAGES_REQUIRED_INSTALL+=('dmidecode') - if [ dpkg --get-selections | grep '^grub2[[:space:]]' ]; then + if (( $(dpkg --get-selections | grep -ci -m1 '^grub2[[:space:]]') )); then aPACKAGES_REQUIRED_INSTALL+=('grub2') - elif [ dpkg --get-selections | grep '^grub-efi-amd64[[:space:]]' ]; then + elif (( $(dpkg --get-selections | grep -ci -m1 '^grub-efi-amd64[[:space:]]') )); then aPACKAGES_REQUIRED_INSTALL+=('grub-efi-amd64') From af5a1f203506f85d2a0e6613239f0b7a6b322af1 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 19 Dec 2017 13:32:23 +0000 Subject: [PATCH 083/390] v160 + Fix for /boot/dietpi/func/dietpi-set_core_environment is doing nothing, returns to prompt. : https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352742808 --- dietpi/func/dietpi-globals | 7 ------- dietpi/func/dietpi-set_core_environment | 9 ++------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 4636c0e9e8..799c0938ac 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -21,13 +21,6 @@ # - . /DietPi/dietpi/func/dietpi-globals > for each script that uses these globals #//////////////////////////////////// - #Non-configured DietPi system, simply exit. - if [ ! -f /DietPi/dietpi/func/dietpi-globals ]; then - - exit 0 - - fi - #----------------------------------------------------------------------------------- # Core var's, functions, environment. Used at start of all scripts. #----------------------------------------------------------------------------------- diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index 13c4ef4d9d..f64f6c22b1 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -28,15 +28,10 @@ fi #Import DietPi-Globals ------------------------------------------------------------- - . $FP_SCRIPTS/dietpi/func/dietpi-globals # NB: HW_* info not loaded + . $FP_SCRIPTS/dietpi/func/dietpi-globals # NB: HW_* info are init only, not detected. + CHECK_ROOT_USER #Import DietPi-Globals ------------------------------------------------------------- - if (( $UID != 0 )); then - - echo -e 'Error: Root privileges required. Please run the command with "sudo"\n' - exit 1 - - fi DIETPI_USERNAME='dietpi' DIETPI_PASSWORD='dietpi' From a8420ad5b66f22d829af35be051e25bd2ec4e8a0 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 19 Dec 2017 22:58:16 +0100 Subject: [PATCH 084/390] DietPi-Software | ownCloud: Fix Buster installation and cleanup https://github.com/Fourdee/DietPi/issues/1286 --- dietpi/dietpi-software | 42 ++++++++++++------------------------------ 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 9b06a5b80b..40421790ad 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4093,19 +4093,9 @@ _EOF_ Banner_Installing - if (( $DISTRO == 3 )); then - - INSTALL_URL_ADDRESS='https://download.owncloud.org/download/repositories/stable/Debian_8.0/Release.key' - - elif (( $DISTRO == 4 )); then - - INSTALL_URL_ADDRESS='https://download.owncloud.org/download/repositories/stable/Debian_9.0/Release.key' - - else - - INSTALL_URL_ADDRESS='https://download.owncloud.org/community/owncloud-latest.zip' - - fi + INSTALL_URL_ADDRESS="https://download.owncloud.org/download/repositories/stable/Debian_$(( $DISTRO + 5 )).0/Release.key" + # No repository available yet after Stretch, thus we choose archive here: + (( $DISTRO > 4 )) && INSTALL_URL_ADDRESS='https://download.owncloud.org/community/owncloud-latest.zip' /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" #Install @@ -4114,32 +4104,24 @@ _EOF_ # Install necessary PHP modules: https://doc.owncloud.org/server/latest/admin_manual/installation/source_installation.html#php-extensions AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis - if [ ! -f /etc/apt/sources.list.d/owncloud.list ] && [ ! -d /var/www/owncloud ]; then + if [ ! -f /etc/apt/sources.list.d/owncloud.list ] && [ ! -f /var/www/owncloud/occ ]; then wget "$INSTALL_URL_ADDRESS" -O owncloud.key_or_zip - apt-key add - < owncloud.key_or_zip 2> /dev/null - unzip -o owncloud.key_or_zip -d /var/www 2> /dev/null - rm owncloud.key_or_zip - - if (( $DISTRO == 3 )); then + if (( $DISTRO < 5 )); then - echo -e 'deb https://download.owncloud.org/download/repositories/stable/Debian_8.0/ /' > /etc/apt/sources.list.d/owncloud.list + echo -e "deb https://download.owncloud.org/download/repositories/stable/Debian_$(( $DISTRO + 5 )).0/ /" > /etc/apt/sources.list.d/owncloud.list + apt-key add - < owncloud.key_or_zip && AGUP - elif (( $DISTRO == 4 )); then + else - echo -e 'deb https://download.owncloud.org/download/repositories/stable/Debian_9.0/ /' > /etc/apt/sources.list.d/owncloud.list + unzip -o owncloud.key_or_zip -d /var/www fi + rm owncloud.key_or_zip fi - # Install APT package just, if we have ownCloud's own up to date repository. - if [ -f /etc/apt/sources.list.d/owncloud.list ]; then - - AGUP - AGI_ERROR_CHECKED owncloud-files - - fi + [ -f /etc/apt/sources.list.d/owncloud.list ] && AGI_ERROR_CHECKED owncloud-files else @@ -4164,7 +4146,7 @@ _EOF_ # Install necessary PHP modules: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis - if [ ! -d /var/www/nextcloud ]; then + if [ ! -f /var/www/nextcloud/occ ]; then wget "$INSTALL_URL_ADDRESS" -O package.zip unzip -o package.zip -d /var/www From 2da499d839348314e12987966d19006676c46659 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 20 Dec 2017 01:26:53 +0100 Subject: [PATCH 085/390] DietPi-Software | PHP: Fix php-xsl installation https://github.com/Fourdee/DietPi/issues/1286 --- dietpi/dietpi-software | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 9b06a5b80b..392c49a430 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3809,7 +3809,9 @@ _EOF_ else - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-fpm "$PHP_APT_PACKAGE_NAME"-cgi "$PHP_APT_PACKAGE_NAME"-xsl + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-fpm "$PHP_APT_PACKAGE_NAME"-cgi + # 'php-xsl' does not exist for >= Stretch, 'php7.0-xsl' is just dummy for 'php7.0-xml': https://github.com/Fourdee/DietPi/issues/1286 + (( $DISTRO < 4 )) && AGI_ERROR_CHECKED php5-xsl fi @@ -3850,7 +3852,7 @@ _EOF_ fi - #Redis php module | >= 1 to check for existing installs (2) + #Redis php module if (( ${aSOFTWARE_INSTALL_STATE[91]} >= 1 )); then AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-redis From 0293c6d40d1bcb128d4966df53ad74cb59fc1530 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 20 Dec 2017 02:02:44 +0100 Subject: [PATCH 086/390] v160 + Adding new optional ownCloud/Nextcloud data directory variable. + Make clear, that optional username now also applies for ownCloud. --- dietpi.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dietpi.txt b/dietpi.txt index 03684bc38e..0ec8ccb8c4 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -207,8 +207,11 @@ dietpi_vncserver_depth=16 dietpi_vncserver_display=1 dietpi_vncserver_shared_desktop=0 -#Optional username for nextcloud admin account, default is admin. Applied during installation. -dietpi_nextcloud_username=admin +#Optional username for ownCloud/Nextcloud admin account, default is 'admin'. Applied during installation. +dietpi_ownnextcloud_username=admin + +#Optional data directory for ownCloud/Nextcloud, default is '/mnt/dietpi_userdata'. Applied during installation. +dietpi_ownnextcloud_datadir=$FP_DIETPI_USERDATA #------------------------------------------------------------------------------------------------------ # D I E T - P I From ad08a6baa432eddf48a534439947a84489aeef39 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 20 Dec 2017 02:32:04 +0100 Subject: [PATCH 087/390] v160 + Adding optional ownCloud/Nextcloud data directory to installation script. --- dietpi/dietpi-software | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 458d9d2a9d..c4fd081dea 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9303,20 +9303,21 @@ _EOF_ local config_php='/var/www/owncloud/config/config.php' # Terminal installation: - mkdir -p "$FP_DIETPI_USERDATA"/owncloud_data + local datadir=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_owncloud_datadir=' | sed 's/.*=//') + [ ! -n "$datadir" ] && datadir="$FP_DIETPI_USERDATA/owncloud_data" + mkdir -p "$datadir" + chown -R www-data:www-data "$datadir" Install_Apply_Permissions &> /dev/null - local username=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_nextcloud_username=' | sed 's/.*=//') - if [ ! -n "$username" ]; then - username='admin' + local username=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_ownnextcloud_username=' | sed 's/.*=//') + [ ! -n "$username" ] && username='admin' - fi systemctl start mysql # For MariaDB, temporary database admin user needs to be created, as 'root' uses unix_socket login, which cannot be accessed by sudo -u www-data. local mysql_cmd='mysql -uroot' (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 )) && mysql_cmd+=" -p$GLOBAL_PW" $mysql_cmd -e "grant all privileges on *.* to 'tmp_root'@'localhost' identified by '$GLOBAL_PW' with grant option" - grep -q "'installed' => true," $config_php 2>/dev/null || occ maintenance:install --no-interaction --database "mysql" --database-name "owncloud" --database-user "tmp_root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$FP_DIETPI_USERDATA/owncloud_data" + grep -q "'installed' => true," $config_php 2>/dev/null || occ maintenance:install --no-interaction --database "mysql" --database-name "owncloud" --database-user "tmp_root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$datadir" $mysql_cmd -e "drop user 'tmp_root'@'localhost'" # Enable MySQL 4-byte support for new installations only, to prevent risky database conversion tasks: @@ -9478,20 +9479,21 @@ _EOF_ local config_php='/var/www/nextcloud/config/config.php' # Terminal installation: - mkdir -p "$FP_DIETPI_USERDATA"/nextcloud_data + local datadir=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_nextcloud_datadir=' | sed 's/.*=//') + [ ! -n "$datadir" ] && datadir="$FP_DIETPI_USERDATA/nextcloud_data" + mkdir -p "$datadir" + chown -R www-data:www-data "$datadir" Install_Apply_Permissions &> /dev/null - local username=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_nextcloud_username=' | sed 's/.*=//') - if [ ! -n "$username" ]; then - username='admin' + local username=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_ownnextcloud_username=' | sed 's/.*=//') + [ ! -n "$username" ] && username='admin' - fi systemctl start mysql # For MariaDB, temporary database admin user needs to be created, as 'root' uses unix_socket login, which cannot be accessed by sudo -u www-data. local mysql_cmd='mysql -uroot' (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 )) && mysql_cmd+=" -p$GLOBAL_PW" $mysql_cmd -e "grant all privileges on *.* to 'tmp_root'@'localhost' identified by '$GLOBAL_PW' with grant option" - grep -q "'installed' => true," $config_php 2>/dev/null || ncc maintenance:install --no-interaction --database "mysql" --database-name "nextcloud" --database-user "tmp_root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$FP_DIETPI_USERDATA/nextcloud_data" + grep -q "'installed' => true," $config_php 2>/dev/null || ncc maintenance:install --no-interaction --database "mysql" --database-name "nextcloud" --database-user "tmp_root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$datadir" $mysql_cmd -e "drop user 'tmp_root'@'localhost'" # Enable MySQL 4-byte support for new installations only, to prevent risky database conversion tasks: From 8a8676625cffc5f5ad9f5475b91e848ae158226b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 20 Dec 2017 02:35:07 +0100 Subject: [PATCH 088/390] v160 + Switched to separate ownCloud and Nextcloud data directory, to allow parallel installation. --- dietpi.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dietpi.txt b/dietpi.txt index 0ec8ccb8c4..d6919ec2aa 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -210,8 +210,11 @@ dietpi_vncserver_shared_desktop=0 #Optional username for ownCloud/Nextcloud admin account, default is 'admin'. Applied during installation. dietpi_ownnextcloud_username=admin -#Optional data directory for ownCloud/Nextcloud, default is '/mnt/dietpi_userdata'. Applied during installation. -dietpi_ownnextcloud_datadir=$FP_DIETPI_USERDATA +#Optional data directory for ownCloud, default is '/mnt/dietpi_userdata/owncloud_data'. Applied during installation. +dietpi_owncloud_datadir=$FP_DIETPI_USERDATA/owncloud_data + +#Optional data directory for Nextcloud, default is '/mnt/dietpi_userdata/nextcloud_data'. Applied during installation. +dietpi_nextcloud_datadir=$FP_DIETPI_USERDATA/nextcloud_data #------------------------------------------------------------------------------------------------------ # D I E T - P I From 65f6501ec0038783e32e8a85a7b905708de517fd Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 20 Dec 2017 02:47:35 +0100 Subject: [PATCH 089/390] v160 + Add ownCloud/Nextcloud changes to changelog. --- CHANGELOG.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 17df9968f4..64a2ba24db 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -11,6 +11,7 @@ DietPi-Globals | Global variables and functions are now exported during login. P DietPi-Set_Hardware | Sparky SBC: enable aotg.aotg1_speed compatibility setting for USB 1.1, when USB-DAC configured: https://github.com/Fourdee/DietPi/issues/1301 DietPi-Software | NAA Daemon: Updated to latest (3.5.2-36). Existing installs will be patched automatically: https://github.com/Fourdee/DietPi/issues/1305 DietPi-Software | PHP-FPM: Increased from "$CPU_CORES_TOTAL" to "pm.max_children = $(( $CPU_CORES_TOTAL * 3 ))". This should avoid failed forking of PHP-FPM processes/requests : https://github.com/Fourdee/DietPi/issues/1298 +DietPi-Software | ownCloud/Nextcloud: Added option to choose data directory via dietpi.txt pre installation: https://github.com/Fourdee/DietPi/issues/1314#issuecomment-352782055 Bug Fixes: DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi drop during software installs/updates etc: https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480 @@ -20,6 +21,7 @@ DietPi-Software | Plex Media Server: Resolved uninstall to include /var/lib/plex DietPi-Software | MariaDB: Resolved an issue where MariaDB would fail to uninstall correctly: https://github.com/Fourdee/DietPi/pull/1280 DietPi-Software | Aira2 (Stretch): Resolved installation, now used APT installation: https://github.com/Fourdee/DietPi/issues/1310 DietPi-Software | Mosquitto (Stretch): Resolved issue with failed install, due to unavailable pre-req libs in Debian/Mosq repos: https://github.com/Fourdee/DietPi/issues/1306 +DietPi-Software | ownCloud/Nextcloud: Fixed an installation issue on Jessie with MariaDB: https://github.com/Fourdee/DietPi/pull/1319 DietPi-Update | dietpi.txt is now checked for missing entries, and, will now be patched during the update: https://github.com/Fourdee/DietPi/issues/1292#issuecomment-350818969 Sparky SBC | Kernel patch will be applied which resolves issues with HQPlayer playback: https://www.computeraudiophile.com/forums/topic/32132-allo-sparky-usbridge/?do=findComment&comment=753100 From 9818338c2a05859c8f3adb2969cdf507603d9672 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 20 Dec 2017 03:11:48 +0100 Subject: [PATCH 090/390] v160 + DietPi-Software | ownCloud/Nextcloud: Adjust 'Install_Apply_Permissions' to handle optional data directories --- dietpi/dietpi-software | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index c4fd081dea..b4c9c31c67 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8702,8 +8702,14 @@ _EOF_ # - www-data chown -R www-data:www-data "$FP_DIETPI_USERDATA"/dietpicam chown -R www-data:www-data "$FP_DIETPI_USERDATA"/pydio_data - chown -R www-data:www-data "$FP_DIETPI_USERDATA"/owncloud_data - chown -R www-data:www-data "$FP_DIETPI_USERDATA"/nextcloud_data + + local datadir=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_owncloud_datadir=' | sed 's/.*=//') + [ ! -n "$datadir" ] && datadir="$FP_DIETPI_USERDATA/owncloud_data" + chown -R www-data:www-data "$datadir" + + datadir=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_nextcloud_datadir=' | sed 's/.*=//') + [ ! -n "$datadir" ] && datadir="$FP_DIETPI_USERDATA/nextcloud_data" + chown -R www-data:www-data "$datadir" # - Home Assistant Permissions #chown -R homeassistant:dietpi /home/homeassistant/.homeassistant @@ -9306,7 +9312,6 @@ _EOF_ local datadir=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_owncloud_datadir=' | sed 's/.*=//') [ ! -n "$datadir" ] && datadir="$FP_DIETPI_USERDATA/owncloud_data" mkdir -p "$datadir" - chown -R www-data:www-data "$datadir" Install_Apply_Permissions &> /dev/null local username=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_ownnextcloud_username=' | sed 's/.*=//') @@ -9482,7 +9487,6 @@ _EOF_ local datadir=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_nextcloud_datadir=' | sed 's/.*=//') [ ! -n "$datadir" ] && datadir="$FP_DIETPI_USERDATA/nextcloud_data" mkdir -p "$datadir" - chown -R www-data:www-data "$datadir" Install_Apply_Permissions &> /dev/null local username=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_ownnextcloud_username=' | sed 's/.*=//') From 27bcbf113aa3a1ec50299af5a618cd7ce2401877 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 20 Dec 2017 05:37:30 +0000 Subject: [PATCH 091/390] v160 + Minor fixes --- dietpi/func/dietpi-globals | 6 ++++++ dietpi/func/dietpi-set_core_environment | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 799c0938ac..405cb1b562 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -160,11 +160,17 @@ CHECK_ROOT_USER(){ + dietpi-notify 2 'Checking for (elevated) root access, please wait..' + if (( $UID != 0 )); then dietpi-notify 1 'Error: Root privileges required. Please run the command with "sudo"\n' exit 1 + else + + dietpi-notify 0 'Root access verified.' + fi } diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index f64f6c22b1..b0af4b314c 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -39,18 +39,18 @@ #Near copy of useradd in dietpi-set_software, however, to support use in non-dietpi ready system, we manually need it here. Create_DietPi_User(){ - mkdir -p /home + mkdir -p /home/"$DIETPI_USERNAME" useradd -m -s /bin/bash "$DIETPI_USERNAME" chpasswd <<< "$DIETPI_USERNAME:$DIETPI_PASSWORD" # Copy existing profile/bashrc - cp /root/.profile /home/$DIETPI_USERNAME/ - cp /root/.bashrc /home/$DIETPI_USERNAME/ + cp /root/.profile /home/"$DIETPI_USERNAME"/ + cp /root/.bashrc /home/"$DIETPI_USERNAME"/ # Sudo up dietpi login script sed -i '/^\/DietPi\/dietpi\/login/c\sudo \/DietPi\/dietpi\/login' /home/$DIETPI_USERNAME/.bashrc - chown -R $DIETPI_USERNAME:$DIETPI_USERNAME /home/$DIETPI_USERNAME + chown -R "$DIETPI_USERNAME":"$DIETPI_USERNAME" /home/"$DIETPI_USERNAME" # Allow sudo without pw if (( ! $(cat /etc/sudoers | grep -ci -m1 "^$DIETPI_USERNAME[[:space:]]") )); then From 9b3ef37d5cef08f379f437d034176b36839270be Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 20 Dec 2017 05:58:54 +0000 Subject: [PATCH 092/390] v160 + Hard code FP_DIETPI_USERDATA dir in dietpi.txt, not expanded during install + Limit new data dir's to advanced users. + https://github.com/Fourdee/DietPi/pull/1319#pullrequestreview-84664248 --- dietpi.txt | 6 ++++-- dietpi/dietpi-software | 10 +++++----- dietpi/func/dietpi-globals | 3 ++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/dietpi.txt b/dietpi.txt index 169a26bc6a..f2586ff6ae 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -211,10 +211,12 @@ dietpi_vncserver_shared_desktop=0 dietpi_ownnextcloud_username=admin #Optional data directory for ownCloud, default is '/mnt/dietpi_userdata/owncloud_data'. Applied during installation. -dietpi_owncloud_datadir=$FP_DIETPI_USERDATA/owncloud_data +# This option is for advanced users. For full compatibility, please keep this options defaults, and, use dietpi-drive_manager to move the DietPi user data location. +dietpi_owncloud_datadir=/mnt/dietpi_userdata/owncloud_data #Optional data directory for Nextcloud, default is '/mnt/dietpi_userdata/nextcloud_data'. Applied during installation. -dietpi_nextcloud_datadir=$FP_DIETPI_USERDATA/nextcloud_data +# This option is for advanced users. For full compatibility, please keep this options defaults, and, use dietpi-drive_manager to move the DietPi user data location. +dietpi_nextcloud_datadir=/mnt/dietpi_userdata/nextcloud_data #------------------------------------------------------------------------------------------------------ # D I E T - P I diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d1c958e6ef..0734182374 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3810,7 +3810,7 @@ _EOF_ else AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-fpm "$PHP_APT_PACKAGE_NAME"-cgi - # 'php-xsl' does not exist for >= Stretch, 'php7.0-xsl' is just dummy for 'php7.0-xml': https://github.com/Fourdee/DietPi/issues/1286 + # 'php-xsl' does not exist for >= Stretch, 'php7.0-xsl' is just dummy for 'php7.0-xml': https://github.com/Fourdee/DietPi/issues/1286 (( $DISTRO < 4 )) && AGI_ERROR_CHECKED php5-xsl fi @@ -8687,11 +8687,11 @@ _EOF_ # - www-data chown -R www-data:www-data "$FP_DIETPI_USERDATA"/dietpicam chown -R www-data:www-data "$FP_DIETPI_USERDATA"/pydio_data - + local datadir=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_owncloud_datadir=' | sed 's/.*=//') [ ! -n "$datadir" ] && datadir="$FP_DIETPI_USERDATA/owncloud_data" chown -R www-data:www-data "$datadir" - + datadir=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_nextcloud_datadir=' | sed 's/.*=//') [ ! -n "$datadir" ] && datadir="$FP_DIETPI_USERDATA/nextcloud_data" chown -R www-data:www-data "$datadir" @@ -9469,12 +9469,12 @@ _EOF_ local config_php='/var/www/nextcloud/config/config.php' # Terminal installation: - local datadir=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_nextcloud_datadir=' | sed 's/.*=//') + local datadir=$(grep -m1 '^dietpi_nextcloud_datadir=' /DietPi/dietpi.txt | sed 's/.*=//') [ ! -n "$datadir" ] && datadir="$FP_DIETPI_USERDATA/nextcloud_data" mkdir -p "$datadir" Install_Apply_Permissions &> /dev/null - local username=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_ownnextcloud_username=' | sed 's/.*=//') + local username=$(grep -m1 '^dietpi_ownnextcloud_username=' /DietPi/dietpi.txt | sed 's/.*=//') [ ! -n "$username" ] && username='admin' systemctl start mysql diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 405cb1b562..337a7c4839 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -15,6 +15,7 @@ # - dietpi-ramlog # - dietpi-ramdisk # - PREP_SYSTEM_FOR_DIETPI.sh + # - dietpi.txt (and all other .txt .ini files) # # Notes: # - . /DietPi/dietpi/func/dietpi-globals > $HOME/.bashrc @@ -357,6 +358,6 @@ } #----------------------------------------------------------------------------------- - #dietpi-notify 0 'DietPi-Globals\n' + dietpi-notify 2 'DietPi-Globals loaded' #----------------------------------------------------------------------------------- } From 63bf1a2d50b9b1ae818853f7cc53cc3c080ed5b8 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 20 Dec 2017 06:29:45 +0000 Subject: [PATCH 093/390] v160 + Fixes for moving userdata: https://github.com/Fourdee/DietPi/issues/1311#issuecomment-352972977 --- dietpi/dietpi-drive_manager | 8 ++++---- dietpi/dietpi-software | 4 ++-- dietpi/func/dietpi-globals | 5 ++++- dietpi/func/dietpi-set_userdata | 31 +++++++++---------------------- 4 files changed, 19 insertions(+), 29 deletions(-) diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 9e46cb9428..535adc698b 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -366,8 +366,8 @@ fi - #User data location - FP_USERDATA_CURRENT=$(/DietPi/dietpi/func/dietpi-set_userdata return_source) + #Obtain actual user data location on disk (follows symlinks) + FP_USERDATA_CURRENT=$(readlink -f $FP_DIETPI_USERDATA) done @@ -737,7 +737,7 @@ # - User data local userdata_location_text="RootFS ($FP_USERDATA_CURRENT)" - if [ "$FP_USERDATA_CURRENT" != "/mnt/dietpi_userdata" ]; then + if [ "$FP_USERDATA_CURRENT" != "$FP_DIETPI_USERDATA" ]; then userdata_location_text="USB ($FP_USERDATA_CURRENT)" @@ -847,7 +847,7 @@ fi if ( [ "${aDRIVE_MOUNT_TARGET[$INDEX_DRIVE_BEING_EDITED]}" != "/" ] && [[ $FP_USERDATA_CURRENT == "${aDRIVE_MOUNT_TARGET[$INDEX_DRIVE_BEING_EDITED]}"* ]] ) || #off rootfs - ( [ "${aDRIVE_MOUNT_TARGET[$INDEX_DRIVE_BEING_EDITED]}" = "/" ] && [ "$FP_USERDATA_CURRENT" = "/mnt/dietpi_userdata" ] ); then #on rootfs + ( [ "${aDRIVE_MOUNT_TARGET[$INDEX_DRIVE_BEING_EDITED]}" = "/" ] && [ "$FP_USERDATA_CURRENT" = "$FP_DIETPI_USERDATA" ] ); then #on rootfs whiptail_menu_array+=("User data" ": Your user data is currently located on this drive") partition_contains_userdata=1 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 0734182374..b195e2a8a6 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -15422,7 +15422,7 @@ _EOF_ Check_USB_Drive_Installed #Where is userdata stored? - local user_data_location_current=$(/DietPi/dietpi/func/dietpi-set_userdata return_source) + local user_data_location_current=$(readlink -f $FP_DIETPI_USERDATA) local user_data_location_description='' if [ "$user_data_location_current" = "$FP_DIETPI_DEDICATED_USBDRIVE" ]; then @@ -15677,7 +15677,7 @@ _EOF_ if (( $? == 0 )); then - whiptail --title "User data transfer: Completed" --msgbox "Your user data has been sucessfuly moved:\n\n - From: $user_data_location_current\n - To: $(/DietPi/dietpi/func/dietpi-set_userdata return_source)" 12 70 + whiptail --title "User data transfer: Completed" --msgbox "Your user data has been sucessfuly moved:\n\n - From: $user_data_location_current\n - To: $move_data_target" 12 70 else diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 337a7c4839..10b817fbee 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -234,7 +234,10 @@ #----------------------------------------------------------------------------------- # DietPi specific directories #----------------------------------------------------------------------------------- + # - Default DietPi userdata location. This must NEVER change. FP_DIETPI_USERDATA='/mnt/dietpi_userdata' + # - Current DietPi userdata location (actual, follows symlink of FP_DIETPI_USERDATA, if not on rootFS) + #FP_DIETPI_USERDATA_CURRENT=$(readlink -f $FP_DIETPI_USERDATA) #FP_DIETPI_VAR_LIB='/var/lib/dietpi' #FP_DIETPI_VAR_TMP='/var/tmp/dietpi' @@ -358,6 +361,6 @@ } #----------------------------------------------------------------------------------- - dietpi-notify 2 'DietPi-Globals loaded' + dietpi-notify 2 'DietPi-Globals loaded\n' #----------------------------------------------------------------------------------- } diff --git a/dietpi/func/dietpi-set_userdata b/dietpi/func/dietpi-set_userdata index 48485256c6..45ea2b60de 100644 --- a/dietpi/func/dietpi-set_userdata +++ b/dietpi/func/dietpi-set_userdata @@ -14,7 +14,6 @@ # - Also moves the Dphys swapfile to $TARGET_DIRECTORY. Required to prevent locked .swapfile from allow us to delete $SOURCE_DIRECTORY. # # Usage: - # - /DietPi/dietpi/func/dietpi-set_userdata return_source | Return current user data directory FP # - /DietPi/dietpi/func/dietpi-set_userdata SOURCE_DIRECTORY TARGET_DIRECTORY | Setup user data directory, move data if needed. if TARGET_DIRECTORY='auto' , auto target location.Returns 1 if failed. #//////////////////////////////////// @@ -25,8 +24,6 @@ EXIT_CODE=0 - DIETPI_USERDATA_DIRECTORY='/mnt/dietpi_userdata' # Global, must match same var in dietpi-software in dietpi-uninstall. Probably a good idea to never change this. - SOURCE_DIRECTORY="$1" TARGET_DIRECTORY="$2" @@ -114,11 +111,11 @@ fi - # - Create symlink to DIETPI_USERDATA_DIRECTORY if required - if [ "$TARGET_DIRECTORY" != "$DIETPI_USERDATA_DIRECTORY" ]; then + # - Create symlink to FP_DIETPI_USERDATA if required + if [ "$TARGET_DIRECTORY" != "$FP_DIETPI_USERDATA" ]; then - rm -R "$DIETPI_USERDATA_DIRECTORY" &> /dev/null - ln -sf "$TARGET_DIRECTORY" "$DIETPI_USERDATA_DIRECTORY" + rm -R "$FP_DIETPI_USERDATA" &> /dev/null + ln -sf "$TARGET_DIRECTORY" "$FP_DIETPI_USERDATA" fi @@ -135,20 +132,10 @@ #///////////////////////////////////////////////////////////////////////////////////// #init - # - If there is no directory or symlink for $DIETPI_USERDATA_DIRECTORY, always create a directory. - if [ ! -d "$DIETPI_USERDATA_DIRECTORY" ] && [ ! -L "$DIETPI_USERDATA_DIRECTORY" ]; then - - mkdir -p "$DIETPI_USERDATA_DIRECTORY" - - fi - - #------------------------------------------------------------------------------------- - #Returns - # - Return current userdata dir - if [ "$1" = "return_source" ]; then + # - If there is no directory or symlink for $FP_DIETPI_USERDATA, always create a directory. + if [ ! -d "$FP_DIETPI_USERDATA" ] && [ ! -L "$FP_DIETPI_USERDATA" ]; then - echo -e "$(readlink -f $DIETPI_USERDATA_DIRECTORY)" - exit + mkdir -p "$FP_DIETPI_USERDATA" fi @@ -173,9 +160,9 @@ break # - Check if symlink is already pointing to target directory. - elif [ "$(readlink -f $DIETPI_USERDATA_DIRECTORY)" = "$TARGET_DIRECTORY" ]; then + elif [ "$(readlink -f $FP_DIETPI_USERDATA)" = "$TARGET_DIRECTORY" ]; then - LOGFILE_OUTPUT_TEXT="$DIETPI_USERDATA_DIRECTORY is already symlinked to target directory." + LOGFILE_OUTPUT_TEXT="$FP_DIETPI_USERDATA is already symlinked to target directory." EXIT_CODE=0 #return ok break From b069e13d2e742b2887661f891294cb8f094b500c Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 20 Dec 2017 06:43:47 +0000 Subject: [PATCH 094/390] v160 + Remaning hard coded "$FP_DIETPI_USERDATA", updated to use globals: https://github.com/Fourdee/DietPi/issues/1311 --- dietpi/dietpi-backup | 13 ++++++------- dietpi/func/dietpi-set_core_environment | 6 +++--- dietpi/login | 2 +- dietpi/patch_file | 12 ++++++------ 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index b73a685cd7..a05a565cdb 100644 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -85,7 +85,7 @@ ;; "Backup mode") - OPTION=$(whiptail --title "$WHIP_TITLE" --menu "Please select a backup mode:\n\n - System only\nOnly the system is backed up and restored, this does not include your DietPi user data (/mnt/dietpi_userdata).\n\n - Full:\nSystem and user data (/mnt/dietpi_userdata) is backed up and restored.\n\nMore information on what DietPi user data is:\nhttp://dietpi.com/phpbb/viewtopic.php?f=8&t=478#p2087" --cancel-button "Exit" --default-item "$BACKUP_MODE" --backtitle "$WHIP_BACKTITLE" 20 80 2 \ + OPTION=$(whiptail --title "$WHIP_TITLE" --menu "Please select a backup mode:\n\n - System only\nOnly the system is backed up and restored, this does not include your DietPi user data ($FP_DIETPI_USERDATA).\n\n - Full:\nSystem and user data ($FP_DIETPI_USERDATA) is backed up and restored.\n\nMore information on what DietPi user data is:\nhttp://dietpi.com/phpbb/viewtopic.php?f=8&t=478#p2087" --cancel-button "Exit" --default-item "$BACKUP_MODE" --backtitle "$WHIP_BACKTITLE" 20 80 2 \ "0" "System only" \ "1" "Full (includes user data)" 3>&1 1>&2 2>&3) CHOICE=$? @@ -259,7 +259,7 @@ dietpi-notify 1 "Target directory can not be contained within DietPi user data location ($FP_TARGET_BACKUP)" if (( $INPUT == 0 )); then - whiptail --title "Directory not supported" --msgbox "$FP_TARGET_BACKUP\n\nYour current location is not supported.\nTarget directory can not be contained within DietPi user data location (/mnt/dietpi_userdata)" --backtitle "$WHIP_BACKTITLE" 13 70 + whiptail --title "Directory not supported" --msgbox "$FP_TARGET_BACKUP\n\nYour current location is not supported.\nTarget directory can not be contained within DietPi user data location ($FP_DIETPI_USERDATA)" --backtitle "$WHIP_BACKTITLE" 13 70 fi } @@ -299,8 +299,7 @@ #Backup Filepaths FP_SOURCE_SYSTEM='/' FP_TARGET_BACKUP='/mnt/dietpi-backup' - FP_SOURCE_USERDATA_GLOBAL='/mnt/dietpi_userdata' - FP_SOURCE_USERDATA_ACTUAL="$(readlink -f /mnt/dietpi_userdata)" + FP_DIETPI_USERDATA_ACTUAL="$(readlink -f /mnt/dietpi_userdata)" #file applied to successful backups (stored in "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_SYSTEM" BACKUP_STATS_FILENAME_SYSTEM='.dietpi-backup_system_stats' @@ -490,7 +489,7 @@ _EOF_ if (( $BACKUP_MODE == 1 )); then - rsync $RSYNC_RUN_OPTIONS_USERDATA_BACKUP "$FP_SOURCE_USERDATA_ACTUAL"/ "$FP_TARGET_BACKUP"/dietpi-backup_userdata/ + rsync $RSYNC_RUN_OPTIONS_USERDATA_BACKUP "$FP_DIETPI_USERDATA_ACTUAL"/ "$FP_TARGET_BACKUP"/dietpi-backup_userdata/ if (( $? == 0 )); then @@ -605,7 +604,7 @@ _EOF_ # - Only restore userdata if a backup exists if [ -f "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_USERDATA" ]; then - rsync $RSYNC_RUN_OPTIONS_USERDATA_BACKUP "$FP_TARGET_BACKUP"/dietpi-backup_userdata/ "$FP_SOURCE_USERDATA_ACTUAL"/ + rsync $RSYNC_RUN_OPTIONS_USERDATA_BACKUP "$FP_TARGET_BACKUP"/dietpi-backup_userdata/ "$FP_DIETPI_USERDATA_ACTUAL"/ if (( $? == 0 )); then dietpi-notify 0 "$RSYNC_MODE_TEXT Completed.\n" @@ -678,7 +677,7 @@ _EOF_ TARGET_DIRECTORY_SUPPORTED=0 #Disallow dietpi_userdata location, due to includes in that location - if [[ "$FP_TARGET_BACKUP" == "$FP_SOURCE_USERDATA_GLOBAL"* ]] || [[ "$FP_TARGET_BACKUP" == "$FP_SOURCE_USERDATA_ACTUAL"* ]] ; then + if [[ "$FP_TARGET_BACKUP" == "$FP_DIETPI_USERDATA"* ]] || [[ "$FP_TARGET_BACKUP" == "$FP_DIETPI_USERDATA_ACTUAL"* ]] ; then Error_DietpiUserdata_Directory diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index b0af4b314c..8e9fb5e589 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -209,9 +209,9 @@ _EOF_ chmod 660 /DietPi # - /mnt/dietpi_userdata : DietPi userdata - mkdir -p /mnt/dietpi_userdata - chown dietpi:dietpi /mnt/dietpi_userdata - chmod 660 /mnt/dietpi_userdata + mkdir -p "$FP_DIETPI_USERDATA" + chown dietpi:dietpi "$FP_DIETPI_USERDATA" + chmod 660 "$FP_DIETPI_USERDATA" # - Networked drives mkdir -p /mnt/samba diff --git a/dietpi/login b/dietpi/login index b5258de56c..d6a2e83312 100644 --- a/dietpi/login +++ b/dietpi/login @@ -117,7 +117,7 @@ done - /mnt/dietpi_userdata/dxx-rebirth/run.sh + "$FP_DIETPI_USERDATA"/dxx-rebirth/run.sh #CAVA elif (( $AUTO_START_INDEX == 10 )); then diff --git a/dietpi/patch_file b/dietpi/patch_file index 844200ed99..e9cdb988cd 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1016,7 +1016,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #Always ensure dietpi_userdata directory exists - mkdir -p /mnt/dietpi_userdata &> /dev/null + mkdir -p "$FP_DIETPI_USERDATA" &> /dev/null #Setup dietpi_userdata symlink for existing installs, if not on flash drive if [ -f /DietPi/dietpi/.installed ]; then @@ -1030,12 +1030,12 @@ _EOF_ #USBDRIVE if (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'USBDRIVE=2') && $(df | grep -ci -m1 '/mnt/usb_1') )); then - /DietPi/dietpi/func/dietpi-set_userdata /mnt/dietpi_userdata /mnt/usb_1 + /DietPi/dietpi/func/dietpi-set_userdata "$FP_DIETPI_USERDATA" /mnt/usb_1 fi #CUSTOM else - /DietPi/dietpi/func/dietpi-set_userdata /mnt/dietpi_userdata "$DIETPI_USERDATA_BASEDIRECTORY" + /DietPi/dietpi/func/dietpi-set_userdata "$FP_DIETPI_USERDATA" "$DIETPI_USERDATA_BASEDIRECTORY" fi # - dietpi-set_userdata restarts services, so stop them. @@ -2428,7 +2428,7 @@ _EOF_ killall -w uae4arm-rpi mv /etc/uae4arm-rpi /etc/amiberry - mv /mnt/dietpi_userdata/uae4arm-rpi /mnt/dietpi_userdata/amiberry + mv "$FP_DIETPI_USERDATA"/uae4arm-rpi "$FP_DIETPI_USERDATA"/amiberry systemctl disable uae4arm-rpi.service rm /etc/systemd/system/uae4arm-rpi.service systemctl daemon-reload @@ -2711,8 +2711,8 @@ _EOF_ 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 + rm "$FP_DIETPI_USERDATA"/roon/RoonBridge/Settings/unique_id + rm "$FP_DIETPI_USERDATA"/roon/RAATServer/Settings/unique_id fi #------------------------------------------------------------------------------- From 39fb3fdc29da46f93c09ce03522a4134ccebe8f7 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 20 Dec 2017 06:55:26 +0000 Subject: [PATCH 095/390] v160 + Permission correction: https://github.com/Fourdee/DietPi/issues/1324#issue-283322615 --- dietpi/func/dietpi-set_core_environment | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index 8e9fb5e589..7e6a2a5bdb 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -211,7 +211,7 @@ _EOF_ # - /mnt/dietpi_userdata : DietPi userdata mkdir -p "$FP_DIETPI_USERDATA" chown dietpi:dietpi "$FP_DIETPI_USERDATA" - chmod 660 "$FP_DIETPI_USERDATA" + chmod -R 775 "$FP_DIETPI_USERDATA" # - Networked drives mkdir -p /mnt/samba From 952b24fa47a5e2b6b289995dfe7ef1064f9c5b7c Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 20 Dec 2017 07:07:13 +0000 Subject: [PATCH 096/390] v160 + Minor fix/reduction in duplicate code. --- dietpi/func/dietpi-set_userdata | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_userdata b/dietpi/func/dietpi-set_userdata index 45ea2b60de..e4df7487fc 100644 --- a/dietpi/func/dietpi-set_userdata +++ b/dietpi/func/dietpi-set_userdata @@ -135,7 +135,8 @@ # - If there is no directory or symlink for $FP_DIETPI_USERDATA, always create a directory. if [ ! -d "$FP_DIETPI_USERDATA" ] && [ ! -L "$FP_DIETPI_USERDATA" ]; then - mkdir -p "$FP_DIETPI_USERDATA" + #Run full core_env set + /DietPi/dietpi/func/dietpi-set_core_environment fi From 0df37f420c4e3766b5f913cdae82c912fe7cb1cb Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 20 Dec 2017 08:29:11 +0000 Subject: [PATCH 097/390] v160 + Use func return value for handling AGX errors, instead of a global + Check_URL connection test now global command https://github.com/Fourdee/DietPi/issues/1311 --- dietpi/dietpi-bugreport | 4 +- dietpi/dietpi-config | 7 +- dietpi/dietpi-software | 227 ++++++++++++++++---------------- dietpi/dietpi-survey | 2 +- dietpi/func/check_connection | 50 ------- dietpi/func/dietpi-globals | 92 ++++++++++--- dietpi/func/dietpi-set_hardware | 10 +- dietpi/func/dietpi-set_software | 2 +- 8 files changed, 206 insertions(+), 188 deletions(-) delete mode 100644 dietpi/func/check_connection diff --git a/dietpi/dietpi-bugreport b/dietpi/dietpi-bugreport index 8207b45125..908137a411 100644 --- a/dietpi/dietpi-bugreport +++ b/dietpi/dietpi-bugreport @@ -206,7 +206,7 @@ _EOF_ cd "$FILEPATH_TEMP" #---------------------------------------------------------------- #Check if we have a working internet connection beforehand - /DietPi/dietpi/func/check_connection "$FTP_ADDR" + Check_URL "$FTP_ADDR" if (( $? == 0 )); then INTERNET_AVAILABLE=1 fi @@ -269,7 +269,7 @@ _EOF_ else #Check upload location is online - /DietPi/dietpi/func/check_connection "$FTP_ADDR" + Check_URL "$FTP_ADDR" if (( $? == 0 )); then #Limit filesize to 10MB diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index c152cf8656..793829a51b 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -2832,7 +2832,7 @@ _EOF_ INTERNET_ONLINE=0 #Not tested #Check for connection - /DietPi/dietpi/func/check_connection "$INTERNET_URL" + Check_URL "$INTERNET_URL" if (( $? == 0 )); then INTERNET_ONLINE=2 #Online else @@ -5003,9 +5003,10 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ dietpi-notify 2 "Updating Apt, please wait..." AGUP - if (( $EXITCODE_APT != 0 )); then + local exit_code=$? + if (( $exit_code != 0 )); then - whiptail --title "Apt Error:" --msgbox "Failed to update apt, exit code: $EXITCODE_APT\nPlease try another Apt mirror." --backtitle "$WHIP_BACKTITLE" 8 65 + whiptail --title "Apt Error:" --msgbox "Failed to update apt, exit code: $exit_code\nPlease try another Apt mirror." --backtitle "$WHIP_BACKTITLE" 8 65 fi diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index b195e2a8a6..f82ced47e1 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3353,7 +3353,7 @@ _EOF_ local string="$@" AGI $string - if (( $EXITCODE_APT != 0 )); then + if (( $? != 0 )); then Error_AptGet_Failed @@ -3366,6 +3366,11 @@ _EOF_ local string="$@" AGP $string + if (( $? != 0 )); then + + Error_AptGet_Failed + + fi } @@ -3373,7 +3378,7 @@ _EOF_ AGF_ERROR_CHECKED(){ AGF - if (( $EXITCODE_APT != 0 )); then + if (( $? != 0 )); then Error_AptGet_Failed @@ -3497,7 +3502,7 @@ _EOF_ # # INSTALL_URL_ADDRESS='https://github.com/Hellowlol/HTPC-Manager.git' # - # /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + # Check_URL "$INSTALL_URL_ADDRESS" # #Install # if (( $? == 0 )); then # @@ -3532,7 +3537,7 @@ _EOF_ # - For desktop entries/icons hosted on dietpi.com INSTALL_URL_ADDRESS='http://dietpi.com/downloads/conf/desktop' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -3556,7 +3561,7 @@ _EOF_ # - For desktop entries/icons hosted on dietpi.com INSTALL_URL_ADDRESS='http://dietpi.com/downloads/conf/desktop' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -3579,7 +3584,7 @@ _EOF_ # - For desktop entries/icons hosted on dietpi.com INSTALL_URL_ADDRESS='http://dietpi.com/downloads/conf/desktop' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -3602,7 +3607,7 @@ _EOF_ # - For desktop entries/icons hosted on dietpi.com INSTALL_URL_ADDRESS='http://dietpi.com/downloads/conf/desktop' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -3651,7 +3656,7 @@ _EOF_ fi # Now, check that the links are legitimate - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -3907,7 +3912,7 @@ _EOF_ if (( $HW_ARCH == 3 )); then INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/mpd_0.19.21_arm64.deb' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then #libupnp6 for net discov with upnp/avahi @@ -3959,7 +3964,7 @@ _EOF_ INSTALL_URL_ADDRESS+='.deb' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then #Prereqs @@ -3990,7 +3995,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://www.phpbb.com/files/release/phpBB-3.1.6.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -4014,7 +4019,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://github.com/OpenBazaar/OpenBazaar-Server.git' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -4074,7 +4079,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://yacy.net/release/yacy_v1.92_20161226_9000.tar.gz' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O package.tar.gz @@ -4099,7 +4104,7 @@ _EOF_ # No repository available yet after Stretch, thus we choose archive here: (( $DISTRO > 4 )) && INSTALL_URL_ADDRESS='https://download.owncloud.org/community/owncloud-latest.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -4141,7 +4146,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://download.nextcloud.com/server/releases/latest-12.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -4171,7 +4176,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/ympd_1.2.3.7z' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" # Install if (( $? == 0 )); then @@ -4241,7 +4246,7 @@ _EOF_ fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" # Install if (( $? == 0 )); then @@ -4287,7 +4292,7 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/cava_0.4.2_arm64.deb' fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" # Install if (( $? == 0 )); then @@ -4317,7 +4322,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://apt.mopidy.com/mopidy.gpg' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" # Install if (( $? == 0 )); then @@ -4387,10 +4392,10 @@ _EOF_ # XU4 package conflict: https://github.com/Fourdee/DietPi/issues/554 # Due to the vast differences in libcec naming across devices, if CEC fails to install, do not terminate DietPi install. AGI libcec3* - if (( $EXITCODE_APT != 0 )); then + if (( $? != 0 )); then AGI libcec3 - if (( $EXITCODE_APT != 0 )); then + if (( $? != 0 )); then dietpi-notify 2 "libcec3 failed to install." @@ -4431,7 +4436,7 @@ _EOF_ INSTALL_URL_ADDRESS="http://dietpi.com/downloads/binaries/all/noip_armhf.zip" fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -4458,7 +4463,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/amiberry-rpi_v2.1.1.7z' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -4493,7 +4498,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/rpi/dxx-rebirth.7z' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -4533,7 +4538,7 @@ _EOF_ fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -4592,7 +4597,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS="http://dietpi.com/downloads/binaries/rpi/opentyrian_armhf.zip" - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -4620,7 +4625,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://github.com/Fourdee/RPi_Cam_Web_Interface/archive/6.2.29.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -4690,7 +4695,7 @@ _EOF_ #Download Grasshopper local grasshopper_directory='/var/www' INSTALL_URL_ADDRESS='http://sourceforge.net/projects/grasshopperwebapp/files/grasshopper_v5_application.zip/download' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O grasshopper.zip @@ -4716,7 +4721,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://github.com/harmon25/raspcontrol/archive/master.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -4742,7 +4747,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://www.webmin.com/download/deb/webmin-current.deb' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O package.deb @@ -4767,7 +4772,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://packages.openmediavault.org/public' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then echo -e "deb $INSTALL_URL_ADDRESS erasmus main" > /etc/apt/sources.list.d/openmediavault.list @@ -4796,7 +4801,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://github.com/ArturSierzant/OMPD/archive/master.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -4831,7 +4836,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://github.com/afaqurk/linux-dash/archive/master.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -4857,7 +4862,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://install.pi-hole.net' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then # - Pre-reqs: https://github.com/Fourdee/DietPi/issues/1282#issuecomment-350490524 @@ -4908,7 +4913,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://sourceforge.net/projects/subsonic/files/subsonic/5.3/subsonic-5.3.deb/download' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then #AGI_ERROR_CHECKED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 @@ -4933,7 +4938,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://sourceforge.net/projects/subsonic/files/subsonic/6.0/subsonic-6.0.deb/download' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then #AGI_ERROR_CHECKED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 @@ -4958,7 +4963,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://github.com/weaved/installer/raw/master/Raspbian%20deb/1.3-07/weavedconnectd_1.3-07v_armhf.deb' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then #Install WEAVED @@ -5026,7 +5031,7 @@ _EOF_ fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -5104,7 +5109,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS="http://repo.mosquitto.org/debian/mosquitto-$DISTRO_NAME.list" - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key @@ -5144,7 +5149,7 @@ _EOF_ fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5179,7 +5184,7 @@ _EOF_ fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5216,7 +5221,7 @@ _EOF_ #Binary URL fails connection test, so we need to parent back a little: https://github.com/Fourdee/DietPi/issues/445#issuecomment-283400449 INSTALL_URL_ADDRESS='https://github.com/blynkkk/blynk-server/releases' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -5269,7 +5274,7 @@ _EOF_ do INSTALL_URL_ADDRESS="${apackages[$i]}" - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? != 0 )); then Error_NoConnection_NoInstall @@ -5328,7 +5333,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://sourceforge.net/projects/webiopi/files/WebIOPi-0.7.1.tar.gz/download' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then #Python dev, pre-reqs @@ -5385,7 +5390,7 @@ _EOF_ INSTALL_URL_ADDRESS='http://www.haproxy.org/download/1.7/src/haproxy-1.7.2.tar.gz' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5431,7 +5436,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/logitechmediaserver_7.9.0_all.deb' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5488,7 +5493,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://wordpress.org/latest.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5539,7 +5544,7 @@ _EOF_ Banner_Installing # INSTALL_URL_ADDRESS='https://www.realvnc.com/download/binary/latest/debian/arm/' - # /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + # Check_URL "$INSTALL_URL_ADDRESS" ##Install # if (( $? == 0 )); then @@ -5583,7 +5588,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/phpsysinfo/phpsysinfo/archive/master.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5609,7 +5614,7 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/Single_File_PHP_Gallery_4.6.1.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5635,7 +5640,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/ampache/ampache/archive/master.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5682,7 +5687,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://install.pivpn.io' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5751,7 +5756,7 @@ _EOF_ else INSTALL_URL_ADDRESS='https://github.com/certbot/certbot/archive/master.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5790,7 +5795,7 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/hostapd_2.5_all.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5886,7 +5891,7 @@ _EOF_ fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5953,7 +5958,7 @@ _EOF_ fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5990,7 +5995,7 @@ _EOF_ fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6023,7 +6028,7 @@ _EOF_ #check folder is online INSTALL_URL_ADDRESS='http://dietpi.com/downloads/conf/BruteFIR/' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6050,7 +6055,7 @@ _EOF_ #check folder is online INSTALL_URL_ADDRESS='https://download.pydio.com/pub/core/archives/pydio-core-8.0.1.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6075,7 +6080,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/squeezelite-1.8_all.7z' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6133,7 +6138,7 @@ _EOF_ #check, is online INSTALL_URL_ADDRESS='https://github.com/Fourdee/emonhub/archive/emon-pi.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6168,7 +6173,7 @@ _EOF_ #check, is online INSTALL_URL_ADDRESS='https://github.com/XavierBerger/RPi-Monitor-deb/raw/a7ae61cec8589b0fe1a835170ff34a268ab4a295/packages/rpimonitor_2.11-r5_all.deb' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6219,7 +6224,7 @@ _EOF_ fi #check, is online - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6247,7 +6252,7 @@ _EOF_ #check folder is online INSTALL_URL_ADDRESS='https://github.com/fruux/Baikal/archive/master.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6308,7 +6313,7 @@ _EOF_ fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -6384,7 +6389,7 @@ _EOF_ fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6444,7 +6449,7 @@ _EOF_ INSTALL_URL_ADDRESS='http://builds.cuberite.org/job/Cuberite%20Linux%20raspi-armhf%20Master/lastSuccessfulBuild/artifact/Cuberite.tar.gz' fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6475,7 +6480,7 @@ _EOF_ #check folder is online INSTALL_URL_ADDRESS='https://github.com/hexparrot/mineos-node.git' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6527,7 +6532,7 @@ _EOF_ INSTALL_URL_ADDRESS+='amd64.zip' fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6563,7 +6568,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://bintray.com/novik65/generic/download_file?file_path=ruTorrent-3.7.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6635,7 +6640,7 @@ _EOF_ fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then # - prereqs @@ -6659,7 +6664,7 @@ _EOF_ #Web interface INSTALL_URL_ADDRESS='https://github.com/ziahamza/webui-aria2/archive/master.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -6684,7 +6689,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://github.com/SickRage/SickRage/archive/master.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6745,8 +6750,8 @@ _EOF_ #?? #For some reason checking connection (spider) against the files above fails. - #/DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" - /DietPi/dietpi/func/check_connection https://github.com/syncthing/syncthing + #Check_URL "$INSTALL_URL_ADDRESS" + Check_URL https://github.com/syncthing/syncthing if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O package.tar @@ -6783,7 +6788,7 @@ _EOF_ fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O package.deb @@ -6809,7 +6814,7 @@ _EOF_ fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then AGI_ERROR_CHECKED libpng12-0 libfontconfig1 @@ -6860,7 +6865,7 @@ _EOF_ fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6923,7 +6928,7 @@ _EOF_ INSTALL_URL_ADDRESS='http://github.com/Motion-Project/motion/releases/download/release-4.0.1/pi_jessie_motion_4.0.1-1_armhf.deb' #url/redireect always fails wget spider test... - /DietPi/dietpi/func/check_connection "http://github.com/Motion-Project/motion" + Check_URL "http://github.com/Motion-Project/motion" if (( $? == 0 )); then # - Prereqs @@ -6969,7 +6974,7 @@ _EOF_ INSTALL_URL_ADDRESS='http://davesteele.github.io/cloudprint-service' #url/redirect fails wget spider test... - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then INSTALL_URL_ADDRESS+='/repo' @@ -7019,7 +7024,7 @@ _EOF_ fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -7047,7 +7052,7 @@ _EOF_ INSTALL_URL_ADDRESS="https://github.com/sabnzbd/sabnzbd/archive/$version.zip" - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then #prereqs @@ -7088,7 +7093,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://github.com/Fornoth/spotify-connect-web/releases' #full path fails wget spider test... - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then INSTALL_URL_ADDRESS+='/download/0.0.3-alpha/spotify-connect-web_0.0.3-alpha.tar.gz' @@ -7112,7 +7117,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://github.com/CouchPotato/CouchPotatoServer/archive/master.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then AGI_ERROR_CHECKED libffi-dev libssl-dev python-lxml python3-lxml @@ -7142,7 +7147,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/phanan/koel/archive/v3.6.2.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -7204,7 +7209,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://api.github.com/repos/Radarr/Radarr/releases' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -7231,7 +7236,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/JonnyWong16/plexpy.git' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -7258,7 +7263,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://api.github.com/repos/Jackett/Jackett/releases' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -7291,7 +7296,7 @@ _EOF_ INSTALL_URL_ADDRESS='http://dist.jriver.com/latest/mediacenter/mediacenter22native.list' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -7319,7 +7324,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://nzbget.net' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -7347,7 +7352,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/Hellowlol/HTPC-Manager.git' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -7377,7 +7382,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://github.com/foosel/OctoPrint.git' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -7405,7 +7410,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://download.roonlabs.com/builds/RoonServer_linuxx64.tar.bz2' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -7456,7 +7461,7 @@ _EOF_ fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then #Download executable @@ -7471,7 +7476,7 @@ _EOF_ # Check, Download, Install startup script INSTALL_URL_ADDRESS='https://github.com/minio/minio-service/raw/master/linux-systemd/minio.service' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then # Download the systemd service script @@ -7503,7 +7508,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://get.docker.com' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then # Offical Docker recommended install command @@ -7533,7 +7538,7 @@ _EOF_ fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -7557,7 +7562,7 @@ _EOF_ 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" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -7599,7 +7604,7 @@ _EOF_ fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -7626,7 +7631,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/allo_web_interface_v4.7z' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O package.7z @@ -7666,7 +7671,7 @@ _EOF_ fi - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then AGI_ERROR_CHECKED libupnp6 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-alsa @@ -7700,7 +7705,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://dtcooper.github.io/raspotify/key.asc' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget -O - "$INSTALL_URL_ADDRESS" | apt-key add - @@ -7724,7 +7729,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/moode/rel-stretch-r40b9.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then cd "$HOME" @@ -7814,7 +7819,7 @@ libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc Banner_Installing INSTALL_URL_ADDRESS='https://github.com/google/aiyprojects-raspbian.git' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then git clone "$INSTALL_URL_ADDRESS" "$FP_DIETPI_USERDATA"/voice-recognizer-raspi @@ -7947,7 +7952,7 @@ _EOF_ elif (( $HW_MODEL >= 40 && $HW_MODEL <= 42 )); then INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/libump_1-1_arm64.deb' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -8273,7 +8278,7 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/rpi/ffmpeg_rpi.7z' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O package.7z @@ -8334,7 +8339,7 @@ _EOF_ #check, is online INSTALL_URL_ADDRESS='http://raw.githubusercontent.com/taaem/nodejs-linux-installer/master/node-install.sh' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -8361,7 +8366,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://bootstrap.pypa.io/get-pip.py' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -8389,7 +8394,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/rpi/sdl2_rpi.7z' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -14622,7 +14627,7 @@ _EOF_ INSTALL_URL_ADDRESS=$AUTOINSTALL_CUSTOMSCRIPTURL - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + Check_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -14802,7 +14807,7 @@ _EOF_ sleep 1 - /DietPi/dietpi/func/check_connection "$INTERNET_URL_TEST" + Check_URL "$INTERNET_URL_TEST" if (( $? == 0 )); then diff --git a/dietpi/dietpi-survey b/dietpi/dietpi-survey index 0db44e1c89..7340c37029 100644 --- a/dietpi/dietpi-survey +++ b/dietpi/dietpi-survey @@ -77,7 +77,7 @@ _EOF_ if (( $OPTED_IN == 1 )); then #Check if we have a working internet connection beforehand - /DietPi/dietpi/func/check_connection "$FTP_ADDR" + Check_URL "$FTP_ADDR" if (( $? == 0 )); then #Obtain active network adapter. diff --git a/dietpi/func/check_connection b/dietpi/func/check_connection deleted file mode 100644 index b6c52b9d31..0000000000 --- a/dietpi/func/check_connection +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -{ - #//////////////////////////////////// - # DietPi Function: - # - check_connection - # - #//////////////////////////////////// - # Created by Daniel Knight / daniel.knight@dietpi.com / dietpi.com - # - #//////////////////////////////////// - # - # Info: - # - Used to check a url connection is valid with wget spider - # - Timeout and Retry count prevents endless waiting if HTTP request is delayed/broken . - # - Returns exit code 0 if successful - # - # Usage: - # - /DietPi/dietpi/func/check_connection sURL - #//////////////////////////////////// - - #Import DietPi-Globals --------------------------------------------------------------- - . /DietPi/dietpi/func/dietpi-globals - #Import DietPi-Globals --------------------------------------------------------------- - - INTERNET_ADDRESS=$1 - TIMEOUT=10 - RETRYCOUNT=2 - - EXIT_CODE=0 - - #///////////////////////////////////////////////////////////////////////////////////// - # Main Loop - #///////////////////////////////////////////////////////////////////////////////////// - #----------------------------------------------------------------------------------- - dietpi-notify 2 "Testing connection to $INTERNET_ADDRESS" - dietpi-notify 2 "Max duration of $(($TIMEOUT * $RETRYCOUNT)) seconds, please wait..." - - wget -q --spider --timeout="$TIMEOUT" --tries="$RETRYCOUNT" "$INTERNET_ADDRESS" - - #--no-check-certificate - #https://github.com/Fourdee/DietPi/issues/352#issuecomment-221013166 - - EXIT_CODE=$? - dietpi-notify -1 $EXIT_CODE "Connection test |" - - #----------------------------------------------------------------------------------- - #return exit code - exit $EXIT_CODE - #----------------------------------------------------------------------------------- -} \ No newline at end of file diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 10b817fbee..6a25f60f2a 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -241,11 +241,35 @@ #FP_DIETPI_VAR_LIB='/var/lib/dietpi' #FP_DIETPI_VAR_TMP='/var/tmp/dietpi' + #----------------------------------------------------------------------------------- + # URL Connection test + #----------------------------------------------------------------------------------- + # $1 = URL + Check_URL(){ + + local exit_code=0 + local timeout=10 + local retry=2 + + dietpi-notify 2 "Testing connection to $1" + dietpi-notify 2 "Max duration of $(($timeout * $retry)) seconds, please wait..." + + wget -q --spider --timeout=$timeout --tries=$retry "$1" + exit_code=$? + + #--no-check-certificate + #https://github.com/Fourdee/DietPi/issues/352#issuecomment-221013166 + + dietpi-notify -1 $exit_code "Connection test |" + + return $exit_code + + } + #----------------------------------------------------------------------------------- # APT #----------------------------------------------------------------------------------- FP_LOG_APT='/var/tmp/dietpi/logs/dietpi-software_apt.log' - EXITCODE_APT=0 #only way I found of exporting the exit code, once the command is run. #Support for apt-fast: https://github.com/Fourdee/DietPi/issues/698 # APT_BINARY='apt-get' @@ -259,6 +283,7 @@ local string="$@" local force_options='' + local exit_code=0 if (( $DISTRO >= 4 )); then @@ -273,15 +298,20 @@ #-qq can add a slight period of appearing nothing is happening, lets inform user dietpi-notify 2 "APT installation for: $string" dietpi-notify 2 "APT is processing, please wait...\n" + DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $force_options $string 2>&1 | tee "$FP_LOG_APT" - EXITCODE_APT=${PIPESTATUS[0]} - dietpi-notify -1 $EXITCODE_APT 'AGI:' + exit_code=${PIPESTATUS[0]} + + dietpi-notify -1 $exit_code 'AGI:' + + return $exit_code } #apt-get purge AGP(){ + local exit_code=0 local string="$@" local options='' if (( $DISTRO >= 4 )); then @@ -291,55 +321,83 @@ fi dietpi-notify 2 "APT removal for: $string" + DEBIAN_FRONTEND=noninteractive apt-get purge -y $string $options - EXITCODE_APT=${PIPESTATUS[0]} - dietpi-notify -1 $EXITCODE_APT 'AGP:' + exit_code=${PIPESTATUS[0]} + + dietpi-notify -1 $exit_code 'AGP:' + return $exit_code } #apt-get autoremove AGA(){ + local exit_code=0 + dietpi-notify 2 "APT autoremove + purge" + DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y - EXITCODE_APT=${PIPESTATUS[0]} - dietpi-notify -1 $EXITCODE_APT 'AGA:' + exit_code=${PIPESTATUS[0]} + + dietpi-notify -1 $exit_code 'AGA:' + + return $exit_code } #apt-get install -f AGF(){ + local exit_code=0 + dietpi-notify 2 "APT fix" + DEBIAN_FRONTEND=noninteractive apt-get install -f -y 2>&1 | tee "$FP_LOG_APT" - EXITCODE_APT=${PIPESTATUS[0]} - dietpi-notify -1 $EXITCODE_APT 'AGF:' + exit_code=${PIPESTATUS[0]} + + dietpi-notify -1 $exit_code 'AGF:' + + return $exit_code } #apt-get update AGUP(){ + local exit_code=0 + dietpi-notify 2 "APT update" + DEBIAN_FRONTEND=noninteractive apt-get update 2>&1 | tee "$FP_LOG_APT" - EXITCODE_APT=${PIPESTATUS[0]} - dietpi-notify -1 $EXITCODE_APT 'AGUP:' + exit_code=${PIPESTATUS[0]} + + dietpi-notify -1 $exit_code 'AGUP:' + + return $exit_code } #apt-get upgrade AGUG(){ + local exit_code=0 + dietpi-notify 2 "APT upgrade" + DEBIAN_FRONTEND=noninteractive apt-get upgrade -y 2>&1 | tee "$FP_LOG_APT" - EXITCODE_APT=${PIPESTATUS[0]} - dietpi-notify -1 $EXITCODE_APT 'AGUG:' + exit_code=${PIPESTATUS[0]} + + dietpi-notify -1 $exit_code 'AGUG:' + + return $exit_code } #apt-get dist-upgrade AGDUG(){ + local exit_code=0 local string="$@" local force_options='' @@ -354,9 +412,13 @@ fi dietpi-notify 2 "APT dist-upgrade" + DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y 2>&1 | tee "$FP_LOG_APT" - EXITCODE_APT=${PIPESTATUS[0]} - dietpi-notify -1 $EXITCODE_APT 'AGDUG:' + exit_code=${PIPESTATUS[0]} + + dietpi-notify -1 $exit_code 'AGDUG:' + + return $exit_code } diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 6143f21c1d..4c5364baf8 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -189,7 +189,7 @@ systemctl enable dietpi-rm_program_usb_boot_mode.service if (( ! $(dpkg --get-selections | grep -ci -m1 '^lirc') )); then AGI lirc - if (( $EXITCODE_APT != 0 )); then + if (( $? != 0 )); then dietpi-notify 1 "apt-get install lirc" EXIT_CODE=1 @@ -498,7 +498,7 @@ _EOF_ if (( $update_required )); then - /DietPi/dietpi/func/check_connection "$install_url_address" + Check_URL "$install_url_address" # Install if (( $? == 0 )); then @@ -547,7 +547,7 @@ _EOF_ # fi - /DietPi/dietpi/func/check_connection "$install_url_address" + Check_URL "$install_url_address" if (( $? == 0 )); then wget "$install_url_address" -O package.zip @@ -567,7 +567,7 @@ _EOF_ local install_url_address='http://dietpi.com/downloads/binaries/nanopi/dietpi_m3_kernel.7z' - /DietPi/dietpi/func/check_connection "$install_url_address" + Check_URL "$install_url_address" # Install if (( $? == 0 )); then @@ -2057,7 +2057,7 @@ _EOF_ # - Install binaries local install_url_address='http://dietpi.com/downloads/binaries/rpi/I-Sabre-K2M_binaries.zip' - /DietPi/dietpi/func/check_connection "$install_url_address" + Check_URL "$install_url_address" if (( $? == 0 )); then wget "$install_url_address" -O package.zip diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index d4955a2088..fff3d17fca 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -347,7 +347,7 @@ _EOF_ fi INSTALL_URL="https://raw.githubusercontent.com/Fourdee/DietPi/$gitbranch/dietpi.txt" - /DietPi/dietpi/func/check_connection "$INSTALL_URL" + Check_URL "$INSTALL_URL" if (( $? == 0 )); then dietpi-notify 0 "Patching dietpi.txt" From dcead7a6e12897f8ff97ef862ef36964aa8c8e64 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 20 Dec 2017 09:04:50 +0000 Subject: [PATCH 098/390] v160 + use of G_ at start of all global commands/vars to clearly define global status, and, avoid variable interaction: https://github.com/Fourdee/DietPi/issues/1311 + define git_branch to use before run: https://github.com/Fourdee/DietPi/issues/1285#issue-280771944 + Testing dietpi-globals in PREP_SYSTEM: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352756354 --- CHANGELOG.txt | 4 +- PREP_SYSTEM_FOR_DIETPI.sh | 518 +++--- dietpi/boot | 26 +- dietpi/dietpi-autostart | 4 +- dietpi/dietpi-backup | 60 +- dietpi/dietpi-banner | 2 +- dietpi/dietpi-bugreport | 10 +- dietpi/dietpi-cleaner | 6 +- dietpi/dietpi-cloudshell | 12 +- dietpi/dietpi-config | 238 +-- dietpi/dietpi-cpu_set | 28 +- dietpi/dietpi-cpuinfo | 18 +- dietpi/dietpi-cron | 2 +- dietpi/dietpi-drive_manager | 88 +- dietpi/dietpi-launcher | 4 +- dietpi/dietpi-letsencrypt | 26 +- dietpi/dietpi-logclear | 10 +- dietpi/dietpi-morsecode | 2 +- dietpi/dietpi-obtain_hw_model | 448 ++--- dietpi/dietpi-process_tool | 12 +- dietpi/dietpi-services | 24 +- dietpi/dietpi-software | 2212 +++++++++++------------ dietpi/dietpi-survey | 8 +- dietpi/dietpi-sync | 8 +- dietpi/dietpi-update | 56 +- dietpi/func/change_hostname | 4 +- dietpi/func/create_mysql_db | 6 +- dietpi/func/dietpi-globals | 132 +- dietpi/func/dietpi-led_control | 10 +- dietpi/func/dietpi-set_core_environment | 34 +- dietpi/func/dietpi-set_dphys-swapfile | 14 +- dietpi/func/dietpi-set_hardware | 164 +- dietpi/func/dietpi-set_nfsclient | 2 +- dietpi/func/dietpi-set_smbclient | 2 +- dietpi/func/dietpi-set_software | 44 +- dietpi/func/dietpi-set_userdata | 44 +- dietpi/func/run_ntpd | 20 +- dietpi/login | 27 +- dietpi/misc/dietpi-justboom | 10 +- dietpi/misc/start_kodi | 4 +- dietpi/patch_file | 248 +-- 41 files changed, 2269 insertions(+), 2322 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 758d9e8724..524d1e467c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -371,7 +371,7 @@ DietPi-Software | Blynk Server: Updated to latest version (0.24) for new install DietPi-Software | UrBackupSrv: Updated to latest version (2.1.19) for new installations only. Thanks @mtdjr : https://github.com/Fourdee/DietPi/issues/948 Bug fixes: -General | RPi: HW_MODEL_INDEX detection has changed. Now uses revision codes pulled from /proc/cpuinfo. This is mainly to support 4.9 kernel which lacks correct BCM code we previously used: https://github.com/Fourdee/DietPi/issues/936 +General | RPi: G_HW_MODEL_INDEX detection has changed. Now uses revision codes pulled from /proc/cpuinfo. This is mainly to support 4.9 kernel which lacks correct BCM code we previously used: https://github.com/Fourdee/DietPi/issues/936 General | If NTPD has not been run, it will be launched automatically, before waiting for status completion: https://github.com/Fourdee/DietPi/issues/919 General | Resolved an issue with incorrect temp readouts on H3/H2+ and NanoPi M2/M3 boards. Many thanks to @hectorcamp for the report: https://github.com/Fourdee/DietPi/issues/909 General | RPi kernel is now overwritten without cleanup, to prevent failed unzip (0bytes free space) rendering system unbootable: https://github.com/Fourdee/DietPi/issues/905 @@ -400,7 +400,7 @@ DietPi-Config | Display Rotation: New options for RPi HDMI output and Touchscree DietPi-Config | Hostname change: Now prompts for immediate reboot. This is to avoid potential issues with software installations and non-updated hostname on system. Many thanks to @9H5G for the suggestion: https://github.com/Fourdee/DietPi/issues/880 DietPi-Config | Audio > Sound Card: Updated hifiberry-dac to include HiFiBerry MiniAMP, many thanks to ta11 for the info: https://twitter.com/ta11/status/852599202186227712 DietPi-Config | Swapfile: Added ability to select Auto size (1GB - total RAM = size). Auto is now the default. Mainly to prevent out of memory errors on recent influx of 256MB boards. -DietPi-Obtain_Hw_Model | Optimized/reduced count of total HW_ARCH (from 21 to 10). Will improve performance in DietPi-Software due to reduced array size. +DietPi-Obtain_Hw_Model | Optimized/reduced count of total G_HW_ARCH (from 21 to 10). Will improve performance in DietPi-Software due to reduced array size. DietPi-RAMlog | PiHole: PiHole FTL log file is now excluded from 1 hour clear (preserves current day logs): https://github.com/Fourdee/DietPi/issues/868 DietPi-Software | Amiberry SDL2: Now available for installation. SDL2 Amiberry is currently in dev/testing. can be enabled with dietpi-autostart and selecting SDL2 option. Roughly 2x FPS increase over SDL1: https://github.com/Fourdee/DietPi/issues/850 DietPi-Software | VirtualHere: Now available for installation. Allows you to access psychically attached USB devices, over the network: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=6709#p6709 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index ce231d0b52..7459af3102 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -9,211 +9,159 @@ #------------------------------------------------------------------------------------------------ # DO NOT USE. Currently under testing. #------------------------------------------------------------------------------------------------ + + #apt-get update + #apt-get install wget || or make it a pre-req? + #wget + #load + #Pull in dietpi-globals + #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. LANG=en_GB.UTF-8 #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 cd "$HOME" + #------------------------------------------------------------------------------------------------ + # Critical checks with exit, prior to initial run of script + #------------------------------------------------------------------------------------------------ #Exit path for non-root logins. if (( $UID != 0 )); then echo -e 'Error: Root privileges required. Please run the command with "sudo"\n' - exit + exit 1 fi - #------------------------------------------------------------------------------------------------ - #Globals - #------------------------------------------------------------------------------------------------ - #System - DISTRO=0 - DISTRO_NAME='' - DISTRO_TARGET=0 - DISTRO_TARGET_NAME='' - if grep -q 'wheezy' /etc/os-release; then - - DISTRO=2 - DISTRO_NAME='wheezy' - - elif grep -q 'jessie' /etc/os-release; then - - DISTRO=3 - DISTRO_NAME='jessie' - - elif grep -q 'stretch' /etc/os-release; then - - DISTRO=4 - DISTRO_NAME='stretch' + #Check for minimal APT Pre-Reqs + a_MIN_APT_PREREQS=( - elif grep -q 'buster' /etc/os-release; then - - DISTRO=5 - DISTRO_NAME='buster' - - else - - echo -e 'Error: Unknown or unsupported distribution version, aborting...\n' - exit + 'wget' + 'ca-certificates' + 'sudo' - fi + ) - HW_MODEL=0 - HW_ARCH_DESCRIPTION=$(uname -m) - if [ "$HW_ARCH_DESCRIPTION" = "armv6l" ]; then + for (( i=0; i<${#a_MIN_APT_PREREQS[@]}; i++)) + do - HW_ARCH=1 + if (( ! $(dpkg --get-selections | grep -ci -m1 "^${a_MIN_APT_PREREQS[$i]}[[:space:]]") )); then - elif [ "$HW_ARCH_DESCRIPTION" = "armv7l" ]; then + #attempt to install it: + apt-get install -y ${a_MIN_APT_PREREQS[$i]} + if (( $? != 0 )); then - HW_ARCH=2 + echo -e "Error: unable to install ${a_MIN_APT_PREREQS[$i]}, please install it manually with\n - apt-get install ${a_MIN_APT_PREREQS[$i]} -y" + exit 1 - elif [ "$HW_ARCH_DESCRIPTION" = "aarch64" ]; then + fi - HW_ARCH=3 + fi - elif [ "$HW_ARCH_DESCRIPTION" = "x86_64" ]; then + done - HW_ARCH=10 + unset a_MIN_APT_PREREQS - else + #Download DietPi-Globals + # - NB: we'll have to manually handle errors, until script is sucessfully loaded + wget https://raw.githubusercontent.com/Fourdee/DietPi/$GIT_BRANCH/dietpi/func/dietpi-globals -O dietpi-globals + if (( $? != 0 )); then - dietpi-notify 1 "Error: Unknown or unsupported CPU architecture $HW_ARCH_DESCRIPTION, aborting..." - exit + echo -e 'Error: Unable to download dietpi-globals. Aborting...\n' + exit 1 fi - #Funcs - INTERNET_ADDRESS='' - Check_Connection(){ + # - load + chmod +x dietpi-globals + . /dietpi-globals + if (( $? != 0 )); then - wget -q --spider --timeout=10 --tries=2 "$INTERNET_ADDRESS" - - } + echo -e 'Error: Unable to load dietpi-globals. Aborting...\n' + exit 1 - #DietPi-Notify: - dietpi-notify(){ - - local ainput_string=("$@") - - local status_text_ok="\e[32mOk\e[0m" - local status_text_failed="\e[31mFailed:\e[0m" - - local bracket_string_l="\e[90m[\e[0m" - local bracket_string_r="\e[90m]\e[0m" + fi - #Funcs + #DEBUG + echo $G_HW_MODEL - Print_Ok(){ + exit - echo -ne " $bracket_string_l\e[32mOk\e[0m$bracket_string_r" + #------------------------------------------------------------------------------------------------ + #Globals + #------------------------------------------------------------------------------------------------ + #System + DISTRO_TARGET=0 + DISTRO_TARGET_NAME='' + if grep -q 'wheezy' /etc/os-release; then - } + G_DISTRO=2 + G_DISTRO_NAME='wheezy' - Print_Failed(){ + elif grep -q 'jessie' /etc/os-release; then - echo -ne " $bracket_string_l\e[31mFailed\e[0m$bracket_string_r" + G_DISTRO=3 + G_DISTRO_NAME='jessie' - } + elif grep -q 'stretch' /etc/os-release; then - # - Print all input string on same line - # - $1 = start printing from word number $1 - Print_Input_String(){ + G_DISTRO=4 + G_DISTRO_NAME='stretch' - for (( i=$1;i<${#ainput_string[@]} ;i++)) - do - echo -ne " ${ainput_string[${i}]}" - done + elif grep -q 'buster' /etc/os-release; then - echo -e "" + G_DISTRO=5 + G_DISTRO_NAME='buster' - } + else - # Main Loop - #-------------------------------------------------------------------------------------- - echo -e "" + echo -e 'Error: Unknown or unsupported distribution version, aborting...\n' + exit - if (( $1 == -1 )); then + fi - if [ "$2" = "0" ]; then + G_HW_MODEL=0 + G_HW_ARCH_DESCRIPTION=$(uname -m) + if [ "$G_HW_ARCH_DESCRIPTION" = "armv6l" ]; then - ainput_string+=("Completed") - Print_Ok - Print_Input_String 2 - echo -e "" + G_HW_ARCH=1 - else + elif [ "$G_HW_ARCH_DESCRIPTION" = "armv7l" ]; then - ainput_string+=("An issue has occured") - Print_Failed - Print_Input_String 2 - echo -e "" + G_HW_ARCH=2 - fi + elif [ "$G_HW_ARCH_DESCRIPTION" = "aarch64" ]; then - #-------------------------------------------------------------------------------------- - #Status Ok - #$@ = txt desc - elif (( $1 == 0 )); then + G_HW_ARCH=3 - Print_Ok - Print_Input_String 1 + elif [ "$G_HW_ARCH_DESCRIPTION" = "x86_64" ]; then - #Status failed - #$@ = txt desc - elif (( $1 == 1 )); then + G_HW_ARCH=10 - Print_Failed - Print_Input_String 1 - - #Status Info - #$@ = txt desc - elif (( $1 == 2 )); then + else - echo -ne " $bracket_string_l\e[0mInfo\e[0m$bracket_string_r" - echo -ne "\e[90m" - Print_Input_String 1 - echo -ne "\e[0m" + G_DIETPI-NOTIFY 1 "Error: Unknown or unsupported CPU architecture $G_HW_ARCH_DESCRIPTION, aborting..." + exit - fi + fi - echo -e "" - #----------------------------------------------------------------------------------- - unset ainput_string - #----------------------------------------------------------------------------------- - } + #Funcs + INTERNET_ADDRESS='' Error_Check(){ #Grab exit code in case of failure - exit_code=$? + local exit_code=$? if (( $exit_code != 0 )); then - dietpi-notify 1 "($exit_code): Script aborted" + G_DIETPI-NOTIFY 1 "($exit_code): Script aborted" exit $exit_code else - dietpi-notify 2 "($exit_code): Passed" - fi - - } - - #Apt-get - AGI(){ - - local string="$@" - - local apt_force_options='--force-yes' - - if (( $DISTRO >= 4 )); then - - apt_force_options='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' - + G_DIETPI-NOTIFY 2 "($exit_code): Passed" fi - DEBIAN_FRONTEND=noninteractive $(which apt) install -y $apt_force_options $string - } #Whiptail @@ -235,7 +183,7 @@ else - dietpi-notify 1 'No choices detected, aborting' + G_DIETPI-NOTIFY 1 'No choices detected, aborting' exit 0 fi @@ -254,13 +202,13 @@ #------------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------------ - dietpi-notify 2 '-----------------------------------------------------------------------------------' - dietpi-notify 0 'Step 0: Detecting existing DietPi system:' - dietpi-notify 2 '-----------------------------------------------------------------------------------' + G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' + G_DIETPI-NOTIFY 0 'Step 0: Detecting existing DietPi system:' + G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ if [ -f /DietPi/dietpi/.installed ]; then - dietpi-notify 2 'DietPi system found, running pre-prep' + G_DIETPI-NOTIFY 2 'DietPi system found, running pre-prep' # - Stop services /DietPi/dietpi/dietpi-services stop @@ -287,17 +235,17 @@ else - dietpi-notify 2 'Non-DietPi system' + G_DIETPI-NOTIFY 2 'Non-DietPi system' fi #------------------------------------------------------------------------------------------------ - dietpi-notify 2 '-----------------------------------------------------------------------------------' - dietpi-notify 0 'Step 1: Initial prep to allow this script to function:' - dietpi-notify 2 '-----------------------------------------------------------------------------------' + G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' + G_DIETPI-NOTIFY 0 'Step 1: Initial prep to allow this script to function:' + G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ - dietpi-notify 2 'Updating APT:' + G_DIETPI-NOTIFY 2 'Updating APT:' apt-get clean Error_Check @@ -305,15 +253,15 @@ apt-get update Error_Check - dietpi-notify 2 'Installing core packages, required for this script to function:' + G_DIETPI-NOTIFY 2 'Installing core packages, required for next stage of this script:' - AGI apt-transport-https wget unzip whiptail + G_AGI apt-transport-https wget unzip whiptail Error_Check #------------------------------------------------------------------------------------------------ - dietpi-notify 2 '-----------------------------------------------------------------------------------' - dietpi-notify 0 'Step 2: Hardware selection:' - dietpi-notify 2 '-----------------------------------------------------------------------------------' + G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' + G_DIETPI-NOTIFY 0 'Step 2: Hardware selection:' + G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ WHIP_TITLE='Hardware selection:' @@ -363,27 +311,27 @@ ) Run_Whiptail - HW_MODEL=$WHIP_RETURN_VALUE + G_HW_MODEL=$WHIP_RETURN_VALUE - dietpi-notify 2 "Setting HW_MODEL index of: $HW_MODEL" - dietpi-notify 2 "CPU ARCH = $HW_ARCH : $HW_ARCH_DESCRIPTION" + G_DIETPI-NOTIFY 2 "Setting G_HW_MODEL index of: $G_HW_MODEL" + G_DIETPI-NOTIFY 2 "CPU ARCH = $G_HW_ARCH : $G_HW_ARCH_DESCRIPTION" - echo -e "$HW_MODEL" > /etc/.dietpi_hw_model_identifier + echo -e "$G_HW_MODEL" > /etc/.dietpi_hw_model_identifier #------------------------------------------------------------------------------------------------ - dietpi-notify 2 '-----------------------------------------------------------------------------------' - dietpi-notify 0 'Step 3: Distro selection / APT prep:' - dietpi-notify 2 '-----------------------------------------------------------------------------------' + G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' + G_DIETPI-NOTIFY 0 'Step 3: Distro selection / APT prep:' + G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ WHIP_TITLE='Distro Selection:' WHIP_DESC='Please select a distro to install on this system. Selecting a distro that is older than the current installed on system, is not supported.' - WHIP_DEFAULT_ITEM=$DISTRO + WHIP_DEFAULT_ITEM=$G_DISTRO WHIP_MENU_ARRAY=( '3' 'Jessie (oldstable, just if you need to avoid upgrade to current release)' '4' 'Stretch (current stable release, recommended)' ) - if (( $HW_MODEL >= 10 )); then + if (( $G_HW_MODEL >= 10 )); then WHIP_MENU_ARRAY+=('5' 'Buster (testing only, not officially suppoted)') @@ -405,16 +353,16 @@ fi - dietpi-notify 2 'Removing conflicting apt sources.list.d' + G_DIETPI-NOTIFY 2 'Removing conflicting apt sources.list.d' # NB: Apt sources will get overwritten during 1st run, via boot script andn dietpi.txt entry #rm /etc/apt/sources.list.d/* &> /dev/null #Probably a bad idea rm /etc/apt/sources.list.d/deb-multimedia.list &> /dev/null #meveric - dietpi-notify 2 "Setting APT sources.list: $DISTRO_TARGET_NAME $DISTRO_TARGET" + G_DIETPI-NOTIFY 2 "Setting APT sources.list: $DISTRO_TARGET_NAME $DISTRO_TARGET" # - Set raspbian - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then cat << _EOF_ > /etc/apt/sources.list deb https://www.mirrorservice.org/sites/archive.raspbian.org/raspbian $DISTRO_TARGET_NAME main contrib non-free rpi @@ -448,7 +396,7 @@ _EOF_ fi - dietpi-notify 2 "Updating APT for $DISTRO_TARGET_NAME:" + G_DIETPI-NOTIFY 2 "Updating APT for $DISTRO_TARGET_NAME:" apt-get clean Error_Check @@ -457,17 +405,17 @@ _EOF_ Error_Check # - Distro is now target - DISTRO=$DISTRO_TARGET - DISTRO_NAME=$DISTRO_TARGET_NAME + G_DISTRO=$DISTRO_TARGET + G_DISTRO_NAME=$DISTRO_TARGET_NAME # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files - dietpi-notify 2 "Marking all packages as auto installed first, to allow allow effective autoremove afterwards" + G_DIETPI-NOTIFY 2 "Marking all packages as auto installed first, to allow allow effective autoremove afterwards" apt-mark auto $(apt-mark showmanual) Error_Check # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files - dietpi-notify 2 "Temporary disable automatic recommends/suggests installation and allow them to be autoremoved:" + G_DIETPI-NOTIFY 2 "Temporary disable automatic recommends/suggests installation and allow them to be autoremoved:" cat << _EOF_ > /etc/apt/apt.conf.d/99dietpi_norecommends APT::Install-Recommends "false"; @@ -477,7 +425,7 @@ APT::AutoRemove::SuggestsImportant "false"; _EOF_ Error_Check - dietpi-notify 2 "Forcing use of existing apt configs if available" + G_DIETPI-NOTIFY 2 "Forcing use of existing apt configs if available" cat << _EOF_ > /etc/apt/apt.conf.d/99dietpi_forceconf Dpkg::options { @@ -489,9 +437,9 @@ _EOF_ #------------------------------------------------------------------------------------------------ - dietpi-notify 2 '-----------------------------------------------------------------------------------' - dietpi-notify 0 'Step 4: APT removals:' - dietpi-notify 2 '-----------------------------------------------------------------------------------' + G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' + G_DIETPI-NOTIFY 0 'Step 4: APT removals:' + G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ # - DietPi list of minimal required packages which must be installed: @@ -551,9 +499,9 @@ _EOF_ ) - # - HW_ARCH specific required packages + # - G_HW_ARCH specific required packages # x86_64 - if (( $HW_ARCH == 10 )); then + if (( $G_HW_ARCH == 10 )); then aPACKAGES_REQUIRED_INSTALL+=('linux-image-amd64') aPACKAGES_REQUIRED_INSTALL+=('intel-microcode') @@ -577,9 +525,9 @@ _EOF_ fi - # - HW_MODEL specific required packages + # - G_HW_MODEL specific required packages # RPi - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then aPACKAGES_REQUIRED_INSTALL+=('libraspberrypi-bin') aPACKAGES_REQUIRED_INSTALL+=('libraspberrypi0') @@ -589,34 +537,34 @@ _EOF_ aPACKAGES_REQUIRED_INSTALL+=('raspi-copies-and-fills') # Odroid C2 - elif (( $HW_MODEL == 12 )); then + elif (( $G_HW_MODEL == 12 )); then aPACKAGES_REQUIRED_INSTALL+=('linux-image-arm64-odroid-c2') # Odroid XU3/4 - elif (( $HW_MODEL == 11 )); then + elif (( $G_HW_MODEL == 11 )); then #aPACKAGES_REQUIRED_INSTALL+=('linux-image-4.9-armhf-odroid-xu3') aPACKAGES_REQUIRED_INSTALL+=('linux-image-armhf-odroid-xu3') # Odroid C1 - elif (( $HW_MODEL == 10 )); then + elif (( $G_HW_MODEL == 10 )); then aPACKAGES_REQUIRED_INSTALL+=('linux-image-armhf-odroid-c1') # Rock64 - elif (( $HW_MODEL == 43 )); then + elif (( $G_HW_MODEL == 43 )); then aPACKAGES_REQUIRED_INSTALL+=('linux-rock64-package') # BBB - elif (( $HW_MODEL == 71 )); then + elif (( $G_HW_MODEL == 71 )); then aPACKAGES_REQUIRED_INSTALL+=('device-tree-compiler') #Kern fi - dietpi-notify 2 "Generating list of minimal packages, required for DietPi installation:" + G_DIETPI-NOTIFY 2 "Generating list of minimal packages, required for DietPi installation:" INSTALL_PACKAGES='' for ((i=0; i<${#aPACKAGES_REQUIRED_INSTALL[@]}; i++)) @@ -630,24 +578,24 @@ _EOF_ # - delete[] unset aPACKAGES_REQUIRED_INSTALL - dietpi-notify 2 "Marking required packages as manually installed:" + G_DIETPI-NOTIFY 2 "Marking required packages as manually installed:" apt-mark manual $INSTALL_PACKAGES Error_Check - dietpi-notify 2 "Purging APT with autoremoval:" + G_DIETPI-NOTIFY 2 "Purging APT with autoremoval:" apt-get autoremove --purge -y Error_Check #------------------------------------------------------------------------------------------------ - dietpi-notify 2 '-----------------------------------------------------------------------------------' - dietpi-notify 0 'Step 5: APT Installations:' - dietpi-notify 2 '-----------------------------------------------------------------------------------' + G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' + G_DIETPI-NOTIFY 0 'Step 5: APT Installations:' + G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ - dietpi-notify 2 "Upgrading existing APT installed packages:" + G_DIETPI-NOTIFY 2 "Upgrading existing APT installed packages:" DEBIAN_FRONTEND='noninteractive' apt-get dist-upgrade -y Error_Check @@ -658,19 +606,19 @@ _EOF_ # systemctl restart ssh #??? - dietpi-notify 2 "Disabling swapfile generation for dphys-swapfile during install" + G_DIETPI-NOTIFY 2 "Disabling swapfile generation for dphys-swapfile during install" echo -e "CONF_SWAPSIZE=0" > /etc/dphys-swapfile Error_Check - dietpi-notify 2 "Installing core DietPi pre-req APT packages" - dietpi-notify 2 "The following packages will be installed\n$INSTALL_PACKAGES" + G_DIETPI-NOTIFY 2 "Installing core DietPi pre-req APT packages" + G_DIETPI-NOTIFY 2 "The following packages will be installed\n$INSTALL_PACKAGES" - AGI $INSTALL_PACKAGES + G_AGI $INSTALL_PACKAGES Error_Check - dietpi-notify 2 "Onboard Bluetooth selection" + G_DIETPI-NOTIFY 2 "Onboard Bluetooth selection" WHIP_TITLE='Bluetooth Required?' WHIP_DESC='Please select an option' @@ -685,16 +633,16 @@ _EOF_ Run_Whiptail if (( $WHIP_RETURN_VALUE == 1 )); then - dietpi-notify 2 "Installing Bluetooth packages" + G_DIETPI-NOTIFY 2 "Installing Bluetooth packages" - AGI bluetooth bluez-firmware + G_AGI bluetooth bluez-firmware Error_Check - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then - dietpi-notify 2 "Installing Bluetooth packages specific to RPi" + G_DIETPI-NOTIFY 2 "Installing Bluetooth packages specific to RPi" - AGI pi-bluetooth + G_AGI pi-bluetooth Error_Check fi @@ -702,32 +650,32 @@ _EOF_ fi # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files - dietpi-notify 2 "Returning installation of recommends back to default" + G_DIETPI-NOTIFY 2 "Returning installation of recommends back to default" rm /etc/apt/apt-conf.d/99dietpi_norecommends &> /dev/null #------------------------------------------------------------------------------------------------ - dietpi-notify 2 '-----------------------------------------------------------------------------------' - dietpi-notify 0 'Step 6: Downloading and installing DietPi sourcecode' - dietpi-notify 2 '-----------------------------------------------------------------------------------' + G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' + G_DIETPI-NOTIFY 0 'Step 6: Downloading and installing DietPi sourcecode' + G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ - INTERNET_ADDRESS='https://github.com/Fourdee/DietPi/archive/testing.zip' #NB: testing until this is stable in master - dietpi-notify 2 "Checking connection to $INTERNET_ADDRESS" - Check_Connection "$INTERNET_ADDRESS" + INTERNET_ADDRESS="https://github.com/Fourdee/DietPi/archive/$GIT_BRANCH.zip" #NB: testing until this is stable in master + G_DIETPI-NOTIFY 2 "Checking connection to $INTERNET_ADDRESS" + G_CHECK_URL "$INTERNET_ADDRESS" Error_Check wget "$INTERNET_ADDRESS" -O package.zip Error_Check - dietpi-notify 2 "Extracting DietPi sourcecode" + G_DIETPI-NOTIFY 2 "Extracting DietPi sourcecode" unzip package.zip Error_Check rm package.zip - dietpi-notify 2 "Removing files not required" + G_DIETPI-NOTIFY 2 "Removing files not required" # Remove files we do not require, or want to overwrite in /boot rm DietPi-*/CHANGELOG.txt @@ -735,25 +683,25 @@ _EOF_ rm DietPi-*/TESTING-BRANCH.md rm DietPi-*/uEnv.txt # Pine 64, use existing on system. - dietpi-notify 2 "Creating /boot" + G_DIETPI-NOTIFY 2 "Creating /boot" mkdir -p /boot Error_Check - dietpi-notify 2 "Moving to /boot" + G_DIETPI-NOTIFY 2 "Moving to /boot" # - HW specific boot.ini uenv.txt - if (( $HW_MODEL == 10 )); then + if (( $G_HW_MODEL == 10 )); then mv DietPi-*/boot_c1.ini /boot/boot.ini Error_Check - elif (( $HW_MODEL == 11 )); then + elif (( $G_HW_MODEL == 11 )); then mv DietPi-*/boot_xu4.ini /boot/boot.ini Error_Check - elif (( $HW_MODEL == 12 )); then + elif (( $G_HW_MODEL == 12 )); then mv DietPi-*/boot_c2.ini /boot/boot.ini Error_Check @@ -764,23 +712,23 @@ _EOF_ cp -R DietPi-*/* /boot/ Error_Check - dietpi-notify 2 "Cleaning up extracted files" + G_DIETPI-NOTIFY 2 "Cleaning up extracted files" rm -R DietPi-* Error_Check - dietpi-notify 2 "Setting execute permissions for /boot/dietpi" + G_DIETPI-NOTIFY 2 "Setting execute permissions for /boot/dietpi" chmod -R +x /boot/dietpi Error_Check #------------------------------------------------------------------------------------------------ - dietpi-notify 2 '-----------------------------------------------------------------------------------' - dietpi-notify 0 "Step 7: Prep system for DietPi ENV:" - dietpi-notify 2 '-----------------------------------------------------------------------------------' + G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' + G_DIETPI-NOTIFY 0 "Step 7: Prep system for DietPi ENV:" + G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ - dietpi-notify 2 "Deleting list of known users, not required by DietPi" + G_DIETPI-NOTIFY 2 "Deleting list of known users, not required by DietPi" userdel -f pi &> /dev/null userdel -f test &> /dev/null #armbian @@ -790,7 +738,7 @@ _EOF_ userdel -f dietpi &> /dev/null userdel -f debian &> /dev/null #BBB - dietpi-notify 2 "Removing misc files/folders/services, not required by DietPi" + G_DIETPI-NOTIFY 2 "Removing misc files/folders/services, not required by DietPi" rm -R /home &> /dev/null rm -R /media &> /dev/null @@ -843,7 +791,7 @@ _EOF_ # - ARMbian-config rm /etc/profile.d/check_first_login_reboot.sh &> /dev/null - dietpi-notify 2 "Creating DietPi core environment" + G_DIETPI-NOTIFY 2 "Creating DietPi core environment" /boot/dietpi/func/dietpi-set_core_environment Error_Check @@ -852,18 +800,18 @@ _EOF_ echo -e "FTP client mount can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking option: NAS/Misc menu" > /mnt/ftp_client/readme.txt echo -e "NFS client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking option: NAS/Misc menu" > /mnt/nfs_client/readme.txt - dietpi-notify 2 "Deleting all log files /var/log" + G_DIETPI-NOTIFY 2 "Deleting all log files /var/log" /boot/dietpi/dietpi-logclear 2 &> /dev/null # As this will report missing vars, however, its fine, does not break functionality. - dietpi-notify 2 "Generating DietPi /etc/fstab" + G_DIETPI-NOTIFY 2 "Generating DietPi /etc/fstab" /boot/dietpi/dietpi-drive_manager 4 Error_Check # - HW Specific: # RPi requires PARTUUID for USB write: https://github.com/Fourdee/DietPi/issues/970 - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then PARTUUID_CURRENT=$(blkid /dev/mmcblk0p1 -s PARTUUID -o value) UUID_CURRENT=$(blkid /dev/mmcblk0p1 -s UUID -o value) @@ -877,21 +825,21 @@ _EOF_ fi - dietpi-notify 2 "Starting DietPi-RAMdisk service" + G_DIETPI-NOTIFY 2 "Starting DietPi-RAMdisk service" systemctl start dietpi-ramdisk.service Error_Check - dietpi-notify 2 "Starting DietPi-RAMlog service" + G_DIETPI-NOTIFY 2 "Starting DietPi-RAMlog service" systemctl start dietpi-ramlog.service Error_Check - dietpi-notify 2 'Updating DietPi HW_INFO' + G_DIETPI-NOTIFY 2 'Updating DietPi HW_INFO' /DietPi/dietpi/dietpi-obtain_hw_model - dietpi-notify 2 "Configuring Network:" + G_DIETPI-NOTIFY 2 "Configuring Network:" rm -R /etc/network/interfaces &> /dev/null # armbian symlink for bulky network-manager cp /boot/dietpi/conf/network_interfaces /etc/network/interfaces @@ -905,13 +853,13 @@ _EOF_ rm /etc/udev/rules.d/70-persistant-net.rules &> /dev/null # - Add pre-up lines for wifi on OrangePi Zero - if (( $HW_MODEL == 32 )); then + if (( $G_HW_MODEL == 32 )); then sed -i '/iface wlan0 inet dhcp/apre-up modprobe xradio_wlan\npre-up iwconfig wlan0 power on' /etc/network/interfaces fi - dietpi-notify 2 "Tweaking DHCP timeout:" + G_DIETPI-NOTIFY 2 "Tweaking DHCP timeout:" # - Reduce DHCP request retry count and timeouts: https://github.com/Fourdee/DietPi/issues/711 sed -i '/^#timeout /d' /etc/dhcp/dhclient.conf @@ -923,7 +871,7 @@ timeout 10; retry 4; _EOF_ - dietpi-notify 2 "Configuring Hosts:" + G_DIETPI-NOTIFY 2 "Configuring Hosts:" cat << _EOF_ > /etc/hosts 127.0.0.1 localhost @@ -939,12 +887,12 @@ DietPi _EOF_ Error_Check - dietpi-notify 2 "Configuring htop:" + G_DIETPI-NOTIFY 2 "Configuring htop:" mkdir -p /root/.config/htop cp /DietPi/dietpi/conf/htoprc /root/.config/htop/htoprc - dietpi-notify 2 "Configuring hdparm:" + G_DIETPI-NOTIFY 2 "Configuring hdparm:" cat << _EOF_ >> /etc/hdparm.conf @@ -959,22 +907,22 @@ _EOF_ _EOF_ Error_Check - dietpi-notify 2 "Configuring fakehwclock:" + G_DIETPI-NOTIFY 2 "Configuring fakehwclock:" # - allow times in the past sed -i "/FORCE=/c\FORCE=force" /etc/default/fake-hwclock - dietpi-notify 2 "Configuring serial consoles:" + G_DIETPI-NOTIFY 2 "Configuring serial consoles:" # - Disable serial console /DietPi/dietpi/func/dietpi-set_hardware serialconsole disable - dietpi-notify 2 "Configuring ntpd:" + G_DIETPI-NOTIFY 2 "Configuring ntpd:" systemctl disable systemd-timesyncd rm /etc/init.d/ntp &> /dev/null - dietpi-notify 2 "Configuring regional settings (TZ/Locale/Keyboard):" + G_DIETPI-NOTIFY 2 "Configuring regional settings (TZ/Locale/Keyboard):" #TODO: automate these... dpkg-reconfigure tzdata #Europe > London @@ -989,10 +937,10 @@ LANG=en_GB.UTF-8 _EOF_ Error_Check - #HW_ARCH specific - dietpi-notify 2 "Applying HW_ARCH specific tweaks:" + #G_HW_ARCH specific + G_DIETPI-NOTIFY 2 "Applying G_HW_ARCH specific tweaks:" - if (( $HW_ARCH == 10 )); then + if (( $G_HW_ARCH == 10 )); then # - i386 APT support dpkg --add-architecture i386 @@ -1011,16 +959,16 @@ _EOF_ fi - #HW_MODEL specific - dietpi-notify 2 "Appling HW_MODEL specific tweaks:" + #G_HW_MODEL specific + G_DIETPI-NOTIFY 2 "Appling G_HW_MODEL specific tweaks:" # - ARMbian OPi Zero 2: https://github.com/Fourdee/DietPi/issues/876#issuecomment-294350580 - if (( $HW_MODEL == 35 )); then + if (( $G_HW_MODEL == 35 )); then echo -e "blacklist bmp085" > /etc/modprobe.d/bmp085.conf # - Sparky SBC ONLY: Blacklist GPU and touch screen modules: https://github.com/Fourdee/DietPi/issues/699#issuecomment-271362441 - elif (( $HW_MODEL == 70 )); then + elif (( $G_HW_MODEL == 70 )); then cat << _EOF_ > /etc/modprobe.d/disable_sparkysbc_touchscreen.conf blacklist owl_camera @@ -1039,14 +987,14 @@ blacklist bc_example _EOF_ # - RPI: Scroll lock fix for RPi by Midwan: https://github.com/Fourdee/DietPi/issues/474#issuecomment-243215674 - elif (( $HW_MODEL < 10 )); then + elif (( $G_HW_MODEL < 10 )); then cat << _EOF_ > /etc/udev/rules.d/50-leds.rules ACTION=="add", SUBSYSTEM=="leds", ENV{DEVPATH}=="*/input*::scrolllock", ATTR{trigger}="kbd-scrollock" _EOF_ # - PINE64 (and possibily others): Cursor fix for FB - elif (( $HW_MODEL >= 40 && $HW_MODEL <= 42 )); then + elif (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then cat << _EOF_ >> "$HOME"/.bashrc infocmp > terminfo.txt @@ -1056,7 +1004,7 @@ tput cnorm _EOF_ # - XU4 FFMPEG fix. Prefer debian.org over Meveric for backports: https://github.com/Fourdee/DietPi/issues/1273 - elif (( $HW_MODEL == 11 )); then + elif (( $G_HW_MODEL == 11 )); then cat << _EOF_ > /etc/apt/preferences.d/backports Package: * @@ -1072,30 +1020,30 @@ _EOF_ #------------------------------------------------------------------------------------------------ - dietpi-notify 2 '-----------------------------------------------------------------------------------' - dietpi-notify 0 "Step 8: Finalise system for first run of DietPi:" - dietpi-notify 2 '-----------------------------------------------------------------------------------' + G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' + G_DIETPI-NOTIFY 0 "Step 8: Finalise system for first run of DietPi:" + G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ - dietpi-notify 2 'Installing Dropbear by default' + G_DIETPI-NOTIFY 2 'Installing Dropbear by default' - AGI dropbear + G_AGI dropbear # set to start on next boot sed -i '/NO_START=1/c\NO_START=0' /etc/default/dropbear - dietpi-notify 2 'Configuring Services' + G_DIETPI-NOTIFY 2 'Configuring Services' /DietPi/dietpi/dietpi-services stop /DietPi/dietpi/dietpi-services dietpi_controlled - dietpi-notify 2 'Clearing APT cache' + G_DIETPI-NOTIFY 2 'Clearing APT cache' apt-get clean rm -R /var/lib/apt/lists/* -vf #lists cache: remove partial folder also, automatically gets regenerated on apt-get update #rm /var/lib/dpkg/info/* #issue... #dpkg: warning: files list file for package 'libdbus-1-3:armhf' missing; assuming package has no files currently installed - dietpi-notify 2 'Running general cleanup of misc files' + G_DIETPI-NOTIFY 2 'Running general cleanup of misc files' # - general folders rm -R /tmp/* &> /dev/null @@ -1106,7 +1054,7 @@ _EOF_ # - Nano histroy file rm ~/.nano_history &> /dev/null - dietpi-notify 2 'Disabling swapfile' + G_DIETPI-NOTIFY 2 'Disabling swapfile' /DietPi/dietpi/func/dietpi-set_dphys-swapfile 0 /var/swap # - Reset config @@ -1114,16 +1062,16 @@ _EOF_ echo -e "CONF_SWAPFILE=/var/swap" >> /etc/dphys-swapfile # BBB disable swapfile gen - if (( $HW_MODEL == 71 )); then + if (( $G_HW_MODEL == 71 )); then sed -i '/Swapfile_Size=/c\Swapfile_Size=0' /DietPi/dietpi.txt fi - dietpi-notify 2 'Resetting boot.ini, config.txt, cmdline.txt etc' + G_DIETPI-NOTIFY 2 'Resetting boot.ini, config.txt, cmdline.txt etc' # - PineA64 - delete ethaddr from uEnv.txt file - if (( $HW_MODEL >= 40 && $HW_MODEL <= 42 )); then + if (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then sed -i '/^ethaddr/ d' /boot/uEnv.txt @@ -1132,90 +1080,90 @@ _EOF_ # - Set Pi cmdline.txt back to normal [ -f /boot/cmdline.txt ] && sed -i "s/ rootdelay=10//g" /boot/cmdline.txt - dietpi-notify 2 'Generating default wpa_supplicant.conf' + G_DIETPI-NOTIFY 2 'Generating default wpa_supplicant.conf' /DietPi/dietpi/func/dietpi-set_hardware wificreds set - dietpi-notify 2 'Disabling generic WiFi/BT by default' + G_DIETPI-NOTIFY 2 'Disabling generic WiFi/BT by default' /DietPi/dietpi/func/dietpi-set_hardware bluetooth disable /DietPi/dietpi/func/dietpi-set_hardware wifimodules disable - dietpi-notify 2 'Enabling onboard WiFi modules by default' + G_DIETPI-NOTIFY 2 'Enabling onboard WiFi modules by default' /DietPi/dietpi/func/dietpi-set_hardware wifimodules onboard_enable - dietpi-notify 2 'Configuring IP version preferences' + G_DIETPI-NOTIFY 2 'Configuring IP version preferences' /DietPi/dietpi/func/dietpi-set_hardware preferipversion auto - dietpi-notify 2 'Configuring kernels' + G_DIETPI-NOTIFY 2 'Configuring kernels' # - Disable installed flags rm /etc/dietpi/.* # - RPi install DietPi kernel by default - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then rm -R /lib/modules/* # Remove all modules from all kernels, ensures our kernel is installed. /DietPi/dietpi/func/dietpi-set_hardware kernel dietpi_rpi_forced #forced, incase of kernel version match which would prevent install fi - dietpi-notify 2 'Disabling soundcards by default' + G_DIETPI-NOTIFY 2 'Disabling soundcards by default' /DietPi/dietpi/func/dietpi-set_hardware soundcard none - dietpi-notify 2 'Setting default CPU gov' + G_DIETPI-NOTIFY 2 'Setting default CPU gov' /DietPi/dietpi/dietpi-cpu_set - dietpi-notify 2 'Clearing log files' + G_DIETPI-NOTIFY 2 'Clearing log files' /DietPi/dietpi/dietpi-logclear 2 - dietpi-notify 2 'Deleting DietPi-RAMlog storage' + G_DIETPI-NOTIFY 2 'Deleting DietPi-RAMlog storage' rm -R /etc/dietpi/dietpi-ramlog/storage &> /dev/null - dietpi-notify 2 'Deleting NTP drift file' + G_DIETPI-NOTIFY 2 'Deleting NTP drift file' rm /var/lib/ntp/ntp.drift &> /dev/null - dietpi-notify 2 'Resetting DietPi generated globals/files' + G_DIETPI-NOTIFY 2 'Resetting DietPi generated globals/files' rm /DietPi/dietpi/.* - dietpi-notify 2 'Storing current image version /etc/.dietpi_image_version' + G_DIETPI-NOTIFY 2 'Storing current image version /etc/.dietpi_image_version' echo -e "$IMAGE_VERSION" > /etc/.dietpi_image_version - dietpi-notify 2 'Setting DietPi-Autostart to console' + G_DIETPI-NOTIFY 2 'Setting DietPi-Autostart to console' echo 0 > /DietPi/dietpi/.dietpi-autostart_index - dietpi-notify 2 'Creating our update file (used on 1st run to check for DietPi updates)' + G_DIETPI-NOTIFY 2 'Creating our update file (used on 1st run to check for DietPi updates)' echo -1 > /DietPi/dietpi/.update_stage - dietpi-notify 2 'Set Init .install_stage to -1 (first boot)' + G_DIETPI-NOTIFY 2 'Set Init .install_stage to -1 (first boot)' echo -1 > /DietPi/dietpi/.install_stage - dietpi-notify 2 'Remove server_version / patch_file (downloads fresh from dietpi-update)' + G_DIETPI-NOTIFY 2 'Remove server_version / patch_file (downloads fresh from dietpi-update)' rm /DietPi/dietpi/patch_file &> /dev/null rm /DietPi/dietpi/server_version &> /dev/null # - HW Specific - # RPi remove saved HW_MODEL , allowing obtain-hw_model to auto detect RPi model - if (( $HW_MODEL < 10 )); then + # RPi remove saved G_HW_MODEL , allowing obtain-hw_model to auto detect RPi model + if (( $G_HW_MODEL < 10 )); then rm /etc/.dietpi_hw_model_identifier fi - dietpi-notify 2 'Generating dietpi-fs_partition_resize for first boot' + G_DIETPI-NOTIFY 2 'Generating dietpi-fs_partition_resize for first boot' #??? BBB skip this??? cat << _EOF_ > /etc/systemd/system/dietpi-fs_partition_resize.service @@ -1280,7 +1228,7 @@ _EOF_ chmod +x /etc/dietpi/fs_partition_resize.sh Error_Check - dietpi-notify 2 'Generating dietpi-fs_partition_expand for subsequent boot' + G_DIETPI-NOTIFY 2 'Generating dietpi-fs_partition_expand for subsequent boot' cat << _EOF_ > /etc/systemd/system/dietpi-fs_expand.service [Unit] @@ -1306,7 +1254,7 @@ _EOF_ # cat /var/tmp/dietpi/logs/fs_partition_resize.log - dietpi-notify 2 'Sync changes to disk and TRIM rootFS' + G_DIETPI-NOTIFY 2 'Sync changes to disk and TRIM rootFS' systemctl stop dietpi-ramlog Error_Check @@ -1317,11 +1265,11 @@ _EOF_ fstrim -v / sync - dietpi-notify 2 'Please check and delete all non-required folders in /root/.xxxxxx' - dietpi-notify 2 'Please delete outdated modules' + G_DIETPI-NOTIFY 2 'Please check and delete all non-required folders in /root/.xxxxxx' + G_DIETPI-NOTIFY 2 'Please delete outdated modules' ls -lha /lib/modules - dietpi-notify 0 "Completed, disk can now be saved to .img for later use, or, reboot system to start first run of DietPi:" + G_DIETPI-NOTIFY 0 "Completed, disk can now be saved to .img for later use, or, reboot system to start first run of DietPi:" #Power off system diff --git a/dietpi/boot b/dietpi/boot index 77af3bcc31..d40b0862bb 100644 --- a/dietpi/boot +++ b/dietpi/boot @@ -26,7 +26,7 @@ RPi_Set_Clock_Speeds(){ #RPi's - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then #If no overclocking is set. set values to current (used in dietpi-config as reference for overclocking / current values) if (( $(cat /DietPi/config.txt | grep -ci -m1 '^#over_voltage=') && @@ -35,7 +35,7 @@ $(cat /DietPi/config.txt | grep -ci -m1 '^#sdram_freq=') )); then #RPi v1 - Set safe clock - if (( $HW_MODEL < 2 )); then + if (( $G_HW_MODEL < 2 )); then sed -i '/over_voltage=/c\over_voltage=2' /DietPi/config.txt sed -i '/arm_freq=/c\arm_freq=900' /DietPi/config.txt @@ -53,7 +53,7 @@ fi #RPi v2 - elif (( $HW_MODEL == 2 )); then + elif (( $G_HW_MODEL == 2 )); then sed -i '/over_voltage=/c\#over_voltage=0' /DietPi/config.txt sed -i '/arm_freq=/c\#arm_freq=900' /DietPi/config.txt @@ -61,7 +61,7 @@ sed -i '/sdram_freq=/c\#sdram_freq=450' /DietPi/config.txt #RPi v3 - elif (( $HW_MODEL == 3 )); then + elif (( $G_HW_MODEL == 3 )); then sed -i '/over_voltage=/c\#over_voltage=0' /DietPi/config.txt sed -i '/arm_freq=/c\#arm_freq=1200' /DietPi/config.txt @@ -196,18 +196,18 @@ if (( $loop_count >= $max_loops )); then - dietpi-notify 1 "$(date) | Valid connection wait timed out." | tee -a "$FP_LOGFILE" + G_DIETPI-NOTIFY 1 "$(date) | Valid connection wait timed out." | tee -a "$FP_LOGFILE" break elif (( ! $(route | awk '{print $4}' | grep -ci -m1 'UG') )); then - dietpi-notify 2 "$(date) | Waiting for valid connection, before continuing boot | Mode=$boot_wait_for_network" | tee -a "$FP_LOGFILE" + G_DIETPI-NOTIFY 2 "$(date) | Waiting for valid connection, before continuing boot | Mode=$boot_wait_for_network" | tee -a "$FP_LOGFILE" sleep 1 else # - Update network details (for IP in dietpi-banner etc..) - dietpi-notify 0 "$(date) | Valid connection found." | tee -a "$FP_LOGFILE" + G_DIETPI-NOTIFY 0 "$(date) | Valid connection found." | tee -a "$FP_LOGFILE" /DietPi/dietpi/func/obtain_network_details # Mount all drives again (eg: network shares) @@ -237,7 +237,7 @@ /DietPi/dietpi/func/dietpi-led_control 1 & #---------------------------------------------------------------- #RPi set volume to -0.1db | We have to do it here because sound card modules (dietpi-set_hardware) are not enabled on the fly, requires a reboot. - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then amixer set PCM -- -010 &> /dev/null & @@ -247,7 +247,7 @@ /DietPi/dietpi/dietpi-cpu_set & #---------------------------------------------------------------- #Disable RPi hdmi output if set in dietpi.txt - if (( $HW_MODEL < 10 && + if (( $G_HW_MODEL < 10 && $(cat /DietPi/dietpi.txt | grep -ci -m1 '^rpi_hdmi_output=0'))); then #FBset value below allows for reduced memory bandwidth usage from VideoCore (eg: Faster RAM bandwidth/performance) @@ -278,7 +278,7 @@ #Workaround: Wlan currently fails to connect during boot, so, manually drop and reconnect: https://github.com/Fourdee/DietPi/issues/602#issuecomment-262806470 # OPi Zero 2 / Neo Air - if (( $HW_MODEL == 35 || $HW_MODEL == 64 )); then + if (( $G_HW_MODEL == 35 || $G_HW_MODEL == 64 )); then ifdown wlan0 ifup wlan0 @@ -297,7 +297,7 @@ #---------------------------------------------------------------- #Normal Boot - if (( $DIETPI_INSTALL_STAGE == 1 )); then + if (( $G_DIETPI_INSTALL_STAGE == 1 )); then Wait_For_Valid_Network_Connection @@ -313,7 +313,7 @@ #---------------------------------------------------------------- #First run prep - elif (( $DIETPI_INSTALL_STAGE == -1 )); then + elif (( $G_DIETPI_INSTALL_STAGE == -1 )); then # Set RPi v1 safe overclocking profile (900mhz) RPi_Set_Clock_Speeds @@ -349,7 +349,7 @@ # - Set apt mirror TARGET_REPO='Apt_Debian_Mirror' - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then TARGET_REPO='Apt_Raspbian_Mirror' diff --git a/dietpi/dietpi-autostart b/dietpi/dietpi-autostart index 05e17d2227..0f683af15b 100644 --- a/dietpi/dietpi-autostart +++ b/dietpi/dietpi-autostart @@ -26,7 +26,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER + G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -141,7 +141,7 @@ _EOF_ fi #Amiberry (RPi) lower framebuffer size to increase memory performance: https://github.com/Fourdee/DietPi/issues/474#issuecomment-243124631 - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then if (( $AUTO_START_INDEX == 6 || $AUTO_START_INDEX == 8 || $AUTO_START_INDEX == 12 || $AUTO_START_INDEX == 13 )); then diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index a05a565cdb..17c195c7a1 100644 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -30,8 +30,8 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER - CHECK_ROOTFS_RW + G_CHECK_ROOT_USER + G_CHECK_ROOTFS_RW #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -85,7 +85,7 @@ ;; "Backup mode") - OPTION=$(whiptail --title "$WHIP_TITLE" --menu "Please select a backup mode:\n\n - System only\nOnly the system is backed up and restored, this does not include your DietPi user data ($FP_DIETPI_USERDATA).\n\n - Full:\nSystem and user data ($FP_DIETPI_USERDATA) is backed up and restored.\n\nMore information on what DietPi user data is:\nhttp://dietpi.com/phpbb/viewtopic.php?f=8&t=478#p2087" --cancel-button "Exit" --default-item "$BACKUP_MODE" --backtitle "$WHIP_BACKTITLE" 20 80 2 \ + OPTION=$(whiptail --title "$WHIP_TITLE" --menu "Please select a backup mode:\n\n - System only\nOnly the system is backed up and restored, this does not include your DietPi user data ($G_FP_DIETPI_USERDATA).\n\n - Full:\nSystem and user data ($G_FP_DIETPI_USERDATA) is backed up and restored.\n\nMore information on what DietPi user data is:\nhttp://dietpi.com/phpbb/viewtopic.php?f=8&t=478#p2087" --cancel-button "Exit" --default-item "$BACKUP_MODE" --backtitle "$WHIP_BACKTITLE" 20 80 2 \ "0" "System only" \ "1" "Full (includes user data)" 3>&1 1>&2 2>&3) CHOICE=$? @@ -236,7 +236,7 @@ #///////////////////////////////////////////////////////////////////////////////////// Error_Filesystem_Not_Supported(){ - dietpi-notify 1 "Filesystem not supported in $FP_TARGET_BACKUP" + G_DIETPI-NOTIFY 1 "Filesystem not supported in $FP_TARGET_BACKUP" if (( $INPUT == 0 )); then whiptail --title "Error" --msgbox "$FP_TARGET_BACKUP Has a filesystem of: $TARGET_FILESYSTEM_TYPE, and is not supported.\n\nThe filesystem must be EXT2/3/4 for symlink compatibility." --backtitle "$WHIP_BACKTITLE" 11 70 @@ -246,7 +246,7 @@ Error_Not_Mnt_Directory(){ - dietpi-notify 1 "Target directory is not inside /mnt ($FP_TARGET_BACKUP)" + G_DIETPI-NOTIFY 1 "Target directory is not inside /mnt ($FP_TARGET_BACKUP)" if (( $INPUT == 0 )); then whiptail --title "Directory not supported" --msgbox "$FP_TARGET_BACKUP\n\nYour current location is not supported.\nThe location must be inside the /mnt/* directory.\n - eg: /mnt/dietpi-backup" --backtitle "$WHIP_BACKTITLE" 11 70 @@ -256,17 +256,17 @@ Error_DietpiUserdata_Directory(){ - dietpi-notify 1 "Target directory can not be contained within DietPi user data location ($FP_TARGET_BACKUP)" + G_DIETPI-NOTIFY 1 "Target directory can not be contained within DietPi user data location ($FP_TARGET_BACKUP)" if (( $INPUT == 0 )); then - whiptail --title "Directory not supported" --msgbox "$FP_TARGET_BACKUP\n\nYour current location is not supported.\nTarget directory can not be contained within DietPi user data location ($FP_DIETPI_USERDATA)" --backtitle "$WHIP_BACKTITLE" 13 70 + whiptail --title "Directory not supported" --msgbox "$FP_TARGET_BACKUP\n\nYour current location is not supported.\nTarget directory can not be contained within DietPi user data location ($G_FP_DIETPI_USERDATA)" --backtitle "$WHIP_BACKTITLE" 13 70 fi } Error_Rsync_Already_Running(){ - dietpi-notify 1 "Another Rsync process is already running." + G_DIETPI-NOTIFY 1 "Another Rsync process is already running." echo -e "$RSYNC_MODE_TEXT failed: $(date +"%d-%m-%Y_%H%M"). Rsync is already running." >> "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_SYSTEM" #Menu @@ -278,7 +278,7 @@ Error_Rsync_Failed(){ - dietpi-notify 1 "$RSYNC_MODE_TEXT failed." + G_DIETPI-NOTIFY 1 "$RSYNC_MODE_TEXT failed." #Menu if (( $INPUT == 0 )); then @@ -299,7 +299,7 @@ #Backup Filepaths FP_SOURCE_SYSTEM='/' FP_TARGET_BACKUP='/mnt/dietpi-backup' - FP_DIETPI_USERDATA_ACTUAL="$(readlink -f /mnt/dietpi_userdata)" + G_FP_DIETPI_USERDATA_ACTUAL="$(readlink -f /mnt/dietpi_userdata)" #file applied to successful backups (stored in "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_SYSTEM" BACKUP_STATS_FILENAME_SYSTEM='.dietpi-backup_system_stats' @@ -424,7 +424,7 @@ _EOF_ RSYNC_MODE_TEXT="Backup" - dietpi-notify 3 DietPi-Backup "$RSYNC_MODE_TEXT" + G_DIETPI-NOTIFY 3 DietPi-Backup "$RSYNC_MODE_TEXT" #Check valid FS Check_Supported_Directory_Location @@ -458,7 +458,7 @@ _EOF_ Services_Stop - dietpi-notify 2 "Backing up to: $FP_TARGET_BACKUP" + G_DIETPI-NOTIFY 2 "Backing up to: $FP_TARGET_BACKUP" BACKUP_RESTORE_FAILED=0 @@ -472,12 +472,12 @@ _EOF_ if (( $? == 0 )); then - dietpi-notify 0 "$RSYNC_MODE_TEXT Completed.\n" + G_DIETPI-NOTIFY 0 "$RSYNC_MODE_TEXT Completed.\n" echo -e "$RSYNC_MODE_TEXT Completed : $(Print_Date)" >> "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_SYSTEM" else - dietpi-notify 1 "$RSYNC_MODE_TEXT FAILED.\n" + G_DIETPI-NOTIFY 1 "$RSYNC_MODE_TEXT FAILED.\n" echo -e "$RSYNC_MODE_TEXT FAILED : $(Print_Date)" >> "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_SYSTEM" BACKUP_RESTORE_FAILED=1 break @@ -489,16 +489,16 @@ _EOF_ if (( $BACKUP_MODE == 1 )); then - rsync $RSYNC_RUN_OPTIONS_USERDATA_BACKUP "$FP_DIETPI_USERDATA_ACTUAL"/ "$FP_TARGET_BACKUP"/dietpi-backup_userdata/ + rsync $RSYNC_RUN_OPTIONS_USERDATA_BACKUP "$G_FP_DIETPI_USERDATA_ACTUAL"/ "$FP_TARGET_BACKUP"/dietpi-backup_userdata/ if (( $? == 0 )); then - dietpi-notify 0 "$RSYNC_MODE_TEXT Completed.\n" + G_DIETPI-NOTIFY 0 "$RSYNC_MODE_TEXT Completed.\n" echo -e "$RSYNC_MODE_TEXT Completed : $(Print_Date)" >> "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_USERDATA" else - dietpi-notify 1 "$RSYNC_MODE_TEXT FAILED.\n" + G_DIETPI-NOTIFY 1 "$RSYNC_MODE_TEXT FAILED.\n" echo -e "$RSYNC_MODE_TEXT FAILED : $(Print_Date)" >> "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_USERDATA" BACKUP_RESTORE_FAILED=1 break @@ -541,7 +541,7 @@ _EOF_ RSYNC_MODE_TEXT="Restore" - dietpi-notify 3 DietPi-Backup "$RSYNC_MODE_TEXT" + G_DIETPI-NOTIFY 3 DietPi-Backup "$RSYNC_MODE_TEXT" #Check valid FS Check_Supported_Directory_Location @@ -552,8 +552,8 @@ _EOF_ #Error: Backup not found if [ ! -f "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_SYSTEM" ]; then - dietpi-notify 2 "No Backup was found in $FP_TARGET_BACKUP" - dietpi-notify 1 "$RSYNC_MODE_TEXT Failed.\n" + G_DIETPI-NOTIFY 2 "No Backup was found in $FP_TARGET_BACKUP" + G_DIETPI-NOTIFY 1 "$RSYNC_MODE_TEXT Failed.\n" if (( $INPUT == 0 )); then whiptail --title "$RSYNC_MODE_TEXT failed" --msgbox "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_SYSTEM does not exist\n\nHave you created a backup?" --backtitle "$WHIP_BACKTITLE" 11 70 fi @@ -571,7 +571,7 @@ _EOF_ Services_Stop - dietpi-notify 2 "Restoring from: $FP_TARGET_BACKUP" + G_DIETPI-NOTIFY 2 "Restoring from: $FP_TARGET_BACKUP" BACKUP_RESTORE_FAILED=0 @@ -584,12 +584,12 @@ _EOF_ rsync $RSYNC_RUN_OPTIONS_SYSTEM_BACKUP "$FP_TARGET_BACKUP"/dietpi-backup_system/ "$FP_SOURCE_SYSTEM" if (( $? == 0 )); then - dietpi-notify 0 "$RSYNC_MODE_TEXT Completed.\n" + G_DIETPI-NOTIFY 0 "$RSYNC_MODE_TEXT Completed.\n" echo -e "$RSYNC_MODE_TEXT Completed : $(Print_Date)" >> "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_SYSTEM" else - dietpi-notify 1 "$RSYNC_MODE_TEXT FAILED.\n" + G_DIETPI-NOTIFY 1 "$RSYNC_MODE_TEXT FAILED.\n" echo -e "$RSYNC_MODE_TEXT FAILED : $(Print_Date)" >> "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_SYSTEM" BACKUP_RESTORE_FAILED=1 break @@ -604,15 +604,15 @@ _EOF_ # - Only restore userdata if a backup exists if [ -f "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_USERDATA" ]; then - rsync $RSYNC_RUN_OPTIONS_USERDATA_BACKUP "$FP_TARGET_BACKUP"/dietpi-backup_userdata/ "$FP_DIETPI_USERDATA_ACTUAL"/ + rsync $RSYNC_RUN_OPTIONS_USERDATA_BACKUP "$FP_TARGET_BACKUP"/dietpi-backup_userdata/ "$G_FP_DIETPI_USERDATA_ACTUAL"/ if (( $? == 0 )); then - dietpi-notify 0 "$RSYNC_MODE_TEXT Completed.\n" + G_DIETPI-NOTIFY 0 "$RSYNC_MODE_TEXT Completed.\n" echo -e "$RSYNC_MODE_TEXT Completed : $(Print_Date)" >> "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_USERDATA" else - dietpi-notify 1 "$RSYNC_MODE_TEXT FAILED.\n" + G_DIETPI-NOTIFY 1 "$RSYNC_MODE_TEXT FAILED.\n" echo -e "$RSYNC_MODE_TEXT FAILED : $(Print_Date)" >> "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_USERDATA" BACKUP_RESTORE_FAILED=1 break @@ -621,7 +621,7 @@ _EOF_ else - dietpi-notify 2 "$RSYNC_MODE_TEXT: No backup exists, skipping...\n" + G_DIETPI-NOTIFY 2 "$RSYNC_MODE_TEXT: No backup exists, skipping...\n" fi @@ -663,10 +663,10 @@ _EOF_ #Rsync if (( ! $(dpkg --get-selections | grep -ci -m1 '^rsync[[[:space:]]') )); then - dietpi-notify 2 "Installing Rsync, please wait....\n" + G_DIETPI-NOTIFY 2 "Installing Rsync, please wait....\n" sleep 1 - AGI rsync + G_AGI rsync fi @@ -677,7 +677,7 @@ _EOF_ TARGET_DIRECTORY_SUPPORTED=0 #Disallow dietpi_userdata location, due to includes in that location - if [[ "$FP_TARGET_BACKUP" == "$FP_DIETPI_USERDATA"* ]] || [[ "$FP_TARGET_BACKUP" == "$FP_DIETPI_USERDATA_ACTUAL"* ]] ; then + if [[ "$FP_TARGET_BACKUP" == "$G_FP_DIETPI_USERDATA"* ]] || [[ "$FP_TARGET_BACKUP" == "$G_FP_DIETPI_USERDATA_ACTUAL"* ]] ; then Error_DietpiUserdata_Directory diff --git a/dietpi/dietpi-banner b/dietpi/dietpi-banner index f0c53cfa36..b4053a5ae4 100644 --- a/dietpi/dietpi-banner +++ b/dietpi/dietpi-banner @@ -44,7 +44,7 @@ Hardware_Model_Print(){ - echo -e " \e[39;49;1mV$DIETPI_VERSION\e[0m \e[90m| $HW_MODEL_DESCRIPTION\e[0m\n \e[38;5;154m───────────────────────────────────────\e[0m" + echo -e " \e[39;49;1mV$DIETPI_VERSION\e[0m \e[90m| $G_HW_MODEL_DESCRIPTION\e[0m\n \e[38;5;154m───────────────────────────────────────\e[0m" } diff --git a/dietpi/dietpi-bugreport b/dietpi/dietpi-bugreport index 908137a411..ef9a31ce8c 100644 --- a/dietpi/dietpi-bugreport +++ b/dietpi/dietpi-bugreport @@ -15,8 +15,8 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER - CHECK_ROOTFS_RW + G_CHECK_ROOT_USER + G_CHECK_ROOTFS_RW #Import DietPi-Globals --------------------------------------------------------------- # - byte @@ -206,7 +206,7 @@ _EOF_ cd "$FILEPATH_TEMP" #---------------------------------------------------------------- #Check if we have a working internet connection beforehand - Check_URL "$FTP_ADDR" + G_CHECK_URL "$FTP_ADDR" if (( $? == 0 )); then INTERNET_AVAILABLE=1 fi @@ -269,7 +269,7 @@ _EOF_ else #Check upload location is online - Check_URL "$FTP_ADDR" + G_CHECK_URL "$FTP_ADDR" if (( $? == 0 )); then #Limit filesize to 10MB @@ -283,7 +283,7 @@ _EOF_ # - upload to server else - dietpi-notify 2 "Uploading bug report, please wait..." + G_DIETPI-NOTIFY 2 "Uploading bug report, please wait..." wput --timeout=10th-4 --tries=1 --waitretry=2 -B -u "$FILE_GENERATED_ZIP" ftp://"$FTP_USER":"$FTP_PASS"@"$FTP_ADDR" BUG_REPORT_COMPLETED=1 diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index c560047139..fc1f357cde 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -24,8 +24,8 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER - CHECK_ROOTFS_RW + G_CHECK_ROOT_USER + G_CHECK_ROOTFS_RW #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -469,7 +469,7 @@ apt-get clean rm /var/lib/apt/lists/* -vf - AGUP + G_AGUP fi diff --git a/dietpi/dietpi-cloudshell b/dietpi/dietpi-cloudshell index c8b103dd51..aac8eb5b52 100644 --- a/dietpi/dietpi-cloudshell +++ b/dietpi/dietpi-cloudshell @@ -25,7 +25,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER + G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- #Version @@ -355,7 +355,7 @@ CPU_FREQ_2="N/A" #Unique additional freq readout for Odroid XU4 (octo, 2nd quad set) - if (( $HW_MODEL == 11 )); then + if (( $G_HW_MODEL == 11 )); then CPU_FREQ_2=$(( $(cat /sys/devices/system/cpu/cpu4/cpufreq/scaling_cur_freq) / 1000 )) @@ -374,7 +374,7 @@ done < $FP_TEMP #ps returns usage of each core, so we devide the total by #n cores - CPU_USAGE=$(echo "scale=0;$CPU_USAGE / $HW_CPU_CORES" | bc -l ) + CPU_USAGE=$(echo "scale=0;$CPU_USAGE / $G_HW_CPU_CORES" | bc -l ) # TOP (accurate) # Fails to output in low screen res (https://github.com/Fourdee/DietPi/issues/203#issuecomment-189711968) @@ -459,7 +459,7 @@ #kill - dietpi-notify 1 "DF failed, unable to obtain drive data" + G_DIETPI-NOTIFY 1 "DF failed, unable to obtain drive data" sleep 2 kill $pid @@ -933,7 +933,7 @@ echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]} Governor ${aCOLOUR[$USER_COLOUR_INDEX]}:$C_RESET $CPU_GOV" #XU3/4 unique octo quad sets - if (( $HW_MODEL == 11 )); then + if (( $G_HW_MODEL == 11 )); then echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]} Freq 0-3 ${aCOLOUR[$USER_COLOUR_INDEX]}:$C_RESET $CPU_FREQ_1 mhz" echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]} Freq 4-7 ${aCOLOUR[$USER_COLOUR_INDEX]}:$C_RESET $CPU_FREQ_2 mhz" @@ -1174,7 +1174,7 @@ _EOF_ #-------------------------------------------------------------------------------- #VM disable CPU scene - if (( $HW_MODEL == 20 )); then + if (( $G_HW_MODEL == 20 )); then aEnabledScenes[0]=0 fi diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 793829a51b..8c2a10a0df 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -30,8 +30,8 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER - CHECK_ROOTFS_RW + G_CHECK_ROOT_USER + G_CHECK_ROOTFS_RW #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -57,7 +57,7 @@ HW_MSG_NOTSUPPORTED="Not Supported" Info_HW_OptionNotSupported(){ - WHIP_QUESTION="This option is not available for $HW_MODEL_DESCRIPTION" + WHIP_QUESTION="This option is not available for $G_HW_MODEL_DESCRIPTION" whiptail --title "$WHIP_TITLE" --msgbox "$WHIP_QUESTION" --backtitle "$WHIP_BACKTITLE" 8 65 } @@ -95,7 +95,7 @@ Menu_Main(){ WHIP_TITLE='DietPi-Config' - OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $HW_MODEL_DESCRIPTION" --cancel-button "Exit" --backtitle "$WHIP_BACKTITLE" 18 50 10 \ + OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $G_HW_MODEL_DESCRIPTION" --cancel-button "Exit" --backtitle "$WHIP_BACKTITLE" 18 50 10 \ "1" "Display Options" \ "2" "Audio Options" \ "3" "Performance Options" \ @@ -114,7 +114,7 @@ TARGETMENUID=1 - if (( $HW_MODEL == 20 )); then + if (( $G_HW_MODEL == 20 )); then TARGETMENUID=0 Info_HW_OptionNotSupported @@ -125,7 +125,7 @@ TARGETMENUID=14 - if (( $HW_MODEL == 20 )); then + if (( $G_HW_MODEL == 20 )); then TARGETMENUID=0 Info_HW_OptionNotSupported @@ -136,7 +136,7 @@ TARGETMENUID=4 - if (( $HW_MODEL == 20 )); then + if (( $G_HW_MODEL == 20 )); then TARGETMENUID=0 Info_HW_OptionNotSupported @@ -226,7 +226,7 @@ local input=$1 - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then local framebuffer_x=$(cat /DietPi/config.txt | grep -m1 'framebuffer'_width= | sed 's/.*=//') local framebuffer_y=$(cat /DietPi/config.txt | grep -m1 'framebuffer'_height= | sed 's/.*=//') @@ -272,7 +272,7 @@ local whiptail_menu_array=() - if (( $HW_MODEL == 21 )); then + if (( $G_HW_MODEL == 21 )); then whiptail_menu_array+=("1" "Display Driver") @@ -289,7 +289,7 @@ whiptail_menu_array+=("14" "LED Control") #RPi only - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then # - Get Current Settings local overscan_enabled=$(cat /DietPi/config.txt | grep -ci -m1 'disable_overscan=0') @@ -362,7 +362,7 @@ fi #Odroid Remote - if (( $HW_MODEL >= 10 && $HW_MODEL <= 12 )); then + if (( $G_HW_MODEL >= 10 && $G_HW_MODEL <= 12 )); then local odroid_remote_text='Disabled' local odroid_remote_enabled=0 @@ -414,23 +414,23 @@ elif (( $OPTION == 3 )); then - if (( $HW_MODEL < 10 || - $HW_MODEL == 10 || - $HW_MODEL == 11 || - $HW_MODEL == 12 )); then + if (( $G_HW_MODEL < 10 || + $G_HW_MODEL == 10 || + $G_HW_MODEL == 11 || + $G_HW_MODEL == 12 )); then local whiptail_menu_array=() whiptail_menu_array+=("none" "Uninstall all panels") whiptail_menu_array+=("waveshare32" "320x240 panel with touch input") - if (( $HW_MODEL == 11 )); then + if (( $G_HW_MODEL == 11 )); then whiptail_menu_array+=("odroid-cloudshell" "320x240 panel") fi - if (( $HW_MODEL >= 10 && $HW_MODEL < 20 )); then + if (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )); then whiptail_menu_array+=("odroid-lcd35" "480x320 panel with touch input") @@ -460,7 +460,7 @@ elif (( $OPTION == 2 )); then - if (( $HW_MODEL < 10 || $HW_MODEL == 10 || $HW_MODEL == 12 )); then + if (( $G_HW_MODEL < 10 || $G_HW_MODEL == 10 || $G_HW_MODEL == 12 )); then WHIP_QUESTION='GPU/RAM Memory splits are pre-configured and applied during DietPi-Software setup. \n \nThe split value is optimized based on your software installs, however, feel free to tweak them.' whiptail --title "$WHIP_TITLE" --msgbox "$WHIP_QUESTION" --backtitle "$WHIP_BACKTITLE" 12 60 @@ -478,7 +478,7 @@ elif (( $OPTION == 6 )); then #RPI only - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then if (( $overscan_enabled )); then @@ -511,7 +511,7 @@ elif (( $OPTION == 7 )); then #RPI only - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then #Enabled if [ "$hdmi_boost_disabled" = 0 ]; then @@ -553,7 +553,7 @@ elif (( $OPTION == 8 )); then #RPI only - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then if (( ! $rpi_camera_module_enabled )); then @@ -579,7 +579,7 @@ elif (( $OPTION == 9 )); then #RPI only - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then if (( ! $rpi_camera_led_enabled )); then @@ -785,7 +785,7 @@ TARGETMENUID=1 #Native PC - if (( $HW_MODEL == 21 )); then + if (( $G_HW_MODEL == 21 )); then local whiptail_menu_array=() @@ -842,7 +842,7 @@ fi #RPI - elif (( $HW_MODEL < 10 )); then + elif (( $G_HW_MODEL < 10 )); then #Get Current Values local framebuffer_x=$(cat /DietPi/config.txt | grep -m1 'framebuffer'_width= | sed 's/.*=//') @@ -864,7 +864,7 @@ fi WHIP_TITLE='DietPi - Resolution' - OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $HW_MODEL_DESCRIPTION \n Current: $display_output_text" --cancel-button "$TEXT_MENU_BACK" 19 60 9 \ + OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $G_HW_MODEL_DESCRIPTION \n Current: $display_output_text" --cancel-button "$TEXT_MENU_BACK" 19 60 9 \ 'OpenGL' '1920 x 1080' \ '1080p' '1920 x 1080' \ '720p' '1280 x 720' \ @@ -960,13 +960,13 @@ fi #Odroid C1 - elif (( $HW_MODEL == 10 )); then + elif (( $G_HW_MODEL == 10 )); then #Get Current Values local current_resolution=$(cat /DietPi/boot.ini | grep -m1 'setenv m "' | awk -F '"' '{print $2}') WHIP_TITLE='DietPi - Resolution' - OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $HW_MODEL_DESCRIPTION \n Current: $current_resolution" --cancel-button "$TEXT_MENU_BACK" 16 60 6 \ + OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $G_HW_MODEL_DESCRIPTION \n Current: $current_resolution" --cancel-button "$TEXT_MENU_BACK" 16 60 6 \ "1080p" "1920 x 1080" \ "720p" "1280 x 720" \ "480p" "720 x 480" \ @@ -1008,7 +1008,7 @@ fi #Odroid xu3/4 - elif (( $HW_MODEL == 11 )); then + elif (( $G_HW_MODEL == 11 )); then #Get Current Values local current_resolution="" @@ -1021,7 +1021,7 @@ fi WHIP_TITLE='DietPi - Resolution' - OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $HW_MODEL_DESCRIPTION \n Current: $current_resolution" --cancel-button "$TEXT_MENU_BACK" 14 60 4 \ + OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $G_HW_MODEL_DESCRIPTION \n Current: $current_resolution" --cancel-button "$TEXT_MENU_BACK" 14 60 4 \ "1080p" "1920 x 1080" \ "720p" "1280 x 720" \ "480p" "720 x 480" \ @@ -1059,7 +1059,7 @@ fi #Odroid C2 - elif (( $HW_MODEL == 12 )); then + elif (( $G_HW_MODEL == 12 )); then #Get Current Values local current_resolution=$(cat /DietPi/boot.ini | grep -m1 'setenv m "' | awk -F '"' '{print $2}' | sed 's/p/p /') @@ -1067,7 +1067,7 @@ WHIP_TITLE='DietPi - Resolution' - OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $HW_MODEL_DESCRIPTION \n Current: $current_resolution" --default-item "$current_resolution" --cancel-button "$TEXT_MENU_BACK" 18 60 9 \ + OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $G_HW_MODEL_DESCRIPTION \n Current: $current_resolution" --default-item "$current_resolution" --cancel-button "$TEXT_MENU_BACK" 18 60 9 \ "2160p 60hz" "4K (Recommended)" \ "2160p 50hz" "4K" \ "2160p 30hz" "4K" \ @@ -1115,13 +1115,13 @@ fi #Pine a64 - elif (( $HW_MODEL >= 40 && $HW_MODEL <= 42 )); then + elif (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then #Get Current Values local current_resolution=$(cat /DietPi/uEnv.txt | grep -m1 'optargs=disp.screen0_output_mode=' | sed 's/.*=//') WHIP_TITLE='DietPi - Resolution' - OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $HW_MODEL_DESCRIPTION \n Current: $current_resolution" --default-item "$current_resolution" --cancel-button "$TEXT_MENU_BACK" 18 55 9 \ + OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $G_HW_MODEL_DESCRIPTION \n Current: $current_resolution" --default-item "$current_resolution" --cancel-button "$TEXT_MENU_BACK" 18 55 9 \ "720p50" "" \ "720p60" "720p" \ "1080i50" "" \ @@ -1200,17 +1200,17 @@ bluetooth_state_text='Disabled' fi # - No bluetooth for VM - if (( $HW_MODEL != 20 )); then + if (( $G_HW_MODEL != 20 )); then whiptail_menu_array+=("Bluetooth" ": $bluetooth_state_text") fi # - No serial console for VM - if (( $HW_MODEL != 20 )); then + if (( $G_HW_MODEL != 20 )); then whiptail_menu_array+=("Serial console" ": $serialconsole_text") fi #RPi Specific - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then local rpi_i2c_enabled=$(cat /DietPi/config.txt | grep -ci -m1 'dtparam=i2c_arm=on') local rpi_i2c_text='Disabled' @@ -1225,7 +1225,7 @@ rpi_usbmaxcurrent_text='Enabled' fi - if (( $HW_MODEL == 3 )); then + if (( $G_HW_MODEL == 3 )); then local rpi3_usb_boot_bit_enabled=$(vcgencmd otp_dump | grep -m1 '17:' | grep -ci -m1 '3020000a') local rpi3_usb_boot_bit_enabled_text='Disabled' @@ -1306,7 +1306,7 @@ elif [ "$OPTION" = "Update firmware" ]; then #RPI - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then WHIP_QUESTION=" Would you like to update the firmware on your Pi? \n - This will run rpi-update" whiptail --title "$WHIP_TITLE" --yesno "$WHIP_QUESTION" --yes-button "Ok" --no-button "Back" --defaultno --backtitle "$WHIP_BACKTITLE" 12 60 @@ -1317,7 +1317,7 @@ if (( $(dpkg -l | grep -ci -m1 'rpi-update') == 0 )); then echo -e "\n DietPi: Installing rpi-update, please wait...\n" - AGI rpi-update + G_AGI rpi-update fi @@ -1327,32 +1327,32 @@ fi #Odroid - elif (( $HW_MODEL >= 10 )) && (( $HW_MODEL < 20 )); then + elif (( $G_HW_MODEL >= 10 )) && (( $G_HW_MODEL < 20 )); then - WHIP_QUESTION=" Would you like to update the firmware on your $HW_MODEL_DESCRIPTION? \n - This will run apt-get dist-upgrade\n\nNB: When asked if you wish to overwrite the current kernel, press Tab and then enter (to confirm)." + WHIP_QUESTION=" Would you like to update the firmware on your $G_HW_MODEL_DESCRIPTION? \n - This will run apt-get dist-upgrade\n\nNB: When asked if you wish to overwrite the current kernel, press Tab and then enter (to confirm)." whiptail --title "$WHIP_TITLE" --yesno "$WHIP_QUESTION" --yes-button "Ok" --no-button "Back" --defaultno --backtitle "$WHIP_BACKTITLE" 14 60 CHOICE=$? if (( $CHOICE == 0 )); then - AGDUG + G_AGDUG fi #OrangePi - elif (( $HW_MODEL >= 30 )) && (( $HW_MODEL < 40 )); then + elif (( $G_HW_MODEL >= 30 )) && (( $G_HW_MODEL < 40 )); then - WHIP_QUESTION=" Would you like to update the firmware on your $HW_MODEL_DESCRIPTION? \n - This will run apt-get dist-upgrade\n\nNB: When asked if you wish to overwrite the current kernel, press Tab and then enter (to confirm)." + WHIP_QUESTION=" Would you like to update the firmware on your $G_HW_MODEL_DESCRIPTION? \n - This will run apt-get dist-upgrade\n\nNB: When asked if you wish to overwrite the current kernel, press Tab and then enter (to confirm)." whiptail --title "$WHIP_TITLE" --yesno "$WHIP_QUESTION" --yes-button "Ok" --no-button "Back" --defaultno --backtitle "$WHIP_BACKTITLE" 14 60 CHOICE=$? if (( $CHOICE == 0 )); then - AGDUG + G_AGDUG fi #PineA64 - elif (( $HW_MODEL >= 40 && $HW_MODEL <= 42 )); then - WHIP_QUESTION=" Would you like to update the firmware on your $HW_MODEL_DESCRIPTION? \n - This will run longsleep's update scripts to update the U-Boot and kernel." + elif (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then + WHIP_QUESTION=" Would you like to update the firmware on your $G_HW_MODEL_DESCRIPTION? \n - This will run longsleep's update scripts to update the U-Boot and kernel." whiptail --title "$WHIP_TITLE" --yesno "$WHIP_QUESTION" --yes-button "Ok" --no-button "Back" --defaultno --backtitle "$WHIP_BACKTITLE" 12 60 CHOICE=$? if (( $CHOICE == 0 )); then @@ -1532,7 +1532,7 @@ local whiptail_menu_array=() #Overclocking - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then whiptail_menu_array+=("Overclocking" "Set Profile") fi @@ -1582,7 +1582,7 @@ whiptail_menu_array+=("CPU Min Freq Limit" ": $user_frequency_min_text") #RPi extras - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then local current_arm_temp_limit=$(cat /DietPi/config.txt | grep -m1 'temp_limit' | sed 's/.*=//') local current_initial_turbo=$(cat /DietPi/config.txt | grep -m1 'initial_turbo' | sed 's/.*=//') @@ -1608,7 +1608,7 @@ fi WHIP_TITLE='DietPi - Performance Options' - OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $HW_MODEL_DESCRIPTION \n ARM Temp: $arm_temp : $arm_temp_f\n RAM: $memory_total MB | Used: $memory_usage MB | Free: $memory_free MB" --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" 18 60 8 "${whiptail_menu_array[@]}" 3>&1 1>&2 2>&3) + OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $G_HW_MODEL_DESCRIPTION \n ARM Temp: $arm_temp : $arm_temp_f\n RAM: $memory_total MB | Used: $memory_usage MB | Free: $memory_free MB" --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" 18 60 8 "${whiptail_menu_array[@]}" 3>&1 1>&2 2>&3) CHOICE=$? @@ -1867,7 +1867,7 @@ # - 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 + (( $G_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 (recommended)." @@ -2115,22 +2115,22 @@ local ram_mem_current=0 local ram_mem_total=0 - if (( $HW_MODEL == 0 )); then + if (( $G_HW_MODEL == 0 )); then gpu_mem_current=$(grep -m1 'gpu_mem_256=' /DietPi/config.txt | sed 's/.*=//') ram_mem_current=$((256-gpu_mem_current)) ram_mem_total=256 - elif (( $HW_MODEL == 1 )); then + elif (( $G_HW_MODEL == 1 )); then gpu_mem_current=$(grep -m1 'gpu_mem_512=' /DietPi/config.txt | sed 's/.*=//') ram_mem_current=$((512-gpu_mem_current)) ram_mem_total=512 - elif (( $HW_MODEL == 2 )) || (( $HW_MODEL == 3 )); then + elif (( $G_HW_MODEL == 2 )) || (( $G_HW_MODEL == 3 )); then gpu_mem_current=$(grep -m1 'gpu_mem_1024=' /DietPi/config.txt | sed 's/.*=//') ram_mem_current=$((1024-gpu_mem_current)) ram_mem_total=1024 - elif (( $HW_MODEL == 10 )); then + elif (( $G_HW_MODEL == 10 )); then ram_mem_current=$(free -m | grep -m1 'Mem:' | awk '{print $2}') gpu_mem_current=$((1024-ram_mem_current)) - elif (( $HW_MODEL == 12 )); then + elif (( $G_HW_MODEL == 12 )); then ram_mem_current=$(free -m | grep -m1 'Mem:' | awk '{print $2}') gpu_mem_current=$((2048-ram_mem_current)) fi @@ -2138,7 +2138,7 @@ WHIP_TITLE='DietPi - GPU/RAM Split' #RPi's - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then #Create array for storing menu selectable options. local -a option_name=( @@ -2156,12 +2156,12 @@ 128 ) - if (( $HW_MODEL == 0 )); then + if (( $G_HW_MODEL == 0 )); then echo -e "As above, array is defaulted to RPi1 - 256mb" &> /dev/null - elif (( $HW_MODEL == 1 )); then + elif (( $G_HW_MODEL == 1 )); then available_gpu_values[2]=128 available_gpu_values[3]=192 - elif (( $HW_MODEL == 2 )) || (( $HW_MODEL == 3 )); then + elif (( $G_HW_MODEL == 2 )) || (( $G_HW_MODEL == 3 )); then available_gpu_values[1]=128 available_gpu_values[2]=192 available_gpu_values[3]=256 @@ -2174,7 +2174,7 @@ option_output_text+=("${option_name[$i]}" "${available_gpu_values[$i]} MB GPU | $((ram_mem_total - ${available_gpu_values[$i]})) MB RAM") done - OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $HW_MODEL_DESCRIPTION \n Current: $gpu_mem_current MB GPU | $ram_mem_current MB RAM" --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" 14 75 4 "${option_output_text[@]}" 3>&1 1>&2 2>&3) + OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $G_HW_MODEL_DESCRIPTION \n Current: $gpu_mem_current MB GPU | $ram_mem_current MB RAM" --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" 14 75 4 "${option_output_text[@]}" 3>&1 1>&2 2>&3) CHOICE=$? if (( $CHOICE == 0 )); then @@ -2202,7 +2202,7 @@ unset available_gpu_values #Odroid C1 - elif (( $HW_MODEL == 10 )); then + elif (( $G_HW_MODEL == 10 )); then #Odroid HDMI/headless extra data local display_output_enabled=$(cat /DietPi/boot.ini | grep -ci -m1 '^setenv hdmioutput "1"') @@ -2217,7 +2217,7 @@ display_vpu_text="Disabled" fi - OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $HW_MODEL_DESCRIPTION \n Current : HDMI: $display_output_text | VPU: $display_vpu_text \n Memory : $gpu_mem_current MB GPU | $ram_mem_current MB RAM \n NB: GPU/RAM figures require a reboot after a change is made." --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" 15 70 3 \ + OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $G_HW_MODEL_DESCRIPTION \n Current : HDMI: $display_output_text | VPU: $display_vpu_text \n Memory : $gpu_mem_current MB GPU | $ram_mem_current MB RAM \n NB: GPU/RAM figures require a reboot after a change is made." --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" 15 70 3 \ "Headless" "HDMI: Disabled | VPU: Disabled" \ "Server" "HDMI: Enabled | VPU: Disabled" \ "Desktop" "HDMI: Enabled | VPU: Enabled" 3>&1 1>&2 2>&3) @@ -2247,7 +2247,7 @@ esac #C2 - elif (( $HW_MODEL == 12 )); then + elif (( $G_HW_MODEL == 12 )); then #Odroid HDMI/headless extra data local display_output_enabled=$(cat /DietPi/boot.ini | grep -ci -m1 '^setenv nographics "0"') @@ -2257,7 +2257,7 @@ display_output_text="Disabled" fi - OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $HW_MODEL_DESCRIPTION \n Current : HDMI: $display_output_text | VPU: $display_output_text \n Memory : $gpu_mem_current MB GPU | $ram_mem_current MB RAM \n NB: GPU/RAM figures require a reboot after a change is made." --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" 14 70 2 \ + OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $G_HW_MODEL_DESCRIPTION \n Current : HDMI: $display_output_text | VPU: $display_output_text \n Memory : $gpu_mem_current MB GPU | $ram_mem_current MB RAM \n NB: GPU/RAM figures require a reboot after a change is made." --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" 14 70 2 \ "Headless" "HDMI: Disabled | VPU: Disabled | +300MB RAM" \ "Default" "HDMI: Enabled | VPU: Enabled | -300MB RAM" 3>&1 1>&2 2>&3) @@ -2410,7 +2410,7 @@ _EOF_ #dhclient -r #Drop Connections - dietpi-notify 2 "Dropping connections, please wait..." + G_DIETPI-NOTIFY 2 "Dropping connections, please wait..." ifdown eth$ETH_INDEX &> /dev/null ifdown wlan$WIFI_INDEX &> /dev/null @@ -2431,7 +2431,7 @@ _EOF_ fi #Restart Networking - dietpi-notify 2 'Restarting networking services, please wait...' + G_DIETPI-NOTIFY 2 'Restarting networking services, please wait...' systemctl daemon-reload systemctl restart networking @@ -2832,7 +2832,7 @@ _EOF_ INTERNET_ONLINE=0 #Not tested #Check for connection - Check_URL "$INTERNET_URL" + G_CHECK_URL "$INTERNET_URL" if (( $? == 0 )); then INTERNET_ONLINE=2 #Online else @@ -3405,19 +3405,19 @@ ADAPTER="wlan$WIFI_INDEX" TICKRATE=10 while true do -dietpi-notify 2 "Checking connnection for: \$ADAPTER" +G_DIETPI-NOTIFY 2 "Checking connnection for: \$ADAPTER" ping -I \$ADAPTER -c 1 \$URL_PING if (( \$? != 0 )); then -dietpi-notify 2 "Detected connection loss: \$ADAPTER. Reconnecting" +G_DIETPI-NOTIFY 2 "Detected connection loss: \$ADAPTER. Reconnecting" ifdown "\$ADAPTER" sleep 1 ifup "\$ADAPTER" -dietpi-notify 0 'Completed' +G_DIETPI-NOTIFY 0 'Completed' else -dietpi-notify 0 "Connection \$ADAPTER" +G_DIETPI-NOTIFY 0 "Connection \$ADAPTER" fi @@ -3881,15 +3881,15 @@ _EOF_ #Run benchmark if (( $run_benchmark == 1 )); then - dietpi-notify 2 "Performing $text_info_test_name benchmark, please wait..." + G_DIETPI-NOTIFY 2 "Performing $text_info_test_name benchmark, please wait..." - dietpi-notify 2 "Testing Seq Write Speed ($benchmark_filesize MB)" + G_DIETPI-NOTIFY 2 "Testing Seq Write Speed ($benchmark_filesize MB)" - if (( $DISTRO == 3 )); then + if (( $G_DISTRO == 3 )); then write_speed=$(dd bs=4K count=$(( $benchmark_filesize * 1024 / 4 )) if=/dev/zero of=$benchmark_temp_file conv=fdatasync 2>&1 | grep 'MB' | awk '{print $8, $9}') - elif (( $DISTRO == 4 )); then + elif (( $G_DISTRO == 4 )); then write_speed=$(dd bs=4K count=$(( $benchmark_filesize * 1024 / 4 )) if=/dev/zero of=$benchmark_temp_file conv=fdatasync 2>&1 | grep 'MB' | awk '{print $10, $11}') @@ -3898,13 +3898,13 @@ _EOF_ # - Clear cache sync echo 3 > /proc/sys/vm/drop_caches - dietpi-notify 2 "Testing Seq Read Speed ($benchmark_filesize MB)" + G_DIETPI-NOTIFY 2 "Testing Seq Read Speed ($benchmark_filesize MB)" - if (( $DISTRO == 3 )); then + if (( $G_DISTRO == 3 )); then read_speed=$(dd bs=4K count=$(( $benchmark_filesize * 1024 / 4 )) if=$benchmark_temp_file of=/dev/zero conv=fdatasync 2>&1 | grep 'MB' | awk '{print $8, $9}') - elif (( $DISTRO == 4 )); then + elif (( $G_DISTRO == 4 )); then read_speed=$(dd bs=4K count=$(( $benchmark_filesize * 1024 / 4 )) if=$benchmark_temp_file of=/dev/zero conv=fdatasync 2>&1 | grep 'MB' | awk '{print $10, $11}') @@ -3944,25 +3944,25 @@ _EOF_ # if (( ! $(dpkg --get-selections | grep -ci -m1 '^sysbench[[:space:]]') )); then - # dietpi-notify 2 "Installing Sysbench, please wait..." - # AGI sysbench + # G_DIETPI-NOTIFY 2 "Installing Sysbench, please wait..." + # G_AGI sysbench # fi /DietPi/dietpi/dietpi-services stop - # dietpi-notify 0 "Running Sysbench with max prime of $CPUBENCH_INT_MAX, please wait..." + # G_DIETPI-NOTIFY 0 "Running Sysbench with max prime of $CPUBENCH_INT_MAX, please wait..." # local fp_log_sysbench='/tmp/.fp_log_sysbench' # sysbench --test=cpu --num-threads=$(nproc --all) --cpu-max-prime=$CPUBENCH_INT_MAX --validate=on run | tee -a "$fp_log_sysbench" - # dietpi-notify 0 "Sysbench completed" + # G_DIETPI-NOTIFY 0 "Sysbench completed" # CPUBENCH_TIME=$(grep -m1 'total time' "$fp_log_sysbench" | awk '{print $NF}') # rm "$fp_log_sysbench" - dietpi-notify 0 "Running DietPi-CPU Benchmark with max value of 1000000 over $(nproc --all) cores, please wait..." + G_DIETPI-NOTIFY 0 "Running DietPi-CPU Benchmark with max value of 1000000 over $(nproc --all) cores, please wait..." cat << _EOF_ > /tmp/dietpi-bench #!/bin/bash @@ -4127,19 +4127,19 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ sed -i '/over_voltage=/c\#over_voltage=0' /DietPi/config.txt - if (( $HW_MODEL == 3 )); then + if (( $G_HW_MODEL == 3 )); then sed -i '/arm_freq=/c\#arm_freq=1200' /DietPi/config.txt sed -i '/core_freq=/c\#core_freq=400' /DietPi/config.txt sed -i '/sdram_freq=/c\#sdram_freq=450' /DietPi/config.txt - elif (( $HW_MODEL == 2 )); then + elif (( $G_HW_MODEL == 2 )); then sed -i '/arm_freq=/c\#arm_freq=900' /DietPi/config.txt sed -i '/core_freq=/c\#core_freq=250' /DietPi/config.txt sed -i '/sdram_freq=/c\#sdram_freq=450' /DietPi/config.txt - elif (( $HW_MODEL <= 1 )); then + elif (( $G_HW_MODEL <= 1 )); then sed -i '/arm_freq=/c\#arm_freq=700' /DietPi/config.txt sed -i '/core_freq=/c\#core_freq=250' /DietPi/config.txt @@ -4182,10 +4182,10 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ #Overclocking Pi1 # - Zero - echo -e "$HW_MODEL" + echo -e "$G_HW_MODEL" if (( $(cat /DietPi/dietpi/.hw_model | tr '[:upper:]' '[:lower:]' | grep -ci -m1 'rpi zero') )); then - OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $HW_MODEL_DESCRIPTION \n Current: $arm_freq_value MHz ARM | $core_freq_value MHz core | $sdram_freq_value MHz SDRAM | $over_voltage_value overvolt" --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" 13 75 4 \ + OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $G_HW_MODEL_DESCRIPTION \n Current: $arm_freq_value MHz ARM | $core_freq_value MHz core | $sdram_freq_value MHz SDRAM | $over_voltage_value overvolt" --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" 13 75 4 \ "none" " 1000 MHz ARM | 400 MHz core | 450 MHz SDRAM | 0 overvolt" 3>&1 1>&2 2>&3) case "$OPTION" in @@ -4198,9 +4198,9 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ ;; esac - elif (( $HW_MODEL <= 1 )); then + elif (( $G_HW_MODEL <= 1 )); then - OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $HW_MODEL_DESCRIPTION \n Current: $arm_freq_value MHz ARM | $core_freq_value MHz core | $sdram_freq_value MHz SDRAM | $over_voltage_value overvolt" --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" 14 70 4 \ + OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $G_HW_MODEL_DESCRIPTION \n Current: $arm_freq_value MHz ARM | $core_freq_value MHz core | $sdram_freq_value MHz SDRAM | $over_voltage_value overvolt" --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" 14 70 4 \ "none" " 700 MHz ARM | 250 MHz core | 400 MHz SDRAM | 0 overvolt" \ "safe" " 900 MHz ARM | 250 MHz core | 400 MHz SDRAM | 2 overvolt" \ "high" " 900 MHz ARM | 500 MHz core | 400 MHz SDRAM | 4 overvolt" \ @@ -4254,9 +4254,9 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ esac #Overclocking Pi2 - elif (( $HW_MODEL == 2 )); then + elif (( $G_HW_MODEL == 2 )); then - OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $HW_MODEL_DESCRIPTION \n Current: $arm_freq_value MHz ARM | $core_freq_value MHz core | $sdram_freq_value MHz SDRAM | $over_voltage_value overvolt" --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" 13 75 4 \ + OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $G_HW_MODEL_DESCRIPTION \n Current: $arm_freq_value MHz ARM | $core_freq_value MHz core | $sdram_freq_value MHz SDRAM | $over_voltage_value overvolt" --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" 13 75 4 \ "none" " 900 MHz ARM | 250 MHz core | 450 MHz SDRAM | 0 overvolt" \ "low" "1000 MHz ARM | 250 MHz core | 450 MHz SDRAM | 3 overvolt" \ "med" "1000 MHz ARM | 500 MHz core | 450 MHz SDRAM | 5 overvolt" \ @@ -4314,9 +4314,9 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ esac #Overclocking Pi3 - elif (( $HW_MODEL == 3 )); then + elif (( $G_HW_MODEL == 3 )); then - OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $HW_MODEL_DESCRIPTION \n Current: $arm_freq_value MHz ARM | $core_freq_value MHz core | $sdram_freq_value MHz SDRAM | $over_voltage_value overvolt" --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" 13 75 4 \ + OPTION=$(whiptail --title "$WHIP_TITLE" --menu " Hardware : $G_HW_MODEL_DESCRIPTION \n Current: $arm_freq_value MHz ARM | $core_freq_value MHz core | $sdram_freq_value MHz SDRAM | $over_voltage_value overvolt" --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" 13 75 4 \ "none" "1200 MHz ARM | 400 MHz core | 450 MHz SDRAM | 0 overvolt" \ "low" "1300 MHz ARM | 400 MHz core | 450 MHz SDRAM | 3 overvolt" \ "med" "1325 MHz ARM | 400 MHz core | 450 MHz SDRAM | 4 overvolt" \ @@ -4404,7 +4404,7 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ fi # - RPi, low power mode (PSU noise ripple reduction): https://github.com/Fourdee/DietPi/issues/757 - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then local current_cpu_governor=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_governor=' | sed 's/.*=//') local hdmi_output=$(cat /DietPi/dietpi.txt | grep -m1 'rpi_hdmi_output=' | sed 's/.*=//') @@ -4462,17 +4462,17 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ # - Global: # RPI, none disables HDMI aswell. - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then whiptail_menu_array+=("none" "Disables HDMI + 3.5mm Analogue") # NanoPi M2/M3, BPi Pro, OPi Zero - elif (( $HW_MODEL == 32 || $HW_MODEL == 51 || $HW_MODEL == 61 || $HW_MODEL == 62 )); then + elif (( $G_HW_MODEL == 32 || $G_HW_MODEL == 51 || $G_HW_MODEL == 61 || $G_HW_MODEL == 62 )); then whiptail_menu_array+=("default" "3.5mm Analogue") # Native PC | List available - elif (( $HW_MODEL == 21 )); then + elif (( $G_HW_MODEL == 21 )); then whiptail_menu_array+=("default" "HW:0,0") @@ -4515,7 +4515,7 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ fi # - RPI - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then whiptail_menu_array+=("rpi-bcm2835" "Onboard: HDMI (if plugged in, else 3.5mm)") whiptail_menu_array+=("rpi-bcm2835-3.5mm" "Onboard: 3.5mm forced output") @@ -4542,38 +4542,38 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ whiptail_menu_array+=("rpi-dac" "Soekris DAM1021 (pcm1794a)") # - C1/C2 - elif (( $HW_MODEL == 10 || $HW_MODEL == 12 )); then + elif (( $G_HW_MODEL == 10 || $G_HW_MODEL == 12 )); then whiptail_menu_array+=("odroid-hifishield-plus" "Odroid HiFi Shield 1/Plus") whiptail_menu_array+=("odroid-hifishield-2" "Odroid HiFi Shield 2") # - h2+ | OPi Zero - elif (( $HW_MODEL == 32 )); then + elif (( $G_HW_MODEL == 32 )); then whiptail_menu_array+=("h2-hdmi" "HDMI") # - Rock64 - elif (( $HW_MODEL == 43 )); then + elif (( $G_HW_MODEL == 43 )); then whiptail_menu_array+=("rock64-analogue" "3.5MM") # NanoPi M2/M3 - elif (( $HW_MODEL == 61 || $HW_MODEL == 62 )); then + elif (( $G_HW_MODEL == 61 || $G_HW_MODEL == 62 )); then whiptail_menu_array+=("s5pxx18-hdmi" "HDMI") # - H3 - elif (( $HW_CPUID == 1 )); then + elif (( $G_HW_CPUID == 1 )); then whiptail_menu_array+=("H3-analogue" "3.5mm analogue") # - H5 - # elif (( $HW_CPUID == 2 )); then + # elif (( $G_HW_CPUID == 2 )); then # whiptail_menu_array+=("H5-analogue" "3.5mm analogue") # - Sparky - elif (( $HW_MODEL == 70 )); then + elif (( $G_HW_MODEL == 70 )); then whiptail_menu_array+=("snd-soc-allo-piano-dac" "Allo Piano DAC") whiptail_menu_array+=("snd-soc-allo-piano-dac-plus" "Allo Piano DAC 2.1") @@ -4581,7 +4581,7 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ whiptail_menu_array+=("allo-cheapo-optical" "Allo Cheapo (Optical output)") # - Asus tb - elif (( $HW_MODEL == 100 )); then + elif (( $G_HW_MODEL == 100 )); then whiptail_menu_array+=("asus-tb-analogue" "3.5mm analogue") @@ -4681,15 +4681,15 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ #install stress if (( ! $(dpkg --get-selections | grep -ci -m1 '^stress') )); then - dietpi-notify 2 'Installing Stress' - dietpi-notify 2 'Please wait...' + G_DIETPI-NOTIFY 2 'Installing Stress' + G_DIETPI-NOTIFY 2 'Please wait...' - AGI stress + G_AGI stress fi - dietpi-notify 3 Stress_Test "Running stress test for $STRESS_TEST_DURATION seconds" - dietpi-notify 2 'To terminate, type: killall -w stress' + G_DIETPI-NOTIFY 3 Stress_Test "Running stress test for $STRESS_TEST_DURATION seconds" + G_DIETPI-NOTIFY 2 'To terminate, type: killall -w stress' local start_time=$(date) local start_time_epoch=$(date +%s) @@ -4768,8 +4768,8 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ - Max Temp : $STRESS_TEST_RESULTS_TEMP_MAX 'c - log : $fp_log" - dietpi-notify 0 'Stress Test Completed' - dietpi-notify 2 "$output_string" + G_DIETPI-NOTIFY 0 'Stress Test Completed' + G_DIETPI-NOTIFY 2 "$output_string" whiptail --title "$WHIP_TITLE" --msgbox "Stress test results:\n$output_string" --backtitle "$WHIP_BACKTITLE" 14 65 @@ -4960,7 +4960,7 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ ) # - Raspbian - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then whiptail_menu_array+=("http://mirrordirector.raspbian.org/raspbian" "Global") whiptail_menu_array+=("https://www.mirrorservice.org/sites/archive.raspbian.org/raspbian" "Global (https)") @@ -5000,9 +5000,9 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ /DietPi/dietpi/func/dietpi-set_software apt-mirror $OPTION # - test it - dietpi-notify 2 "Updating Apt, please wait..." + G_DIETPI-NOTIFY 2 "Updating Apt, please wait..." - AGUP + G_AGUP local exit_code=$? if (( $exit_code != 0 )); then @@ -5347,7 +5347,7 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - if (( $DIETPI_INSTALL_STAGE >= 0 )); then + if (( $G_DIETPI_INSTALL_STAGE >= 0 )); then #Start DietPi-Config while (( $TARGETMENUID > -1 )); do diff --git a/dietpi/dietpi-cpu_set b/dietpi/dietpi-cpu_set index 6e89606903..c1c968ff57 100644 --- a/dietpi/dietpi-cpu_set +++ b/dietpi/dietpi-cpu_set @@ -16,11 +16,11 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER + G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- #Exit path for VM - if (( $HW_MODEL == 20 )); then + if (( $G_HW_MODEL == 20 )); then echo -e "\nNotice: CPU Governors are not available for VM.\n" exit @@ -36,7 +36,7 @@ #Check if target Gov is available on system. if (( ! $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors | grep -ci -m1 "$CPU_GOVERNOR") )); then - dietpi-notify 1 "CPU gov: $CPU_GOVERNOR, not supported by kernel" + G_DIETPI-NOTIFY 1 "CPU gov: $CPU_GOVERNOR, not supported by kernel" if (( $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors | grep -ci -m1 'ondemand') )); then @@ -52,7 +52,7 @@ fi - dietpi-notify 2 "Switching to CPU gov: $CPU_GOVERNOR" + G_DIETPI-NOTIFY 2 "Switching to CPU gov: $CPU_GOVERNOR" # - Update dietpi.txt sed -i "/^cpu_governor=/c\cpu_governor=$CPU_GOVERNOR" /DietPi/dietpi.txt @@ -86,7 +86,7 @@ done - dietpi-notify 2 "Setting CPU max freq: $CPU_MAX_FREQ MHz" + G_DIETPI-NOTIFY 2 "Setting CPU max freq: $CPU_MAX_FREQ MHz" fi @@ -103,7 +103,7 @@ done - dietpi-notify 2 "Setting CPU min freq: $CPU_MIN_FREQ MHz" + G_DIETPI-NOTIFY 2 "Setting CPU min freq: $CPU_MIN_FREQ MHz" fi @@ -115,7 +115,7 @@ #Set hispeed_load, if available on system (eg: XU4 kernel lacks this feature) if [ -f /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load ]; then - dietpi-notify 2 "Setting go_hispeed_load: $cpu_throttle_up_percent %" + G_DIETPI-NOTIFY 2 "Setting go_hispeed_load: $cpu_throttle_up_percent %" echo "$cpu_throttle_up_percent" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load fi @@ -126,9 +126,9 @@ local cpu_ondemand_sampling_rate=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_ondemand_sampling_rate' | sed 's/.*=//') local cpu_ondemand_sampling_down_factor=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_ondemand_sampling_down_factor' | sed 's/.*=//') - dietpi-notify 2 "Setting up_threshold: $cpu_throttle_up_percent %" - dietpi-notify 2 "Setting sampling_rate: $cpu_ondemand_sampling_rate microseconds" - dietpi-notify 2 "Setting sampling_down_factor: $cpu_ondemand_sampling_down_factor" + G_DIETPI-NOTIFY 2 "Setting up_threshold: $cpu_throttle_up_percent %" + G_DIETPI-NOTIFY 2 "Setting sampling_rate: $cpu_ondemand_sampling_rate microseconds" + G_DIETPI-NOTIFY 2 "Setting sampling_down_factor: $cpu_ondemand_sampling_down_factor" #Check for different possible locations # All @@ -156,7 +156,7 @@ cpu_throttle_up_percent=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_usage_throttle_up' | sed 's/.*=//') #XU3/4 different path (must apply to each core) - if (( $HW_MODEL == 11 )); then + if (( $G_HW_MODEL == 11 )); then for ((i=$input_core_start; i<$input_core_end; i++)) do @@ -175,14 +175,14 @@ # Main Loop #///////////////////////////////////////////////////////////////////////////////////// #----------------------------------------------------------------------------------- - dietpi-notify 3 DietPi-Cpu_Set "Applying CPU gov" + G_DIETPI-NOTIFY 3 DietPi-Cpu_Set "Applying CPU gov" #----------------------------------------------------------------------------------- Check_GPU_Gov_Available #Apply CPU0 gov to all cores (if required) - Apply_CPU_Gov "$CPU_GOVERNOR" 0 $HW_CPU_CORES + Apply_CPU_Gov "$CPU_GOVERNOR" 0 $G_HW_CPU_CORES - dietpi-notify 0 "CPU gov applied: $CPU_GOVERNOR\n" + G_DIETPI-NOTIFY 0 "CPU gov applied: $CPU_GOVERNOR\n" #----------------------------------------------------------------------------------- exit diff --git a/dietpi/dietpi-cpuinfo b/dietpi/dietpi-cpuinfo index 988a23bb32..edcd2c0106 100644 --- a/dietpi/dietpi-cpuinfo +++ b/dietpi/dietpi-cpuinfo @@ -27,11 +27,11 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER + G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- #Exit path for VM - if (( $HW_MODEL == 20 )); then + if (( $G_HW_MODEL == 20 )); then echo -e "\nNotice: CPU information is not available for VM.\n" exit @@ -118,7 +118,7 @@ if [ -f "${aFP_TEMPERATURE[$i]}" ]; then # Sparky/asus, special case: - if (( $HW_MODEL == 70 || $HW_MODEL == 100 || $HW_MODEL == 110 )); then + if (( $G_HW_MODEL == 70 || $G_HW_MODEL == 100 || $G_HW_MODEL == 110 )); then CPU_TEMP_CURRENT=$(cat /sys/class/thermal/thermal_zone1/temp) @@ -134,11 +134,11 @@ # NanoPi M3 # H3 3.x # H2+ 3.x - if (( ( $HW_MODEL >= 40 && $HW_MODEL <= 42 ) || - $HW_MODEL == 61 || - $HW_MODEL == 62 || - ( $HW_CPUID == 1 && $(uname -r | grep -ci -m1 '^3.') ) || - ( $HW_MODEL == 32 && $(uname -r | grep -ci -m1 '^3.') ) )); then + if (( ( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 ) || + $G_HW_MODEL == 61 || + $G_HW_MODEL == 62 || + ( $G_HW_CPUID == 1 && $(uname -r | grep -ci -m1 '^3.') ) || + ( $G_HW_MODEL == 32 && $(uname -r | grep -ci -m1 '^3.') ) )); then echo -e "Do nothing" &> /dev/null @@ -256,7 +256,7 @@ echo -e "" #CPU scaling may bump up with script - dietpi-notify 2 'CPU current frequency, may be affected by this script, due to the processing required to run it.\n' + G_DIETPI-NOTIFY 2 'CPU current frequency, may be affected by this script, due to the processing required to run it.\n' } diff --git a/dietpi/dietpi-cron b/dietpi/dietpi-cron index c61d2c2659..4e48a42944 100644 --- a/dietpi/dietpi-cron +++ b/dietpi/dietpi-cron @@ -17,7 +17,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER + G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 535adc698b..c64c8bb6d2 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -33,7 +33,7 @@ if [ -f /DietPi/dietpi/func/dietpi-globals ]; then . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER + G_CHECK_ROOT_USER fi #Import DietPi-Globals --------------------------------------------------------------- @@ -118,7 +118,7 @@ init=0 - dietpi-notify 2 "Detecting drives, please wait..." + G_DIETPI-NOTIFY 2 "Detecting drives, please wait..." #Copy FSTAB to ram, faster exe cp /etc/fstab "$FP_TEMP_FSTAB" @@ -160,7 +160,7 @@ aDRIVE_MOUNT_TARGET[$i]=$drive_mount_target_dev aDRIVE_ISAVAILABLE[$i]=1 - dietpi-notify 2 "Detected /dev mount: ${aDRIVE_MOUNT_SOURCE[$i]} > ${aDRIVE_MOUNT_TARGET[$i]}" + G_DIETPI-NOTIFY 2 "Detected /dev mount: ${aDRIVE_MOUNT_SOURCE[$i]} > ${aDRIVE_MOUNT_TARGET[$i]}" # - check UUID elif [ -n "$drive_mount_target_uuid" ]; then @@ -170,7 +170,7 @@ aDRIVE_ISAVAILABLE[$i]=1 aDRIVE_ISUUIDMOUNT[$i]=1 - dietpi-notify 2 "Detected UUID mount: ${aDRIVE_MOUNT_SOURCE[$i]} > ${aDRIVE_MOUNT_TARGET[$i]}" + G_DIETPI-NOTIFY 2 "Detected UUID mount: ${aDRIVE_MOUNT_SOURCE[$i]} > ${aDRIVE_MOUNT_TARGET[$i]}" # - check PARTUUID elif [ -n "$drive_mount_target_partuuid" ]; then @@ -180,14 +180,14 @@ aDRIVE_ISAVAILABLE[$i]=1 aDRIVE_ISUUIDMOUNT[$i]=1 - dietpi-notify 2 "Detected PARTUUID mount: ${aDRIVE_MOUNT_SOURCE[$i]} > ${aDRIVE_MOUNT_TARGET[$i]}" + G_DIETPI-NOTIFY 2 "Detected PARTUUID mount: ${aDRIVE_MOUNT_SOURCE[$i]} > ${aDRIVE_MOUNT_TARGET[$i]}" # - Active drive mount does not exist in fstab, create one elif [ -n "${aDRIVE_UUID[$i]}" ]; then #Ignore master partition tables / drives with no UUID aDRIVE_MOUNT_TARGET[$i]="/mnt/${aDRIVE_UUID[$i]}" - dietpi-notify 2 "Creating UUID fstab entry: ${aDRIVE_MOUNT_SOURCE[$i]}" + G_DIETPI-NOTIFY 2 "Creating UUID fstab entry: ${aDRIVE_MOUNT_SOURCE[$i]}" # Always check for rootFS device and set target manually # - EG: RPi, rootFS source is reported as /dev/root in df scrapes. @@ -195,12 +195,12 @@ aDRIVE_MOUNT_TARGET[$i]='/' - dietpi-notify 2 " - Drive is currently mounted, using existing mount location: ${aDRIVE_MOUNT_TARGET[$i]}" + G_DIETPI-NOTIFY 2 " - Drive is currently mounted, using existing mount location: ${aDRIVE_MOUNT_TARGET[$i]}" # Check if the drive is already mounted (but not set in fstab) and use existing mount target elif (( $(df -P | grep -ci -m1 "${aDRIVE_MOUNT_SOURCE[$i]}[[:space:]]") )); then - dietpi-notify 2 " - Drive is currently mounted, using existing mount location: ${aDRIVE_MOUNT_TARGET[$i]}" + G_DIETPI-NOTIFY 2 " - Drive is currently mounted, using existing mount location: ${aDRIVE_MOUNT_TARGET[$i]}" aDRIVE_MOUNT_TARGET[$i]=$(df -P | grep -m1 "${aDRIVE_MOUNT_SOURCE[$i]}[[:space:]]" | awk '{print $NF}') @@ -230,7 +230,7 @@ if (( ${aDRIVE_ISAVAILABLE[$i]} )) && [ ! -d "${aDRIVE_MOUNT_TARGET[$i]}" ]; then - dietpi-notify 2 "Creating mount folder for ${aDRIVE_MOUNT_TARGET[$i]}" + G_DIETPI-NOTIFY 2 "Creating mount folder for ${aDRIVE_MOUNT_TARGET[$i]}" mkdir -p "${aDRIVE_MOUNT_TARGET[$i]}" fi @@ -246,7 +246,7 @@ #--------------------------------------------------------------- - dietpi-notify 2 "Processing drive information, please wait..." + G_DIETPI-NOTIFY 2 "Processing drive information, please wait..." #ROOTFS location FP_ROOTFS_SOURCE=$(df -P | grep -m1 '[[:space:]]/$' | awk '{print $1}') @@ -337,13 +337,13 @@ INDEX_DRIVE_BEING_EDITED=$i - dietpi-notify 2 "RootFS is currently set to R/O. $PROGRAM_NAME requires R/W access." + G_DIETPI-NOTIFY 2 "RootFS is currently set to R/O. $PROGRAM_NAME requires R/W access." whiptail --title "RootFS is R/O" --yesno "RootFS is currently set to 'Read Only'. DietPi-Drive_Manager requires 'Read Write' access to function.\n\nWould you like to renable 'Read Write' access on RootFS?" --backtitle "$PROGRAM_NAME" --defaultno 14 75 if (( $? == 0 )); then Toggle_WriteMode - dietpi-notify 0 "RootFS R/W now enabled." + G_DIETPI-NOTIFY 0 "RootFS R/W now enabled." # reinit init=1 @@ -352,8 +352,8 @@ /DietPi/dietpi/dietpi-services start - dietpi-notify 0 "RootFS currently set to R/O." - dietpi-notify 2 "Please run 'dietpi-drive_manager' again, if you want to re-enable RootFS R/W." + G_DIETPI-NOTIFY 0 "RootFS currently set to R/O." + G_DIETPI-NOTIFY 2 "Please run 'dietpi-drive_manager' again, if you want to re-enable RootFS R/W." Destroy exit @@ -367,7 +367,7 @@ fi #Obtain actual user data location on disk (follows symlinks) - FP_USERDATA_CURRENT=$(readlink -f $FP_DIETPI_USERDATA) + FP_USERDATA_CURRENT=$(readlink -f $G_FP_DIETPI_USERDATA) done @@ -409,7 +409,7 @@ fi - dietpi-notify 2 "Partition table target: $parition_table_type" + G_DIETPI-NOTIFY 2 "Partition table target: $parition_table_type" parted -s "$drivepath_no_partitions" mklabel "$parition_table_type" parted -a optimal "$drivepath_no_partitions" mkpart primary 0% 100% @@ -509,17 +509,17 @@ # - install rsync if (( ! $(dpkg --get-selections | grep -ci -m1 '^rsync[[[:space:]]') )); then - dietpi-notify 2 "Installing Rsync, please wait...\n" + G_DIETPI-NOTIFY 2 "Installing Rsync, please wait...\n" sleep 1 - AGI rsync + G_AGI rsync fi rsync -paxv --exclude '/lost+found' / "${aDRIVE_MOUNT_TARGET[$INDEX_DRIVE_BEING_EDITED]}"/ if (( $? != 0 )); then - dietpi-notify 1 'Rsync has failed, RootFS transfer has been aborted.' + G_DIETPI-NOTIFY 1 'Rsync has failed, RootFS transfer has been aborted.' # revert FSTAB changes cp /etc/fstab.bak /etc/fstab @@ -529,7 +529,7 @@ fi #RPi | cmdline.txt - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then # find current root= and replace local rootfs_current=$(awk '{for(i=1;i<=NF;i++) {print $i} }' /boot/cmdline.txt | grep -m1 'root=') @@ -547,7 +547,7 @@ sed -i "s#$rootfstype_current#rootfstype=${aDRIVE_FSTYPE[$INDEX_DRIVE_BEING_EDITED]}#g" /boot/cmdline.txt #C1/C2/XU4 | /DietPi/boot.ini - elif (( $HW_MODEL == 10 || $HW_MODEL == 11 || $HW_MODEL == 12 )); then + elif (( $G_HW_MODEL == 10 || $G_HW_MODEL == 11 || $G_HW_MODEL == 12 )); then # find current root= to replace local rootfs_current=$(awk '{for(i=1;i<=NF;i++) {print $i} }' /DietPi/boot.ini | grep -m1 'root=' | sed 's/\"//') @@ -568,7 +568,7 @@ # global min limit (MB) local free_space_limit=500 - dietpi-notify 2 'Checking available free space on RootFS, please wait...' + G_DIETPI-NOTIFY 2 'Checking available free space on RootFS, please wait...' #Find rootfs for ((i=0; i<$MAX_DRIVES; i++)) @@ -587,15 +587,15 @@ whiptail --title "Insufficient free space" --msgbox "$message" --backtitle "$PROGRAM_NAME" 14 70 - dietpi-notify 1 "Insufficient free space on RootFS. $free_space_current MB available, $free_space_limit MB required" - dietpi-notify 1 'Aborting' + G_DIETPI-NOTIFY 1 "Insufficient free space on RootFS. $free_space_current MB available, $free_space_limit MB required" + G_DIETPI-NOTIFY 1 'Aborting' # export EXIT_CODE=1 else - dietpi-notify 0 "$free_space_current MB available, $free_space_limit MB required" + G_DIETPI-NOTIFY 0 "$free_space_current MB available, $free_space_limit MB required" fi @@ -615,23 +615,23 @@ # echo 0 > "$fp_test_file" # if (( $? != 0 )); then - # dietpi-notify 1 "RootFS is currently set to R/O." + # G_DIETPI-NOTIFY 1 "RootFS is currently set to R/O." # EXIT_CODE=1 # fi # rm "$fp_test_file" &> /dev/null - dietpi-notify 2 "Checking RootFS R/W access. Please wait..." + G_DIETPI-NOTIFY 2 "Checking RootFS R/W access. Please wait..." if (( $(mount | grep -m1 '[[:space:]]/[[:space:]]' | grep -ci -m1 '(ro,') )); then - dietpi-notify 1 "RootFS is currently set to R/O." - dietpi-notify 2 "DietPi requires RootFS R/W access. Please run 'dietpi-drive_manager' to re-enable.\n" + G_DIETPI-NOTIFY 1 "RootFS is currently set to R/O." + G_DIETPI-NOTIFY 2 "DietPi requires RootFS R/W access. Please run 'dietpi-drive_manager' to re-enable.\n" EXIT_CODE=1 else - dietpi-notify 0 "RootFS R/W access.\n" + G_DIETPI-NOTIFY 0 "RootFS R/W access.\n" fi @@ -737,7 +737,7 @@ # - User data local userdata_location_text="RootFS ($FP_USERDATA_CURRENT)" - if [ "$FP_USERDATA_CURRENT" != "$FP_DIETPI_USERDATA" ]; then + if [ "$FP_USERDATA_CURRENT" != "$G_FP_DIETPI_USERDATA" ]; then userdata_location_text="USB ($FP_USERDATA_CURRENT)" @@ -847,7 +847,7 @@ fi if ( [ "${aDRIVE_MOUNT_TARGET[$INDEX_DRIVE_BEING_EDITED]}" != "/" ] && [[ $FP_USERDATA_CURRENT == "${aDRIVE_MOUNT_TARGET[$INDEX_DRIVE_BEING_EDITED]}"* ]] ) || #off rootfs - ( [ "${aDRIVE_MOUNT_TARGET[$INDEX_DRIVE_BEING_EDITED]}" = "/" ] && [ "$FP_USERDATA_CURRENT" = "$FP_DIETPI_USERDATA" ] ); then #on rootfs + ( [ "${aDRIVE_MOUNT_TARGET[$INDEX_DRIVE_BEING_EDITED]}" = "/" ] && [ "$FP_USERDATA_CURRENT" = "$G_FP_DIETPI_USERDATA" ] ); then #on rootfs whiptail_menu_array+=("User data" ": Your user data is currently located on this drive") partition_contains_userdata=1 @@ -901,7 +901,7 @@ #Transfer RootFS if [[ ${aDRIVE_MOUNT_SOURCE[$INDEX_DRIVE_BEING_EDITED]} != $FP_ROOTFS_SOURCE ]] && - (( $HW_MODEL < 10 || $HW_MODEL == 10 || $HW_MODEL == 11 || $HW_MODEL == 12 )); then + (( $G_HW_MODEL < 10 || $G_HW_MODEL == 10 || $G_HW_MODEL == 11 || $G_HW_MODEL == 12 )); then whiptail_menu_array+=("Transfer RootFS" ": Transfer RootFS to this drive") @@ -1168,29 +1168,29 @@ if (( $OPTION == 3 && ! $(dpkg --get-selections | grep -ci -m1 '^hfsutils') )); then - dietpi-notify 2 "Installing additional packages for HFS+ support, please wait..." - AGI hfsplus hfsprogs hfsutils + G_DIETPI-NOTIFY 2 "Installing additional packages for HFS+ support, please wait..." + G_AGI hfsplus hfsprogs hfsutils # - btrfs install packages elif (( $OPTION == 4 && ! $(dpkg --get-selections | grep -ci -m1 '^btrfs-tools') )); then - dietpi-notify 2 "Installing additional packages for BTRFS support, please wait..." - AGI btrfs-tools + G_DIETPI-NOTIFY 2 "Installing additional packages for BTRFS support, please wait..." + G_AGI btrfs-tools # - f2fs install packages elif (( $OPTION == 5 && ! $(dpkg --get-selections | grep -ci -m1 '^f2fs-tools') )); then - dietpi-notify 2 "Installing additional packages for F2FS support, please wait..." - AGI f2fs-tools + G_DIETPI-NOTIFY 2 "Installing additional packages for F2FS support, please wait..." + G_AGI f2fs-tools # - exfat install packages elif (( $OPTION == 6 && ! $(dpkg --get-selections | grep -ci -m1 '^exfat-utils') )); then - dietpi-notify 2 "Installing additional packages for exFAT support, please wait..." - AGI exfat-utils exfat-fuse + G_DIETPI-NOTIFY 2 "Installing additional packages for exFAT support, please wait..." + G_AGI exfat-utils exfat-fuse fi @@ -1257,7 +1257,7 @@ local drive_manager_selection="$OPTION" - dietpi-notify 0 "Drive mount selected: $drive_manager_selection" + G_DIETPI-NOTIFY 0 "Drive mount selected: $drive_manager_selection" echo -e "$drive_manager_selection" > "$FP_DRIVE_MANAGER_SELECTION" fi @@ -1342,9 +1342,9 @@ _EOF_ Menu_Select_Mount_Location #Prevent VM image from running core script - elif (( $HW_MODEL == 20 )); then + elif (( $G_HW_MODEL == 20 )); then - dietpi-notify 1 "$PROGRAM_NAME is not currently supported on VM images" + G_DIETPI-NOTIFY 1 "$PROGRAM_NAME is not currently supported on VM images" #Drive Manager else diff --git a/dietpi/dietpi-launcher b/dietpi/dietpi-launcher index 3d25609873..61da70532a 100644 --- a/dietpi/dietpi-launcher +++ b/dietpi/dietpi-launcher @@ -16,8 +16,8 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER - CHECK_ROOTFS_RW + G_CHECK_ROOT_USER + G_CHECK_ROOTFS_RW #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-letsencrypt b/dietpi/dietpi-letsencrypt index 46faa97c05..0dbffd13ad 100644 --- a/dietpi/dietpi-letsencrypt +++ b/dietpi/dietpi-letsencrypt @@ -25,8 +25,8 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER - CHECK_ROOTFS_RW + G_CHECK_ROOT_USER + G_CHECK_ROOTFS_RW #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -35,7 +35,7 @@ DP_LOGFILE="/var/log/dietpi-letsencrypt.log" DP_MONTHLY_CRON="/etc/cron.monthly/dietpi-letsencrypt" DP_LETSENCRYPT_BINARY="/usr/bin/certbot" - if (( $DISTRO < 4 )); then + if (( $G_DISTRO < 4 )); then DP_LETSENCRYPT_BINARY="/etc/certbot_scripts/certbot-auto" fi DP_WEBSERVER_INDEX=0 #0=apache2 1=lighttpd 2=nginx 3=minio @@ -52,7 +52,7 @@ Run_Lets_Encrypt(){ - dietpi-notify 3 "$PROGRAM_NAME" "Running cert" + G_DIETPI-NOTIFY 3 "$PROGRAM_NAME" "Running cert" #Conditions that must be met before allowing run local run_conditions_met=1 @@ -63,28 +63,28 @@ if (( $(ps aux | grep -ci -m1 '[a]pache') )); then DP_WEBSERVER_INDEX=0 - dietpi-notify 0 "Apache2 webserver detected" - if (( $DISTRO >= 4 )); then + G_DIETPI-NOTIFY 0 "Apache2 webserver detected" + if (( $G_DISTRO >= 4 )); then DP_LETSENCRYPT_BINARY="$DP_LETSENCRYPT_BINARY --apache" fi elif (( $(ps aux | grep -ci -m1 '[l]ighttpd') )); then DP_WEBSERVER_INDEX=1 - dietpi-notify 0 "Lighttpd webserver detected" + G_DIETPI-NOTIFY 0 "Lighttpd webserver detected" elif (( $(ps aux | grep -ci -m1 '[n]ginx') )); then DP_WEBSERVER_INDEX=2 - dietpi-notify 0 "Nginx webserver detected" - if (( $DISTRO >= 4 )); then + G_DIETPI-NOTIFY 0 "Nginx webserver detected" + if (( $G_DISTRO >= 4 )); then DP_LETSENCRYPT_BINARY="$DP_LETSENCRYPT_BINARY --nginx" fi elif (( $(ps aux | grep -ci -m1 '[m]inio') )); then DP_WEBSERVER_INDEX=3 - dietpi-notify 0 "Minio S3 server detected" + G_DIETPI-NOTIFY 0 "Minio S3 server detected" else @@ -259,7 +259,7 @@ _EOF_ #------------------------------------------------------------------------------------------------------ #ALL | Create cron job - if (( $LETSENCRYPT_AUTORENEW && $DISTRO < 4 )); then + if (( $LETSENCRYPT_AUTORENEW && $G_DISTRO < 4 )); then cat << _EOF_ > "$DP_MONTHLY_CRON" #!/bin/bash @@ -468,8 +468,8 @@ _EOF_ #Menu if (( $INPUT == 0 )); then - dietpi-notify 1 "Certbot binary not found ( $DP_LETSENCRYPT_BINARY )" - dietpi-notify 2 "Please install Certbot with DietPi-Software before running this program." + G_DIETPI-NOTIFY 1 "Certbot binary not found ( $DP_LETSENCRYPT_BINARY )" + G_DIETPI-NOTIFY 2 "Please install Certbot with DietPi-Software before running this program." read -p "Press any key to continue....." else diff --git a/dietpi/dietpi-logclear b/dietpi/dietpi-logclear index a2777965c1..66aa24a249 100644 --- a/dietpi/dietpi-logclear +++ b/dietpi/dietpi-logclear @@ -25,7 +25,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER + G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- #//////////////////////////////////////////////////////////////// @@ -124,7 +124,7 @@ fi - dietpi-notify 2 'Clearing log entries for PiHole, that are not from today, please wait...' + G_DIETPI-NOTIFY 2 'Clearing log entries for PiHole, that are not from today, please wait...' sed -i '/'"$month_day_today"'/!d' /var/log/pihole.log pihole_restart_required=1 @@ -137,7 +137,7 @@ # - 5mb should be more than enough for 1+ days of pihole logs if (( $FILESIZE_BYTES >= 5242880 )); then - dietpi-notify 2 "${ARRAY_LOG_FILEPATH[$i]} has exceeded 5MB, clearing, please wait..." + G_DIETPI-NOTIFY 2 "${ARRAY_LOG_FILEPATH[$i]} has exceeded 5MB, clearing, please wait..." # RAMlog mode 2: if (( $INPUT == 0 )); then @@ -162,7 +162,7 @@ #restart PiHole if we modified the log file if (( $pihole_restart_required )); then - dietpi-notify 2 'PiHole logs have been changed, restarting, please wait...' + G_DIETPI-NOTIFY 2 'PiHole logs have been changed, restarting, please wait...' systemctl stop pihole-FTL systemctl stop dnsmasq sleep 1 @@ -238,7 +238,7 @@ #//////////////////////////////////////////////////////////////// #---------------------------------------------------------------- - dietpi-notify 3 DietPi-Logclear "Welcome" + G_DIETPI-NOTIFY 3 DietPi-Logclear "Welcome" #---------------------------------------------------------------- #How to use print. if (( $INPUT == -1 )); then diff --git a/dietpi/dietpi-morsecode b/dietpi/dietpi-morsecode index bba958d757..38c8065c1f 100644 --- a/dietpi/dietpi-morsecode +++ b/dietpi/dietpi-morsecode @@ -29,7 +29,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER + G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-obtain_hw_model b/dietpi/dietpi-obtain_hw_model index 35f1bdcb83..748377abb8 100644 --- a/dietpi/dietpi-obtain_hw_model +++ b/dietpi/dietpi-obtain_hw_model @@ -12,75 +12,75 @@ # - Called from /DietPi/dietpi/boot # # In DietPi-Software: - # MAX_HW_MODEL=64 #This needs to match highest HW_MODEL value in dietpi-obtain_hw_model - # MAX_HW_ARCH=10 #This needs to match highest HW_ARCH value in dietpi-obtain_hw_model + # MAX_G_HW_MODEL=64 #This needs to match highest G_HW_MODEL value in dietpi-obtain_hw_model + # MAX_G_HW_ARCH=10 #This needs to match highest G_HW_ARCH value in dietpi-obtain_hw_model # # - Line1 - - # HW_MODEL 110 RoseapplePi - # 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 - # HW_MODEL 64 NanoPi NEO Air - # HW_MODEL 63 NanoPi M1/T1 - # HW_MODEL 62 NanoPi M3/T3 - # HW_MODEL 61 NanoPi M2/T2 - # HW_MODEL 60 NanoPi Neo - # HW_MODEL 51 BananaPi Pro (Lemaker) - # HW_MODEL 50 BananaPi M2+ (sinovoip) - # HW_MODEL 43 Rock64 - # HW_MODEL 42 Pine A64+ (2048mb) - # HW_MODEL 41 Pine A64+ (1024mb) - # HW_MODEL 40 Pine A64 (512mb) - # HW_MODEL 38 OrangePi PC 2 - # HW_MODEL 37 OrangePi Prime - # HW_MODEL 36 OrangePi Win - # HW_MODEL 35 OrangePi Zero Plus 2 (H3/H5) - # HW_MODEL 34 OrangePi Plus - # HW_MODEL 33 OrangePi Lite - # HW_MODEL 32 OrangePi Zero (H2+) - # HW_MODEL 31 OrangePi One - # HW_MODEL 30 OrangePi PC - # HW_MODEL 21 x86_64 native (PC) - # HW_MODEL 20 VM x64 (VMware VirtualBox) - # HW_MODEL 13 oDroid U3 - # HW_MODEL 12 oDroid C2 - # HW_MODEL 11 oDroid XU3/4 - # HW_MODEL 10 oDroid C1 - # HW_MODEL 3 Raspberry Pi 3 - # HW_MODEL 2 Raspberry Pi 2 - # HW_MODEL 1 Raspberry Pi 1/Zero (512mb) - # HW_MODEL 0 Raspberry Pi 1 (256mb) + # G_HW_MODEL 110 RoseapplePi + # G_HW_MODEL 100 Asus Tinker Board + # G_HW_MODEL 90 A20-OLinuXino-MICRO + # G_HW_MODEL 80 Cubieboard 3 + # G_HW_MODEL 71 Beagle Bone Black + # G_HW_MODEL 70 Sparky SBC + # G_HW_MODEL 66 NanoPi M1 Plus + # G_HW_MODEL 65 NanoPi NEO 2 + # G_HW_MODEL 64 NanoPi NEO Air + # G_HW_MODEL 63 NanoPi M1/T1 + # G_HW_MODEL 62 NanoPi M3/T3 + # G_HW_MODEL 61 NanoPi M2/T2 + # G_HW_MODEL 60 NanoPi Neo + # G_HW_MODEL 51 BananaPi Pro (Lemaker) + # G_HW_MODEL 50 BananaPi M2+ (sinovoip) + # G_HW_MODEL 43 Rock64 + # G_HW_MODEL 42 Pine A64+ (2048mb) + # G_HW_MODEL 41 Pine A64+ (1024mb) + # G_HW_MODEL 40 Pine A64 (512mb) + # G_HW_MODEL 38 OrangePi PC 2 + # G_HW_MODEL 37 OrangePi Prime + # G_HW_MODEL 36 OrangePi Win + # G_HW_MODEL 35 OrangePi Zero Plus 2 (H3/H5) + # G_HW_MODEL 34 OrangePi Plus + # G_HW_MODEL 33 OrangePi Lite + # G_HW_MODEL 32 OrangePi Zero (H2+) + # G_HW_MODEL 31 OrangePi One + # G_HW_MODEL 30 OrangePi PC + # G_HW_MODEL 21 x86_64 native (PC) + # G_HW_MODEL 20 VM x64 (VMware VirtualBox) + # G_HW_MODEL 13 oDroid U3 + # G_HW_MODEL 12 oDroid C2 + # G_HW_MODEL 11 oDroid XU3/4 + # G_HW_MODEL 10 oDroid C1 + # G_HW_MODEL 3 Raspberry Pi 3 + # G_HW_MODEL 2 Raspberry Pi 2 + # G_HW_MODEL 1 Raspberry Pi 1/Zero (512mb) + # G_HW_MODEL 0 Raspberry Pi 1 (256mb) # - Line2 - - # HW_MODEL_DESCRIPTION + # G_HW_MODEL_DESCRIPTION # - Line3 - - # DISTRO 0 unknown - # DISTRO 1 Debian Wheezy (No longer supported, http://dietpi.com/phpbb/viewtopic.php?f=9&t=432#p1898) - # DISTRO 2 Ubuntu 14.04 (No longer supported, left in for user message during update) - # DISTRO 3 Jessie - # DISTRO 4 Stretch, pulled a muscle! - # DISTRO 5 Buster + # G_DISTRO 0 unknown + # G_DISTRO 1 Debian Wheezy (No longer supported, http://dietpi.com/phpbb/viewtopic.php?f=9&t=432#p1898) + # G_DISTRO 2 Ubuntu 14.04 (No longer supported, left in for user message during update) + # G_DISTRO 3 Jessie + # G_DISTRO 4 Stretch, pulled a muscle! + # G_DISTRO 5 Buster # - Line4 - # RootFS device path (eg: /dev/mmc01) # - Line5 - # UUID # - Line 6 - - # HW_ARCH 10 x86_64 (VM) - # HW_ARCH 3 armv8/arm64 - # HW_ARCH 2 armv7 - # HW_ARCH 1 armv6 - # HW_ARCH 0 unknown + # G_HW_ARCH 10 x86_64 (VM) + # G_HW_ARCH 3 armv8/arm64 + # G_HW_ARCH 2 armv7 + # G_HW_ARCH 1 armv6 + # G_HW_ARCH 0 unknown # - Line 7 - - # HW_ARCH_DESCRIPTION + # G_HW_ARCH_DESCRIPTION # - Line 8 - # IMAGE_ADDITIONAL_CREDITS (eg: ARMbian, Meveric) # - Line 9 - Group CPU's - # HW_CPUID 0 Not set - # HW_CPUID 1 H3 - # HW_CPUID 2 H5 + # G_HW_CPUID 0 Not set + # G_HW_CPUID 1 H3 + # G_HW_CPUID 2 H5 # - Line 10 - Onboard WiFi/BT Index # HW_ONBOARD_WIFI 0 Not set # HW_ONBOARD_WIFI 1 RPi3/ZeroW (BCM43438) @@ -110,15 +110,15 @@ #Obtain Hardware Model index #///////////////////////////////////////////////////////////////////////////////////// - HW_MODEL=0 - HW_MODEL_DESCRIPTION='Unknown Device' - FP_HW_MODEL_INDENTIFIER='/etc/.dietpi_hw_model_identifier' - DISTRO=0 + G_HW_MODEL=0 + G_HW_MODEL_DESCRIPTION='Unknown Device' + FP_G_HW_MODEL_INDENTIFIER='/etc/.dietpi_hw_model_identifier' + G_DISTRO=0 HW_UUID=0 - HW_ARCH=0 - HW_ARCH_DESCRIPTION='unknown' + G_HW_ARCH=0 + G_HW_ARCH_DESCRIPTION='unknown' IMAGE_ADDITIONAL_CREDITS='' - HW_CPUID=0 + G_HW_CPUID=0 HW_ONBOARD_WIFI=0 ROOTFS_DEVICE_PATH=$(df | grep -m1 '/$' | awk '{print $1}') @@ -137,236 +137,236 @@ # *" because 10000002 then it indicates that your Raspberry Pi has been over-volted HW_REVISION_CODE=$(cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}') - HW_MODEL_DESCRIPTION='RPi ' + G_HW_MODEL_DESCRIPTION='RPi ' if [[ "$HW_REVISION_CODE" = *"Beta" ]]; then HW_RELEASE_DATE='Q1 2012' - HW_MODEL_DESCRIPTION+='Beta' + G_HW_MODEL_DESCRIPTION+='Beta' HW_PCB_REVISION_CODE='Unknown' HW_MEMORY_SIZE=256 HW_MANUFACTURER_NAME='Unknown' - HW_MODEL=0 + G_HW_MODEL=0 elif [[ "$HW_REVISION_CODE" = *"0002" ]]; then HW_RELEASE_DATE='Q1 2012' - HW_MODEL_DESCRIPTION+='B' + G_HW_MODEL_DESCRIPTION+='B' HW_PCB_REVISION_CODE='1.0' HW_MEMORY_SIZE=256 HW_MANUFACTURER_NAME='Unknown' - HW_MODEL=0 + G_HW_MODEL=0 elif [[ "$HW_REVISION_CODE" = *"0003" ]]; then HW_RELEASE_DATE='Q3 2012' - HW_MODEL_DESCRIPTION+='B (ECN0001)' + G_HW_MODEL_DESCRIPTION+='B (ECN0001)' HW_PCB_REVISION_CODE='1.0' HW_MEMORY_SIZE=256 HW_MANUFACTURER_NAME='Unknown' - HW_MODEL=0 + G_HW_MODEL=0 elif [[ "$HW_REVISION_CODE" = *"0004" ]]; then HW_RELEASE_DATE='Q3 2012' - HW_MODEL_DESCRIPTION+='B' + G_HW_MODEL_DESCRIPTION+='B' HW_PCB_REVISION_CODE='2.0' HW_MEMORY_SIZE=256 HW_MANUFACTURER_NAME='Sony' - HW_MODEL=0 + G_HW_MODEL=0 elif [[ "$HW_REVISION_CODE" = *"0005" ]]; then HW_RELEASE_DATE='Q4 2012' - HW_MODEL_DESCRIPTION+='B' + G_HW_MODEL_DESCRIPTION+='B' HW_PCB_REVISION_CODE='2.0' HW_MEMORY_SIZE=256 HW_MANUFACTURER_NAME='Qisda' - HW_MODEL=0 + G_HW_MODEL=0 elif [[ "$HW_REVISION_CODE" = *"0006" ]]; then HW_RELEASE_DATE='Q4 2012' - HW_MODEL_DESCRIPTION+='B' + G_HW_MODEL_DESCRIPTION+='B' HW_PCB_REVISION_CODE='2.0' HW_MEMORY_SIZE=256 HW_MANUFACTURER_NAME='Egoman' - HW_MODEL=0 + G_HW_MODEL=0 elif [[ "$HW_REVISION_CODE" = *"0007" ]]; then HW_RELEASE_DATE='Q1 2013' - HW_MODEL_DESCRIPTION+='A' + G_HW_MODEL_DESCRIPTION+='A' HW_PCB_REVISION_CODE='2.0' HW_MEMORY_SIZE=256 HW_MANUFACTURER_NAME='Egoman' - HW_MODEL=0 + G_HW_MODEL=0 elif [[ "$HW_REVISION_CODE" = *"0008" ]]; then HW_RELEASE_DATE='Q1 2013' - HW_MODEL_DESCRIPTION+='A' + G_HW_MODEL_DESCRIPTION+='A' HW_PCB_REVISION_CODE='2.0' HW_MEMORY_SIZE=256 HW_MANUFACTURER_NAME='Sony' - HW_MODEL=0 + G_HW_MODEL=0 elif [[ "$HW_REVISION_CODE" = *"0009" ]]; then HW_RELEASE_DATE='Q1 2013' - HW_MODEL_DESCRIPTION+='A' + G_HW_MODEL_DESCRIPTION+='A' HW_PCB_REVISION_CODE='2.0' HW_MEMORY_SIZE=256 HW_MANUFACTURER_NAME='Qisda' - HW_MODEL=0 + G_HW_MODEL=0 elif [[ "$HW_REVISION_CODE" = *"000d" ]]; then HW_RELEASE_DATE='Q4 2012' - HW_MODEL_DESCRIPTION+='B' + G_HW_MODEL_DESCRIPTION+='B' HW_PCB_REVISION_CODE='2.0' HW_MEMORY_SIZE=512 HW_MANUFACTURER_NAME='Egoman' - HW_MODEL=1 + G_HW_MODEL=1 elif [[ "$HW_REVISION_CODE" = *"000e" ]]; then HW_RELEASE_DATE='Q4 2012' - HW_MODEL_DESCRIPTION+='B' + G_HW_MODEL_DESCRIPTION+='B' HW_PCB_REVISION_CODE='2.0' HW_MEMORY_SIZE=512 HW_MANUFACTURER_NAME='Sony' - HW_MODEL=1 + G_HW_MODEL=1 elif [[ "$HW_REVISION_CODE" = *"000f" ]]; then HW_RELEASE_DATE='Q4 2012' - HW_MODEL_DESCRIPTION+='B' + G_HW_MODEL_DESCRIPTION+='B' HW_PCB_REVISION_CODE='2.0' HW_MEMORY_SIZE=512 HW_MANUFACTURER_NAME='Qisda' - HW_MODEL=1 + G_HW_MODEL=1 elif [[ "$HW_REVISION_CODE" = *"0010" ]]; then HW_RELEASE_DATE='Q3 2014' - HW_MODEL_DESCRIPTION+='B+' + G_HW_MODEL_DESCRIPTION+='B+' HW_PCB_REVISION_CODE='1.0' HW_MEMORY_SIZE=512 HW_MANUFACTURER_NAME='Sony' - HW_MODEL=1 + G_HW_MODEL=1 elif [[ "$HW_REVISION_CODE" = *"0011" ]]; then HW_RELEASE_DATE='Q2 2014' - HW_MODEL_DESCRIPTION+='CM' + G_HW_MODEL_DESCRIPTION+='CM' HW_PCB_REVISION_CODE='1.0' HW_MEMORY_SIZE=512 HW_MANUFACTURER_NAME='Sony' - HW_MODEL=1 + G_HW_MODEL=1 elif [[ "$HW_REVISION_CODE" = *"0012" ]]; then HW_RELEASE_DATE='Q4 2014' - HW_MODEL_DESCRIPTION+='A+' + G_HW_MODEL_DESCRIPTION+='A+' HW_PCB_REVISION_CODE='1.0' HW_MEMORY_SIZE=256 HW_MANUFACTURER_NAME='Sony' - HW_MODEL=0 + G_HW_MODEL=0 elif [[ "$HW_REVISION_CODE" = *"0013" ]]; then HW_RELEASE_DATE='Q1 2015' - HW_MODEL_DESCRIPTION+='B+' + G_HW_MODEL_DESCRIPTION+='B+' HW_PCB_REVISION_CODE='1.2' HW_MEMORY_SIZE=512 HW_MANUFACTURER_NAME='Unknown' - HW_MODEL=1 + G_HW_MODEL=1 elif [[ "$HW_REVISION_CODE" = *"a01041" ]]; then HW_RELEASE_DATE='Q1 2015' - HW_MODEL_DESCRIPTION+='2 Model B' + G_HW_MODEL_DESCRIPTION+='2 Model B' HW_PCB_REVISION_CODE='1.1' HW_MEMORY_SIZE=1024 HW_MANUFACTURER_NAME='Sony' - HW_MODEL=2 + G_HW_MODEL=2 elif [[ "$HW_REVISION_CODE" = *"a020a0" ]]; then HW_RELEASE_DATE='Q1 2017' - HW_MODEL_DESCRIPTION+='CM 3' + G_HW_MODEL_DESCRIPTION+='CM 3' HW_PCB_REVISION_CODE='1.0' HW_MEMORY_SIZE=1024 HW_MANUFACTURER_NAME='Sony' - HW_MODEL=3 + G_HW_MODEL=3 HW_ONBOARD_WIFI=1 elif [[ "$HW_REVISION_CODE" = *"a21041" ]]; then HW_RELEASE_DATE='Q1 2015' - HW_MODEL_DESCRIPTION+='2 Model B' + G_HW_MODEL_DESCRIPTION+='2 Model B' HW_PCB_REVISION_CODE='1.1' HW_MEMORY_SIZE=1024 HW_MANUFACTURER_NAME='Embest, China' - HW_MODEL=2 + G_HW_MODEL=2 elif [[ "$HW_REVISION_CODE" = *"a02082" ]]; then HW_RELEASE_DATE='Q1 2016' - HW_MODEL_DESCRIPTION+='3 Model B' + G_HW_MODEL_DESCRIPTION+='3 Model B' HW_PCB_REVISION_CODE='1.2' HW_MEMORY_SIZE=1024 HW_MANUFACTURER_NAME='Sony' - HW_MODEL=3 + G_HW_MODEL=3 HW_ONBOARD_WIFI=1 elif [[ "$HW_REVISION_CODE" = *"a22082" ]]; then HW_RELEASE_DATE='Q1 2016' - HW_MODEL_DESCRIPTION+='3 Model B' + G_HW_MODEL_DESCRIPTION+='3 Model B' HW_PCB_REVISION_CODE='1.2' HW_MEMORY_SIZE=1024 HW_MANUFACTURER_NAME='Embest, China' - HW_MODEL=3 + G_HW_MODEL=3 HW_ONBOARD_WIFI=1 elif [[ "$HW_REVISION_CODE" = *"a32082" ]]; then HW_RELEASE_DATE='Q4 2016' - HW_MODEL_DESCRIPTION+='3 Model B' + G_HW_MODEL_DESCRIPTION+='3 Model B' HW_PCB_REVISION_CODE='1.2' HW_MEMORY_SIZE=1024 HW_MANUFACTURER_NAME='Sony' - HW_MODEL=3 + G_HW_MODEL=3 HW_ONBOARD_WIFI=1 elif [[ "$HW_REVISION_CODE" = *"900092" ]]; then HW_RELEASE_DATE='Q4 2015' - HW_MODEL_DESCRIPTION+='Zero' + G_HW_MODEL_DESCRIPTION+='Zero' HW_PCB_REVISION_CODE='1.2' HW_MEMORY_SIZE=512 HW_MANUFACTURER_NAME='Sony' - HW_MODEL=1 + G_HW_MODEL=1 elif [[ "$HW_REVISION_CODE" = *"900093" ]]; then HW_RELEASE_DATE='Q2 2016' - HW_MODEL_DESCRIPTION+='Zero' + G_HW_MODEL_DESCRIPTION+='Zero' HW_PCB_REVISION_CODE='1.3' HW_MEMORY_SIZE=512 HW_MANUFACTURER_NAME='Sony' - HW_MODEL=1 + G_HW_MODEL=1 elif [[ "$HW_REVISION_CODE" = *"9000c1" ]]; then HW_RELEASE_DATE='Q1 2017' - HW_MODEL_DESCRIPTION+='Zero W' + G_HW_MODEL_DESCRIPTION+='Zero W' HW_PCB_REVISION_CODE='1.1' HW_MEMORY_SIZE=512 HW_MANUFACTURER_NAME='Sony' - HW_MODEL=1 + G_HW_MODEL=1 HW_ONBOARD_WIFI=1 fi @@ -375,218 +375,218 @@ Obtain_HW_Info(){ - #Systems that use /etc/.dietpi_hw_model_identifier for HW_MODEL - if [ -f "$FP_HW_MODEL_INDENTIFIER" ]; then + #Systems that use /etc/.dietpi_hw_model_identifier for G_HW_MODEL + if [ -f "$FP_G_HW_MODEL_INDENTIFIER" ]; then - HW_MODEL=$(sed -n 1p "$FP_HW_MODEL_INDENTIFIER") + G_HW_MODEL=$(sed -n 1p "$FP_G_HW_MODEL_INDENTIFIER") #RoseapplePi - if (( $HW_MODEL == 110 )); then + if (( $G_HW_MODEL == 110 )); then - HW_MODEL_DESCRIPTION='RoseapplePi' + G_HW_MODEL_DESCRIPTION='RoseapplePi' IMAGE_ADDITIONAL_CREDITS='ARMbian' #Asus Tinker Board - elif (( $HW_MODEL == 100 )); then + elif (( $G_HW_MODEL == 100 )); then - HW_MODEL_DESCRIPTION='Asus Tinker Board' + G_HW_MODEL_DESCRIPTION='Asus Tinker Board' #A20-OLinuXino-MICRO - elif (( $HW_MODEL == 90 )); then + elif (( $G_HW_MODEL == 90 )); then - HW_MODEL_DESCRIPTION='A20-OLinuXino-MICRO' + G_HW_MODEL_DESCRIPTION='A20-OLinuXino-MICRO' IMAGE_ADDITIONAL_CREDITS='ARMbian' #Cubieboard 3 - elif (( $HW_MODEL == 80 )); then + elif (( $G_HW_MODEL == 80 )); then - HW_MODEL_DESCRIPTION='Cubieboard 3' + G_HW_MODEL_DESCRIPTION='Cubieboard 3' IMAGE_ADDITIONAL_CREDITS='ARMbian' #Beagle Bone Black - elif (( $HW_MODEL == 71 )); then + elif (( $G_HW_MODEL == 71 )); then - HW_MODEL_DESCRIPTION='BBB' + G_HW_MODEL_DESCRIPTION='BBB' #Sparky SBC - elif (( $HW_MODEL == 70 )); then + elif (( $G_HW_MODEL == 70 )); then - HW_MODEL_DESCRIPTION='Sparky SBC' + G_HW_MODEL_DESCRIPTION='Sparky SBC' #NanoPi M1 Plus - elif (( $HW_MODEL == 66 )); then + elif (( $G_HW_MODEL == 66 )); then - HW_MODEL_DESCRIPTION='NanoPi M1 Plus' + G_HW_MODEL_DESCRIPTION='NanoPi M1 Plus' IMAGE_ADDITIONAL_CREDITS='ARMbian' - HW_CPUID=1 + G_HW_CPUID=1 #NanoPi NEO 2 - elif (( $HW_MODEL == 65 )); then + elif (( $G_HW_MODEL == 65 )); then - HW_MODEL_DESCRIPTION='NanoPi NEO 2' + G_HW_MODEL_DESCRIPTION='NanoPi NEO 2' IMAGE_ADDITIONAL_CREDITS='ARMbian' - HW_CPUID=2 + G_HW_CPUID=2 #NanoPi NEO Air - elif (( $HW_MODEL == 64 )); then + elif (( $G_HW_MODEL == 64 )); then - HW_MODEL_DESCRIPTION='NanoPi NEO Air' + G_HW_MODEL_DESCRIPTION='NanoPi NEO Air' IMAGE_ADDITIONAL_CREDITS='ARMbian' - HW_CPUID=1 + G_HW_CPUID=1 #NanoPi M1 - elif (( $HW_MODEL == 63 )); then + elif (( $G_HW_MODEL == 63 )); then - HW_MODEL_DESCRIPTION='NanoPi M1/T1' + G_HW_MODEL_DESCRIPTION='NanoPi M1/T1' IMAGE_ADDITIONAL_CREDITS='ARMbian' - HW_CPUID=1 + G_HW_CPUID=1 #NanoPi M3 - elif (( $HW_MODEL == 62 )); then + elif (( $G_HW_MODEL == 62 )); then - HW_MODEL_DESCRIPTION='NanoPi M3/T3' + G_HW_MODEL_DESCRIPTION='NanoPi M3/T3' #NanoPi M2 - elif (( $HW_MODEL == 61 )); then + elif (( $G_HW_MODEL == 61 )); then - HW_MODEL_DESCRIPTION='NanoPi M2/T2' + G_HW_MODEL_DESCRIPTION='NanoPi M2/T2' #NanoPi Neo - elif (( $HW_MODEL == 60 )); then + elif (( $G_HW_MODEL == 60 )); then - HW_MODEL_DESCRIPTION='NanoPi Neo' + G_HW_MODEL_DESCRIPTION='NanoPi Neo' IMAGE_ADDITIONAL_CREDITS='ARMbian' - HW_CPUID=1 + G_HW_CPUID=1 #BananaPi M2+ - elif (( $HW_MODEL == 50 )); then + elif (( $G_HW_MODEL == 50 )); then - HW_MODEL_DESCRIPTION='BananaPi M2+' + G_HW_MODEL_DESCRIPTION='BananaPi M2+' IMAGE_ADDITIONAL_CREDITS='ARMbian' - HW_CPUID=1 + G_HW_CPUID=1 #BananaPi Pro - elif (( $HW_MODEL == 51 )); then + elif (( $G_HW_MODEL == 51 )); then - HW_MODEL_DESCRIPTION='BananaPi Pro' + G_HW_MODEL_DESCRIPTION='BananaPi Pro' IMAGE_ADDITIONAL_CREDITS='ARMbian' #Rock64 - elif (( $HW_MODEL == 43 )); then + elif (( $G_HW_MODEL == 43 )); then - HW_MODEL_DESCRIPTION='Rock64' + G_HW_MODEL_DESCRIPTION='Rock64' IMAGE_ADDITIONAL_CREDITS='Longsleep, Ayufan' #PineA64 - elif (( $HW_MODEL >= 40 && $HW_MODEL <= 42 )); then + elif (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then IMAGE_ADDITIONAL_CREDITS='Longsleep, Rhkean' MEMTOTAL=$(free | awk '/^Mem:/{print $2}') if (( $MEMTOTAL > 2000000 )); then - HW_MODEL_DESCRIPTION='Pine A64+ 2GB' - HW_MODEL=42 + G_HW_MODEL_DESCRIPTION='Pine A64+ 2GB' + G_HW_MODEL=42 elif (( $MEMTOTAL > 1000000 )); then - HW_MODEL_DESCRIPTION='Pine A64+ 1GB' - HW_MODEL=41 + G_HW_MODEL_DESCRIPTION='Pine A64+ 1GB' + G_HW_MODEL=41 else - HW_MODEL_DESCRIPTION='Pine A64 512MB' - HW_MODEL=40 + G_HW_MODEL_DESCRIPTION='Pine A64 512MB' + G_HW_MODEL=40 fi #OrangePi PC 2 - elif (( $HW_MODEL == 38 )); then + elif (( $G_HW_MODEL == 38 )); then - HW_MODEL_DESCRIPTION='OPi PC2' + G_HW_MODEL_DESCRIPTION='OPi PC2' IMAGE_ADDITIONAL_CREDITS='ARMbian' - HW_CPUID=2 + G_HW_CPUID=2 #OrangePi Prime - elif (( $HW_MODEL == 37 )); then + elif (( $G_HW_MODEL == 37 )); then - HW_MODEL_DESCRIPTION='OPi Prime' + G_HW_MODEL_DESCRIPTION='OPi Prime' IMAGE_ADDITIONAL_CREDITS='ARMbian' - HW_CPUID=2 + G_HW_CPUID=2 #OrangePi Win - elif (( $HW_MODEL == 36 )); then + elif (( $G_HW_MODEL == 36 )); then - HW_MODEL_DESCRIPTION='OPi Win' + G_HW_MODEL_DESCRIPTION='OPi Win' IMAGE_ADDITIONAL_CREDITS='ARMbian' #OrangePi Zero Plus 2 (h3/h5) - elif (( $HW_MODEL == 35 )); then + elif (( $G_HW_MODEL == 35 )); then - HW_MODEL_DESCRIPTION='OPi Zero 2 Plus' + G_HW_MODEL_DESCRIPTION='OPi Zero 2 Plus' IMAGE_ADDITIONAL_CREDITS='ARMbian' - HW_CPUID=1 + G_HW_CPUID=1 #OrangePi Plus - elif (( $HW_MODEL == 34 )); then + elif (( $G_HW_MODEL == 34 )); then - HW_MODEL_DESCRIPTION='OrangePi Plus' + G_HW_MODEL_DESCRIPTION='OrangePi Plus' IMAGE_ADDITIONAL_CREDITS='ARMbian' - HW_CPUID=1 + G_HW_CPUID=1 #OrangePi Lite - elif (( $HW_MODEL == 33 )); then + elif (( $G_HW_MODEL == 33 )); then - HW_MODEL_DESCRIPTION='OrangePi Lite' + G_HW_MODEL_DESCRIPTION='OrangePi Lite' IMAGE_ADDITIONAL_CREDITS='ARMbian' - HW_CPUID=1 + G_HW_CPUID=1 #OrangePi Zero - elif (( $HW_MODEL == 32 )); then + elif (( $G_HW_MODEL == 32 )); then - HW_MODEL_DESCRIPTION='OrangePi Zero' + G_HW_MODEL_DESCRIPTION='OrangePi Zero' IMAGE_ADDITIONAL_CREDITS='ARMbian' - #HW_CPUID=1 #H2+ + #G_HW_CPUID=1 #H2+ #OrangePi One - elif (( $HW_MODEL == 31 )); then + elif (( $G_HW_MODEL == 31 )); then - HW_MODEL_DESCRIPTION='OrangePi One' + G_HW_MODEL_DESCRIPTION='OrangePi One' IMAGE_ADDITIONAL_CREDITS='ARMbian' - HW_CPUID=1 + G_HW_CPUID=1 #OrangePi Pc - elif (( $HW_MODEL == 30 )); then + elif (( $G_HW_MODEL == 30 )); then - HW_MODEL_DESCRIPTION='OrangePi PC' + G_HW_MODEL_DESCRIPTION='OrangePi PC' IMAGE_ADDITIONAL_CREDITS='ARMbian' - HW_CPUID=1 + G_HW_CPUID=1 #x86_64 native PC - elif (( $HW_MODEL == 21 )); then + elif (( $G_HW_MODEL == 21 )); then - HW_MODEL_DESCRIPTION='Native PC' + G_HW_MODEL_DESCRIPTION='Native PC' #VM - elif (( $HW_MODEL == 20 )); then + elif (( $G_HW_MODEL == 20 )); then - HW_MODEL_DESCRIPTION='Virtual Machine' + G_HW_MODEL_DESCRIPTION='Virtual Machine' #oDroid U3 - elif (( $HW_MODEL == 13 )); then + elif (( $G_HW_MODEL == 13 )); then - HW_MODEL_DESCRIPTION='oDroid U3' + G_HW_MODEL_DESCRIPTION='oDroid U3' #IMAGE_ADDITIONAL_CREDITS='Meveric' - elif (( $HW_MODEL == 12 )); then + elif (( $G_HW_MODEL == 12 )); then - HW_MODEL_DESCRIPTION='oDroid C2' + G_HW_MODEL_DESCRIPTION='oDroid C2' IMAGE_ADDITIONAL_CREDITS='Meveric' #oDroid XU3/4 via /etc/.dietpi_hw_model - elif (( $HW_MODEL == 11 )); then + elif (( $G_HW_MODEL == 11 )); then - HW_MODEL_DESCRIPTION='oDroid XU3/4' + G_HW_MODEL_DESCRIPTION='oDroid XU3/4' IMAGE_ADDITIONAL_CREDITS='Meveric' fi @@ -600,22 +600,22 @@ #oDroid C2 elif (( $(cat /proc/cpuinfo | grep -ci -m1 'ODROID-C2') )); then - HW_MODEL_DESCRIPTION='oDroid C2' - HW_MODEL=12 + G_HW_MODEL_DESCRIPTION='oDroid C2' + G_HW_MODEL=12 IMAGE_ADDITIONAL_CREDITS='Meveric' #oDroid XU3/4 elif (( $(cat /proc/cpuinfo | grep -ci -m1 'ODROID-XU3') )); then - HW_MODEL_DESCRIPTION='oDroid XU3/4' - HW_MODEL=11 + G_HW_MODEL_DESCRIPTION='oDroid XU3/4' + G_HW_MODEL=11 IMAGE_ADDITIONAL_CREDITS='Meveric' #oDroid C1 elif (( $(cat /proc/cpuinfo | grep -ci -m1 'ODROIDC') )); then - HW_MODEL_DESCRIPTION='oDroid C1' - HW_MODEL=10 + G_HW_MODEL_DESCRIPTION='oDroid C1' + G_HW_MODEL=10 IMAGE_ADDITIONAL_CREDITS='Meveric' fi @@ -623,15 +623,15 @@ #Get Distro Index if (( $( grep -ci -m1 'jessie' /etc/*release) )); then - DISTRO=3 + G_DISTRO=3 elif (( $( grep -ci -m1 'stretch' /etc/*release) )); then - DISTRO=4 + G_DISTRO=4 elif (( $( grep -ci -m1 'buster' /etc/*release) )); then - DISTRO=5 + G_DISTRO=5 fi @@ -647,44 +647,44 @@ fi #Obtain hardware cpu architecture - HW_ARCH_DESCRIPTION=$(uname -m) - if [ "$HW_ARCH_DESCRIPTION" = "armv6l" ]; then + G_HW_ARCH_DESCRIPTION=$(uname -m) + if [ "$G_HW_ARCH_DESCRIPTION" = "armv6l" ]; then - HW_ARCH=1 + G_HW_ARCH=1 - elif [ "$HW_ARCH_DESCRIPTION" = "armv7l" ]; then + elif [ "$G_HW_ARCH_DESCRIPTION" = "armv7l" ]; then - HW_ARCH=2 + G_HW_ARCH=2 - elif [ "$HW_ARCH_DESCRIPTION" = "aarch64" ]; then + elif [ "$G_HW_ARCH_DESCRIPTION" = "aarch64" ]; then - HW_ARCH=3 + G_HW_ARCH=3 - elif [ "$HW_ARCH_DESCRIPTION" = "x86_64" ]; then + elif [ "$G_HW_ARCH_DESCRIPTION" = "x86_64" ]; then - HW_ARCH=10 + G_HW_ARCH=10 # - Unknown arch for DietPi, inform user by adding 'unknown'. else - HW_ARCH_DESCRIPTION+=' (Unknown)' + G_HW_ARCH_DESCRIPTION+=' (Unknown)' fi # - Add HW arch to HW desc - HW_MODEL_DESCRIPTION+=" ($HW_ARCH_DESCRIPTION)" + G_HW_MODEL_DESCRIPTION+=" ($G_HW_ARCH_DESCRIPTION)" #Save data cat << _EOF_ > /DietPi/dietpi/.hw_model -$HW_MODEL -$HW_MODEL_DESCRIPTION -$DISTRO +$G_HW_MODEL +$G_HW_MODEL_DESCRIPTION +$G_DISTRO $ROOTFS_DEVICE_PATH $HW_UUID -$HW_ARCH -$HW_ARCH_DESCRIPTION +$G_HW_ARCH +$G_HW_ARCH_DESCRIPTION $IMAGE_ADDITIONAL_CREDITS -$HW_CPUID +$G_HW_CPUID $HW_ONBOARD_WIFI $HW_REVISION_CODE $HW_RELEASE_DATE diff --git a/dietpi/dietpi-process_tool b/dietpi/dietpi-process_tool index 8a34cae3a1..9f77b03df7 100644 --- a/dietpi/dietpi-process_tool +++ b/dietpi/dietpi-process_tool @@ -27,7 +27,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER + G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -52,11 +52,11 @@ Apply_Process_Tool(){ - dietpi-notify 3 DietPi-Process_Tool Apply + G_DIETPI-NOTIFY 3 DietPi-Process_Tool Apply local status_text="" - local status_text_ok="$(dietpi-notify 0)" - local status_text_failed="$(dietpi-notify 1)" + local status_text_ok="$(G_DIETPI-NOTIFY 0)" + local status_text_failed="$(G_DIETPI-NOTIFY 1)" for ((i=0; i<$MAX_PROGRAMS; i++)) do @@ -77,7 +77,7 @@ # - Check if PID exists (this can occur with programs like netdata that run as root initally, create a new process under a different user, then terminate the original root process. if (( ! $( ps ax | awk '{print $1}' | grep -ci -m1 "${aPID[$i]}") )); then - dietpi-notify 2 PID "${aPID[$i]}" no longer exists + G_DIETPI-NOTIFY 2 PID "${aPID[$i]}" no longer exists else @@ -829,7 +829,7 @@ elif (( $INPUT == 1 )); then Apply_Process_Tool - dietpi-notify -1 ${EXIT_CODE:=0} "$PROGRAM_NAME |" + G_DIETPI-NOTIFY -1 ${EXIT_CODE:=0} "$PROGRAM_NAME |" fi #----------------------------------------------------------------------------------- diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index 2e7d59ff65..e979d3f8d5 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -27,7 +27,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER + G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- aSERVICE_NAME=( @@ -187,12 +187,12 @@ #ok if (( $3 == 0 || $3 == 5 )); then - echo -e "\e[1A$(dietpi-notify 0)\e[0m $1 : $2" + echo -e "\e[1A$(G_DIETPI-NOTIFY 0)\e[0m $1 : $2" #failed else - echo -e "\e[1A$(dietpi-notify 1)\e[0m $1 : $2" + echo -e "\e[1A$(G_DIETPI-NOTIFY 1)\e[0m $1 : $2" fi @@ -329,7 +329,7 @@ # Main #///////////////////////////////////////////////////////////////////////////////////// #Info - dietpi-notify 3 DietPi-Services "$INPUT_MODE" + G_DIETPI-NOTIFY 3 DietPi-Services "$INPUT_MODE" #Obtain an array of available services installed on system. Populate_Available_Array @@ -400,7 +400,7 @@ if (( ${aSERVICE_AVAILABLE[$i]} )); then - dietpi-notify 0 "$INPUT_MODE $INPUT_S2: ${aSERVICE_NAME[$i]}" + G_DIETPI-NOTIFY 0 "$INPUT_MODE $INPUT_S2: ${aSERVICE_NAME[$i]}" systemctl $SYSTEMD_CMD ${aSERVICE_NAME[$i]} fi @@ -416,11 +416,11 @@ systemctl $SYSTEMD_CMD $INPUT_S2 if (( $? == 0 )); then - dietpi-notify 0 "$INPUT_MODE $INPUT_S2" + G_DIETPI-NOTIFY 0 "$INPUT_MODE $INPUT_S2" else - dietpi-notify 1 "$INPUT_MODE $INPUT_S2" + G_DIETPI-NOTIFY 1 "$INPUT_MODE $INPUT_S2" fi @@ -452,16 +452,16 @@ if [[ "$STATUS" =~ .*'failed'.* ]]; then - dietpi-notify 1 "$STATUS" + G_DIETPI-NOTIFY 1 "$STATUS" systemctl status "${aSERVICE_NAME[$i]}" -l --no-pager elif [[ "$STATUS" =~ .*'inactive'.* ]]; then - dietpi-notify 2 "$STATUS" + G_DIETPI-NOTIFY 2 "$STATUS" else - dietpi-notify 0 "$STATUS" + G_DIETPI-NOTIFY 0 "$STATUS" fi @@ -483,11 +483,11 @@ systemctl $INPUT_MODE $INPUT_S2 &> /dev/null if (( $? == 0 )); then - dietpi-notify 0 "$INPUT_MODE $INPUT_S2" + G_DIETPI-NOTIFY 0 "$INPUT_MODE $INPUT_S2" else - dietpi-notify 1 "$INPUT_MODE $INPUT_S2" + G_DIETPI-NOTIFY 1 "$INPUT_MODE $INPUT_S2" fi diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f82ced47e1..7d68ed7795 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -25,8 +25,8 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER - CHECK_ROOTFS_RW + G_CHECK_ROOT_USER + G_CHECK_ROOTFS_RW #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -115,7 +115,7 @@ _EOF_ fi #Load Software states - dietpi-notify 2 "Reading database, please wait..." + G_DIETPI-NOTIFY 2 "Reading database, please wait..." #Load if [ -f "$fp_target" ]; then @@ -125,7 +125,7 @@ _EOF_ fi #Always reset choice system during first run to defaults: https://github.com/Fourdee/DietPi/issues/1122 - if (( $DIETPI_INSTALL_STAGE == 0 )); then + if (( $G_DIETPI_INSTALL_STAGE == 0 )); then INDEX_SSHSERVER_CURRENT=-1 INDEX_SSHSERVER_TARGET=-1 @@ -227,7 +227,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 < 4 )); then + if (( $G_DISTRO < 4 )); then FP_PHP_BASE_DIR='/etc/php5' PHP_APT_PACKAGE_NAME='php5' @@ -308,11 +308,11 @@ _EOF_ aSOFTWARE_REQUIRES_NODEJS=0 # - Available for - MAX_HW_MODEL=110 #This needs to match highest HW_MODEL value in dietpi-obtain_hw_model - MAX_HW_ARCH=10 #This needs to match highest HW_ARCH value in dietpi-obtain_hw_model + MAX_G_HW_MODEL=110 #This needs to match highest G_HW_MODEL value in dietpi-obtain_hw_model + MAX_G_HW_ARCH=10 #This needs to match highest G_HW_ARCH value in dietpi-obtain_hw_model # 2D array (well, bash style) - declare -A aSOFTWARE_AVAIL_HW_MODEL - declare -A aSOFTWARE_AVAIL_HW_ARCH + declare -A aSOFTWARE_AVAIL_G_HW_MODEL + declare -A aSOFTWARE_AVAIL_G_HW_ARCH #///////////////////////////////////////////////////////////////////////////////////// # This function generates the array for all the software avaliable to be installed. @@ -360,9 +360,9 @@ _EOF_ # 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++)) + # for ((i=10; i<=$MAX_G_HW_MODEL; i++)) # do - # aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + # aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 # done # # Example: @@ -437,12 +437,12 @@ _EOF_ for ((i=0; i<$TOTAL_SOFTWARE_INDEXS_HARDLIMIT; i++)) do - for ((j=0; j<=$MAX_HW_MODEL; j++)) + for ((j=0; j<=$MAX_G_HW_MODEL; j++)) do - aSOFTWARE_AVAIL_HW_MODEL[$i,$j]=1 + aSOFTWARE_AVAIL_G_HW_MODEL[$i,$j]=1 # ((debug_array_count++)) - # echo -e "$debug_array_count ${aSOFTWARE_AVAIL_HW_MODEL[$i,$j]}" + # echo -e "$debug_array_count ${aSOFTWARE_AVAIL_G_HW_MODEL[$i,$j]}" done @@ -451,12 +451,12 @@ _EOF_ for ((i=0; i<$TOTAL_SOFTWARE_INDEXS_HARDLIMIT; i++)) do - for ((j=0; j<=$MAX_HW_ARCH; j++)) + for ((j=0; j<=$MAX_G_HW_ARCH; j++)) do - aSOFTWARE_AVAIL_HW_ARCH[$i,$j]=1 + aSOFTWARE_AVAIL_G_HW_ARCH[$i,$j]=1 # ((debug_array_count++)) - # echo -e "$debug_array_count ${aSOFTWARE_AVAIL_HW_ARCH[$i,$j]}" + # echo -e "$debug_array_count ${aSOFTWARE_AVAIL_G_HW_ARCH[$i,$j]}" done @@ -558,10 +558,10 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=3011#p3011' # - ARMv6 - aSOFTWARE_AVAIL_HW_ARCH[$index_current,1]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,1]=0 # - VM - aSOFTWARE_AVAIL_HW_MODEL[$index_current,20]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,20]=0 #Remote Desktops #-------------------------------------------------------------------------------- @@ -575,15 +575,15 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&start=30#p408' # - ARMv8 - aSOFTWARE_AVAIL_HW_ARCH[$index_current,3]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,3]=0 # - Disable for Stretch, replaced by tigervnc (vnc4) - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then - for ((i=0; i<$MAX_HW_MODEL; i++)) + for ((i=0; i<$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done @@ -620,7 +620,7 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&start=60#p2071' # - ARMv8 - aSOFTWARE_AVAIL_HW_ARCH[$index_current,3]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,3]=0 #------------------ index_current=120 @@ -633,10 +633,10 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=4149#p4149' # - License RPi only - for ((i=10; i<$MAX_HW_MODEL; i++)) + for ((i=10; i<$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done @@ -653,10 +653,10 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5#p43' # - Disabled for All non-RPi/Odroid boards - for ((i=20; i<$MAX_HW_MODEL; i++)) + for ((i=20; i<$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done @@ -681,7 +681,7 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=3928#p3928' # - X86_64 - aSOFTWARE_AVAIL_HW_ARCH[$index_current,10]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,10]=0 #------------------ index_current=33 @@ -739,7 +739,7 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=1221#p1221' # - x86_64 - aSOFTWARE_AVAIL_HW_ARCH[$index_current,10]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,10]=0 #------------------ index_current=38 @@ -752,10 +752,10 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=57#p57' # - Disabled for All non-rpi - for ((i=10; i<=$MAX_HW_MODEL; i++)) + for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done @@ -794,10 +794,10 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=1789#p1789' #disable ARMv6: https://github.com/Fourdee/DietPi/issues/534 - aSOFTWARE_AVAIL_HW_ARCH[$index_current,1]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,1]=0 #disable ARMv8: https://github.com/Fourdee/DietPi/issues/1059#issuecomment-313661959 - aSOFTWARE_AVAIL_HW_ARCH[$index_current,3]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,3]=0 #------------------ index_current=42 @@ -809,7 +809,7 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=1949#p1949' #disable ARMv6: https://github.com/Fourdee/DietPi/issues/648 - aSOFTWARE_AVAIL_HW_ARCH[$index_current,1]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,1]=0 #------------------ index_current=43 @@ -841,10 +841,10 @@ _EOF_ aSOFTWARE_REQUIRES_ALSA[$index_current]=1 # - Currently ARMv7/64 only, so disable all archs - for ((i=0; i<=$MAX_HW_ARCH; i++)) + for ((i=0; i<=$MAX_G_HW_ARCH; i++)) do - aSOFTWARE_AVAIL_HW_ARCH[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,$i]=0 done @@ -852,7 +852,7 @@ _EOF_ for ((i=2; i<=10; i++)) do - aSOFTWARE_AVAIL_HW_ARCH[$index_current,$i]=1 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,$i]=1 done @@ -867,15 +867,15 @@ _EOF_ aSOFTWARE_REQUIRES_ALSA[$index_current]=1 # - Currently ARMv7+ only, so disable all archs - for ((i=0; i<=$MAX_HW_ARCH; i++)) + for ((i=0; i<=$MAX_G_HW_ARCH; i++)) do - aSOFTWARE_AVAIL_HW_ARCH[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,$i]=0 done # renable for armv7+ - aSOFTWARE_AVAIL_HW_ARCH[$index_current,2]=1 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,2]=1 #------------------ index_current=128 @@ -900,7 +900,7 @@ _EOF_ aSOFTWARE_REQUIRES_MYSQL[$index_current]=1 # - VM - aSOFTWARE_AVAIL_HW_MODEL[$index_current,20]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,20]=0 #------------------ index_current=135 @@ -913,7 +913,7 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=6526#p6526' # - VM - aSOFTWARE_AVAIL_HW_MODEL[$index_current,20]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,20]=0 #------------------ index_current=141 @@ -926,15 +926,15 @@ _EOF_ aSOFTWARE_REQUIRES_ALSA[$index_current]=1 # - Currently ARMv7+ only, so disable all archs - for ((i=0; i<=$MAX_HW_ARCH; i++)) + for ((i=0; i<=$MAX_G_HW_ARCH; i++)) do - aSOFTWARE_AVAIL_HW_ARCH[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,$i]=0 done # renable for armv7+ - aSOFTWARE_AVAIL_HW_ARCH[$index_current,2]=1 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,2]=1 #------------------ index_current=143 @@ -961,7 +961,7 @@ _EOF_ aSOFTWARE_REQUIRES_GIT[$index_current]=1 # - Disabled for ARM64 - aSOFTWARE_AVAIL_HW_ARCH[$index_current,3]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,3]=0 #------------------ @@ -976,10 +976,10 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&start=110#p7536' # - Disabled for All non-rpi - for ((i=10; i<=$MAX_HW_MODEL; i++)) + for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done @@ -995,14 +995,14 @@ _EOF_ aSOFTWARE_REQUIRES_FFMPEG[$index_current]=1 # - x86_64 - for ((i=0; i<=$MAX_HW_ARCH; i++)) + for ((i=0; i<=$MAX_G_HW_ARCH; i++)) do - aSOFTWARE_AVAIL_HW_ARCH[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,$i]=0 done - aSOFTWARE_AVAIL_HW_ARCH[$index_current,10]=1 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,10]=1 #------------------ index_current=159 @@ -1046,10 +1046,10 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=9368#p9368' #disable ARMv8: - aSOFTWARE_AVAIL_HW_ARCH[$index_current,3]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,3]=0 #disable x86_64: - aSOFTWARE_AVAIL_HW_ARCH[$index_current,10]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,10]=0 #------------------ index_current=168 @@ -1066,10 +1066,10 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='xxxxxxxxxxxxxxxxx' # - Disabled for All non-rpi - for ((i=10; i<=$MAX_HW_MODEL; i++)) + for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done @@ -1244,7 +1244,7 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=65#p65' #No deb packages for ARMv6: - aSOFTWARE_AVAIL_HW_ARCH[$index_current,1]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,1]=0 #------------------ index_current=49 @@ -1258,7 +1258,7 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&start=70#p2187' # - ARMv8 - aSOFTWARE_AVAIL_HW_ARCH[$index_current,3]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,3]=0 #------------------ index_current=50 @@ -1279,10 +1279,10 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=6476#p6476' # - ARMv6 - aSOFTWARE_AVAIL_HW_ARCH[$index_current,1]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,1]=0 # - ARMv8 - aSOFTWARE_AVAIL_HW_ARCH[$index_current,3]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,3]=0 #------------------ index_current=158 @@ -1299,10 +1299,10 @@ _EOF_ aSOFTWARE_TYPE[$index_current]=0 # - x86_64 - #aSOFTWARE_AVAIL_HW_ARCH[$index_current,10]=0 + #aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,10]=0 # - ARMv8 - aSOFTWARE_AVAIL_HW_ARCH[$index_current,3]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,3]=0 #------------------ index_current=165 @@ -1329,10 +1329,10 @@ _EOF_ aSOFTWARE_REQUIRES_XSERVERXORG[$index_current]=1 # - Disabled for All non-rpi - for ((i=10; i<=$MAX_HW_MODEL; i++)) + for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done @@ -1348,10 +1348,10 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5#p45' # - Disabled for All non-rpi - for ((i=10; i<=$MAX_HW_MODEL; i++)) + for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done @@ -1366,10 +1366,10 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=2963#p2963' # - Disabled for All non-rpi - for ((i=10; i<=$MAX_HW_MODEL; i++)) + for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done @@ -1383,7 +1383,7 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&start=60#p2068' # - ARMv8 - aSOFTWARE_AVAIL_HW_ARCH[$index_current,3]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,3]=0 #------------------ index_current=53 @@ -1411,14 +1411,14 @@ _EOF_ aSOFTWARE_REQUIRES_DESKTOP[$index_current]=1 #Native PC only - for ((i=0; i<=$MAX_HW_MODEL; i++)) + for ((i=0; i<=$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done - aSOFTWARE_AVAIL_HW_MODEL[$index_current,21]=1 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,21]=1 #------------------ index_current=164 @@ -1507,10 +1507,10 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5#p48' # - Disabled for All non-rpi - for ((i=10; i<=$MAX_HW_MODEL; i++)) + for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done @@ -1525,10 +1525,10 @@ _EOF_ aSOFTWARE_REQUIRES_FFMPEG[$index_current]=1 # - Disabled for All non-rpi - for ((i=10; i<=$MAX_HW_MODEL; i++)) + for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done @@ -1545,7 +1545,7 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=1207#p1207' # - VM - aSOFTWARE_AVAIL_HW_MODEL[$index_current,20]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,20]=0 #------------------ index_current=61 @@ -1557,7 +1557,7 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=1529#p1529' # - VM - aSOFTWARE_AVAIL_HW_MODEL[$index_current,20]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,20]=0 #------------------ @@ -1611,10 +1611,10 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&start=50#p1503' # - Disabled for All non-rpi - for ((i=10; i<=$MAX_HW_MODEL; i++)) + for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done @@ -1628,10 +1628,10 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&start=20#p89' # - Disabled for All non-rpi - for ((i=10; i<=$MAX_HW_MODEL; i++)) + for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done @@ -1665,7 +1665,7 @@ _EOF_ aSOFTWARE_TYPE[$index_current]=0 # - ARMv8 - aSOFTWARE_AVAIL_HW_ARCH[$index_current,3]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,3]=0 #Remote Access #-------------------------------------------------------------------------------- @@ -1687,16 +1687,16 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&start=20#p188' # - Currently ARMv7+ only, so disable all archs - for ((i=0; i<=$MAX_HW_ARCH; i++)) + for ((i=0; i<=$MAX_G_HW_ARCH; i++)) do - aSOFTWARE_AVAIL_HW_ARCH[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,$i]=0 done # renable for armv6/7 - aSOFTWARE_AVAIL_HW_ARCH[$index_current,1]=1 - aSOFTWARE_AVAIL_HW_ARCH[$index_current,2]=1 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,1]=1 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,2]=1 #------------------ index_current=138 @@ -1720,10 +1720,10 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&start=40#p1065' # - Disabled for All non-rpi - for ((i=10; i<=$MAX_HW_MODEL; i++)) + for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done @@ -1738,15 +1738,15 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=1066#p1066' # - RPi / Odroids - for ((i=20; i<=$MAX_HW_MODEL; i++)) + for ((i=20; i<=$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done #+ BPi Pro - aSOFTWARE_AVAIL_HW_MODEL[$index_current,51]=1 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,51]=1 #------------------ index_current=71 @@ -1759,10 +1759,10 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&start=20#p189' # - Disabled for All non-rpi and RPi3 - for ((i=3; i<=$MAX_HW_MODEL; i++)) + for ((i=3; i<=$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done @@ -1775,10 +1775,10 @@ _EOF_ aSOFTWARE_TYPE[$index_current]=0 # - Disabled for All non-rpi - for ((i=10; i<=$MAX_HW_MODEL; i++)) + for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done @@ -1824,10 +1824,10 @@ _EOF_ 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++)) + for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done @@ -1843,10 +1843,10 @@ _EOF_ 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++)) + for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done @@ -1872,9 +1872,9 @@ _EOF_ aSOFTWARE_TYPE[$index_current]=0 aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&start=10#p52' # - disable on Stretch - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$HW_MODEL]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$G_HW_MODEL]=0 fi @@ -1905,9 +1905,9 @@ _EOF_ aSOFTWARE_TYPE[$index_current]=0 aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5#p5' # - disable on Stretch - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$HW_MODEL]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$G_HW_MODEL]=0 fi @@ -1938,9 +1938,9 @@ _EOF_ aSOFTWARE_TYPE[$index_current]=0 aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=1335#p1335' # - disable on Stretch - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$HW_MODEL]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$G_HW_MODEL]=0 fi @@ -1998,9 +1998,9 @@ _EOF_ aSOFTWARE_TYPE[$index_current]=-1 aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=1335#p1335' # - disable on Stretch - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$HW_MODEL]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$G_HW_MODEL]=0 fi @@ -2170,10 +2170,10 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=1529#p1525' # - Disabled for All non-rpi - for ((i=10; i<=$MAX_HW_MODEL; i++)) + for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done @@ -2189,10 +2189,10 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&start=20#p70' # - Disabled for All non-rpi - for ((i=10; i<=$MAX_HW_MODEL; i++)) + for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done @@ -2224,9 +2224,9 @@ _EOF_ aSOFTWARE_REQUIRES_RSYSLOG[$index_current]=1 #Not required, but comes in as package dep #Disabled for ARMv8 on Jessie only: https://github.com/Fourdee/DietPi/issues/855#issuecomment-292712002 - if (( $DISTRO == 3 )); then + if (( $G_DISTRO == 3 )); then - aSOFTWARE_AVAIL_HW_ARCH[$index_current,3]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$index_current,3]=0 fi @@ -2324,14 +2324,14 @@ _EOF_ aSOFTWARE_TYPE[$index_current]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$index_current]=1 - for ((i=0; i<$MAX_HW_MODEL; i++)) + for ((i=0; i<$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done - aSOFTWARE_AVAIL_HW_MODEL[$index_current,21]=1 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,21]=1 #------------------ index_current=170 @@ -2379,10 +2379,10 @@ _EOF_ aSOFTWARE_TYPE[$index_current]=1 # - Disabled for All non-rpi - for ((i=10; i<=$MAX_HW_MODEL; i++)) + for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$i]=0 done @@ -2502,9 +2502,9 @@ _EOF_ aSOFTWARE_TYPE[$index_current]=1 # - Stretch only - if (( $DISTRO < 4 )); then + if (( $G_DISTRO < 4 )); then - aSOFTWARE_AVAIL_HW_MODEL[$index_current,$HW_MODEL]=0 + aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$G_HW_MODEL]=0 fi @@ -2617,8 +2617,8 @@ _EOF_ unset aSOFTWARE_REQUIRES_ORACLEJAVA unset aSOFTWARE_REQUIRES_NODEJS - unset aSOFTWARE_AVAIL_HW_MODEL - unset aSOFTWARE_AVAIL_HW_ARCH + unset aSOFTWARE_AVAIL_G_HW_MODEL + unset aSOFTWARE_AVAIL_G_HW_ARCH } @@ -2636,8 +2636,8 @@ _EOF_ # - Disable aSOFTWARE_INSTALL_STATE[$i]=0 - dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[$i]}: Requires user input and can not be automated." - dietpi-notify 1 "${aSOFTWARE_WHIP_NAME[$i]}: Will not be installed. Please run 'dietpi-software' to install." + G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$i]}: Requires user input and can not be automated." + G_DIETPI-NOTIFY 1 "${aSOFTWARE_WHIP_NAME[$i]}: Will not be installed. Please run 'dietpi-software' to install." fi @@ -2650,7 +2650,7 @@ _EOF_ #Work out which additional software we need to install Install_Flag_Prereq_Software(){ - dietpi-notify 3 DietPi-Software "Checking for prerequisite software" + G_DIETPI-NOTIFY 3 DietPi-Software "Checking for prerequisite software" #------------------------------------------------------------------------- #Pre-req software, for items that do not have their own array aSOFTWARE_REQUIRES_SOFTWARENAME @@ -2670,7 +2670,7 @@ _EOF_ aSOFTWARE_INSTALL_STATE[36]=1 # Squeezelite aSOFTWARE_INSTALL_STATE[37]=1 # Shairport Sync - if (( $HW_MODEL == 70 )); then + if (( $G_HW_MODEL == 70 )); then aSOFTWARE_INSTALL_STATE[60]=1 # WiFi Hotspot @@ -2696,16 +2696,16 @@ _EOF_ #aSOFTWARE_INSTALL_STATE[37]=1 # Shairport Sync # Disabled/optional #aSOFTWARE_INSTALL_STATE[60]=1 # WiFi Hotspot # Installed as per moOde docs - dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[128]} will be installed" + G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[128]} will be installed" aSOFTWARE_INSTALL_STATE[128]=1 # MPD - dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[78]} will be installed" + G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[78]} will be installed" aSOFTWARE_INSTALL_STATE[78]=1 # LESP, override user choice for now. - dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[1]} will be installed" + G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[1]} will be installed" aSOFTWARE_INSTALL_STATE[1]=1 # Samba Client - dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[96]} will be installed" + G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[96]} will be installed" aSOFTWARE_INSTALL_STATE[96]=1 # Samba Server fi @@ -2732,7 +2732,7 @@ _EOF_ aSOFTWARE_INSTALL_STATE[$index]=1 #aSOFTWARE_WHIP_NAME - dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[$index]} will be installed" + G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$index]} will be installed" fi @@ -2748,7 +2748,7 @@ _EOF_ aSOFTWARE_INSTALL_STATE[150]=1 - dietpi-notify 2 "Mono runtime libary will be installed" + G_DIETPI-NOTIFY 2 "Mono runtime libary will be installed" fi @@ -2761,7 +2761,7 @@ _EOF_ aSOFTWARE_INSTALL_STATE[140]=1 - dietpi-notify 2 "SDL2 will be installed" + G_DIETPI-NOTIFY 2 "SDL2 will be installed" fi @@ -2781,7 +2781,7 @@ _EOF_ aSOFTWARE_INSTALL_STATE[130]=1 - dietpi-notify 2 "Python-Pip will be installed" + G_DIETPI-NOTIFY 2 "Python-Pip will be installed" fi @@ -2800,7 +2800,7 @@ _EOF_ # - Flag for install aSOFTWARE_INSTALL_STATE[128]=1 - dietpi-notify 2 "MPD will be installed" + G_DIETPI-NOTIFY 2 "MPD will be installed" fi @@ -2814,7 +2814,7 @@ _EOF_ aSOFTWARE_INSTALL_STATE[94]=1 - dietpi-notify 2 "ProFTP will be installed" + G_DIETPI-NOTIFY 2 "ProFTP will be installed" fi @@ -2823,7 +2823,7 @@ _EOF_ aSOFTWARE_INSTALL_STATE[96]=1 - dietpi-notify 2 "Samba Server will be installed" + G_DIETPI-NOTIFY 2 "Samba Server will be installed" fi @@ -2837,7 +2837,7 @@ _EOF_ aSOFTWARE_INSTALL_STATE[91]=1 - dietpi-notify 2 "Redis will be installed" + G_DIETPI-NOTIFY 2 "Redis will be installed" fi @@ -2928,25 +2928,25 @@ _EOF_ #WEBSERVER_APACHE aSOFTWARE_INSTALL_STATE[83]=1 - dietpi-notify 2 "Apache2 will be installed" + G_DIETPI-NOTIFY 2 "Apache2 will be installed" elif (( $INDEX_WEBSERVER_TARGET == -1 )); then #WEBSERVER_NGINX aSOFTWARE_INSTALL_STATE[85]=1 - dietpi-notify 2 "Nginx will be installed" + G_DIETPI-NOTIFY 2 "Nginx will be installed" elif (( $INDEX_WEBSERVER_TARGET == -2 )); then #WEBSERVER_LIGHTTPD aSOFTWARE_INSTALL_STATE[84]=1 - dietpi-notify 2 "Lighttpd will be installed" + G_DIETPI-NOTIFY 2 "Lighttpd will be installed" fi # - Always install WEBSERVER_PHP aSOFTWARE_INSTALL_STATE[89]=1 - dietpi-notify 2 "PHP will be installed" + G_DIETPI-NOTIFY 2 "PHP will be installed" fi @@ -2970,7 +2970,7 @@ _EOF_ #WEBSERVER_MARIADB as new default aSOFTWARE_INSTALL_STATE[88]=1 - dietpi-notify 2 "MariaDB will be installed" + G_DIETPI-NOTIFY 2 "MariaDB will be installed" fi @@ -2990,7 +2990,7 @@ _EOF_ #WEBSERVER_SQLITE aSOFTWARE_INSTALL_STATE[87]=1 - dietpi-notify 2 "SQlite will be installed" + G_DIETPI-NOTIFY 2 "SQlite will be installed" break @@ -3091,19 +3091,19 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[86]} == 2 )); then aSOFTWARE_INSTALL_STATE[88]=0 - dietpi-notify 2 "MySQL is already installed, MariaDB install has been disabled" + G_DIETPI-NOTIFY 2 "MySQL is already installed, MariaDB install has been disabled" # MariaDB installed elif (( ${aSOFTWARE_INSTALL_STATE[88]} == 2 )); then aSOFTWARE_INSTALL_STATE[86]=0 - dietpi-notify 2 "MariaDB is already installed, MySQL install has been disabled" + G_DIETPI-NOTIFY 2 "MariaDB is already installed, MySQL install has been disabled" # Both selected for install, disable MySQL else aSOFTWARE_INSTALL_STATE[86]=0 - dietpi-notify 2 "MySQL and MariaDB are selected for install. MySQL has been de-selected to prevent incompatible MySQL + MariaDB installation" + G_DIETPI-NOTIFY 2 "MySQL and MariaDB are selected for install. MySQL has been de-selected to prevent incompatible MySQL + MariaDB installation" fi @@ -3123,7 +3123,7 @@ _EOF_ ! ${aSOFTWARE_INSTALL_STATE[26]} )); then aSOFTWARE_INSTALL_STATE[23]=1 - dietpi-notify 2 "LXDE desktop will be installed" + G_DIETPI-NOTIFY 2 "LXDE desktop will be installed" fi @@ -3143,7 +3143,7 @@ _EOF_ # - Flag for install aSOFTWARE_INSTALL_STATE[17]=1 - dietpi-notify 2 "Git will be installed" + G_DIETPI-NOTIFY 2 "Git will be installed" break @@ -3161,7 +3161,7 @@ _EOF_ # - Flag for install aSOFTWARE_INSTALL_STATE[16]=1 - dietpi-notify 2 "Build-Essential will be installed" + G_DIETPI-NOTIFY 2 "Build-Essential will be installed" break @@ -3179,7 +3179,7 @@ _EOF_ # - Flag for install aSOFTWARE_INSTALL_STATE[102]=1 - dietpi-notify 2 "Rsyslog will be installed" + G_DIETPI-NOTIFY 2 "Rsyslog will be installed" break @@ -3197,7 +3197,7 @@ _EOF_ # - Flag for install aSOFTWARE_INSTALL_STATE[7]=1 - dietpi-notify 2 "FFmpeg will be installed" + G_DIETPI-NOTIFY 2 "FFmpeg will be installed" break @@ -3215,7 +3215,7 @@ _EOF_ # - Flag for install aSOFTWARE_INSTALL_STATE[8]=1 - dietpi-notify 2 "Oracle Java will be installed" + G_DIETPI-NOTIFY 2 "Oracle Java will be installed" break @@ -3233,7 +3233,7 @@ _EOF_ # - Flag for install aSOFTWARE_INSTALL_STATE[9]=1 - dietpi-notify 2 "NodeJS will be installed" + G_DIETPI-NOTIFY 2 "NodeJS will be installed" break @@ -3251,7 +3251,7 @@ _EOF_ # - Flag for install aSOFTWARE_INSTALL_STATE[5]=1 - dietpi-notify 2 "Alsa will be installed" + G_DIETPI-NOTIFY 2 "Alsa will be installed" break @@ -3269,7 +3269,7 @@ _EOF_ # - Flag for install aSOFTWARE_INSTALL_STATE[6]=1 - dietpi-notify 2 "Xserver will be installed" + G_DIETPI-NOTIFY 2 "Xserver will be installed" break @@ -3322,37 +3322,37 @@ _EOF_ Create_UserContent_Folders(){ - mkdir -p "$FP_DIETPI_USERDATA"/"$FOLDER_MUSIC" - mkdir -p "$FP_DIETPI_USERDATA"/"$FOLDER_PICTURES" - mkdir -p "$FP_DIETPI_USERDATA"/"$FOLDER_VIDEO" - mkdir -p "$FP_DIETPI_USERDATA"/"$FOLDER_DOWNLOADS" + mkdir -p "$G_FP_DIETPI_USERDATA"/"$FOLDER_MUSIC" + mkdir -p "$G_FP_DIETPI_USERDATA"/"$FOLDER_PICTURES" + mkdir -p "$G_FP_DIETPI_USERDATA"/"$FOLDER_VIDEO" + mkdir -p "$G_FP_DIETPI_USERDATA"/"$FOLDER_DOWNLOADS" } Download_Test_Media(){ - if [ ! -f "$FP_DIETPI_USERDATA/$FOLDER_MUSIC"/fourdee_tech.ogg ]; then + if [ ! -f "$G_FP_DIETPI_USERDATA/$FOLDER_MUSIC"/fourdee_tech.ogg ]; then #Grab My test music - wget http://dietpi.com/downloads/audio/fourdee_tech.ogg -O "$FP_DIETPI_USERDATA/$FOLDER_MUSIC"/fourdee_tech.ogg - #wget http://dietpi.com/downloads/audio/fourdee_space.mp3 -O "$FP_DIETPI_USERDATA/$FOLDER_MUSIC"/fourdee_space.mp3 + wget http://dietpi.com/downloads/audio/fourdee_tech.ogg -O "$G_FP_DIETPI_USERDATA/$FOLDER_MUSIC"/fourdee_tech.ogg + #wget http://dietpi.com/downloads/audio/fourdee_space.mp3 -O "$G_FP_DIETPI_USERDATA/$FOLDER_MUSIC"/fourdee_space.mp3 #Grab Absolute Radio Streams - wget http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=vrbb -O "$FP_DIETPI_USERDATA/$FOLDER_MUSIC"/Absolute-Radio.pls - wget http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=a8bb -O "$FP_DIETPI_USERDATA/$FOLDER_MUSIC"/Absolute-Radio-80s.pls - wget http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=a9bb -O "$FP_DIETPI_USERDATA/$FOLDER_MUSIC"/Absolute-Radio-90s.pls - wget http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=a0bb -O "$FP_DIETPI_USERDATA/$FOLDER_MUSIC"/Absolute-Radio-00s.pls + wget http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=vrbb -O "$G_FP_DIETPI_USERDATA/$FOLDER_MUSIC"/Absolute-Radio.pls + wget http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=a8bb -O "$G_FP_DIETPI_USERDATA/$FOLDER_MUSIC"/Absolute-Radio-80s.pls + wget http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=a9bb -O "$G_FP_DIETPI_USERDATA/$FOLDER_MUSIC"/Absolute-Radio-90s.pls + wget http://network.absoluteradio.co.uk/core/audio/ogg/live.pls?service=a0bb -O "$G_FP_DIETPI_USERDATA/$FOLDER_MUSIC"/Absolute-Radio-00s.pls fi } #apt-get install - AGI_ERROR_CHECKED(){ + G_AGI_ERROR_CHECKED(){ local string="$@" - AGI $string + G_AGI $string if (( $? != 0 )); then Error_AptGet_Failed @@ -3362,10 +3362,10 @@ _EOF_ } #apt-get purge - AGP_ERROR_CHECKED(){ + G_AGP_ERROR_CHECKED(){ local string="$@" - AGP $string + G_AGP $string if (( $? != 0 )); then Error_AptGet_Failed @@ -3375,9 +3375,9 @@ _EOF_ } #apt-get install -f - AGF_ERROR_CHECKED(){ + G_AGF_ERROR_CHECKED(){ - AGF + G_AGF if (( $? != 0 )); then Error_AptGet_Failed @@ -3393,7 +3393,7 @@ _EOF_ local gigabit_device=1 # - Lets hope the next RPi device is finally gigabit capable. I'll cry if it is not. - if (( $HW_MODEL <= 3 || $HW_MODEL == 30 || $HW_MODEL == 32 || $HW_MODEL == 40 || $HW_MODEL == 60 || $HW_MODEL == 70 )); then + if (( $G_HW_MODEL <= 3 || $G_HW_MODEL == 30 || $G_HW_MODEL == 32 || $G_HW_MODEL == 40 || $G_HW_MODEL == 60 || $G_HW_MODEL == 70 )); then gigabit_device=0 @@ -3410,7 +3410,7 @@ _EOF_ output=2 # - Bump up for VM's - if (( $HW_MODEL == 20 || $HW_MODEL == 21 )); then + if (( $G_HW_MODEL == 20 || $G_HW_MODEL == 21 )); then output=3 @@ -3422,7 +3422,7 @@ _EOF_ output=20 # - Bump up for VM's - if (( $HW_MODEL == 20 || $HW_MODEL == 21 )); then + if (( $G_HW_MODEL == 20 || $G_HW_MODEL == 21 )); then output=40 @@ -3433,17 +3433,17 @@ _EOF_ # - Reduce for RPi's. This is due to the USB bus ethernet in the ARM SoC, which cripples network throughput/performance/latency. # - RPi v3 - elif (( $HW_MODEL == 3 )); then + elif (( $G_HW_MODEL == 3 )); then output=15 # - RPi v2 - elif (( $HW_MODEL == 2 )); then + elif (( $G_HW_MODEL == 2 )); then output=13 # - RPi v1 256/512 - elif (( $HW_MODEL <= 1 )); then + elif (( $G_HW_MODEL <= 1 )); then output=7 @@ -3455,7 +3455,7 @@ _EOF_ output=3 # - Bump up for VM's - if (( $HW_MODEL == 20 || $HW_MODEL == 21 )); then + if (( $G_HW_MODEL == 20 || $G_HW_MODEL == 21 )); then output=5 @@ -3465,7 +3465,7 @@ _EOF_ output=4 # - Reduce for RPi's. This is due to the USB bus ethernet in the ARM SoC, which cripples network throughput/performance/latency. - elif (( $HW_MODEL <= 3 )); then + elif (( $G_HW_MODEL <= 3 )); then output=2 @@ -3502,19 +3502,19 @@ _EOF_ # # INSTALL_URL_ADDRESS='https://github.com/Hellowlol/HTPC-Manager.git' # - # Check_URL "$INSTALL_URL_ADDRESS" + # G_CHECK_URL "$INSTALL_URL_ADDRESS" # #Install # if (( $? == 0 )); then # # #Install Python and PIP - # AGI_ERROR_CHECKED python python-pip python-imaging + # G_AGI_ERROR_CHECKED python python-pip python-imaging # # cd "$HOME" # git clone --depth=1 "$INSTALL_URL_ADDRESS" # # # - Move HTPC Manager to a 'better' location - # mkdir -p "$FP_DIETPI_USERDATA"/htpc-manager - # mv "$HOME"/HTPC-Manager/* "$FP_DIETPI_USERDATA"/htpc-manager/ + # mkdir -p "$G_FP_DIETPI_USERDATA"/htpc-manager + # mv "$HOME"/HTPC-Manager/* "$G_FP_DIETPI_USERDATA"/htpc-manager/ # rm -R "$HOME"/HTPC-Manager # # else @@ -3537,11 +3537,11 @@ _EOF_ # - For desktop entries/icons hosted on dietpi.com INSTALL_URL_ADDRESS='http://dietpi.com/downloads/conf/desktop' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - AGI_ERROR_CHECKED lxde upower policykit-1 iceweasel p7zip-full --no-install-recommends + G_AGI_ERROR_CHECKED lxde upower policykit-1 iceweasel p7zip-full --no-install-recommends #upower policykit-1. Needed for LXDE logout menu item to show shutdown/restart ...... else @@ -3561,11 +3561,11 @@ _EOF_ # - For desktop entries/icons hosted on dietpi.com INSTALL_URL_ADDRESS='http://dietpi.com/downloads/conf/desktop' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - AGI_ERROR_CHECKED mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full --no-install-recommends + G_AGI_ERROR_CHECKED mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full --no-install-recommends else @@ -3584,11 +3584,11 @@ _EOF_ # - For desktop entries/icons hosted on dietpi.com INSTALL_URL_ADDRESS='http://dietpi.com/downloads/conf/desktop' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - AGI_ERROR_CHECKED x-window-system-core wmaker gnustep gnustep-devel gnustep-games libc-dbg upower policykit-1 iceweasel p7zip-full --no-install-recommends + G_AGI_ERROR_CHECKED x-window-system-core wmaker gnustep gnustep-devel gnustep-games libc-dbg upower policykit-1 iceweasel p7zip-full --no-install-recommends else @@ -3607,11 +3607,11 @@ _EOF_ # - For desktop entries/icons hosted on dietpi.com INSTALL_URL_ADDRESS='http://dietpi.com/downloads/conf/desktop' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - AGI_ERROR_CHECKED xfce4 xfce4-terminal gnome-icon-theme tango-icon-theme iceweasel p7zip-full --no-install-recommends + G_AGI_ERROR_CHECKED xfce4 xfce4-terminal gnome-icon-theme tango-icon-theme iceweasel p7zip-full --no-install-recommends else @@ -3627,7 +3627,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED xrdp + G_AGI_ERROR_CHECKED xrdp fi @@ -3639,24 +3639,24 @@ _EOF_ INSTALL_DESCRIPTION="NoMachine (Secure RDP Server & Client)" #x86_64 - if (( $HW_ARCH == 10 )); then + if (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/nomachine_5.1.44_1_amd64.deb' #arm6 (RPi1) - elif (( $HW_ARCH == 1 )); then + elif (( $G_HW_ARCH == 1 )); then INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/nomachine_5.1.44_3_armv6hf.deb' #arm7+ (RPi 2/3) - elif (( $HW_ARCH == 2 )); then + elif (( $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/nomachine_5.1.44_armhf.deb' fi # Now, check that the links are legitimate - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -3677,7 +3677,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED transmission-daemon + G_AGI_ERROR_CHECKED transmission-daemon fi @@ -3688,7 +3688,7 @@ _EOF_ Banner_Installing echo -e "proftpd-basic shared/proftpd/inetd_or_standalone select standalone" | debconf-set-selections - AGI_ERROR_CHECKED proftpd-basic + G_AGI_ERROR_CHECKED proftpd-basic fi @@ -3697,7 +3697,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED samba samba-common-bin --no-install-recommends + G_AGI_ERROR_CHECKED samba samba-common-bin --no-install-recommends fi @@ -3707,7 +3707,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED vsftpd --no-install-recommends + G_AGI_ERROR_CHECKED vsftpd --no-install-recommends fi @@ -3717,7 +3717,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED nfs-kernel-server nfs-common ucf rpcbind + G_AGI_ERROR_CHECKED nfs-kernel-server nfs-common ucf rpcbind fi @@ -3726,7 +3726,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED apache2 + G_AGI_ERROR_CHECKED apache2 fi @@ -3735,7 +3735,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED nginx xml-core --no-install-recommends + G_AGI_ERROR_CHECKED nginx xml-core --no-install-recommends fi @@ -3744,7 +3744,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED lighttpd + G_AGI_ERROR_CHECKED lighttpd fi @@ -3757,7 +3757,7 @@ _EOF_ debconf-set-selections <<< "mysql-server mysql-server/root_password password $GLOBAL_PW" debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $GLOBAL_PW" - AGI_ERROR_CHECKED mysql-server + G_AGI_ERROR_CHECKED mysql-server # Fix depricated key_buffer -> key_buffer_size per MySQL 5.x notification sed -i 's/^key_buffer[[:space:]]/key_buffer_size /g' /etc/mysql/my.cnf @@ -3773,7 +3773,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED mariadb-server + G_AGI_ERROR_CHECKED mariadb-server fi @@ -3782,7 +3782,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED sqlite3 + G_AGI_ERROR_CHECKED sqlite3 fi @@ -3791,11 +3791,11 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED redis-server + G_AGI_ERROR_CHECKED redis-server #Redis php module | == 2 to check for existing installs, if == 1, then module will be installed together with PHP, to prevent dependency installations if (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )); then - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-redis + G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-redis fi @@ -3810,42 +3810,42 @@ _EOF_ #Install base PHP packages/modules. if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME" libapache2-mod-"$PHP_APT_PACKAGE_NAME" + G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME" libapache2-mod-"$PHP_APT_PACKAGE_NAME" else - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-fpm "$PHP_APT_PACKAGE_NAME"-cgi + G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-fpm "$PHP_APT_PACKAGE_NAME"-cgi # 'php-xsl' does not exist for >= Stretch, 'php7.0-xsl' is just dummy for 'php7.0-xml': https://github.com/Fourdee/DietPi/issues/1286 - (( $DISTRO < 4 )) && AGI_ERROR_CHECKED php5-xsl + (( $G_DISTRO < 4 )) && G_AGI_ERROR_CHECKED php5-xsl fi #php-common modules, used by most web software - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-curl "$PHP_APT_PACKAGE_NAME"-gd "$PHP_APT_PACKAGE_NAME"-apcu "$PHP_APT_PACKAGE_NAME"-mcrypt + G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-curl "$PHP_APT_PACKAGE_NAME"-gd "$PHP_APT_PACKAGE_NAME"-apcu "$PHP_APT_PACKAGE_NAME"-mcrypt # + stretch extras - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mbstring "$PHP_APT_PACKAGE_NAME"-zip "$PHP_APT_PACKAGE_NAME"-xml + G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mbstring "$PHP_APT_PACKAGE_NAME"-zip "$PHP_APT_PACKAGE_NAME"-xml fi #php-SQL modules if (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 )); then - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mysql + G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mysql fi if (( ${aSOFTWARE_INSTALL_STATE[88]} >= 1 )); then - if (( $DISTRO < 4 )); then + if (( $G_DISTRO < 4 )); then #For <= Jessie, php5-mysqlnd provides the newer mysql client libraries compared to php5-mysql. - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mysqlnd + G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mysqlnd else #For >= Stretch, php(7.X)-mysqlnd does not exist, thus php-mysql need to be installed: https://packages.debian.org/de/stretch/php-mysql - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mysql + G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mysql fi @@ -3853,14 +3853,14 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[87]} >= 1 )); then - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-sqlite* #wildcard for version (eg:3) + G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-sqlite* #wildcard for version (eg:3) fi #Redis php module if (( ${aSOFTWARE_INSTALL_STATE[91]} >= 1 )); then - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-redis + G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-redis fi @@ -3895,7 +3895,7 @@ _EOF_ fi - AGI_ERROR_CHECKED phpmyadmin + G_AGI_ERROR_CHECKED phpmyadmin fi @@ -3906,18 +3906,18 @@ _EOF_ Banner_Installing #Jessie - if (( $DISTRO == 3 )); then + if (( $G_DISTRO == 3 )); then #MPD not available in Jessie Repo for ARMv8 - if (( $HW_ARCH == 3 )); then + if (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/mpd_0.19.21_arm64.deb' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then #libupnp6 for net discov with upnp/avahi - AGI_ERROR_CHECKED libupnp6 - AGI_ERROR_CHECKED libmpdclient2 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file --no-install-recommends + G_AGI_ERROR_CHECKED libupnp6 + G_AGI_ERROR_CHECKED libmpdclient2 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file --no-install-recommends wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb @@ -3931,7 +3931,7 @@ _EOF_ else - AGI_ERROR_CHECKED mpd + G_AGI_ERROR_CHECKED mpd fi @@ -3941,22 +3941,22 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/mpd_0.20.11-1_' #armv6 - if (( $HW_ARCH == 1 )); then + if (( $G_HW_ARCH == 1 )); then INSTALL_URL_ADDRESS+='armv6' #armv7+ - elif (( $HW_ARCH == 2 )); then + elif (( $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS+='armv7' #ARMv8 - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS+='armv8' #x86_64 - elif (( $HW_ARCH == 10 )); then + elif (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS+='amd64' @@ -3964,11 +3964,11 @@ _EOF_ INSTALL_URL_ADDRESS+='.deb' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then #Prereqs - AGI_ERROR_CHECKED libmpdclient2 libflac8 libyajl2 libavahi-client3 libvorbisfile3 libwavpack1 libmad0 libmpg123-0 libopus0 libavformat57 libfaad2 libcdio-paranoia1 libiso9660-8 libshout3 libid3tag0 + G_AGI_ERROR_CHECKED libmpdclient2 libflac8 libyajl2 libavahi-client3 libvorbisfile3 libwavpack1 libmad0 libmpg123-0 libopus0 libavformat57 libfaad2 libcdio-paranoia1 libiso9660-8 libshout3 libid3tag0 apt-mark unhold mpd &> /dev/null #??? Not required for dpkg -i installs @@ -3995,7 +3995,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://www.phpbb.com/files/release/phpBB-3.1.6.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -4019,17 +4019,17 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://github.com/OpenBazaar/OpenBazaar-Server.git' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then - AGI_ERROR_CHECKED libsodium-dev automake autoconf pkg-config libtool libssl-dev libffi-dev python-dev openssl libzmq3-dev + G_AGI_ERROR_CHECKED libsodium-dev automake autoconf pkg-config libtool libssl-dev libffi-dev python-dev openssl libzmq3-dev #Not required. - #AGI_ERROR_CHECKED software-properties-common + #G_AGI_ERROR_CHECKED software-properties-common #add-apt-repository -y ppa:chris-lea/libsodium - #AGUP + #G_AGUP pip install cryptography @@ -4040,7 +4040,7 @@ _EOF_ # - compile cd "$HOME"/libzmq - ./autogen.sh && ./configure && make -j $HW_CPU_CORES + ./autogen.sh && ./configure && make -j $G_HW_CPU_CORES make check && make install && ldconfig cd "$HOME"/pynacl @@ -4079,7 +4079,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://yacy.net/release/yacy_v1.92_20161226_9000.tar.gz' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O package.tar.gz @@ -4100,24 +4100,24 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS="https://download.owncloud.org/download/repositories/stable/Debian_$(( $DISTRO + 5 )).0/Release.key" + INSTALL_URL_ADDRESS="https://download.owncloud.org/download/repositories/stable/Debian_$(( $G_DISTRO + 5 )).0/Release.key" # No repository available yet after Stretch, thus we choose archive here: - (( $DISTRO > 4 )) && INSTALL_URL_ADDRESS='https://download.owncloud.org/community/owncloud-latest.zip' + (( $G_DISTRO > 4 )) && INSTALL_URL_ADDRESS='https://download.owncloud.org/community/owncloud-latest.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then # Install necessary PHP modules: https://doc.owncloud.org/server/latest/admin_manual/installation/source_installation.html#php-extensions - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis + G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis if [ ! -f /etc/apt/sources.list.d/owncloud.list ] && [ ! -f /var/www/owncloud/occ ]; then wget "$INSTALL_URL_ADDRESS" -O owncloud.key_or_zip - if (( $DISTRO < 5 )); then + if (( $G_DISTRO < 5 )); then - echo -e "deb https://download.owncloud.org/download/repositories/stable/Debian_$(( $DISTRO + 5 )).0/ /" > /etc/apt/sources.list.d/owncloud.list - apt-key add - < owncloud.key_or_zip && AGUP + echo -e "deb https://download.owncloud.org/download/repositories/stable/Debian_$(( $G_DISTRO + 5 )).0/ /" > /etc/apt/sources.list.d/owncloud.list + apt-key add - < owncloud.key_or_zip && G_AGUP else @@ -4128,7 +4128,7 @@ _EOF_ fi - [ -f /etc/apt/sources.list.d/owncloud.list ] && AGI_ERROR_CHECKED owncloud-files + [ -f /etc/apt/sources.list.d/owncloud.list ] && G_AGI_ERROR_CHECKED owncloud-files else @@ -4146,12 +4146,12 @@ _EOF_ INSTALL_URL_ADDRESS='https://download.nextcloud.com/server/releases/latest-12.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then # Install necessary PHP modules: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis + G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis if [ ! -f /var/www/nextcloud/occ ]; then @@ -4176,7 +4176,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/ympd_1.2.3.7z' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" # Install if (( $? == 0 )); then @@ -4186,28 +4186,28 @@ _EOF_ local binary_name='ympd_' # - armv6 - if (( $HW_ARCH == 1 )); then + if (( $G_HW_ARCH == 1 )); then binary_name+='armv6' # - armv7 - elif (( $HW_ARCH == 2 )); then + elif (( $G_HW_ARCH == 2 )); then binary_name+='armv7' # - arm64 - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then binary_name+='armv8' # - x86_64 - elif (( $HW_ARCH == 10 )); then + elif (( $G_HW_ARCH == 10 )); then binary_name+='amd64' fi - binary_name+="_$DISTRO_NAME" + binary_name+="_$G_DISTRO_NAME" mv "$binary_name" /usr/bin/ympd chmod +x /usr/bin/ympd @@ -4230,12 +4230,12 @@ _EOF_ Banner_Installing #x86_64 - if (( $HW_ARCH == 10 )); then + if (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS='http://download.roonlabs.com/builds/RoonBridge_linuxx64.tar.bz2' #ARMv8 - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS='http://download.roonlabs.com/builds/RoonBridge_linuxarmv8.tar.bz2' @@ -4246,7 +4246,7 @@ _EOF_ fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" # Install if (( $? == 0 )); then @@ -4277,28 +4277,28 @@ _EOF_ Banner_Installing # - armv6 - if (( $HW_ARCH == 1 )); then + if (( $G_HW_ARCH == 1 )); then INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/cava_0.4.2_armv6.deb' # - armv7 - elif (( $HW_ARCH == 2 )); then + elif (( $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/cava_0.4.2_armv7.deb' # - arm64 - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/cava_0.4.2_arm64.deb' fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" # Install if (( $? == 0 )); then - AGI_ERROR_CHECKED libpulse0 libfftw3-3 + G_AGI_ERROR_CHECKED libpulse0 libfftw3-3 wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb @@ -4322,7 +4322,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://apt.mopidy.com/mopidy.gpg' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" # Install if (( $? == 0 )); then @@ -4330,15 +4330,15 @@ _EOF_ wget -q -O - "$INSTALL_URL_ADDRESS" | apt-key add - wget https://apt.mopidy.com/jessie.list -O /etc/apt/sources.list.d/mopidy.list - AGUP - AGI_ERROR_CHECKED mopidy + G_AGUP + G_AGI_ERROR_CHECKED mopidy #ARMv8 #NB: No ARM64 packages currently exist in mopidy repo. So it will throw a minor error when updating apt. #Mopidy web client extensions not loading in webpage... - # if (( $HW_ARCH == 3 )); then + # if (( $G_HW_ARCH == 3 )); then - # AGI_ERROR_CHECKED build-essential python-dev + # G_AGI_ERROR_CHECKED build-essential python-dev # pip install mopidy #no effect, claims already upto date. # fi @@ -4360,44 +4360,44 @@ _EOF_ Banner_Installing #Odroids - if (( $HW_MODEL >= 10 )) && (( $HW_MODEL < 20 )); then + if (( $G_HW_MODEL >= 10 )) && (( $G_HW_MODEL < 20 )); then - AGI_ERROR_CHECKED kodi-odroid + G_AGI_ERROR_CHECKED kodi-odroid #XU4 - requires pulse audio (fixes corrupt sound) - if (( $HW_MODEL == 11 )); then + if (( $G_HW_MODEL == 11 )); then - AGI_ERROR_CHECKED pulseaudio --no-install-recommends + G_AGI_ERROR_CHECKED pulseaudio --no-install-recommends fi #Everything else else - AGI_ERROR_CHECKED kodi + G_AGI_ERROR_CHECKED kodi fi # - libcurl3-gnutls required for C2. But lets apply to all: https://github.com/Fourdee/DietPi/issues/446 - AGI_ERROR_CHECKED libcurl3-gnutls + G_AGI_ERROR_CHECKED libcurl3-gnutls # - Add NFS support for kodi - if (( $DISTRO == 3 )); then + if (( $G_DISTRO == 3 )); then - AGI_ERROR_CHECKED libnfs4 + G_AGI_ERROR_CHECKED libnfs4 fi # - CEC support | * due to C2 having libcec3v4, rpi has libcec3. # XU4 package conflict: https://github.com/Fourdee/DietPi/issues/554 # Due to the vast differences in libcec naming across devices, if CEC fails to install, do not terminate DietPi install. - AGI libcec3* + G_AGI libcec3* if (( $? != 0 )); then - AGI libcec3 + G_AGI libcec3 if (( $? != 0 )); then - dietpi-notify 2 "libcec3 failed to install." + G_DIETPI-NOTIFY 2 "libcec3 failed to install." fi @@ -4410,7 +4410,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED minidlna + G_AGI_ERROR_CHECKED minidlna fi @@ -4421,12 +4421,12 @@ _EOF_ Banner_Installing #x32 x64 - if (( $HW_MODEL == 20 || $HW_MODEL == 21 )); then + if (( $G_HW_MODEL == 20 || $G_HW_MODEL == 21 )); then INSTALL_URL_ADDRESS="http://dietpi.com/downloads/binaries/all/noip_x32_x64.zip" #ARMv8 - elif (( ( $HW_MODEL == 12 ) || ( $HW_MODEL >=40 && $HW_MODEL < 50 ) )); then + elif (( ( $G_HW_MODEL == 12 ) || ( $G_HW_MODEL >=40 && $G_HW_MODEL < 50 ) )); then INSTALL_URL_ADDRESS="http://dietpi.com/downloads/binaries/all/noip_arm64.zip" @@ -4436,7 +4436,7 @@ _EOF_ INSTALL_URL_ADDRESS="http://dietpi.com/downloads/binaries/all/noip_armhf.zip" fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -4463,21 +4463,21 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/amiberry-rpi_v2.1.1.7z' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then - AGI_ERROR_CHECKED alsa-oss joystick libsdl-image1.2 libsdl-ttf2.0-0 libsdl-gfx1.2-5 libguichan-0.8.1-1* libguichan-allegro-0.8.1-1* libguichan-sdl-0.8.1-1* libguichan-opengl-0.8.1-1* libjpgalleg4.4 libxml2 libmpg123-0 + G_AGI_ERROR_CHECKED alsa-oss joystick libsdl-image1.2 libsdl-ttf2.0-0 libsdl-gfx1.2-5 libguichan-0.8.1-1* libguichan-allegro-0.8.1-1* libguichan-sdl-0.8.1-1* libguichan-opengl-0.8.1-1* libjpgalleg4.4 libxml2 libmpg123-0 #libmpeg2-4 # Required for dev branch # + SDL2 - AGI_ERROR_CHECKED libpng12-0 libflac8 libmpg123-0 libgoogle-perftools4 libfreetype6 libxxf86vm1 + G_AGI_ERROR_CHECKED libpng12-0 libflac8 libmpg123-0 libgoogle-perftools4 libfreetype6 libxxf86vm1 #Download binaries # - Backup existing autostart.uae for user - mv "$FP_DIETPI_USERDATA"/amiberry/conf/autostart.uae "$FP_DIETPI_USERDATA"/amiberry/conf/autostart_pre-dietpi-update.uae &> /dev/null + mv "$G_FP_DIETPI_USERDATA"/amiberry/conf/autostart.uae "$G_FP_DIETPI_USERDATA"/amiberry/conf/autostart_pre-dietpi-update.uae &> /dev/null wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z -o/etc @@ -4498,15 +4498,15 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/rpi/dxx-rebirth.7z' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then - AGI_ERROR_CHECKED libsdl-mixer1.2 libsdl1.2debian libphysfs1 + G_AGI_ERROR_CHECKED libsdl-mixer1.2 libsdl1.2debian libphysfs1 wget "$INSTALL_URL_ADDRESS" -O package.7z - 7z x -y package.7z -o"$FP_DIETPI_USERDATA" + 7z x -y package.7z -o"$G_FP_DIETPI_USERDATA" rm package.7z else @@ -4523,31 +4523,31 @@ _EOF_ Banner_Installing - if (( $HW_ARCH == 10 )); then + if (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS='http://hndl.urbackup.org/Server/2.1.19/urbackup-server_2.1.19_amd64.deb' - elif (( $HW_ARCH == 1 || $HW_ARCH == 2 )); then + elif (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS='http://hndl.urbackup.org/Server/2.1.19/urbackup-server_2.1.19_armhf.deb' #ARMv8 sourcebuild - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS='http://hndl.urbackup.org/Server/2.1.19/urbackup-server-2.1.19.tar.gz' fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then #ARMv8 source build - if (( $HW_ARCH == 3 )); then + if (( $G_HW_ARCH == 3 )); then - AGI_ERROR_CHECKED build-essential zlib1g-dev libcurl4-openssl-dev libcrypto++-dev sqlite3 + G_AGI_ERROR_CHECKED build-essential zlib1g-dev libcurl4-openssl-dev libcrypto++-dev sqlite3 wget "$INSTALL_URL_ADDRESS" -O package.tar tar xzvf package.tar @@ -4556,7 +4556,7 @@ _EOF_ cd urbackup-server-* ./configure - make -j $HW_CPU_CORES + make -j $G_HW_CPU_CORES make install sed -i "/ExecStart=/c ExecStart=/usr/local/bin/urbackupsrv run --config /etc/default/urbackupsrv --no-consoletime" urbackup-server.service @@ -4573,7 +4573,7 @@ _EOF_ wget "$INSTALL_URL_ADDRESS" -O package.deb - echo -e "urbackup-server urbackup/backuppath string $FP_DIETPI_USERDATA/urbackup" | debconf-set-selections + echo -e "urbackup-server urbackup/backuppath string $G_FP_DIETPI_USERDATA/urbackup" | debconf-set-selections dpkg -i package.deb apt-get -f install -y @@ -4597,12 +4597,12 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS="http://dietpi.com/downloads/binaries/rpi/opentyrian_armhf.zip" - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then - AGI_ERROR_CHECKED ibsdl1.2debian libsdl-net1.2 --no-install-recommends + G_AGI_ERROR_CHECKED ibsdl1.2debian libsdl-net1.2 --no-install-recommends #Download binaries wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -4625,13 +4625,13 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://github.com/Fourdee/RPi_Cam_Web_Interface/archive/6.2.29.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then #Install pre-reqs - AGI_ERROR_CHECKED gpac motion + G_AGI_ERROR_CHECKED gpac motion #Get source/binaries and extract wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -4680,7 +4680,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED deluged deluge-web deluge-webui deluge-console + G_AGI_ERROR_CHECKED deluged deluge-web deluge-webui deluge-console fi @@ -4690,12 +4690,12 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED python + G_AGI_ERROR_CHECKED python #Download Grasshopper local grasshopper_directory='/var/www' INSTALL_URL_ADDRESS='http://sourceforge.net/projects/grasshopperwebapp/files/grasshopper_v5_application.zip/download' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O grasshopper.zip @@ -4721,7 +4721,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://github.com/harmon25/raspcontrol/archive/master.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -4747,13 +4747,13 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://www.webmin.com/download/deb/webmin-current.deb' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb - AGF_ERROR_CHECKED + G_AGF_ERROR_CHECKED rm package.deb @@ -4772,19 +4772,19 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://packages.openmediavault.org/public' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then echo -e "deb $INSTALL_URL_ADDRESS erasmus main" > /etc/apt/sources.list.d/openmediavault.list - AGUP + G_AGUP - AGI_ERROR_CHECKED openmediavault-keyring + G_AGI_ERROR_CHECKED openmediavault-keyring debconf-set-selections <<< "openmediavault openmediavault/run-initsystem note" debconf-set-selections <<< "postfix postfix/main_mailer_type select No configuration" - AGUP - AGI_ERROR_CHECKED openmediavault postfix + G_AGUP + G_AGI_ERROR_CHECKED openmediavault postfix else @@ -4801,7 +4801,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://github.com/ArturSierzant/OMPD/archive/master.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -4825,7 +4825,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED darkice icecast2 + G_AGI_ERROR_CHECKED darkice icecast2 fi @@ -4836,7 +4836,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://github.com/afaqurk/linux-dash/archive/master.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -4862,11 +4862,11 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://install.pi-hole.net' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then # - Pre-reqs: https://github.com/Fourdee/DietPi/issues/1282#issuecomment-350490524 - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-cgi "$PHP_APT_PACKAGE_NAME"-sqlite* + G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-cgi "$PHP_APT_PACKAGE_NAME"-sqlite* # - Check free available memory. Increase swapfile size to prevent gravity running out of mem. if (( $(free -m | grep -m1 'Mem:' | awk '{print $4}') < 512 )); then @@ -4874,7 +4874,7 @@ _EOF_ if [ -f /etc/dphys-swapfile ] && (( $(grep 'CONF_SWAPSIZE=' /etc/dphys-swapfile | sed 's/.*=//') < 512 )); then - dietpi-notify 2 "Increasing swapfile size to 512MB before running gravity.sh, please wait...\n" + G_DIETPI-NOTIFY 2 "Increasing swapfile size to 512MB before running gravity.sh, please wait...\n" /DietPi/dietpi/func/dietpi-set_dphys-swapfile 512 fi @@ -4891,7 +4891,7 @@ _EOF_ local exit_code=$? if (( $exit_code != 0 )); then - dietpi-notify 1 "Pi-Hole exited with code ($exit_code) and is not installed." + G_DIETPI-NOTIFY 1 "Pi-Hole exited with code ($exit_code) and is not installed." aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]=0 fi @@ -4913,10 +4913,10 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://sourceforge.net/projects/subsonic/files/subsonic/5.3/subsonic-5.3.deb/download' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - #AGI_ERROR_CHECKED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 + #G_AGI_ERROR_CHECKED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 #Install SubSonic 5.3 wget "$INSTALL_URL_ADDRESS" -O package.deb @@ -4938,10 +4938,10 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://sourceforge.net/projects/subsonic/files/subsonic/6.0/subsonic-6.0.deb/download' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - #AGI_ERROR_CHECKED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 + #G_AGI_ERROR_CHECKED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 #Install SubSonic 6.0 wget "$INSTALL_URL_ADDRESS" -O package.deb @@ -4963,7 +4963,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://github.com/weaved/installer/raw/master/Raspbian%20deb/1.3-07/weavedconnectd_1.3-07v_armhf.deb' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then #Install WEAVED @@ -4995,12 +4995,12 @@ _EOF_ # >= v111 image if [ -f /etc/.dietpi_image_version ]; then - AGI_ERROR_CHECKED python-rpi.gpio python3-rpi.gpio + G_AGI_ERROR_CHECKED python-rpi.gpio python3-rpi.gpio # - < v111 Bug in older DietPi images with sources.list | Use pip, as offical repo = python3-rpi.gpio: Depends: python3 (< 3.3) but 3.4.2-2 is to be installed else - AGI_ERROR_CHECKED python3-pip + G_AGI_ERROR_CHECKED python3-pip pip3 install RPi.GPIO fi @@ -5014,29 +5014,29 @@ _EOF_ Banner_Installing # - RPi - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then # http://git.drogon.net/?p=wiringPi;a=shortlog;h=refs/heads/master snapshot INSTALL_URL_ADDRESS='http://git.drogon.net/?p=wiringPi;a=snapshot;h=HEAD;sf=tgz' # - Odroid's - elif (( $HW_MODEL >= 10 && $HW_MODEL < 20 )); then + elif (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )); then INSTALL_URL_ADDRESS='https://github.com/hardkernel/wiringPi/archive/master.zip' # - BPiPro - elif (( $HW_MODEL == 51 )); then + elif (( $G_HW_MODEL == 51 )); then INSTALL_URL_ADDRESS='https://github.com/LeMaker/WiringBP/archive/bananapro.zip' fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then # - RPi - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then wget "$INSTALL_URL_ADDRESS" -O package.tar tar xfz package.tar @@ -5051,7 +5051,7 @@ _EOF_ fi - if (( $HW_MODEL == 51 )); then + if (( $G_HW_MODEL == 51 )); then mv WiringBP* wiringPi @@ -5088,12 +5088,12 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED python python3 + G_AGI_ERROR_CHECKED python python3 # - RPi, pre-reqs GPIO control for Node-Red - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then - AGI_ERROR_CHECKED python-rpi.gpio + G_AGI_ERROR_CHECKED python-rpi.gpio fi @@ -5108,48 +5108,48 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS="http://repo.mosquitto.org/debian/mosquitto-$DISTRO_NAME.list" - Check_URL "$INSTALL_URL_ADDRESS" + INSTALL_URL_ADDRESS="http://repo.mosquitto.org/debian/mosquitto-$G_DISTRO_NAME.list" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key apt-key add mosquitto-repo.gpg.key rm mosquitto-repo.gpg.key - wget "$INSTALL_URL_ADDRESS" -O /etc/apt/sources.list.d/mosquitto-"$DISTRO_NAME".list + wget "$INSTALL_URL_ADDRESS" -O /etc/apt/sources.list.d/mosquitto-"$G_DISTRO_NAME".list # - ARM64 - if (( $HW_ARCH == 3 )); then + if (( $G_HW_ARCH == 3 )); then - echo -e "deb [arch=armhf] http://repo.mosquitto.org/debian $DISTRO_NAME main" > /etc/apt/sources.list.d/mosquitto-"$DISTRO_NAME".list + echo -e "deb [arch=armhf] http://repo.mosquitto.org/debian $G_DISTRO_NAME main" > /etc/apt/sources.list.d/mosquitto-"$G_DISTRO_NAME".list dpkg --add-architecture armhf fi #Pre-Req stretch # - libssl1.0.0 no longer available: https://github.com/Fourdee/DietPi/issues/1299 - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/' # - ARMv6/7 - if (( $HW_ARCH == 1 || $HW_ARCH == 2 )); then + if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_armhf.deb' # - ARM64 - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_arm64.deb' # - x86_64 - elif (( $HW_ARCH == 10 )); then + elif (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_amd64.deb' fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5168,23 +5168,23 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/' # - ARMv6/7 - if (( $HW_ARCH == 1 || $HW_ARCH == 2 )); then + if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS+='libwebsockets3_1.2.2-1_armhf.deb' # - ARM64 - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS+='libwebsockets3_1.2.2-1_arm64.deb' # - x86_64 - elif (( $HW_ARCH == 10 )); then + elif (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS+='libwebsockets3_1.2.2-1_amd64.deb' fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5201,9 +5201,9 @@ _EOF_ fi - AGUP + G_AGUP - AGI_ERROR_CHECKED mosquitto + G_AGI_ERROR_CHECKED mosquitto else @@ -5221,7 +5221,7 @@ _EOF_ #Binary URL fails connection test, so we need to parent back a little: https://github.com/Fourdee/DietPi/issues/445#issuecomment-283400449 INSTALL_URL_ADDRESS='https://github.com/blynkkk/blynk-server/releases' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -5231,7 +5231,7 @@ _EOF_ wget "$INSTALL_URL_ADDRESS" -O /etc/blynkserver/server.jar # - Install Blynk JS Libary - AGI_ERROR_CHECKED python + G_AGI_ERROR_CHECKED python npm install -g onoff npm install -g blynk-library @@ -5260,7 +5260,7 @@ _EOF_ local apackages=() # Jessie - requires stretch packages - if (( $DISTRO == 3 )); then + if (( $G_DISTRO == 3 )); then apackages+=('http://dietpi.com/downloads/binaries/all/gcc-6-base_6.3.0-6_armhf.deb') apackages+=('http://dietpi.com/downloads/binaries/all/libstdc++6_6.3.0-6_armhf.deb') @@ -5274,7 +5274,7 @@ _EOF_ do INSTALL_URL_ADDRESS="${apackages[$i]}" - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? != 0 )); then Error_NoConnection_NoInstall @@ -5289,12 +5289,12 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then # - Prereqs - AGI_ERROR_CHECKED libasound2 + G_AGI_ERROR_CHECKED libasound2 # - Stretch, install additional packages - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then - AGI_ERROR_CHECKED gcc-6-base libstdc++6 + G_AGI_ERROR_CHECKED gcc-6-base libstdc++6 fi @@ -5322,7 +5322,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED tomcat8 + G_AGI_ERROR_CHECKED tomcat8 fi @@ -5333,11 +5333,11 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://sourceforge.net/projects/webiopi/files/WebIOPi-0.7.1.tar.gz/download' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then #Python dev, pre-reqs - AGI_ERROR_CHECKED python-dev python-setuptools --no-install-recommends + G_AGI_ERROR_CHECKED python-dev python-setuptools --no-install-recommends #Install WEBIOPI wget "$INSTALL_URL_ADDRESS" -O package.tar @@ -5374,7 +5374,7 @@ _EOF_ #LCD panels can be enabled in Dietpi-config > display options # XU4 enable cloudshell - if (( $HW_MODEL == 11 )); then + if (( $G_HW_MODEL == 11 )); then /DietPi/dietpi/func/dietpi-set_hardware lcdpanel odroid-cloudshell @@ -5390,7 +5390,7 @@ _EOF_ INSTALL_URL_ADDRESS='http://www.haproxy.org/download/1.7/src/haproxy-1.7.2.tar.gz' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5403,9 +5403,9 @@ _EOF_ cd haproxy-* #Pre-reqs - AGI_ERROR_CHECKED libpcre3-dev libssl-dev + G_AGI_ERROR_CHECKED libpcre3-dev libssl-dev #Compile and install - make -j $HW_CPU_CORES TARGET=linux2628 CPU=generic USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 USE_LINUX_SPLICE=1 + make -j $G_HW_CPU_CORES TARGET=linux2628 CPU=generic USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 USE_LINUX_SPLICE=1 make install mkdir /etc/haproxy @@ -5436,7 +5436,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/logitechmediaserver_7.9.0_all.deb' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5446,30 +5446,30 @@ _EOF_ rm package.deb #https://github.com/Fourdee/DietPi/issues/736 - AGF_ERROR_CHECKED + G_AGF_ERROR_CHECKED #Stop service service logitechmediaserver stop #Stretch # Compile pre-req CPAN modules??? - # if (( $DISTRO >= 4 )); then + # if (( $G_DISTRO >= 4 )); then - # AGI_ERROR_CHECKED yasm git build-essential automake cpanminus nasm libxml-parser-perl libexpat1-dev libgif-dev zlib1g-dev libjpeg-dev libpng-dev + # G_AGI_ERROR_CHECKED 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 + if (( $G_HW_ARCH == 1 )); then wget http://dietpi.com/downloads/binaries/all/logitechmediaserver_7.9.0_CPAN_5.20_armv6hf.tar.gz -O package.tar tar xvzf package.tar -C / rm package.tar # + ARM64 cpan - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then - AGI_ERROR_CHECKED libxml-parser-perl - AGI_ERROR_CHECKED zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev # shared libs needed for Image::Scale@0.08 + G_AGI_ERROR_CHECKED libxml-parser-perl + G_AGI_ERROR_CHECKED zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev # shared libs needed for Image::Scale@0.08 wget http://dietpi.com/downloads/binaries/all/DietPi-LMS7.9-CPAN_arm64.zip -O package.zip unzip -o package.zip -d /usr/share/squeezeboxserver @@ -5493,7 +5493,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://wordpress.org/latest.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5516,7 +5516,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED tightvncserver x11vnc --no-install-recommends + G_AGI_ERROR_CHECKED tightvncserver x11vnc --no-install-recommends fi @@ -5526,12 +5526,12 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED vnc4server x11vnc --no-install-recommends + G_AGI_ERROR_CHECKED vnc4server x11vnc --no-install-recommends # - Stretch+ - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then - AGI_ERROR_CHECKED tigervnc-common + G_AGI_ERROR_CHECKED tigervnc-common fi @@ -5544,7 +5544,7 @@ _EOF_ Banner_Installing # INSTALL_URL_ADDRESS='https://www.realvnc.com/download/binary/latest/debian/arm/' - # Check_URL "$INSTALL_URL_ADDRESS" + # G_CHECK_URL "$INSTALL_URL_ADDRESS" ##Install # if (( $? == 0 )); then @@ -5564,7 +5564,7 @@ _EOF_ # fi # - Available in Raspbian apt - AGI_ERROR_CHECKED realvnc-vnc-server + G_AGI_ERROR_CHECKED realvnc-vnc-server fi @@ -5576,7 +5576,7 @@ _EOF_ touch /var/log/auth.log #: https://github.com/Fourdee/DietPi/issues/475#issuecomment-310873879 - AGI_ERROR_CHECKED fail2ban --no-install-recommends + G_AGI_ERROR_CHECKED fail2ban --no-install-recommends fi @@ -5588,7 +5588,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/phpsysinfo/phpsysinfo/archive/master.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5614,7 +5614,7 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/Single_File_PHP_Gallery_4.6.1.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5640,7 +5640,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/ampache/ampache/archive/master.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5675,7 +5675,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED openvpn easy-rsa iptables + G_AGI_ERROR_CHECKED openvpn easy-rsa iptables fi @@ -5687,12 +5687,12 @@ _EOF_ INSTALL_URL_ADDRESS='https://install.pivpn.io' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then - AGI_ERROR_CHECKED lsb-release + G_AGI_ERROR_CHECKED lsb-release # - Requires underpriv user: https://github.com/Fourdee/DietPi/issues/570#issuecomment-255588307 useradd pivpn @@ -5737,26 +5737,26 @@ _EOF_ Banner_Installing - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then - AGI_ERROR_CHECKED certbot + G_AGI_ERROR_CHECKED certbot if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then - AGI_ERROR_CHECKED python-certbot-apache + G_AGI_ERROR_CHECKED python-certbot-apache fi if (( ${aSOFTWARE_INSTALL_STATE[85]} >= 1 )); then - AGI_ERROR_CHECKED python-certbot-nginx + G_AGI_ERROR_CHECKED python-certbot-nginx fi else INSTALL_URL_ADDRESS='https://github.com/certbot/certbot/archive/master.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5795,13 +5795,13 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/hostapd_2.5_all.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then # - Prereqs - AGI_ERROR_CHECKED hostapd isc-dhcp-server iptables libnl-3-200 + G_AGI_ERROR_CHECKED hostapd isc-dhcp-server iptables libnl-3-200 wget "$INSTALL_URL_ADDRESS" -O package.zip unzip -o package.zip @@ -5809,7 +5809,7 @@ _EOF_ # - Check for RTL8188C* device, use the patched binary I compiled: https://github.com/pritambaral/hostapd-rtl871xdrv#why if (( $(lsusb | grep -ci -m1 'RTL8188C') || - $HW_MODEL == 70 )); then #Force RTL for allo provided WiFi dongle + $G_HW_MODEL == 70 )); then #Force RTL for allo provided WiFi dongle WIFIHOTSPOT_RTL8188C_DEVICE=1 @@ -5820,7 +5820,7 @@ _EOF_ local filename_hostapd_cli='' # - armv6 - if (( $HW_ARCH == 1 )); then + if (( $G_HW_ARCH == 1 )); then filename_hostapd='hostapd-nl80211-armv6' filename_hostapd_cli='hostapd_cli-armv6' @@ -5832,7 +5832,7 @@ _EOF_ fi # - armv7+ - elif (( $HW_ARCH == 2 )); then + elif (( $G_HW_ARCH == 2 )); then filename_hostapd='hostapd-nl80211-armv7' filename_hostapd_cli='hostapd_cli-armv7' @@ -5844,7 +5844,7 @@ _EOF_ fi # - arm64 - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then filename_hostapd='hostapd-nl80211-arm64' filename_hostapd_cli='hostapd_cli-arm64' @@ -5870,28 +5870,28 @@ _EOF_ # - Stretch, libssl1.0.0 no longer available: https://github.com/Fourdee/DietPi/issues/1299 # Possibly only needed for RPi, however, no harm in installing, cover all bases. - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/' # - ARMv6/7 - if (( $HW_ARCH == 1 || $HW_ARCH == 2 )); then + if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_armhf.deb' # - ARM64 - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_arm64.deb' # - x86_64 - elif (( $HW_ARCH == 10 )); then + elif (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_amd64.deb' fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -5924,7 +5924,7 @@ _EOF_ Banner_Installing # - Prereqs - AGI_ERROR_CHECKED tor + G_AGI_ERROR_CHECKED tor fi @@ -5937,65 +5937,65 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/shairport-sync_3.1.3_' # - ARMv6 - if (( $HW_ARCH == 1 )); then + if (( $G_HW_ARCH == 1 )); then INSTALL_URL_ADDRESS+='armv6.7z' # - ARMv7 - elif (( $HW_ARCH == 2 )); then + elif (( $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS+='armv7.7z' # - ARM64 - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS+='arm64.7z' # - x86_64 - # elif (( $HW_ARCH == 10 )); then + # elif (( $G_HW_ARCH == 10 )); then # INSTALL_URL_ADDRESS+='amd64.7z' fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then # - Prereqs - AGI_ERROR_CHECKED openssl libsoxr0 libavahi-client3 libtool libconfig9 libpopt0 libdaemon0 --no-install-recommends + G_AGI_ERROR_CHECKED openssl libsoxr0 libavahi-client3 libtool libconfig9 libpopt0 libdaemon0 --no-install-recommends # This occured on C2: shairport-sync : Depends: libpopt-dev but it is not installed - #AGI_ERROR_CHECKED libpopt-dev + #G_AGI_ERROR_CHECKED libpopt-dev wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z -o/ rm package.7z # - Stretch, libssl1.0.0 no longer available - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/' # - ARMv6/7 - if (( $HW_ARCH == 1 || $HW_ARCH == 2 )); then + if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_armhf.deb' # - ARM64 - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_arm64.deb' # - x86_64 - elif (( $HW_ARCH == 10 )); then + elif (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_amd64.deb' fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6028,13 +6028,13 @@ _EOF_ #check folder is online INSTALL_URL_ADDRESS='http://dietpi.com/downloads/conf/BruteFIR/' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then # - Prereqs - AGI_ERROR_CHECKED brutefir + G_AGI_ERROR_CHECKED brutefir wget -r -nH --cut-dirs=2 --no-parent --reject="index.htm*" -e robots=off "$INSTALL_URL_ADDRESS" mv BruteFIR /etc/ @@ -6055,7 +6055,7 @@ _EOF_ #check folder is online INSTALL_URL_ADDRESS='https://download.pydio.com/pub/core/archives/pydio-core-8.0.1.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6080,13 +6080,13 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/squeezelite-1.8_all.7z' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then # - Prereqs - AGI_ERROR_CHECKED squeezelite + G_AGI_ERROR_CHECKED squeezelite # - Overwrite binary with latest version: wget "$INSTALL_URL_ADDRESS" -O package.7z @@ -6097,22 +6097,22 @@ _EOF_ local target_binary='' - if (( $HW_ARCH == 1 )); then + if (( $G_HW_ARCH == 1 )); then target_binary='squeezelite_armv6' # - ARMv7 - elif (( $HW_ARCH == 2 )); then + elif (( $G_HW_ARCH == 2 )); then target_binary='squeezelite_armv7' # - ARM64 - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then target_binary='squeezelite_arm64' # - x86_64 - elif (( $HW_ARCH == 10 )); then + elif (( $G_HW_ARCH == 10 )); then target_binary='squeezelite_amd64' @@ -6138,13 +6138,13 @@ _EOF_ #check, is online INSTALL_URL_ADDRESS='https://github.com/Fourdee/emonhub/archive/emon-pi.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then # - Prereqs - AGI_ERROR_CHECKED minicom python-serial python-configobj --no-install-recommends + G_AGI_ERROR_CHECKED minicom python-serial python-configobj --no-install-recommends pip install paho-mqtt pydispatcher wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -6173,7 +6173,7 @@ _EOF_ #check, is online INSTALL_URL_ADDRESS='https://github.com/XavierBerger/RPi-Monitor-deb/raw/a7ae61cec8589b0fe1a835170ff34a268ab4a295/packages/rpimonitor_2.11-r5_all.deb' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6202,35 +6202,35 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/netdata_1.6.0_' #armv6 - if (( $HW_ARCH == 1 )); then + if (( $G_HW_ARCH == 1 )); then INSTALL_URL_ADDRESS+='armv6.deb' #armv7+ - elif (( $HW_ARCH == 2 )); then + elif (( $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS+='armv7.deb' #ARMv8 - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS+='arm64.deb' #amd64 - elif (( $HW_ARCH == 10 )); then + elif (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS+='amd64.deb' fi #check, is online - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then # - For compression - AGI_ERROR_CHECKED --no-install-recommends zlib1g-dev + G_AGI_ERROR_CHECKED --no-install-recommends zlib1g-dev wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb @@ -6252,7 +6252,7 @@ _EOF_ #check folder is online INSTALL_URL_ADDRESS='https://github.com/fruux/Baikal/archive/master.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6276,7 +6276,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED mumble-server + G_AGI_ERROR_CHECKED mumble-server fi @@ -6290,19 +6290,19 @@ _EOF_ INSTALL_URL_ADDRESS='http://download.opensuse.org/repositories/home:/emby/xUbuntu_14.04/' # x86_64, use Debian repos - if (( $HW_ARCH == 10 )); then + if (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS='http://download.opensuse.org/repositories/home:/emby/Debian_' - if (( $DISTRO == 3 )); then + if (( $G_DISTRO == 3 )); then INSTALL_URL_ADDRESS+='8.0' - elif (( $DISTRO == 4 )); then + elif (( $G_DISTRO == 4 )); then INSTALL_URL_ADDRESS+='9.0' - elif (( $DISTRO == 5 )); then + elif (( $G_DISTRO == 5 )); then # http://download.opensuse.org/repositories/home:/emby/Debian_Next/ INSTALL_URL_ADDRESS+='Next' @@ -6313,7 +6313,7 @@ _EOF_ fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -6321,10 +6321,10 @@ _EOF_ wget "$INSTALL_URL_ADDRESS"Release.key apt-key add - < Release.key rm Release.key - AGUP + G_AGUP #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 + if (( $G_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 @@ -6339,7 +6339,7 @@ _EOF_ rm package.deb #ARMv8 - elif (( $HW_ARCH == 3 )); then + elif (( $G_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 @@ -6359,7 +6359,7 @@ _EOF_ fi - AGI_ERROR_CHECKED emby-server embymagick + G_AGI_ERROR_CHECKED emby-server embymagick else @@ -6378,7 +6378,7 @@ _EOF_ #check folder is online #x86_64 - if (( $HW_ARCH == 10 )); then + if (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS='https://downloads.plex.tv/plex-media-server/1.5.6.3790-4613ce077/plexmediaserver_1.5.6.3790-4613ce077_amd64.deb' @@ -6389,13 +6389,13 @@ _EOF_ fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then #x86_64 - if (( $HW_ARCH == 10 )); then + if (( $G_HW_ARCH == 10 )); then wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb @@ -6404,21 +6404,21 @@ _EOF_ #ARM else - echo -e "deb [arch=armhf] $INSTALL_URL_ADDRESS $DISTRO_NAME main" > /etc/apt/sources.list.d/plex.list + echo -e "deb [arch=armhf] $INSTALL_URL_ADDRESS $G_DISTRO_NAME main" > /etc/apt/sources.list.d/plex.list wget -O - "$INSTALL_URL_ADDRESS"dev2day-pms.gpg.key | apt-key add - - AGUP + G_AGUP #ARMv8: Install 32bit binaries - if (( $HW_ARCH == 3 )); then + if (( $G_HW_ARCH == 3 )); then dpkg --add-architecture armhf - AGUP - AGI_ERROR_CHECKED binutils:armhf plexmediaserver-installer:armhf + G_AGUP + G_AGI_ERROR_CHECKED binutils:armhf plexmediaserver-installer:armhf #ARM32 else - AGI_ERROR_CHECKED plexmediaserver-installer + G_AGI_ERROR_CHECKED plexmediaserver-installer fi @@ -6439,17 +6439,17 @@ _EOF_ Banner_Installing #x86_64 - if (( $HW_ARCH == 10 )); then + if (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS='http://builds.cuberite.org/job/Cuberite%20Linux%20x64%20Master/lastSuccessfulBuild/artifact/Cuberite.tar.gz' #32bit ARM - elif (( $HW_ARCH == 1 || $HW_ARCH == 2 )); then + elif (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS='http://builds.cuberite.org/job/Cuberite%20Linux%20raspi-armhf%20Master/lastSuccessfulBuild/artifact/Cuberite.tar.gz' fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6480,16 +6480,16 @@ _EOF_ #check folder is online INSTALL_URL_ADDRESS='https://github.com/hexparrot/mineos-node.git' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then #prereqs - AGI_ERROR_CHECKED python python3 supervisor rdiff-backup screen rsync + G_AGI_ERROR_CHECKED python python3 supervisor rdiff-backup screen rsync - mkdir -p "$FP_DIETPI_USERDATA"/mineos - cd "$FP_DIETPI_USERDATA"/mineos + mkdir -p "$G_FP_DIETPI_USERDATA"/mineos + cd "$G_FP_DIETPI_USERDATA"/mineos git clone https://github.com/hexparrot/mineos-node.git minecraft cd minecraft @@ -6517,22 +6517,22 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/gogs_' #armv6 - if (( $HW_ARCH == 1 )); then + if (( $G_HW_ARCH == 1 )); then INSTALL_URL_ADDRESS+='armv6.zip' #armv7+ - elif (( $HW_ARCH == 2 )); then + elif (( $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS+='armv7.zip' #x86_64 - elif (( $HW_ARCH == 10 )); then + elif (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS+='amd64.zip' fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6557,7 +6557,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED qbittorrent-nox + G_AGI_ERROR_CHECKED qbittorrent-nox fi @@ -6568,21 +6568,21 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://bintray.com/novik65/generic/download_file?file_path=ruTorrent-3.7.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then - AGI_ERROR_CHECKED rtorrent screen #mediainfo + G_AGI_ERROR_CHECKED rtorrent screen #mediainfo #Raspbian unrar free - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then - AGI_ERROR_CHECKED unrar-free #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 + G_AGI_ERROR_CHECKED unrar-free #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 else - AGI_ERROR_CHECKED unrar #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 + G_AGI_ERROR_CHECKED unrar #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 fi @@ -6609,9 +6609,9 @@ _EOF_ Banner_Installing - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then - AGI_ERROR_CHECKED aria2 + G_AGI_ERROR_CHECKED aria2 else @@ -6619,32 +6619,32 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/aria2_' # - armv6 - if (( $HW_ARCH == 1 )); then + if (( $G_HW_ARCH == 1 )); then INSTALL_URL_ADDRESS+='armv6.7z' # - armv7+ - elif (( $HW_ARCH == 2 )); then + elif (( $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS+='armv7.7z' # - arm64 - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS+='arm64.7z' # - x86_64 - elif (( $HW_ARCH == 10 )); then + elif (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS+='x86_64.7z' fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then # - prereqs - AGI_ERROR_CHECKED libc-ares2 + G_AGI_ERROR_CHECKED libc-ares2 wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z @@ -6664,7 +6664,7 @@ _EOF_ #Web interface INSTALL_URL_ADDRESS='https://github.com/ziahamza/webui-aria2/archive/master.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -6689,21 +6689,21 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://github.com/SickRage/SickRage/archive/master.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then - AGI_ERROR_CHECKED python libxslt1.1 libxml2 python-openssl python-xmltodict + G_AGI_ERROR_CHECKED python libxslt1.1 libxml2 python-openssl python-xmltodict #Raspbian unrar free - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then - AGI_ERROR_CHECKED unrar-free + G_AGI_ERROR_CHECKED unrar-free else - AGI_ERROR_CHECKED unrar + G_AGI_ERROR_CHECKED unrar fi @@ -6731,17 +6731,17 @@ _EOF_ Banner_Installing # - armv6+ - if (( $HW_ARCH == 1 || $HW_ARCH == 2 )); then + if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS='https://github.com/syncthing/syncthing/releases/download/v0.14.40/syncthing-linux-arm-v0.14.40.tar.gz' # - arm64 - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS='https://github.com/syncthing/syncthing/releases/download/v0.14.40/syncthing-linux-arm64-v0.14.40.tar.gz' # - x86_64 - elif (( $HW_ARCH == 10 )); then + elif (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS='https://github.com/syncthing/syncthing/releases/download/v0.14.40/syncthing-linux-amd64-v0.14.40.tar.gz' @@ -6750,8 +6750,8 @@ _EOF_ #?? #For some reason checking connection (spider) against the files above fails. - #Check_URL "$INSTALL_URL_ADDRESS" - Check_URL https://github.com/syncthing/syncthing + #G_CHECK_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL https://github.com/syncthing/syncthing if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O package.tar @@ -6777,18 +6777,18 @@ _EOF_ Banner_Installing # - armv6/7 - if (( $HW_ARCH == 1 || $HW_ARCH == 2 )); then + if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/libjpeg8_8d1-2_armhf.deb' # - x86_64 - elif (( $HW_ARCH == 10 )); then + elif (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/libjpeg8_8d1-2_amd64.deb' fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O package.deb @@ -6803,21 +6803,21 @@ _EOF_ # - armv6+ - if (( $HW_ARCH == 1 || $HW_ARCH == 2 )); then + if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS='http://patch.codelathe.com/tonido/live/installer/armv6l-rpi/tonido.tar.gz' # - x86_64 - elif (( $HW_ARCH == 10 )); then + elif (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS='http://www.tonido.com/download.php?tonido64.tar.gz' fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - AGI_ERROR_CHECKED libpng12-0 libfontconfig1 + G_AGI_ERROR_CHECKED libpng12-0 libfontconfig1 wget "$INSTALL_URL_ADDRESS" -O package.tar mkdir /etc/tonido @@ -6839,33 +6839,33 @@ _EOF_ Banner_Installing #Stretch via apt - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then - AGI_ERROR_CHECKED chromium-browser + G_AGI_ERROR_CHECKED chromium-browser else - AGI_ERROR_CHECKED chromium + G_AGI_ERROR_CHECKED chromium fi else #armv6+ - if (( $HW_ARCH == 1 || $HW_ARCH == 2 )); then + if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/chromium_52.0.2743.116-1-deb8u1.1_armhf.deb' #ARMv8 - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/chromium_52.0.2743.116-1-deb8u1.1_arm64.deb' fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -6874,13 +6874,13 @@ _EOF_ dpkg -i package.deb # - Odroid's, 'apt-get install -f' removes chromium package, rather than install required deps... - if (( $HW_MODEL >= 10 && $HW_MODEL < 20 )); then + if (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )); then - AGI_ERROR_CHECKED libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7 + G_AGI_ERROR_CHECKED libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7 else - AGF_ERROR_CHECKED + G_AGF_ERROR_CHECKED fi @@ -6888,13 +6888,13 @@ _EOF_ dpkg -i package.deb # armv6+ - if (( $HW_ARCH == 1 || $HW_ARCH == 2 )); then + if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then wget http://dietpi.com/downloads/binaries/all/chromedriver_52.0.2743.116-1-deb8u1.1_armhf.deb -O package.deb dpkg -i package.deb # arm64 - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then wget http://dietpi.com/downloads/binaries/all/chromedriver_52.0.2743.116-1-deb8u1.1_arm64.deb -O package.deb dpkg -i package.deb @@ -6923,16 +6923,16 @@ _EOF_ Banner_Installing #Jessie, prefer latest motion release. - if (( $DISTRO == 3 )); then + if (( $G_DISTRO == 3 )); then INSTALL_URL_ADDRESS='http://github.com/Motion-Project/motion/releases/download/release-4.0.1/pi_jessie_motion_4.0.1-1_armhf.deb' #url/redireect always fails wget spider test... - Check_URL "http://github.com/Motion-Project/motion" + G_CHECK_URL "http://github.com/Motion-Project/motion" if (( $? == 0 )); then # - Prereqs - AGI_ERROR_CHECKED v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev libx264-142 libavcodec56 libavformat56 libmysqlclient18 libswscale3 libpq5 + G_AGI_ERROR_CHECKED v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev libx264-142 libavcodec56 libavformat56 libmysqlclient18 libswscale3 libpq5 # - Motion wget "$INSTALL_URL_ADDRESS" -O package.deb @@ -6952,9 +6952,9 @@ _EOF_ else # - Prereqs - AGI_ERROR_CHECKED v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev + G_AGI_ERROR_CHECKED v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev - AGI_ERROR_CHECKED motion + G_AGI_ERROR_CHECKED motion # - Motioneye pip install motioneye @@ -6969,21 +6969,21 @@ _EOF_ Banner_Installing - if (( $DISTRO == 3 )); then #https://github.com/Fourdee/DietPi/issues/855#issuecomment-292712002 + if (( $G_DISTRO == 3 )); then #https://github.com/Fourdee/DietPi/issues/855#issuecomment-292712002 INSTALL_URL_ADDRESS='http://davesteele.github.io/cloudprint-service' #url/redirect fails wget spider test... - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then INSTALL_URL_ADDRESS+='/repo' echo -e "deb $INSTALL_URL_ADDRESS cloudprint-jessie main" > /etc/apt/sources.list.d/cloudprint.list wget -q -O - https://davesteele.github.io/key-366150CE.pub.txt | apt-key add - - AGUP + G_AGUP - AGI_ERROR_CHECKED cloudprint-service + G_AGI_ERROR_CHECKED cloudprint-service else @@ -6993,7 +6993,7 @@ _EOF_ else - AGI_ERROR_CHECKED cloudprint-service + G_AGI_ERROR_CHECKED cloudprint-service fi @@ -7008,23 +7008,23 @@ _EOF_ INSTALL_URL_ADDRESS='https://virtualhere.com/sites/default/files/usbserver/vhusbd' #armv6+ - if (( $HW_ARCH == 1 || $HW_ARCH == 2 )); then + if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS+='arm' #ARMv8 - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS+='arm64' #x86_64 - elif (( $HW_ARCH == 10 )); then + elif (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS+='x86_64' fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -7052,19 +7052,19 @@ _EOF_ INSTALL_URL_ADDRESS="https://github.com/sabnzbd/sabnzbd/archive/$version.zip" - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then #prereqs - AGI_ERROR_CHECKED par2 python-dev libffi-dev libssl-dev + G_AGI_ERROR_CHECKED par2 python-dev libffi-dev libssl-dev - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then - AGI_ERROR_CHECKED unrar-free + G_AGI_ERROR_CHECKED unrar-free else - AGI_ERROR_CHECKED unrar + G_AGI_ERROR_CHECKED unrar fi @@ -7093,13 +7093,13 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://github.com/Fornoth/spotify-connect-web/releases' #full path fails wget spider test... - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then INSTALL_URL_ADDRESS+='/download/0.0.3-alpha/spotify-connect-web_0.0.3-alpha.tar.gz' wget "$INSTALL_URL_ADDRESS" -O package.tar - tar zxvf package.tar -C "$FP_DIETPI_USERDATA"/ + tar zxvf package.tar -C "$G_FP_DIETPI_USERDATA"/ rm package.tar else @@ -7117,10 +7117,10 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://github.com/CouchPotato/CouchPotatoServer/archive/master.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - AGI_ERROR_CHECKED libffi-dev libssl-dev python-lxml python3-lxml + G_AGI_ERROR_CHECKED libffi-dev libssl-dev python-lxml python3-lxml wget "$INSTALL_URL_ADDRESS" -O package.zip unzip -o package.zip @@ -7147,12 +7147,12 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/phanan/koel/archive/v3.6.2.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then - AGI_ERROR_CHECKED python + G_AGI_ERROR_CHECKED python wget "$INSTALL_URL_ADDRESS" -O package.zip unzip -o package.zip @@ -7186,7 +7186,7 @@ _EOF_ Banner_Installing apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FDA5DFFC - if (( $HW_ARCH == 3 )); then + if (( $G_HW_ARCH == 3 )); then echo -e "deb [arch=armhf] https://apt.sonarr.tv/ master main" > /etc/apt/sources.list.d/sonarr.list @@ -7195,9 +7195,9 @@ _EOF_ echo -e "deb https://apt.sonarr.tv/ master main" > /etc/apt/sources.list.d/sonarr.list fi - AGUP + G_AGUP - AGI_ERROR_CHECKED nzbdrone + G_AGI_ERROR_CHECKED nzbdrone fi @@ -7209,12 +7209,12 @@ _EOF_ INSTALL_URL_ADDRESS='https://api.github.com/repos/Radarr/Radarr/releases' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then - AGI_ERROR_CHECKED mono-devel mediainfo sqlite3 libmono-cil-dev + G_AGI_ERROR_CHECKED mono-devel mediainfo sqlite3 libmono-cil-dev wget $( curl -s "$INSTALL_URL_ADDRESS" | grep linux.tar.gz | grep browser_download_url | head -1 | cut -d \" -f 4 ) -O package.tar tar -xf package.tar -C /opt/ @@ -7236,12 +7236,12 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/JonnyWong16/plexpy.git' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then - AGI_ERROR_CHECKED python + G_AGI_ERROR_CHECKED python git clone --depth=1 "$INSTALL_URL_ADDRESS" @@ -7263,12 +7263,12 @@ _EOF_ INSTALL_URL_ADDRESS='https://api.github.com/repos/Jackett/Jackett/releases' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then - AGI_ERROR_CHECKED mono-devel + G_AGI_ERROR_CHECKED mono-devel wget $( curl -s "$INSTALL_URL_ADDRESS" | grep Jackett.Binaries.Mono.tar.gz | grep browser_download_url | head -1 | cut -d \" -f 4 ) -O package.tar tar -xvf package.tar @@ -7296,7 +7296,7 @@ _EOF_ INSTALL_URL_ADDRESS='http://dist.jriver.com/latest/mediacenter/mediacenter22native.list' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -7304,9 +7304,9 @@ _EOF_ wget -q -O - http://dist.jriver.com/mediacenter@jriver.com.gpg.key | apt-key add - wget "$INSTALL_URL_ADDRESS" -O /etc/apt/sources.list.d/mediacenter22.list - AGUP + G_AGUP - AGI_ERROR_CHECKED mediacenter22 + G_AGI_ERROR_CHECKED mediacenter22 else @@ -7324,7 +7324,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://nzbget.net' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -7332,8 +7332,8 @@ _EOF_ INSTALL_URL_ADDRESS+='/download/nzbget-latest-bin-linux.run' wget "$INSTALL_URL_ADDRESS" -O package.run - mkdir -p "$FP_DIETPI_USERDATA"/nzbget - sh package.run --destdir "$FP_DIETPI_USERDATA"/nzbget + mkdir -p "$G_FP_DIETPI_USERDATA"/nzbget + sh package.run --destdir "$G_FP_DIETPI_USERDATA"/nzbget rm package.run else @@ -7352,19 +7352,19 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/Hellowlol/HTPC-Manager.git' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then #Install Python and PIP - AGI_ERROR_CHECKED python python-pip python-imaging python-dev + G_AGI_ERROR_CHECKED python python-pip python-imaging python-dev cd "$HOME" git clone --depth=1 "$INSTALL_URL_ADDRESS" # - Move HTPC Manager to a 'better' location - mkdir -p "$FP_DIETPI_USERDATA"/htpc-manager - mv "$HOME"/HTPC-Manager/* "$FP_DIETPI_USERDATA"/htpc-manager/ + mkdir -p "$G_FP_DIETPI_USERDATA"/htpc-manager + mv "$HOME"/HTPC-Manager/* "$G_FP_DIETPI_USERDATA"/htpc-manager/ rm -R "$HOME"/HTPC-Manager # - psutil for system stats @@ -7382,16 +7382,16 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://github.com/foosel/OctoPrint.git' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - AGI_ERROR_CHECKED python python-dev + G_AGI_ERROR_CHECKED python python-dev git clone "$INSTALL_URL_ADDRESS" - mv OctoPrint* "$FP_DIETPI_USERDATA"/octoprint + mv OctoPrint* "$G_FP_DIETPI_USERDATA"/octoprint - cd "$FP_DIETPI_USERDATA"/octoprint + cd "$G_FP_DIETPI_USERDATA"/octoprint python setup.py install cd "$HOME" @@ -7410,17 +7410,17 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://download.roonlabs.com/builds/RoonServer_linuxx64.tar.bz2' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - AGI_ERROR_CHECKED libav-tools cifs-utils + G_AGI_ERROR_CHECKED libav-tools cifs-utils wget "$INSTALL_URL_ADDRESS" -O package.tar tar xvf package.tar rm package.tar - mv RoonServer "$FP_DIETPI_USERDATA"/roonserver + mv RoonServer "$G_FP_DIETPI_USERDATA"/roonserver else @@ -7438,7 +7438,7 @@ _EOF_ debconf-set-selections <<< "steam steam/question select I AGREE" - AGI_ERROR_CHECKED steam + G_AGI_ERROR_CHECKED steam fi @@ -7451,7 +7451,7 @@ _EOF_ # Download the proper Minio executable and put it in the proper location # Check to see if this is a n x86 or x64 box. If so download the x86 Minio if not download 32bit ARM linux version - if (( $HW_ARCH == 10 )); then + if (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS='https://dl.minio.io/server/minio/release/linux-amd64/minio' @@ -7461,7 +7461,7 @@ _EOF_ fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then #Download executable @@ -7476,7 +7476,7 @@ _EOF_ # Check, Download, Install startup script INSTALL_URL_ADDRESS='https://github.com/minio/minio-service/raw/master/linux-systemd/minio.service' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then # Download the systemd service script @@ -7493,7 +7493,7 @@ _EOF_ adduser --system --group minio-user # Create default data directory & grant minio-user proper access - mkdir "$FP_DIETPI_USERDATA"/minio-data + mkdir "$G_FP_DIETPI_USERDATA"/minio-data fi @@ -7508,7 +7508,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://get.docker.com' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then # Offical Docker recommended install command @@ -7528,7 +7528,7 @@ _EOF_ Banner_Installing - if (( $HW_ARCH == 10 )); then + if (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS='http://FuguHub.com/install/FuguHub.linux.install' @@ -7538,7 +7538,7 @@ _EOF_ fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -7562,7 +7562,7 @@ _EOF_ INSTALL_URL_ADDRESS='http://ci.mengcraft.com:8080/job/nukkit/lastStableBuild/artifact/target/nukkit-1.0-SNAPSHOT.jar' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -7583,37 +7583,37 @@ _EOF_ INSTALL_URL_ADDRESS='https://dl.gitea.io/gitea/1.3.1/gitea-1.3.1-' #armv6 - if (( $HW_ARCH == 1 )); then + if (( $G_HW_ARCH == 1 )); then INSTALL_URL_ADDRESS+='linux-arm-6' #armv7 - elif (( $HW_ARCH == 2 )); then + elif (( $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS+='linux-arm-7' #armv8 - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS+='linux-arm64' #x86_64 - elif (( $HW_ARCH == 10 )); then + elif (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS+='linux-amd64' fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then # - Data storage / user data - mkdir -p "$FP_DIETPI_USERDATA"/gitea/gitea-repositories + mkdir -p "$G_FP_DIETPI_USERDATA"/gitea/gitea-repositories - wget "$INSTALL_URL_ADDRESS" -O "$FP_DIETPI_USERDATA"/gitea/gitea - chmod +x "$FP_DIETPI_USERDATA"/gitea/gitea + wget "$INSTALL_URL_ADDRESS" -O "$G_FP_DIETPI_USERDATA"/gitea/gitea + chmod +x "$G_FP_DIETPI_USERDATA"/gitea/gitea else @@ -7631,7 +7631,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/allo_web_interface_v4.7z' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O package.7z @@ -7653,28 +7653,28 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/gmrender_1_' - if (( $HW_ARCH == 10 )); then + if (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS+='amd64.deb' - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then INSTALL_URL_ADDRESS+='arm64.deb' - elif (( $HW_ARCH == 2 )); then + elif (( $G_HW_ARCH == 2 )); then INSTALL_URL_ADDRESS+='armv7.deb' - elif (( $HW_ARCH == 1 )); then + elif (( $G_HW_ARCH == 1 )); then INSTALL_URL_ADDRESS+='armv6.deb' fi - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - AGI_ERROR_CHECKED libupnp6 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-alsa + G_AGI_ERROR_CHECKED 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 @@ -7705,14 +7705,14 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://dtcooper.github.io/raspotify/key.asc' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then 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 - AGUP + G_AGUP - AGI_ERROR_CHECKED raspotify + G_AGI_ERROR_CHECKED raspotify else @@ -7729,7 +7729,7 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/moode/rel-stretch-r40b9.zip' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then cd "$HOME" @@ -7738,23 +7738,23 @@ _EOF_ #Pre-Reqs ----------------------------------------------------------------------- # Core packages - AGI_ERROR_CHECKED rpi-update mpc memcached $PHP_APT_PACKAGE_NAME-memcache \ + G_AGI_ERROR_CHECKED 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_ERROR_CHECKED dnsmasq hostapd + G_AGI_ERROR_CHECKED dnsmasq hostapd # BT - AGI_ERROR_CHECKED bluez bluez-firmware \ + G_AGI_ERROR_CHECKED 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 + if (( $G_HW_MODEL < 10 )); then - AGI_ERROR_CHECKED pi-bluetooth + G_AGI_ERROR_CHECKED pi-bluetooth fi @@ -7819,25 +7819,25 @@ libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc Banner_Installing INSTALL_URL_ADDRESS='https://github.com/google/aiyprojects-raspbian.git' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - git clone "$INSTALL_URL_ADDRESS" "$FP_DIETPI_USERDATA"/voice-recognizer-raspi - cd "$FP_DIETPI_USERDATA"/voice-recognizer-raspi + git clone "$INSTALL_URL_ADDRESS" "$G_FP_DIETPI_USERDATA"/voice-recognizer-raspi + cd "$G_FP_DIETPI_USERDATA"/voice-recognizer-raspi pip3 install --upgrade pip virtualenv virtualenv --system-site-packages -p python3 env env/bin/pip install -r requirements.txt #??? ARMv7 only - if (( $HW_ARCH == 2 )); then + if (( $G_HW_ARCH == 2 )); then env/bin/pip install google-assistant-library==0.0.3 fi # - Services - sed -i "s#/home/pi#$FP_DIETPI_USERDATA#g" systemd/voice-recognizer.service + sed -i "s#/home/pi#$G_FP_DIETPI_USERDATA#g" systemd/voice-recognizer.service sed -i "/^User=/c\User=dietpi" systemd/voice-recognizer.service cp systemd/voice-recognizer.service /etc/systemd/system/ @@ -7868,13 +7868,13 @@ libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc Banner_Installing - AGI_ERROR_CHECKED alsa-utils + G_AGI_ERROR_CHECKED alsa-utils #Apply soundcard local soundcard=$(cat /DietPi/dietpi.txt | grep -m1 'soundcard=' | sed 's/.*=//') # - RPi enable internal HDMI+Analogue if currently set to 'none' - if (( $HW_MODEL < 10 )) && + if (( $G_HW_MODEL < 10 )) && [ "$soundcard" = "none" ] || [ "$soundcard" = "default" ]; then soundcard='rpi-bcm2835' @@ -7899,7 +7899,7 @@ libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc Banner_Installing #Xserver Prereqs (ALL) - AGI_ERROR_CHECKED xcompmgr xterm xinit xauth xserver-xorg dbus-x11 xfonts-base x11-xserver-utils x11-common x11-utils --no-install-recommends + G_AGI_ERROR_CHECKED xcompmgr xterm xinit xauth xserver-xorg dbus-x11 xfonts-base x11-xserver-utils x11-common x11-utils --no-install-recommends #Improve performance on all desktops and devices (eg: removes window lag in desktops) by limiting compositions mkdir -p /etc/xdg/autostart @@ -7912,18 +7912,18 @@ Exec=xcompmgr -a _EOF_ #RPI - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then sleep 1 #Odroid C2 - elif (( $HW_MODEL == 12 )); then + elif (( $G_HW_MODEL == 12 )); then - AGI_ERROR_CHECKED aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump-odroid --no-install-recommends + G_AGI_ERROR_CHECKED aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump-odroid --no-install-recommends #cp /DietPi/dietpi/conf/xorg_c2.conf /etc/X11/xorg.conf # FBTURBO C2, provides much better desktop performance over Mali DDX: http://forum.odroid.com/viewtopic.php?f=138&t=19948&p=169808#p169808 - AGI_ERROR_CHECKED xf86-video-fbturbo-odroid + G_AGI_ERROR_CHECKED xf86-video-fbturbo-odroid cat << _EOF_ > /etc/X11/xorg.conf Section "Device" Identifier "FBTurbo" @@ -7935,24 +7935,24 @@ EndSection _EOF_ #Odroid XU4 - elif (( $HW_MODEL == 11 )); then + elif (( $G_HW_MODEL == 11 )); then - AGI_ERROR_CHECKED firmware-samsung xf86-video-armsoc-odroid malit628-odroid --no-install-recommends + G_AGI_ERROR_CHECKED firmware-samsung xf86-video-armsoc-odroid malit628-odroid --no-install-recommends cp /DietPi/dietpi/conf/xorg_xu4.conf /etc/X11/xorg.conf #Odroid C1 - elif (( $HW_MODEL == 10 )); then + elif (( $G_HW_MODEL == 10 )); then - AGI_ERROR_CHECKED aml-libs-odroid xf86-video-mali-odroid libump-odroid mali450-odroid --no-install-recommends + G_AGI_ERROR_CHECKED aml-libs-odroid xf86-video-mali-odroid libump-odroid mali450-odroid --no-install-recommends cp /DietPi/dietpi/conf/xorg_c1.conf /etc/X11/xorg.conf #Pine64 - elif (( $HW_MODEL >= 40 && $HW_MODEL <= 42 )); then + elif (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/libump_1-1_arm64.deb' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -7981,7 +7981,7 @@ _EOF_ fi #Asus TB - # elif (( $HW_MODEL == 100 )); then + # elif (( $G_HW_MODEL == 100 )); then # cat << _EOF_ > /etc/X11/xorg.conf # Section "Device" @@ -8003,10 +8003,10 @@ _EOF_ Banner_Installing #Install - AGI_ERROR_CHECKED nvidia-driver nvidia-xconfig + G_AGI_ERROR_CHECKED nvidia-driver nvidia-xconfig # + i386 OpenGL - AGI_ERROR_CHECKED libgl1-nvidia-glx:i386 + G_AGI_ERROR_CHECKED libgl1-nvidia-glx:i386 fi @@ -8016,7 +8016,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED avahi-daemon + G_AGI_ERROR_CHECKED avahi-daemon fi @@ -8024,7 +8024,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED build-essential make autoconf automake --no-install-recommends + G_AGI_ERROR_CHECKED build-essential make autoconf automake --no-install-recommends fi @@ -8032,7 +8032,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED ntp + G_AGI_ERROR_CHECKED ntp # Remove service, as DietPi ntpd-mode launches the binary with custom commands systemctl stop ntp @@ -8046,7 +8046,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED git --no-install-recommends + G_AGI_ERROR_CHECKED git --no-install-recommends fi @@ -8054,7 +8054,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED vifm + G_AGI_ERROR_CHECKED vifm fi @@ -8062,7 +8062,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED vim + G_AGI_ERROR_CHECKED vim fi @@ -8070,7 +8070,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED vim-tiny + G_AGI_ERROR_CHECKED vim-tiny fi @@ -8078,7 +8078,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED neovim + G_AGI_ERROR_CHECKED neovim fi @@ -8086,7 +8086,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED emacs + G_AGI_ERROR_CHECKED emacs fi @@ -8094,7 +8094,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED iperf + G_AGI_ERROR_CHECKED iperf fi @@ -8102,7 +8102,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED mc + G_AGI_ERROR_CHECKED mc fi @@ -8110,7 +8110,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED jed + G_AGI_ERROR_CHECKED jed fi @@ -8118,7 +8118,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED iftop + G_AGI_ERROR_CHECKED iftop fi @@ -8126,7 +8126,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED iptraf + G_AGI_ERROR_CHECKED iptraf fi @@ -8134,7 +8134,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED mtr-tiny + G_AGI_ERROR_CHECKED mtr-tiny fi @@ -8142,7 +8142,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED nload + G_AGI_ERROR_CHECKED nload fi @@ -8150,7 +8150,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED tcpdump + G_AGI_ERROR_CHECKED tcpdump fi @@ -8158,7 +8158,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED openssh-client + G_AGI_ERROR_CHECKED openssh-client fi @@ -8170,7 +8170,7 @@ _EOF_ #Remove Information file rm /mnt/samba/readme.txt &> /dev/null - AGI_ERROR_CHECKED smbclient cifs-utils --no-install-recommends + G_AGI_ERROR_CHECKED smbclient cifs-utils --no-install-recommends fi @@ -8182,7 +8182,7 @@ _EOF_ #Remove information file rm /mnt/ftp_client/readme.txt &> /dev/null - AGI_ERROR_CHECKED curlftpfs + G_AGI_ERROR_CHECKED curlftpfs fi @@ -8194,7 +8194,7 @@ _EOF_ #Remove information file rm /mnt/nfs_client/readme.txt &> /dev/null - AGI_ERROR_CHECKED nfs-common + G_AGI_ERROR_CHECKED nfs-common fi @@ -8202,7 +8202,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED dropbear + G_AGI_ERROR_CHECKED dropbear #set to start on next boot sed -i '/NO_START=1/c\NO_START=0' /etc/default/dropbear @@ -8213,7 +8213,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED openssh-server --no-install-recommends + G_AGI_ERROR_CHECKED openssh-server --no-install-recommends # - Remove all references before adding the entry: https://github.com/Fourdee/DietPi/issues/604 @@ -8256,7 +8256,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED logrotate --no-install-recommends + G_AGI_ERROR_CHECKED logrotate --no-install-recommends fi @@ -8264,7 +8264,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED rsyslog --no-install-recommends + G_AGI_ERROR_CHECKED rsyslog --no-install-recommends fi @@ -8274,11 +8274,11 @@ _EOF_ Banner_Installing #RPi + OpenMAX HW Encoding: https://github.com/Fourdee/DietPi/issues/869 - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/rpi/ffmpeg_rpi.7z' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then wget "$INSTALL_URL_ADDRESS" -O package.7z @@ -8296,7 +8296,7 @@ _EOF_ #Everything else else - AGI_ERROR_CHECKED ffmpeg + G_AGI_ERROR_CHECKED ffmpeg fi @@ -8308,9 +8308,9 @@ _EOF_ Banner_Installing # - Raspbian - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then - AGI_ERROR_CHECKED oracle-java8-jdk + G_AGI_ERROR_CHECKED oracle-java8-jdk # - Debian. Add repo else @@ -8321,12 +8321,12 @@ deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main _EOF_ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 - AGUP + G_AGUP # - Accept the license: https://github.com/Fourdee/DietPi/issues/298 debconf-set-selections <<< "oracle-java8-installer shared/accepted-oracle-license-v1-1 boolean true" - AGI_ERROR_CHECKED oracle-java8-installer + G_AGI_ERROR_CHECKED oracle-java8-installer fi @@ -8339,7 +8339,7 @@ _EOF_ #check, is online INSTALL_URL_ADDRESS='http://raw.githubusercontent.com/taaem/nodejs-linux-installer/master/node-install.sh' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -8366,18 +8366,18 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='https://bootstrap.pypa.io/get-pip.py' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then # - Preqs - AGI_ERROR_CHECKED python python-dev + G_AGI_ERROR_CHECKED python python-dev wget "$INSTALL_URL_ADDRESS" -O install.py python ./install.py rm install.py - AGI_ERROR_CHECKED python-pip python3-pip + G_AGI_ERROR_CHECKED python-pip python3-pip else @@ -8394,11 +8394,11 @@ _EOF_ Banner_Installing INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/rpi/sdl2_rpi.7z' - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - #AGI_ERROR_CHECKED libxss1 #if using SDL2+rpi5 + #G_AGI_ERROR_CHECKED libxss1 #if using SDL2+rpi5 wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z -osdl2_rpi @@ -8424,19 +8424,19 @@ _EOF_ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF #ARMv6 only available in raspbian repo: https://github.com/Fourdee/DietPi/issues/1023 - if (( $HW_ARCH == 1 )); then + if (( $G_HW_ARCH == 1 )); then - echo -e "deb http://download.mono-project.com/repo/debian raspbian$DISTRO_NAME main" > /etc/apt/sources.list.d/mono-xamarin.list + echo -e "deb http://download.mono-project.com/repo/debian raspbian$G_DISTRO_NAME main" > /etc/apt/sources.list.d/mono-xamarin.list else - echo -e "deb http://download.mono-project.com/repo/debian $DISTRO_NAME main" > /etc/apt/sources.list.d/mono-xamarin.list + echo -e "deb http://download.mono-project.com/repo/debian $G_DISTRO_NAME main" > /etc/apt/sources.list.d/mono-xamarin.list fi - AGUP + G_AGUP - AGI_ERROR_CHECKED mono-runtime + G_AGI_ERROR_CHECKED mono-runtime fi @@ -8452,22 +8452,22 @@ _EOF_ HA_PYENV_ACTIVATION="export PATH=\"$HA_USERROOT/.pyenv/bin:\$PATH\"; eval \"\$(pyenv init -)\"; eval \"\$(pyenv virtualenv-init -)\"" HA_PYTHON_VERSION="3.6.3" - dietpi-notify 2 "HA_USER: $HA_USER" - dietpi-notify 2 "HA_USERROOT: $HA_USERROOT" - dietpi-notify 2 "HA_SRVROOT: $HA_SRVROOT" - dietpi-notify 2 "HA_PYENV_ACTIVATION: $HA_PYENV_ACTIVATION" - dietpi-notify 2 "HA_PYTHON_VERSION: $HA_PYTHON_VERSION" + G_DIETPI-NOTIFY 2 "HA_USER: $HA_USER" + G_DIETPI-NOTIFY 2 "HA_USERROOT: $HA_USERROOT" + G_DIETPI-NOTIFY 2 "HA_SRVROOT: $HA_SRVROOT" + G_DIETPI-NOTIFY 2 "HA_PYENV_ACTIVATION: $HA_PYENV_ACTIVATION" + G_DIETPI-NOTIFY 2 "HA_PYTHON_VERSION: $HA_PYTHON_VERSION" # Install needed libraries - AGI_ERROR_CHECKED 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 + G_AGI_ERROR_CHECKED 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 (( $G_DISTRO == 3 )); then - AGI_ERROR_CHECKED libmysqlclient-dev + G_AGI_ERROR_CHECKED libmysqlclient-dev fi - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then - AGI_ERROR_CHECKED libmariadbclient-dev + G_AGI_ERROR_CHECKED libmariadbclient-dev fi @@ -8554,7 +8554,7 @@ _EOF_ fi #Inform user (From testing, stopping SSH server services does not disconnect user, however, just incase it does in the future) - dietpi-notify 3 DietPi-Software "Stopping SSH servers" + G_DIETPI-NOTIFY 3 DietPi-Software "Stopping SSH servers" #stop all SSH server services service ssh stop &> /dev/null @@ -8657,7 +8657,7 @@ _EOF_ Install_Apply_Permissions(){ #Not all permissions are listed here. - # - Only ones which are shared across programs, and/or located inside FP_DIETPI_USERDATA that require non-root permissions. + # - Only ones which are shared across programs, and/or located inside G_FP_DIETPI_USERDATA that require non-root permissions. #- /var/www / www-data chown -R www-data:www-data /var/www @@ -8668,48 +8668,48 @@ _EOF_ chmod -R 777 /var/www/ompd/stream #(required for streaming files) chmod -R 777 /var/www/ompd/cache #(required for downloading files) - #Apply non-root permissions for files and folders in FP_DIETPI_USERDATA + #Apply non-root permissions for files and folders in G_FP_DIETPI_USERDATA # - dietpi user chown -R dietpi:dietpi /home/dietpi - chown -R dietpi:dietpi "$FP_DIETPI_USERDATA" - chmod -R 775 "$FP_DIETPI_USERDATA" + chown -R dietpi:dietpi "$G_FP_DIETPI_USERDATA" + chmod -R 775 "$G_FP_DIETPI_USERDATA" # + for symlinked locations - chown -R dietpi:dietpi "$FP_DIETPI_USERDATA"/* - chmod -R 775 "$FP_DIETPI_USERDATA"/* + chown -R dietpi:dietpi "$G_FP_DIETPI_USERDATA"/* + chmod -R 775 "$G_FP_DIETPI_USERDATA"/* # - MPD - chown -R mpd:audio "$FP_DIETPI_USERDATA"/.mpd_cache + chown -R mpd:audio "$G_FP_DIETPI_USERDATA"/.mpd_cache # - MySQL data store - chown -R mysql:mysql "$FP_DIETPI_USERDATA"/mysql - chmod -R 770 "$FP_DIETPI_USERDATA"/mysql + chown -R mysql:mysql "$G_FP_DIETPI_USERDATA"/mysql + chmod -R 770 "$G_FP_DIETPI_USERDATA"/mysql - chown -R mineos:mineos "$FP_DIETPI_USERDATA"/mineos/serverdata - chown -R urbackup:urbackup "$FP_DIETPI_USERDATA"/urbackup - #chown -R couchpotato:couchpotato "$FP_DIETPI_USERDATA"/couchpotato + chown -R mineos:mineos "$G_FP_DIETPI_USERDATA"/mineos/serverdata + chown -R urbackup:urbackup "$G_FP_DIETPI_USERDATA"/urbackup + #chown -R couchpotato:couchpotato "$G_FP_DIETPI_USERDATA"/couchpotato # - www-data - chown -R www-data:www-data "$FP_DIETPI_USERDATA"/dietpicam - chown -R www-data:www-data "$FP_DIETPI_USERDATA"/pydio_data + chown -R www-data:www-data "$G_FP_DIETPI_USERDATA"/dietpicam + chown -R www-data:www-data "$G_FP_DIETPI_USERDATA"/pydio_data local datadir=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_owncloud_datadir=' | sed 's/.*=//') - [ ! -n "$datadir" ] && datadir="$FP_DIETPI_USERDATA/owncloud_data" + [ ! -n "$datadir" ] && datadir="$G_FP_DIETPI_USERDATA/owncloud_data" chown -R www-data:www-data "$datadir" datadir=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_nextcloud_datadir=' | sed 's/.*=//') - [ ! -n "$datadir" ] && datadir="$FP_DIETPI_USERDATA/nextcloud_data" + [ ! -n "$datadir" ] && datadir="$G_FP_DIETPI_USERDATA/nextcloud_data" chown -R www-data:www-data "$datadir" # - Home Assistant Permissions #chown -R homeassistant:dietpi /home/homeassistant/.homeassistant - #chown -R dietpi:dietpi "$FP_DIETPI_USERDATA"/homeassistant + #chown -R dietpi:dietpi "$G_FP_DIETPI_USERDATA"/homeassistant # - Minio - chown -R minio-user:minio-user "$FP_DIETPI_USERDATA"/minio-data + chown -R minio-user:minio-user "$G_FP_DIETPI_USERDATA"/minio-data # - FuguHub - chown -R bd:bd "$FP_DIETPI_USERDATA"/fuguhub-data/ + chown -R bd:bd "$G_FP_DIETPI_USERDATA"/fuguhub-data/ } @@ -8740,7 +8740,7 @@ _EOF_ # Create_Desktop_Shared_Items # # #Odroid C2, define default pulseaudio sink: https://github.com/Fourdee/DietPi/issues/415 - # if (( $HW_MODEL == 12 && + # if (( $G_HW_MODEL == 12 && # ! $(cat /etc/pulse/default.pa | grep -ci -m1 '^set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo') )); then # # echo -e "set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo" >> /etc/pulse/default.pa @@ -8795,7 +8795,7 @@ _EOF_ Create_Desktop_Shared_Items #Odroid C2, define default pulseaudio sink: https://github.com/Fourdee/DietPi/issues/415 - if (( $HW_MODEL == 12 && + if (( $G_HW_MODEL == 12 && ! $(cat /etc/pulse/default.pa | grep -ci -m1 '^set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo') )); then echo -e "set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo" >> /etc/pulse/default.pa @@ -8841,7 +8841,7 @@ _EOF_ cat << _EOF_ > /etc/apache2/mods-available/mpm_event.conf -StartServers $HW_CPU_CORES +StartServers $G_HW_CPU_CORES MinSpareThreads 1 MaxSpareThreads 8 ThreadLimit 16 @@ -8853,9 +8853,9 @@ _EOF_ cat << _EOF_ > /etc/apache2/mods-available/mpm_prefork.conf -StartServers $HW_CPU_CORES +StartServers $G_HW_CPU_CORES MinSpareServers 1 -MaxSpareServers $HW_CPU_CORES +MaxSpareServers $G_HW_CPU_CORES MaxRequestWorkers 50 MaxConnectionsPerChild 0 @@ -8863,7 +8863,7 @@ _EOF_ cat << _EOF_ > /etc/apache2/mods-available/mpm_worker.conf -StartServers $HW_CPU_CORES +StartServers $G_HW_CPU_CORES MinSpareThreads 1 MaxSpareThreads 8 ThreadLimit 16 @@ -8895,17 +8895,17 @@ _EOF_ cp /DietPi/dietpi/conf/nginx.conf /etc/nginx/nginx.conf # - Stretch , set php7.0 - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then sed -i "s#/run/php5-fpm.sock#/run/php/php7.0-fpm.sock#g" /etc/nginx/nginx.conf fi # - CPU core count - sed -i "/worker_processes/c\worker_processes $HW_CPU_CORES;" /etc/nginx/nginx.conf + sed -i "/worker_processes/c\worker_processes $G_HW_CPU_CORES;" /etc/nginx/nginx.conf #Default site cp /DietPi/dietpi/conf/nginx.site-available-default /etc/nginx/sites-available/default # - Stretch , set php7.0 - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then sed -i "s#/run/php5-fpm.sock#/run/php/php7.0-fpm.sock#g" /etc/nginx/sites-available/default fi @@ -8926,7 +8926,7 @@ _EOF_ #Configure fastcgi for PHP-FPM local fp_php_fpm_sock='/var/run/php/php7.0-fpm.sock' - if (( $DISTRO == 3 )); then + if (( $G_DISTRO == 3 )); then fp_php_fpm_sock='/var/run/php5-fpm.sock' @@ -8976,10 +8976,10 @@ _EOF_ sed -i '/cgi.fix_pathinfo=/c\cgi.fix_pathinfo=1' "$FP_PHP_BASE_DIR"/fpm/php.ini # - PHP-FPM optimizations based on total cores - sed -i "/pm.max_children = /c\pm.max_children = $(( $HW_CPU_CORES * 3 ))" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf - sed -i "/pm.start_servers = /c\pm.start_servers = $HW_CPU_CORES" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf - sed -i "/pm.min_spare_servers = /c\pm.min_spare_servers = $HW_CPU_CORES" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf - sed -i "/pm.max_spare_servers = /c\pm.max_spare_servers = $HW_CPU_CORES" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf + sed -i "/pm.max_children = /c\pm.max_children = $(( $G_HW_CPU_CORES * 3 ))" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf + sed -i "/pm.start_servers = /c\pm.start_servers = $G_HW_CPU_CORES" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf + sed -i "/pm.min_spare_servers = /c\pm.min_spare_servers = $G_HW_CPU_CORES" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf + sed -i "/pm.max_spare_servers = /c\pm.max_spare_servers = $G_HW_CPU_CORES" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf # - Enviroment PHP settings: sed -i "/env\[HOSTNAME\]/c\env\[HOSTNAME\] = \$HOSTNAME" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf @@ -9111,18 +9111,18 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[86]} == 1 || ${aSOFTWARE_INSTALL_STATE[88]} == 1 )); then - if [ "$(readlink /var/lib/mysql)" != "$FP_DIETPI_USERDATA/mysql" ]; then + if [ "$(readlink /var/lib/mysql)" != "$G_FP_DIETPI_USERDATA/mysql" ]; then systemctl stop mysql # - Create target dir - mkdir -p "$FP_DIETPI_USERDATA"/mysql + mkdir -p "$G_FP_DIETPI_USERDATA"/mysql # - copy - cp -R /var/lib/mysql/* "$FP_DIETPI_USERDATA"/mysql/ + cp -R /var/lib/mysql/* "$G_FP_DIETPI_USERDATA"/mysql/ if (( $? != 0 )); then - dietpi-notify 1 "Moving of MySQL data store failed to $FP_DIETPI_USERDATA/mysql. DietPi-Software will now exit" + G_DIETPI-NOTIFY 1 "Moving of MySQL data store failed to $G_FP_DIETPI_USERDATA/mysql. DietPi-Software will now exit" Exit_Destroy fi @@ -9130,7 +9130,7 @@ _EOF_ rm -R /var/lib/mysql # - Symlink - ln -sf "$FP_DIETPI_USERDATA"/mysql /var/lib/mysql + ln -sf "$G_FP_DIETPI_USERDATA"/mysql /var/lib/mysql chown mysql:mysql /var/lib/mysql @@ -9217,7 +9217,7 @@ _EOF_ # Enable necessary PHP modules: https://doc.owncloud.org/server/latest/admin_manual/installation/source_installation.html#php-extensions "$PHP_APT_PACKAGE_NAME"enmod curl gd intl json pdo_mysql opcache apcu redis # Following modules are switchable since Stretch: - if (( $DISTRO > 3 )); then + if (( $G_DISTRO > 3 )); then phpenmod ctype dom fileinfo iconv mbstring posix simplexml xmlwriter xmlreader zip exif @@ -9259,7 +9259,7 @@ _EOF_ cp /DietPi/dietpi/conf/nginx.sites-dietpi.owncloud.config $owncloud_config # Stretch: Use PHP7.0 socket and set 'fastcgi_request_buffering off'; - if (( $DISTRO > 3 )); then + if (( $G_DISTRO > 3 )); then sed -i 's|/run/php5-fpm.sock|/run/php/php7.0-fpm.sock|g' $owncloud_config sed -i 's/#fastcgi_request_buffering off;/fastcgi_request_buffering off;/g' $owncloud_config @@ -9285,7 +9285,7 @@ innodb_file_per_table=1 _EOF_ # Check if we really do fresh installation: local oc_is_fresh=1 - if [ -d "$FP_DIETPI_USERDATA"/mysql/owncloud ]; then + if [ -d "$G_FP_DIETPI_USERDATA"/mysql/owncloud ]; then oc_is_fresh=0 @@ -9300,7 +9300,7 @@ _EOF_ # Terminal installation: local datadir=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_owncloud_datadir=' | sed 's/.*=//') - [ ! -n "$datadir" ] && datadir="$FP_DIETPI_USERDATA/owncloud_data" + [ ! -n "$datadir" ] && datadir="$G_FP_DIETPI_USERDATA/owncloud_data" mkdir -p "$datadir" Install_Apply_Permissions &> /dev/null @@ -9387,7 +9387,7 @@ _EOF_ # Enable necessary PHP modules: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation "$PHP_APT_PACKAGE_NAME"enmod curl gd intl json pdo_mysql opcache apcu redis # Following modules are switchable since Stretch: - if (( $DISTRO > 3 )); then + if (( $G_DISTRO > 3 )); then phpenmod ctype dom fileinfo iconv mbstring posix simplexml xmlwriter xmlreader zip exif @@ -9434,7 +9434,7 @@ _EOF_ cp /DietPi/dietpi/conf/nginx.sites-dietpi.nextcloud.config $nextcloud_config # Stretch: Use PHP7.0 socket and set 'fastcgi_request_buffering off'; - if (( $DISTRO > 3 )); then + if (( $G_DISTRO > 3 )); then sed -i 's|/run/php5-fpm.sock|/run/php/php7.0-fpm.sock|g' $nextcloud_config sed -i 's/#fastcgi_request_buffering off;/fastcgi_request_buffering off;/g' $nextcloud_config @@ -9460,7 +9460,7 @@ innodb_file_per_table=1 _EOF_ # Check if we really do fresh installation: local nc_is_fresh=1 - if [ -d "$FP_DIETPI_USERDATA"/mysql/nextcloud ]; then + if [ -d "$G_FP_DIETPI_USERDATA"/mysql/nextcloud ]; then nc_is_fresh=0 @@ -9475,7 +9475,7 @@ _EOF_ # Terminal installation: local datadir=$(grep -m1 '^dietpi_nextcloud_datadir=' /DietPi/dietpi.txt | sed 's/.*=//') - [ ! -n "$datadir" ] && datadir="$FP_DIETPI_USERDATA/nextcloud_data" + [ ! -n "$datadir" ] && datadir="$G_FP_DIETPI_USERDATA/nextcloud_data" mkdir -p "$datadir" Install_Apply_Permissions &> /dev/null @@ -9591,7 +9591,7 @@ _EOF_ "blocklist-url": "http://www.example.com/blocklist", "cache-size-mb": 48, "dht-enabled": true, - "download-dir": "$FP_DIETPI_USERDATA/downloads", + "download-dir": "$G_FP_DIETPI_USERDATA/downloads", "download-limit": 100, "download-limit-enabled": false, "download-queue-enabled": true, @@ -9599,7 +9599,7 @@ _EOF_ "encryption": 2, "idle-seeding-limit": 1, "idle-seeding-limit-enabled": true, - "incomplete-dir": "$FP_DIETPI_USERDATA/bt-inprogress", + "incomplete-dir": "$G_FP_DIETPI_USERDATA/bt-inprogress", "incomplete-dir-enabled": false, "lpd-enabled": false, "max-peers-global": 8, @@ -9691,7 +9691,7 @@ _EOF_ chown -R mpd:audio /var/log/mpd # cache - mkdir -p "$FP_DIETPI_USERDATA"/.mpd_cache + mkdir -p "$G_FP_DIETPI_USERDATA"/.mpd_cache #MPD service/confs cat << _EOF_ > /etc/default/mpd @@ -9754,7 +9754,7 @@ _EOF_ sed -i "/root/c\#root" /etc/ftpusers cp /DietPi/dietpi/conf/proftpd.conf /etc/proftpd/proftpd.conf - sed -i "/DefaultRoot /c\DefaultRoot $FP_DIETPI_USERDATA" /etc/proftpd/proftpd.conf + sed -i "/DefaultRoot /c\DefaultRoot $G_FP_DIETPI_USERDATA" /etc/proftpd/proftpd.conf fi @@ -9765,7 +9765,7 @@ _EOF_ echo -e "dietpi\ndietpi" | smbpasswd -s -a root cp /DietPi/dietpi/conf/smb.conf /etc/samba/smb.conf - sed -i "/path = /c\path = $FP_DIETPI_USERDATA" /etc/samba/smb.conf + sed -i "/path = /c\path = $G_FP_DIETPI_USERDATA" /etc/samba/smb.conf fi @@ -9776,7 +9776,7 @@ _EOF_ sed -i '/root/c\#root' /etc/ftpusers cp /DietPi/dietpi/conf/vsftpd.conf /etc/vsftpd.conf - sed -i "/^local_root=/c\local_root=$FP_DIETPI_USERDATA" /etc/vsftpd.conf + sed -i "/^local_root=/c\local_root=$G_FP_DIETPI_USERDATA" /etc/vsftpd.conf fi @@ -9785,7 +9785,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then cat << _EOF_ > /etc/exports -$FP_DIETPI_USERDATA *(rw,async,no_root_squash,fsid=0,crossmnt,no_subtree_check) +$G_FP_DIETPI_USERDATA *(rw,async,no_root_squash,fsid=0,crossmnt,no_subtree_check) _EOF_ fi @@ -9815,20 +9815,20 @@ _EOF_ INSTALLING_INDEX=121 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - mkdir -p "$FP_DIETPI_USERDATA"/roon + mkdir -p "$G_FP_DIETPI_USERDATA"/roon cp /DietPi/dietpi/conf/roonbridge.service /etc/systemd/system/roonbridge.service # - Move logfiles to /var/log/ (dietpi-ramlog) # Remove any previous folders to clear for symlink - rm -R "$FP_DIETPI_USERDATA"/roon/RoonBridge/Logs &> /dev/null - rm -R "$FP_DIETPI_USERDATA"/roon/RAATServer/Logs &> /dev/null + rm -R "$G_FP_DIETPI_USERDATA"/roon/RoonBridge/Logs &> /dev/null + rm -R "$G_FP_DIETPI_USERDATA"/roon/RAATServer/Logs &> /dev/null - mkdir -p "$FP_DIETPI_USERDATA"/roon/RoonBridge - mkdir -p "$FP_DIETPI_USERDATA"/roon/RAATServer + mkdir -p "$G_FP_DIETPI_USERDATA"/roon/RoonBridge + mkdir -p "$G_FP_DIETPI_USERDATA"/roon/RAATServer - ln -sf /var/log "$FP_DIETPI_USERDATA"/roon/RoonBridge/Logs - ln -sf /var/log "$FP_DIETPI_USERDATA"/roon/RAATServer/Logs + ln -sf /var/log "$G_FP_DIETPI_USERDATA"/roon/RoonBridge/Logs + ln -sf /var/log "$G_FP_DIETPI_USERDATA"/roon/RAATServer/Logs fi @@ -9836,7 +9836,7 @@ _EOF_ INSTALLING_INDEX=122 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - mkdir -p "$FP_DIETPI_USERDATA"/node-red + mkdir -p "$G_FP_DIETPI_USERDATA"/node-red cat << _EOF_ > /etc/systemd/system/node-red.service [Unit] @@ -9845,14 +9845,14 @@ Description=Node-Red [Service] Type=simple User=root -ExecStart=/usr/local/bin/node-red -u $FP_DIETPI_USERDATA/node-red +ExecStart=/usr/local/bin/node-red -u $G_FP_DIETPI_USERDATA/node-red [Install] WantedBy=multi-user.target _EOF_ #Symlink to home dir: https://github.com/Fourdee/DietPi/issues/1256 - ln -sf "$FP_DIETPI_USERDATA"/node-red "$HOME"/.node-red + ln -sf "$G_FP_DIETPI_USERDATA"/node-red "$HOME"/.node-red fi @@ -9925,15 +9925,15 @@ _EOF_ sed -i "/User=/c\User=root" /lib/systemd/system/mopidy.service # - conf - mkdir -p "$FP_DIETPI_USERDATA"/mopidy/cache - mkdir -p "$FP_DIETPI_USERDATA"/mopidy/data + mkdir -p "$G_FP_DIETPI_USERDATA"/mopidy/cache + mkdir -p "$G_FP_DIETPI_USERDATA"/mopidy/data mkdir -p ~/.config/mopidy cat << _EOF_ > ~/.config/mopidy/mopidy.conf [core] -cache_dir = $FP_DIETPI_USERDATA/mopidy/cache +cache_dir = $G_FP_DIETPI_USERDATA/mopidy/cache config_dir = /etc/mopidy -data_dir = $FP_DIETPI_USERDATA/mopidy/data +data_dir = $G_FP_DIETPI_USERDATA/mopidy/data [logging] config_file = /etc/mopidy/logging.conf @@ -10022,7 +10022,7 @@ _EOF_ cp /DietPi/dietpi/conf/minidlna.conf /etc/minidlna.conf #Setup data directories - mkdir -p "$FP_DIETPI_USERDATA"/.MiniDLNA_Cache + mkdir -p "$G_FP_DIETPI_USERDATA"/.MiniDLNA_Cache fi @@ -10058,65 +10058,65 @@ _EOF_ chmod -R +x /etc/amiberry #Create userdata/rom directories and symlink from /etc/amiberry/ - mkdir -p "$FP_DIETPI_USERDATA"/amiberry + mkdir -p "$G_FP_DIETPI_USERDATA"/amiberry #Copy default configs, then setup symlinks from Uae4ARM folders to userdata. # - Conf - cp -R /etc/amiberry/conf "$FP_DIETPI_USERDATA"/amiberry/ + cp -R /etc/amiberry/conf "$G_FP_DIETPI_USERDATA"/amiberry/ rm -R /etc/amiberry/conf &> /dev/null - ln -sf "$FP_DIETPI_USERDATA"/amiberry/conf /etc/amiberry/conf + ln -sf "$G_FP_DIETPI_USERDATA"/amiberry/conf /etc/amiberry/conf # - Disks rm -R /etc/amiberry/disks &> /dev/null - mkdir -p "$FP_DIETPI_USERDATA"/amiberry/disks - ln -sf "$FP_DIETPI_USERDATA"/amiberry/disks /etc/amiberry/disks + mkdir -p "$G_FP_DIETPI_USERDATA"/amiberry/disks + ln -sf "$G_FP_DIETPI_USERDATA"/amiberry/disks /etc/amiberry/disks # - floppy_images rm -R /etc/amiberry/floppy_images &> /dev/null - mkdir -p "$FP_DIETPI_USERDATA"/amiberry/floppy_images - ln -sf "$FP_DIETPI_USERDATA"/amiberry/floppy_images /etc/amiberry/floppy_images - cat << _EOF_ > "$FP_DIETPI_USERDATA"/amiberry/floppy_images/dir.txt + mkdir -p "$G_FP_DIETPI_USERDATA"/amiberry/floppy_images + ln -sf "$G_FP_DIETPI_USERDATA"/amiberry/floppy_images /etc/amiberry/floppy_images + cat << _EOF_ > "$G_FP_DIETPI_USERDATA"/amiberry/floppy_images/dir.txt Put your Amiga floopy images (*.adf) in this directory. _EOF_ # - HDF rm -R /etc/amiberry/hdf &> /dev/null - mkdir -p "$FP_DIETPI_USERDATA"/amiberry/hdf - ln -sf "$FP_DIETPI_USERDATA"/amiberry/hdf /etc/amiberry/hdf + mkdir -p "$G_FP_DIETPI_USERDATA"/amiberry/hdf + ln -sf "$G_FP_DIETPI_USERDATA"/amiberry/hdf /etc/amiberry/hdf # - Kickstarts rm -R /etc/amiberry/kickstarts &> /dev/null - mkdir -p "$FP_DIETPI_USERDATA"/amiberry/kickstarts - ln -sf "$FP_DIETPI_USERDATA"/amiberry/kickstarts /etc/amiberry/kickstarts - cat << _EOF_ > "$FP_DIETPI_USERDATA"/amiberry/kickstarts/dir.txt + mkdir -p "$G_FP_DIETPI_USERDATA"/amiberry/kickstarts + ln -sf "$G_FP_DIETPI_USERDATA"/amiberry/kickstarts /etc/amiberry/kickstarts + cat << _EOF_ > "$G_FP_DIETPI_USERDATA"/amiberry/kickstarts/dir.txt Put your Kickstart Roms (*.rom) in this directory. They should be named accordingly depending on version: kick12.rom , kick13.rom , kick20.rom, kick31.rom _EOF_ # - Savestates rm -R /etc/amiberry/savestates &> /dev/null - mkdir -p "$FP_DIETPI_USERDATA"/amiberry/savestates - ln -sf "$FP_DIETPI_USERDATA"/amiberry/savestates /etc/amiberry/savestates - cat << _EOF_ > "$FP_DIETPI_USERDATA"/amiberry/savestates/dir.txt + mkdir -p "$G_FP_DIETPI_USERDATA"/amiberry/savestates + ln -sf "$G_FP_DIETPI_USERDATA"/amiberry/savestates /etc/amiberry/savestates + cat << _EOF_ > "$G_FP_DIETPI_USERDATA"/amiberry/savestates/dir.txt Saved states will be stored here. _EOF_ # - Screenshots rm -R /etc/amiberry/screenshots &> /dev/null - mkdir -p "$FP_DIETPI_USERDATA"/amiberry/screenshots - ln -sf "$FP_DIETPI_USERDATA"/amiberry/screenshots /etc/amiberry/screenshots - cat << _EOF_ > "$FP_DIETPI_USERDATA"/amiberry/screenshots/dir.txt + mkdir -p "$G_FP_DIETPI_USERDATA"/amiberry/screenshots + ln -sf "$G_FP_DIETPI_USERDATA"/amiberry/screenshots /etc/amiberry/screenshots + cat << _EOF_ > "$G_FP_DIETPI_USERDATA"/amiberry/screenshots/dir.txt Screenshots will be stored here. _EOF_ #Uae4arm does not support browsing symlinks (https://github.com/Fourdee/DietPi/issues/474#issuecomment-242973839) # So we need to change config file default paths to actual userdata location: - local fp_userdata_actual=$(readlink "$FP_DIETPI_USERDATA") # Only returns a value if symlink exists (eg: off SDcard) + local fp_userdata_actual=$(readlink "$G_FP_DIETPI_USERDATA") # Only returns a value if symlink exists (eg: off SDcard) if [ -n "$fp_userdata_actual" ]; then - sed -i "s:$FP_DIETPI_USERDATA:$fp_userdata_actual:g" "$FP_DIETPI_USERDATA"/amiberry/conf/adfdir.conf - sed -i "s:$FP_DIETPI_USERDATA:$fp_userdata_actual:g" "$FP_DIETPI_USERDATA"/amiberry/conf/autostart.uae + sed -i "s:$G_FP_DIETPI_USERDATA:$fp_userdata_actual:g" "$G_FP_DIETPI_USERDATA"/amiberry/conf/adfdir.conf + sed -i "s:$G_FP_DIETPI_USERDATA:$fp_userdata_actual:g" "$G_FP_DIETPI_USERDATA"/amiberry/conf/autostart.uae fi @@ -10124,12 +10124,12 @@ _EOF_ local amiberry_filename='amiberry-rpi' # - RPi 3 - if (( $HW_MODEL == 3 )); then + if (( $G_HW_MODEL == 3 )); then amiberry_filename+='3' # - RPi 2 - elif (( $HW_MODEL == 2 )); then + elif (( $G_HW_MODEL == 2 )); then amiberry_filename+='2' @@ -10215,16 +10215,16 @@ _EOF_ rm -R "$HOME"/.d1x-rebirth &> /dev/null rm -R "$HOME"/.d2x-rebirth &> /dev/null - ln -sf "$FP_DIETPI_USERDATA"/dxx-rebirth/descent_1_profiles "$HOME"/.d1x-rebirth - ln -sf "$FP_DIETPI_USERDATA"/dxx-rebirth/descent_2_profiles "$HOME"/.d2x-rebirth + ln -sf "$G_FP_DIETPI_USERDATA"/dxx-rebirth/descent_1_profiles "$HOME"/.d1x-rebirth + ln -sf "$G_FP_DIETPI_USERDATA"/dxx-rebirth/descent_2_profiles "$HOME"/.d2x-rebirth #+exe - chmod +x -R "$FP_DIETPI_USERDATA"/dxx-rebirth/* + chmod +x -R "$G_FP_DIETPI_USERDATA"/dxx-rebirth/* #Alias if (( ! $(cat /etc/bash.bashrc | grep -ci -m1 'dxx-rebirth') )); then - sed -i "/#DietPi Additions/a alias dxx-rebirth='$FP_DIETPI_USERDATA/dxx-rebirth/run.sh'" /etc/bash.bashrc + sed -i "/#DietPi Additions/a alias dxx-rebirth='$G_FP_DIETPI_USERDATA/dxx-rebirth/run.sh'" /etc/bash.bashrc fi @@ -10232,8 +10232,8 @@ _EOF_ mkdir -p "$HOME"/Desktop mkdir -p /usr/share/applications - ln -s "$FP_DIETPI_USERDATA"/dxx-rebirth/dxx-rebirth.desktop "$HOME"/Desktop/dxx-rebirth.desktop - ln -s "$FP_DIETPI_USERDATA"/dxx-rebirth/dxx-rebirth.desktop /usr/share/applications/dxx-rebirth.desktop + ln -s "$G_FP_DIETPI_USERDATA"/dxx-rebirth/dxx-rebirth.desktop "$HOME"/Desktop/dxx-rebirth.desktop + ln -s "$G_FP_DIETPI_USERDATA"/dxx-rebirth/dxx-rebirth.desktop /usr/share/applications/dxx-rebirth.desktop fi @@ -10270,7 +10270,7 @@ _EOF_ cp /DietPi/dietpi/conf/raspimjpeg.service /etc/dietpi/dietpi-software/services/raspimjpeg.service # - Setup Data directory - local dietpicam_media_directory=$FP_DIETPI_USERDATA + local dietpicam_media_directory=$G_FP_DIETPI_USERDATA mkdir -p "$dietpicam_media_directory"/dietpicam rm -R /var/www/dietpicam/media @@ -10380,7 +10380,7 @@ _EOF_ cat << _EOF_ > /etc/default/subsonic SUBSONIC_USER=root -SUBSONIC_ARGS="--quiet --pidfile=/run/subsonic.pid --max-memory=$subsonic_memory_max --default-music-folder=$FP_DIETPI_USERDATA/$FOLDER_MUSIC --default-podcast-folder=$FP_DIETPI_USERDATA/$FOLDER_MUSIC --default-playlist-folder=$FP_DIETPI_USERDATA/$FOLDER_MUSIC" +SUBSONIC_ARGS="--quiet --pidfile=/run/subsonic.pid --max-memory=$subsonic_memory_max --default-music-folder=$G_FP_DIETPI_USERDATA/$FOLDER_MUSIC --default-podcast-folder=$G_FP_DIETPI_USERDATA/$FOLDER_MUSIC --default-playlist-folder=$G_FP_DIETPI_USERDATA/$FOLDER_MUSIC" _EOF_ #Grab our test media for user @@ -10388,7 +10388,7 @@ _EOF_ #Symlink ffmpeg to subsonic transcoder #rpi armv6 jessie (using compiled ffmpeg) - if (( $HW_MODEL < 2 )); then + if (( $G_HW_MODEL < 2 )); then ln -fs /usr/local/bin/ffmpeg /var/subsonic/transcode @@ -10440,7 +10440,7 @@ ExecStartPre=/usr/bin/setterm --term linux --blank 0 --powersave off --cursor of ExecStart=/bin/bash -c '/DietPi/dietpi/dietpi-cloudshell 1' ExecStop=/usr/bin/setterm --reset -ExecStop=/bin/bash -c 'dietpi-notify 0 DietPi-Cloudshell terminated, have a nice day!' +ExecStop=/bin/bash -c 'G_DIETPI-NOTIFY 0 DietPi-Cloudshell terminated, have a nice day!' [Install] WantedBy=multi-user.target @@ -10722,7 +10722,7 @@ _EOF_ fi # - Stretch + TigerVNC: Disable Localhost only by default - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then echo -e '$localhost = "no";' >> /etc/vnc.conf @@ -10860,7 +10860,7 @@ export KEY_NAME="DietPi_OpenVPN_Server" _EOF_ #Create Server Cert Auth - dietpi-notify 2 "Generating unique OpenVPN certificates and keys. Please wait...\n" + G_DIETPI-NOTIFY 2 "Generating unique OpenVPN certificates and keys. Please wait...\n" openssl dhparam -out /etc/openvpn/dh"$key_size".pem "$key_size" #Build Server certs/keys @@ -10950,7 +10950,7 @@ _EOF_ echo '' >> /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn #Copy client file to userdata location - cp /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn "$FP_DIETPI_USERDATA"/ + cp /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn "$G_FP_DIETPI_USERDATA"/ # - and /boot partition cp /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn /boot/ @@ -11055,7 +11055,7 @@ _EOF_ iptables-save > /etc/iptables.ipv4.nat # - RPi 3 - onboard wifi, enable N - if (( $HW_MODEL == 3 && ! $WIFIHOTSPOT_RTL8188C_DEVICE )); then + if (( $G_HW_MODEL == 3 && ! $WIFIHOTSPOT_RTL8188C_DEVICE )); then # - Add Wireless N support echo -e "ieee80211n=1" >> /etc/hostapd/hostapd.conf @@ -11203,7 +11203,7 @@ _EOF_ /DietPi/dietpi/func/create_mysql_db pydio "$GLOBAL_PW" root "$GLOBAL_PW" #Setup Data directory - local target_data_dir="$FP_DIETPI_USERDATA/pydio_data" + local target_data_dir="$G_FP_DIETPI_USERDATA/pydio_data" # - Generate user data dir mkdir -p "$target_data_dir" @@ -11244,7 +11244,7 @@ _EOF_ chmod +x -R /etc/emonhub #RPI 3 - Must disable BCM BT to recover UART 0 - if (( $HW_MODEL == 3 )); then + if (( $G_HW_MODEL == 3 )); then # - Add DToverlay to disable bluetooth if (( $(cat /DietPi/config.txt | grep -ci -m1 '=pi3-disable-bt') == 0 )); then @@ -11372,7 +11372,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then #Cap total connections - local max_users=$(( $HW_CPU_CORES * 8 )) + local max_users=$(( $G_HW_CPU_CORES * 8 )) sed -i "/users=/c\users=$max_users" /etc/mumble-server.ini #Name the root channel @@ -11403,7 +11403,7 @@ _EOF_ #For all ARM devices: # - en_US.UTF8 must be installed and the default locale on system. This is for SBC installs using dev2day repo: https://github.com/Fourdee/DietPi/issues/116#issuecomment-222195911 if (( $USER_INPUTS && - $HW_ARCH < 10 && ! $(locale | grep -ci -m1 'en_US.UTF-8') )); then + $G_HW_ARCH < 10 && ! $(locale | grep -ci -m1 'en_US.UTF-8') )); then sed -i '/en_US.UTF-8 UTF-8/c\en_US.UTF-8 UTF-8' /etc/locale.gen locale-gen @@ -11461,16 +11461,16 @@ _EOF_ killall -w node &> /dev/null killall -w nodejs &> /dev/null - ln -sf "$FP_DIETPI_USERDATA"/mineos/minecraft/mineos_console.js /usr/local/bin/mineos + ln -sf "$G_FP_DIETPI_USERDATA"/mineos/minecraft/mineos_console.js /usr/local/bin/mineos - cp "$FP_DIETPI_USERDATA"/mineos/minecraft/mineos.conf /etc/mineos.conf + cp "$G_FP_DIETPI_USERDATA"/mineos/minecraft/mineos.conf /etc/mineos.conf # - setup SSL cert - cd "$FP_DIETPI_USERDATA"/mineos/minecraft + cd "$G_FP_DIETPI_USERDATA"/mineos/minecraft ./generate-sslcert.sh # - Supervisor service - cp "$FP_DIETPI_USERDATA"/mineos/minecraft/init/supervisor_conf /etc/supervisor/conf.d/mineos.conf + cp "$G_FP_DIETPI_USERDATA"/mineos/minecraft/init/supervisor_conf /etc/supervisor/conf.d/mineos.conf cd "$HOME" @@ -11479,20 +11479,20 @@ _EOF_ echo -e "dietpi\ndietpi\n" | passwd mineos # - Move server data storage to userdata dir (High disk writes) - mkdir -p "$FP_DIETPI_USERDATA"/mineos/serverdata + mkdir -p "$G_FP_DIETPI_USERDATA"/mineos/serverdata mkdir -p /var/games #sometimes this is not created by mineos after installation... Ensures symlink creation does not fail. - cp -R /var/games/minecraft/* "$FP_DIETPI_USERDATA"/mineos/serverdata/ #Folder does not exist during installation, as of 18/09/16 + cp -R /var/games/minecraft/* "$G_FP_DIETPI_USERDATA"/mineos/serverdata/ #Folder does not exist during installation, as of 18/09/16 rm -R /var/games/minecraft - ln -sf "$FP_DIETPI_USERDATA"/mineos/serverdata /var/games/minecraft + ln -sf "$G_FP_DIETPI_USERDATA"/mineos/serverdata /var/games/minecraft chown -R mineos:mineos /var/games/minecraft # - correct the node filepath for supervisor mineos sed -i '/^command=/c\command=/usr/local/bin/node webui.js' /etc/supervisor/conf.d/mineos.conf - # - Set directory to FP_DIETPI_USERDATA - sed -i "/^directory=/c\directory=$FP_DIETPI_USERDATA/mineos/minecraft" /etc/supervisor/conf.d/mineos.conf + # - Set directory to G_FP_DIETPI_USERDATA + sed -i "/^directory=/c\directory=$G_FP_DIETPI_USERDATA/mineos/minecraft" /etc/supervisor/conf.d/mineos.conf supervisorctl reload @@ -11503,7 +11503,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then # - Data storage / user data - mkdir -p "$FP_DIETPI_USERDATA"/gogs-repo + mkdir -p "$G_FP_DIETPI_USERDATA"/gogs-repo # - sqldb /DietPi/dietpi/func/create_mysql_db gogs "$GLOBAL_PW" root "$GLOBAL_PW" @@ -11561,9 +11561,9 @@ Bittorrent\MaxUploadsPerTorrent=$(Optimize_BitTorrent 3) WebUI\Port=1340 WebUI\Enabled=true General\Locale=en_GB -Downloads\SavePath=$FP_DIETPI_USERDATA/downloads +Downloads\SavePath=$G_FP_DIETPI_USERDATA/downloads Downloads\TempPathEnabled=false -Downloads\TempPath=$FP_DIETPI_USERDATA/downloads +Downloads\TempPath=$G_FP_DIETPI_USERDATA/downloads Downloads\ScanDirs=@Invalid() Downloads\DownloadInScanDirs=@Invalid() Downloads\TorrentExportDir= @@ -11657,7 +11657,7 @@ _EOF_ a2enmod rewrite #install scgi module - AGI_ERROR_CHECKED libapache2-mod-scgi + G_AGI_ERROR_CHECKED libapache2-mod-scgi htpasswd -cb /etc/.rutorrent-htaccess root "$GLOBAL_PW" cat << _EOF_ > /var/www/rutorrent/.htaccess @@ -11742,7 +11742,7 @@ _EOF_ chmod 400 /etc/.rutorrent-htaccess # - Session folder - mkdir -p "$FP_DIETPI_USERDATA"/downloads/.session + mkdir -p "$G_FP_DIETPI_USERDATA"/downloads/.session # - Service using screen | '/usr/bin/rtorrent &> /var/log/rtorrent.log &' doesnt work, hangs program after 5 seconds cat << _EOF_ > /etc/systemd/system/rtorrent.service @@ -11792,12 +11792,12 @@ download_rate = 0 upload_rate = 0 # Default directory to save the downloaded torrents. -directory = $FP_DIETPI_USERDATA/downloads +directory = $G_FP_DIETPI_USERDATA/downloads # Default session directory. Make sure you don't run multiple instance # of rtorrent using the same session directory. Perhaps using a # relative path? -session = $FP_DIETPI_USERDATA/downloads/.session +session = $G_FP_DIETPI_USERDATA/downloads/.session # Close torrents when diskspace is low. schedule = low_diskspace,5,60,close_low_diskspace=1000M @@ -11896,7 +11896,7 @@ Description=DietPi Aria2 [Service] Type=simple -ExecStart=$(which aria2c) --enable-rpc --rpc-listen-all --rpc-secret=$GLOBAL_PW --dir=$FP_DIETPI_USERDATA/$FOLDER_DOWNLOADS +ExecStart=$(which aria2c) --enable-rpc --rpc-listen-all --rpc-secret=$GLOBAL_PW --dir=$G_FP_DIETPI_USERDATA/$FOLDER_DOWNLOADS [Install] WantedBy=multi-user.target @@ -11909,8 +11909,8 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then # - Generate dir's - mkdir -p "$FP_DIETPI_USERDATA"/syncthing - mkdir -p "$FP_DIETPI_USERDATA"/syncthing_data + mkdir -p "$G_FP_DIETPI_USERDATA"/syncthing + mkdir -p "$G_FP_DIETPI_USERDATA"/syncthing_data # Logs/Binary mkdir -p /var/log/syncthing @@ -11919,22 +11919,22 @@ _EOF_ chown -R dietpi:dietpi /etc/syncthing # - run syncthing to create cert/config and exit - /etc/syncthing/syncthing -generate="$FP_DIETPI_USERDATA"/syncthing + /etc/syncthing/syncthing -generate="$G_FP_DIETPI_USERDATA"/syncthing # - Disable automatic upgrades - sed -i '/<\/autoUpgradeIntervalH>/c\ 0<\/autoUpgradeIntervalH>' "$FP_DIETPI_USERDATA"/syncthing/config.xml + sed -i '/<\/autoUpgradeIntervalH>/c\ 0<\/autoUpgradeIntervalH>' "$G_FP_DIETPI_USERDATA"/syncthing/config.xml # - Allow external access (LAN). - sed -i '/:8384<\/address>/c\
0.0.0.0:8384<\/address>' "$FP_DIETPI_USERDATA"/syncthing/config.xml + sed -i '/:8384<\/address>/c\
0.0.0.0:8384<\/address>' "$G_FP_DIETPI_USERDATA"/syncthing/config.xml # - Set default folder - sed -i '/label=\"Default Folder/c\ ' "$FP_DIETPI_USERDATA"/syncthing/config.xml + sed -i '/label=\"Default Folder/c\ ' "$G_FP_DIETPI_USERDATA"/syncthing/config.xml # - Disable browser starting - sed -i '/<\/startBrowser>/c\ false<\/startBrowser>' "$FP_DIETPI_USERDATA"/syncthing/config.xml + sed -i '/<\/startBrowser>/c\ false<\/startBrowser>' "$G_FP_DIETPI_USERDATA"/syncthing/config.xml # - Enable filesystem watcher (previously inotify) - sed -i 's/fsWatcherEnabled=\"false\"/fsWatcherEnabled=\"true\"/g' "$FP_DIETPI_USERDATA"/syncthing/config.xml + sed -i 's/fsWatcherEnabled=\"false\"/fsWatcherEnabled=\"true\"/g' "$G_FP_DIETPI_USERDATA"/syncthing/config.xml #services cat << _EOF_ > /etc/systemd/system/syncthing.service @@ -11944,7 +11944,7 @@ After=network.target [Service] Type=simple -ExecStart=/etc/syncthing/syncthing -logfile=/var/log/syncthing/syncthing.log -logflags=3 -home=$FP_DIETPI_USERDATA/syncthing +ExecStart=/etc/syncthing/syncthing -logfile=/var/log/syncthing/syncthing.log -logflags=3 -home=$G_FP_DIETPI_USERDATA/syncthing User=dietpi [Install] @@ -11960,7 +11960,7 @@ _EOF_ INSTALLING_INDEX=111 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - mkdir -p "$FP_DIETPI_USERDATA"/urbackup/urbackup_tmp_files + mkdir -p "$G_FP_DIETPI_USERDATA"/urbackup/urbackup_tmp_files #As we have /tmp mounted to RAM, change tmp locations sed -i '/DAEMON_TMPDIR=/c\DAEMON_TMPDIR="/var/tmp"' /etc/default/urbackupsrv @@ -11974,7 +11974,7 @@ _EOF_ INSTALLING_INDEX=116 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - mkdir -p "$FP_DIETPI_USERDATA"/sickrage + mkdir -p "$G_FP_DIETPI_USERDATA"/sickrage cat << _EOF_ > /etc/systemd/system/sickrage.service [Unit] @@ -11986,7 +11986,7 @@ User=root Group=root Type=forking GuessMainPID=no -ExecStart=/usr/bin/python /etc/sickrage/SickBeard.py -q --daemon --nolaunch --datadir=$FP_DIETPI_USERDATA/sickrage +ExecStart=/usr/bin/python /etc/sickrage/SickBeard.py -q --daemon --nolaunch --datadir=$G_FP_DIETPI_USERDATA/sickrage #ExecStop=/usr/bin/killall -w SickBeard.py [Install] @@ -11995,23 +11995,23 @@ _EOF_ #Grab our premade config: # SickRage must be run at least once, or it will simply overwrite our config - dietpi-notify 2 "Configuring SickRage, please wait..." + G_DIETPI-NOTIFY 2 "Configuring SickRage, please wait..." systemctl start sickrage # Wait for SickRage to generate its default config.ini, else, it will just overwrite our config.ini. local max_loops=10 local current_loop=0 - while [ ! -f "$FP_DIETPI_USERDATA/sickrage/config.ini" ] + while [ ! -f "$G_FP_DIETPI_USERDATA/sickrage/config.ini" ] do - dietpi-notify 2 "Waiting for SickRage to finish 1st run prep, please wait..." + G_DIETPI-NOTIFY 2 "Waiting for SickRage to finish 1st run prep, please wait..." sleep 1 ((current_loop++)) if (( $current_loop >= $max_loops )); then - dietpi-notify 1 "Timed-out waiting for SickRage to generate config.ini" + G_DIETPI-NOTIFY 1 "Timed-out waiting for SickRage to generate config.ini" break fi @@ -12020,8 +12020,8 @@ _EOF_ systemctl stop sickrage - cp "$FP_DIETPI_USERDATA"/sickrage/config.ini "$FP_DIETPI_USERDATA"/sickrage/config.ini.default - wget http://dietpi.com/downloads/conf/sickrage_dietpi_config.ini -O "$FP_DIETPI_USERDATA"/sickrage/config.ini + cp "$G_FP_DIETPI_USERDATA"/sickrage/config.ini "$G_FP_DIETPI_USERDATA"/sickrage/config.ini.default + wget http://dietpi.com/downloads/conf/sickrage_dietpi_config.ini -O "$G_FP_DIETPI_USERDATA"/sickrage/config.ini fi @@ -12045,18 +12045,18 @@ WantedBy=multi-user.target _EOF_ # - userdirs - mkdir -p "$FP_DIETPI_USERDATA"/tonido/sync - mkdir -p "$FP_DIETPI_USERDATA"/tonido/syncdata + mkdir -p "$G_FP_DIETPI_USERDATA"/tonido/sync + mkdir -p "$G_FP_DIETPI_USERDATA"/tonido/syncdata # symlink - cp -R "$HOME"/tonido "$FP_DIETPI_USERDATA"/ + cp -R "$HOME"/tonido "$G_FP_DIETPI_USERDATA"/ rm -R "$HOME"/tonido - ln -sf "$FP_DIETPI_USERDATA"/tonido "$HOME"/tonido - ln -sf "$FP_DIETPI_USERDATA"/tonido/sync "$HOME"/TonidoSync - ln -sf "$FP_DIETPI_USERDATA"/tonido/syncdata "$HOME"/TonidoSyncData + ln -sf "$G_FP_DIETPI_USERDATA"/tonido "$HOME"/tonido + ln -sf "$G_FP_DIETPI_USERDATA"/tonido/sync "$HOME"/TonidoSync + ln -sf "$G_FP_DIETPI_USERDATA"/tonido/syncdata "$HOME"/TonidoSyncData # - armv7 switch - if (( $HW_ARCH == 2 )); then + if (( $G_HW_ARCH == 2 )); then sed -i 's/armv6l/armv7l/' /etc/tonido/manifest.xml sed -i 's/armv6l/armv7l/' /etc/tonido/plugins/*/manifest.xml @@ -12073,10 +12073,10 @@ _EOF_ local export_options="export CHROMIUM_FLAGS=\"\$CHROMIUM_FLAGS --no-sandbox --temp-profile --start-maximized --user-data-dir " #RPi - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then # OpenGL - if (( $HW_MODEL >= 2 )); then + if (( $G_HW_MODEL >= 2 )); then #Hangs xinit: https://github.com/Fourdee/DietPi/issues/834 #/DietPi/dietpi/func/dietpi-set_hardware rpi-opengl enable @@ -12085,7 +12085,7 @@ _EOF_ fi #OpenGL - elif (( $HW_MODEL == 21 )); then + elif (( $G_HW_MODEL == 21 )); then echo 0 &> /dev/null @@ -12184,7 +12184,7 @@ description = DarkIce on DietPi url = http://localhost genre = none public = no -#localDumpFile = $FP_DIETPI_USERDATA/darkice_recording.ogg +#localDumpFile = $G_FP_DIETPI_USERDATA/darkice_recording.ogg _EOF_ #SystemD service for Darkice @@ -12212,10 +12212,10 @@ _EOF_ # - service local fp_java_binary=$(which java) - mkdir -p "$FP_DIETPI_USERDATA"/blynk + mkdir -p "$G_FP_DIETPI_USERDATA"/blynk CONFIG_FILE_URL_ADDRESS='https://raw.githubusercontent.com/blynkkk/blynk-server/master/server/core/src/main/resources/server.properties' - wget "$CONFIG_URL_ADDRESS" -O "$FP_DIETPI_USERDATA"/blynk/server.properties - sed -i "/data.folder=/c\data.folder=$FP_DIETPI_USERDATA/blynk" "$FP_DIETPI_USERDATA"/blynk/server.properties + wget "$CONFIG_URL_ADDRESS" -O "$G_FP_DIETPI_USERDATA"/blynk/server.properties + sed -i "/data.folder=/c\data.folder=$G_FP_DIETPI_USERDATA/blynk" "$G_FP_DIETPI_USERDATA"/blynk/server.properties cat << _EOF_ > /etc/systemd/system/blynkserver.service [Unit] @@ -12224,7 +12224,7 @@ After=network.target [Service] Type=simple -ExecStart=$fp_java_binary -jar /etc/blynkserver/server.jar -serverConfig $FP_DIETPI_USERDATA/blynk/server.properties +ExecStart=$fp_java_binary -jar /etc/blynkserver/server.jar -serverConfig $G_FP_DIETPI_USERDATA/blynk/server.properties [Install] WantedBy=multi-user.target @@ -12237,7 +12237,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then #Enable RPi cam - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then /DietPi/dietpi/func/dietpi-set_hardware rpi-camera enable @@ -12246,8 +12246,8 @@ _EOF_ mkdir -p /etc/motioneye cp /usr/local/share/motioneye/extra/motioneye.conf.sample /etc/motioneye/motioneye.conf - mkdir -p "$FP_DIETPI_USERDATA"/motioneye - sed -i "/^media_path/c\media_path $FP_DIETPI_USERDATA/motioneye" /etc/motioneye/motioneye.conf + mkdir -p "$G_FP_DIETPI_USERDATA"/motioneye + sed -i "/^media_path/c\media_path $G_FP_DIETPI_USERDATA/motioneye" /etc/motioneye/motioneye.conf # service cp /usr/local/share/motioneye/extra/motioneye.systemd-unit-local /etc/systemd/system/motioneye.service @@ -12310,7 +12310,7 @@ _EOF_ rm /etc/sabnzbd/sabnzbd.ini &> /dev/null systemctl start sabnzbd - dietpi-notify 2 "Generating initial config, please wait..." + G_DIETPI-NOTIFY 2 "Generating initial config, please wait..." while [ ! -f /etc/sabnzbd/sabnzbd.ini ] do @@ -12324,10 +12324,10 @@ _EOF_ sleep 2 #additional wait, config being overwritten after below changes: http://dietpi.com/phpbb/viewtopic.php?f=11&t=1848&p=7085#p7082 - sed -i "/^download_dir =/c\download_dir = $FP_DIETPI_USERDATA/downloads/incomplete" /etc/sabnzbd/sabnzbd.ini - sed -i "/^complete_dir =/c\complete_dir = $FP_DIETPI_USERDATA/downloads/complete" /etc/sabnzbd/sabnzbd.ini - sed -i "/^nzb_backup_dir =/c\nzb_backup_dir = $FP_DIETPI_USERDATA/downloads/sabnzbd_nzb_backup" /etc/sabnzbd/sabnzbd.ini - sed -i "/^admin_dir =/c\admin_dir = $FP_DIETPI_USERDATA/downloads/sabnzbd_admin" /etc/sabnzbd/sabnzbd.ini + sed -i "/^download_dir =/c\download_dir = $G_FP_DIETPI_USERDATA/downloads/incomplete" /etc/sabnzbd/sabnzbd.ini + sed -i "/^complete_dir =/c\complete_dir = $G_FP_DIETPI_USERDATA/downloads/complete" /etc/sabnzbd/sabnzbd.ini + sed -i "/^nzb_backup_dir =/c\nzb_backup_dir = $G_FP_DIETPI_USERDATA/downloads/sabnzbd_nzb_backup" /etc/sabnzbd/sabnzbd.ini + sed -i "/^admin_dir =/c\admin_dir = $G_FP_DIETPI_USERDATA/downloads/sabnzbd_admin" /etc/sabnzbd/sabnzbd.ini sed -i "/^log_dir =/c\log_dir = /var/log" /etc/sabnzbd/sabnzbd.ini sed -i "/^log_level =/c\log_level = 0" /etc/sabnzbd/sabnzbd.ini #err only sed -i "/^refresh_rate =/c\refresh_rate = 2" /etc/sabnzbd/sabnzbd.ini @@ -12346,8 +12346,8 @@ After=sound.target [Service] Type=simple -WorkingDirectory=$FP_DIETPI_USERDATA/spotify-connect-web -ExecStart=$FP_DIETPI_USERDATA/spotify-connect-web/spotify-connect-web +WorkingDirectory=$G_FP_DIETPI_USERDATA/spotify-connect-web +ExecStart=$G_FP_DIETPI_USERDATA/spotify-connect-web/spotify-connect-web [Install] WantedBy=multi-user.target @@ -12362,10 +12362,10 @@ _EOF_ cp /etc/couchpotato/init/ubuntu.default /etc/default/couchpotato sed -i "/CP_USER=/c\CP_USER=root" /etc/default/couchpotato sed -i "/CP_HOME=/c\CP_HOME=/etc/couchpotato" /etc/default/couchpotato - sed -i "/CP_DATA=/c\CP_DATA=$FP_DIETPI_USERDATA/couchpotato" /etc/default/couchpotato + sed -i "/CP_DATA=/c\CP_DATA=$G_FP_DIETPI_USERDATA/couchpotato" /etc/default/couchpotato - mkdir -p "$FP_DIETPI_USERDATA"/couchpotato - #useradd -d "$FP_DIETPI_USERDATA"/couchpotato couchpotato + mkdir -p "$G_FP_DIETPI_USERDATA"/couchpotato + #useradd -d "$G_FP_DIETPI_USERDATA"/couchpotato couchpotato cp /etc/couchpotato/init/ubuntu /etc/init.d/couchpotato @@ -12463,14 +12463,14 @@ _EOF_ INSTALLING_INDEX=146 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - mkdir -p "$FP_DIETPI_USERDATA"/plexpy + mkdir -p "$G_FP_DIETPI_USERDATA"/plexpy cat << _EOF_ > /etc/systemd/system/plexpy.service [Unit] Description=PlexPy - Stats for Plex Media Server usage [Service] -ExecStart=/opt/plexpy/PlexPy.py --quiet --daemon --nolaunch --config /opt/plexpy/config.ini --datadir $FP_DIETPI_USERDATA/plexpy +ExecStart=/opt/plexpy/PlexPy.py --quiet --daemon --nolaunch --config /opt/plexpy/config.ini --datadir $G_FP_DIETPI_USERDATA/plexpy GuessMainPID=no Type=forking User=root @@ -12509,27 +12509,27 @@ _EOF_ INSTALLING_INDEX=149 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - sed -i "/MainDir=/c\MainDir=$FP_DIETPI_USERDATA/downloads" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf - sed -i "/DestDir=/c\DestDir=$FP_DIETPI_USERDATA/downloads/complete" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/MainDir=/c\MainDir=$G_FP_DIETPI_USERDATA/downloads" "$G_FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/DestDir=/c\DestDir=$G_FP_DIETPI_USERDATA/downloads/complete" "$G_FP_DIETPI_USERDATA"/nzbget/nzbget.conf - sed -i "/LogFile=/c\LogFile=/var/log/nzbget.log" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/LogFile=/c\LogFile=/var/log/nzbget.log" "$G_FP_DIETPI_USERDATA"/nzbget/nzbget.conf - sed -i "/ControlUsername=/c\ControlUsername=root" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf - sed -i "/ControlPassword=/c\ControlPassword=$GLOBAL_PW" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/ControlUsername=/c\ControlUsername=root" "$G_FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/ControlPassword=/c\ControlPassword=$GLOBAL_PW" "$G_FP_DIETPI_USERDATA"/nzbget/nzbget.conf # Optimizations - sed -i "/Server1.Cipher=/c\Server1.Cipher=RC4-MD5" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf - sed -i "/CrcCheck=/c\CrcCheck=no" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf - sed -i "/ParScan=/c\ParScan=limited" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf - sed -i "/ParThreads=/c\ParThreads=$HW_CPU_CORES" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/Server1.Cipher=/c\Server1.Cipher=RC4-MD5" "$G_FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/CrcCheck=/c\CrcCheck=no" "$G_FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/ParScan=/c\ParScan=limited" "$G_FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/ParThreads=/c\ParThreads=$G_HW_CPU_CORES" "$G_FP_DIETPI_USERDATA"/nzbget/nzbget.conf - sed -i "/DebugTarget=/c\DebugTarget=none" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf - sed -i "/CrashTrace=/c\CrashTrace=no" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf - sed -i "/DetailTarget=/c\DetailTarget=none" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/DebugTarget=/c\DebugTarget=none" "$G_FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/CrashTrace=/c\CrashTrace=no" "$G_FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/DetailTarget=/c\DetailTarget=none" "$G_FP_DIETPI_USERDATA"/nzbget/nzbget.conf - sed -i "/ParBuffer=/c\ParBuffer=$(Optimize_BitTorrent 0)" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf - sed -i "/ArticleCache=/c\ArticleCache=$(Optimize_BitTorrent 0)" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf - sed -i "/WriteBuffer=/c\WriteBuffer=$(Optimize_BitTorrent 0)" "$FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/ParBuffer=/c\ParBuffer=$(Optimize_BitTorrent 0)" "$G_FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/ArticleCache=/c\ArticleCache=$(Optimize_BitTorrent 0)" "$G_FP_DIETPI_USERDATA"/nzbget/nzbget.conf + sed -i "/WriteBuffer=/c\WriteBuffer=$(Optimize_BitTorrent 0)" "$G_FP_DIETPI_USERDATA"/nzbget/nzbget.conf cat << _EOF_ > /etc/systemd/system/nzbget.service [Unit] @@ -12538,8 +12538,8 @@ Description=NZBget [Service] Type=forking User=root -WorkingDirectory=$FP_DIETPI_USERDATA/nzbget -ExecStart=$FP_DIETPI_USERDATA/nzbget/nzbget -D +WorkingDirectory=$G_FP_DIETPI_USERDATA/nzbget +ExecStart=$G_FP_DIETPI_USERDATA/nzbget/nzbget -D [Install] WantedBy=multi-user.target @@ -12558,7 +12558,7 @@ After=network.target [Service] Type=simple -ExecStart=/usr/bin/python $FP_DIETPI_USERDATA/htpc-manager/Htpc.py +ExecStart=/usr/bin/python $G_FP_DIETPI_USERDATA/htpc-manager/Htpc.py [Install] WantedBy=multi-user.target @@ -12597,8 +12597,8 @@ After=network.target [Service] Type=simple User=root -Environment=ROON_DATAROOT=$FP_DIETPI_USERDATA/roonserver -ExecStart=$FP_DIETPI_USERDATA/roonserver/start.sh +Environment=ROON_DATAROOT=$G_FP_DIETPI_USERDATA/roonserver +ExecStart=$G_FP_DIETPI_USERDATA/roonserver/start.sh [Install] WantedBy=multi-user.target @@ -12610,11 +12610,11 @@ _EOF_ INSTALLING_INDEX=156 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - mkdir -p "$FP_DIETPI_USERDATA"/steam - mv "$HOME"/.steam/* "$FP_DIETPI_USERDATA"/steam/ + mkdir -p "$G_FP_DIETPI_USERDATA"/steam + mv "$HOME"/.steam/* "$G_FP_DIETPI_USERDATA"/steam/ rm -R "$HOME"/.steam - ln -sf "$FP_DIETPI_USERDATA"/steam "$HOME"/.steam + ln -sf "$G_FP_DIETPI_USERDATA"/steam "$HOME"/.steam fi @@ -12640,8 +12640,8 @@ _EOF_ # Link to the default ha location for the homeassistant user, this makes # the configuration avaliable for the user to edit. Configuration generated # when service is started at /home/homeassistant/.homeassistant - mkdir "$FP_DIETPI_USERDATA"/homeassistant - ln -sf "$FP_DIETPI_USERDATA"/homeassistant /home/homeassistant/.homeassistant + mkdir "$G_FP_DIETPI_USERDATA"/homeassistant + ln -sf "$G_FP_DIETPI_USERDATA"/homeassistant /home/homeassistant/.homeassistant fi #------------------------------------------------------------------- @@ -12653,7 +12653,7 @@ _EOF_ # Create simple mandatory default configuration file cat << _EOF_ >> /etc/default/minio # Default file path -MINIO_VOLUMES="$FP_DIETPI_USERDATA/minio-data" +MINIO_VOLUMES="$G_FP_DIETPI_USERDATA/minio-data" # Use if you want to run Minio on a custom port. # MINIO_OPTS="--address :9199" # Access Key of the server. @@ -12672,13 +12672,13 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then # Create directory for docker containers - mkdir "$FP_DIETPI_USERDATA"/docker-data + mkdir "$G_FP_DIETPI_USERDATA"/docker-data # stop service systemctl stop docker.service # Set container(s) locations in /lib/systemd/system/docker.service - sed -i "/ExecStart=\/usr\/bin\/dockerd/c\ExecStart=\/usr\/bin\/dockerd -g $FP_DIETPI_USERDATA\/docker-data -H fd:\/\/" /lib/systemd/system/docker.service + sed -i "/ExecStart=\/usr\/bin\/dockerd/c\ExecStart=\/usr\/bin\/dockerd -g $G_FP_DIETPI_USERDATA\/docker-data -H fd:\/\/" /lib/systemd/system/docker.service fi @@ -12689,21 +12689,21 @@ _EOF_ # Setup Filestore DietPi appropriate # IF already present just create symlink - if [ ! -f "$FP_DIETPI_USERDATA"/fuguhub-data/ ]; then + if [ ! -f "$G_FP_DIETPI_USERDATA"/fuguhub-data/ ]; then # Move installed filestore to dietpi folder - mkdir "$FP_DIETPI_USERDATA"/fuguhub-data/ - mv /home/bd/disk/* "$FP_DIETPI_USERDATA"/fuguhub-data/ + mkdir "$G_FP_DIETPI_USERDATA"/fuguhub-data/ + mv /home/bd/disk/* "$G_FP_DIETPI_USERDATA"/fuguhub-data/ # Removed 'actual' folder to make way for symlink rm -r /home/bd/disk # Create symlink - ln -s "$FP_DIETPI_USERDATA"/fuguhub-data /home/bd/disk + ln -s "$G_FP_DIETPI_USERDATA"/fuguhub-data /home/bd/disk # Set permissions - # setfacl -R -m u:bd:rwx "$FP_DIETPI_USERDATA"/fuguhub-data/ + # setfacl -R -m u:bd:rwx "$G_FP_DIETPI_USERDATA"/fuguhub-data/ else # Removed 'actual' folder to make way for symlink rm -r /home/bd/disk # Create symlink - ln -s "$FP_DIETPI_USERDATA"/fuguhub-data /home/bd/disk + ln -s "$G_FP_DIETPI_USERDATA"/fuguhub-data /home/bd/disk fi fi @@ -12742,9 +12742,9 @@ Description=Gitea (Git with a cup of tea) [Service] Type=simple User=dietpi -WorkingDirectory=$FP_DIETPI_USERDATA/gitea/gitea-repositories -ExecStart=$FP_DIETPI_USERDATA/gitea/gitea web -Environment=USER=dietpi HOME=$FP_DIETPI_USERDATA/gitea +WorkingDirectory=$G_FP_DIETPI_USERDATA/gitea/gitea-repositories +ExecStart=$G_FP_DIETPI_USERDATA/gitea/gitea web +Environment=USER=dietpi HOME=$G_FP_DIETPI_USERDATA/gitea [Install] WantedBy=multi-user.target @@ -12784,7 +12784,7 @@ _EOF_ #HW specific changes # - SPARKY ONLY - Auto detect eth adapter - if (( $HW_MODEL == 70 )); then + if (( $G_HW_MODEL == 70 )); then # - Disable onboard ETH if adapter found cat << _EOF_ > /etc/systemd/system/sparky_eth_controller.service @@ -12874,7 +12874,7 @@ do if (( \$(gpio -g read 17) == 1 )); then - dietpi-notify 0 "AudioPhonics Pi-SPC: Power off requested. Shutting down system." + G_DIETPI-NOTIFY 0 "AudioPhonics Pi-SPC: Power off requested. Shutting down system." sudo poweroff #sudo shutdown -h -P now break @@ -13066,7 +13066,7 @@ _EOF_ while [ ! -f /DietPi/.ramdisk ] do - dietpi-notify 2 "Waiting for DietPi-RAMDISK to finish mounting DietPi to RAM..." + G_DIETPI-NOTIFY 2 "Waiting for DietPi-RAMDISK to finish mounting DietPi to RAM..." sleep 1 done @@ -13124,7 +13124,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then # - Symlink userdata location for assistant.json - ln -sf "$FP_DIETPI_USERDATA"/voice-recognizer-raspi/assistant.json /home/dietpi/assistant.json + ln -sf "$G_FP_DIETPI_USERDATA"/voice-recognizer-raspi/assistant.json /home/dietpi/assistant.json # - Generate cache dir mkdir -p /home/dietpi/.cache/voice-recognizer @@ -13180,7 +13180,7 @@ _EOF_ if (( $gpu_memory > 0 )); then #RPi - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then /DietPi/dietpi/func/dietpi-set_hardware gpumemsplit $gpu_memory @@ -13191,19 +13191,19 @@ _EOF_ if (( $gpu_enabled )); then #RPi - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then sed -i "/rpi_hdmi_output=/c\rpi_hdmi_output=1" /DietPi/dietpi.txt #odroid C1 - elif (( $HW_MODEL == 10 )); then + elif (( $G_HW_MODEL == 10 )); then sed -i '/setenv hdmioutput /c\setenv hdmioutput "1"' /DietPi/boot.ini sed -i '/setenv vpu /c\setenv vpu "1"' /DietPi/boot.ini sed -i '/setenv m_bpp /c\setenv m_bpp "32"' /DietPi/boot.ini #Odroid C2 - elif (( $HW_MODEL == 12 )); then + elif (( $G_HW_MODEL == 12 )); then sed -i '/setenv nographics /c\setenv nographics "0"' /DietPi/boot.ini @@ -13235,10 +13235,10 @@ _EOF_ #---------------------------------------------------------------------- #Inform User - dietpi-notify 3 DietPi-Software "Uninstall" + G_DIETPI-NOTIFY 3 DietPi-Software "Uninstall" echo -e "" - dietpi-notify 0 "Uninstalling ${aSOFTWARE_WHIP_NAME[$1]}: ${aSOFTWARE_WHIP_DESC[$1]}\n" + G_DIETPI-NOTIFY 0 "Uninstalling ${aSOFTWARE_WHIP_NAME[$1]}: ${aSOFTWARE_WHIP_DESC[$1]}\n" #Was a uninstall event trigged? local valid_input=1 @@ -13269,55 +13269,55 @@ _EOF_ elif (( $1 == 23 )); then - AGP_ERROR_CHECKED lxde lxde-* upower policykit-1 iceweasel p7zip-full + G_AGP_ERROR_CHECKED lxde lxde-* upower policykit-1 iceweasel p7zip-full elif (( $1 == 24 )); then - AGP_ERROR_CHECKED mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full + G_AGP_ERROR_CHECKED mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full elif (( $1 == 26 )); then - AGP_ERROR_CHECKED x-window-system-core wmaker gnustep gnustep-devel gnustep-games upower policykit-1 iceweasel p7zip-full + G_AGP_ERROR_CHECKED x-window-system-core wmaker gnustep gnustep-devel gnustep-games upower policykit-1 iceweasel p7zip-full elif (( $1 == 25 )); then - AGP_ERROR_CHECKED xfce4 gnome-icon-theme tango-icon-theme iceweasel p7zip-full + G_AGP_ERROR_CHECKED xfce4 gnome-icon-theme tango-icon-theme iceweasel p7zip-full elif (( $1 == 22 )); then - AGP_ERROR_CHECKED quiterss + G_AGP_ERROR_CHECKED quiterss elif (( $1 == 30 )); then - AGP_ERROR_CHECKED nomachine + G_AGP_ERROR_CHECKED nomachine elif (( $1 == 29 )); then - AGP_ERROR_CHECKED xrdp + G_AGP_ERROR_CHECKED xrdp elif (( $1 == 44 )); then - AGP_ERROR_CHECKED transmission-daemon + G_AGP_ERROR_CHECKED transmission-daemon rm /etc/init.d/transmission-daemon &> /dev/null rm /etc/systemd/system/transmission-daemon.service &> /dev/null elif (( $1 == 83 )); then - AGP_ERROR_CHECKED apache2 + G_AGP_ERROR_CHECKED apache2 elif (( $1 == 85 )); then - AGP_ERROR_CHECKED nginx + G_AGP_ERROR_CHECKED nginx elif (( $1 == 84 )); then - AGP_ERROR_CHECKED lighttpd + G_AGP_ERROR_CHECKED lighttpd elif (( $1 == 86 || $1 == 88 )); then - AGP_ERROR_CHECKED mysql-server mysql-client + G_AGP_ERROR_CHECKED mysql-server mysql-client - AGP_ERROR_CHECKED mariadb-server mariadb-client + G_AGP_ERROR_CHECKED mariadb-server mariadb-client # - custom confs rm /etc/mysql/conf.d/reduce_resources.cnf @@ -13327,21 +13327,21 @@ _EOF_ # - SQL store rm -R /var/lib/mysql - rm -R "$FP_DIETPI_USERDATA"/mysql + rm -R "$G_FP_DIETPI_USERDATA"/mysql elif (( $1 == 87 )); then - AGP_ERROR_CHECKED sqlite3 + G_AGP_ERROR_CHECKED sqlite3 elif (( $1 == 91 )); then - AGP_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-redis redis-server redis-tools + G_AGP_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-redis redis-server redis-tools elif (( $1 == 89 )); then rm "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf rm "$FP_PHP_BASE_DIR"/mods-available/dietpi.ini 2> /dev/null - AGP_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-* libapache2-mod-"$PHP_APT_PACKAGE_NAME" + G_AGP_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-* libapache2-mod-"$PHP_APT_PACKAGE_NAME" rm /var/www/phpinfo.php rm /var/www/apc.php rm /var/www/opcache.php @@ -13350,7 +13350,7 @@ _EOF_ elif (( $1 == 90 )); then - AGP_ERROR_CHECKED phpmyadmin + G_AGP_ERROR_CHECKED phpmyadmin elif (( $1 == 54 )); then @@ -13374,10 +13374,10 @@ _EOF_ (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 )) && mysql_auth+=" -p$GLOBAL_PW" mysql "$mysql_auth" -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")@$(grep -m1 "'dbhost'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" mysql "$mysql_auth" -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" - mysqldump --lock-tables "$mysql_auth" owncloud > "$FP_DIETPI_USERDATA"/owncloud_data/mysql_backup.sql + mysqldump --lock-tables "$mysql_auth" owncloud > "$G_FP_DIETPI_USERDATA"/owncloud_data/mysql_backup.sql mysqladmin "$mysql_auth" drop owncloud -f # Purge APT package - AGP_ERROR_CHECKED owncloud-files owncloud owncloud-deps + G_AGP_ERROR_CHECKED owncloud-files owncloud owncloud-deps # Remove ownCloud installation folder rm -R /var/www/owncloud # Remove ownCloud repo @@ -13399,14 +13399,14 @@ _EOF_ (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 )) && mysql_auth+=" -p$GLOBAL_PW" mysql "$mysql_auth" -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/,//")" mysql "$mysql_auth" -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" - mysqldump --lock-tables "$mysql_auth" nextcloud > "$FP_DIETPI_USERDATA"/nextcloud_data/mysql_backup.sql + mysqldump --lock-tables "$mysql_auth" nextcloud > "$G_FP_DIETPI_USERDATA"/nextcloud_data/mysql_backup.sql mysqladmin "$mysql_auth" drop nextcloud -f # Remove Nextcloud installation folder rm -R /var/www/nextcloud elif (( $1 == 115 )); then - AGP_ERROR_CHECKED webmin + G_AGP_ERROR_CHECKED webmin elif (( $1 == 32 )); then @@ -13415,10 +13415,10 @@ _EOF_ elif (( $1 == 128 )); then - AGP_ERROR_CHECKED mpd libmpdclient2 + G_AGP_ERROR_CHECKED mpd libmpdclient2 userdel -f mpd &> /dev/null rm /lib/systemd/system/mpd.service - rm -R "$FP_DIETPI_USERDATA"/.mpd_cache + rm -R "$G_FP_DIETPI_USERDATA"/.mpd_cache elif (( $1 == 121 )); then @@ -13429,24 +13429,24 @@ _EOF_ rm /etc/systemd/system/node-red.service rm "$HOME"/.node-red - rm -R "$FP_DIETPI_USERDATA"/node-red + rm -R "$G_FP_DIETPI_USERDATA"/node-red elif (( $1 == 123 )); then - AGP_ERROR_CHECKED mosquitto + G_AGP_ERROR_CHECKED mosquitto rm /etc/apt/sources.list.d/mosquitto-*.list elif (( $1 == 124 )); then - AGP_ERROR_CHECKED networkaudiod + G_AGP_ERROR_CHECKED networkaudiod elif (( $1 == 125 )); then - AGP_ERROR_CHECKED tomcat8 + G_AGP_ERROR_CHECKED tomcat8 elif (( $1 == 126 )); then - AGP_ERROR_CHECKED openmediavault + G_AGP_ERROR_CHECKED openmediavault rm /etc/apt/sources.list.d/openmediavault.list elif (( $1 == 129 )); then @@ -13457,7 +13457,7 @@ _EOF_ elif (( $1 == 130 )); then - AGP_ERROR_CHECKED python-pip python3-pip + G_AGP_ERROR_CHECKED python-pip python3-pip elif (( $1 == 131 )); then @@ -13471,7 +13471,7 @@ _EOF_ rm /usr/local/bin/aria2c rm -R /var/www/aria2 - AGP_ERROR_CHECKED aria2 + G_AGP_ERROR_CHECKED aria2 elif (( $1 == 133 )); then @@ -13492,13 +13492,13 @@ _EOF_ elif (( $1 == 135 )); then - AGP_ERROR_CHECKED darkice icecast2 + G_AGP_ERROR_CHECKED darkice icecast2 rm /etc/systemd/system/darkice.service elif (( $1 == 136 )); then - AGP_ERROR_CHECKED motion + G_AGP_ERROR_CHECKED motion rm -R /etc/motioneye @@ -13508,11 +13508,11 @@ _EOF_ elif (( $1 == 137 )); then - AGP_ERROR_CHECKED cloudprint-service - if (( $DISTRO == 3 )); then + G_AGP_ERROR_CHECKED cloudprint-service + if (( $G_DISTRO == 3 )); then rm /etc/apt/sources.list.d/cloudprint.list - AGUP + G_AGUP fi @@ -13530,17 +13530,17 @@ _EOF_ elif (( $1 == 140 )); then - AGP_ERROR_CHECKED libsdl2 libsdl2-image libsdl2-mixer libsdl2-net libsdl2-ttf libsmpeg2 + G_AGP_ERROR_CHECKED libsdl2 libsdl2-image libsdl2-mixer libsdl2-net libsdl2-ttf libsmpeg2 elif (( $1 == 141 )); then - rm -R "$FP_DIETPI_USERDATA"/spotify-connect-web + rm -R "$G_FP_DIETPI_USERDATA"/spotify-connect-web rm /etc/systemd/system/spotify-connect-web.service elif (( $1 == 142 )); then rm -R /etc/couchpotato - rm -R "$FP_DIETPI_USERDATA"/couchpotato + rm -R "$G_FP_DIETPI_USERDATA"/couchpotato rm /etc/init.d/couchpotato #userdel -f couchpotato @@ -13556,10 +13556,10 @@ _EOF_ elif (( $1 == 144 )); then - AGP_ERROR_CHECKED nzbdrone + G_AGP_ERROR_CHECKED nzbdrone rm /etc/systemd/system/sonarr.service rm /etc/apt/sources.list.d/sonarr.list - AGUP + G_AGUP elif (( $1 == 145 )); then @@ -13569,7 +13569,7 @@ _EOF_ elif (( $1 == 146 )); then rm -R /opt/plexpy - rm -R "$FP_DIETPI_USERDATA"/plexpy + rm -R "$G_FP_DIETPI_USERDATA"/plexpy rm /etc/systemd/system/plexpy.service elif (( $1 == 147 )); then @@ -13579,86 +13579,86 @@ _EOF_ elif (( $1 == 148 )); then - AGP_ERROR_CHECKED mediacenter22 + G_AGP_ERROR_CHECKED mediacenter22 elif (( $1 == 149 )); then - rm -R "$FP_DIETPI_USERDATA"/nzbget + rm -R "$G_FP_DIETPI_USERDATA"/nzbget rm /etc/systemd/system/nzbget.service elif (( $1 == 155 )); then - rm -R "$FP_DIETPI_USERDATA"/htpc-manager + rm -R "$G_FP_DIETPI_USERDATA"/htpc-manager rm /etc/systemd/system/htpc-manager.service elif (( $1 == 150 )); then - #AGP_ERROR_CHECKED mono-runtime #shared lib + #G_AGP_ERROR_CHECKED mono-runtime #shared lib rm /etc/apt/sources.list.d/mono-xamarin.list - AGUP + G_AGUP elif (( $1 == 151 )); then - AGP_ERROR_CHECKED nvidia-driver nvidia-xconfig libgl1-nvidia-glx:i386 + G_AGP_ERROR_CHECKED nvidia-driver nvidia-xconfig libgl1-nvidia-glx:i386 elif (( $1 == 152 )); then - AGP_ERROR_CHECKED avahi-daemon + G_AGP_ERROR_CHECKED avahi-daemon elif (( $1 == 153 )); then - rm -R "$FP_DIETPI_USERDATA"/octoprint + rm -R "$G_FP_DIETPI_USERDATA"/octoprint rm $(which octoprint) rm -R "$HOME"/.octoprint rm /etc/systemd/system/octoprint.service elif (( $1 == 154 )); then - rm -R "$FP_DIETPI_USERDATA"/roonserver + rm -R "$G_FP_DIETPI_USERDATA"/roonserver rm /etc/systemd/system/roonserver.service elif (( $1 == 156 )); then - AGP_ERROR_CHECKED steam + G_AGP_ERROR_CHECKED steam rm -R "$HOME"/.steam - rm -R "$FP_DIETPI_USERDATA"/steam + rm -R "$G_FP_DIETPI_USERDATA"/steam elif (( $1 == 119 )); then - AGP_ERROR_CHECKED cava + G_AGP_ERROR_CHECKED cava rm "$HOME/.config/cava/config" rm "$HOME/cava.psf" elif (( $1 == 118 )); then - AGP_ERROR_CHECKED mopidy + G_AGP_ERROR_CHECKED mopidy rm /etc/apt/sources.list.d/mopidy.list pip uninstall -y Mopidy-MusicBox-Webclient Mopidy-Local-Images elif (( $1 == 31 )); then - AGP_ERROR_CHECKED kodi + G_AGP_ERROR_CHECKED kodi #+Odroids - AGP_ERROR_CHECKED kodi-odroid + G_AGP_ERROR_CHECKED kodi-odroid rm /usr/share/applications/kodi.desktop rm ~/Desktop/kodi.desktop elif (( $1 == 39 )); then - AGP_ERROR_CHECKED minidlna + G_AGP_ERROR_CHECKED minidlna elif (( $1 == 51 )); then - AGP_ERROR_CHECKED ibsdl1.2debian libsdl-net1.2 + G_AGP_ERROR_CHECKED ibsdl1.2debian libsdl-net1.2 rm -R /usr/local/games/opentyrian rm /usr/share/applications/opentyrian.desktop rm ~/Desktop/opentyrian.desktop elif (( $1 == 59 )); then - AGP_ERROR_CHECKED gpac + G_AGP_ERROR_CHECKED gpac rm -R /var/www/dietpicam rm /opt/vc/bin/raspimjpeg rm /usr/bin/raspimjpeg @@ -13667,25 +13667,25 @@ _EOF_ elif (( $1 == 45 )); then - AGP_ERROR_CHECKED deluged deluge-web deluge-webui deluge-console + G_AGP_ERROR_CHECKED deluged deluge-web deluge-webui deluge-console rm /etc/dietpi/dietpi-software/services/deluge.service rm -R ~/.config/deluge elif (( $1 == 94 )); then - AGP_ERROR_CHECKED proftpd-basic + G_AGP_ERROR_CHECKED proftpd-basic elif (( $1 == 96 )); then - AGP_ERROR_CHECKED samba samba-common-bin + G_AGP_ERROR_CHECKED samba samba-common-bin elif (( $1 == 95 )); then - AGP_ERROR_CHECKED vsftpd + G_AGP_ERROR_CHECKED vsftpd elif (( $1 == 109 )); then - AGP_ERROR_CHECKED nfs-kernel-server + G_AGP_ERROR_CHECKED nfs-kernel-server elif (( $1 == 67 )); then @@ -13703,7 +13703,7 @@ _EOF_ elif (( $1 == 93 )); then - AGP_ERROR_CHECKED dnsmasq + G_AGP_ERROR_CHECKED dnsmasq pihole uninstall #https://github.com/Fourdee/DietPi/issues/753 @@ -13719,7 +13719,7 @@ _EOF_ elif (( $1 == 33 || $1 == 34 )); then - AGP_ERROR_CHECKED subsonic + G_AGP_ERROR_CHECKED subsonic rm -R /var/subsonic elif (( $1 == 71 )); then @@ -13738,7 +13738,7 @@ _EOF_ rm "$HOME"/weaved_setup.bin # Remot3.it - AGP_ERROR_CHECKED weavedconnectd + G_AGP_ERROR_CHECKED weavedconnectd elif (( $1 == 62 )); then @@ -13763,11 +13763,11 @@ _EOF_ rm -r /etc/haproxy #Shared dev libraries. Leave these installed - #AGP_ERROR_CHECKED libpcre3-dev libssl-dev + #G_AGP_ERROR_CHECKED libpcre3-dev libssl-dev elif (( $1 == 35 )); then - AGP_ERROR_CHECKED logitechmediaserver + G_AGP_ERROR_CHECKED logitechmediaserver rm /etc/dietpi/dietpi-software/services/squeezeboxserver.service rm -R /var/lib/squeezeboxserver rm -R /usr/share/squeezeboxserver @@ -13778,11 +13778,11 @@ _EOF_ elif (( $1 == 27 || $1 == 28 || $1 == 120 )); then - AGP_ERROR_CHECKED tightvncserver - AGP_ERROR_CHECKED vnc4server - AGP_ERROR_CHECKED x11vnc - AGP_ERROR_CHECKED realvnc-vnc-server - AGP_ERROR_CHECKED tigervnc-* + G_AGP_ERROR_CHECKED tightvncserver + G_AGP_ERROR_CHECKED vnc4server + G_AGP_ERROR_CHECKED x11vnc + G_AGP_ERROR_CHECKED realvnc-vnc-server + G_AGP_ERROR_CHECKED tigervnc-* rm /etc/systemd/system/vncserver.service rm /etc/init.d/vncserver @@ -13797,7 +13797,7 @@ _EOF_ elif (( $1 == 73 )); then - AGP_ERROR_CHECKED fail2ban + G_AGP_ERROR_CHECKED fail2ban elif (( $1 == 64 )); then @@ -13824,14 +13824,14 @@ _EOF_ elif (( $1 == 97 )); then - AGP_ERROR_CHECKED openvpn + G_AGP_ERROR_CHECKED openvpn rm -R /etc/openvpn &> /dev/null elif (( $1 == 92 )); then - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then - AGP_ERROR_CHECKED python-certbot-apache python-certbot-nginx certbot + G_AGP_ERROR_CHECKED python-certbot-apache python-certbot-nginx certbot fi @@ -13840,11 +13840,11 @@ _EOF_ elif (( $1 == 69 )); then - AGP_ERROR_CHECKED python-rpi.gpio python3-rpi.gpio + G_AGP_ERROR_CHECKED python-rpi.gpio python3-rpi.gpio elif (( $1 == 72 )); then - AGP_ERROR_CHECKED i2c-tools + G_AGP_ERROR_CHECKED i2c-tools #Disable /DietPi/dietpi/func/dietpi-set_hardware i2c disable @@ -13854,7 +13854,7 @@ _EOF_ elif (( $1 == 60 )); then - AGP_ERROR_CHECKED hostapd isc-dhcp-server + G_AGP_ERROR_CHECKED hostapd isc-dhcp-server rm /etc/dhcp/dhcpd.conf &> /dev/null rm /etc/hostapd/hostapd.conf &> /dev/null @@ -13892,19 +13892,19 @@ _EOF_ elif (( $1 == 61 )); then - AGP_ERROR_CHECKED tor + G_AGP_ERROR_CHECKED tor # - uninstall WIFIHOTSPOT ALSO. Due to IPtables needing reset. Uninstall_Software 60 elif (( $1 == 37 )); then - AGP_ERROR_CHECKED shairport-sync* + G_AGP_ERROR_CHECKED shairport-sync* userdel -f shairport-sync elif (( $1 == 38 )); then - AGP_ERROR_CHECKED brutefir + G_AGP_ERROR_CHECKED brutefir rm -R /etc/BruteFIR rm /etc/dietpi/dietpi-software/services/brutefir.service @@ -13923,7 +13923,7 @@ _EOF_ elif (( $1 == 36 )); then - AGP_ERROR_CHECKED squeezelite + G_AGP_ERROR_CHECKED squeezelite rm -R /usr/bin/squeezelite* rm /etc/systemd/system/squeezelite.service @@ -13936,7 +13936,7 @@ _EOF_ elif (( $1 == 66 )); then - AGP_ERROR_CHECKED rpimonitor + G_AGP_ERROR_CHECKED rpimonitor elif (( $1 == 57 )); then @@ -13955,7 +13955,7 @@ _EOF_ groupdel netdata #1.2.0+ - AGP_ERROR_CHECKED netdata + G_AGP_ERROR_CHECKED netdata #1.0.0 rm /usr/sbin/netdata @@ -13968,14 +13968,14 @@ _EOF_ elif (( $1 == 43 )); then - AGP_ERROR_CHECKED mumble-server + G_AGP_ERROR_CHECKED mumble-server elif (( $1 == 41 )); then - AGP_ERROR_CHECKED emby-server + G_AGP_ERROR_CHECKED emby-server rm /etc/apt/sources.list.d/emby-server.list - AGUP + G_AGUP elif (( $1 == 58 )); then @@ -13984,12 +13984,12 @@ _EOF_ elif (( $1 == 42 )); then - AGP_ERROR_CHECKED plexmediaserver + G_AGP_ERROR_CHECKED plexmediaserver rm -R /var/lib/plexmediaserver rm /etc/apt/sources.list.d/plex.list &> /dev/null - AGUP + G_AGUP elif (( $1 == 52 )); then @@ -14021,7 +14021,7 @@ _EOF_ elif (( $1 == 46 )); then - AGP_ERROR_CHECKED qbittorrent-nox + G_AGP_ERROR_CHECKED qbittorrent-nox rm /etc/systemd/system/qbittorrent.service rm -R "$HOME"/.config/qBittorrent @@ -14031,7 +14031,7 @@ _EOF_ rm -R /etc/syncthing rm /usr/bin/syncthing &> /dev/null # DietPi v158 <= rm /etc/systemd/system/syncthing.service - rm -R "$FP_DIETPI_USERDATA"/syncthing + rm -R "$G_FP_DIETPI_USERDATA"/syncthing elif (( $1 == 116 )); then @@ -14040,7 +14040,7 @@ _EOF_ elif (( $1 == 107 )); then - AGP_ERROR_CHECKED rtorrent + G_AGP_ERROR_CHECKED rtorrent rm -R /var/www/rutorrent rm "$HOME"/.rtorrent.rc rm /etc/systemd/system/rtorrent.service @@ -14069,9 +14069,9 @@ _EOF_ elif (( $1 == 112 )); then - rm "$FP_DIETPI_USERDATA"/dxx-rebirth/* - rm -R "$FP_DIETPI_USERDATA"/dxx-rebirth/descent_1_game - rm -R "$FP_DIETPI_USERDATA"/dxx-rebirth/descent_2_game + rm "$G_FP_DIETPI_USERDATA"/dxx-rebirth/* + rm -R "$G_FP_DIETPI_USERDATA"/dxx-rebirth/descent_1_game + rm -R "$G_FP_DIETPI_USERDATA"/dxx-rebirth/descent_2_game sed -i '/dxx-rebirth/d' /etc/bash.bashrc #Remove symlinks @@ -14087,7 +14087,7 @@ _EOF_ rm /etc/chromium.d/custom_flags rm "$HOME"/.chromium-browser.init - AGP_ERROR_CHECKED chromium + G_AGP_ERROR_CHECKED chromium elif (( $1 == 157)); then @@ -14107,7 +14107,7 @@ _EOF_ rm /etc/systemd/system/gitea.service # Delete data - rm -R "$FP_DIETPI_USERDATA"/gitea + rm -R "$G_FP_DIETPI_USERDATA"/gitea rm -R /var/log/gitea # drop/delete database @@ -14122,9 +14122,9 @@ _EOF_ elif (( $1 == 167 )); then - AGP_ERROR_CHECKED raspotify + G_AGP_ERROR_CHECKED raspotify rm /etc/apt/sources.list.d/raspotify.list - AGUP + G_AGUP elif (( $1 == 168 )); then @@ -14132,7 +14132,7 @@ _EOF_ elif (( $1 == 169 )); then - rm -R "$FP_DIETPI_USERDATA"/voice-recognizer-raspi + rm -R "$G_FP_DIETPI_USERDATA"/voice-recognizer-raspi rm /etc/systemd/system/voice-recognizer.service rm /etc/systemd/system/alsa-init.service rm -R /home/dietpi/assistant.json @@ -14140,7 +14140,7 @@ _EOF_ elif (( $1 == 170 )); then Reset_NTPD - AGP_ERROR_CHECKED ntp + G_AGP_ERROR_CHECKED ntp elif (( $1 == 158 )); then @@ -14172,16 +14172,16 @@ _EOF_ elif (( $1 == 162 )); then - if (( $HW_ARCH == 10 )); then + if (( $G_HW_ARCH == 10 )); then # remove docker and all its unused dependencies - x86_64 package name is different - AGP_ERROR_CHECKED docker-ce + G_AGP_ERROR_CHECKED docker-ce else # remove docker and all its unused dependencies - ARM package name - AGP_ERROR_CHECKED docker-engine + G_AGP_ERROR_CHECKED docker-engine fi # delete data files - dietpi - rm -r "$FP_DIETPI_USERDATA"/docker-data + rm -r "$G_FP_DIETPI_USERDATA"/docker-data # remove default unused folder rm -r /var/lib/docker @@ -14195,7 +14195,7 @@ _EOF_ elif (( $1 == 163 )); then - AGP_ERROR_CHECKED gmrender + G_AGP_ERROR_CHECKED gmrender rm /etc/systemd/system/gmrender.service elif (( $1 == 159 || $1 == 160 )); then @@ -14211,57 +14211,57 @@ _EOF_ elif (( $1 == 15 )); then - AGP_ERROR_CHECKED tcpdump + G_AGP_ERROR_CHECKED tcpdump elif (( $1 == 14 )); then - AGP_ERROR_CHECKED nload + G_AGP_ERROR_CHECKED nload elif (( $1 == 13 )); then - AGP_ERROR_CHECKED mtr-tiny + G_AGP_ERROR_CHECKED mtr-tiny elif (( $1 == 11 )); then - AGP_ERROR_CHECKED iptraf + G_AGP_ERROR_CHECKED iptraf elif (( $1 == 10 )); then - AGP_ERROR_CHECKED iftop + G_AGP_ERROR_CHECKED iftop elif (( $1 == 19 )); then - AGP_ERROR_CHECKED jed + G_AGP_ERROR_CHECKED jed elif (( $1 == 3 )); then - AGP_ERROR_CHECKED mc + G_AGP_ERROR_CHECKED mc elif (( $1 == 18 )); then - AGP_ERROR_CHECKED emacs + G_AGP_ERROR_CHECKED emacs elif (( $1 == 20 || $i == 21 )); then - AGP_ERROR_CHECKED vim vim-tiny + G_AGP_ERROR_CHECKED vim vim-tiny elif (( $1 == 127 )); then - AGP_ERROR_CHECKED neovim + G_AGP_ERROR_CHECKED neovim elif (( $1 == 0 )); then #This also removes OpenSSH server. So lets check OpenSSH server isnt installed before hand. if (( $(dpkg -l | grep -ci -m1 'openssh-server') == 0 )); then - AGP_ERROR_CHECKED openssh-client + G_AGP_ERROR_CHECKED openssh-client fi elif (( $1 == 1 )); then umount -f /mnt/samba - AGP_ERROR_CHECKED smbclient + G_AGP_ERROR_CHECKED smbclient #Disable in fstab sed -i '/\/mnt\/samba/c\#\/mnt\/samba . Please use dietpi-config and the Networking Options: NAS menu to setup this mount' /etc/fstab #Add info file for installation method. @@ -14269,7 +14269,7 @@ _EOF_ elif (( $1 == 111 )); then - AGP_ERROR_CHECKED urbackup-server + G_AGP_ERROR_CHECKED urbackup-server #+sourcebuild rm /etc/systemd/system/urbackupsrv.service @@ -14287,7 +14287,7 @@ _EOF_ #nfs-kernel-server depends on nfs-common if (( ${aSOFTWARE_INSTALL_STATE[109]} == 0 )); then - AGP_ERROR_CHECKED nfs-common + G_AGP_ERROR_CHECKED nfs-common fi @@ -14299,28 +14299,28 @@ _EOF_ elif (( $1 == 16 )); then - AGP_ERROR_CHECKED build-essential + G_AGP_ERROR_CHECKED build-essential elif (( $1 == 17 )); then - AGP_ERROR_CHECKED git + G_AGP_ERROR_CHECKED git elif (( $1 == 5 )); then - AGP_ERROR_CHECKED alsa-utils + G_AGP_ERROR_CHECKED alsa-utils #DietPi-JustBoom, remove bash alias for config panel: sed -i '/dietpi-justboom/d' /etc/bash.bashrc &> /dev/null elif (( $1 == 6 )); then - AGP_ERROR_CHECKED xcompmgr xinit xauth xserver-xorg xfonts-base x11-xserver-utils x11-common x11-utils + G_AGP_ERROR_CHECKED xcompmgr xinit xauth xserver-xorg xfonts-base x11-xserver-utils x11-common x11-utils rm /etc/xdg/autostart/xcompmgr.desktop elif (( $1 == 2 )); then umount -f /mnt/ftp_client - AGP_ERROR_CHECKED curlftpfs + G_AGP_ERROR_CHECKED curlftpfs #Disable in fstab sed -i '/\/mnt\/ftp_client/c\#\/mnt\/ftp_client . Please use dietpi-config and the Networking Options: NAS menu to setup this mount' /etc/fstab @@ -14330,23 +14330,23 @@ _EOF_ elif (( $1 == 7 )); then - AGP_ERROR_CHECKED ffmpeg + G_AGP_ERROR_CHECKED ffmpeg # + RPi - AGP_ERROR_CHECKED libx264 libmp3lame libfdk-aac + G_AGP_ERROR_CHECKED libx264 libmp3lame libfdk-aac elif (( $1 == 8 )); then - AGP_ERROR_CHECKED oracle-java8-* + G_AGP_ERROR_CHECKED oracle-java8-* rm /etc/apt/sources.list.d/webupd8team-java.list - AGUP + G_AGUP elif (( $1 == 104 )); then - AGP_ERROR_CHECKED dropbear* #stretch | dropbear-initramfs dropbear-run + G_AGP_ERROR_CHECKED dropbear* #stretch | dropbear-initramfs dropbear-run elif (( $1 == 105 )); then - AGP_ERROR_CHECKED openssh-* + G_AGP_ERROR_CHECKED openssh-* # This also clears Openssh-client aSOFTWARE_INSTALL_STATE[0]=0 @@ -14357,21 +14357,21 @@ _EOF_ elif (( $1 == 101 )); then - AGP_ERROR_CHECKED logrotate + G_AGP_ERROR_CHECKED logrotate elif (( $1 == 102 )); then - AGP_ERROR_CHECKED rsyslog + G_AGP_ERROR_CHECKED rsyslog elif (( $1 == 9 )); then - AGP_ERROR_CHECKED nodejs + G_AGP_ERROR_CHECKED nodejs # - old install via repo if [ -f /etc/apt/sources.list.d/nodesource_nodejs.list ]; then rm /etc/apt/sources.list.d/nodesource_nodejs.list - AGUP + G_AGUP fi @@ -14379,11 +14379,11 @@ _EOF_ elif (( $1 == 4 )); then - AGP_ERROR_CHECKED vifm + G_AGP_ERROR_CHECKED vifm else - dietpi-notify 2 "Software index $1 is unknown, or, has no removal code." + G_DIETPI-NOTIFY 2 "Software index $1 is unknown, or, has no removal code." valid_input=0 fi @@ -14406,7 +14406,7 @@ _EOF_ Uninstall_Software_Finalize(){ #Purge - dietpi-notify 3 DietPi-Software "Removing packages that are no longer required" + G_DIETPI-NOTIFY 3 DietPi-Software "Removing packages that are no longer required" apt-get autoremove --purge -y @@ -14469,15 +14469,15 @@ _EOF_ #Always clean and update apt, before running installs. apt-get clean - AGUP + G_AGUP #Simluated apt installation to check for failures related to apt-cache. - dietpi-notify 2 "Running apt simulation to check for errors, please wait..." + G_DIETPI-NOTIFY 2 "Running apt simulation to check for errors, please wait..." local package_to_test='bash-doc' - apt-get install $package_to_test -qq -s -y 2>&1 | tee "$FP_LOG_APT" + apt-get install $package_to_test -qq -s -y 2>&1 | tee "$G_FP_LOG_APT" local result=${PIPESTATUS[0]} - dietpi-notify -1 $result "Apt simulation |" + G_DIETPI-NOTIFY -1 $result "Apt simulation |" if (( $result != 0 )); then @@ -14491,7 +14491,7 @@ _EOF_ # - Set noninteractive | Allows automation for some software local force_options='--force-yes' - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then force_options='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' @@ -14560,7 +14560,7 @@ _EOF_ Write_InstallFileList #DietPi-Automation - if (( $DIETPI_INSTALL_STAGE == 0 )); then + if (( $G_DIETPI_INSTALL_STAGE == 0 )); then #Apply Timezone if [ "$AUTOINSTALL_TIMEZONE" != "Europe/London" ]; then @@ -14574,7 +14574,7 @@ _EOF_ #Apply Language (Locale) if [ "$AUTOINSTALL_LANGUAGE" != "en_GB" ]; then - dietpi-notify 2 "Setting Locale $AUTOINSTALL_LANGUAGE. Please wait...\n" + G_DIETPI-NOTIFY 2 "Setting Locale $AUTOINSTALL_LANGUAGE. Please wait...\n" #Enable user setting sed -i "/$AUTOINSTALL_LANGUAGE.UTF-8/c $AUTOINSTALL_LANGUAGE.UTF-8 UTF-8" /etc/locale.gen @@ -14590,7 +14590,7 @@ _EOF_ #Apply Keyboard if [ "$AUTOINSTALL_KEYBOARD" != "gb" ]; then - dietpi-notify 2 "Setting Keyboard $AUTOINSTALL_KEYBOARD. Please wait...\n" + G_DIETPI-NOTIFY 2 "Setting Keyboard $AUTOINSTALL_KEYBOARD. Please wait...\n" sed -i '/XKBLAYOUT=/c XKBLAYOUT="'"$AUTOINSTALL_KEYBOARD"'"' /etc/default/keyboard #systemctl restart keyboard-setup @@ -14627,7 +14627,7 @@ _EOF_ INSTALL_URL_ADDRESS=$AUTOINSTALL_CUSTOMSCRIPTURL - Check_URL "$INSTALL_URL_ADDRESS" + G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install if (( $? == 0 )); then @@ -14714,7 +14714,7 @@ _EOF_ #Automated install if (( $AUTOINSTALL_ENABLED >= 1 )); then - dietpi-notify 3 DietPi-Software "Running automated installation" + G_DIETPI-NOTIFY 3 DietPi-Software "Running automated installation" #Skip dietpi-software menu TARGETMENUID=-1 @@ -14733,7 +14733,7 @@ _EOF_ aSOFTWARE_INSTALL_STATE[$index]=1 - dietpi-notify 2 "Automation: ${aSOFTWARE_WHIP_NAME[$index]}. Flagged for installation." + G_DIETPI-NOTIFY 2 "Automation: ${aSOFTWARE_WHIP_NAME[$index]}. Flagged for installation." fi @@ -14762,7 +14762,7 @@ _EOF_ echo 1 > /DietPi/dietpi/.update_stage #Update APT - AGUP + G_AGUP #Check for updates and apply if needed (1=force apply updates). /DietPi/dietpi/dietpi-update 1 @@ -14807,7 +14807,7 @@ _EOF_ sleep 1 - Check_URL "$INTERNET_URL_TEST" + G_CHECK_URL "$INTERNET_URL_TEST" if (( $? == 0 )); then @@ -14821,13 +14821,13 @@ _EOF_ if (( $current_loop >= $max_loops )); then - dietpi-notify 1 "Connection test failed. $INTERNET_URL_TEST" + G_DIETPI-NOTIFY 1 "Connection test failed. $INTERNET_URL_TEST" Exit_Destroy else - dietpi-notify 2 "Testing connection to $INTERNET_URL_TEST" - dietpi-notify 2 "Attempt ($current_loop / $max_loops), please wait..." + G_DIETPI-NOTIFY 2 "Testing connection to $INTERNET_URL_TEST" + G_DIETPI-NOTIFY 2 "Attempt ($current_loop / $max_loops), please wait..." fi @@ -14859,13 +14859,13 @@ _EOF_ #Install software and exit. if [ "$1" = "install" ] || [ "$1" = "reinstall" ] || [ "$1" = "uninstall" ] ; then - dietpi-notify 3 DietPi-Software "Automated $1" + G_DIETPI-NOTIFY 3 DietPi-Software "Automated $1" sleep 1 # - Make sure we have at least one entry if [ -z "$2" ]; then - dietpi-notify 1 "Please enter a software index ID, or, choice system INDEX_*_TARGET=-?" + G_DIETPI-NOTIFY 1 "Please enter a software index ID, or, choice system INDEX_*_TARGET=-?" else @@ -14912,14 +14912,14 @@ _EOF_ aSOFTWARE_INSTALL_STATE[$i]=1 GOSTARTINSTALL=1 - dietpi-notify 0 "Reinstalling ${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}" + G_DIETPI-NOTIFY 0 "Reinstalling ${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}" sleep 1 else - dietpi-notify 2 "$i: ${aSOFTWARE_WHIP_NAME[$i]} is not currently installed" - dietpi-notify 2 "The program must be installed, before reinstall can be used" - dietpi-notify 0 "No changes applied for: ${aSOFTWARE_WHIP_NAME[$i]}" + G_DIETPI-NOTIFY 2 "$i: ${aSOFTWARE_WHIP_NAME[$i]} is not currently installed" + G_DIETPI-NOTIFY 2 "The program must be installed, before reinstall can be used" + G_DIETPI-NOTIFY 0 "No changes applied for: ${aSOFTWARE_WHIP_NAME[$i]}" fi @@ -14930,13 +14930,13 @@ _EOF_ aSOFTWARE_INSTALL_STATE[$i]=1 GOSTARTINSTALL=1 - dietpi-notify 0 "Installing ${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}" + G_DIETPI-NOTIFY 0 "Installing ${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}" sleep 0.5 else - dietpi-notify 2 "$i: ${aSOFTWARE_WHIP_NAME[$i]} is already installed" - dietpi-notify 0 "No changes applied for: ${aSOFTWARE_WHIP_NAME[$i]}" + G_DIETPI-NOTIFY 2 "$i: ${aSOFTWARE_WHIP_NAME[$i]} is already installed" + G_DIETPI-NOTIFY 0 "No changes applied for: ${aSOFTWARE_WHIP_NAME[$i]}" fi @@ -14952,7 +14952,7 @@ _EOF_ elif [ "$1" = "setpermissions" ]; then Install_Apply_Permissions &> /dev/null - dietpi-notify 0 "Set permissions completed" + G_DIETPI-NOTIFY 0 "Set permissions completed" #List unique software names and ID's elif [ "$1" = "list" ]; then @@ -15045,17 +15045,17 @@ _EOF_ fi - # - Available for HW_ARCH? - if (( ! ${aSOFTWARE_AVAIL_HW_ARCH[$i,$HW_ARCH]} )); then + # - Available for G_HW_ARCH? + if (( ! ${aSOFTWARE_AVAIL_G_HW_ARCH[$i,$G_HW_ARCH]} )); then - string+=" \e[31mDISABLED for HW_ARCH\e[0m" + string+=" \e[31mDISABLED for G_HW_ARCH\e[0m" fi - # - Available for HW_MODEL? - if (( ! ${aSOFTWARE_AVAIL_HW_MODEL[$i,$HW_MODEL]} )); then + # - Available for G_HW_MODEL? + if (( ! ${aSOFTWARE_AVAIL_G_HW_MODEL[$i,$G_HW_MODEL]} )); then - string+=" \e[31mDISABLED for HW_MODEL\e[0m" + string+=" \e[31mDISABLED for G_HW_MODEL\e[0m" fi @@ -15128,14 +15128,14 @@ _EOF_ fp_target="$fp_export_dir/software_available_hw_model" for ((i=0; i<$TOTAL_SOFTWARE_INDEXS; i++)) do - printf "%i\n" "${aSOFTWARE_AVAIL_HW_MODEL[$i,$HW_MODEL]}" >> "$fp_target" + printf "%i\n" "${aSOFTWARE_AVAIL_G_HW_MODEL[$i,$G_HW_MODEL]}" >> "$fp_target" done fp_target="$fp_export_dir/software_available_hw_arch" for ((i=0; i<$TOTAL_SOFTWARE_INDEXS; i++)) do - printf "%i\n" "${aSOFTWARE_AVAIL_HW_ARCH[$i,$HW_ARCH]}" >> "$fp_target" + printf "%i\n" "${aSOFTWARE_AVAIL_G_HW_ARCH[$i,$G_HW_ARCH]}" >> "$fp_target" done @@ -15151,7 +15151,7 @@ _EOF_ else - dietpi-notify 2 "Unknown command $1" + G_DIETPI-NOTIFY 2 "Unknown command $1" fi @@ -15205,25 +15205,25 @@ _EOF_ if [ "$1" = "simulation" ]; then - ERROR_TEXT="Apt-get simulation has failed.\n - Apt log = $(echo -e $FP_LOG_APT)\n\nDietPi-Software will now exit." + ERROR_TEXT="Apt-get simulation has failed.\n - Apt log = $(echo -e $G_FP_LOG_APT)\n\nDietPi-Software will now exit." Error_Display else - ERROR_TEXT="Apt-get has failed:\n - Apt string = $string\n - Error code = $result\n - Software Title = ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}\n - Apt log = $(echo -e $FP_LOG_APT)\n\nPlease report this issue to DietPi (INCLUDING THE APT LOG) so it can be investigated.\n\nDietPi-Software will now exit." + ERROR_TEXT="Apt-get has failed:\n - Apt string = $string\n - Error code = $result\n - Software Title = ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}\n - Apt log = $(echo -e $G_FP_LOG_APT)\n\nPlease report this issue to DietPi (INCLUDING THE APT LOG) so it can be investigated.\n\nDietPi-Software will now exit." Error_Display fi - dietpi-notify 1 "The apt cache may be corrupt, apt mirror offline, or you have held broken packages. DietPi-Software will now exit.\n" + G_DIETPI-NOTIFY 1 "The apt cache may be corrupt, apt mirror offline, or you have held broken packages. DietPi-Software will now exit.\n" - dietpi-notify 2 "Apt Log:\n$(cat $FP_LOG_APT)\n" + G_DIETPI-NOTIFY 2 "Apt Log:\n$(cat $G_FP_LOG_APT)\n" - dietpi-notify 2 "Please try:" - dietpi-notify 2 "- Fixing apt package errors with 'apt-get install -f'" - dietpi-notify 2 "- Change apt mirror: 'dietpi-config' > 'Networking: NAS/MISC' > 'Apt Mirror'" - dietpi-notify 2 "- Clear and refresh apt 'AGUP'" - dietpi-notify 2 "- If problems persist, please create a Git ticket so DietPi can investigate the issue:\n - https://github.com/Fourdee/DietPi/issues\n" + G_DIETPI-NOTIFY 2 "Please try:" + G_DIETPI-NOTIFY 2 "- Fixing apt package errors with 'apt-get install -f'" + G_DIETPI-NOTIFY 2 "- Change apt mirror: 'dietpi-config' > 'Networking: NAS/MISC' > 'Apt Mirror'" + G_DIETPI-NOTIFY 2 "- Clear and refresh apt 'G_AGUP'" + G_DIETPI-NOTIFY 2 "- If problems persist, please create a Git ticket so DietPi can investigate the issue:\n - https://github.com/Fourdee/DietPi/issues\n" Exit_Destroy @@ -15264,13 +15264,13 @@ _EOF_ do #Check if this software matches the current category and sofware type for this menu. - # - I originally had "aSOFTWARE_AVAIL_HW_MODEL" and "aSOFTWARE_AVAIL_HW_ARCH" in one 'if' statement below, however, this seems to takes 4x longer to process in bash. + # - I originally had "aSOFTWARE_AVAIL_G_HW_MODEL" and "aSOFTWARE_AVAIL_G_HW_ARCH" in one 'if' statement below, however, this seems to takes 4x longer to process in bash. if (( ${aSOFTWARE_CATEGORY_INDEX[$j]} == $i && ${aSOFTWARE_TYPE[$j]} == $software_type )); then # + is available for hardware? # + is available for distro? - if (( ${aSOFTWARE_AVAIL_HW_MODEL[$j,$HW_MODEL]} && - ${aSOFTWARE_AVAIL_HW_ARCH[$j,$HW_ARCH]} )); then + if (( ${aSOFTWARE_AVAIL_G_HW_MODEL[$j,$G_HW_MODEL]} && + ${aSOFTWARE_AVAIL_G_HW_ARCH[$j,$G_HW_ARCH]} )); then local selected="off" @@ -15427,14 +15427,14 @@ _EOF_ Check_USB_Drive_Installed #Where is userdata stored? - local user_data_location_current=$(readlink -f $FP_DIETPI_USERDATA) + local user_data_location_current=$(readlink -f $G_FP_DIETPI_USERDATA) local user_data_location_description='' if [ "$user_data_location_current" = "$FP_DIETPI_DEDICATED_USBDRIVE" ]; then user_data_location_description="USB Drive | $user_data_location_current" - elif [ "$user_data_location_current" = "$FP_DIETPI_USERDATA" ]; then + elif [ "$user_data_location_current" = "$G_FP_DIETPI_USERDATA" ]; then user_data_location_description="SD/EMMC | $user_data_location_current" @@ -15457,7 +15457,7 @@ _EOF_ fi WHIP_TITLE='DietPi-Software' - WHIP_BACKTITLE="DietPi-Software | IP: $(sed -n 4p /DietPi/dietpi/.network) | Device: $HW_MODEL_DESCRIPTION" + WHIP_BACKTITLE="DietPi-Software | IP: $(sed -n 4p /DietPi/dietpi/.network) | Device: $G_HW_MODEL_DESCRIPTION" OPTION=$(whiptail --title "$WHIP_TITLE" --backtitle "$WHIP_BACKTITLE" --menu "" --default-item "$MENU_MAIN_LASTITEM" --cancel-button "Exit" 20 100 13 \ "Help!" "Links to online guides, docs and information" \ @@ -15842,7 +15842,7 @@ _EOF_ Menu_Exit(){ #1st run install - if (( $DIETPI_INSTALL_STAGE == 0 )); then + if (( $G_DIETPI_INSTALL_STAGE == 0 )); then WHIP_TITLE='Exit Setup?' WHIP_QUESTION=' DietPi has not fully been installed.\n This must be completed prior to using DietPi by selecting:\n - Go Start Install. \n \n Would you like to exit and abort the installation?' whiptail --title "$WHIP_TITLE" --yesno "$WHIP_QUESTION" --backtitle "$WHIP_BACKTITLE" --yes-button "Ok" --no-button "Back" --defaultno 13 65 @@ -15856,7 +15856,7 @@ _EOF_ TARGETMENUID=0 fi #Standard exit - elif (( $DIETPI_INSTALL_STAGE == 1 )); then + elif (( $G_DIETPI_INSTALL_STAGE == 1 )); then WHIP_TITLE='Exit DietPi-Software?' WHIP_QUESTION='Do you wish to exit DietPi-Software?\n\nAll changes to software selections will be cleared.' whiptail --title "$WHIP_TITLE" --yesno "$WHIP_QUESTION" --backtitle "$WHIP_BACKTITLE" --yes-button "Ok" --no-button "Back" --defaultno 11 65 @@ -15924,7 +15924,7 @@ _EOF_ else #1st run install - if (( $DIETPI_INSTALL_STAGE == 0 )); then + if (( $G_DIETPI_INSTALL_STAGE == 0 )); then WHIP_TITLE='No Software Selected. Continue?' WHIP_QUESTION='DietPi was unable to detect any software selections for install. Do you wish to continue?\n\nBy selecting Ok: \n- DietPi optimized software will NOT be installed.\nYou can use dietpi-software at a later date if you change your mind. \n\n- You want a Minimal Raspbian/Debian Server Install.\nDietPi is a minimal image. A great OS base to use with your projects.' @@ -15946,7 +15946,7 @@ _EOF_ fi #Not 1st run - elif (( $DIETPI_INSTALL_STAGE == 1 )); then + elif (( $G_DIETPI_INSTALL_STAGE == 1 )); then WHIP_TITLE='No Changes to Software Selection' whiptail --title "$WHIP_TITLE" --msgbox "No changes have been detected. Unable to start installation." 8 65 @@ -16451,17 +16451,17 @@ _EOF_ Banner_Installing(){ - dietpi-notify 3 DietPi-Software "Install software" + G_DIETPI-NOTIFY 3 DietPi-Software "Install software" echo -e " ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}" - dietpi-notify 2 "Please wait...\n" + G_DIETPI-NOTIFY 2 "Please wait...\n" /DietPi/dietpi/dietpi-funtime 0 } Banner_Apt_Update(){ - dietpi-notify 3 DietPi-Software "Update & upgrade APT" + G_DIETPI-NOTIFY 3 DietPi-Software "Update & upgrade APT" sleep 1 } @@ -16470,23 +16470,23 @@ _EOF_ if (( ! $DISABLE_REBOOT )); then - dietpi-notify 3 DietPi-Software "Installation completed" + G_DIETPI-NOTIFY 3 DietPi-Software "Installation completed" echo -e "\n The system will now reboot. \n This completes the DietPi-Software installation.\n" /DietPi/dietpi/dietpi-funtime 0 sleep 3 else - dietpi-notify 0 "DietPi-Software installation completed." + G_DIETPI-NOTIFY 0 "DietPi-Software installation completed." fi } Banner_Configs(){ - dietpi-notify 3 DietPi-Software "Optimize and configure software" - dietpi-notify 2 "Applying DietPi optimizations and configurations for $HW_MODEL_DESCRIPTION" - dietpi-notify 2 "Please wait...\n" + G_DIETPI-NOTIFY 3 DietPi-Software "Optimize and configure software" + G_DIETPI-NOTIFY 2 "Applying DietPi optimizations and configurations for $G_HW_MODEL_DESCRIPTION" + G_DIETPI-NOTIFY 2 "Please wait...\n" /DietPi/dietpi/dietpi-funtime 0 #List software due for configuration @@ -16495,7 +16495,7 @@ _EOF_ # if (( ${aSOFTWARE_INSTALL_STATE[$i]} == 1 )); then - # dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}" + # G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}" # fi @@ -16506,7 +16506,7 @@ _EOF_ Banner_Aborted(){ #1st run abort - if (( $DIETPI_INSTALL_STAGE == 0 )); then + if (( $G_DIETPI_INSTALL_STAGE == 0 )); then /DietPi/dietpi/dietpi-banner 0 echo -e "\n Installation Aborted by User \n Installation must be completed prior to using DietPi \n Please run dietpi-software to restart the installation \n" @@ -16524,7 +16524,7 @@ _EOF_ # Main Loop #///////////////////////////////////////////////////////////////////////////////////// #-------------------------------------------------------------------------------------- - dietpi-notify 2 "Initializing database, please wait..." + G_DIETPI-NOTIFY 2 "Initializing database, please wait..." #-------------------------------------------------------------------------------------- #Init software arrays @@ -16550,7 +16550,7 @@ _EOF_ #Check if we are setting no user inputs and prompts # - Load all automation vars - if (( $DIETPI_INSTALL_STAGE == 0 )); then + if (( $G_DIETPI_INSTALL_STAGE == 0 )); then FirstRun_Automation_Init @@ -16564,7 +16564,7 @@ _EOF_ fi #GPL compliance prompt - if (( $DIETPI_INSTALL_STAGE == 0 && $USER_INPUTS )); then + if (( $G_DIETPI_INSTALL_STAGE == 0 && $USER_INPUTS )); then whiptail --title "DietPi - GPLv2 License" --msgbox "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see http://www.gnu.org/licenses/" --backtitle "DietPi - GPLv2 Compliance" 18 70 @@ -16586,7 +16586,7 @@ _EOF_ fi #Apply 1st run automation and ask questions. - if (( $DIETPI_INSTALL_STAGE == 0 )); then + if (( $G_DIETPI_INSTALL_STAGE == 0 )); then #Activate automation settings from dietpi.txt, if set. FirstRun_Automation_Set diff --git a/dietpi/dietpi-survey b/dietpi/dietpi-survey index 7340c37029..f1598b9a44 100644 --- a/dietpi/dietpi-survey +++ b/dietpi/dietpi-survey @@ -24,7 +24,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER + G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- SURVEY_VERSION=3 @@ -33,7 +33,7 @@ OPTED_IN=1 DIETPI_VERSION=$(cat /DietPi/dietpi/.version) - HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) + G_HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) UNIQUE_ID=$(sed -n 5p /DietPi/dietpi/.hw_model) FTP_ADDR="dietpi.com" @@ -41,7 +41,7 @@ FTP_PASS="raspberry13" Update_FileName_Format(){ - FILENAME_FORMAT="$SURVEY_VERSION-$UNIQUE_ID-$DIETPI_VERSION-$HW_MODEL.txt" + FILENAME_FORMAT="$SURVEY_VERSION-$UNIQUE_ID-$DIETPI_VERSION-$G_HW_MODEL.txt" } FP_SETTINGS="/DietPi/dietpi/.dietpi-survey" @@ -77,7 +77,7 @@ _EOF_ if (( $OPTED_IN == 1 )); then #Check if we have a working internet connection beforehand - Check_URL "$FTP_ADDR" + G_CHECK_URL "$FTP_ADDR" if (( $? == 0 )); then #Obtain active network adapter. diff --git a/dietpi/dietpi-sync b/dietpi/dietpi-sync index c66a2f4d31..e1742e16ce 100644 --- a/dietpi/dietpi-sync +++ b/dietpi/dietpi-sync @@ -25,8 +25,8 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER - CHECK_ROOTFS_RW + G_CHECK_ROOT_USER + G_CHECK_ROOTFS_RW #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -470,7 +470,7 @@ mode='Dry Run' fi - dietpi-notify 3 DietPi-Sync "$mode" + G_DIETPI-NOTIFY 3 DietPi-Sync "$mode" } @@ -579,7 +579,7 @@ echo -e "\n\nInstalling Rsync, please wait....\n\n" sleep 1 - AGI rsync + G_AGI rsync fi diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 419386815b..8ee1448e0d 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -28,8 +28,8 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER - CHECK_ROOTFS_RW + G_CHECK_ROOT_USER + G_CHECK_ROOTFS_RW #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -84,7 +84,7 @@ URL_MIRROR_INDEX=$i - dietpi-notify 2 "Checking Mirror : ${URL_MIRROR_SERVERVERSION[$i]}" + G_DIETPI-NOTIFY 2 "Checking Mirror : ${URL_MIRROR_SERVERVERSION[$i]}" curl -k -L ${URL_MIRROR_SERVERVERSION[$i]} > "$FILEPATH_TEMP"/server_version if (( $? == 0 )); then @@ -96,19 +96,19 @@ if [[ $VERSION_SERVER =~ ^-?[0-9]+$ ]]; then SERVER_ONLINE=1 - dietpi-notify 0 "Using update server: ${URL_MIRROR_SERVERVERSION[$i]}" + G_DIETPI-NOTIFY 0 "Using update server: ${URL_MIRROR_SERVERVERSION[$i]}" break else - dietpi-notify 2 "Invalid server version and/or update file unavailable" + G_DIETPI-NOTIFY 2 "Invalid server version and/or update file unavailable" fi else - dietpi-notify 2 "No response from: ${URL_MIRROR_SERVERVERSION[$i]}" + G_DIETPI-NOTIFY 2 "No response from: ${URL_MIRROR_SERVERVERSION[$i]}" fi @@ -134,9 +134,9 @@ UPDATE_AVAILABLE=1 echo -e "" - dietpi-notify 0 "Update available" - dietpi-notify 2 "Current Version : $VERSION_CURRENT" - dietpi-notify 2 "Server Version : $VERSION_SERVER" + G_DIETPI-NOTIFY 0 "Update available" + G_DIETPI-NOTIFY 2 "Current Version : $VERSION_CURRENT" + G_DIETPI-NOTIFY 2 "Server Version : $VERSION_SERVER" #Write update available version to file. echo -e "$VERSION_SERVER" > /DietPi/dietpi/.update_available @@ -145,7 +145,7 @@ else - dietpi-notify 1 "Unable to access update servers. Please check your connection, then run dietpi-update again." + G_DIETPI-NOTIFY 1 "Unable to access update servers. Please check your connection, then run dietpi-update again." exit fi @@ -217,19 +217,19 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok #Run Patch file while (( $VERSION_CURRENT < $VERSION_SERVER )); do - dietpi-notify 3 DietPi-Update "Updating DietPi" - dietpi-notify 2 "Current Version : $VERSION_CURRENT" - dietpi-notify 2 "Server Version : $VERSION_SERVER\n" + G_DIETPI-NOTIFY 3 DietPi-Update "Updating DietPi" + G_DIETPI-NOTIFY 2 "Current Version : $VERSION_CURRENT" + G_DIETPI-NOTIFY 2 "Server Version : $VERSION_SERVER\n" #Run patch file - dietpi-notify 2 "Patching $VERSION_CURRENT to $(( $VERSION_CURRENT + 1 ))" + G_DIETPI-NOTIFY 2 "Patching $VERSION_CURRENT to $(( $VERSION_CURRENT + 1 ))" /DietPi/dietpi/patch_file "$VERSION_CURRENT" "$VERSION_SERVER" #Update Local Version ID ((VERSION_CURRENT++)) echo -e "$VERSION_CURRENT" > /DietPi/dietpi/.version - dietpi-notify 0 "Patch $VERSION_CURRENT completed\n" + G_DIETPI-NOTIFY 0 "Patch $VERSION_CURRENT completed\n" Get_Client_Version @@ -245,7 +245,7 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok #Unable to download file. else - dietpi-notify 1 "Download failed, unable to run update. Please try running dietpi-update again." + G_DIETPI-NOTIFY 1 "Download failed, unable to run update. Please try running dietpi-update again." exit fi @@ -257,7 +257,7 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok #///////////////////////////////////////////////////////////////////////////////////// #---------------------------------------------------------------- #Inform user - dietpi-notify 3 DietPi-Update "Checking for DietPi updates" + G_DIETPI-NOTIFY 3 DietPi-Update "Checking for DietPi updates" #---------------------------------------------------------------- #Create temp directory used in dietpi-update rm -R "$FILEPATH_TEMP" &> /dev/null @@ -291,7 +291,7 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok #Cannot update, Image required whiptail --title "New image required" --msgbox " Your version of DietPi is now obsolete and cannot be updated. \n\n Please download the latest DietPi image:\n - http://dietpi.com/downloads/images \n\n - Current Version : $VERSION_CURRENT \n - Server Version : $VERSION_SERVER \n " 13 70 - dietpi-notify 1 "Your version of DietPi is now obsolete and cannot be updated." + G_DIETPI-NOTIFY 1 "Your version of DietPi is now obsolete and cannot be updated." echo -e "Please download the latest DietPi image:\n - http://dietpi.com/download \n\n - Current Version : $VERSION_CURRENT \n - Server Version : $VERSION_SERVER \n " #Update available @@ -306,9 +306,9 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok #Forced update elif (( $INPUT == 1 )); then - dietpi-notify 0 "Updates have been found and are being applied, please wait..." - dietpi-notify 2 "Current Version : $VERSION_CURRENT" - dietpi-notify 2 "Server Version : $VERSION_SERVER" + G_DIETPI-NOTIFY 0 "Updates have been found and are being applied, please wait..." + G_DIETPI-NOTIFY 2 "Current Version : $VERSION_CURRENT" + G_DIETPI-NOTIFY 2 "Server Version : $VERSION_SERVER" /DietPi/dietpi/dietpi-funtime 0 @@ -325,9 +325,9 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok else echo -e "" - dietpi-notify 0 "No updates required, your DietPi installation is up to date.\n" - dietpi-notify 2 "Current Version : $VERSION_CURRENT" - dietpi-notify 2 "Server Version : $VERSION_SERVER" + G_DIETPI-NOTIFY 0 "No updates required, your DietPi installation is up to date.\n" + G_DIETPI-NOTIFY 2 "Current Version : $VERSION_CURRENT" + G_DIETPI-NOTIFY 2 "Server Version : $VERSION_SERVER" sleep 2 fi @@ -363,10 +363,10 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok sync #Done - dietpi-notify 3 DietPi-Update "Completed" - dietpi-notify 2 "Current Version : $VERSION_CURRENT" - dietpi-notify 2 "Server Version : $VERSION_SERVER" - dietpi-notify 0 "Update completed" + G_DIETPI-NOTIFY 3 DietPi-Update "Completed" + G_DIETPI-NOTIFY 2 "Current Version : $VERSION_CURRENT" + G_DIETPI-NOTIFY 2 "Server Version : $VERSION_SERVER" + G_DIETPI-NOTIFY 0 "Update completed" echo -e "" echo -e "Please reboot your system now, using the command \e[31;49;1mreboot\e[0m" diff --git a/dietpi/func/change_hostname b/dietpi/func/change_hostname index 02d402ba92..ad3a48b0d0 100644 --- a/dietpi/func/change_hostname +++ b/dietpi/func/change_hostname @@ -19,8 +19,8 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER - CHECK_ROOTFS_RW + G_CHECK_ROOT_USER + G_CHECK_ROOTFS_RW #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/func/create_mysql_db b/dietpi/func/create_mysql_db index a95e541843..cbc8770ab0 100644 --- a/dietpi/func/create_mysql_db +++ b/dietpi/func/create_mysql_db @@ -20,7 +20,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER + G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -30,12 +30,12 @@ #Start sql if not running. service mysql start &> /dev/null - dietpi-notify 2 "Creating MySql DB for $DATABASE_NAME\n" + G_DIETPI-NOTIFY 2 "Creating MySql DB for $DATABASE_NAME\n" #Generate DB mysql -u root -p$MYSQL_ROOT_PW -e "create database \`$DATABASE_NAME\`;GRANT ALL PRIVILEGES ON \`$DATABASE_NAME\`.* TO $DATABASE_USER@localhost IDENTIFIED BY '$DATABASE_PW';FLUSH PRIVILEGES;" - dietpi-notify -1 $? "Create database $DATABASE_NAME |" + G_DIETPI-NOTIFY -1 $? "Create database $DATABASE_NAME |" #----------------------------------------------------------------------------------- exit diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 6a25f60f2a..c02f61e49c 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -44,7 +44,7 @@ # 3=DietPi banner style # - $2 = txt program name # - $3 = txt mode - dietpi-notify(){ + G_DIETPI-NOTIFY(){ local ainput_string=("$@") @@ -99,7 +99,7 @@ #-------------------------------------------------------------------------------------- #Exit code, print OK or Failed #$2 = exit code - # - Use this at end of DietPi scripts, EG: dietpi-notify -1 ${EXIT_CODE:=0} + # - Use this at end of DietPi scripts, EG: G_DIETPI-NOTIFY -1 ${EXIT_CODE:=0} if (( $1 == -1 )); then if [ "$2" = "0" ]; then @@ -159,30 +159,30 @@ } - CHECK_ROOT_USER(){ + G_CHECK_ROOT_USER(){ - dietpi-notify 2 'Checking for (elevated) root access, please wait..' + G_DIETPI-NOTIFY 2 'Checking for (elevated) root access, please wait..' if (( $UID != 0 )); then - dietpi-notify 1 'Error: Root privileges required. Please run the command with "sudo"\n' + G_DIETPI-NOTIFY 1 'Error: Root privileges required. Please run the command with "sudo"\n' exit 1 else - dietpi-notify 0 'Root access verified.' + G_DIETPI-NOTIFY 0 'Root access verified.' fi } - CHECK_ROOTFS_RW(){ + G_CHECK_ROOTFS_RW(){ #RootFS RW check /DietPi/dietpi/dietpi-drive_manager 3 if (( $? != 0 )); then - dietpi-notify 1 'Error: RootFS is currently Read Only, unable to continue.\n' + G_DIETPI-NOTIFY 1 'Error: RootFS is currently Read Only, unable to continue.\n' exit 1 fi @@ -193,39 +193,39 @@ # DietPi First-Run Stage #----------------------------------------------------------------------------------- # -1 = first boot / 0 = run dietpi-software at login / 1 = completed - DIETPI_INSTALL_STAGE=$(cat /DietPi/dietpi/.install_stage) + G_DIETPI_INSTALL_STAGE=$(cat /DietPi/dietpi/.install_stage) #----------------------------------------------------------------------------------- # Hardware Details #----------------------------------------------------------------------------------- - HW_MODEL=0 - HW_MODEL_DESCRIPTION='NULL' - HW_ARCH=0 - HW_CPU_CORES=1 - HW_CPUID=0 + G_HW_MODEL=0 + G_HW_MODEL_DESCRIPTION='NULL' + G_HW_ARCH=0 + G_HW_CPU_CORES=1 + G_HW_CPUID=0 - DISTRO=0 - DISTRO_NAME='NULL' + G_DISTRO=0 + G_DISTRO_NAME='NULL' # - Update # NB: dietpi-boot service launches dietpi-obtain_hw_model to create the following file if [ -f /DietPi/dietpi/.hw_model ]; then - HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) - HW_MODEL_DESCRIPTION=$(sed -n 2p /DietPi/dietpi/.hw_model) - HW_ARCH=$(sed -n 6p /DietPi/dietpi/.hw_model) - HW_CPU_CORES=$(nproc --all) - HW_CPUID=$(sed -n 9p /DietPi/dietpi/.hw_model) + G_HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) + G_HW_MODEL_DESCRIPTION=$(sed -n 2p /DietPi/dietpi/.hw_model) + G_HW_ARCH=$(sed -n 6p /DietPi/dietpi/.hw_model) + G_HW_CPU_CORES=$(nproc --all) + G_HW_CPUID=$(sed -n 9p /DietPi/dietpi/.hw_model) - DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) - DISTRO_NAME='jessie' - if (( $DISTRO == 4 )); then + G_DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) + G_DISTRO_NAME='jessie' + if (( $G_DISTRO == 4 )); then - DISTRO_NAME='stretch' + G_DISTRO_NAME='stretch' - elif (( $DISTRO == 5 )); then + elif (( $G_DISTRO == 5 )); then - DISTRO_NAME='buster' + G_DISTRO_NAME='buster' fi @@ -235,9 +235,9 @@ # DietPi specific directories #----------------------------------------------------------------------------------- # - Default DietPi userdata location. This must NEVER change. - FP_DIETPI_USERDATA='/mnt/dietpi_userdata' - # - Current DietPi userdata location (actual, follows symlink of FP_DIETPI_USERDATA, if not on rootFS) - #FP_DIETPI_USERDATA_CURRENT=$(readlink -f $FP_DIETPI_USERDATA) + G_FP_DIETPI_USERDATA='/mnt/dietpi_userdata' + # - Current DietPi userdata location (actual, follows symlink of G_FP_DIETPI_USERDATA, if not on rootFS) + #G_FP_DIETPI_USERDATA_CURRENT=$(readlink -f $G_FP_DIETPI_USERDATA) #FP_DIETPI_VAR_LIB='/var/lib/dietpi' #FP_DIETPI_VAR_TMP='/var/tmp/dietpi' @@ -245,14 +245,14 @@ # URL Connection test #----------------------------------------------------------------------------------- # $1 = URL - Check_URL(){ + G_CHECK_URL(){ local exit_code=0 local timeout=10 local retry=2 - dietpi-notify 2 "Testing connection to $1" - dietpi-notify 2 "Max duration of $(($timeout * $retry)) seconds, please wait..." + G_DIETPI-NOTIFY 2 "Testing connection to $1" + G_DIETPI-NOTIFY 2 "Max duration of $(($timeout * $retry)) seconds, please wait..." wget -q --spider --timeout=$timeout --tries=$retry "$1" exit_code=$? @@ -260,7 +260,7 @@ #--no-check-certificate #https://github.com/Fourdee/DietPi/issues/352#issuecomment-221013166 - dietpi-notify -1 $exit_code "Connection test |" + G_DIETPI-NOTIFY -1 $exit_code "Connection test |" return $exit_code @@ -269,7 +269,7 @@ #----------------------------------------------------------------------------------- # APT #----------------------------------------------------------------------------------- - FP_LOG_APT='/var/tmp/dietpi/logs/dietpi-software_apt.log' + G_FP_LOG_APT='/var/tmp/dietpi/logs/dietpi-software_apt.log' #Support for apt-fast: https://github.com/Fourdee/DietPi/issues/698 # APT_BINARY='apt-get' @@ -279,13 +279,13 @@ # fi - AGI(){ + G_AGI(){ local string="$@" local force_options='' local exit_code=0 - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then force_options='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' @@ -296,112 +296,112 @@ fi #-qq can add a slight period of appearing nothing is happening, lets inform user - dietpi-notify 2 "APT installation for: $string" - dietpi-notify 2 "APT is processing, please wait...\n" + G_DIETPI-NOTIFY 2 "APT installation for: $string" + G_DIETPI-NOTIFY 2 "APT is processing, please wait...\n" - DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $force_options $string 2>&1 | tee "$FP_LOG_APT" + DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $force_options $string 2>&1 | tee "$G_FP_LOG_APT" exit_code=${PIPESTATUS[0]} - dietpi-notify -1 $exit_code 'AGI:' + G_DIETPI-NOTIFY -1 $exit_code 'G_AGI:' return $exit_code } #apt-get purge - AGP(){ + G_AGP(){ local exit_code=0 local string="$@" local options='' - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then options+=' --allow-change-held-packages' fi - dietpi-notify 2 "APT removal for: $string" + G_DIETPI-NOTIFY 2 "APT removal for: $string" DEBIAN_FRONTEND=noninteractive apt-get purge -y $string $options exit_code=${PIPESTATUS[0]} - dietpi-notify -1 $exit_code 'AGP:' + G_DIETPI-NOTIFY -1 $exit_code 'G_AGP:' return $exit_code } #apt-get autoremove - AGA(){ + G_AGA(){ local exit_code=0 - dietpi-notify 2 "APT autoremove + purge" + G_DIETPI-NOTIFY 2 "APT autoremove + purge" DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y exit_code=${PIPESTATUS[0]} - dietpi-notify -1 $exit_code 'AGA:' + G_DIETPI-NOTIFY -1 $exit_code 'G_AGA:' return $exit_code } #apt-get install -f - AGF(){ + G_AGF(){ local exit_code=0 - dietpi-notify 2 "APT fix" + G_DIETPI-NOTIFY 2 "APT fix" - DEBIAN_FRONTEND=noninteractive apt-get install -f -y 2>&1 | tee "$FP_LOG_APT" + DEBIAN_FRONTEND=noninteractive apt-get install -f -y 2>&1 | tee "$G_FP_LOG_APT" exit_code=${PIPESTATUS[0]} - dietpi-notify -1 $exit_code 'AGF:' + G_DIETPI-NOTIFY -1 $exit_code 'G_AGF:' return $exit_code } #apt-get update - AGUP(){ + G_AGUP(){ local exit_code=0 - dietpi-notify 2 "APT update" + G_DIETPI-NOTIFY 2 "APT update" - DEBIAN_FRONTEND=noninteractive apt-get update 2>&1 | tee "$FP_LOG_APT" + DEBIAN_FRONTEND=noninteractive apt-get update 2>&1 | tee "$G_FP_LOG_APT" exit_code=${PIPESTATUS[0]} - dietpi-notify -1 $exit_code 'AGUP:' + G_DIETPI-NOTIFY -1 $exit_code 'G_AGUP:' return $exit_code } #apt-get upgrade - AGUG(){ + G_AGUG(){ local exit_code=0 - dietpi-notify 2 "APT upgrade" + G_DIETPI-NOTIFY 2 "APT upgrade" - DEBIAN_FRONTEND=noninteractive apt-get upgrade -y 2>&1 | tee "$FP_LOG_APT" + DEBIAN_FRONTEND=noninteractive apt-get upgrade -y 2>&1 | tee "$G_FP_LOG_APT" exit_code=${PIPESTATUS[0]} - dietpi-notify -1 $exit_code 'AGUG:' + G_DIETPI-NOTIFY -1 $exit_code 'G_AGUG:' return $exit_code } #apt-get dist-upgrade - AGDUG(){ + G_AGDUG(){ local exit_code=0 local string="$@" local force_options='' - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then force_options='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' @@ -411,18 +411,18 @@ fi - dietpi-notify 2 "APT dist-upgrade" + G_DIETPI-NOTIFY 2 "APT dist-upgrade" - DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y 2>&1 | tee "$FP_LOG_APT" + DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y 2>&1 | tee "$G_FP_LOG_APT" exit_code=${PIPESTATUS[0]} - dietpi-notify -1 $exit_code 'AGDUG:' + G_DIETPI-NOTIFY -1 $exit_code 'G_AGDUG:' return $exit_code } #----------------------------------------------------------------------------------- - dietpi-notify 2 'DietPi-Globals loaded\n' + G_DIETPI-NOTIFY 2 'DietPi-Globals loaded\n' #----------------------------------------------------------------------------------- } diff --git a/dietpi/func/dietpi-led_control b/dietpi/func/dietpi-led_control index 32e2e8d105..1d500eeb2f 100644 --- a/dietpi/func/dietpi-led_control +++ b/dietpi/func/dietpi-led_control @@ -26,7 +26,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER + G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- FP_SETTINGS='/DietPi/dietpi/.dietpi-led_control' @@ -50,7 +50,7 @@ if (( ${#aLED_NAME[@]} == 0 )); then - dietpi-notify 1 'Unable to find any supported LEDS on this device.' + G_DIETPI-NOTIFY 1 'Unable to find any supported LEDS on this device.' exit fi @@ -61,7 +61,7 @@ rm "$FP_SETTINGS" &> /dev/null - dietpi-notify 3 DietPi-LED_Control "Applying LED triggers" + G_DIETPI-NOTIFY 3 DietPi-LED_Control "Applying LED triggers" for ((i=0; i<${#aLED_NAME[@]}; i++)) do @@ -70,11 +70,11 @@ echo -e "${aLED_SETTING_CURRENT[$i]}" > "/sys/class/leds/${aLED_NAME[$i]}/trigger" if (( $? == 0 )); then - dietpi-notify 0 "${aLED_NAME[$i]}: ${aLED_SETTING_CURRENT[$i]}" + G_DIETPI-NOTIFY 0 "${aLED_NAME[$i]}: ${aLED_SETTING_CURRENT[$i]}" else - dietpi-notify 1 "${aLED_NAME[$i]}: ${aLED_SETTING_CURRENT[$i]}" + G_DIETPI-NOTIFY 1 "${aLED_NAME[$i]}: ${aLED_SETTING_CURRENT[$i]}" fi diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index 7e6a2a5bdb..135302a10f 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -29,7 +29,7 @@ #Import DietPi-Globals ------------------------------------------------------------- . $FP_SCRIPTS/dietpi/func/dietpi-globals # NB: HW_* info are init only, not detected. - CHECK_ROOT_USER + G_CHECK_ROOT_USER #Import DietPi-Globals ------------------------------------------------------------- @@ -96,12 +96,12 @@ _EOF_ #/////////////////////////////////////////////////////////////////////////////////// # Main Loop #/////////////////////////////////////////////////////////////////////////////////// - dietpi-notify 2 "Creating core DietPi environment, please wait..." + G_DIETPI-NOTIFY 2 "Creating core DietPi environment, please wait..." #----------------------------------------------------------------------------------- #Bash - dietpi-notify 2 "Configuring .bashrc:" + G_DIETPI-NOTIFY 2 "Configuring .bashrc:" sed -i '/DietPi/d' /root/.bashrc cat << _EOF_ >> /root/.bashrc @@ -109,7 +109,7 @@ _EOF_ . /DietPi/dietpi/func/dietpi-globals _EOF_ - dietpi-notify 2 "Configuring /etc/bash.bashrc:" + G_DIETPI-NOTIFY 2 "Configuring /etc/bash.bashrc:" sed -i '/#DietPi_Entries/,$d' /etc/bash.bashrc sed -i '/LANG=/,$d' /etc/bash.bashrc # pre v160 images @@ -168,7 +168,7 @@ _EOF_ #----------------------------------------------------------------------------------- #Create_DietPi_User - dietpi-notify 2 'Creating DietPi User Account:' + G_DIETPI-NOTIFY 2 'Creating DietPi User Account:' Create_DietPi_User @@ -176,14 +176,14 @@ _EOF_ #UID bit for sudo # - https://github.com/Fourdee/DietPi/issues/794 - dietpi-notify 2 'Configuring Sudo UID bit:' + G_DIETPI-NOTIFY 2 'Configuring Sudo UID bit:' chmod 4755 $(which sudo) #----------------------------------------------------------------------------------- #Dir's - dietpi-notify 2 'Configuring DietPi Directories:' + G_DIETPI-NOTIFY 2 'Configuring DietPi Directories:' # - /etc/dietpi , in process of moving this over to /var/lib/dietpi and /var/tmp/dietpi mkdir -p /etc/dietpi @@ -209,9 +209,9 @@ _EOF_ chmod 660 /DietPi # - /mnt/dietpi_userdata : DietPi userdata - mkdir -p "$FP_DIETPI_USERDATA" - chown dietpi:dietpi "$FP_DIETPI_USERDATA" - chmod -R 775 "$FP_DIETPI_USERDATA" + mkdir -p "$G_FP_DIETPI_USERDATA" + chown dietpi:dietpi "$G_FP_DIETPI_USERDATA" + chmod -R 775 "$G_FP_DIETPI_USERDATA" # - Networked drives mkdir -p /mnt/samba @@ -221,7 +221,7 @@ _EOF_ #----------------------------------------------------------------------------------- #Services - dietpi-notify 2 'Configuring DietPi Services:' + G_DIETPI-NOTIFY 2 'Configuring DietPi Services:' cat << _EOF_ > /etc/systemd/system/dietpi-ramdisk.service [Unit] @@ -304,7 +304,7 @@ _EOF_ while [ ! -f /DietPi/.ramdisk ] do - dietpi-notify 2 "Waiting for DietPi-RAMDISK to finish mounting DietPi to RAM..." + G_DIETPI-NOTIFY 2 "Waiting for DietPi-RAMDISK to finish mounting DietPi to RAM..." sleep 1 done @@ -341,7 +341,7 @@ _EOF_ #----------------------------------------------------------------------------------- #Cron Jobs - dietpi-notify 2 "Configuring Cron:" + G_DIETPI-NOTIFY 2 "Configuring Cron:" cp $FP_SCRIPTS/dietpi/conf/cron.daily_dietpi /etc/cron.daily/dietpi chmod +x /etc/cron.daily/dietpi @@ -366,7 +366,7 @@ _EOF_ #----------------------------------------------------------------------------------- #Network - dietpi-notify 2 "Configuring: Prefer wlan/eth naming for networked devices:" + G_DIETPI-NOTIFY 2 "Configuring: Prefer wlan/eth naming for networked devices:" # - Prefer to use wlan/eth naming for networked devices (eg: stretch) ln -sf /dev/null /etc/systemd/network/99-default.link @@ -379,18 +379,18 @@ _EOF_ #----------------------------------------------------------------------------------- #MISC - dietpi-notify 2 "Disabling apt-daily services (prevents random APT cache lock):" + G_DIETPI-NOTIFY 2 "Disabling apt-daily services (prevents random APT cache lock):" systemctl mask apt-daily.service &> /dev/null systemctl mask apt-daily-upgrade.timer &> /dev/null - dietpi-notify 2 "Setting vm.swappiness=1:" + G_DIETPI-NOTIFY 2 "Setting vm.swappiness=1:" sed -i '/vm.swappiness=/d' /etc/sysctl.conf echo -e "vm.swappiness=1" > /etc/sysctl.d/97-dietpi.conf #----------------------------------------------------------------------------------- - dietpi-notify 0 "Completed DietPi core environment" + G_DIETPI-NOTIFY 0 "Completed DietPi core environment" exit #----------------------------------------------------------------------------------- } diff --git a/dietpi/func/dietpi-set_dphys-swapfile b/dietpi/func/dietpi-set_dphys-swapfile index 9c90174bf4..fc564e5874 100644 --- a/dietpi/func/dietpi-set_dphys-swapfile +++ b/dietpi/func/dietpi-set_dphys-swapfile @@ -23,7 +23,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER + G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- SWAP_SIZE_CURRENT=$(cat /etc/dphys-swapfile | grep -m1 '^CONF_SWAPSIZE=' | sed 's/.*=//') @@ -42,7 +42,7 @@ SERVICE_MODE="" Delete_Swapfile(){ - dietpi-notify 2 "Deleting existing swapfile ($SWAP_LOCATION_CURRENT)\n" + G_DIETPI-NOTIFY 2 "Deleting existing swapfile ($SWAP_LOCATION_CURRENT)\n" rm "$SWAP_LOCATION_CURRENT" &> /dev/null } @@ -57,7 +57,7 @@ Swap_Disable(){ - dietpi-notify 3 DietPi Disable swapfile + G_DIETPI-NOTIFY 3 DietPi Disable swapfile SWAP_SIZE_TARGET=0 SERVICE_MODE="disable" @@ -70,9 +70,9 @@ Swap_Enable(){ - dietpi-notify 3 DietPi Generating new swapfile - dietpi-notify 2 "Size = $SWAP_SIZE_TARGET MB" - dietpi-notify 2 "Location = $SWAP_LOCATION_TARGET" + G_DIETPI-NOTIFY 3 DietPi Generating new swapfile + G_DIETPI-NOTIFY 2 "Size = $SWAP_SIZE_TARGET MB" + G_DIETPI-NOTIFY 2 "Location = $SWAP_LOCATION_TARGET" SERVICE_MODE="enable" dphys-swapfile swapoff @@ -125,7 +125,7 @@ systemctl "$SERVICE_MODE" dphys-swapfile - dietpi-notify 2 "Completed\n" + G_DIETPI-NOTIFY 2 "Completed\n" fi #----------------------------------------------------------------------------------- diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 4c5364baf8..698deca5a6 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -48,8 +48,8 @@ $FP_SCRIPT lcdpanel target_panel (none to remove all) #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER - CHECK_ROOTFS_RW + G_CHECK_ROOT_USER + G_CHECK_ROOTFS_RW #Import DietPi-Globals --------------------------------------------------------------- #Semi support non-dietpi Raspbian @@ -67,7 +67,7 @@ $FP_SCRIPT lcdpanel target_panel (none to remove all) Unknown_Input_Name(){ EXIT_CODE=1 - dietpi-notify 2 "Unknown input name ($INPUT_DEVICE_NAME). Nothing has been applied." + G_DIETPI-NOTIFY 2 "Unknown input name ($INPUT_DEVICE_NAME). Nothing has been applied." echo -e "$AVAIABLE_COMMANDS" @@ -76,7 +76,7 @@ $FP_SCRIPT lcdpanel target_panel (none to remove all) Unknown_Input_Mode(){ EXIT_CODE=1 - dietpi-notify 2 "Unknown input value ($INPUT_DEVICE_VALUE). Nothing has been applied." + G_DIETPI-NOTIFY 2 "Unknown input value ($INPUT_DEVICE_VALUE). Nothing has been applied." } @@ -188,10 +188,10 @@ systemctl enable dietpi-rm_program_usb_boot_mode.service # - LIRC if (( ! $(dpkg --get-selections | grep -ci -m1 '^lirc') )); then - AGI lirc + G_AGI lirc if (( $? != 0 )); then - dietpi-notify 1 "apt-get install lirc" + G_DIETPI-NOTIFY 1 "apt-get install lirc" EXIT_CODE=1 fi @@ -225,7 +225,7 @@ systemctl enable dietpi-rm_program_usb_boot_mode.service RemoteIR_Reset_All &> /dev/null # - xu4 Cloudshell - if (( $HW_MODEL == 11 )); then + if (( $G_HW_MODEL == 11 )); then # - modules local string="options gpioplug_ir_recv gpio_nr=24 active_low=1" @@ -250,7 +250,7 @@ systemctl enable dietpi-rm_program_usb_boot_mode.service fi # - c1/c2 - elif (( $HW_MODEL == 10 || $HW_MODEL == 12 )); then + elif (( $G_HW_MODEL == 10 || $G_HW_MODEL == 12 )); then # - Module if (( ! $(cat /etc/modules | grep -ci -m1 '^meson_ir') )); then @@ -381,7 +381,7 @@ _EOF_ # + MPD control if (( ! $(dpkg --get-selections | grep -ci -m1 '^mpc[[:space:]]') )); then - AGI mpc + G_AGI mpc fi @@ -498,7 +498,7 @@ _EOF_ if (( $update_required )); then - Check_URL "$install_url_address" + G_CHECK_URL "$install_url_address" # Install if (( $? == 0 )); then @@ -516,7 +516,7 @@ _EOF_ unzip -o package.zip -d / if (( $? != 0 )); then - dietpi-notify 1 "Failed to extract $INPUT_DEVICE_NAME." + G_DIETPI-NOTIFY 1 "Failed to extract $INPUT_DEVICE_NAME." fi @@ -527,13 +527,13 @@ _EOF_ else - dietpi-notify 1 "Failed to install $INPUT_DEVICE_NAME. $install_url_address may be offline or unreachable." + G_DIETPI-NOTIFY 1 "Failed to install $INPUT_DEVICE_NAME. $install_url_address may be offline or unreachable." fi else - dietpi-notify 2 "$INPUT_DEVICE_NAME: Currently running latest kernel, no updates required." + G_DIETPI-NOTIFY 2 "$INPUT_DEVICE_NAME: Currently running latest kernel, no updates required." fi @@ -547,7 +547,7 @@ _EOF_ # fi - Check_URL "$install_url_address" + G_CHECK_URL "$install_url_address" if (( $? == 0 )); then wget "$install_url_address" -O package.zip @@ -555,7 +555,7 @@ _EOF_ unzip -o package.zip -d / if (( $? != 0 )); then - dietpi-notify 1 "Failed to extract kernel $INPUT_DEVICE_NAME." + G_DIETPI-NOTIFY 1 "Failed to extract kernel $INPUT_DEVICE_NAME." fi @@ -567,7 +567,7 @@ _EOF_ local install_url_address='http://dietpi.com/downloads/binaries/nanopi/dietpi_m3_kernel.7z' - Check_URL "$install_url_address" + G_CHECK_URL "$install_url_address" # Install if (( $? == 0 )); then @@ -578,7 +578,7 @@ _EOF_ else - dietpi-notify 1 "Failed to install $INPUT_DEVICE_NAME. $install_url_address may be offline or unreachable." + G_DIETPI-NOTIFY 1 "Failed to install $INPUT_DEVICE_NAME. $install_url_address may be offline or unreachable." fi @@ -636,7 +636,7 @@ _EOF_ if [ "$INPUT_DEVICE_VALUE" = "enable" ]; then #RPi 2/3+ only - if (( $HW_MODEL >= 2 && $HW_MODEL < 10 )); then + if (( $G_HW_MODEL >= 2 && $G_HW_MODEL < 10 )); then #install pre-reqs @@ -644,16 +644,16 @@ _EOF_ /DietPi/dietpi/dietpi-software install 6 # - GL packages - dietpi-notify 2 "Installing additional OpenGL packages, please wait...\n" + G_DIETPI-NOTIFY 2 "Installing additional OpenGL packages, please wait...\n" sleep 1 - AGI libgl1-mesa-dri mesa-utils + G_AGI libgl1-mesa-dri mesa-utils sed -i '/dtoverlay=vc4-kms-v3d/d' "$FP_RPI_CONFIG" echo -e "\ndtoverlay=vc4-kms-v3d" >> "$FP_RPI_CONFIG" else - dietpi-notify 1 "OpenGL requires a RPi 2 or higher" + G_DIETPI-NOTIFY 1 "OpenGL requires a RPi 2 or higher" sleep 2 fi @@ -676,7 +676,7 @@ _EOF_ Lcd_Panel_Not_Available_For_Device(){ EXIT_CODE=1 - dietpi-notify 2 "$INPUT_DEVICE_VALUE is not available for this device. Nothing has been applied." + G_DIETPI-NOTIFY 2 "$INPUT_DEVICE_VALUE is not available for this device. Nothing has been applied." } @@ -722,7 +722,7 @@ _EOF_ Lcd_Panel_Xorg_All_Enable(){ #Xinput calibrator - AGI xinput-calibrator + G_AGI xinput-calibrator mkdir -p /etc/X11/xorg.conf.d @@ -773,7 +773,7 @@ _EOF_ Lcd_Panel_Waveshare32_Disable #RPi - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then # + X11 Lcd_Panel_Xorg_All_Enable @@ -803,7 +803,7 @@ _EOF_ mv /usr/share/X11/xorg.conf.d/99-fbturbo.conf /usr/share/X11/99-fbturbo.conf #Odroids - elif (( $HW_MODEL >= 10 && $HW_MODEL < 20 )); then + elif (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )); then # + X11 Lcd_Panel_Xorg_All_Enable @@ -863,7 +863,7 @@ _EOF_ rm /usr/share/applications/xinput_calibrator.desktop #RPi - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then rm /boot/overlays/waveshare32b.dtbo sed -i 's/ fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo//' /boot/cmdline.txt @@ -881,7 +881,7 @@ _EOF_ mv /usr/share/X11/99-fbturbo.conf /usr/share/X11/xorg.conf.d/99-fbturbo.conf #Odroids - elif (( $HW_MODEL >= 10 && $HW_MODEL < 20 )); then + elif (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )); then rm /etc/systemd/system/con2fbmap.service systemctl daemon-reload @@ -923,7 +923,7 @@ _EOF_ # - Odroid LCD 3.5 Lcd_Panel_OdroidLCD35_Enable(){ - if (( $HW_MODEL >= 10 && $HW_MODEL < 20 )); then + if (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )); then #Reset to disabled: Lcd_Panel_OdroidLCD35_Disable @@ -938,7 +938,7 @@ _EOF_ if (( ! $(cat /etc/modules | grep -ci -m1 'flexfb') )); then # - XU4 - if (( $HW_MODEL == 11 )); then + if (( $G_HW_MODEL == 11 )); then cat << _EOF_ >> /etc/modules fbtft_device @@ -967,7 +967,7 @@ _EOF_ #Service # - XU4 - if (( $HW_MODEL == 11 )); then + if (( $G_HW_MODEL == 11 )); then cat << _EOF_ > /etc/systemd/system/odroid-lcd35.service [Unit] @@ -1068,9 +1068,9 @@ _EOF_ #Check/install pre-reqs if (( $(dpkg -l | grep -ci -m1 'i2c-tools') == 0 )); then - dietpi-notify 2 "Installing Python-smbus, i2c-tools, pre-reqs.\nPlease wait...\n" + G_DIETPI-NOTIFY 2 "Installing Python-smbus, i2c-tools, pre-reqs.\nPlease wait...\n" sleep 1 - AGI python-smbus i2c-tools + G_AGI python-smbus i2c-tools fi @@ -1141,7 +1141,7 @@ _EOF_ if [ "$INPUT_DEVICE_VALUE" = "disable" ]; then # + all Broadcom-based models that need brcm_patchram_plus - if (( $HW_MODEL == 61 || $HW_MODEL == 62 )); then + if (( $G_HW_MODEL == 61 || $G_HW_MODEL == 62 )); then systemctl stop brcm_patchram_plus 2> /dev/null systemctl disable brcm_patchram_plus 2> /dev/null @@ -1150,7 +1150,7 @@ _EOF_ # + RPi 3 (apply to all, as pi-bluetooth package is default installed on all RPi's now) # + Asus TB - if (( $HW_MODEL < 10 || $HW_MODEL == 100 )); then + if (( $G_HW_MODEL < 10 || $G_HW_MODEL == 100 )); then systemctl stop hciuart systemctl disable hciuart @@ -1161,7 +1161,7 @@ _EOF_ systemctl stop bluetooth 2> /dev/null if (( $? != 0 )); then - dietpi-notify 2 "Bluetooth service failed to stop. Is it installed?" + G_DIETPI-NOTIFY 2 "Bluetooth service failed to stop. Is it installed?" EXIT_CODE=1 fi @@ -1187,13 +1187,13 @@ _EOF_ done # + all Broadcom-based models that need brcm_patchram_plus - if (( $HW_MODEL == 61 || $HW_MODEL == 62 )); then + if (( $G_HW_MODEL == 61 || $G_HW_MODEL == 62 )); then systemctl enable brcm_patchram_plus 2> /dev/null systemctl start brcm_patchram_plus 2> /dev/null if (( $? != 0 )); then - dietpi-notify 2 "brcm_patchram_plus service failed to start. Is it installed?" + G_DIETPI-NOTIFY 2 "brcm_patchram_plus service failed to start. Is it installed?" EXIT_CODE=1 fi @@ -1204,7 +1204,7 @@ _EOF_ systemctl start bluetooth 2> /dev/null if (( $? != 0 )); then - dietpi-notify 2 "Bluetooth service failed to start. Is it installed?" + G_DIETPI-NOTIFY 2 "Bluetooth service failed to start. Is it installed?" EXIT_CODE=1 fi @@ -1216,7 +1216,7 @@ _EOF_ # Installed by default as of v142 if (( ! $(dpkg --get-selections | grep -ci -m1 '^pi-bluetooth') )); then - AGI pi-bluetooth + G_AGI pi-bluetooth fi @@ -1230,13 +1230,13 @@ _EOF_ if (( $loop_count >= $max_count )); then - dietpi-notify 1 "hciuart failed to start after $loop_count attempts." + G_DIETPI-NOTIFY 1 "hciuart failed to start after $loop_count attempts." EXIT_CODE=1 break else - dietpi-notify 2 "hciuart failed to start. Attempting to restart it, please wait..." + G_DIETPI-NOTIFY 2 "hciuart failed to start. Attempting to restart it, please wait..." ((loop_count++)) sleep 1 @@ -1247,7 +1247,7 @@ _EOF_ fi # + Asus TB - if (( $HW_MODEL == 100 )); then + if (( $G_HW_MODEL == 100 )); then systemctl enable hciuart systemctl start hciuart @@ -1300,7 +1300,7 @@ _EOF_ # - All aWIFI_MODULES=("cfg80211") - #NB: we need to start doing these device specific via $HW_MODEL index. This prevents unnecessary modules getting loaded. + #NB: we need to start doing these device specific via $G_HW_MODEL index. This prevents unnecessary modules getting loaded. # + RPi 3 aWIFI_MODULES+=("brcmfmac") #onboard WiFi aWIFI_MODULES+=("brcmutil") #onboard WiFi @@ -1309,22 +1309,22 @@ _EOF_ aWIFI_MODULES+=("ap6211") #onboard # + OrangePi Zero - if (( $HW_MODEL == 32 )); then + if (( $G_HW_MODEL == 32 )); then aWIFI_MODULES+=("xradio_wlan") # + OrangePi Plus - elif (( $HW_MODEL == 34 )); then + elif (( $G_HW_MODEL == 34 )); then aWIFI_MODULES+=("8189es") # + Pine A64 / Asus tinker board (onboard) - elif (( ( $HW_MODEL >= 40 && $HW_MODEL <= 42 ) || $HW_MODEL == 100 )); then + elif (( ( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 ) || $G_HW_MODEL == 100 )); then aWIFI_MODULES+=("8723bs") # + NanoPi NEO Air / Zero 2+ - elif (( $HW_MODEL == 35 || $HW_MODEL == 64 )); then + elif (( $G_HW_MODEL == 35 || $G_HW_MODEL == 64 )); then #4.9 uses brcm, only enable dhd for 3.x if [ ! -d /boot/dtb ]; then @@ -1377,7 +1377,7 @@ _EOF_ done # - Delay. Without this, kernel reports wifi device not found with RPi 3 and Pine A64 addon board, when ran straight after this script. - dietpi-notify 2 "Please wait, enabling WiFi Modules..." + G_DIETPI-NOTIFY 2 "Please wait, enabling WiFi Modules..." sleep 3 #Update our networking file (refresh active wlan index) @@ -1527,7 +1527,7 @@ _EOF_ #systemctl enable serial-getty@*.service # Wildcard does not work, we need to specify each possible tty device name #systemctl enable serial-getty@ttyAMA[0-9].service # Number wildcards do not work, we need to specify each possible tty device number - dietpi-notify 2 "Enabling known serial-getty services, please wait..." + G_DIETPI-NOTIFY 2 "Enabling known serial-getty services, please wait..." systemctl enable serial-getty@.service for ((i=0; i<=$MAX_SERIAL_CONSOLES; i++)) do @@ -1540,7 +1540,7 @@ _EOF_ #Device Specific: # - RPi - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then if (( ! $(cat /boot/cmdline.txt | grep -ci -m1 'console=ttyAMA0,115200 ') )); then @@ -1548,7 +1548,7 @@ _EOF_ fi - if (( $HW_MODEL == 3 )); then + if (( $G_HW_MODEL == 3 )); then # - Must use 250mhz core frequency, else, corrupt characters: https://github.com/Fourdee/DietPi/issues/306#issuecomment-222304202 sed -i '/core_freq=/c\core_freq=250' "$FP_RPI_CONFIG" @@ -1556,12 +1556,12 @@ _EOF_ fi # - Odroid C1 - elif (( $HW_MODEL == 10 )); then + elif (( $G_HW_MODEL == 10 )); then sed -i '/^setenv condev/c\setenv condev "console=tty0 console=ttyS0,115200n8"' /DietPi/boot.ini # - Odroid XU4 - elif (( $HW_MODEL == 11 )); then + elif (( $G_HW_MODEL == 11 )); then if (( ! $(cat /DietPi/boot.ini | grep -ci -m1 'console=ttySAC2,115200n8 ') )); then @@ -1570,12 +1570,12 @@ _EOF_ fi # - Odroid C2 - elif (( $HW_MODEL == 12 )); then + elif (( $G_HW_MODEL == 12 )); then sed -i '/^setenv condev/c\setenv condev "console=tty0 console=ttyS0,115200n8"' /DietPi/boot.ini # - Pine A64 - elif (( $HW_MODEL >= 40 && $HW_MODEL <= 42 )); then + elif (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then if (( ! $(cat /DietPi/uEnv.txt | grep -ci -m1 'console=ttyS0,115200n8 ') )); then @@ -1594,7 +1594,7 @@ _EOF_ elif [ "$INPUT_DEVICE_VALUE" = "disable" ]; then #Disable services. Although, this seems to have no effect on the cmdline.txt boot.ini etc serial console entries. They run regardless. But lets do it for consistency. - dietpi-notify 2 "Disabling known serial-getty services, please wait..." + G_DIETPI-NOTIFY 2 "Disabling known serial-getty services, please wait..." systemctl disable serial-getty@.service for ((i=0; i<=$MAX_SERIAL_CONSOLES; i++)) do @@ -1607,7 +1607,7 @@ _EOF_ #Device Specific: # - RPi - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then # RPi 1/2 sed -i 's/console=ttyAMA0,115200 //' /boot/cmdline.txt @@ -1616,7 +1616,7 @@ _EOF_ sed -i 's/console=ttyS0,115200 //' /boot/cmdline.txt # RPi 3 - Put core freq back to default (400mhz), if set to 250mhz. - if (( $HW_MODEL == 3 && + if (( $G_HW_MODEL == 3 && $(cat "$FP_RPI_CONFIG" | grep -m1 'core_freq=' | sed 's/.*=//') == 250 )); then sed -i '/core_freq=/c\#core_freq=400' "$FP_RPI_CONFIG" @@ -1624,22 +1624,22 @@ _EOF_ fi # - Odroid C1 - elif (( $HW_MODEL == 10 )); then + elif (( $G_HW_MODEL == 10 )); then sed -i '/^setenv condev/c\setenv condev "console=tty0"' /DietPi/boot.ini # - Odroid XU4 - elif (( $HW_MODEL == 11 )); then + elif (( $G_HW_MODEL == 11 )); then sed -i 's/console=ttySAC2,115200n8 //' /DietPi/boot.ini # - Odroid C2 - elif (( $HW_MODEL == 12 )); then + elif (( $G_HW_MODEL == 12 )); then sed -i '/^setenv condev/c\setenv condev "console=tty0"' /DietPi/boot.ini # - Pine A64 - elif (( $HW_MODEL >= 40 && $HW_MODEL <= 42 )); then + elif (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then sed -i 's/console=ttyS0,115200n8 //' /DietPi/uEnv.txt @@ -1675,11 +1675,11 @@ _EOF_ # - Pre-Reqs for any soundcard if (( ! $(dpkg --get-selections | grep -ci -m1 '^alsa-utils') )); then - dietpi-notify 2 "Installing alsa-utils. Please wait..." - AGI alsa-utils + G_DIETPI-NOTIFY 2 "Installing alsa-utils. Please wait..." + G_AGI alsa-utils if (( $? != 0 )); then - dietpi-notify 1 "Unable to install alsa-utils." + G_DIETPI-NOTIFY 1 "Unable to install alsa-utils." fi @@ -1687,42 +1687,42 @@ _EOF_ #HW specific # - RPI - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then Soundcard_Reset_RPi # - Odroid - elif (( $HW_MODEL >= 10 && $HW_MODEL < 20 )); then + elif (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )); then Soundcard_Reset_Odroid # - OPi Zero (H2+) - elif (( $HW_MODEL == 32 )); then + elif (( $G_HW_MODEL == 32 )); then Soundcard_Reset_H2 # - H3 - elif (( $HW_CPUID == 1 )); then + elif (( $G_HW_CPUID == 1 )); then Soundcard_Reset_H3 # - Pine a64 - elif (( $HW_MODEL >= 40 && $HW_MODEL <= 42 )); then + elif (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then Soundcard_Reset_PineA64 # - BPi Pro - elif (( $HW_MODEL == 51 )); then + elif (( $G_HW_MODEL == 51 )); then Soundcard_Reset_BPi_Pro #Sparky SBC - elif (( $HW_MODEL == 70 )); then + elif (( $G_HW_MODEL == 70 )); then Soundcard_Reset_SparkySBC #ASUS - elif (( $HW_MODEL == 100 )); then + elif (( $G_HW_MODEL == 100 )); then Soundcard_Reset_Asus @@ -1868,7 +1868,7 @@ _EOF_ sed -i "/^soundcard=/c\soundcard=$INPUT_DEVICE_VALUE" /DietPi/dietpi.txt # - RPi: Enable DTPARAM audio setting - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then # - Enable dtparam audio sed -i '/dtparam=audio=/c\dtparam=audio=on' "$FP_RPI_CONFIG" @@ -1901,7 +1901,7 @@ _EOF_ # - Not found else - dietpi-notify 1 "Unable to find a USB-DAC on system." + G_DIETPI-NOTIFY 1 "Unable to find a USB-DAC on system." EXIT_CODE=1 # - Reset @@ -1912,7 +1912,7 @@ _EOF_ SOUNDCARD_TARGET_DEVICE=0 # - SparkySBC, enable aotg.aotg1_speed compatibility setting for USB 1.1, when USB-DAC configured: https://github.com/Fourdee/DietPi/issues/1301 - if (( $HW_MODEL == 70 )); then + if (( $G_HW_MODEL == 70 )); then sed -i 's/aotg.aotg1_speed=0/aotg.aotg1_speed=1/' /DietPi/uEnv.txt @@ -2012,7 +2012,7 @@ _EOF_ echo -e "\ndtoverlay=$INPUT_DEVICE_VALUE" >> "$FP_RPI_CONFIG" # + Sparky SBC - if (( $HW_MODEL == 70 )); then + if (( $G_HW_MODEL == 70 )); then echo -e "$INPUT_DEVICE_VALUE" >> /etc/modules SOUNDCARD_TARGET_CARD=1 @@ -2057,7 +2057,7 @@ _EOF_ # - Install binaries local install_url_address='http://dietpi.com/downloads/binaries/rpi/I-Sabre-K2M_binaries.zip' - Check_URL "$install_url_address" + G_CHECK_URL "$install_url_address" if (( $? == 0 )); then wget "$install_url_address" -O package.zip @@ -2075,7 +2075,7 @@ _EOF_ else - dietpi-notify 1 "Failed to install $INPUT_DEVICE_NAME. $install_url_address may be offline or unreachable." + G_DIETPI-NOTIFY 1 "Failed to install $INPUT_DEVICE_NAME. $install_url_address may be offline or unreachable." fi @@ -2269,7 +2269,7 @@ _EOF_ if (( ! $(dpkg --get-selections | grep -ci -m1 '^libasound2-plugin-equal') )); then - AGI libasound2-plugin-equal + G_AGI libasound2-plugin-equal fi @@ -2298,7 +2298,7 @@ _EOF_ #----------------------------------------------------------------------------------- #info - dietpi-notify 3 DietPi-Set_Hardware "$INPUT_DEVICE_NAME ($INPUT_DEVICE_VALUE)" + G_DIETPI-NOTIFY 3 DietPi-Set_Hardware "$INPUT_DEVICE_NAME ($INPUT_DEVICE_VALUE)" #----------------------------------------------------------------------------------- if [ "$INPUT_DEVICE_NAME" = "soundcard" ]; then @@ -2372,7 +2372,7 @@ _EOF_ fi #----------------------------------------------------------------------------------- - dietpi-notify -1 $EXIT_CODE "$INPUT_DEVICE_NAME $INPUT_DEVICE_VALUE |" + G_DIETPI-NOTIFY -1 $EXIT_CODE "$INPUT_DEVICE_NAME $INPUT_DEVICE_VALUE |" #----------------------------------------------------------------------------------- exit $EXIT_CODE #----------------------------------------------------------------------------------- diff --git a/dietpi/func/dietpi-set_nfsclient b/dietpi/func/dietpi-set_nfsclient index 022540ce30..2658b480f9 100644 --- a/dietpi/func/dietpi-set_nfsclient +++ b/dietpi/func/dietpi-set_nfsclient @@ -26,7 +26,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER + G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/func/dietpi-set_smbclient b/dietpi/func/dietpi-set_smbclient index e1b37a7646..1f1473a7a2 100644 --- a/dietpi/func/dietpi-set_smbclient +++ b/dietpi/func/dietpi-set_smbclient @@ -27,7 +27,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER + G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index fff3d17fca..e0c7512904 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -35,8 +35,8 @@ $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entrie #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER - CHECK_ROOTFS_RW + G_CHECK_ROOT_USER + G_CHECK_ROOTFS_RW #Import DietPi-Globals --------------------------------------------------------------- EXIT_CODE=0 @@ -44,7 +44,7 @@ $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entrie Unknown_Input_Name(){ EXIT_CODE=1 - dietpi-notify 2 "Unknown input name ($INPUT_MODE_NAME). Nothing has been applied." + G_DIETPI-NOTIFY 2 "Unknown input name ($INPUT_MODE_NAME). Nothing has been applied." echo -e "$AVAIABLE_COMMANDS" } @@ -52,7 +52,7 @@ $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entrie Unknown_Input_Mode(){ EXIT_CODE=1 - dietpi-notify 2 "Unknown input value ($INPUT_MODE_VALUE). Nothing has been applied." + G_DIETPI-NOTIFY 2 "Unknown input value ($INPUT_MODE_VALUE). Nothing has been applied." } @@ -66,7 +66,7 @@ $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entrie # - Set defaults? if [ "$INPUT_MODE_VALUE" = "default" ]; then - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then INPUT_MODE_VALUE='https://www.mirrorservice.org/sites/archive.raspbian.org/raspbian' @@ -79,14 +79,14 @@ $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entrie fi # - Set raspbian - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then cat << _EOF_ > /etc/apt/sources.list -deb $INPUT_MODE_VALUE $DISTRO_NAME main contrib non-free rpi +deb $INPUT_MODE_VALUE $G_DISTRO_NAME main contrib non-free rpi _EOF_ cat << _EOF_ > /etc/apt/sources.list.d/raspi.list -deb https://archive.raspberrypi.org/debian/ $DISTRO_NAME main ui +deb https://archive.raspberrypi.org/debian/ $G_DISTRO_NAME main ui _EOF_ # Update dietpi.txt entry @@ -96,19 +96,19 @@ _EOF_ else cat << _EOF_ > /etc/apt/sources.list -deb https://deb.debian.org/debian/ $DISTRO_NAME main contrib non-free -deb https://deb.debian.org/debian/ $DISTRO_NAME-updates main contrib non-free -deb https://deb.debian.org/debian-security/ $DISTRO_NAME/updates main contrib non-free -deb https://deb.debian.org/debian/ $DISTRO_NAME-backports main contrib non-free +deb https://deb.debian.org/debian/ $G_DISTRO_NAME main contrib non-free +deb https://deb.debian.org/debian/ $G_DISTRO_NAME-updates main contrib non-free +deb https://deb.debian.org/debian-security/ $G_DISTRO_NAME/updates main contrib non-free +deb https://deb.debian.org/debian/ $G_DISTRO_NAME-backports main contrib non-free _EOF_ # Jessie, switch to http: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 - if (( $DISTRO == 3 )); then + if (( $G_DISTRO == 3 )); then sed -i 's/https/http/g' /etc/apt/sources.list # Buster, remove backports: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 - elif (( $DISTRO == 5 )); then + elif (( $G_DISTRO == 5 )); then sed -i '/backports/d' /etc/apt/sources.list @@ -347,10 +347,10 @@ _EOF_ fi INSTALL_URL="https://raw.githubusercontent.com/Fourdee/DietPi/$gitbranch/dietpi.txt" - Check_URL "$INSTALL_URL" + G_CHECK_URL "$INSTALL_URL" if (( $? == 0 )); then - dietpi-notify 0 "Patching dietpi.txt" + G_DIETPI-NOTIFY 0 "Patching dietpi.txt" wget "$INSTALL_URL" -O /tmp/dietpi.txt_patch local entry=0 @@ -368,14 +368,14 @@ _EOF_ # - Patch new entry if required if (( ! $(grep -ci -m1 "^$entry=" /DietPi/dietpi.txt) )); then - dietpi-notify 2 "Updating dietpi.txt with new entry: $entry=$value" + G_DIETPI-NOTIFY 2 "Updating dietpi.txt with new entry: $entry=$value" cat << _EOF_ >> /DietPi/dietpi.txt $entry=$value _EOF_ else - dietpi-notify 0 "Verified: $entry" + G_DIETPI-NOTIFY 0 "Verified: $entry" fi @@ -384,11 +384,11 @@ _EOF_ done < /tmp/dietpi.txt_patch rm /tmp/dietpi.txt_patch - dietpi-notify 0 "dietpi.txt verification completed" + G_DIETPI-NOTIFY 0 "dietpi.txt verification completed" else - dietpi-notify 1 "Failed to verify dietpi.txt, $INSTALL_URL is offline and/or inaccessible" + G_DIETPI-NOTIFY 1 "Failed to verify dietpi.txt, $INSTALL_URL is offline and/or inaccessible" fi @@ -400,7 +400,7 @@ _EOF_ #----------------------------------------------------------------------------------- #info - dietpi-notify 3 DietPi-Set_Software "$INPUT_MODE_NAME ($INPUT_MODE_VALUE)" + G_DIETPI-NOTIFY 3 DietPi-Set_Software "$INPUT_MODE_NAME ($INPUT_MODE_VALUE)" #----------------------------------------------------------------------------------- if [ "$INPUT_MODE_NAME" = "apt-mirror" ]; then @@ -438,7 +438,7 @@ _EOF_ fi #----------------------------------------------------------------------------------- - dietpi-notify -1 $EXIT_CODE "$INPUT_MODE_NAME $INPUT_MODE_VALUE |" + G_DIETPI-NOTIFY -1 $EXIT_CODE "$INPUT_MODE_NAME $INPUT_MODE_VALUE |" #----------------------------------------------------------------------------------- exit $EXIT_CODE #----------------------------------------------------------------------------------- diff --git a/dietpi/func/dietpi-set_userdata b/dietpi/func/dietpi-set_userdata index e4df7487fc..5ea26c3918 100644 --- a/dietpi/func/dietpi-set_userdata +++ b/dietpi/func/dietpi-set_userdata @@ -19,7 +19,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER + G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- EXIT_CODE=0 @@ -56,8 +56,8 @@ # - Copy source to target, if it contains any files/folders if [ -z "$(find $SOURCE_DIRECTORY -maxdepth 0 -empty)" ]; then - dietpi-notify 0 "Moving your existing data from $SOURCE_DIRECTORY to $TARGET_DIRECTORY" - dietpi-notify 2 "Please wait...\n" + G_DIETPI-NOTIFY 0 "Moving your existing data from $SOURCE_DIRECTORY to $TARGET_DIRECTORY" + G_DIETPI-NOTIFY 2 "Please wait...\n" sleep 1 @@ -74,8 +74,8 @@ if (( $(ls -lha "$fp_test_target" | grep -ci -m1 "www-data") )); then cp_options+='p' - dietpi-notify 2 "Target filesystem supports user permissions:" - dietpi-notify 2 " - Attempting to preserve permissions during transfer." + G_DIETPI-NOTIFY 2 "Target filesystem supports user permissions:" + G_DIETPI-NOTIFY 2 " - Attempting to preserve permissions during transfer." sleep 1 fi @@ -111,11 +111,11 @@ fi - # - Create symlink to FP_DIETPI_USERDATA if required - if [ "$TARGET_DIRECTORY" != "$FP_DIETPI_USERDATA" ]; then + # - Create symlink to G_FP_DIETPI_USERDATA if required + if [ "$TARGET_DIRECTORY" != "$G_FP_DIETPI_USERDATA" ]; then - rm -R "$FP_DIETPI_USERDATA" &> /dev/null - ln -sf "$TARGET_DIRECTORY" "$FP_DIETPI_USERDATA" + rm -R "$G_FP_DIETPI_USERDATA" &> /dev/null + ln -sf "$TARGET_DIRECTORY" "$G_FP_DIETPI_USERDATA" fi @@ -132,8 +132,8 @@ #///////////////////////////////////////////////////////////////////////////////////// #init - # - If there is no directory or symlink for $FP_DIETPI_USERDATA, always create a directory. - if [ ! -d "$FP_DIETPI_USERDATA" ] && [ ! -L "$FP_DIETPI_USERDATA" ]; then + # - If there is no directory or symlink for $G_FP_DIETPI_USERDATA, always create a directory. + if [ ! -d "$G_FP_DIETPI_USERDATA" ] && [ ! -L "$G_FP_DIETPI_USERDATA" ]; then #Run full core_env set /DietPi/dietpi/func/dietpi-set_core_environment @@ -144,10 +144,10 @@ #Run target_to_lowercase=$(echo -e "$TARGET_DIRECTORY" | tr '[:upper:]' '[:lower:]') - dietpi-notify 3 DietPi Updating user data location - dietpi-notify 2 " - From : $SOURCE_DIRECTORY" - dietpi-notify 2 " - To : $TARGET_DIRECTORY" - dietpi-notify 2 "Please wait..." + G_DIETPI-NOTIFY 3 DietPi Updating user data location + G_DIETPI-NOTIFY 2 " - From : $SOURCE_DIRECTORY" + G_DIETPI-NOTIFY 2 " - To : $TARGET_DIRECTORY" + G_DIETPI-NOTIFY 2 "Please wait..." while (( $RUN_MOVE_DATA )); do @@ -161,9 +161,9 @@ break # - Check if symlink is already pointing to target directory. - elif [ "$(readlink -f $FP_DIETPI_USERDATA)" = "$TARGET_DIRECTORY" ]; then + elif [ "$(readlink -f $G_FP_DIETPI_USERDATA)" = "$TARGET_DIRECTORY" ]; then - LOGFILE_OUTPUT_TEXT="$FP_DIETPI_USERDATA is already symlinked to target directory." + LOGFILE_OUTPUT_TEXT="$G_FP_DIETPI_USERDATA is already symlinked to target directory." EXIT_CODE=0 #return ok break @@ -219,7 +219,7 @@ #Ensure enough freespace in target FREESPACE_AVAILABLE_TARGET=$(( $(df -Pk "$TARGET_DIRECTORY" | awk '{print $4}' | sed -n 2p) * 1024 )) #bytes - dietpi-notify 2 "Calculating space required for moving data, please wait..." + G_DIETPI-NOTIFY 2 "Calculating space required for moving data, please wait..." FREESPACE_REQUIRED_SOURCE=$(du -cbs "$SOURCE_DIRECTORY" | awk '{print $1}' | sed -n 1p) #bytes echo -e " - Available $FREESPACE_AVAILABLE_TARGET bytes" @@ -250,12 +250,12 @@ # - Info if (( $EXIT_CODE == 0 )); then - dietpi-notify 2 "$LOGFILE_OUTPUT_TEXT" + G_DIETPI-NOTIFY 2 "$LOGFILE_OUTPUT_TEXT" # - Error else - dietpi-notify 1 "$LOGFILE_OUTPUT_TEXT" + G_DIETPI-NOTIFY 1 "$LOGFILE_OUTPUT_TEXT" fi @@ -266,14 +266,14 @@ else - dietpi-notify 2 User data location setup completed. + G_DIETPI-NOTIFY 2 User data location setup completed. echo -e "" fi #----------------------------------------------------------------------------------- - dietpi-notify -1 ${EXIT_CODE:=0} + G_DIETPI-NOTIFY -1 ${EXIT_CODE:=0} #----------------------------------------------------------------------------------- exit $EXIT_CODE #----------------------------------------------------------------------------------- diff --git a/dietpi/func/run_ntpd b/dietpi/func/run_ntpd index 55c5970b1f..26bf68529f 100644 --- a/dietpi/func/run_ntpd +++ b/dietpi/func/run_ntpd @@ -20,7 +20,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER + G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- INPUT_MODE=$1 @@ -35,7 +35,7 @@ #Dont run twice if (( $(ps aux | grep -ci -m1 '[[:space:]][n]tpd[[:space:]]') )); then - dietpi-notify 2 "NTPD: is already running" + G_DIETPI-NOTIFY 2 "NTPD: is already running" else @@ -49,14 +49,14 @@ #NTPD: run, exit when updated. if (( $NTPD_UPDATE_MODE >= 1 && $NTPD_UPDATE_MODE <= 3 )); then - dietpi-notify 2 "NTPD: Running time sync update ($NTPD_UPDATE_MODE)" + G_DIETPI-NOTIFY 2 "NTPD: Running time sync update ($NTPD_UPDATE_MODE)" ntpd -gq -l /var/log/ntpd.log &> /dev/null EXIT_CODE=$? #systemD-timesyncd/other method: assume status is ok else - dietpi-notify 0 "NTPD: non-NTPD mode detected. Completed" + G_DIETPI-NOTIFY 0 "NTPD: non-NTPD mode detected. Completed" EXIT_CODE=0 fi @@ -85,7 +85,7 @@ # Update NTPD if its not running, and, no exit file exists if [ ! -f "$FP_EXIT_CODE" ] && (( ! $(ps aux | grep -ci -m1 '[[:space:]][n]tpd[[:space:]]') )); then - dietpi-notify 2 "NTPD: Has not yet been launched, running now, please wait..." + G_DIETPI-NOTIFY 2 "NTPD: Has not yet been launched, running now, please wait..." Update_NTPD & sleep 1 @@ -96,7 +96,7 @@ else - dietpi-notify 2 "NTPD: Waiting for completion of time sync ($CURRENT_LOOP/$MAX_LOOPS)" + G_DIETPI-NOTIFY 2 "NTPD: Waiting for completion of time sync ($CURRENT_LOOP/$MAX_LOOPS)" sleep 1 ((CURRENT_LOOP++)) @@ -107,7 +107,7 @@ #systemD-timesyncd/other method: assume status is ok else - dietpi-notify 0 "NTPD: non-NTPD mode detected. Completed" + G_DIETPI-NOTIFY 0 "NTPD: non-NTPD mode detected. Completed" EXIT_CODE=0 fi @@ -120,11 +120,11 @@ fi #----------------------------------------------------------------------------------- #Always return status - dietpi-notify -1 $EXIT_CODE 'NTPD: time sync |' + G_DIETPI-NOTIFY -1 $EXIT_CODE 'NTPD: time sync |' if (( $EXIT_CODE != 0 )); then - dietpi-notify 2 "NTPD: Please check the log file for more information:" - dietpi-notify 2 "NTPD: /var/log/ntpd.log" + G_DIETPI-NOTIFY 2 "NTPD: Please check the log file for more information:" + G_DIETPI-NOTIFY 2 "NTPD: /var/log/ntpd.log" fi #----------------------------------------------------------------------------------- diff --git a/dietpi/login b/dietpi/login index d6a2e83312..b0a5640952 100644 --- a/dietpi/login +++ b/dietpi/login @@ -25,15 +25,14 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER + G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// #Globals #///////////////////////////////////////////////////////////////////////////////////// - HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) - DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) - DIETPI_INSTALL_STAGE=$(cat /DietPi/dietpi/.install_stage) + G_HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) + G_DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) FP_DIETPI_FIRSTRUNSETUP_LOG='/var/tmp/dietpi/logs/dietpi-firstrun-setup.log' #///////////////////////////////////////////////////////////////////////////////////// @@ -49,7 +48,7 @@ local screen_valid=0 #OrangePi - # if (( $HW_MODEL >= 30 && $HW_MODEL < 40 )); then + # if (( $G_HW_MODEL >= 30 && $G_HW_MODEL < 40 )); then # if [ "$(tty)" = "/dev/pts/0" ]; then # screen_valid=1 # fi @@ -117,7 +116,7 @@ done - "$FP_DIETPI_USERDATA"/dxx-rebirth/run.sh + "$G_FP_DIETPI_USERDATA"/dxx-rebirth/run.sh #CAVA elif (( $AUTO_START_INDEX == 10 )); then @@ -169,7 +168,7 @@ while [ ! -f /DietPi/.ramdisk ] do - dietpi-notify 2 "Waiting for DietPi-RAMDISK to finish mounting DietPi to RAM..." + G_DIETPI-NOTIFY 2 "Waiting for DietPi-RAMDISK to finish mounting DietPi to RAM..." sleep 1 done @@ -179,7 +178,7 @@ #---------------------------------------------------------------- #Normal Login - if (( $DIETPI_INSTALL_STAGE == 1 )); then + if (( $G_DIETPI_INSTALL_STAGE == 1 )); then /DietPi/dietpi/dietpi-banner 1 @@ -191,7 +190,7 @@ #---------------------------------------------------------------- #Run DietPi-Software (1st run setup) - elif (( $DIETPI_INSTALL_STAGE == 0 )); then + elif (( $G_DIETPI_INSTALL_STAGE == 0 )); then /DietPi/dietpi/dietpi-banner 0 @@ -202,12 +201,12 @@ # - Automated if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 '^AUTO_Install_Enable=1') )); then - dietpi-notify 2 'DietPi is currently installing and configuring your system. Please wait for this to complete, check back later.' + G_DIETPI-NOTIFY 2 'DietPi is currently installing and configuring your system. Please wait for this to complete, check back later.' else - dietpi-notify 2 'DietPi-Software is already running on another terminal/screen. Please complete or exit, before continuing.' + G_DIETPI-NOTIFY 2 'DietPi-Software is already running on another terminal/screen. Please complete or exit, before continuing.' fi @@ -216,8 +215,8 @@ done #Start DietPi-Software if required - DIETPI_INSTALL_STAGE=$(cat /DietPi/dietpi/.install_stage) - if (( $DIETPI_INSTALL_STAGE == 0 )); then + G_DIETPI_INSTALL_STAGE=$(cat /DietPi/dietpi/.install_stage) + if (( $G_DIETPI_INSTALL_STAGE == 0 )); then /DietPi/dietpi/dietpi-software | tee "$FP_DIETPI_FIRSTRUNSETUP_LOG" @@ -225,7 +224,7 @@ #---------------------------------------------------------------- #DietPi finishing up bootloader. - elif (( $DIETPI_INSTALL_STAGE == -1 )); then + elif (( $G_DIETPI_INSTALL_STAGE == -1 )); then /DietPi/dietpi/dietpi-banner 0 echo -e " >> DietPi System prep is nearly completed: \n Please run /DietPi/dietpi/login after a few seconds" diff --git a/dietpi/misc/dietpi-justboom b/dietpi/misc/dietpi-justboom index e7a9445f3f..5e7f74ce11 100644 --- a/dietpi/misc/dietpi-justboom +++ b/dietpi/misc/dietpi-justboom @@ -16,8 +16,8 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - CHECK_ROOT_USER - CHECK_ROOTFS_RW + G_CHECK_ROOT_USER + G_CHECK_ROOTFS_RW #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -352,18 +352,18 @@ if [ "$OPTION" = "ALSA Output Info" ]; then - dietpi-notify 3 DietPi-JustBoom "ALSA Output Info" + G_DIETPI-NOTIFY 3 DietPi-JustBoom "ALSA Output Info" local stream_result=$(cat /proc/asound/card*/pcm0p/sub0/hw_params) echo -e "$stream_result" echo -e "" if [ "$stream_result" = "closed" ]; then - dietpi-notify 1 "Detailed info is only available when audio is being played, play some music first!" + G_DIETPI-NOTIFY 1 "Detailed info is only available when audio is being played, play some music first!" fi - dietpi-notify 0 "Completed, press any key to exit...\n" + G_DIETPI-NOTIFY 0 "Completed, press any key to exit...\n" read -p "Press any key to exit..." elif [ "$OPTION" = "Subwoofer Mode" ]; then diff --git a/dietpi/misc/start_kodi b/dietpi/misc/start_kodi index 59efcbb898..a2110cbc38 100644 --- a/dietpi/misc/start_kodi +++ b/dietpi/misc/start_kodi @@ -27,7 +27,7 @@ #///////////////////////////////////////////////////////////////////////////////////// #----------------------------------------------------------------------------------- #Raspberry Pi - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then kodi-standalone @@ -39,7 +39,7 @@ if [ "$DISPLAY" ]; then #C2 fix for stuttering and laggy audio: https://github.com/Fourdee/DietPi/issues/399#issuecomment-229413994 - if (( $HW_MODEL == 12 )); then + if (( $G_HW_MODEL == 12 )); then killall -w xcompmgr xcompmgr -a & diff --git a/dietpi/patch_file b/dietpi/patch_file index e9cdb988cd..adcfc149ff 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -79,21 +79,21 @@ if (( ! $(dpkg --get-selections | grep -ci -m1 '^apt-transport-https') )); then - AGI apt-transport-https + G_AGI apt-transport-https if (( $? != 0 )); then # - armv7 - if (( $HW_ARCH == 2 )); then + if (( $G_HW_ARCH == 2 )); then INSTALL_URL='http://security.debian.org/debian-security/pool/updates/main/c/curl/libcurl3-gnutls_7.38.0-4+deb8u5_armhf.deb' # - arm64 - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then INSTALL_URL='http://security.debian.org/debian-security/pool/updates/main/c/curl/libcurl3-gnutls_7.38.0-4+deb8u5_arm64.deb' # - x86_64 - elif (( $HW_ARCH == 10 )); then + elif (( $G_HW_ARCH == 10 )); then INSTALL_URL='http://security.debian.org/debian-security/pool/updates/main/c/curl/libcurl3-gnutls_7.38.0-4+deb8u5_amd64.deb' @@ -104,17 +104,17 @@ rm package.deb # - armv7 - if (( $HW_ARCH == 2 )); then + if (( $G_HW_ARCH == 2 )); then INSTALL_URL='http://security.debian.org/debian-security/pool/updates/main/a/apt/libapt-pkg4.12_1.0.9.8.4_armhf.deb' # - arm64 - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then INSTALL_URL='http://security.debian.org/debian-security/pool/updates/main/a/apt/libapt-pkg4.12_1.0.9.8.4_arm64.deb' # - x86_64 - elif (( $HW_ARCH == 10 )); then + elif (( $G_HW_ARCH == 10 )); then INSTALL_URL='http://security.debian.org/debian-security/pool/updates/main/a/apt/libapt-pkg4.12_1.0.9.8.4_amd64.deb' @@ -125,17 +125,17 @@ rm package.deb # - armv7 - if (( $HW_ARCH == 2 )); then + if (( $G_HW_ARCH == 2 )); then INSTALL_URL='http://security.debian.org/debian-security/pool/updates/main/a/apt/apt-transport-https_1.0.9.8.4_armhf.deb' # - arm64 - elif (( $HW_ARCH == 3 )); then + elif (( $G_HW_ARCH == 3 )); then INSTALL_URL='http://security.debian.org/debian-security/pool/updates/main/a/apt/apt-transport-https_1.0.9.8.4_arm64.deb' # - x86_64 - elif (( $HW_ARCH == 10 )); then + elif (( $G_HW_ARCH == 10 )); then INSTALL_URL='http://security.debian.org/debian-security/pool/updates/main/a/apt/apt-transport-https_1.0.9.8.4_amd64.deb' @@ -195,7 +195,7 @@ #------------------------------------------------------------------------------- #Missing Resolvconf /DietPi/dietpi/dietpi-apt-get_update 1 - AGI resolvconf + G_AGI resolvconf #------------------------------------------------------------------------------- #New Bash Alias's if (( $(cat /etc/bash.bashrc | grep -ci -m1 'dietpi-autostart=') == 0 )); then @@ -302,7 +302,7 @@ if [ -f /DietPi/dietpi/.installed ]; then if (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'XSERVERXORG 2') == 1 )); then /DietPi/dietpi/dietpi-apt-get_update 1 - AGI dbus-x11 + G_AGI dbus-x11 fi fi #------------------------------------------------------------------------------- @@ -375,7 +375,7 @@ _EOF_ chmod +x /usr/local/bin/chronometer.sh /DietPi/dietpi/dietpi-apt-get_update 1 - AGI bc + G_AGI bc fi #------------------------------------------------------------------------------- #DietPi-Software additions @@ -404,14 +404,14 @@ _EOF_ #------------------------------------------------------------------------------- #debconf-get-selections mising from odroid's /DietPi/dietpi/dietpi-apt-get_update 1 - AGI debconf-utils + G_AGI debconf-utils #------------------------------------------------------------------------------- elif (( $VERSION_CURRENT == 109 )); then #------------------------------------------------------------------------------- #Put XU4 kernel updates on hold to prevent automated installations causing broken kernel/modules. #https://github.com/Fourdee/DietPi/issues/185#issuecomment-183343474 - if (( $HW_MODEL == 11 )); then + if (( $G_HW_MODEL == 11 )); then apt-mark hold linux-headers-armhf-odroid-xu3 linux-image-armhf-odroid-xu3 fi #------------------------------------------------------------------------------- @@ -433,7 +433,7 @@ _EOF_ #------------------------------------------------------------------------------- #BC is now installed by default on all DietPi systems. bc is needed for bash floating point calculations that many scripts rely on. /DietPi/dietpi/dietpi-apt-get_update 1 - AGI bc + G_AGI bc #------------------------------------------------------------------------------- #Cloudshell new option | NETWORK_USAGE_CURRENT_OUTPUT_TYPE if [ -f /DietPi/dietpi/.dietpi-cloudshell ]; then @@ -452,7 +452,7 @@ _EOF_ #RPI Jessie: # - remove /etc/apt/sources.list.d/collabora.list. This was left over from Wheezy dist-upgrade and is not required. # - Update /etc/apt/sources.list.d/raspi.list to match Raspbian Jessie raspi.list. - if (( $HW_MODEL < 10 )) && (( $DISTRO == 3 )); then + if (( $G_HW_MODEL < 10 )) && (( $G_DISTRO == 3 )); then rm /etc/apt/sources.list.d/collabora.list cat << _EOF_ > /etc/apt/sources.list.d/raspi.list deb http://archive.raspberrypi.org/debian/ jessie main ui @@ -463,7 +463,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #RPI - snd-bcm2835 is now disabled by default. - if (( $HW_MODEL < 10 )) && (( $(dpkg -l | grep -ci -m1 'alsa') == 0 )); then + if (( $G_HW_MODEL < 10 )) && (( $(dpkg -l | grep -ci -m1 'alsa') == 0 )); then /DietPi/dietpi/func/dietpi-set_hardware soundcard none fi #------------------------------------------------------------------------------- @@ -473,9 +473,9 @@ _EOF_ #RPi 3 - WiFi hotspot. Internal Wifi fix. # - Disable driver definition # - Use non-modified hostapd binary from Jessie repo. - if (( $HW_MODEL == 3 )) && (( $(dpkg -l | grep -ci -m1 'hostapd') == 1 )); then + if (( $G_HW_MODEL == 3 )) && (( $(dpkg -l | grep -ci -m1 'hostapd') == 1 )); then apt-get remove hostapd -y - AGI hostapd + G_AGI hostapd sed -i '/driver=/c\#driver=rtl871xdrv/' /etc/hostapd/hostapd.conf fi #------------------------------------------------------------------------------- @@ -537,12 +537,12 @@ _EOF_ fi #------------------------------------------------------------------------------- #Odroid C2 - Kodi sound fix - if (( $HW_MODEL == 12 )); then + if (( $G_HW_MODEL == 12 )); then if (( $(dpkg -l | grep -ci -m1 'kodi-odroid') == 1 )); then # - upgrade kodi - AGUP - AGUG + G_AGUP + G_AGUG # - Remove pulse audio workaround fix we used. apt-get purge pulseaudio -y @@ -562,7 +562,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #fbset now installed by default - AGI fbset + G_AGI fbset #------------------------------------------------------------------------------- elif (( $VERSION_CURRENT == 113 )); then @@ -578,7 +578,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #C1 - Ondemand does not work, replace with interactive: https://github.com/Fourdee/DietPi/issues/248 - if (( $HW_MODEL == 10 )) && (( $(cat /DietPi/dietpi.txt | grep -ci -m1 '^cpu_governor=ondemand') == 1 )); then + if (( $G_HW_MODEL == 10 )) && (( $(cat /DietPi/dietpi.txt | grep -ci -m1 '^cpu_governor=ondemand') == 1 )); then sed -i "/cpu_governor=/c\cpu_governor=interactive" /DietPi/dietpi.txt /DietPi/dietpi/dietpi-cpu_set fi @@ -590,7 +590,7 @@ _EOF_ elif (( $VERSION_CURRENT == 114 )); then #------------------------------------------------------------------------------- #OPi PC - Comminuty Fix vcore/freq: https://github.com/Fourdee/DietPi/issues/263 - if (( $HW_MODEL == 30 )); then + if (( $G_HW_MODEL == 30 )); then # - Warn user of OPi-PC only support after this is run. whiptail --title "OPi-PC vcore/stability fix" --yesno "This will apply the community vcore/stability fix on your system. The fix resolves known issues with the H3 clockspeeds and vcore voltages. Whilst this patch has been tested on OPi-PC systems, there is no guarantee the fix will work, and, could render your system unbootable.\n\nNB: If you NOT using an OPi-PC, say no.\n\nDo you wish to apply the community H3 patch?" --backtitle "DietPi-Update" --defaultno 16 70 @@ -672,8 +672,8 @@ _EOF_ fi #------------------------------------------------------------------------------- #Odroid C1 WiFi fix (missing packages): https://github.com/Fourdee/DietPi/issues/273#issuecomment-210410651 - if (( $HW_MODEL == 10 )); then - AGI wireless-regdb iw crda wpasupplicant + if (( $G_HW_MODEL == 10 )); then + G_AGI wireless-regdb iw crda wpasupplicant fi #------------------------------------------------------------------------------- @@ -696,7 +696,7 @@ _EOF_ chmod +x /etc/cron.hourly/dietpi #------------------------------------------------------------------------------- #ifmetric: https://github.com/Fourdee/DietPi/issues/273#issuecomment-213951519 - AGI ifmetric + G_AGI ifmetric if (( $(cat /etc/network/interfaces | grep -ci -m1 '^metric ') == 0 )); then # - eth sed -i "/iface eth$(sed -n 1p /DietPi/dietpi/.network)/a metric 0" /etc/network/interfaces @@ -705,7 +705,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #netplug. Resolves issues with unplugging eth and breaking all connections, when WiFi is also active: https://github.com/Fourdee/DietPi/issues/273#issuecomment-215996025 - AGI netplug + G_AGI netplug cat << _EOF_ > /etc/netplug/netplugd.conf eth* wlan* @@ -724,7 +724,7 @@ _EOF_ sed -i "/^#auto wlan$(sed -n 2p /DietPi/dietpi/.network)/c\#allow-hotplug wlan$(sed -n 2p /DietPi/dietpi/.network)" /etc/network/interfaces #------------------------------------------------------------------------------- #apply to all DietPi systems (but targeted at Odroid XU4) - missing WiFi packages. - AGI wireless-regdb iw crda wpasupplicant + G_AGI wireless-regdb iw crda wpasupplicant #------------------------------------------------------------------------------- #Missing line at EOF echo -e "" >> /etc/network/interfaces @@ -753,9 +753,9 @@ _EOF_ fi #------------------------------------------------------------------------------- #Patch PineA64 to include xz-utils for firmware upgrades (only needed w/ alpha v118 image - if (( $HW_MODEL >= 40 && $HW_MODEL <= 42 )); then - AGUP - AGI xz-utils + if (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then + G_AGUP + G_AGI xz-utils /usr/local/sbin/pine64_update_uboot.sh /usr/local/sbin/pine64_update_kernel.sh @@ -767,7 +767,7 @@ _EOF_ #------------------------------------------------------------------------------- #Transmission, service starts before network via SystemD, instead of "dietpi-services start": https://github.com/Fourdee/DietPi/issues/350 if [ -f /DietPi/dietpi/.installed ] && - (( $DISTRO == 3 )) && + (( $G_DISTRO == 3 )) && (( $( cat /DietPi/dietpi/.installed | grep -ci -m1 '^TRANSMISSION=2' ) )); then rm /etc/init.d/transmission-daemon @@ -803,7 +803,7 @@ _EOF_ (( $( cat /DietPi/dietpi/.installed | grep -ci -m1 '^TIGHTVNCSERVER=2' ) )); then #Wheezy - if (( $DISTRO == 1 )); then + if (( $G_DISTRO == 1 )); then cat << _EOF_ > /etc/init.d/vncserver #!/bin/bash -e @@ -856,7 +856,7 @@ _EOF_ #Jessie - elif (( $DISTRO == 3 )); then + elif (( $G_DISTRO == 3 )); then cat << _EOF_ > /etc/systemd/system/vncserver.service [Unit] @@ -942,7 +942,7 @@ _EOF_ #------------------------------------------------------------------------------- #Odroid C2 boot.ini changes: https://github.com/Fourdee/DietPi/issues/366#issue-157399983 # I dont want to risk patching these additional options in, so lets overwrite the users boot.ini with the new one. - if (( $HW_MODEL == 12 )); then + if (( $G_HW_MODEL == 12 )); then DEBIAN_FRONTEND='noninteractive' apt-get upgrade -y linux-headers-arm64-odroid-c2 linux-image-arm64-odroid-c2 @@ -950,7 +950,7 @@ _EOF_ DEBIAN_FRONTEND='noninteractive' apt-get autoremove --purge -y # - Because removing 3.14.29 also removes 3.14.65 (most likley same locations) we need to reinstall 3.14.65+ - AGI --reinstall linux-headers-3.14.65+ linux-image-3.14.65+ + G_AGI --reinstall linux-headers-3.14.65+ linux-image-3.14.65+ wget https://raw.githubusercontent.com/Fourdee/DietPi/e8e0edf7193c61d6084bf252397561081e335dc5/boot_c2.ini -O /DietPi/boot.ini @@ -960,7 +960,7 @@ _EOF_ elif (( $VERSION_CURRENT == 119 )); then #------------------------------------------------------------------------------- #RPi 3 75 thermal limit: https://github.com/Fourdee/DietPi/issues/356#issuecomment-223282185 - if (( $HW_MODEL == 3 )); then + if (( $G_HW_MODEL == 3 )); then sed -i '/temp_limit=/c\temp_limit=75' /DietPi/config.txt @@ -985,7 +985,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #Pine A64 image, disable systemd-timesyncd as we use ntp/d. New installs only. - if (( $HW_MODEL >= 40 && $HW_MODEL <= 42 )) && [ ! -f /DietPi/dietpi/.installed ]; then + if (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )) && [ ! -f /DietPi/dietpi/.installed ]; then systemctl disable systemd-timesyncd systemctl mask systemd-timesyncd fi @@ -1001,7 +1001,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #Pine A64, now using fbturbo driver: https://github.com/Fourdee/DietPi/issues/380 - if (( $HW_MODEL >= 40 && $HW_MODEL <= 42 )) && + if (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )) && [ -f /DietPi/dietpi/.installed ] && (( $( cat /DietPi/dietpi/.installed | grep -ci -m1 '^XSERVERXORG=2' ) )); then @@ -1016,7 +1016,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #Always ensure dietpi_userdata directory exists - mkdir -p "$FP_DIETPI_USERDATA" &> /dev/null + mkdir -p "$G_FP_DIETPI_USERDATA" &> /dev/null #Setup dietpi_userdata symlink for existing installs, if not on flash drive if [ -f /DietPi/dietpi/.installed ]; then @@ -1030,12 +1030,12 @@ _EOF_ #USBDRIVE if (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'USBDRIVE=2') && $(df | grep -ci -m1 '/mnt/usb_1') )); then - /DietPi/dietpi/func/dietpi-set_userdata "$FP_DIETPI_USERDATA" /mnt/usb_1 + /DietPi/dietpi/func/dietpi-set_userdata "$G_FP_DIETPI_USERDATA" /mnt/usb_1 fi #CUSTOM else - /DietPi/dietpi/func/dietpi-set_userdata "$FP_DIETPI_USERDATA" "$DIETPI_USERDATA_BASEDIRECTORY" + /DietPi/dietpi/func/dietpi-set_userdata "$G_FP_DIETPI_USERDATA" "$DIETPI_USERDATA_BASEDIRECTORY" fi # - dietpi-set_userdata restarts services, so stop them. @@ -1050,7 +1050,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #xz-utils missing from some images, required for decompress tar.xz support. - AGI xz-utils + G_AGI xz-utils #------------------------------------------------------------------------------- #I left the serial console enabled for all the v120 images (my bad). Disable if not enabled in dietpi.txt if (( ! $(cat /DietPi/dietpi.txt | grep -ci -m1 '^serial_console_enabled=1') )); then @@ -1068,7 +1068,7 @@ _EOF_ if [ -f /DietPi/dietpi/.installed ]; then if (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'XSERVERXORG=2') )); then - AGI xterm + G_AGI xterm fi # Mate: https://github.com/Fourdee/DietPi/issues/388 @@ -1086,7 +1086,7 @@ _EOF_ #------------------------------------------------------------------------------- #C2 X11 GPU/VPU patches: https://github.com/Fourdee/DietPi/issues/399 # - boot.ini - if (( $HW_MODEL == 12 )); then + if (( $G_HW_MODEL == 12 )); then if [ -f /DietPi/dietpi/.installed ]; then @@ -1104,10 +1104,10 @@ _EOF_ # - Update/Upgrade apt /DietPi/dietpi/dietpi-apt-get_update 2 - AGUP + G_AGUP # - Reinstall all packages, including the X11 additions (xf86-video-mali-odroid libump-odroid) - AGI xcompmgr aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump-odroid + G_AGI xcompmgr aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump-odroid cp /DietPi/dietpi/conf/xorg_c2.conf /etc/X11/xorg.conf fi @@ -1154,7 +1154,7 @@ _EOF_ #MineOS requires rsync: https://github.com/Fourdee/DietPi/issues/403 if [ -f /DietPi/dietpi/.installed ] && (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'MINEOS=2') )); then - AGI rsync + G_AGI rsync fi #------------------------------------------------------------------------------- @@ -1168,7 +1168,7 @@ _EOF_ elif (( $VERSION_CURRENT == 122 )); then #------------------------------------------------------------------------------- #Pine a64 resolution option in dietpi-config: https://github.com/Fourdee/DietPi/issues/398 - if (( $HW_MODEL >= 40 && $HW_MODEL <= 42 )); then + if (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then if (( ! $(cat /DietPi/uEnv.txt | grep -ci -m1 '^optargs=disp.screen0_output_mode=') )); then @@ -1245,12 +1245,12 @@ _EOF_ #Kodi add NFS support: if [ -f /DietPi/dietpi/.installed ] && (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'KODI=2') )); then - AGI libnfs4 + G_AGI libnfs4 fi #------------------------------------------------------------------------------- #Odroid C2, define default pulseaudio sink: https://github.com/Fourdee/DietPi/issues/415 - if (( $HW_MODEL == 12 )) && + if (( $G_HW_MODEL == 12 )) && [ -f /DietPi/dietpi/.installed ] && (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'DESKTOP_MATE=2') )) && (( ! $(cat /etc/pulse/default.pa | grep -ci -m1 '^set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo') )); then @@ -1260,33 +1260,33 @@ _EOF_ fi #------------------------------------------------------------------------------- #ARMbian images, install armbian repo and update packages - if (( $HW_MODEL == 30 || $HW_MODEL == 50 || $HW_MODEL == 51 )) && + if (( $G_HW_MODEL == 30 || $G_HW_MODEL == 50 || $G_HW_MODEL == 51 )) && [ ! -f /proc/sunxi_debug/sunxi_debug ]; then # Skip the replaced OPi PC loboris image. echo "deb http://apt.armbian.com jessie main" > /etc/apt/sources.list.d/armbian.list apt-key adv --keyserver keys.gnupg.net --recv-keys 0x93D6889F9F0E78D5 - AGUP + G_AGUP # - remove ye-olde packages apt-get purge -y armbian-firmware #BPi m2+ - if (( $HW_MODEL == 50 )); then + if (( $G_HW_MODEL == 50 )); then - AGI linux-u-boot-bananapim2plus-default linux-firmware-image-sun8i linux-image-sun8i + G_AGI linux-u-boot-bananapim2plus-default linux-firmware-image-sun8i linux-image-sun8i #OPi PC - elif (( $HW_MODEL == 30 )); then + elif (( $G_HW_MODEL == 30 )); then # - remove ye-olde packages apt-get purge -y linux-jessie-root-orangepih3 linux-u-boot-orangepih3-default - AGI linux-u-boot-orangepipc-default linux-firmware-image-sun8i linux-image-sun8i + G_AGI linux-u-boot-orangepipc-default linux-firmware-image-sun8i linux-image-sun8i #BPi pro - elif (( $HW_MODEL == 51 )); then + elif (( $G_HW_MODEL == 51 )); then - AGI linux-image-sun7i linux-firmware-image-sun7i linux-u-boot-bananapipro-default + G_AGI linux-image-sun7i linux-firmware-image-sun7i linux-u-boot-bananapipro-default fi @@ -1301,7 +1301,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #RPi add dtparam=spi=off to config by default - if (( $HW_MODEL < 10 && + if (( $G_HW_MODEL < 10 && ! $(cat /DietPi/config.txt | grep -ci -m1 'dtparam=spi=') )); then echo -e "\ndtparam=spi=off" >> /DietPi/config.txt @@ -1320,7 +1320,7 @@ _EOF_ elif (( $VERSION_CURRENT == 123 )); then #------------------------------------------------------------------------------- #Pine remove vim-* (was left on latest image) for new installations. - if [ ! -f /DietPi/dietpi/.installed ] && (( $HW_MODEL >= 40 && $HW_MODEL <= 42 )); then + if [ ! -f /DietPi/dietpi/.installed ] && (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then apt-get purge -y vim-common vim-tiny @@ -1340,12 +1340,12 @@ _EOF_ if [ -f /DietPi/dietpi/.installed ] && (( $( cat /DietPi/dietpi/.installed | grep -ci -m1 '^KODI=2' ) )); then - AGI libcurl3-gnutls + G_AGI libcurl3-gnutls fi #------------------------------------------------------------------------------- #C2 remove asound.conf for hdmi: https://github.com/Fourdee/DietPi/issues/447 - if (( $HW_MODEL == 12 )) && [ -f /etc/asound.conf ] && + if (( $G_HW_MODEL == 12 )) && [ -f /etc/asound.conf ] && (( $(cat /etc/asound.conf | grep -ci -m1 'format S32_LE') )); then rm /etc/asound.conf @@ -1356,7 +1356,7 @@ _EOF_ elif (( $VERSION_CURRENT == 126 )); then #------------------------------------------------------------------------------- #NanoPi Neo, left test account on image, remove it - if (( $HW_MODEL == 60 )); then + if (( $G_HW_MODEL == 60 )); then userdel -f test @@ -1518,14 +1518,14 @@ _EOF_ fi #------------------------------------------------------------------------------- #RPi 2/3 - Set correct sdram speed if not active. Used by dietpi-config for reading value. - if (( $HW_MODEL == 2 || $HW_MODEL == 3 )); then + if (( $G_HW_MODEL == 2 || $G_HW_MODEL == 3 )); then sed -i '/^#sdram_freq=/c\#sdram_freq=450' /DietPi/config.txt fi #------------------------------------------------------------------------------- #RPi new installs - if [ ! -f /DietPi/dietpi/.installed ] && (( $HW_MODEL < 10 )); then + if [ ! -f /DietPi/dietpi/.installed ] && (( $G_HW_MODEL < 10 )); then # - RPi-update backup left on image, remove rm -R /boot.bak &> /dev/null @@ -1577,7 +1577,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #Scroll lock fix for RPi by Midwan: https://github.com/Fourdee/DietPi/issues/474#issuecomment-243215674 - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then cat << _EOF_ > /etc/udev/rules.d/50-leds.rules ACTION=="add", SUBSYSTEM=="leds", ENV{DEVPATH}=="*/input*::scrolllock", ATTR{trigger}="kbd-scrollock" @@ -1598,21 +1598,21 @@ _EOF_ #------------------------------------------------------------------------------- #C2 v130 image: apt-get update prior to this script has no effect. No apt-cache: https://github.com/Fourdee/DietPi/issues/508#issuecomment-246196842 #NB: Regardless, run for all devices. - AGUP + G_AGUP #C2: apt-get upgrade 'uboot' package update without 'linux-image' at the same time = failed boot. #NB: Apply to odroids as we also hold kernel packages for XU4. - if (( $HW_MODEL >= 10 && $HW_MODEL < 20 )); then + if (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )); then apt-mark unhold linux-* - AGDUG + G_AGDUG fi #------------------------------------------------------------------------------- #Auto mount USB drive by default https://github.com/Fourdee/DietPi/issues/501 # - All excluding VM images - if (( $HW_MODEL != 20 )); then + if (( $G_HW_MODEL != 20 )); then cp /etc/fstab /etc/fstab.v130 @@ -1642,7 +1642,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #add HFS+ FS support for all DietPi systems by default: https://github.com/Fourdee/DietPi/issues/271#issuecomment-245651818 - AGI hfsplus #hfsprogs is for format capabilities + G_AGI hfsplus #hfsprogs is for format capabilities #------------------------------------------------------------------------------- #NFS: https://github.com/Fourdee/DietPi/issues/246 mkdir -p /mnt/nfs_client @@ -1705,7 +1705,7 @@ _EOF_ elif (( $VERSION_CURRENT == 131 )); then #------------------------------------------------------------------------------- #Install p7zip by default on all DietPi systems - AGI p7zip-full + G_AGI p7zip-full #------------------------------------------------------------------------------- elif (( $VERSION_CURRENT == 132 )); then @@ -1747,7 +1747,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #FriendlyARM images, remove custom services: - if (( $HW_MODEL == 61 || $HW_MODEL == 62 )); then + if (( $G_HW_MODEL == 61 || $G_HW_MODEL == 62 )); then rm /lib/systemd/system/lcd4linux.service rm /lib/systemd/system/hwservice.service @@ -1757,13 +1757,13 @@ _EOF_ fi #------------------------------------------------------------------------------- #ethtool: - AGI ethtool + G_AGI ethtool #------------------------------------------------------------------------------- elif (( $VERSION_CURRENT == 133 )); then #------------------------------------------------------------------------------- #NanoPi T2 bluetooth + patch by AWL29: http://dietpi.com/phpbb/viewtopic.php?f=12&t=622&start=40#p3280 - if (( $HW_MODEL == 61 )); then + if (( $G_HW_MODEL == 61 )); then BT_USER_ENABLED=0 if (( $(lsmod | grep -ci -m1 '^bluetooth') )); then @@ -1782,14 +1782,14 @@ _EOF_ # - BT modules must be enabled before installation. Else, apt-get install will fail on bluetooth package init. /DietPi/dietpi/func/dietpi-set_hardware bluetooth enable # will fail on bluetooth service start. Expected, as not installed yet. - dietpi-notify 2 "If the above returns an error, it can safely be ignored as BT isnt installed yet." + G_DIETPI-NOTIFY 2 "If the above returns an error, it can safely be ignored as BT isnt installed yet." - AGI bluetooth + G_AGI bluetooth # - Disable BT modules, if the user had it disabled before hand: if (( ! $BT_USER_ENABLED )); then - dietpi-notify 2 "BT was in a disabled state previously, setting back to disabled." + G_DIETPI-NOTIFY 2 "BT was in a disabled state previously, setting back to disabled." /DietPi/dietpi/func/dietpi-set_hardware bluetooth disable fi @@ -1894,7 +1894,7 @@ _EOF_ while [ ! -f /DietPi/.ramdisk ] do - dietpi-notify 2 "Waiting for DietPi-RAMDISK to finish mounting DietPi to RAM..." + G_DIETPI-NOTIFY 2 "Waiting for DietPi-RAMDISK to finish mounting DietPi to RAM..." sleep 1 done @@ -2091,28 +2091,28 @@ _EOF_ #------------------------------------------------------------------------------- #C2 libc6 u7 breaking most installations, replace with u6: https://github.com/Fourdee/DietPi/issues/653 # https://github.com/Fourdee/DietPi/issues/663#issuecomment-269867184 - if (( $HW_MODEL == 12 )); then + if (( $G_HW_MODEL == 12 )); then wget http://ftp.us.debian.org/debian/pool/main/g/glibc/libc6_2.19-18+deb8u6_arm64.deb -O package.deb dpkg -i package.deb rm package.deb # - Just incase u6 is outdated by the time this patch is run, lets also update and upgrade apt: - AGUP - AGDUG + G_AGUP + G_AGDUG fi #------------------------------------------------------------------------------- #Stretch, disable automatic updates and management of apt cache. Prevents unexpected lock on Apt cache and therefore failed apt installations. # Very similar to a system DietPi had a while back that background threaded weekly apt-get updates, was removed as repo files change and without apt-get update prior to install, chance of package no longer existing (eg: package-1.2.3 changes to package-1.2.4), unless the apt list was also updated. - if (( $DISTRO == 4 )); then + if (( $G_DISTRO == 4 )); then systemctl mask apt-daily.service fi #------------------------------------------------------------------------------- #Apt-transport install by default on all systems: - AGI apt-transport-https + G_AGI apt-transport-https #------------------------------------------------------------------------------- elif (( $VERSION_CURRENT == 141 )); then @@ -2136,9 +2136,9 @@ _EOF_ fi #------------------------------------------------------------------------------- #RPi 3 Bluetooth packages missing: https://github.com/Fourdee/DietPi/issues/693 - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then - AGI --reinstall pi-bluetooth + G_AGI --reinstall pi-bluetooth # - Check if previously disabled, and reapply if [ -f /etc/modprobe.d/disable_bt.conf ]; then @@ -2150,16 +2150,16 @@ _EOF_ fi #------------------------------------------------------------------------------- #Stretch RPi WiFi fix + firmware: https://github.com/Fourdee/DietPi/issues/475#issuecomment-270696515 - if (( $DISTRO == 4 && $HW_MODEL < 10 )); then + if (( $G_DISTRO == 4 && $G_HW_MODEL < 10 )); then - AGDUG + G_AGDUG wget https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/master/brcm80211/brcm/brcmfmac43430-sdio.txt -O /lib/firmware/brcm/brcmfmac43430-sdio.txt fi #------------------------------------------------------------------------------- #Sparky SBC fixes: # Additional blacklist to disable touch screen, and dmesg errors associated with it: https://github.com/Fourdee/DietPi/issues/699#issuecomment-271362441 - if (( $HW_MODEL == 70 )); then + if (( $G_HW_MODEL == 70 )); then cat << _EOF_ > /etc/modprobe.d/disable_sparkysbc_touchscreen.conf blacklist ctp_gsl3680 @@ -2175,9 +2175,9 @@ _EOF_ fi #------------------------------------------------------------------------------- #RPi, install common rpi specific binaries by default (eg: raspistill) - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then - AGI --reinstall libraspberrypi-bin + G_AGI --reinstall libraspberrypi-bin fi #------------------------------------------------------------------------------- @@ -2203,7 +2203,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #Remove Meveric's CPU governor scripts, all Odroid images - if (( $HW_MODEL >= 10 && $HW_MODEL < 20 )); then + if (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )); then systemctl disable cpu_governor &> /dev/null rm /etc/init.d/cpu_governor &> /dev/null @@ -2233,7 +2233,7 @@ _EOF_ rm /etc/init.d/firstrun &> /dev/null #------------------------------------------------------------------------------- #Pine A64, fb cursor: https://github.com/Fourdee/DietPi/issues/596#issuecomment-274328262 - if (( $HW_MODEL >= 40 && $HW_MODEL <= 42 )); then + if (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then cat << _EOF_ >> "$HOME"/.bashrc infocmp > terminfo.txt @@ -2301,7 +2301,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #Sparky SBC kernel upgrade from Allo, improve USB DAC support: - if (( $HW_MODEL == 70 )); then + if (( $G_HW_MODEL == 70 )); then /DietPi/dietpi/func/dietpi-set_hardware kernel sparky_sbc @@ -2316,7 +2316,7 @@ _EOF_ elif (( $VERSION_CURRENT == 144 )); then #------------------------------------------------------------------------------- #Use our new EU mirror for mdrjr repo (Meveric's packages): - if (( $HW_MODEL >= 10 && $HW_MODEL < 20 )); then + if (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )); then sed -i 's@http://oph.mdrjr.net/meveric@http://fuzon.co.uk/meveric@' /etc/apt/sources.list.d/* @@ -2402,7 +2402,7 @@ _EOF_ /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 + if (( $G_HW_MODEL < 10 )); then if (( ! $(cat /DietPi/config.txt | grep -ci -m1 'display_rotate=') )); then @@ -2428,7 +2428,7 @@ _EOF_ killall -w uae4arm-rpi mv /etc/uae4arm-rpi /etc/amiberry - mv "$FP_DIETPI_USERDATA"/uae4arm-rpi "$FP_DIETPI_USERDATA"/amiberry + mv "$G_FP_DIETPI_USERDATA"/uae4arm-rpi "$G_FP_DIETPI_USERDATA"/amiberry systemctl disable uae4arm-rpi.service rm /etc/systemd/system/uae4arm-rpi.service systemctl daemon-reload @@ -2440,7 +2440,7 @@ _EOF_ #Reinstalls (RPI) # FFmpeg RPi (OpenMAX HW enc): https://github.com/Fourdee/DietPi/issues/869 # AmiBerry (Name change): https://github.com/Fourdee/DietPi/issues/850 - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then /DietPi/dietpi/dietpi-software reinstall 7 108 @@ -2456,7 +2456,7 @@ _EOF_ rm /etc/profile.d/check_first_login_reboot.sh &> /dev/null #------------------------------------------------------------------------------- #XU4 kernel 4.9 prep: https://github.com/Fourdee/DietPi/issues/899 - if (( $HW_MODEL == 11 && $(uname -r | grep -ci -m1 '^3.' ) )); then + if (( $G_HW_MODEL == 11 && $(uname -r | grep -ci -m1 '^3.' ) )); then # - Replace /dev/mmcblk0p* in /etc/fstab + boot.ini with UUID as required by 4.9 kernel+uboot # MMC0p1 @@ -2517,7 +2517,7 @@ _EOF_ systemctl daemon-reload #------------------------------------------------------------------------------- #NanoPi M3 update DietPi kernel: https://github.com/Fourdee/DietPi/issues/763 + https://github.com/Fourdee/DietPi/issues/920 - if (( $HW_MODEL == 62 )); then + if (( $G_HW_MODEL == 62 )); then /DietPi/dietpi/func/dietpi-set_hardware kernel nanopim3 @@ -2528,7 +2528,7 @@ _EOF_ #------------------------------------------------------------------------------- #Fix for VM fstab: https://github.com/Fourdee/DietPi/issues/960 # Removal of quotations in UUID entry - if (( $HW_MODEL == 20 )); then + if (( $G_HW_MODEL == 20 )); then sed -i 's#"044766be-96ca-491a-a93f-913b75a843bd"#044766be-96ca-491a-a93f-913b75a843bd#g' /etc/fstab systemctl daemon-reload @@ -2563,12 +2563,12 @@ _EOF_ systemctl mask apt-daily-upgrade.timer &> /dev/null #------------------------------------------------------------------------------- #Odroid C2 Stretch, missing gnupg, install on all systems by default: https://github.com/Fourdee/DietPi/issues/1032 - AGI gnupg + G_AGI gnupg #------------------------------------------------------------------------------- #Firmware for Native PC: https://github.com/Fourdee/DietPi/issues/1007#issuecomment-312442384 - if (( $HW_MODEL == 21 )); then + if (( $G_HW_MODEL == 21 )); then - AGI firmware-linux-nonfree + G_AGI firmware-linux-nonfree cp /boot/dietpi/conf/htoprc /root/.config/htop/htoprc # Also missing our htop cfg fi @@ -2576,7 +2576,7 @@ _EOF_ #Sparky kernel update: # v151 | Updated kernel.dtb for USB Bridge support # v153 | Updated driver for Piano DAC + (dual output modes) - if (( $HW_MODEL == 70 )); then + if (( $G_HW_MODEL == 70 )); then wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/usb-port1-enable/kernel.dtb -O /boot/kernel.dtb wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/piano-dac-plus-mono/snd-soc-allo-piano-dac-plus.ko -O /lib/modules/$(uname -r)/kernel/sound/soc/atc260x/snd-soc-allo-piano-dac-plus.ko @@ -2608,20 +2608,20 @@ _EOF_ fi #------------------------------------------------------------------------------- # Purge unnecessary pciutils package: https://github.com/Fourdee/DietPi/issues/1068 - AGP pciutils + G_AGP pciutils #------------------------------------------------------------------------------- # RPi Stretch: Switch to new stretch repo on archive.raspberrypi.org: https://github.com/Fourdee/DietPi/issues/1077 - if (( $HW_MODEL < 10 && $DISTRO == 4 )); then # RPi + Stretch + if (( $G_HW_MODEL < 10 && $G_DISTRO == 4 )); then # RPi + Stretch echo "deb https://archive.raspberrypi.org/debian/ stretch main ui" > /etc/apt/sources.list.d/raspi.list - AGUP - AGDUG + G_AGUP + G_AGDUG fi #------------------------------------------------------------------------------- #Native PC, add i386 support by default - if (( $HW_MODEL == 21 )); then + if (( $G_HW_MODEL == 21 )); then dpkg --add-architecture i386 - AGUP + G_AGUP fi #------------------------------------------------------------------------------- @@ -2667,7 +2667,7 @@ _EOF_ elif (( $VERSION_CURRENT == 155 )); then #------------------------------------------------------------------------------- #Sparky kernel update to resolve slow playback under 16bit: https://community.roonlabs.com/t/allo-usbridge-board/27487/148 - if (( $HW_MODEL == 70 )); then + if (( $G_HW_MODEL == 70 )); then /DietPi/dietpi/func/dietpi-set_hardware kernel sparky_sbc @@ -2711,8 +2711,8 @@ _EOF_ 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 "$FP_DIETPI_USERDATA"/roon/RoonBridge/Settings/unique_id - rm "$FP_DIETPI_USERDATA"/roon/RAATServer/Settings/unique_id + rm "$G_FP_DIETPI_USERDATA"/roon/RoonBridge/Settings/unique_id + rm "$G_FP_DIETPI_USERDATA"/roon/RAATServer/Settings/unique_id fi #------------------------------------------------------------------------------- @@ -2747,7 +2747,7 @@ _EOF_ elif (( $VERSION_CURRENT == 158 )); then #------------------------------------------------------------------------------- #RPi update DietPi kernel: - if (( $HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then # - remove old flags rm /etc/dietpi/.dietpi_rpi &> /dev/null @@ -2766,7 +2766,7 @@ _EOF_ #------------------------------------------------------------------------------- #x86_64, blacklist by nouveau default, prefer Nvidia driver installer # Disable nouveau: https://github.com/Fourdee/DietPi/issues/1244 // http://dietpi.com/phpbb/viewtopic.php?f=11&t=2462&p=9688#p9688 - if (( $HW_ARCH == 10 )); then + if (( $G_HW_ARCH == 10 )); then cat << _EOF_ > /etc/modprobe.d/blacklist-nouveau.conf blacklist nouveau @@ -2839,7 +2839,7 @@ _EOF_ fi if grep -q '^\s*PrivateTmp=true' $PHP_SERVICE &> /dev/null; then - if (( $DISTRO >= 4 )); then + if (( $G_DISTRO >= 4 )); then DIETPI_PHP_INI="/etc/php/7.0/mods-available/dietpi.ini" PHP_BIN="php" @@ -2858,7 +2858,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #XU4 FFMPEG fix. Prefer debian.org over Meveric for backports: https://github.com/Fourdee/DietPi/issues/1273 - if (( $HW_MODEL == 11 && $DISTRO == 3 )); then + if (( $G_HW_MODEL == 11 && $G_DISTRO == 3 )); then cat << _EOF_ > /etc/apt/preferences.d/backports Package: * @@ -2886,7 +2886,7 @@ _EOF_ /DietPi/dietpi/func/dietpi-set_software verify_dietpi.txt #------------------------------------------------------------------------------- #Sparky SBC patches - if (( $HW_MODEL == 70 )); then + if (( $G_HW_MODEL == 70 )); then # Updated kernel which resolves HQplayer playback issues. wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dragon_fly_check/uImage -O /boot/uImage @@ -2909,7 +2909,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #@MichaIng Move Stretch instances from MySQL to MariaDB: https://github.com/Fourdee/DietPi/pull/1280 - if grep -q 'aSOFTWARE_INSTALL_STATE\[86\]=2' /DietPi/dietpi/.installed && (( $DISTRO > 3 )); then + if grep -q 'aSOFTWARE_INSTALL_STATE\[86\]=2' /DietPi/dietpi/.installed && (( $G_DISTRO > 3 )); then apt -y install mariadb-server apt -y purge mysql-server default-mysql-server From 8fbe9c32283f88d3d4191d6d6619fe8f7354292f Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 20 Dec 2017 09:16:06 +0000 Subject: [PATCH 099/390] v160 + correction: https://github.com/Fourdee/DietPi/issues/1311 --- dietpi/dietpi-software | 592 ++++++++++++++++++++--------------------- 1 file changed, 296 insertions(+), 296 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 7d68ed7795..7d3eb0edcf 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3348,7 +3348,7 @@ _EOF_ } #apt-get install - G_AGI_ERROR_CHECKED(){ + AGI_ERROR_CHECKED(){ local string="$@" @@ -3362,7 +3362,7 @@ _EOF_ } #apt-get purge - G_AGP_ERROR_CHECKED(){ + AGP_ERROR_CHECKED(){ local string="$@" G_AGP $string @@ -3375,7 +3375,7 @@ _EOF_ } #apt-get install -f - G_AGF_ERROR_CHECKED(){ + AGF_ERROR_CHECKED(){ G_AGF if (( $? != 0 )); then @@ -3507,7 +3507,7 @@ _EOF_ # if (( $? == 0 )); then # # #Install Python and PIP - # G_AGI_ERROR_CHECKED python python-pip python-imaging + # AGI_ERROR_CHECKED python python-pip python-imaging # # cd "$HOME" # git clone --depth=1 "$INSTALL_URL_ADDRESS" @@ -3541,7 +3541,7 @@ _EOF_ if (( $? == 0 )); then - G_AGI_ERROR_CHECKED lxde upower policykit-1 iceweasel p7zip-full --no-install-recommends + AGI_ERROR_CHECKED lxde upower policykit-1 iceweasel p7zip-full --no-install-recommends #upower policykit-1. Needed for LXDE logout menu item to show shutdown/restart ...... else @@ -3565,7 +3565,7 @@ _EOF_ if (( $? == 0 )); then - G_AGI_ERROR_CHECKED mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full --no-install-recommends + AGI_ERROR_CHECKED mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full --no-install-recommends else @@ -3588,7 +3588,7 @@ _EOF_ if (( $? == 0 )); then - G_AGI_ERROR_CHECKED x-window-system-core wmaker gnustep gnustep-devel gnustep-games libc-dbg upower policykit-1 iceweasel p7zip-full --no-install-recommends + AGI_ERROR_CHECKED x-window-system-core wmaker gnustep gnustep-devel gnustep-games libc-dbg upower policykit-1 iceweasel p7zip-full --no-install-recommends else @@ -3611,7 +3611,7 @@ _EOF_ if (( $? == 0 )); then - G_AGI_ERROR_CHECKED xfce4 xfce4-terminal gnome-icon-theme tango-icon-theme iceweasel p7zip-full --no-install-recommends + AGI_ERROR_CHECKED xfce4 xfce4-terminal gnome-icon-theme tango-icon-theme iceweasel p7zip-full --no-install-recommends else @@ -3627,7 +3627,7 @@ _EOF_ Banner_Installing - G_AGI_ERROR_CHECKED xrdp + AGI_ERROR_CHECKED xrdp fi @@ -3677,7 +3677,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED transmission-daemon + AGI_ERROR_CHECKED transmission-daemon fi @@ -3688,7 +3688,7 @@ _EOF_ Banner_Installing echo -e "proftpd-basic shared/proftpd/inetd_or_standalone select standalone" | debconf-set-selections - G_AGI_ERROR_CHECKED proftpd-basic + AGI_ERROR_CHECKED proftpd-basic fi @@ -3697,7 +3697,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED samba samba-common-bin --no-install-recommends + AGI_ERROR_CHECKED samba samba-common-bin --no-install-recommends fi @@ -3707,7 +3707,7 @@ _EOF_ Banner_Installing - G_AGI_ERROR_CHECKED vsftpd --no-install-recommends + AGI_ERROR_CHECKED vsftpd --no-install-recommends fi @@ -3717,7 +3717,7 @@ _EOF_ Banner_Installing - G_AGI_ERROR_CHECKED nfs-kernel-server nfs-common ucf rpcbind + AGI_ERROR_CHECKED nfs-kernel-server nfs-common ucf rpcbind fi @@ -3726,7 +3726,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED apache2 + AGI_ERROR_CHECKED apache2 fi @@ -3735,7 +3735,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED nginx xml-core --no-install-recommends + AGI_ERROR_CHECKED nginx xml-core --no-install-recommends fi @@ -3744,7 +3744,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED lighttpd + AGI_ERROR_CHECKED lighttpd fi @@ -3757,7 +3757,7 @@ _EOF_ debconf-set-selections <<< "mysql-server mysql-server/root_password password $GLOBAL_PW" debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $GLOBAL_PW" - G_AGI_ERROR_CHECKED mysql-server + AGI_ERROR_CHECKED mysql-server # Fix depricated key_buffer -> key_buffer_size per MySQL 5.x notification sed -i 's/^key_buffer[[:space:]]/key_buffer_size /g' /etc/mysql/my.cnf @@ -3773,7 +3773,7 @@ _EOF_ Banner_Installing - G_AGI_ERROR_CHECKED mariadb-server + AGI_ERROR_CHECKED mariadb-server fi @@ -3782,7 +3782,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED sqlite3 + AGI_ERROR_CHECKED sqlite3 fi @@ -3791,11 +3791,11 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED redis-server + AGI_ERROR_CHECKED redis-server #Redis php module | == 2 to check for existing installs, if == 1, then module will be installed together with PHP, to prevent dependency installations if (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )); then - G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-redis + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-redis fi @@ -3810,30 +3810,30 @@ _EOF_ #Install base PHP packages/modules. if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then - G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME" libapache2-mod-"$PHP_APT_PACKAGE_NAME" + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME" libapache2-mod-"$PHP_APT_PACKAGE_NAME" else - G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-fpm "$PHP_APT_PACKAGE_NAME"-cgi + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-fpm "$PHP_APT_PACKAGE_NAME"-cgi # 'php-xsl' does not exist for >= Stretch, 'php7.0-xsl' is just dummy for 'php7.0-xml': https://github.com/Fourdee/DietPi/issues/1286 - (( $G_DISTRO < 4 )) && G_AGI_ERROR_CHECKED php5-xsl + (( $G_DISTRO < 4 )) && AGI_ERROR_CHECKED php5-xsl fi #php-common modules, used by most web software - G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-curl "$PHP_APT_PACKAGE_NAME"-gd "$PHP_APT_PACKAGE_NAME"-apcu "$PHP_APT_PACKAGE_NAME"-mcrypt + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-curl "$PHP_APT_PACKAGE_NAME"-gd "$PHP_APT_PACKAGE_NAME"-apcu "$PHP_APT_PACKAGE_NAME"-mcrypt # + stretch extras if (( $G_DISTRO >= 4 )); then - G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mbstring "$PHP_APT_PACKAGE_NAME"-zip "$PHP_APT_PACKAGE_NAME"-xml + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mbstring "$PHP_APT_PACKAGE_NAME"-zip "$PHP_APT_PACKAGE_NAME"-xml fi #php-SQL modules if (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 )); then - G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mysql + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mysql fi @@ -3841,11 +3841,11 @@ _EOF_ if (( $G_DISTRO < 4 )); then #For <= Jessie, php5-mysqlnd provides the newer mysql client libraries compared to php5-mysql. - G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mysqlnd + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mysqlnd else #For >= Stretch, php(7.X)-mysqlnd does not exist, thus php-mysql need to be installed: https://packages.debian.org/de/stretch/php-mysql - G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mysql + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mysql fi @@ -3853,14 +3853,14 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[87]} >= 1 )); then - G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-sqlite* #wildcard for version (eg:3) + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-sqlite* #wildcard for version (eg:3) fi #Redis php module if (( ${aSOFTWARE_INSTALL_STATE[91]} >= 1 )); then - G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-redis + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-redis fi @@ -3895,7 +3895,7 @@ _EOF_ fi - G_AGI_ERROR_CHECKED phpmyadmin + AGI_ERROR_CHECKED phpmyadmin fi @@ -3916,8 +3916,8 @@ _EOF_ if (( $? == 0 )); then #libupnp6 for net discov with upnp/avahi - G_AGI_ERROR_CHECKED libupnp6 - G_AGI_ERROR_CHECKED libmpdclient2 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file --no-install-recommends + AGI_ERROR_CHECKED libupnp6 + AGI_ERROR_CHECKED libmpdclient2 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file --no-install-recommends wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb @@ -3931,7 +3931,7 @@ _EOF_ else - G_AGI_ERROR_CHECKED mpd + AGI_ERROR_CHECKED mpd fi @@ -3968,7 +3968,7 @@ _EOF_ if (( $? == 0 )); then #Prereqs - G_AGI_ERROR_CHECKED libmpdclient2 libflac8 libyajl2 libavahi-client3 libvorbisfile3 libwavpack1 libmad0 libmpg123-0 libopus0 libavformat57 libfaad2 libcdio-paranoia1 libiso9660-8 libshout3 libid3tag0 + AGI_ERROR_CHECKED libmpdclient2 libflac8 libyajl2 libavahi-client3 libvorbisfile3 libwavpack1 libmad0 libmpg123-0 libopus0 libavformat57 libfaad2 libcdio-paranoia1 libiso9660-8 libshout3 libid3tag0 apt-mark unhold mpd &> /dev/null #??? Not required for dpkg -i installs @@ -4024,10 +4024,10 @@ _EOF_ if (( $? == 0 )); then - G_AGI_ERROR_CHECKED libsodium-dev automake autoconf pkg-config libtool libssl-dev libffi-dev python-dev openssl libzmq3-dev + AGI_ERROR_CHECKED libsodium-dev automake autoconf pkg-config libtool libssl-dev libffi-dev python-dev openssl libzmq3-dev #Not required. - #G_AGI_ERROR_CHECKED software-properties-common + #AGI_ERROR_CHECKED software-properties-common #add-apt-repository -y ppa:chris-lea/libsodium #G_AGUP @@ -4109,7 +4109,7 @@ _EOF_ if (( $? == 0 )); then # Install necessary PHP modules: https://doc.owncloud.org/server/latest/admin_manual/installation/source_installation.html#php-extensions - G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis if [ ! -f /etc/apt/sources.list.d/owncloud.list ] && [ ! -f /var/www/owncloud/occ ]; then @@ -4128,7 +4128,7 @@ _EOF_ fi - [ -f /etc/apt/sources.list.d/owncloud.list ] && G_AGI_ERROR_CHECKED owncloud-files + [ -f /etc/apt/sources.list.d/owncloud.list ] && AGI_ERROR_CHECKED owncloud-files else @@ -4151,7 +4151,7 @@ _EOF_ if (( $? == 0 )); then # Install necessary PHP modules: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis if [ ! -f /var/www/nextcloud/occ ]; then @@ -4298,7 +4298,7 @@ _EOF_ if (( $? == 0 )); then - G_AGI_ERROR_CHECKED libpulse0 libfftw3-3 + AGI_ERROR_CHECKED libpulse0 libfftw3-3 wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb @@ -4331,14 +4331,14 @@ _EOF_ wget https://apt.mopidy.com/jessie.list -O /etc/apt/sources.list.d/mopidy.list G_AGUP - G_AGI_ERROR_CHECKED mopidy + AGI_ERROR_CHECKED mopidy #ARMv8 #NB: No ARM64 packages currently exist in mopidy repo. So it will throw a minor error when updating apt. #Mopidy web client extensions not loading in webpage... # if (( $G_HW_ARCH == 3 )); then - # G_AGI_ERROR_CHECKED build-essential python-dev + # AGI_ERROR_CHECKED build-essential python-dev # pip install mopidy #no effect, claims already upto date. # fi @@ -4362,29 +4362,29 @@ _EOF_ #Odroids if (( $G_HW_MODEL >= 10 )) && (( $G_HW_MODEL < 20 )); then - G_AGI_ERROR_CHECKED kodi-odroid + AGI_ERROR_CHECKED kodi-odroid #XU4 - requires pulse audio (fixes corrupt sound) if (( $G_HW_MODEL == 11 )); then - G_AGI_ERROR_CHECKED pulseaudio --no-install-recommends + AGI_ERROR_CHECKED pulseaudio --no-install-recommends fi #Everything else else - G_AGI_ERROR_CHECKED kodi + AGI_ERROR_CHECKED kodi fi # - libcurl3-gnutls required for C2. But lets apply to all: https://github.com/Fourdee/DietPi/issues/446 - G_AGI_ERROR_CHECKED libcurl3-gnutls + AGI_ERROR_CHECKED libcurl3-gnutls # - Add NFS support for kodi if (( $G_DISTRO == 3 )); then - G_AGI_ERROR_CHECKED libnfs4 + AGI_ERROR_CHECKED libnfs4 fi @@ -4410,7 +4410,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED minidlna + AGI_ERROR_CHECKED minidlna fi @@ -4468,12 +4468,12 @@ _EOF_ #Install if (( $? == 0 )); then - G_AGI_ERROR_CHECKED alsa-oss joystick libsdl-image1.2 libsdl-ttf2.0-0 libsdl-gfx1.2-5 libguichan-0.8.1-1* libguichan-allegro-0.8.1-1* libguichan-sdl-0.8.1-1* libguichan-opengl-0.8.1-1* libjpgalleg4.4 libxml2 libmpg123-0 + AGI_ERROR_CHECKED alsa-oss joystick libsdl-image1.2 libsdl-ttf2.0-0 libsdl-gfx1.2-5 libguichan-0.8.1-1* libguichan-allegro-0.8.1-1* libguichan-sdl-0.8.1-1* libguichan-opengl-0.8.1-1* libjpgalleg4.4 libxml2 libmpg123-0 #libmpeg2-4 # Required for dev branch # + SDL2 - G_AGI_ERROR_CHECKED libpng12-0 libflac8 libmpg123-0 libgoogle-perftools4 libfreetype6 libxxf86vm1 + AGI_ERROR_CHECKED libpng12-0 libflac8 libmpg123-0 libgoogle-perftools4 libfreetype6 libxxf86vm1 #Download binaries # - Backup existing autostart.uae for user @@ -4503,7 +4503,7 @@ _EOF_ #Install if (( $? == 0 )); then - G_AGI_ERROR_CHECKED libsdl-mixer1.2 libsdl1.2debian libphysfs1 + AGI_ERROR_CHECKED libsdl-mixer1.2 libsdl1.2debian libphysfs1 wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z -o"$G_FP_DIETPI_USERDATA" @@ -4547,7 +4547,7 @@ _EOF_ #ARMv8 source build if (( $G_HW_ARCH == 3 )); then - G_AGI_ERROR_CHECKED build-essential zlib1g-dev libcurl4-openssl-dev libcrypto++-dev sqlite3 + AGI_ERROR_CHECKED build-essential zlib1g-dev libcurl4-openssl-dev libcrypto++-dev sqlite3 wget "$INSTALL_URL_ADDRESS" -O package.tar tar xzvf package.tar @@ -4602,7 +4602,7 @@ _EOF_ #Install if (( $? == 0 )); then - G_AGI_ERROR_CHECKED ibsdl1.2debian libsdl-net1.2 --no-install-recommends + AGI_ERROR_CHECKED ibsdl1.2debian libsdl-net1.2 --no-install-recommends #Download binaries wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -4631,7 +4631,7 @@ _EOF_ if (( $? == 0 )); then #Install pre-reqs - G_AGI_ERROR_CHECKED gpac motion + AGI_ERROR_CHECKED gpac motion #Get source/binaries and extract wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -4680,7 +4680,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED deluged deluge-web deluge-webui deluge-console + AGI_ERROR_CHECKED deluged deluge-web deluge-webui deluge-console fi @@ -4690,7 +4690,7 @@ _EOF_ Banner_Installing - G_AGI_ERROR_CHECKED python + AGI_ERROR_CHECKED python #Download Grasshopper local grasshopper_directory='/var/www' @@ -4753,7 +4753,7 @@ _EOF_ wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb - G_AGF_ERROR_CHECKED + AGF_ERROR_CHECKED rm package.deb @@ -4778,13 +4778,13 @@ _EOF_ echo -e "deb $INSTALL_URL_ADDRESS erasmus main" > /etc/apt/sources.list.d/openmediavault.list G_AGUP - G_AGI_ERROR_CHECKED openmediavault-keyring + AGI_ERROR_CHECKED openmediavault-keyring debconf-set-selections <<< "openmediavault openmediavault/run-initsystem note" debconf-set-selections <<< "postfix postfix/main_mailer_type select No configuration" G_AGUP - G_AGI_ERROR_CHECKED openmediavault postfix + AGI_ERROR_CHECKED openmediavault postfix else @@ -4825,7 +4825,7 @@ _EOF_ Banner_Installing - G_AGI_ERROR_CHECKED darkice icecast2 + AGI_ERROR_CHECKED darkice icecast2 fi @@ -4866,7 +4866,7 @@ _EOF_ if (( $? == 0 )); then # - Pre-reqs: https://github.com/Fourdee/DietPi/issues/1282#issuecomment-350490524 - G_AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-cgi "$PHP_APT_PACKAGE_NAME"-sqlite* + AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-cgi "$PHP_APT_PACKAGE_NAME"-sqlite* # - Check free available memory. Increase swapfile size to prevent gravity running out of mem. if (( $(free -m | grep -m1 'Mem:' | awk '{print $4}') < 512 )); then @@ -4916,7 +4916,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - #G_AGI_ERROR_CHECKED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 + #AGI_ERROR_CHECKED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 #Install SubSonic 5.3 wget "$INSTALL_URL_ADDRESS" -O package.deb @@ -4941,7 +4941,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - #G_AGI_ERROR_CHECKED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 + #AGI_ERROR_CHECKED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 #Install SubSonic 6.0 wget "$INSTALL_URL_ADDRESS" -O package.deb @@ -4995,12 +4995,12 @@ _EOF_ # >= v111 image if [ -f /etc/.dietpi_image_version ]; then - G_AGI_ERROR_CHECKED python-rpi.gpio python3-rpi.gpio + AGI_ERROR_CHECKED python-rpi.gpio python3-rpi.gpio # - < v111 Bug in older DietPi images with sources.list | Use pip, as offical repo = python3-rpi.gpio: Depends: python3 (< 3.3) but 3.4.2-2 is to be installed else - G_AGI_ERROR_CHECKED python3-pip + AGI_ERROR_CHECKED python3-pip pip3 install RPi.GPIO fi @@ -5088,12 +5088,12 @@ _EOF_ Banner_Installing - G_AGI_ERROR_CHECKED python python3 + AGI_ERROR_CHECKED python python3 # - RPi, pre-reqs GPIO control for Node-Red if (( $G_HW_MODEL < 10 )); then - G_AGI_ERROR_CHECKED python-rpi.gpio + AGI_ERROR_CHECKED python-rpi.gpio fi @@ -5203,7 +5203,7 @@ _EOF_ G_AGUP - G_AGI_ERROR_CHECKED mosquitto + AGI_ERROR_CHECKED mosquitto else @@ -5231,7 +5231,7 @@ _EOF_ wget "$INSTALL_URL_ADDRESS" -O /etc/blynkserver/server.jar # - Install Blynk JS Libary - G_AGI_ERROR_CHECKED python + AGI_ERROR_CHECKED python npm install -g onoff npm install -g blynk-library @@ -5289,12 +5289,12 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then # - Prereqs - G_AGI_ERROR_CHECKED libasound2 + AGI_ERROR_CHECKED libasound2 # - Stretch, install additional packages if (( $G_DISTRO >= 4 )); then - G_AGI_ERROR_CHECKED gcc-6-base libstdc++6 + AGI_ERROR_CHECKED gcc-6-base libstdc++6 fi @@ -5322,7 +5322,7 @@ _EOF_ Banner_Installing - G_AGI_ERROR_CHECKED tomcat8 + AGI_ERROR_CHECKED tomcat8 fi @@ -5337,7 +5337,7 @@ _EOF_ if (( $? == 0 )); then #Python dev, pre-reqs - G_AGI_ERROR_CHECKED python-dev python-setuptools --no-install-recommends + AGI_ERROR_CHECKED python-dev python-setuptools --no-install-recommends #Install WEBIOPI wget "$INSTALL_URL_ADDRESS" -O package.tar @@ -5403,7 +5403,7 @@ _EOF_ cd haproxy-* #Pre-reqs - G_AGI_ERROR_CHECKED libpcre3-dev libssl-dev + AGI_ERROR_CHECKED libpcre3-dev libssl-dev #Compile and install make -j $G_HW_CPU_CORES TARGET=linux2628 CPU=generic USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 USE_LINUX_SPLICE=1 make install @@ -5446,7 +5446,7 @@ _EOF_ rm package.deb #https://github.com/Fourdee/DietPi/issues/736 - G_AGF_ERROR_CHECKED + AGF_ERROR_CHECKED #Stop service service logitechmediaserver stop @@ -5455,7 +5455,7 @@ _EOF_ # Compile pre-req CPAN modules??? # if (( $G_DISTRO >= 4 )); then - # G_AGI_ERROR_CHECKED yasm git build-essential automake cpanminus nasm libxml-parser-perl libexpat1-dev libgif-dev zlib1g-dev libjpeg-dev libpng-dev + # AGI_ERROR_CHECKED yasm git build-essential automake cpanminus nasm libxml-parser-perl libexpat1-dev libgif-dev zlib1g-dev libjpeg-dev libpng-dev # + ARMv6 cpan @@ -5468,8 +5468,8 @@ _EOF_ # + ARM64 cpan elif (( $G_HW_ARCH == 3 )); then - G_AGI_ERROR_CHECKED libxml-parser-perl - G_AGI_ERROR_CHECKED zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev # shared libs needed for Image::Scale@0.08 + AGI_ERROR_CHECKED libxml-parser-perl + AGI_ERROR_CHECKED zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev # shared libs needed for Image::Scale@0.08 wget http://dietpi.com/downloads/binaries/all/DietPi-LMS7.9-CPAN_arm64.zip -O package.zip unzip -o package.zip -d /usr/share/squeezeboxserver @@ -5516,7 +5516,7 @@ _EOF_ Banner_Installing - G_AGI_ERROR_CHECKED tightvncserver x11vnc --no-install-recommends + AGI_ERROR_CHECKED tightvncserver x11vnc --no-install-recommends fi @@ -5526,12 +5526,12 @@ _EOF_ Banner_Installing - G_AGI_ERROR_CHECKED vnc4server x11vnc --no-install-recommends + AGI_ERROR_CHECKED vnc4server x11vnc --no-install-recommends # - Stretch+ if (( $G_DISTRO >= 4 )); then - G_AGI_ERROR_CHECKED tigervnc-common + AGI_ERROR_CHECKED tigervnc-common fi @@ -5564,7 +5564,7 @@ _EOF_ # fi # - Available in Raspbian apt - G_AGI_ERROR_CHECKED realvnc-vnc-server + AGI_ERROR_CHECKED realvnc-vnc-server fi @@ -5576,7 +5576,7 @@ _EOF_ touch /var/log/auth.log #: https://github.com/Fourdee/DietPi/issues/475#issuecomment-310873879 - G_AGI_ERROR_CHECKED fail2ban --no-install-recommends + AGI_ERROR_CHECKED fail2ban --no-install-recommends fi @@ -5675,7 +5675,7 @@ _EOF_ Banner_Installing - G_AGI_ERROR_CHECKED openvpn easy-rsa iptables + AGI_ERROR_CHECKED openvpn easy-rsa iptables fi @@ -5692,7 +5692,7 @@ _EOF_ #Install if (( $? == 0 )); then - G_AGI_ERROR_CHECKED lsb-release + AGI_ERROR_CHECKED lsb-release # - Requires underpriv user: https://github.com/Fourdee/DietPi/issues/570#issuecomment-255588307 useradd pivpn @@ -5739,17 +5739,17 @@ _EOF_ if (( $G_DISTRO >= 4 )); then - G_AGI_ERROR_CHECKED certbot + AGI_ERROR_CHECKED certbot if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then - G_AGI_ERROR_CHECKED python-certbot-apache + AGI_ERROR_CHECKED python-certbot-apache fi if (( ${aSOFTWARE_INSTALL_STATE[85]} >= 1 )); then - G_AGI_ERROR_CHECKED python-certbot-nginx + AGI_ERROR_CHECKED python-certbot-nginx fi @@ -5801,7 +5801,7 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - G_AGI_ERROR_CHECKED hostapd isc-dhcp-server iptables libnl-3-200 + AGI_ERROR_CHECKED hostapd isc-dhcp-server iptables libnl-3-200 wget "$INSTALL_URL_ADDRESS" -O package.zip unzip -o package.zip @@ -5924,7 +5924,7 @@ _EOF_ Banner_Installing # - Prereqs - G_AGI_ERROR_CHECKED tor + AGI_ERROR_CHECKED tor fi @@ -5964,10 +5964,10 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - G_AGI_ERROR_CHECKED openssl libsoxr0 libavahi-client3 libtool libconfig9 libpopt0 libdaemon0 --no-install-recommends + AGI_ERROR_CHECKED openssl libsoxr0 libavahi-client3 libtool libconfig9 libpopt0 libdaemon0 --no-install-recommends # This occured on C2: shairport-sync : Depends: libpopt-dev but it is not installed - #G_AGI_ERROR_CHECKED libpopt-dev + #AGI_ERROR_CHECKED libpopt-dev wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z -o/ @@ -6034,7 +6034,7 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - G_AGI_ERROR_CHECKED brutefir + AGI_ERROR_CHECKED brutefir wget -r -nH --cut-dirs=2 --no-parent --reject="index.htm*" -e robots=off "$INSTALL_URL_ADDRESS" mv BruteFIR /etc/ @@ -6086,7 +6086,7 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - G_AGI_ERROR_CHECKED squeezelite + AGI_ERROR_CHECKED squeezelite # - Overwrite binary with latest version: wget "$INSTALL_URL_ADDRESS" -O package.7z @@ -6144,7 +6144,7 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - G_AGI_ERROR_CHECKED minicom python-serial python-configobj --no-install-recommends + AGI_ERROR_CHECKED minicom python-serial python-configobj --no-install-recommends pip install paho-mqtt pydispatcher wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -6230,7 +6230,7 @@ _EOF_ if (( $? == 0 )); then # - For compression - G_AGI_ERROR_CHECKED --no-install-recommends zlib1g-dev + AGI_ERROR_CHECKED --no-install-recommends zlib1g-dev wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb @@ -6276,7 +6276,7 @@ _EOF_ Banner_Installing - G_AGI_ERROR_CHECKED mumble-server + AGI_ERROR_CHECKED mumble-server fi @@ -6359,7 +6359,7 @@ _EOF_ fi - G_AGI_ERROR_CHECKED emby-server embymagick + AGI_ERROR_CHECKED emby-server embymagick else @@ -6413,12 +6413,12 @@ _EOF_ dpkg --add-architecture armhf G_AGUP - G_AGI_ERROR_CHECKED binutils:armhf plexmediaserver-installer:armhf + AGI_ERROR_CHECKED binutils:armhf plexmediaserver-installer:armhf #ARM32 else - G_AGI_ERROR_CHECKED plexmediaserver-installer + AGI_ERROR_CHECKED plexmediaserver-installer fi @@ -6486,7 +6486,7 @@ _EOF_ if (( $? == 0 )); then #prereqs - G_AGI_ERROR_CHECKED python python3 supervisor rdiff-backup screen rsync + AGI_ERROR_CHECKED python python3 supervisor rdiff-backup screen rsync mkdir -p "$G_FP_DIETPI_USERDATA"/mineos cd "$G_FP_DIETPI_USERDATA"/mineos @@ -6557,7 +6557,7 @@ _EOF_ Banner_Installing - G_AGI_ERROR_CHECKED qbittorrent-nox + AGI_ERROR_CHECKED qbittorrent-nox fi @@ -6573,16 +6573,16 @@ _EOF_ #Install if (( $? == 0 )); then - G_AGI_ERROR_CHECKED rtorrent screen #mediainfo + AGI_ERROR_CHECKED rtorrent screen #mediainfo #Raspbian unrar free if (( $G_HW_MODEL < 10 )); then - G_AGI_ERROR_CHECKED unrar-free #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 + AGI_ERROR_CHECKED unrar-free #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 else - G_AGI_ERROR_CHECKED unrar #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 + AGI_ERROR_CHECKED unrar #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 fi @@ -6611,7 +6611,7 @@ _EOF_ if (( $G_DISTRO >= 4 )); then - G_AGI_ERROR_CHECKED aria2 + AGI_ERROR_CHECKED aria2 else @@ -6644,7 +6644,7 @@ _EOF_ if (( $? == 0 )); then # - prereqs - G_AGI_ERROR_CHECKED libc-ares2 + AGI_ERROR_CHECKED libc-ares2 wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z @@ -6694,16 +6694,16 @@ _EOF_ #Install if (( $? == 0 )); then - G_AGI_ERROR_CHECKED python libxslt1.1 libxml2 python-openssl python-xmltodict + AGI_ERROR_CHECKED python libxslt1.1 libxml2 python-openssl python-xmltodict #Raspbian unrar free if (( $G_HW_MODEL < 10 )); then - G_AGI_ERROR_CHECKED unrar-free + AGI_ERROR_CHECKED unrar-free else - G_AGI_ERROR_CHECKED unrar + AGI_ERROR_CHECKED unrar fi @@ -6817,7 +6817,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - G_AGI_ERROR_CHECKED libpng12-0 libfontconfig1 + AGI_ERROR_CHECKED libpng12-0 libfontconfig1 wget "$INSTALL_URL_ADDRESS" -O package.tar mkdir /etc/tonido @@ -6843,11 +6843,11 @@ _EOF_ if (( $G_HW_MODEL < 10 )); then - G_AGI_ERROR_CHECKED chromium-browser + AGI_ERROR_CHECKED chromium-browser else - G_AGI_ERROR_CHECKED chromium + AGI_ERROR_CHECKED chromium fi @@ -6876,11 +6876,11 @@ _EOF_ # - Odroid's, 'apt-get install -f' removes chromium package, rather than install required deps... if (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )); then - G_AGI_ERROR_CHECKED libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7 + AGI_ERROR_CHECKED libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7 else - G_AGF_ERROR_CHECKED + AGF_ERROR_CHECKED fi @@ -6932,7 +6932,7 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - G_AGI_ERROR_CHECKED v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev libx264-142 libavcodec56 libavformat56 libmysqlclient18 libswscale3 libpq5 + AGI_ERROR_CHECKED v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev libx264-142 libavcodec56 libavformat56 libmysqlclient18 libswscale3 libpq5 # - Motion wget "$INSTALL_URL_ADDRESS" -O package.deb @@ -6952,9 +6952,9 @@ _EOF_ else # - Prereqs - G_AGI_ERROR_CHECKED v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev + AGI_ERROR_CHECKED v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev - G_AGI_ERROR_CHECKED motion + AGI_ERROR_CHECKED motion # - Motioneye pip install motioneye @@ -6983,7 +6983,7 @@ _EOF_ wget -q -O - https://davesteele.github.io/key-366150CE.pub.txt | apt-key add - G_AGUP - G_AGI_ERROR_CHECKED cloudprint-service + AGI_ERROR_CHECKED cloudprint-service else @@ -6993,7 +6993,7 @@ _EOF_ else - G_AGI_ERROR_CHECKED cloudprint-service + AGI_ERROR_CHECKED cloudprint-service fi @@ -7056,15 +7056,15 @@ _EOF_ if (( $? == 0 )); then #prereqs - G_AGI_ERROR_CHECKED par2 python-dev libffi-dev libssl-dev + AGI_ERROR_CHECKED par2 python-dev libffi-dev libssl-dev if (( $G_HW_MODEL < 10 )); then - G_AGI_ERROR_CHECKED unrar-free + AGI_ERROR_CHECKED unrar-free else - G_AGI_ERROR_CHECKED unrar + AGI_ERROR_CHECKED unrar fi @@ -7120,7 +7120,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - G_AGI_ERROR_CHECKED libffi-dev libssl-dev python-lxml python3-lxml + AGI_ERROR_CHECKED libffi-dev libssl-dev python-lxml python3-lxml wget "$INSTALL_URL_ADDRESS" -O package.zip unzip -o package.zip @@ -7152,7 +7152,7 @@ _EOF_ #Install if (( $? == 0 )); then - G_AGI_ERROR_CHECKED python + AGI_ERROR_CHECKED python wget "$INSTALL_URL_ADDRESS" -O package.zip unzip -o package.zip @@ -7197,7 +7197,7 @@ _EOF_ fi G_AGUP - G_AGI_ERROR_CHECKED nzbdrone + AGI_ERROR_CHECKED nzbdrone fi @@ -7214,7 +7214,7 @@ _EOF_ #Install if (( $? == 0 )); then - G_AGI_ERROR_CHECKED mono-devel mediainfo sqlite3 libmono-cil-dev + AGI_ERROR_CHECKED mono-devel mediainfo sqlite3 libmono-cil-dev wget $( curl -s "$INSTALL_URL_ADDRESS" | grep linux.tar.gz | grep browser_download_url | head -1 | cut -d \" -f 4 ) -O package.tar tar -xf package.tar -C /opt/ @@ -7241,7 +7241,7 @@ _EOF_ #Install if (( $? == 0 )); then - G_AGI_ERROR_CHECKED python + AGI_ERROR_CHECKED python git clone --depth=1 "$INSTALL_URL_ADDRESS" @@ -7268,7 +7268,7 @@ _EOF_ #Install if (( $? == 0 )); then - G_AGI_ERROR_CHECKED mono-devel + AGI_ERROR_CHECKED mono-devel wget $( curl -s "$INSTALL_URL_ADDRESS" | grep Jackett.Binaries.Mono.tar.gz | grep browser_download_url | head -1 | cut -d \" -f 4 ) -O package.tar tar -xvf package.tar @@ -7306,7 +7306,7 @@ _EOF_ G_AGUP - G_AGI_ERROR_CHECKED mediacenter22 + AGI_ERROR_CHECKED mediacenter22 else @@ -7357,7 +7357,7 @@ _EOF_ if (( $? == 0 )); then #Install Python and PIP - G_AGI_ERROR_CHECKED python python-pip python-imaging python-dev + AGI_ERROR_CHECKED python python-pip python-imaging python-dev cd "$HOME" git clone --depth=1 "$INSTALL_URL_ADDRESS" @@ -7386,7 +7386,7 @@ _EOF_ if (( $? == 0 )); then - G_AGI_ERROR_CHECKED python python-dev + AGI_ERROR_CHECKED python python-dev git clone "$INSTALL_URL_ADDRESS" mv OctoPrint* "$G_FP_DIETPI_USERDATA"/octoprint @@ -7414,7 +7414,7 @@ _EOF_ if (( $? == 0 )); then - G_AGI_ERROR_CHECKED libav-tools cifs-utils + AGI_ERROR_CHECKED libav-tools cifs-utils wget "$INSTALL_URL_ADDRESS" -O package.tar tar xvf package.tar @@ -7438,7 +7438,7 @@ _EOF_ debconf-set-selections <<< "steam steam/question select I AGREE" - G_AGI_ERROR_CHECKED steam + AGI_ERROR_CHECKED steam fi @@ -7674,7 +7674,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - G_AGI_ERROR_CHECKED libupnp6 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-alsa + AGI_ERROR_CHECKED 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 @@ -7712,7 +7712,7 @@ _EOF_ echo -e "deb https://dtcooper.github.io/raspotify jessie main" > /etc/apt/sources.list.d/raspotify.list G_AGUP - G_AGI_ERROR_CHECKED raspotify + AGI_ERROR_CHECKED raspotify else @@ -7738,23 +7738,23 @@ _EOF_ #Pre-Reqs ----------------------------------------------------------------------- # Core packages - G_AGI_ERROR_CHECKED rpi-update mpc memcached $PHP_APT_PACKAGE_NAME-memcache \ + AGI_ERROR_CHECKED 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 - G_AGI_ERROR_CHECKED dnsmasq hostapd + AGI_ERROR_CHECKED dnsmasq hostapd # BT - G_AGI_ERROR_CHECKED bluez bluez-firmware \ + AGI_ERROR_CHECKED 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 (( $G_HW_MODEL < 10 )); then - G_AGI_ERROR_CHECKED pi-bluetooth + AGI_ERROR_CHECKED pi-bluetooth fi @@ -7868,7 +7868,7 @@ libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc Banner_Installing - G_AGI_ERROR_CHECKED alsa-utils + AGI_ERROR_CHECKED alsa-utils #Apply soundcard local soundcard=$(cat /DietPi/dietpi.txt | grep -m1 'soundcard=' | sed 's/.*=//') @@ -7899,7 +7899,7 @@ libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc Banner_Installing #Xserver Prereqs (ALL) - G_AGI_ERROR_CHECKED xcompmgr xterm xinit xauth xserver-xorg dbus-x11 xfonts-base x11-xserver-utils x11-common x11-utils --no-install-recommends + AGI_ERROR_CHECKED xcompmgr xterm xinit xauth xserver-xorg dbus-x11 xfonts-base x11-xserver-utils x11-common x11-utils --no-install-recommends #Improve performance on all desktops and devices (eg: removes window lag in desktops) by limiting compositions mkdir -p /etc/xdg/autostart @@ -7919,11 +7919,11 @@ _EOF_ #Odroid C2 elif (( $G_HW_MODEL == 12 )); then - G_AGI_ERROR_CHECKED aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump-odroid --no-install-recommends + AGI_ERROR_CHECKED aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump-odroid --no-install-recommends #cp /DietPi/dietpi/conf/xorg_c2.conf /etc/X11/xorg.conf # FBTURBO C2, provides much better desktop performance over Mali DDX: http://forum.odroid.com/viewtopic.php?f=138&t=19948&p=169808#p169808 - G_AGI_ERROR_CHECKED xf86-video-fbturbo-odroid + AGI_ERROR_CHECKED xf86-video-fbturbo-odroid cat << _EOF_ > /etc/X11/xorg.conf Section "Device" Identifier "FBTurbo" @@ -7937,14 +7937,14 @@ _EOF_ #Odroid XU4 elif (( $G_HW_MODEL == 11 )); then - G_AGI_ERROR_CHECKED firmware-samsung xf86-video-armsoc-odroid malit628-odroid --no-install-recommends + AGI_ERROR_CHECKED firmware-samsung xf86-video-armsoc-odroid malit628-odroid --no-install-recommends cp /DietPi/dietpi/conf/xorg_xu4.conf /etc/X11/xorg.conf #Odroid C1 elif (( $G_HW_MODEL == 10 )); then - G_AGI_ERROR_CHECKED aml-libs-odroid xf86-video-mali-odroid libump-odroid mali450-odroid --no-install-recommends + AGI_ERROR_CHECKED aml-libs-odroid xf86-video-mali-odroid libump-odroid mali450-odroid --no-install-recommends cp /DietPi/dietpi/conf/xorg_c1.conf /etc/X11/xorg.conf @@ -8003,10 +8003,10 @@ _EOF_ Banner_Installing #Install - G_AGI_ERROR_CHECKED nvidia-driver nvidia-xconfig + AGI_ERROR_CHECKED nvidia-driver nvidia-xconfig # + i386 OpenGL - G_AGI_ERROR_CHECKED libgl1-nvidia-glx:i386 + AGI_ERROR_CHECKED libgl1-nvidia-glx:i386 fi @@ -8016,7 +8016,7 @@ _EOF_ Banner_Installing - G_AGI_ERROR_CHECKED avahi-daemon + AGI_ERROR_CHECKED avahi-daemon fi @@ -8024,7 +8024,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED build-essential make autoconf automake --no-install-recommends + AGI_ERROR_CHECKED build-essential make autoconf automake --no-install-recommends fi @@ -8032,7 +8032,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED ntp + AGI_ERROR_CHECKED ntp # Remove service, as DietPi ntpd-mode launches the binary with custom commands systemctl stop ntp @@ -8046,7 +8046,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED git --no-install-recommends + AGI_ERROR_CHECKED git --no-install-recommends fi @@ -8054,7 +8054,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED vifm + AGI_ERROR_CHECKED vifm fi @@ -8062,7 +8062,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED vim + AGI_ERROR_CHECKED vim fi @@ -8070,7 +8070,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED vim-tiny + AGI_ERROR_CHECKED vim-tiny fi @@ -8078,7 +8078,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED neovim + AGI_ERROR_CHECKED neovim fi @@ -8086,7 +8086,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED emacs + AGI_ERROR_CHECKED emacs fi @@ -8094,7 +8094,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED iperf + AGI_ERROR_CHECKED iperf fi @@ -8102,7 +8102,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED mc + AGI_ERROR_CHECKED mc fi @@ -8110,7 +8110,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED jed + AGI_ERROR_CHECKED jed fi @@ -8118,7 +8118,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED iftop + AGI_ERROR_CHECKED iftop fi @@ -8126,7 +8126,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED iptraf + AGI_ERROR_CHECKED iptraf fi @@ -8134,7 +8134,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED mtr-tiny + AGI_ERROR_CHECKED mtr-tiny fi @@ -8142,7 +8142,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED nload + AGI_ERROR_CHECKED nload fi @@ -8150,7 +8150,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED tcpdump + AGI_ERROR_CHECKED tcpdump fi @@ -8158,7 +8158,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED openssh-client + AGI_ERROR_CHECKED openssh-client fi @@ -8170,7 +8170,7 @@ _EOF_ #Remove Information file rm /mnt/samba/readme.txt &> /dev/null - G_AGI_ERROR_CHECKED smbclient cifs-utils --no-install-recommends + AGI_ERROR_CHECKED smbclient cifs-utils --no-install-recommends fi @@ -8182,7 +8182,7 @@ _EOF_ #Remove information file rm /mnt/ftp_client/readme.txt &> /dev/null - G_AGI_ERROR_CHECKED curlftpfs + AGI_ERROR_CHECKED curlftpfs fi @@ -8194,7 +8194,7 @@ _EOF_ #Remove information file rm /mnt/nfs_client/readme.txt &> /dev/null - G_AGI_ERROR_CHECKED nfs-common + AGI_ERROR_CHECKED nfs-common fi @@ -8202,7 +8202,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED dropbear + AGI_ERROR_CHECKED dropbear #set to start on next boot sed -i '/NO_START=1/c\NO_START=0' /etc/default/dropbear @@ -8213,7 +8213,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED openssh-server --no-install-recommends + AGI_ERROR_CHECKED openssh-server --no-install-recommends # - Remove all references before adding the entry: https://github.com/Fourdee/DietPi/issues/604 @@ -8256,7 +8256,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED logrotate --no-install-recommends + AGI_ERROR_CHECKED logrotate --no-install-recommends fi @@ -8264,7 +8264,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - G_AGI_ERROR_CHECKED rsyslog --no-install-recommends + AGI_ERROR_CHECKED rsyslog --no-install-recommends fi @@ -8296,7 +8296,7 @@ _EOF_ #Everything else else - G_AGI_ERROR_CHECKED ffmpeg + AGI_ERROR_CHECKED ffmpeg fi @@ -8310,7 +8310,7 @@ _EOF_ # - Raspbian if (( $G_HW_MODEL < 10 )); then - G_AGI_ERROR_CHECKED oracle-java8-jdk + AGI_ERROR_CHECKED oracle-java8-jdk # - Debian. Add repo else @@ -8326,7 +8326,7 @@ _EOF_ # - Accept the license: https://github.com/Fourdee/DietPi/issues/298 debconf-set-selections <<< "oracle-java8-installer shared/accepted-oracle-license-v1-1 boolean true" - G_AGI_ERROR_CHECKED oracle-java8-installer + AGI_ERROR_CHECKED oracle-java8-installer fi @@ -8371,13 +8371,13 @@ _EOF_ if (( $? == 0 )); then # - Preqs - G_AGI_ERROR_CHECKED python python-dev + AGI_ERROR_CHECKED python python-dev wget "$INSTALL_URL_ADDRESS" -O install.py python ./install.py rm install.py - G_AGI_ERROR_CHECKED python-pip python3-pip + AGI_ERROR_CHECKED python-pip python3-pip else @@ -8398,7 +8398,7 @@ _EOF_ if (( $? == 0 )); then - #G_AGI_ERROR_CHECKED libxss1 #if using SDL2+rpi5 + #AGI_ERROR_CHECKED libxss1 #if using SDL2+rpi5 wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z -osdl2_rpi @@ -8436,7 +8436,7 @@ _EOF_ G_AGUP - G_AGI_ERROR_CHECKED mono-runtime + AGI_ERROR_CHECKED mono-runtime fi @@ -8459,15 +8459,15 @@ _EOF_ G_DIETPI-NOTIFY 2 "HA_PYTHON_VERSION: $HA_PYTHON_VERSION" # Install needed libraries - G_AGI_ERROR_CHECKED 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 + AGI_ERROR_CHECKED 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 (( $G_DISTRO == 3 )); then - G_AGI_ERROR_CHECKED libmysqlclient-dev + AGI_ERROR_CHECKED libmysqlclient-dev fi if (( $G_DISTRO >= 4 )); then - G_AGI_ERROR_CHECKED libmariadbclient-dev + AGI_ERROR_CHECKED libmariadbclient-dev fi @@ -11657,7 +11657,7 @@ _EOF_ a2enmod rewrite #install scgi module - G_AGI_ERROR_CHECKED libapache2-mod-scgi + AGI_ERROR_CHECKED libapache2-mod-scgi htpasswd -cb /etc/.rutorrent-htaccess root "$GLOBAL_PW" cat << _EOF_ > /var/www/rutorrent/.htaccess @@ -13269,55 +13269,55 @@ _EOF_ elif (( $1 == 23 )); then - G_AGP_ERROR_CHECKED lxde lxde-* upower policykit-1 iceweasel p7zip-full + AGP_ERROR_CHECKED lxde lxde-* upower policykit-1 iceweasel p7zip-full elif (( $1 == 24 )); then - G_AGP_ERROR_CHECKED mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full + AGP_ERROR_CHECKED mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full elif (( $1 == 26 )); then - G_AGP_ERROR_CHECKED x-window-system-core wmaker gnustep gnustep-devel gnustep-games upower policykit-1 iceweasel p7zip-full + AGP_ERROR_CHECKED x-window-system-core wmaker gnustep gnustep-devel gnustep-games upower policykit-1 iceweasel p7zip-full elif (( $1 == 25 )); then - G_AGP_ERROR_CHECKED xfce4 gnome-icon-theme tango-icon-theme iceweasel p7zip-full + AGP_ERROR_CHECKED xfce4 gnome-icon-theme tango-icon-theme iceweasel p7zip-full elif (( $1 == 22 )); then - G_AGP_ERROR_CHECKED quiterss + AGP_ERROR_CHECKED quiterss elif (( $1 == 30 )); then - G_AGP_ERROR_CHECKED nomachine + AGP_ERROR_CHECKED nomachine elif (( $1 == 29 )); then - G_AGP_ERROR_CHECKED xrdp + AGP_ERROR_CHECKED xrdp elif (( $1 == 44 )); then - G_AGP_ERROR_CHECKED transmission-daemon + AGP_ERROR_CHECKED transmission-daemon rm /etc/init.d/transmission-daemon &> /dev/null rm /etc/systemd/system/transmission-daemon.service &> /dev/null elif (( $1 == 83 )); then - G_AGP_ERROR_CHECKED apache2 + AGP_ERROR_CHECKED apache2 elif (( $1 == 85 )); then - G_AGP_ERROR_CHECKED nginx + AGP_ERROR_CHECKED nginx elif (( $1 == 84 )); then - G_AGP_ERROR_CHECKED lighttpd + AGP_ERROR_CHECKED lighttpd elif (( $1 == 86 || $1 == 88 )); then - G_AGP_ERROR_CHECKED mysql-server mysql-client + AGP_ERROR_CHECKED mysql-server mysql-client - G_AGP_ERROR_CHECKED mariadb-server mariadb-client + AGP_ERROR_CHECKED mariadb-server mariadb-client # - custom confs rm /etc/mysql/conf.d/reduce_resources.cnf @@ -13331,17 +13331,17 @@ _EOF_ elif (( $1 == 87 )); then - G_AGP_ERROR_CHECKED sqlite3 + AGP_ERROR_CHECKED sqlite3 elif (( $1 == 91 )); then - G_AGP_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-redis redis-server redis-tools + AGP_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-redis redis-server redis-tools elif (( $1 == 89 )); then rm "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf rm "$FP_PHP_BASE_DIR"/mods-available/dietpi.ini 2> /dev/null - G_AGP_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-* libapache2-mod-"$PHP_APT_PACKAGE_NAME" + AGP_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-* libapache2-mod-"$PHP_APT_PACKAGE_NAME" rm /var/www/phpinfo.php rm /var/www/apc.php rm /var/www/opcache.php @@ -13350,7 +13350,7 @@ _EOF_ elif (( $1 == 90 )); then - G_AGP_ERROR_CHECKED phpmyadmin + AGP_ERROR_CHECKED phpmyadmin elif (( $1 == 54 )); then @@ -13377,7 +13377,7 @@ _EOF_ mysqldump --lock-tables "$mysql_auth" owncloud > "$G_FP_DIETPI_USERDATA"/owncloud_data/mysql_backup.sql mysqladmin "$mysql_auth" drop owncloud -f # Purge APT package - G_AGP_ERROR_CHECKED owncloud-files owncloud owncloud-deps + AGP_ERROR_CHECKED owncloud-files owncloud owncloud-deps # Remove ownCloud installation folder rm -R /var/www/owncloud # Remove ownCloud repo @@ -13406,7 +13406,7 @@ _EOF_ elif (( $1 == 115 )); then - G_AGP_ERROR_CHECKED webmin + AGP_ERROR_CHECKED webmin elif (( $1 == 32 )); then @@ -13415,7 +13415,7 @@ _EOF_ elif (( $1 == 128 )); then - G_AGP_ERROR_CHECKED mpd libmpdclient2 + AGP_ERROR_CHECKED mpd libmpdclient2 userdel -f mpd &> /dev/null rm /lib/systemd/system/mpd.service rm -R "$G_FP_DIETPI_USERDATA"/.mpd_cache @@ -13433,20 +13433,20 @@ _EOF_ elif (( $1 == 123 )); then - G_AGP_ERROR_CHECKED mosquitto + AGP_ERROR_CHECKED mosquitto rm /etc/apt/sources.list.d/mosquitto-*.list elif (( $1 == 124 )); then - G_AGP_ERROR_CHECKED networkaudiod + AGP_ERROR_CHECKED networkaudiod elif (( $1 == 125 )); then - G_AGP_ERROR_CHECKED tomcat8 + AGP_ERROR_CHECKED tomcat8 elif (( $1 == 126 )); then - G_AGP_ERROR_CHECKED openmediavault + AGP_ERROR_CHECKED openmediavault rm /etc/apt/sources.list.d/openmediavault.list elif (( $1 == 129 )); then @@ -13457,7 +13457,7 @@ _EOF_ elif (( $1 == 130 )); then - G_AGP_ERROR_CHECKED python-pip python3-pip + AGP_ERROR_CHECKED python-pip python3-pip elif (( $1 == 131 )); then @@ -13471,7 +13471,7 @@ _EOF_ rm /usr/local/bin/aria2c rm -R /var/www/aria2 - G_AGP_ERROR_CHECKED aria2 + AGP_ERROR_CHECKED aria2 elif (( $1 == 133 )); then @@ -13492,13 +13492,13 @@ _EOF_ elif (( $1 == 135 )); then - G_AGP_ERROR_CHECKED darkice icecast2 + AGP_ERROR_CHECKED darkice icecast2 rm /etc/systemd/system/darkice.service elif (( $1 == 136 )); then - G_AGP_ERROR_CHECKED motion + AGP_ERROR_CHECKED motion rm -R /etc/motioneye @@ -13508,7 +13508,7 @@ _EOF_ elif (( $1 == 137 )); then - G_AGP_ERROR_CHECKED cloudprint-service + AGP_ERROR_CHECKED cloudprint-service if (( $G_DISTRO == 3 )); then rm /etc/apt/sources.list.d/cloudprint.list @@ -13530,7 +13530,7 @@ _EOF_ elif (( $1 == 140 )); then - G_AGP_ERROR_CHECKED libsdl2 libsdl2-image libsdl2-mixer libsdl2-net libsdl2-ttf libsmpeg2 + AGP_ERROR_CHECKED libsdl2 libsdl2-image libsdl2-mixer libsdl2-net libsdl2-ttf libsmpeg2 elif (( $1 == 141 )); then @@ -13556,7 +13556,7 @@ _EOF_ elif (( $1 == 144 )); then - G_AGP_ERROR_CHECKED nzbdrone + AGP_ERROR_CHECKED nzbdrone rm /etc/systemd/system/sonarr.service rm /etc/apt/sources.list.d/sonarr.list G_AGUP @@ -13579,7 +13579,7 @@ _EOF_ elif (( $1 == 148 )); then - G_AGP_ERROR_CHECKED mediacenter22 + AGP_ERROR_CHECKED mediacenter22 elif (( $1 == 149 )); then @@ -13593,18 +13593,18 @@ _EOF_ elif (( $1 == 150 )); then - #G_AGP_ERROR_CHECKED mono-runtime #shared lib + #AGP_ERROR_CHECKED mono-runtime #shared lib rm /etc/apt/sources.list.d/mono-xamarin.list G_AGUP elif (( $1 == 151 )); then - G_AGP_ERROR_CHECKED nvidia-driver nvidia-xconfig libgl1-nvidia-glx:i386 + AGP_ERROR_CHECKED nvidia-driver nvidia-xconfig libgl1-nvidia-glx:i386 elif (( $1 == 152 )); then - G_AGP_ERROR_CHECKED avahi-daemon + AGP_ERROR_CHECKED avahi-daemon elif (( $1 == 153 )); then @@ -13620,45 +13620,45 @@ _EOF_ elif (( $1 == 156 )); then - G_AGP_ERROR_CHECKED steam + AGP_ERROR_CHECKED steam rm -R "$HOME"/.steam rm -R "$G_FP_DIETPI_USERDATA"/steam elif (( $1 == 119 )); then - G_AGP_ERROR_CHECKED cava + AGP_ERROR_CHECKED cava rm "$HOME/.config/cava/config" rm "$HOME/cava.psf" elif (( $1 == 118 )); then - G_AGP_ERROR_CHECKED mopidy + AGP_ERROR_CHECKED mopidy rm /etc/apt/sources.list.d/mopidy.list pip uninstall -y Mopidy-MusicBox-Webclient Mopidy-Local-Images elif (( $1 == 31 )); then - G_AGP_ERROR_CHECKED kodi + AGP_ERROR_CHECKED kodi #+Odroids - G_AGP_ERROR_CHECKED kodi-odroid + AGP_ERROR_CHECKED kodi-odroid rm /usr/share/applications/kodi.desktop rm ~/Desktop/kodi.desktop elif (( $1 == 39 )); then - G_AGP_ERROR_CHECKED minidlna + AGP_ERROR_CHECKED minidlna elif (( $1 == 51 )); then - G_AGP_ERROR_CHECKED ibsdl1.2debian libsdl-net1.2 + AGP_ERROR_CHECKED ibsdl1.2debian libsdl-net1.2 rm -R /usr/local/games/opentyrian rm /usr/share/applications/opentyrian.desktop rm ~/Desktop/opentyrian.desktop elif (( $1 == 59 )); then - G_AGP_ERROR_CHECKED gpac + AGP_ERROR_CHECKED gpac rm -R /var/www/dietpicam rm /opt/vc/bin/raspimjpeg rm /usr/bin/raspimjpeg @@ -13667,25 +13667,25 @@ _EOF_ elif (( $1 == 45 )); then - G_AGP_ERROR_CHECKED deluged deluge-web deluge-webui deluge-console + AGP_ERROR_CHECKED deluged deluge-web deluge-webui deluge-console rm /etc/dietpi/dietpi-software/services/deluge.service rm -R ~/.config/deluge elif (( $1 == 94 )); then - G_AGP_ERROR_CHECKED proftpd-basic + AGP_ERROR_CHECKED proftpd-basic elif (( $1 == 96 )); then - G_AGP_ERROR_CHECKED samba samba-common-bin + AGP_ERROR_CHECKED samba samba-common-bin elif (( $1 == 95 )); then - G_AGP_ERROR_CHECKED vsftpd + AGP_ERROR_CHECKED vsftpd elif (( $1 == 109 )); then - G_AGP_ERROR_CHECKED nfs-kernel-server + AGP_ERROR_CHECKED nfs-kernel-server elif (( $1 == 67 )); then @@ -13703,7 +13703,7 @@ _EOF_ elif (( $1 == 93 )); then - G_AGP_ERROR_CHECKED dnsmasq + AGP_ERROR_CHECKED dnsmasq pihole uninstall #https://github.com/Fourdee/DietPi/issues/753 @@ -13719,7 +13719,7 @@ _EOF_ elif (( $1 == 33 || $1 == 34 )); then - G_AGP_ERROR_CHECKED subsonic + AGP_ERROR_CHECKED subsonic rm -R /var/subsonic elif (( $1 == 71 )); then @@ -13738,7 +13738,7 @@ _EOF_ rm "$HOME"/weaved_setup.bin # Remot3.it - G_AGP_ERROR_CHECKED weavedconnectd + AGP_ERROR_CHECKED weavedconnectd elif (( $1 == 62 )); then @@ -13763,11 +13763,11 @@ _EOF_ rm -r /etc/haproxy #Shared dev libraries. Leave these installed - #G_AGP_ERROR_CHECKED libpcre3-dev libssl-dev + #AGP_ERROR_CHECKED libpcre3-dev libssl-dev elif (( $1 == 35 )); then - G_AGP_ERROR_CHECKED logitechmediaserver + AGP_ERROR_CHECKED logitechmediaserver rm /etc/dietpi/dietpi-software/services/squeezeboxserver.service rm -R /var/lib/squeezeboxserver rm -R /usr/share/squeezeboxserver @@ -13778,11 +13778,11 @@ _EOF_ elif (( $1 == 27 || $1 == 28 || $1 == 120 )); then - G_AGP_ERROR_CHECKED tightvncserver - G_AGP_ERROR_CHECKED vnc4server - G_AGP_ERROR_CHECKED x11vnc - G_AGP_ERROR_CHECKED realvnc-vnc-server - G_AGP_ERROR_CHECKED tigervnc-* + AGP_ERROR_CHECKED tightvncserver + AGP_ERROR_CHECKED vnc4server + AGP_ERROR_CHECKED x11vnc + AGP_ERROR_CHECKED realvnc-vnc-server + AGP_ERROR_CHECKED tigervnc-* rm /etc/systemd/system/vncserver.service rm /etc/init.d/vncserver @@ -13797,7 +13797,7 @@ _EOF_ elif (( $1 == 73 )); then - G_AGP_ERROR_CHECKED fail2ban + AGP_ERROR_CHECKED fail2ban elif (( $1 == 64 )); then @@ -13824,14 +13824,14 @@ _EOF_ elif (( $1 == 97 )); then - G_AGP_ERROR_CHECKED openvpn + AGP_ERROR_CHECKED openvpn rm -R /etc/openvpn &> /dev/null elif (( $1 == 92 )); then if (( $G_DISTRO >= 4 )); then - G_AGP_ERROR_CHECKED python-certbot-apache python-certbot-nginx certbot + AGP_ERROR_CHECKED python-certbot-apache python-certbot-nginx certbot fi @@ -13840,11 +13840,11 @@ _EOF_ elif (( $1 == 69 )); then - G_AGP_ERROR_CHECKED python-rpi.gpio python3-rpi.gpio + AGP_ERROR_CHECKED python-rpi.gpio python3-rpi.gpio elif (( $1 == 72 )); then - G_AGP_ERROR_CHECKED i2c-tools + AGP_ERROR_CHECKED i2c-tools #Disable /DietPi/dietpi/func/dietpi-set_hardware i2c disable @@ -13854,7 +13854,7 @@ _EOF_ elif (( $1 == 60 )); then - G_AGP_ERROR_CHECKED hostapd isc-dhcp-server + AGP_ERROR_CHECKED hostapd isc-dhcp-server rm /etc/dhcp/dhcpd.conf &> /dev/null rm /etc/hostapd/hostapd.conf &> /dev/null @@ -13892,19 +13892,19 @@ _EOF_ elif (( $1 == 61 )); then - G_AGP_ERROR_CHECKED tor + AGP_ERROR_CHECKED tor # - uninstall WIFIHOTSPOT ALSO. Due to IPtables needing reset. Uninstall_Software 60 elif (( $1 == 37 )); then - G_AGP_ERROR_CHECKED shairport-sync* + AGP_ERROR_CHECKED shairport-sync* userdel -f shairport-sync elif (( $1 == 38 )); then - G_AGP_ERROR_CHECKED brutefir + AGP_ERROR_CHECKED brutefir rm -R /etc/BruteFIR rm /etc/dietpi/dietpi-software/services/brutefir.service @@ -13923,7 +13923,7 @@ _EOF_ elif (( $1 == 36 )); then - G_AGP_ERROR_CHECKED squeezelite + AGP_ERROR_CHECKED squeezelite rm -R /usr/bin/squeezelite* rm /etc/systemd/system/squeezelite.service @@ -13936,7 +13936,7 @@ _EOF_ elif (( $1 == 66 )); then - G_AGP_ERROR_CHECKED rpimonitor + AGP_ERROR_CHECKED rpimonitor elif (( $1 == 57 )); then @@ -13955,7 +13955,7 @@ _EOF_ groupdel netdata #1.2.0+ - G_AGP_ERROR_CHECKED netdata + AGP_ERROR_CHECKED netdata #1.0.0 rm /usr/sbin/netdata @@ -13968,11 +13968,11 @@ _EOF_ elif (( $1 == 43 )); then - G_AGP_ERROR_CHECKED mumble-server + AGP_ERROR_CHECKED mumble-server elif (( $1 == 41 )); then - G_AGP_ERROR_CHECKED emby-server + AGP_ERROR_CHECKED emby-server rm /etc/apt/sources.list.d/emby-server.list G_AGUP @@ -13984,7 +13984,7 @@ _EOF_ elif (( $1 == 42 )); then - G_AGP_ERROR_CHECKED plexmediaserver + AGP_ERROR_CHECKED plexmediaserver rm -R /var/lib/plexmediaserver @@ -14021,7 +14021,7 @@ _EOF_ elif (( $1 == 46 )); then - G_AGP_ERROR_CHECKED qbittorrent-nox + AGP_ERROR_CHECKED qbittorrent-nox rm /etc/systemd/system/qbittorrent.service rm -R "$HOME"/.config/qBittorrent @@ -14040,7 +14040,7 @@ _EOF_ elif (( $1 == 107 )); then - G_AGP_ERROR_CHECKED rtorrent + AGP_ERROR_CHECKED rtorrent rm -R /var/www/rutorrent rm "$HOME"/.rtorrent.rc rm /etc/systemd/system/rtorrent.service @@ -14087,7 +14087,7 @@ _EOF_ rm /etc/chromium.d/custom_flags rm "$HOME"/.chromium-browser.init - G_AGP_ERROR_CHECKED chromium + AGP_ERROR_CHECKED chromium elif (( $1 == 157)); then @@ -14122,7 +14122,7 @@ _EOF_ elif (( $1 == 167 )); then - G_AGP_ERROR_CHECKED raspotify + AGP_ERROR_CHECKED raspotify rm /etc/apt/sources.list.d/raspotify.list G_AGUP @@ -14140,7 +14140,7 @@ _EOF_ elif (( $1 == 170 )); then Reset_NTPD - G_AGP_ERROR_CHECKED ntp + AGP_ERROR_CHECKED ntp elif (( $1 == 158 )); then @@ -14174,10 +14174,10 @@ _EOF_ if (( $G_HW_ARCH == 10 )); then # remove docker and all its unused dependencies - x86_64 package name is different - G_AGP_ERROR_CHECKED docker-ce + AGP_ERROR_CHECKED docker-ce else # remove docker and all its unused dependencies - ARM package name - G_AGP_ERROR_CHECKED docker-engine + AGP_ERROR_CHECKED docker-engine fi # delete data files - dietpi @@ -14195,7 +14195,7 @@ _EOF_ elif (( $1 == 163 )); then - G_AGP_ERROR_CHECKED gmrender + AGP_ERROR_CHECKED gmrender rm /etc/systemd/system/gmrender.service elif (( $1 == 159 || $1 == 160 )); then @@ -14211,57 +14211,57 @@ _EOF_ elif (( $1 == 15 )); then - G_AGP_ERROR_CHECKED tcpdump + AGP_ERROR_CHECKED tcpdump elif (( $1 == 14 )); then - G_AGP_ERROR_CHECKED nload + AGP_ERROR_CHECKED nload elif (( $1 == 13 )); then - G_AGP_ERROR_CHECKED mtr-tiny + AGP_ERROR_CHECKED mtr-tiny elif (( $1 == 11 )); then - G_AGP_ERROR_CHECKED iptraf + AGP_ERROR_CHECKED iptraf elif (( $1 == 10 )); then - G_AGP_ERROR_CHECKED iftop + AGP_ERROR_CHECKED iftop elif (( $1 == 19 )); then - G_AGP_ERROR_CHECKED jed + AGP_ERROR_CHECKED jed elif (( $1 == 3 )); then - G_AGP_ERROR_CHECKED mc + AGP_ERROR_CHECKED mc elif (( $1 == 18 )); then - G_AGP_ERROR_CHECKED emacs + AGP_ERROR_CHECKED emacs elif (( $1 == 20 || $i == 21 )); then - G_AGP_ERROR_CHECKED vim vim-tiny + AGP_ERROR_CHECKED vim vim-tiny elif (( $1 == 127 )); then - G_AGP_ERROR_CHECKED neovim + AGP_ERROR_CHECKED neovim elif (( $1 == 0 )); then #This also removes OpenSSH server. So lets check OpenSSH server isnt installed before hand. if (( $(dpkg -l | grep -ci -m1 'openssh-server') == 0 )); then - G_AGP_ERROR_CHECKED openssh-client + AGP_ERROR_CHECKED openssh-client fi elif (( $1 == 1 )); then umount -f /mnt/samba - G_AGP_ERROR_CHECKED smbclient + AGP_ERROR_CHECKED smbclient #Disable in fstab sed -i '/\/mnt\/samba/c\#\/mnt\/samba . Please use dietpi-config and the Networking Options: NAS menu to setup this mount' /etc/fstab #Add info file for installation method. @@ -14269,7 +14269,7 @@ _EOF_ elif (( $1 == 111 )); then - G_AGP_ERROR_CHECKED urbackup-server + AGP_ERROR_CHECKED urbackup-server #+sourcebuild rm /etc/systemd/system/urbackupsrv.service @@ -14287,7 +14287,7 @@ _EOF_ #nfs-kernel-server depends on nfs-common if (( ${aSOFTWARE_INSTALL_STATE[109]} == 0 )); then - G_AGP_ERROR_CHECKED nfs-common + AGP_ERROR_CHECKED nfs-common fi @@ -14299,28 +14299,28 @@ _EOF_ elif (( $1 == 16 )); then - G_AGP_ERROR_CHECKED build-essential + AGP_ERROR_CHECKED build-essential elif (( $1 == 17 )); then - G_AGP_ERROR_CHECKED git + AGP_ERROR_CHECKED git elif (( $1 == 5 )); then - G_AGP_ERROR_CHECKED alsa-utils + AGP_ERROR_CHECKED alsa-utils #DietPi-JustBoom, remove bash alias for config panel: sed -i '/dietpi-justboom/d' /etc/bash.bashrc &> /dev/null elif (( $1 == 6 )); then - G_AGP_ERROR_CHECKED xcompmgr xinit xauth xserver-xorg xfonts-base x11-xserver-utils x11-common x11-utils + AGP_ERROR_CHECKED xcompmgr xinit xauth xserver-xorg xfonts-base x11-xserver-utils x11-common x11-utils rm /etc/xdg/autostart/xcompmgr.desktop elif (( $1 == 2 )); then umount -f /mnt/ftp_client - G_AGP_ERROR_CHECKED curlftpfs + AGP_ERROR_CHECKED curlftpfs #Disable in fstab sed -i '/\/mnt\/ftp_client/c\#\/mnt\/ftp_client . Please use dietpi-config and the Networking Options: NAS menu to setup this mount' /etc/fstab @@ -14330,23 +14330,23 @@ _EOF_ elif (( $1 == 7 )); then - G_AGP_ERROR_CHECKED ffmpeg + AGP_ERROR_CHECKED ffmpeg # + RPi - G_AGP_ERROR_CHECKED libx264 libmp3lame libfdk-aac + AGP_ERROR_CHECKED libx264 libmp3lame libfdk-aac elif (( $1 == 8 )); then - G_AGP_ERROR_CHECKED oracle-java8-* + AGP_ERROR_CHECKED oracle-java8-* rm /etc/apt/sources.list.d/webupd8team-java.list G_AGUP elif (( $1 == 104 )); then - G_AGP_ERROR_CHECKED dropbear* #stretch | dropbear-initramfs dropbear-run + AGP_ERROR_CHECKED dropbear* #stretch | dropbear-initramfs dropbear-run elif (( $1 == 105 )); then - G_AGP_ERROR_CHECKED openssh-* + AGP_ERROR_CHECKED openssh-* # This also clears Openssh-client aSOFTWARE_INSTALL_STATE[0]=0 @@ -14357,15 +14357,15 @@ _EOF_ elif (( $1 == 101 )); then - G_AGP_ERROR_CHECKED logrotate + AGP_ERROR_CHECKED logrotate elif (( $1 == 102 )); then - G_AGP_ERROR_CHECKED rsyslog + AGP_ERROR_CHECKED rsyslog elif (( $1 == 9 )); then - G_AGP_ERROR_CHECKED nodejs + AGP_ERROR_CHECKED nodejs # - old install via repo if [ -f /etc/apt/sources.list.d/nodesource_nodejs.list ]; then @@ -14379,7 +14379,7 @@ _EOF_ elif (( $1 == 4 )); then - G_AGP_ERROR_CHECKED vifm + AGP_ERROR_CHECKED vifm else From 1fc8e3f99f9c9e960a1f1dcff7573c6cb5911931 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 20 Dec 2017 09:17:46 +0000 Subject: [PATCH 100/390] v160 Debugging: https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 7459af3102..ec46cdcc9d 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -74,7 +74,7 @@ # - load chmod +x dietpi-globals - . /dietpi-globals + . ./dietpi-globals if (( $? != 0 )); then echo -e 'Error: Unable to load dietpi-globals. Aborting...\n' From 2c9c7306e8159d77adccbee1d8dda8d56d95582e Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 20 Dec 2017 09:22:54 +0000 Subject: [PATCH 101/390] v160 + Debugging: https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index ec46cdcc9d..980e2de075 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -82,15 +82,12 @@ fi - #DEBUG - echo $G_HW_MODEL - - exit - #------------------------------------------------------------------------------------------------ #Globals #------------------------------------------------------------------------------------------------ #System + #G_DISTRO # init from dietpi-globals + #G_DISTRO_NAME # init from dietpi-globals DISTRO_TARGET=0 DISTRO_TARGET_NAME='' if grep -q 'wheezy' /etc/os-release; then @@ -116,11 +113,12 @@ else echo -e 'Error: Unknown or unsupported distribution version, aborting...\n' - exit + exit 1 fi - G_HW_MODEL=0 + #G_HW_MODEL # init from dietpi-globals + #G_HW_ARCH_DESCRIPTION # init from dietpi-globals G_HW_ARCH_DESCRIPTION=$(uname -m) if [ "$G_HW_ARCH_DESCRIPTION" = "armv6l" ]; then @@ -141,13 +139,15 @@ else G_DIETPI-NOTIFY 1 "Error: Unknown or unsupported CPU architecture $G_HW_ARCH_DESCRIPTION, aborting..." - exit + exit 1 fi - #Funcs + #URL connection test var holder INTERNET_ADDRESS='' + #Funcs + Error_Check(){ #Grab exit code in case of failure From 35342bd527a387c7d3806c3189d1cfa970b5da2b Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 20 Dec 2017 09:31:23 +0000 Subject: [PATCH 102/390] v160 + Debugging: https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 980e2de075..cae906c9bb 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -10,7 +10,7 @@ # DO NOT USE. Currently under testing. #------------------------------------------------------------------------------------------------ - #apt-get update + #G_AGUP #apt-get install wget || or make it a pre-req? #wget #load @@ -239,6 +239,10 @@ fi + #Recreate dietpi logs dir, used by G_AGx + mkdir -p /var/tmp/dietpi/logs + Error_Check + #------------------------------------------------------------------------------------------------ G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' @@ -250,7 +254,7 @@ apt-get clean Error_Check - apt-get update + G_AGUP Error_Check G_DIETPI-NOTIFY 2 'Installing core packages, required for next stage of this script:' @@ -401,7 +405,7 @@ _EOF_ apt-get clean Error_Check - apt-get update + G_AGUP Error_Check # - Distro is now target @@ -585,7 +589,7 @@ _EOF_ G_DIETPI-NOTIFY 2 "Purging APT with autoremoval:" - apt-get autoremove --purge -y + G_AGA Error_Check @@ -597,7 +601,7 @@ _EOF_ G_DIETPI-NOTIFY 2 "Upgrading existing APT installed packages:" - DEBIAN_FRONTEND='noninteractive' apt-get dist-upgrade -y + G_AGDUG Error_Check #???: WHIP_OPTIONal Reinstall OpenSSH (for updating dietpi scripts etc). Gets removed during finalise. @@ -944,7 +948,7 @@ _EOF_ # - i386 APT support dpkg --add-architecture i386 - apt-get update + G_AGUP # - Disable nouveau: https://github.com/Fourdee/DietPi/issues/1244 // http://dietpi.com/phpbb/viewtopic.php?f=11&t=2462&p=9688#p9688 cat << _EOF_ > /etc/modprobe.d/blacklist-nouveau.conf @@ -1039,7 +1043,7 @@ _EOF_ G_DIETPI-NOTIFY 2 'Clearing APT cache' apt-get clean - rm -R /var/lib/apt/lists/* -vf #lists cache: remove partial folder also, automatically gets regenerated on apt-get update + rm -R /var/lib/apt/lists/* -vf #lists cache: remove partial folder also, automatically gets regenerated on G_AGUP #rm /var/lib/dpkg/info/* #issue... #dpkg: warning: files list file for package 'libdbus-1-3:armhf' missing; assuming package has no files currently installed From 861f4d850ecfd348aa3a0a58e3125cc0b0582a75 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 20 Dec 2017 09:39:30 +0000 Subject: [PATCH 103/390] v160 + Debugging: https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 1 - dietpi/dietpi-drive_manager | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index cae906c9bb..7fc2c1a92a 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -617,7 +617,6 @@ _EOF_ G_DIETPI-NOTIFY 2 "Installing core DietPi pre-req APT packages" - G_DIETPI-NOTIFY 2 "The following packages will be installed\n$INSTALL_PACKAGES" G_AGI $INSTALL_PACKAGES Error_Check diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index c64c8bb6d2..1918965836 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -29,13 +29,18 @@ fi #Import DietPi-Globals --------------------------------------------------------------- - # - Avoid loading on non-dietpi system if [ -f /DietPi/dietpi/func/dietpi-globals ]; then . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER + # - Support for loading from /boot during PREP_SYSTEM + elif [ -f "$HOME"/dietpi-globals ]; then + + . "$HOME"/dietpi-globals + fi + G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- EXIT_CODE=0 From bc9c540feed4a43223b88ac60a02bc8044af865e Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 20 Dec 2017 09:39:54 +0000 Subject: [PATCH 104/390] v160 + minor --- dietpi/dietpi-drive_manager | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 1918965836..8531251df6 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -38,9 +38,9 @@ elif [ -f "$HOME"/dietpi-globals ]; then . "$HOME"/dietpi-globals + G_CHECK_ROOT_USER fi - G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- EXIT_CODE=0 From 9a6f67522471f33c74e810e18b8d462a2e848e98 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 20 Dec 2017 09:45:30 +0000 Subject: [PATCH 105/390] v160 + minor info: https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 7fc2c1a92a..94edf3ab53 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1257,7 +1257,7 @@ _EOF_ # cat /var/tmp/dietpi/logs/fs_partition_resize.log - G_DIETPI-NOTIFY 2 'Sync changes to disk and TRIM rootFS' + G_DIETPI-NOTIFY 2 'Sync changes to disk and TRIM rootFS. Please wait, this may take some time...' systemctl stop dietpi-ramlog Error_Check From 7884895a25501ae4b0656563720f28195aa97acf Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 20 Dec 2017 09:52:40 +0000 Subject: [PATCH 106/390] v160 + Debugging: https://github.com/Fourdee/DietPi/issues/1285 --- dietpi/func/dietpi-globals | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index c02f61e49c..5b57dc26b9 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -192,8 +192,13 @@ #----------------------------------------------------------------------------------- # DietPi First-Run Stage #----------------------------------------------------------------------------------- - # -1 = first boot / 0 = run dietpi-software at login / 1 = completed - G_DIETPI_INSTALL_STAGE=$(cat /DietPi/dietpi/.install_stage) + # -2 = PREP_SYSTEM/Unknown | -1 = first boot | 0 = run dietpi-software at login | 1 = completed + G_DIETPI_INSTALL_STAGE=-2 + if [ -f /DietPi/dietpi/.install_stage ]; then + + G_DIETPI_INSTALL_STAGE=$(cat /DietPi/dietpi/.install_stage) + + fi #----------------------------------------------------------------------------------- # Hardware Details From d6d47a7d93dcda9c4352f624cc79e9821d892826 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 20 Dec 2017 11:30:04 +0000 Subject: [PATCH 107/390] v160 + minor --- dietpi/dietpi-drive_manager | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 8531251df6..9e51c9937f 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -34,7 +34,7 @@ . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER - # - Support for loading from /boot during PREP_SYSTEM + # - Support for loading during PREP_SYSTEM elif [ -f "$HOME"/dietpi-globals ]; then . "$HOME"/dietpi-globals From fd4e6f9063342872b8fe35bd01222ce73c221622 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 20 Dec 2017 11:43:51 +0000 Subject: [PATCH 108/390] v160 + Define eth naming net.ifnames=0 in grub defaults and regen: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353015233 --- dietpi/func/dietpi-set_core_environment | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index 135302a10f..33f611d903 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -370,11 +370,14 @@ _EOF_ # - Prefer to use wlan/eth naming for networked devices (eg: stretch) ln -sf /dev/null /etc/systemd/network/99-default.link - #??? x86_64 - # kernel cmd line with GRUB - # /etc/default/grub [replace] GRUB_CMDLINE_LINUX="net.ifnames=0" - # GRUB_TIMEOUT=0 - #??? + # x86_64: kernel cmd line with GRUB + if (( $HW_ARCH == 10 )); then + + sed -i '/^GRUB_CMDLINE_LINUX=/c\GRUB_CMDLINE_LINUX="net.ifnames=0"' /etc/default/grub + sed -i '/^GRUB_TIMEOUT=/c\GRUB_TIMEOUT=0' /etc/default/grub + update-grub + + fi #----------------------------------------------------------------------------------- #MISC From 5f963133bca9c28d7b68465340ddf9f8095cb432 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 20 Dec 2017 11:49:41 +0000 Subject: [PATCH 109/390] v160 + Correction: https://github.com/Fourdee/DietPi/issues/1285 --- dietpi/func/dietpi-set_core_environment | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index 33f611d903..d86cca5f94 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -371,7 +371,8 @@ _EOF_ # - Prefer to use wlan/eth naming for networked devices (eg: stretch) ln -sf /dev/null /etc/systemd/network/99-default.link # x86_64: kernel cmd line with GRUB - if (( $HW_ARCH == 10 )); then + # HW_ARCH not set at this stage within DietPi, using PREP_SYSTEM + if [ -f /etc/default/grub ]; then sed -i '/^GRUB_CMDLINE_LINUX=/c\GRUB_CMDLINE_LINUX="net.ifnames=0"' /etc/default/grub sed -i '/^GRUB_TIMEOUT=/c\GRUB_TIMEOUT=0' /etc/default/grub From 3e8c7c0d9d19c79884231af9671783c12add4e2c Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 20 Dec 2017 12:25:42 +0000 Subject: [PATCH 110/390] v160 + Eth renaming for x86_64: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353015233 --- PREP_SYSTEM_FOR_DIETPI.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 94edf3ab53..a197d6c7e2 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -844,6 +844,23 @@ _EOF_ G_DIETPI-NOTIFY 2 "Configuring Network:" + # - x86_64 Check for non-standard ethX naming. Rename now (also done via net.iframes=0 in grub for future reboots. + if (( $G_HW_ARCH == 10 )); then + + CURRENT_ADAPTER_NAME=$(ip r | grep -m1 'default' | awk '{print $NF}') + if [ ! -n "$CURRENT_ADAPTER_NAME" ]; then + + G_DIETPI-NOTIFY 1 'Error: Unable to find active ethernet adapater. Aborting...' + exit 1 + + fi + + ifconfig $CURRENT_ADAPTER_NAME down + ip link set $CURRENT_ADAPTER_NAME name eth0 + ifconfig eth0 up + + fi + rm -R /etc/network/interfaces &> /dev/null # armbian symlink for bulky network-manager cp /boot/dietpi/conf/network_interfaces /etc/network/interfaces /DietPi/dietpi/func/obtain_network_details From d5f95cb5c658f965e39e6d358c5f61e417a22ed1 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 20 Dec 2017 12:31:28 +0000 Subject: [PATCH 111/390] v160 + Run G_AGA again, to purge leftover packages during DISTRO up/downgrades: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352159530 --- PREP_SYSTEM_FOR_DIETPI.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index a197d6c7e2..c7d1e35a57 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -604,12 +604,6 @@ _EOF_ G_AGDUG Error_Check - #???: WHIP_OPTIONal Reinstall OpenSSH (for updating dietpi scripts etc). Gets removed during finalise. - # apt-get install openssh-server -y - # echo -e "PermitRootLogin yes" >> /etc/ssh/sshd_config - # systemctl restart ssh - #??? - G_DIETPI-NOTIFY 2 "Disabling swapfile generation for dphys-swapfile during install" echo -e "CONF_SWAPSIZE=0" > /etc/dphys-swapfile @@ -657,6 +651,12 @@ _EOF_ rm /etc/apt/apt-conf.d/99dietpi_norecommends &> /dev/null + G_DIETPI-NOTIFY 2 "Purging APT with autoremoval (in case of DISTRO upgrade/downgrade):" + + G_AGA + Error_Check + + #------------------------------------------------------------------------------------------------ G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' G_DIETPI-NOTIFY 0 'Step 6: Downloading and installing DietPi sourcecode' @@ -847,6 +847,9 @@ _EOF_ # - x86_64 Check for non-standard ethX naming. Rename now (also done via net.iframes=0 in grub for future reboots. if (( $G_HW_ARCH == 10 )); then + + G_DIETPI-NOTIFY 2 'Setting adapter name to standard ethX' + CURRENT_ADAPTER_NAME=$(ip r | grep -m1 'default' | awk '{print $NF}') if [ ! -n "$CURRENT_ADAPTER_NAME" ]; then From 207b05cc4a28e9c2c2e2b7671730435f94d20fff Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 21 Dec 2017 06:00:14 +0000 Subject: [PATCH 112/390] v160 + No need to obtain network details, or rename adapters now. Adapter rename is done after reboot. DietPi will also configure rest of networking automatically during 1st run: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353015233 --- PREP_SYSTEM_FOR_DIETPI.sh | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index c7d1e35a57..56df885d7d 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -745,9 +745,11 @@ _EOF_ rm -R /home &> /dev/null rm -R /media &> /dev/null - rm -R /selinux &> /dev/null + # - www + rm -R /var/www/* &> /dev/null + # - sourcecode (linux-headers etc) rm -R /usr/src/* &> /dev/null @@ -844,33 +846,12 @@ _EOF_ G_DIETPI-NOTIFY 2 "Configuring Network:" - # - x86_64 Check for non-standard ethX naming. Rename now (also done via net.iframes=0 in grub for future reboots. - if (( $G_HW_ARCH == 10 )); then - - - G_DIETPI-NOTIFY 2 'Setting adapter name to standard ethX' - - CURRENT_ADAPTER_NAME=$(ip r | grep -m1 'default' | awk '{print $NF}') - if [ ! -n "$CURRENT_ADAPTER_NAME" ]; then - - G_DIETPI-NOTIFY 1 'Error: Unable to find active ethernet adapater. Aborting...' - exit 1 - - fi - - ifconfig $CURRENT_ADAPTER_NAME down - ip link set $CURRENT_ADAPTER_NAME name eth0 - ifconfig eth0 up - - fi - rm -R /etc/network/interfaces &> /dev/null # armbian symlink for bulky network-manager cp /boot/dietpi/conf/network_interfaces /etc/network/interfaces - /DietPi/dietpi/func/obtain_network_details Error_Check # - enable allow-hotplug eth0 after copying. - sed -i "/allow-hotplug eth/c\allow-hotplug eth$(sed -n 1p /DietPi/dietpi/.network)" /etc/network/interfaces + sed -i "/allow-hotplug eth/c\allow-hotplug eth0" /etc/network/interfaces # - Remove all predefined eth*/wlan* adapter rules rm /etc/udev/rules.d/70-persistent-net.rules &> /dev/null rm /etc/udev/rules.d/70-persistant-net.rules &> /dev/null @@ -952,7 +933,6 @@ _EOF_ dpkg-reconfigure keyboard-configuration #Keyboard must be plugged in for this to work! dpkg-reconfigure locales # en_GB.UTF8 as default and only installed locale - # - Pump default locale into sys env: https://github.com/Fourdee/DietPi/issues/825 cat << _EOF_ > /etc/environment LC_ALL=en_GB.UTF-8 @@ -1048,9 +1028,8 @@ _EOF_ G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ - G_DIETPI-NOTIFY 2 'Installing Dropbear by default' + G_DIETPI-NOTIFY 2 'Configuring Dropbear:' - G_AGI dropbear # set to start on next boot sed -i '/NO_START=1/c\NO_START=0' /etc/default/dropbear From 6aeb32c1cf7173a4924ee9751c64215086d06960 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 21 Dec 2017 06:31:06 +0000 Subject: [PATCH 113/390] v160 + Automate TZdata/Locale: https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 56df885d7d..b699bed0b7 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -926,12 +926,24 @@ _EOF_ systemctl disable systemd-timesyncd rm /etc/init.d/ntp &> /dev/null - G_DIETPI-NOTIFY 2 "Configuring regional settings (TZ/Locale/Keyboard):" + G_DIETPI-NOTIFY 2 "Configuring regional settings (TZdata):" + + echo "Europe/London" > /etc/timezone + dpkg-reconfigure -f noninteractive tzdata #Europe > London + Error_Check + + G_DIETPI-NOTIFY 2 "Configuring regional settings (Keyboard):" - #TODO: automate these... - dpkg-reconfigure tzdata #Europe > London dpkg-reconfigure keyboard-configuration #Keyboard must be plugged in for this to work! - dpkg-reconfigure locales # en_GB.UTF8 as default and only installed locale + + G_DIETPI-NOTIFY 2 "Configuring regional settings (Locale):" + + sed -i 's/^\([^#]\)/#\1/g' /etc/locale.gen + sed -i '/en_GB.UTF-8 UTF-8/c\en_GB.UTF-8 UTF-8' /etc/locale.gen + #locale-gen + update-locale + dpkg-reconfigure -f noninteractive locales # en_GB.UTF8 as only installed locale + Error_Check # - Pump default locale into sys env: https://github.com/Fourdee/DietPi/issues/825 cat << _EOF_ > /etc/environment From d5b4394cf06df64f7794e4114d76f121454e82a2 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 21 Dec 2017 06:57:08 +0000 Subject: [PATCH 114/390] v160 + Grub package tweaks: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353272357 + Automate keyboard (if its plugged in): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353272357 --- PREP_SYSTEM_FOR_DIETPI.sh | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index b699bed0b7..4623ad33ba 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -202,6 +202,7 @@ #------------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------------ + echo -e '' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' G_DIETPI-NOTIFY 0 'Step 0: Detecting existing DietPi system:' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' @@ -245,6 +246,7 @@ #------------------------------------------------------------------------------------------------ + echo -e '' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' G_DIETPI-NOTIFY 0 'Step 1: Initial prep to allow this script to function:' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' @@ -263,6 +265,7 @@ Error_Check #------------------------------------------------------------------------------------------------ + echo -e '' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' G_DIETPI-NOTIFY 0 'Step 2: Hardware selection:' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' @@ -323,6 +326,7 @@ echo -e "$G_HW_MODEL" > /etc/.dietpi_hw_model_identifier #------------------------------------------------------------------------------------------------ + echo -e '' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' G_DIETPI-NOTIFY 0 'Step 3: Distro selection / APT prep:' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' @@ -441,6 +445,7 @@ _EOF_ #------------------------------------------------------------------------------------------------ + echo -e '' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' G_DIETPI-NOTIFY 0 'Step 4: APT removals:' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' @@ -513,19 +518,19 @@ _EOF_ aPACKAGES_REQUIRED_INSTALL+=('firmware-linux-nonfree') #aPACKAGES_REQUIRED_INSTALL+=('firmware-misc-nonfree') #aPACKAGES_REQUIRED_INSTALL+=('dmidecode') - if (( $(dpkg --get-selections | grep -ci -m1 '^grub2[[:space:]]') )); then - aPACKAGES_REQUIRED_INSTALL+=('grub2') - - elif (( $(dpkg --get-selections | grep -ci -m1 '^grub-efi-amd64[[:space:]]') )); then + # Grub EFI + if (( $(dpkg --get-selections | grep -ci -m1 '^grub-efi-amd64[[:space:]]') )) || + [ -d /boot/efi ]; then aPACKAGES_REQUIRED_INSTALL+=('grub-efi-amd64') + # Grub BIOS else - [ -d /boot/efi ] && aPACKAGES_REQUIRED_INSTALL+=('grub-efi-amd64') || aPACKAGES_REQUIRED_INSTALL+=('grub2') + aPACKAGES_REQUIRED_INSTALL+=('grub2') - fi + fi fi @@ -594,6 +599,7 @@ _EOF_ #------------------------------------------------------------------------------------------------ + echo -e '' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' G_DIETPI-NOTIFY 0 'Step 5: APT Installations:' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' @@ -658,6 +664,7 @@ _EOF_ #------------------------------------------------------------------------------------------------ + echo -e '' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' G_DIETPI-NOTIFY 0 'Step 6: Downloading and installing DietPi sourcecode' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' @@ -726,6 +733,7 @@ _EOF_ Error_Check #------------------------------------------------------------------------------------------------ + echo -e '' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' G_DIETPI-NOTIFY 0 "Step 7: Prep system for DietPi ENV:" G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' @@ -934,7 +942,7 @@ _EOF_ G_DIETPI-NOTIFY 2 "Configuring regional settings (Keyboard):" - dpkg-reconfigure keyboard-configuration #Keyboard must be plugged in for this to work! + dpkg-reconfigure -f noninteractive keyboard-configuration #Keyboard must be plugged in for this to work! G_DIETPI-NOTIFY 2 "Configuring regional settings (Locale):" @@ -1035,6 +1043,7 @@ _EOF_ #------------------------------------------------------------------------------------------------ + echo -e '' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' G_DIETPI-NOTIFY 0 "Step 8: Finalise system for first run of DietPi:" G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' From f82b707ada2f80891dce153d57eae9723bb74f95 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 21 Dec 2017 07:06:25 +0000 Subject: [PATCH 115/390] v160 + grub2 is a dummy package, corrected with grub-pc: https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 4623ad33ba..168d470f9c 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -528,7 +528,7 @@ _EOF_ # Grub BIOS else - aPACKAGES_REQUIRED_INSTALL+=('grub2') + aPACKAGES_REQUIRED_INSTALL+=('grub-pc') fi From 787a1d97bb978cda03d299535564035def50e4b7 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 21 Dec 2017 07:38:09 +0000 Subject: [PATCH 116/390] v160 + General | wget: Now set to prefer IPv4 by default (generally faster): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 General | APT: Now set to force IPv4 by default (generally faster): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 --- CHANGELOG.txt | 2 ++ PREP_SYSTEM_FOR_DIETPI.sh | 20 +++++++++----------- dietpi.txt | 4 ++-- dietpi/func/dietpi-set_core_environment | 10 +++++++++- dietpi/patch_file | 4 ++++ 5 files changed, 26 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 524d1e467c..5ead6e5986 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,8 @@ Image Modifications: Changes / Improvements / Optimizations: General | Start of FHS compliance: https://github.com/Fourdee/DietPi/issues/1297#issuecomment-352241193 +General | wget: Now set to prefer IPv4 by default (generally faster): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 +General | APT: Now set to force IPv4 by default (generally faster): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 DietPi-Boot | Improved the method of initial FS_partition and FS_expansion during 1st run, via systemD services. 'fs_force_resize=' in dietpi.txt is no longer supported: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352159930 DietPi-Banner | IP: Will now also list the active network adapter used (eg: eth0/wlan0) DietPi-Drive_Manager | Added support for exFAT, many thanks @MichaIng : https://github.com/Fourdee/DietPi/pull/1312 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 168d470f9c..a4401d9d6d 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -7,14 +7,6 @@ # - Currently running Debian (ideally minimal, eg: Raspbian Lite-ish =)) ) # - Active eth0 connection #------------------------------------------------------------------------------------------------ - # DO NOT USE. Currently under testing. - #------------------------------------------------------------------------------------------------ - - #G_AGUP - #apt-get install wget || or make it a pre-req? - #wget - #load - #Pull in dietpi-globals #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. LANG=en_GB.UTF-8 @@ -42,6 +34,9 @@ ) + # - APT force IPv4 + echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99force-ipv + for (( i=0; i<${#a_MIN_APT_PREREQS[@]}; i++)) do @@ -62,6 +57,9 @@ unset a_MIN_APT_PREREQS + # - Wget prefer IPv4 + sed -i '/prefer-family =/c\prefer-family = IPv4' /etc/wgetrc &> /dev/null + #Download DietPi-Globals # - NB: we'll have to manually handle errors, until script is sucessfully loaded wget https://raw.githubusercontent.com/Fourdee/DietPi/$GIT_BRANCH/dietpi/func/dietpi-globals -O dietpi-globals @@ -1116,11 +1114,11 @@ _EOF_ /DietPi/dietpi/func/dietpi-set_hardware wifimodules onboard_enable - G_DIETPI-NOTIFY 2 'Configuring IP version preferences' + #G_DIETPI-NOTIFY 2 'Configuring IP version preferences' - /DietPi/dietpi/func/dietpi-set_hardware preferipversion auto + #/DietPi/dietpi/func/dietpi-set_hardware preferipversion ipv4 #Already done at top of script, and now default in dietpi.txt - G_DIETPI-NOTIFY 2 'Configuring kernels' + G_DIETPI-NOTIFY 2 'Configuring kernel' # - Disable installed flags rm /etc/dietpi/.* diff --git a/dietpi.txt b/dietpi.txt index f2586ff6ae..c539be54c9 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -178,8 +178,8 @@ soundcard=none #LCD Panel addon lcdpanel=none -#Prefer IPversion (for: apt-get) | auto (let system decide) / ipv4 (force) / ipv6 (force) | eg: force IPv4 with prefer_ipversion=ipv4 -prefer_ipversion=auto +#Prefer IPversion (for: APT) | auto (let system decide) / ipv4 (force) / ipv6 (force) | eg: force IPv4 with prefer_ipversion=ipv4 +prefer_ipversion=ipv4 #Apt mirrors which are applied to /etc/apt/sources.list | Values here will also be applied during 1st run setup # Raspbian = https://www.raspbian.org/RaspbianMirrors diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index d86cca5f94..77438e108f 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -366,7 +366,7 @@ _EOF_ #----------------------------------------------------------------------------------- #Network - G_DIETPI-NOTIFY 2 "Configuring: Prefer wlan/eth naming for networked devices:" + G_DIETPI-NOTIFY 2 "Configuring: prefer wlan/eth naming for networked devices:" # - Prefer to use wlan/eth naming for networked devices (eg: stretch) ln -sf /dev/null /etc/systemd/network/99-default.link @@ -380,6 +380,14 @@ _EOF_ fi + G_DIETPI-NOTIFY 2 "Configuring: prefer IPv4 (wget):" + + sed -i '/prefer-family =/c\prefer-family = IPv4' /etc/wgetrc + + G_DIETPI-NOTIFY 2 "Configuring: force IPv4 (APT):" + + echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99force-ipv + #----------------------------------------------------------------------------------- #MISC diff --git a/dietpi/patch_file b/dietpi/patch_file index adcfc149ff..71a930acf2 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2971,6 +2971,9 @@ _EOF_ fi #------------------------------------------------------------------------------- #FHS changes: https://github.com/Fourdee/DietPi/issues/1297 + # APT now IPv4 forced: + # - Update core ENV + sed -i '/prefer_ipversion=/c\Sprefer_ipversion=ipv4' /DietPi/dietpi.txt /DietPi/dietpi/func/dietpi-set_core_environment # - DietPi-autostart custom script moved @@ -2978,6 +2981,7 @@ _EOF_ mv /etc/dietpi/autostart.sh /var/lib/dietpi/dietpi-autostart/custom.sh &> /dev/null #------------------------------------------------------------------------------- + fi #------------------------------------------------------------------------------- From 329f868a2da60c6bdf02b987bc3c4218da54baf1 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 21 Dec 2017 08:03:04 +0000 Subject: [PATCH 117/390] v160 + Minor error fixes: https://github.com/Fourdee/DietPi/issues/1285 Move apt-cache rm to end of script. --- PREP_SYSTEM_FOR_DIETPI.sh | 16 +++++++++------- dietpi/func/dietpi-set_hardware | 11 +++-------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index a4401d9d6d..5ef74ff4da 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1057,13 +1057,6 @@ _EOF_ /DietPi/dietpi/dietpi-services stop /DietPi/dietpi/dietpi-services dietpi_controlled - G_DIETPI-NOTIFY 2 'Clearing APT cache' - - apt-get clean - rm -R /var/lib/apt/lists/* -vf #lists cache: remove partial folder also, automatically gets regenerated on G_AGUP - #rm /var/lib/dpkg/info/* #issue... - #dpkg: warning: files list file for package 'libdbus-1-3:armhf' missing; assuming package has no files currently installed - G_DIETPI-NOTIFY 2 'Running general cleanup of misc files' # - general folders @@ -1134,6 +1127,8 @@ _EOF_ G_DIETPI-NOTIFY 2 'Disabling soundcards by default' /DietPi/dietpi/func/dietpi-set_hardware soundcard none + # Alsa-utils is auto installed to reset soundcard settings on some ARM devices. uninstall it afterwards + G_AGP alsa-utils G_DIETPI-NOTIFY 2 'Setting default CPU gov' @@ -1176,6 +1171,13 @@ _EOF_ rm /DietPi/dietpi/patch_file &> /dev/null rm /DietPi/dietpi/server_version &> /dev/null + G_DIETPI-NOTIFY 2 'Clearing APT cache' + + apt-get clean + rm -R /var/lib/apt/lists/* -vf #lists cache: remove partial folder also, automatically gets regenerated on G_AGUP + #rm /var/lib/dpkg/info/* #issue... + #dpkg: warning: files list file for package 'libdbus-1-3:armhf' missing; assuming package has no files currently installed + # - HW Specific # RPi remove saved G_HW_MODEL , allowing obtain-hw_model to auto detect RPi model if (( $G_HW_MODEL < 10 )); then diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 698deca5a6..000b263bf4 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1159,9 +1159,9 @@ _EOF_ #bluetooth last systemctl stop bluetooth 2> /dev/null - if (( $? != 0 )); then + if (( $? != 0 && $(dpkg --get-selections | grep -ci -m1 '^bluetooth[[:space:]]') )); then - G_DIETPI-NOTIFY 2 "Bluetooth service failed to stop. Is it installed?" + G_DIETPI-NOTIFY 2 "Bluetooth service failed to stop" EXIT_CODE=1 fi @@ -1353,7 +1353,7 @@ _EOF_ done #Disable powersave being applied - systemctl disable wifi_disable_powersave + systemctl disable wifi_disable_powersave &> /dev/null rm /etc/systemd/system/wifi_disable_powersave.service &> /dev/null # - Enable @@ -1677,11 +1677,6 @@ _EOF_ G_DIETPI-NOTIFY 2 "Installing alsa-utils. Please wait..." G_AGI alsa-utils - if (( $? != 0 )); then - - G_DIETPI-NOTIFY 1 "Unable to install alsa-utils." - - fi fi From bd3778662d678e1817bdce095a13441b38e51b10 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 21 Dec 2017 09:11:40 +0000 Subject: [PATCH 118/390] v160 + Possible fix for Distro up/downgrade in relation to G_DISTRO and G_AGX commands: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353289330 --- PREP_SYSTEM_FOR_DIETPI.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 5ef74ff4da..7c7a43fed4 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -410,10 +410,6 @@ _EOF_ G_AGUP Error_Check - # - Distro is now target - G_DISTRO=$DISTRO_TARGET - G_DISTRO_NAME=$DISTRO_TARGET_NAME - # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files G_DIETPI-NOTIFY 2 "Marking all packages as auto installed first, to allow allow effective autoremove afterwards" @@ -608,12 +604,15 @@ _EOF_ G_AGDUG Error_Check + # - Distro is now target (for APT purposes and G_AGX support due to installed binary, its here, instead of after G_AGUP) + G_DISTRO=$DISTRO_TARGET + G_DISTRO_NAME=$DISTRO_TARGET_NAME + G_DIETPI-NOTIFY 2 "Disabling swapfile generation for dphys-swapfile during install" echo -e "CONF_SWAPSIZE=0" > /etc/dphys-swapfile Error_Check - G_DIETPI-NOTIFY 2 "Installing core DietPi pre-req APT packages" G_AGI $INSTALL_PACKAGES From 990e7867f86a0eab464f9821d910de115193d02d Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 21 Dec 2017 10:57:55 +0000 Subject: [PATCH 119/390] v160 + Debugging --- PREP_SYSTEM_FOR_DIETPI.sh | 50 +++++++++++++++++++++----------------- dietpi/func/dietpi-globals | 9 +++++-- 2 files changed, 35 insertions(+), 24 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 7c7a43fed4..6d7085aaf5 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -60,32 +60,12 @@ # - Wget prefer IPv4 sed -i '/prefer-family =/c\prefer-family = IPv4' /etc/wgetrc &> /dev/null - #Download DietPi-Globals - # - NB: we'll have to manually handle errors, until script is sucessfully loaded - wget https://raw.githubusercontent.com/Fourdee/DietPi/$GIT_BRANCH/dietpi/func/dietpi-globals -O dietpi-globals - if (( $? != 0 )); then - - echo -e 'Error: Unable to download dietpi-globals. Aborting...\n' - exit 1 - - fi - - # - load - chmod +x dietpi-globals - . ./dietpi-globals - if (( $? != 0 )); then - - echo -e 'Error: Unable to load dietpi-globals. Aborting...\n' - exit 1 - - fi - #------------------------------------------------------------------------------------------------ #Globals #------------------------------------------------------------------------------------------------ #System - #G_DISTRO # init from dietpi-globals - #G_DISTRO_NAME # init from dietpi-globals + export G_DISTRO=0 # Export to dietpi-globals + export G_DISTRO_NAME='NULL' # Export to dietpi-globals DISTRO_TARGET=0 DISTRO_TARGET_NAME='' if grep -q 'wheezy' /etc/os-release; then @@ -141,6 +121,32 @@ fi + #Download DietPi-Globals + # - NB: we'll have to manually handle errors, until script is sucessfully loaded + wget https://raw.githubusercontent.com/Fourdee/DietPi/$GIT_BRANCH/dietpi/func/dietpi-globals -O dietpi-globals + if (( $? != 0 )); then + + echo -e 'Error: Unable to download dietpi-globals. Aborting...\n' + exit 1 + + fi + + # - load + chmod +x dietpi-globals + . ./dietpi-globals + if (( $? != 0 )); then + + echo -e 'Error: Unable to load dietpi-globals. Aborting...\n' + exit 1 + + fi + + #DEBUG: + G_AGI omgwtfbbq + G_DISTRO=-1 + G_AGI omgwtfbbq + #DEBUG: + #URL connection test var holder INTERNET_ADDRESS='' diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 5b57dc26b9..e78dff7ef1 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -209,8 +209,9 @@ G_HW_CPU_CORES=1 G_HW_CPUID=0 - G_DISTRO=0 - G_DISTRO_NAME='NULL' + # If already init, use existing value. + G_DISTRO=${G_DISTRO:-0} + G_DISTRO_NAME=${G_DISTRO_NAME:-NULL} # - Update # NB: dietpi-boot service launches dietpi-obtain_hw_model to create the following file @@ -290,6 +291,10 @@ local force_options='' local exit_code=0 + #DEBUG: + echo -e $G_DISTRO + #DEBUG: + if (( $G_DISTRO >= 4 )); then force_options='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' From b86d97704873bd207338ec3a929c320967146a92 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 21 Dec 2017 11:02:01 +0000 Subject: [PATCH 120/390] v160 + Remove debugging --- PREP_SYSTEM_FOR_DIETPI.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 6d7085aaf5..5d36572ce2 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -141,12 +141,6 @@ fi - #DEBUG: - G_AGI omgwtfbbq - G_DISTRO=-1 - G_AGI omgwtfbbq - #DEBUG: - #URL connection test var holder INTERNET_ADDRESS='' From efcde5f6b43293e128f765e533b12baebdb99f7e Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 21 Dec 2017 11:06:33 +0000 Subject: [PATCH 121/390] v160 + Remove debugging --- dietpi/func/dietpi-globals | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index e78dff7ef1..f8de11b60c 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -291,10 +291,6 @@ local force_options='' local exit_code=0 - #DEBUG: - echo -e $G_DISTRO - #DEBUG: - if (( $G_DISTRO >= 4 )); then force_options='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' From cc087e9c297a53fa95bb5f99308a3be177c78e04 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 22 Dec 2017 01:45:37 +0100 Subject: [PATCH 122/390] v160 + Installing Intel or AMD microcode package only, if related CPU is detected. + Start to make Wifi optional. Needs further changes within other scripts. --- PREP_SYSTEM_FOR_DIETPI.sh | 44 ++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 5d36572ce2..8ddb813a39 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -456,7 +456,6 @@ _EOF_ 'bzip2' # .bz2 wrapper 'ca-certificates' # Adds known ca-certificates, necessary to practically access https sources 'console-setup' # DietPi-Config keyboard configuration - 'crda' # WiFi related 'cron' # background job scheduler 'curl' # Web address testing, downloading, uploading etc. 'dbus' # System message bus @@ -467,10 +466,6 @@ _EOF_ 'ethtool' # Ethernet link checking 'fake-hwclock' # Hardware clock emulation, to allow correct timestamps during boot before network time sync 'fbset' # DietPi-Config display settings - 'firmware-atheros' # WiFi dongle firmware - 'firmware-brcm80211' # WiFi dongle firmware - 'firmware-ralink' # WiFi dongle firmware - 'firmware-realtek' # WiFi dongle firmware 'gnupg' # apt-key add 'hdparm' # Drive power management adjustment 'hfsplus' # DietPi-Drive_Manager NTS (MacOS) file system support @@ -478,7 +473,6 @@ _EOF_ 'initramfs-tools' # RAM file system initialization 'iputils-ping' # ping command 'isc-dhcp-client' # DHCP client - 'iw' # WiFi related 'locales' # Support locales, necessary for DietPi scripts, as we use enGB.UTF8 as default language 'nano' # Simple text editor 'net-tools' # DietPi-Boot: Network tools, ifconfig, route etc. @@ -488,15 +482,12 @@ _EOF_ 'parted' # DietPi-Boot + DietPi-Drive_Manager 'psmisc' # DietPi-Boot + DietPi-Software: e.g. killall 'resolvconf' # System name server updater - 'rfkill' # WiFi related: Used by some onboard WiFi chipsets 'sudo' # DietPi-Software + general use 'tzdata' # Time zone data for system clock, auto summer/winter time adjustment 'unzip' # .zip unwrapper 'usbutils' # DietPi-Software + DietPi-Bugreport: e.g. lsusb 'wget' # download 'whiptail' # DietPi dialogs - 'wireless-tools' # WiFi related - 'wpasupplicant' # WiFi related 'wput' # upload 'zip' # .zip wrapper @@ -507,8 +498,8 @@ _EOF_ if (( $G_HW_ARCH == 10 )); then aPACKAGES_REQUIRED_INSTALL+=('linux-image-amd64') - aPACKAGES_REQUIRED_INSTALL+=('intel-microcode') - aPACKAGES_REQUIRED_INSTALL+=('amd64-microcode') + grep 'vendor_id' /proc/cpuinfo | grep -qi 'intel' && aPACKAGES_REQUIRED_INSTALL+=('intel-microcode') + grep 'vendor_id' /proc/cpuinfo | grep -qi 'amd' && aPACKAGES_REQUIRED_INSTALL+=('amd64-microcode') aPACKAGES_REQUIRED_INSTALL+=('firmware-linux-nonfree') #aPACKAGES_REQUIRED_INSTALL+=('firmware-misc-nonfree') #aPACKAGES_REQUIRED_INSTALL+=('dmidecode') @@ -566,6 +557,35 @@ _EOF_ aPACKAGES_REQUIRED_INSTALL+=('device-tree-compiler') #Kern fi + + G_DIETPI-NOTIFY 2 "WiFi selection" + + WHIP_TITLE='WiFi required?' + WHIP_DESC='Please select an option' + WHIP_DEFAULT_ITEM=1 + WHIP_MENU_ARRAY=( + + '0' "I don't require WiFi, do not install." + '1' 'I require WiFi functionality, keep/install related packages.' + + ) + + Run_Whiptail + if (( $WHIP_RETURN_VALUE == 1 )); then + + G_DIETPI-NOTIFY 2 "Marking WiFi as needed" + + aPACKAGES_REQUIRED_INSTALL+=('crda') # WiFi related + aPACKAGES_REQUIRED_INSTALL+=('firmware-atheros') # WiFi dongle firmware + aPACKAGES_REQUIRED_INSTALL+=('firmware-brcm80211') # WiFi dongle firmware + aPACKAGES_REQUIRED_INSTALL+=('firmware-ralink') # WiFi dongle firmware + aPACKAGES_REQUIRED_INSTALL+=('firmware-realtek') # WiFi dongle firmware + aPACKAGES_REQUIRED_INSTALL+=('iw') # WiFi related + aPACKAGES_REQUIRED_INSTALL+=('rfkill') # WiFi related: Used by some onboard WiFi chipsets + aPACKAGES_REQUIRED_INSTALL+=('wireless-tools') # WiFi related + aPACKAGES_REQUIRED_INSTALL+=('wpasupplicant') # WiFi related + + fi G_DIETPI-NOTIFY 2 "Generating list of minimal packages, required for DietPi installation:" @@ -620,7 +640,7 @@ _EOF_ G_DIETPI-NOTIFY 2 "Onboard Bluetooth selection" - WHIP_TITLE='Bluetooth Required?' + WHIP_TITLE='Bluetooth required?' WHIP_DESC='Please select an option' WHIP_DEFAULT_ITEM=0 WHIP_MENU_ARRAY=( From b309488f6cd335e2d0eee9c51406eef22891c9a3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 22 Dec 2017 02:57:12 +0100 Subject: [PATCH 123/390] v160 + Pydio version update --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 7d3eb0edcf..862bf45e35 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6054,7 +6054,7 @@ _EOF_ Banner_Installing #check folder is online - INSTALL_URL_ADDRESS='https://download.pydio.com/pub/core/archives/pydio-core-8.0.1.zip' + INSTALL_URL_ADDRESS='https://download.pydio.com/pub/core/archives/pydio-core-8.0.2.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install From ab7c1ba1cb638e9a8e4ef7836e3f786aba019c70 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 22 Dec 2017 03:05:28 +0100 Subject: [PATCH 124/390] v160 + Blynk server version update --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 862bf45e35..deebbff755 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5227,7 +5227,7 @@ _EOF_ mkdir -p /etc/blynkserver - INSTALL_URL_ADDRESS='https://github.com/blynkkk/blynk-server/releases/download/v0.25.2/server-0.25.2.jar' + INSTALL_URL_ADDRESS='https://github.com/blynkkk/blynk-server/releases/download/v0.29.2/server-0.29.2.jar' wget "$INSTALL_URL_ADDRESS" -O /etc/blynkserver/server.jar # - Install Blynk JS Libary From 5ef3fc63815abff4002aaa47a91a0c0d4feae750 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 22 Dec 2017 07:11:36 +0000 Subject: [PATCH 125/390] v160 + firmware-realtek added back to core packages, contains ethernet firmware: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353534076 @MichaIng --- PREP_SYSTEM_FOR_DIETPI.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 8ddb813a39..097f409be3 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -466,6 +466,7 @@ _EOF_ 'ethtool' # Ethernet link checking 'fake-hwclock' # Hardware clock emulation, to allow correct timestamps during boot before network time sync 'fbset' # DietPi-Config display settings + 'firmware-realtek' # Eth/WiFi/BT dongle firmware 'gnupg' # apt-key add 'hdparm' # Drive power management adjustment 'hfsplus' # DietPi-Drive_Manager NTS (MacOS) file system support @@ -557,7 +558,7 @@ _EOF_ aPACKAGES_REQUIRED_INSTALL+=('device-tree-compiler') #Kern fi - + G_DIETPI-NOTIFY 2 "WiFi selection" WHIP_TITLE='WiFi required?' @@ -579,7 +580,6 @@ _EOF_ aPACKAGES_REQUIRED_INSTALL+=('firmware-atheros') # WiFi dongle firmware aPACKAGES_REQUIRED_INSTALL+=('firmware-brcm80211') # WiFi dongle firmware aPACKAGES_REQUIRED_INSTALL+=('firmware-ralink') # WiFi dongle firmware - aPACKAGES_REQUIRED_INSTALL+=('firmware-realtek') # WiFi dongle firmware aPACKAGES_REQUIRED_INSTALL+=('iw') # WiFi related aPACKAGES_REQUIRED_INSTALL+=('rfkill') # WiFi related: Used by some onboard WiFi chipsets aPACKAGES_REQUIRED_INSTALL+=('wireless-tools') # WiFi related From 3e5feb102d8c0ec213988da1754de52ea3b3fef2 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 22 Dec 2017 08:41:16 +0000 Subject: [PATCH 126/390] v160 - Disable downgrades of Distro: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353534076 RE: @MichaIng --- PREP_SYSTEM_FOR_DIETPI.sh | 45 ++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 097f409be3..b0933f907e 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -173,7 +173,7 @@ WHIP_CHOICE=0 Run_Whiptail(){ - WHIP_OPTION=$(whiptail --title "$WHIP_TITLE" --menu "$WHIP_DESC" --default-item "$WHIP_DEFAULT_ITEM" --backtitle "$WHIP_BACKTITLE" 20 80 12 "${WHIP_MENU_ARRAY[@]}" 3>&1 1>&2 2>&3) + WHIP_OPTION=$(whiptail --title "$WHIP_TITLE" --menu "$WHIP_DESC" --default-item "$WHIP_DEFAULT_ITEM" --backtitle "$WHIP_BACKTITLE" 24 85 12 "${WHIP_MENU_ARRAY[@]}" 3>&1 1>&2 2>&3) WHIP_CHOICE=$? if (( $WHIP_CHOICE == 0 )); then @@ -331,15 +331,50 @@ #------------------------------------------------------------------------------------------------ WHIP_TITLE='Distro Selection:' - WHIP_DESC='Please select a distro to install on this system. Selecting a distro that is older than the current installed on system, is not supported.' + WHIP_DESC="Please select a distro to install on this system. Selecting a distro that is older than the current installed on system, is not supported.\n\nCurrently installed:\n - $G_DISTRO $G_DISTRO_NAME" WHIP_DEFAULT_ITEM=$G_DISTRO - WHIP_MENU_ARRAY=( + DISTRO_LIST_ARRAY=( '3' 'Jessie (oldstable, just if you need to avoid upgrade to current release)' '4' 'Stretch (current stable release, recommended)' + '5' 'Buster (testing only, not officially suppoted)' ) - if (( $G_HW_MODEL >= 10 )); then - WHIP_MENU_ARRAY+=('5' 'Buster (testing only, not officially suppoted)') + # - Enable/list available options based on criteria + # NB: Whiptail use 2 array indexs per whip displayed entry. + for ((i=0; i<$(( ${#DISTRO_LIST_ARRAY[@]} / 2 )); i++)) + do + temp_distro_available=1 + temp_distro_index=$(( $i + 3 )) + + # - Disable downgrades + if (( $temp_distro_index < $G_DISTRO )); then + + G_DIETPI-NOTIFY 2 "Disabled Distro downgrade: index $temp_distro_index" + temp_distro_available=0 + + # - RPi disable buster + elif (( $temp_distro_index == 5 && $G_HW_MODEL < 10 )); then + + G_DIETPI-NOTIFY 2 "Disabled Buster for RPi: index $temp_distro_index" + temp_distro_available=0 + + fi + + # - Enable option + if (( $temp_distro_available )); then + + WHIP_MENU_ARRAY+=( "${DISTRO_LIST_ARRAY[$(( $i * 2 ))]}" "${DISTRO_LIST_ARRAY[$(( ($i * 2) + 1 ))]}") + fi + + done + + #delete [] + unset DISTRO_LIST_ARRAY + + if [ -z ${WHIP_MENU_ARRAY+x} ]; then + + G_DIETPI-NOTIFY 1 'Error: No available Distros for this system. Aborting...' + exit 1 fi From e3e61b6ca171cf17fe5f0ce629a7945ee12170ee Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 22 Dec 2017 09:35:54 +0000 Subject: [PATCH 127/390] v160 + G_CHECKINSTALL_PREREQ Check and auto install packages: https://github.com/Fourdee/DietPi/issues/1311#issuecomment-353559932 @MichaIng this will come in handy --- CHANGELOG.txt | 2 ++ PREP_SYSTEM_FOR_DIETPI.sh | 4 +++- dietpi/func/dietpi-globals | 49 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5ead6e5986..91052e833d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,8 @@ v160 Image Modifications: Changes / Improvements / Optimizations: +General | We have completed much needed backbone work for DietPi, which will allow for improved expansion in source code. This includes the use of dietpi-globals. +DietPi-Globals | New script which optimizes most used DietPi commands and vars, throughout our scripts. Also exported to bash session, please type 'G_' then press 'TAB' to see a full list of options. General | Start of FHS compliance: https://github.com/Fourdee/DietPi/issues/1297#issuecomment-352241193 General | wget: Now set to prefer IPv4 by default (generally faster): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 General | APT: Now set to force IPv4 by default (generally faster): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index b0933f907e..739830e493 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -363,7 +363,8 @@ # - Enable option if (( $temp_distro_available )); then - WHIP_MENU_ARRAY+=( "${DISTRO_LIST_ARRAY[$(( $i * 2 ))]}" "${DISTRO_LIST_ARRAY[$(( ($i * 2) + 1 ))]}") + WHIP_MENU_ARRAY+=( "${DISTRO_LIST_ARRAY[$(( $i * 2 ))]}" "${DISTRO_LIST_ARRAY[$(( ($i * 2) + 1 ))]}" ) + fi done @@ -1183,6 +1184,7 @@ _EOF_ /DietPi/dietpi/func/dietpi-set_hardware soundcard none # Alsa-utils is auto installed to reset soundcard settings on some ARM devices. uninstall it afterwards G_AGP alsa-utils + G_AGA G_DIETPI-NOTIFY 2 'Setting default CPU gov' diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index f8de11b60c..6548033dbd 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -428,6 +428,55 @@ } + #Checks for required APT packages, installs if needed. + # $@ = list of required packages + G_CHECKINSTALL_PREREQ(){ + + local fp_temp='/tmp/.G_CHECK_INSTALL_PREREQ' + local exit_code=0 + local string=( "$@" ) + local packages_to_install='' + + G_DIETPI-NOTIFY 2 "Checking for currently installed pre-req packages: ${string[@]}" + + dpkg --get-selections > "$fp_temp" + for i in "${string[@]}" + do + + + if (( ! $(grep -ci -m1 "^$i[[:space:]]" "$fp_temp") )); then + + G_DIETPI-NOTIFY 2 "($i) | Not found, flagging pre-req package for installation" + packages_to_install+=" $i" + + else + + G_DIETPI-NOTIFY 2 "($i) | Currently installed" + + fi + + done + + if [ -n "$packages_to_install" ]; then + + G_DIETPI-NOTIFY 2 "Installing pre-req packages, please wait..." + G_AGI $packages_to_install + exit_code=$? + + else + + G_DIETPI-NOTIFY 2 "Pre-req packages already installed" + + fi + + G_DIETPI-NOTIFY -1 $exit_code 'G_CHECK_INSTALL_PREREQ:' + + rm "$fp_temp" + + return $exit_code + + } + #----------------------------------------------------------------------------------- G_DIETPI-NOTIFY 2 'DietPi-Globals loaded\n' #----------------------------------------------------------------------------------- From bcafed9ba205db067e7d8e2808c1af1f52eddb91 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 22 Dec 2017 09:39:17 +0000 Subject: [PATCH 128/390] v160 + Minor: Rename to G_AG_CHECK_INSTALL_PREREQ, to keep inline with current G_AG standard: https://github.com/Fourdee/DietPi/issues/1311#issuecomment-353559932 --- dietpi/func/dietpi-globals | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 6548033dbd..8362c0aa17 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -430,9 +430,9 @@ #Checks for required APT packages, installs if needed. # $@ = list of required packages - G_CHECKINSTALL_PREREQ(){ + G_AG_CHECK_INSTALL_PREREQ(){ - local fp_temp='/tmp/.G_CHECK_INSTALL_PREREQ' + local fp_temp='/tmp/.G_AG_CHECK_INSTALL_PREREQ' local exit_code=0 local string=( "$@" ) local packages_to_install='' @@ -443,7 +443,6 @@ for i in "${string[@]}" do - if (( ! $(grep -ci -m1 "^$i[[:space:]]" "$fp_temp") )); then G_DIETPI-NOTIFY 2 "($i) | Not found, flagging pre-req package for installation" From 376de9217f6e829558c20a8ecc44a721cc7be07c Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 22 Dec 2017 10:34:05 +0000 Subject: [PATCH 129/390] v160 + Further global additions and roll out: https://github.com/Fourdee/DietPi/issues/1311#issuecomment-353568940 --- dietpi/dietpi-backup | 9 +-- dietpi/dietpi-cloudshell | 2 +- dietpi/dietpi-config | 22 +++---- dietpi/dietpi-cpuinfo | 123 +++++++------------------------------ dietpi/dietpi-sync | 9 +-- dietpi/func/dietpi-globals | 105 +++++++++++++++++++++++++++---- 6 files changed, 129 insertions(+), 141 deletions(-) diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index 17c195c7a1..3dfdc0e692 100644 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -660,13 +660,10 @@ _EOF_ Check_Install_PreReqs(){ - #Rsync - if (( ! $(dpkg --get-selections | grep -ci -m1 '^rsync[[[:space:]]') )); then + G_AG_CHECK_INSTALL_PREREQ rsync + if (( $? != 0 )); then - G_DIETPI-NOTIFY 2 "Installing Rsync, please wait....\n" - sleep 1 - - G_AGI rsync + exit 1 fi diff --git a/dietpi/dietpi-cloudshell b/dietpi/dietpi-cloudshell index aac8eb5b52..1393c03824 100644 --- a/dietpi/dietpi-cloudshell +++ b/dietpi/dietpi-cloudshell @@ -321,7 +321,7 @@ CPU_TOTALPROCESSES=$(( $(ps --ppid 2 -p 2 --deselect | wc -l) - 2 )) # - ps process and descriptions. CPU_GOV=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor) - CPU_TEMP=$(/DietPi/dietpi/dietpi-cpuinfo 1) + CPU_TEMP=$(G_OBTAIN_CPU_TEMP) if [[ $CPU_TEMP =~ ^-?[0-9]+$ ]]; then diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 8c2a10a0df..750473dcd6 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1313,11 +1313,10 @@ CHOICE=$? if (( $CHOICE == 0 )); then - #Check its installed. Install if not. - if (( $(dpkg -l | grep -ci -m1 'rpi-update') == 0 )); then + G_AG_CHECK_INSTALL_PREREQ rpi-update + if (( $? != 0 )); then - echo -e "\n DietPi: Installing rpi-update, please wait...\n" - G_AGI rpi-update + exit 1 fi @@ -1514,7 +1513,7 @@ fi - local arm_temp=$(/DietPi/dietpi/dietpi-cpuinfo 1) + local arm_temp=$(G_OBTAIN_CPU_TEMP) local arm_temp_f='Unknown' if [[ $arm_temp =~ ^-?[0-9]+$ ]]; then @@ -4678,13 +4677,10 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ elif [ "$OPTION" = "Start" ]; then - #install stress - if (( ! $(dpkg --get-selections | grep -ci -m1 '^stress') )); then + G_AG_CHECK_INSTALL_PREREQ stress + if (( $? != 0 )); then - G_DIETPI-NOTIFY 2 'Installing Stress' - G_DIETPI-NOTIFY 2 'Please wait...' - - G_AGI stress + exit 1 fi @@ -4718,7 +4714,7 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ # - Check if system supports temp readouts local cpu_supports_temp=0 - local cpu_temp=$(/DietPi/dietpi/dietpi-cpuinfo 1) + local cpu_temp=$(G_OBTAIN_CPU_TEMP) if [[ $cpu_temp =~ ^-?[0-9]+$ ]]; then cpu_supports_temp=1 @@ -4730,7 +4726,7 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ while (( $(ps aux | grep -ci -m1 '[s]tress') == 1 )) do - cpu_temp=$(/DietPi/dietpi/dietpi-cpuinfo 1) + cpu_temp=$(G_OBTAIN_CPU_TEMP) remaning_time=$(( $STRESS_TEST_DURATION + ( $start_time_epoch - $(date +%s) ) )) echo -e "$(date) | $cpu_temp'c | $remaning_time seconds remaining" diff --git a/dietpi/dietpi-cpuinfo b/dietpi/dietpi-cpuinfo index edcd2c0106..f79dc7124d 100644 --- a/dietpi/dietpi-cpuinfo +++ b/dietpi/dietpi-cpuinfo @@ -13,7 +13,6 @@ # # Usage: # - /DietPi/dietpi/dietpi-cpuinfo Obtain stats and print - # - /DietPi/dietpi/dietpi-cpuinfo 1 Returns current CPU temp # - /DietPi/dietpi/dietpi-cpuinfo 2 Generates file of available, ordered scaling freq's "$FP_CPU_SCALINGAVAILABLE_FREQ" #//////////////////////////////////// @@ -39,7 +38,6 @@ fi #Funcs - CPU_USAGE=0 CPU_GOV_CURRENT='Unknown' aCPU_CURRENT_FREQ=0 @@ -100,112 +98,46 @@ CPU_TEMP_CURRENT='Unknown' CPU_TEMP_PRINT='Unknown' - #Array to store possible locations for temp read. - aFP_TEMPERATURE=( - - #'/sys/class/thermal/thermal_zone1/temp' #sparky/Asus, will break other SBC temp readouts as most have 2 zones, needs a special case - '/sys/class/thermal/thermal_zone0/temp' - '/sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/temp1_input' - '/sys/class/hwmon/hwmon0/device/temp_label' - - ) Obtain_Cpu_Temp(){ - for ((i=0; i<${#aFP_TEMPERATURE[@]}; i++)) - do - - if [ -f "${aFP_TEMPERATURE[$i]}" ]; then - - # Sparky/asus, special case: - if (( $G_HW_MODEL == 70 || $G_HW_MODEL == 100 || $G_HW_MODEL == 110 )); then - - CPU_TEMP_CURRENT=$(cat /sys/class/thermal/thermal_zone1/temp) - - else - - CPU_TEMP_CURRENT=$(cat ${aFP_TEMPERATURE[$i]}) - - fi - - # - Boards that provide 2 digit output - # Pine - # NanoPi M2 - # NanoPi M3 - # H3 3.x - # H2+ 3.x - if (( ( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 ) || - $G_HW_MODEL == 61 || - $G_HW_MODEL == 62 || - ( $G_HW_CPUID == 1 && $(uname -r | grep -ci -m1 '^3.') ) || - ( $G_HW_MODEL == 32 && $(uname -r | grep -ci -m1 '^3.') ) )); then - - echo -e "Do nothing" &> /dev/null - - else - - CPU_TEMP_CURRENT=$( echo -e "$CPU_TEMP_CURRENT" | awk '{print $1/1000}' | xargs printf "%0.0f" ) - - fi - - local cpu_temp_current_f='Unknown' - if [[ $CPU_TEMP_CURRENT =~ ^-?[0-9]+$ ]]; then - - cpu_temp_current_f=$(( ( $CPU_TEMP_CURRENT * 9 / 5 ) + 32 )) - if (( $CPU_TEMP_CURRENT >= 70 )); then - - CPU_TEMP_PRINT="\e[91mWarning: $CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f | Reducing the life of your device.\e[0m" + CPU_TEMP_CURRENT=$(G_OBTAIN_CPU_TEMP) - elif (( $CPU_TEMP_CURRENT >= 60 )); then + local cpu_temp_current_f='Unknown' + if [[ $CPU_TEMP_CURRENT =~ ^-?[0-9]+$ ]]; then - CPU_TEMP_PRINT="\e[38;5;202m$CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f\e[90m | Running hot, not recommended.\e[0m" + cpu_temp_current_f=$(( ( $CPU_TEMP_CURRENT * 9 / 5 ) + 32 )) + if (( $CPU_TEMP_CURRENT >= 70 )); then - elif (( $CPU_TEMP_CURRENT >= 50 )); then + CPU_TEMP_PRINT="\e[91mWarning: $CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f | Reducing the life of your device.\e[0m" - CPU_TEMP_PRINT="\e[93m$CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f\e[0m \e[90m | Running warm, but safe.\e[0m" + elif (( $CPU_TEMP_CURRENT >= 60 )); then - elif (( $CPU_TEMP_CURRENT >= 40 )); then + CPU_TEMP_PRINT="\e[38;5;202m$CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f\e[90m | Running hot, not recommended.\e[0m" - CPU_TEMP_PRINT="\e[92m$CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f\e[0m\e[90m | Optimal temperature.\e[0m" + elif (( $CPU_TEMP_CURRENT >= 50 )); then - elif (( $CPU_TEMP_CURRENT >= 30 )); then + CPU_TEMP_PRINT="\e[93m$CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f\e[0m \e[90m | Running warm, but safe.\e[0m" - CPU_TEMP_PRINT="\e[96m$CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f\e[0m\e[90m | Cool runnings.\e[0m" + elif (( $CPU_TEMP_CURRENT >= 40 )); then - else + CPU_TEMP_PRINT="\e[92m$CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f\e[0m\e[90m | Optimal temperature.\e[0m" - CPU_TEMP_PRINT="\e[96m$CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f \e[0m \e[90m| Who put me in the freezer!\e[0m" + elif (( $CPU_TEMP_CURRENT >= 30 )); then - fi + CPU_TEMP_PRINT="\e[96m$CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f\e[0m\e[90m | Cool runnings.\e[0m" - else + else - CPU_TEMP_PRINT="\e[91mKERNELERR: $CPU_TEMP_CURRENT'c\e[0m" - - fi - - break + CPU_TEMP_PRINT="\e[96m$CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f \e[0m \e[90m| Who put me in the freezer!\e[0m" fi - done - - } - - Obtain_Cpu_Usage(){ - - # PS (inaccurate) - local fp_temp='/tmp/.cpu_usage_cpuinfo' - ps -axo %cpu | sed '1d' | sed 's/ //' > "$fp_temp" - while read line - do - - CPU_USAGE=$( echo "scale=1;$CPU_USAGE + $line" | bc -l ) + else - done < "$fp_temp" + CPU_TEMP_PRINT="\e[91mKERNELERR: $CPU_TEMP_CURRENT'c\e[0m" - #ps returns usage of each core, so we devide the total by #n cores - CPU_USAGE=$(echo "scale=1;$CPU_USAGE / $(nproc --all)" | bc -l ) + fi } @@ -227,9 +159,6 @@ #Processor Type echo -e " Architecture \e[90m|\e[0m $(uname -m)" - #Current usage - # echo -e " Usage \e[90m|\e[0m $CPU_USAGE" - #Current Temp echo -e " Temp \e[90m|\e[0m $CPU_TEMP_PRINT" @@ -266,12 +195,7 @@ #----------------------------------------------------------------------------------- #Return mode - if (( $INPUT == 3 )); then - - Obtain_Cpu_Usage - echo "$CPU_USAGE" - - elif (( $INPUT == 2 )); then + if (( $INPUT == 2 )); then Obtain_Cpu_Freq @@ -292,11 +216,6 @@ fi - elif (( $INPUT == 1 )); then - - Obtain_Cpu_Temp - echo "$CPU_TEMP_CURRENT" - #Print all stats else @@ -315,7 +234,7 @@ unset aCPU_MIN_FREQ unset aCPU_MAX_FREQ unset aCPU_SCALINGAVAILABLE_FREQ - unset aFP_TEMPERATURE + unset afp_temperature #----------------------------------------------------------------------------------- exit #----------------------------------------------------------------------------------- diff --git a/dietpi/dietpi-sync b/dietpi/dietpi-sync index e1742e16ce..9f2ca0787b 100644 --- a/dietpi/dietpi-sync +++ b/dietpi/dietpi-sync @@ -573,13 +573,10 @@ Check_Install_PreReqs(){ - #Rsync - if (( $(dpkg -l | grep -ci -m1 ' rsync ') == 0 )); then + G_AG_CHECK_INSTALL_PREREQ rsync + if (( $? != 0 )); then - echo -e "\n\nInstalling Rsync, please wait....\n\n" - sleep 1 - - G_AGI rsync + exit 1 fi diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 8362c0aa17..c40d9b648e 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -9,17 +9,13 @@ #//////////////////////////////////// # # Info: - # - Allows export of shared DietPi global variables into current bash session, and, other scripts + # - Allows export of shared DietPi global variables/funcs into current bash session, and, other scripts # # Excluded scripts, which do NOT load these globals # - dietpi-ramlog # - dietpi-ramdisk - # - PREP_SYSTEM_FOR_DIETPI.sh # - dietpi.txt (and all other .txt .ini files) # - # Notes: - # - . /DietPi/dietpi/func/dietpi-globals > $HOME/.bashrc - # - . /DietPi/dietpi/func/dietpi-globals > for each script that uses these globals #//////////////////////////////////// #----------------------------------------------------------------------------------- @@ -237,6 +233,89 @@ fi + #Returns current CPU temp 'C + G_OBTAIN_CPU_TEMP(){ + + # - Array to store possible locations for temp read. + afp_temperature=( + + #'/sys/class/thermal/thermal_zone1/temp' #sparky/Asus, will break other SBC temp readouts as most have 2 zones, needs a special case + '/sys/class/thermal/thermal_zone0/temp' + '/sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/temp1_input' + '/sys/class/hwmon/hwmon0/device/temp_label' + + ) + + for ((i=0; i<${#afp_temperature[@]}; i++)) + do + + if [ -f "${afp_temperature[$i]}" ]; then + + # Sparky/asus, special case: + if (( $G_HW_MODEL == 70 || $G_HW_MODEL == 100 || $G_HW_MODEL == 110 )); then + + cpu_temp_current=$(cat /sys/class/thermal/thermal_zone1/temp) + + else + + cpu_temp_current=$(cat ${afp_temperature[$i]}) + + fi + + # - Boards that provide 2 digit output + # Pine + # NanoPi M2 + # NanoPi M3 + # H3 3.x + # H2+ 3.x + if (( ( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 ) || + $G_HW_MODEL == 61 || + $G_HW_MODEL == 62 || + ( $G_HW_CPUID == 1 && $(uname -r | grep -ci -m1 '^3.') ) || + ( $G_HW_MODEL == 32 && $(uname -r | grep -ci -m1 '^3.') ) )); then + + echo -e "Do nothing" &> /dev/null + + else + + cpu_temp_current=$( echo -e "$cpu_temp_current" | awk '{print $1/1000}' | xargs printf "%0.0f" ) + + fi + + + break + + fi + + done + + unset afp_temperature + + echo $cpu_temp_current + + } + + #Returns current CPU usage % + G_OBTAIN_CPU_USAGE(){ + + # - PS (inaccurate, but fast??) + local cpu_usage=0 + local fp_temp='/tmp/.cpu_usage_cpuinfo' + ps -axo %cpu | sed '1d' | sed 's/ //' > "$fp_temp" + while read line + do + + cpu_usage=$( echo "scale=1;$cpu_usage + $line" | bc -l ) + + done < "$fp_temp" + + # - ps returns usage of each core, so we devide the total by #n cores + cpu_usage=$(echo "scale=1;$cpu_usage / $(nproc --all)" | bc -l ) + + echo $cpu_usage + + } + #----------------------------------------------------------------------------------- # DietPi specific directories #----------------------------------------------------------------------------------- @@ -437,20 +516,20 @@ local string=( "$@" ) local packages_to_install='' - G_DIETPI-NOTIFY 2 "Checking for currently installed pre-req packages: ${string[@]}" + G_DIETPI-NOTIFY 2 "Checking for pre-req APT packages: ${string[@]}" dpkg --get-selections > "$fp_temp" for i in "${string[@]}" do - if (( ! $(grep -ci -m1 "^$i[[:space:]]" "$fp_temp") )); then + if (( $(grep -ci -m1 "^$i[[:space:]]" "$fp_temp") )); then - G_DIETPI-NOTIFY 2 "($i) | Not found, flagging pre-req package for installation" - packages_to_install+=" $i" + G_DIETPI-NOTIFY 2 "($i) | Currently installed" else - G_DIETPI-NOTIFY 2 "($i) | Currently installed" + G_DIETPI-NOTIFY 2 "($i) | Not found, flagging pre-req APT package for installation" + packages_to_install+=" $i" fi @@ -458,17 +537,17 @@ if [ -n "$packages_to_install" ]; then - G_DIETPI-NOTIFY 2 "Installing pre-req packages, please wait..." + G_DIETPI-NOTIFY 2 "Installing pre-req APT packages, please wait..." G_AGI $packages_to_install exit_code=$? else - G_DIETPI-NOTIFY 2 "Pre-req packages already installed" + G_DIETPI-NOTIFY 2 "Pre-req APT packages are currently already installed" fi - G_DIETPI-NOTIFY -1 $exit_code 'G_CHECK_INSTALL_PREREQ:' + G_DIETPI-NOTIFY -1 $exit_code 'G_AG_CHECK_INSTALL_PREREQ:' rm "$fp_temp" From e96e1d5d26efc7a3dc2f43478e76306343f69d6e Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 22 Dec 2017 11:29:51 +0000 Subject: [PATCH 130/390] v160 + General | SparkySBC: CPU gov default changed to Performance, reports of increased stability. --- CHANGELOG.txt | 1 + PREP_SYSTEM_FOR_DIETPI.sh | 7 ++++++- dietpi/patch_file | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 91052e833d..36d3abf877 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -9,6 +9,7 @@ DietPi-Globals | New script which optimizes most used DietPi commands and vars, General | Start of FHS compliance: https://github.com/Fourdee/DietPi/issues/1297#issuecomment-352241193 General | wget: Now set to prefer IPv4 by default (generally faster): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 General | APT: Now set to force IPv4 by default (generally faster): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 +General | SparkySBC: CPU gov default changed to Performance, reports of increased stability. DietPi-Boot | Improved the method of initial FS_partition and FS_expansion during 1st run, via systemD services. 'fs_force_resize=' in dietpi.txt is no longer supported: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352159930 DietPi-Banner | IP: Will now also list the active network adapter used (eg: eth0/wlan0) DietPi-Drive_Manager | Added support for exFAT, many thanks @MichaIng : https://github.com/Fourdee/DietPi/pull/1312 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 739830e493..a27ac20858 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1043,9 +1043,10 @@ _EOF_ echo -e "blacklist bmp085" > /etc/modprobe.d/bmp085.conf - # - Sparky SBC ONLY: Blacklist GPU and touch screen modules: https://github.com/Fourdee/DietPi/issues/699#issuecomment-271362441 + # - Sparky SBC ONLY: elif (( $G_HW_MODEL == 70 )); then + # Blacklist GPU and touch screen modules: https://github.com/Fourdee/DietPi/issues/699#issuecomment-271362441 cat << _EOF_ > /etc/modprobe.d/disable_sparkysbc_touchscreen.conf blacklist owl_camera blacklist gsensor_stk8313 @@ -1062,6 +1063,10 @@ blacklist videobuf2_vmalloc blacklist bc_example _EOF_ + # Use performance gov for stability. + sed -i "/^cpu_governor=/c\cpu_governor=performance" /DietPi/dietpi.txt + /DietPi/dietpi/dietpi-cpu_set + # - RPI: Scroll lock fix for RPi by Midwan: https://github.com/Fourdee/DietPi/issues/474#issuecomment-243215674 elif (( $G_HW_MODEL < 10 )); then diff --git a/dietpi/patch_file b/dietpi/patch_file index 71a930acf2..37cef349f2 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2906,6 +2906,10 @@ _EOF_ fi + # Set performance CPU gov for stability + sed -i "/^cpu_governor=/c\cpu_governor=performance" /DietPi/dietpi.txt + /DietPi/dietpi/dietpi-cpu_set + fi #------------------------------------------------------------------------------- #@MichaIng Move Stretch instances from MySQL to MariaDB: https://github.com/Fourdee/DietPi/pull/1280 From cbc61d0ea37c5cdb01061853417f3aff5520c15e Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 22 Dec 2017 11:51:22 +0000 Subject: [PATCH 131/390] v160 + Check/install WiFi packages during enable: https://github.com/Fourdee/DietPi/issues/1285 RE: @MichaIng --- dietpi/dietpi-config | 32 ++++++++++++++++++-------------- dietpi/func/dietpi-set_hardware | 8 ++++++++ 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 750473dcd6..0c3499be1d 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -2405,17 +2405,6 @@ _EOF_ #Stop all services (required for hotspot) /DietPi/dietpi/dietpi-services stop - #Release all DHCP leases (too slow, quicker to allow router to decide leases) - #dhclient -r - - #Drop Connections - G_DIETPI-NOTIFY 2 "Dropping connections, please wait..." - ifdown eth$ETH_INDEX &> /dev/null - ifdown wlan$WIFI_INDEX &> /dev/null - - #Kill dhclient - killall dhclient &> /dev/null - # Enable/Disable wifi modules # - enable if (( $WIFI_DISABLED == 0 )); then @@ -2429,6 +2418,17 @@ _EOF_ fi + #Release all DHCP leases (too slow, quicker to allow router to decide leases) + #dhclient -r + + #Drop Connections + G_DIETPI-NOTIFY 2 "Dropping connections, please wait..." + ifdown eth$ETH_INDEX &> /dev/null + ifdown wlan$WIFI_INDEX &> /dev/null + + #Kill dhclient + killall dhclient &> /dev/null + #Restart Networking G_DIETPI-NOTIFY 2 'Restarting networking services, please wait...' systemctl daemon-reload @@ -2894,10 +2894,14 @@ _EOF_ #?????????????????????????????????????????????????????? # We cant rely on lsmod for this. Some of our images have cfg80211 built into kernel, so lsmod wont show a result. # Redirect stderr and stdout does nowt 2> /dev/null and &> /dev/null no effect. - #if (( $(lsmod | grep -ci -m1 'cfg80211' ) )); then - WIFI_COUNTRYCODE=$(iw reg get | grep -m1 'country' | awk '{print $2}' | tr -d ':') - #fi + + WIFI_COUNTRYCODE='GB' + if [ -n "$(which iw)" ]; then + + WIFI_COUNTRYCODE=$(iw reg get | grep -m1 'country' | awk '{print $2}' | tr -d ':') + + fi #?????????????????????????????????????????????????????? diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 000b263bf4..073f36bdb0 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1359,6 +1359,14 @@ _EOF_ # - Enable elif [ "$INPUT_DEVICE_VALUE" = "enable" ]; then + # - Install prereqs + G_AG_CHECK_INSTALL_PREREQ crda firmware-atheros firmware-brcm80211 firmware-ralink iw rfkill wireless-tools wpasupplicant + if (( $? != 0 )); then + + exit 1 + + fi + rm /etc/modprobe.d/disable_wifi.conf &> /dev/null # - Disable known powersaving options for specific chipsets From 585dd48750a13e0047701253e09aeec2b992a6c5 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 22 Dec 2017 12:24:18 +0000 Subject: [PATCH 132/390] v160 + DietPi-Software | Resolved an issue where our custom LD_LIBRARY_PATH would cause APT failures. LD_LIBRARY_PATH has now been reverted, apologies if this effected your system: https://github.com/Fourdee/DietPi/issues/1329 --- CHANGELOG.txt | 1 + dietpi/func/dietpi-set_core_environment | 2 +- dietpi/patch_file | 14 +++++--------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 36d3abf877..fa8832eef2 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -21,6 +21,7 @@ DietPi-Software | ownCloud/Nextcloud: Added option to choose data directory via Bug Fixes: DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi drop during software installs/updates etc: https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480 +DietPi-Software | Resolved an issue where our custom LD_LIBRARY_PATH would cause APT failures. LD_LIBRARY_PATH has now been reverted, apologies if this effected your system: https://github.com/Fourdee/DietPi/issues/1329 DietPi-Software | Resolved an issue where APT installations would fail if services were masked. All known DietPi software services, will be enabled/unmasked, before installation: https://github.com/Fourdee/DietPi/issues/1320 DietPi-Software | WiFi Hotspot (Stretch): Resolved an issue where hostapd would fail to run due to missing libssl1.0.0 lib, not available in repos: https://github.com/Fourdee/DietPi/issues/1299 DietPi-Software | Shairport-sync (Stretch): Resolved an issue where this would fail to install, due to pre-req URLS becomming invalid: https://github.com/Fourdee/DietPi/issues/1303 diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index 77438e108f..9ce69dbc01 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -119,7 +119,7 @@ _EOF_ export \$(cat /etc/default/locale | grep LANG=) # - Define a default LD_LIBRARY_PATH for all systems -export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/opt/vc/lib +#export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/opt/vc/lib #Disabled due to https://github.com/Fourdee/DietPi/issues/1329#issuecomment-353586754 # - DietPi Scripts alias sudo='sudo ' # https://github.com/Fourdee/DietPi/issues/424 diff --git a/dietpi/patch_file b/dietpi/patch_file index 37cef349f2..9f9f097b09 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2865,15 +2865,6 @@ Package: * Pin: release a=jessie-backports Pin: origin "fuzon.co.uk" Pin-Priority: 99 -_EOF_ - - fi - #------------------------------------------------------------------------------- - #Define a default LD_LIBRARY_PATH for all systems: https://github.com/Fourdee/DietPi/issues/475#issuecomment-350380744 - if (( ! $(grep -ci -m1 '^export LD_LIBRARY_PATH=' /etc/bash.bashrc) )); then - - cat << _EOF_ >> /etc/bash.bashrc -export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/opt/vc/lib _EOF_ fi @@ -2980,6 +2971,11 @@ _EOF_ sed -i '/prefer_ipversion=/c\Sprefer_ipversion=ipv4' /DietPi/dietpi.txt /DietPi/dietpi/func/dietpi-set_core_environment + # - Revert of https://github.com/Fourdee/DietPi/issues/1329#issuecomment-353586754 + # Disabled/replaced in /DietPi/dietpi/func/dietpi-set_core_environment generation + unset LD_LIBRARY_PATH + ldconfig + # - DietPi-autostart custom script moved mkdir -p /var/lib/dietpi/dietpi-autostart &> /dev/null mv /etc/dietpi/autostart.sh /var/lib/dietpi/dietpi-autostart/custom.sh &> /dev/null From f1e6360da7748a7686794b095de6170f258135b1 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 25 Dec 2017 07:17:08 +0000 Subject: [PATCH 133/390] v160 + DietPi-Config | Dion Audio LOCO V1/V2: Soundcards added for RPi. --- CHANGELOG.txt | 1 + dietpi/dietpi-config | 2 ++ dietpi/func/dietpi-set_hardware | 10 ++++++++++ 3 files changed, 13 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fa8832eef2..28f6ce9906 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -12,6 +12,7 @@ General | APT: Now set to force IPv4 by default (generally faster): https://gith General | SparkySBC: CPU gov default changed to Performance, reports of increased stability. DietPi-Boot | Improved the method of initial FS_partition and FS_expansion during 1st run, via systemD services. 'fs_force_resize=' in dietpi.txt is no longer supported: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352159930 DietPi-Banner | IP: Will now also list the active network adapter used (eg: eth0/wlan0) +DietPi-Config | Dion Audio LOCO V1/V2: Soundcards added for RPi. DietPi-Drive_Manager | Added support for exFAT, many thanks @MichaIng : https://github.com/Fourdee/DietPi/pull/1312 DietPi-Globals | Global variables and functions are now exported during login. Please see the sourcecode for more information: https://github.com/Fourdee/DietPi/issues/1311 DietPi-Set_Hardware | Sparky SBC: enable aotg.aotg1_speed compatibility setting for USB 1.1, when USB-DAC configured: https://github.com/Fourdee/DietPi/issues/1301 diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 0c3499be1d..ff37a25289 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -4529,6 +4529,8 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ whiptail_menu_array+=("allo-digione" "Allo DigiOne") whiptail_menu_array+=("allo-piano-dac-pcm512x-audio" "Allo Piano DAC") whiptail_menu_array+=("allo-piano-dac-pcm512x-audio" "Allo Piano DAC") + whiptail_menu_array+=("dionaudio-loco" "Dion Audio LOCO") + whiptail_menu_array+=("dionaudio-loco-v2" "Dion Audio LOCO V2") 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") diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 073f36bdb0..539f78e5bb 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1755,6 +1755,7 @@ _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=dionaudio/d' "$FP_RPI_CONFIG" sed -i '/dtoverlay=googlevoicehat-soundcard/d' "$FP_RPI_CONFIG" # - Disable i2s maps @@ -2115,6 +2116,15 @@ _EOF_ ;; + #dionaudio-loco + #dionaudio-loco-v2 + dionaudio-loco*) + + # - enable dtoverlay + echo -e "\ndtoverlay=$INPUT_DEVICE_VALUE" >> "$FP_RPI_CONFIG" + + ;; + #Odroid ------------------------------------------------------------------------------- odroid-hifishield-plus) From fc733328045c717bcb13015d67c0420d16e8dcfd Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 26 Dec 2017 10:10:57 +0000 Subject: [PATCH 134/390] v160 Work in progress: Improved error handle system. + G_ERROR_HANDLER + G_RUN_CMD (error handled) + G_AGX commands are now automatically error handled https://github.com/Fourdee/DietPi/issues/1311#issuecomment-353716344 --- PREP_SYSTEM_FOR_DIETPI.sh | 126 ++--- dietpi/boot | 1 + dietpi/dietpi-autostart | 1 + dietpi/dietpi-backup | 41 +- dietpi/dietpi-banner | 1 + dietpi/dietpi-bugreport | 1 + dietpi/dietpi-cleaner | 1 + dietpi/dietpi-cloudshell | 1 + dietpi/dietpi-config | 1 + dietpi/dietpi-cpu_set | 1 + dietpi/dietpi-cpuinfo | 1 + dietpi/dietpi-cron | 1 + dietpi/dietpi-drive_manager | 2 + dietpi/dietpi-funtime | 1 + dietpi/dietpi-launcher | 1 + dietpi/dietpi-letsencrypt | 1 + dietpi/dietpi-logclear | 1 + dietpi/dietpi-morsecode | 1 + dietpi/dietpi-process_tool | 1 + dietpi/dietpi-services | 1 + dietpi/dietpi-software | 695 +++++++++++------------- dietpi/dietpi-survey | 1 + dietpi/dietpi-sync | 36 +- dietpi/dietpi-update | 1 + dietpi/func/change_hostname | 1 + dietpi/func/create_mysql_db | 1 + dietpi/func/dietpi-globals | 304 +++++++++-- dietpi/func/dietpi-led_control | 1 + dietpi/func/dietpi-optimal_mtu | 1 + dietpi/func/dietpi-set_core_environment | 1 + dietpi/func/dietpi-set_curlftpfs | 1 + dietpi/func/dietpi-set_dphys-swapfile | 1 + dietpi/func/dietpi-set_hardware | 1 + dietpi/func/dietpi-set_nfsclient | 1 + dietpi/func/dietpi-set_smbclient | 1 + dietpi/func/dietpi-set_software | 1 + dietpi/func/dietpi-set_userdata | 1 + dietpi/func/obtain_network_details | 1 + dietpi/func/run_ntpd | 1 + dietpi/login | 1 + dietpi/misc/dietpi-justboom | 1 + dietpi/misc/start_kodi | 1 + dietpi/patch_file | 6 +- 43 files changed, 716 insertions(+), 530 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index a27ac20858..3de34d97bc 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -140,28 +140,11 @@ exit 1 fi + export G_PROGRAM_NAME='DietPi-PREP_SYSTEM_FOR_DIETPI' #URL connection test var holder INTERNET_ADDRESS='' - #Funcs - - Error_Check(){ - - #Grab exit code in case of failure - local exit_code=$? - if (( $exit_code != 0 )); then - - G_DIETPI-NOTIFY 1 "($exit_code): Script aborted" - exit $exit_code - - else - - G_DIETPI-NOTIFY 2 "($exit_code): Passed" - fi - - } - #Whiptail WHIP_BACKTITLE='DietPi-Prep' WHIP_TITLE=0 @@ -212,10 +195,8 @@ # - Stop services /DietPi/dietpi/dietpi-services stop - systemctl stop dietpi-ramlog - Error_Check - systemctl stop dietpi-ramdisk - Error_Check + G_RUN_CMD systemctl stop dietpi-ramlog + G_RUN_CMD systemctl stop dietpi-ramdisk # - Delete any previous exsiting data rm -R /DietPi/* @@ -239,8 +220,7 @@ fi #Recreate dietpi logs dir, used by G_AGx - mkdir -p /var/tmp/dietpi/logs - Error_Check + G_RUN_CMD mkdir -p /var/tmp/dietpi/logs #------------------------------------------------------------------------------------------------ @@ -251,16 +231,13 @@ #------------------------------------------------------------------------------------------------ G_DIETPI-NOTIFY 2 'Updating APT:' - apt-get clean - Error_Check + G_RUN_CMD apt-get clean G_AGUP - Error_Check G_DIETPI-NOTIFY 2 'Installing core packages, required for next stage of this script:' G_AGI apt-transport-https wget unzip whiptail - Error_Check #------------------------------------------------------------------------------------------------ echo -e '' @@ -440,17 +417,14 @@ _EOF_ G_DIETPI-NOTIFY 2 "Updating APT for $DISTRO_TARGET_NAME:" - apt-get clean - Error_Check + G_RUN_CMD apt-get clean G_AGUP - Error_Check # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files G_DIETPI-NOTIFY 2 "Marking all packages as auto installed first, to allow allow effective autoremove afterwards" - apt-mark auto $(apt-mark showmanual) - Error_Check + G_RUN_CMD apt-mark auto $(apt-mark showmanual) # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files G_DIETPI-NOTIFY 2 "Temporary disable automatic recommends/suggests installation and allow them to be autoremoved:" @@ -461,7 +435,7 @@ APT::Install-Suggests "false"; APT::AutoRemove::RecommendsImportant "false"; APT::AutoRemove::SuggestsImportant "false"; _EOF_ - Error_Check + G_ERROR_HANDLER G_DIETPI-NOTIFY 2 "Forcing use of existing apt configs if available" @@ -471,7 +445,7 @@ Dpkg::options { "--force-confold"; } _EOF_ - Error_Check + G_ERROR_HANDLER #------------------------------------------------------------------------------------------------ @@ -639,13 +613,11 @@ _EOF_ G_DIETPI-NOTIFY 2 "Marking required packages as manually installed:" - apt-mark manual $INSTALL_PACKAGES - Error_Check + G_RUN_CMD apt-mark manual $INSTALL_PACKAGES G_DIETPI-NOTIFY 2 "Purging APT with autoremoval:" G_AGA - Error_Check #------------------------------------------------------------------------------------------------ @@ -658,7 +630,6 @@ _EOF_ G_DIETPI-NOTIFY 2 "Upgrading existing APT installed packages:" G_AGDUG - Error_Check # - Distro is now target (for APT purposes and G_AGX support due to installed binary, its here, instead of after G_AGUP) G_DISTRO=$DISTRO_TARGET @@ -666,13 +637,11 @@ _EOF_ G_DIETPI-NOTIFY 2 "Disabling swapfile generation for dphys-swapfile during install" - echo -e "CONF_SWAPSIZE=0" > /etc/dphys-swapfile - Error_Check + G_RUN_CMD echo -e "CONF_SWAPSIZE=0" > /etc/dphys-swapfile G_DIETPI-NOTIFY 2 "Installing core DietPi pre-req APT packages" G_AGI $INSTALL_PACKAGES - Error_Check G_DIETPI-NOTIFY 2 "Onboard Bluetooth selection" @@ -692,14 +661,12 @@ _EOF_ G_DIETPI-NOTIFY 2 "Installing Bluetooth packages" G_AGI bluetooth bluez-firmware - Error_Check if (( $G_HW_MODEL < 10 )); then G_DIETPI-NOTIFY 2 "Installing Bluetooth packages specific to RPi" G_AGI pi-bluetooth - Error_Check fi @@ -713,7 +680,6 @@ _EOF_ G_DIETPI-NOTIFY 2 "Purging APT with autoremoval (in case of DISTRO upgrade/downgrade):" G_AGA - Error_Check #------------------------------------------------------------------------------------------------ @@ -726,15 +692,12 @@ _EOF_ INTERNET_ADDRESS="https://github.com/Fourdee/DietPi/archive/$GIT_BRANCH.zip" #NB: testing until this is stable in master G_DIETPI-NOTIFY 2 "Checking connection to $INTERNET_ADDRESS" G_CHECK_URL "$INTERNET_ADDRESS" - Error_Check - wget "$INTERNET_ADDRESS" -O package.zip - Error_Check + G_RUN_CMD wget "$INTERNET_ADDRESS" -O package.zip G_DIETPI-NOTIFY 2 "Extracting DietPi sourcecode" - unzip package.zip - Error_Check + G_RUN_CMD unzip package.zip rm package.zip @@ -748,42 +711,35 @@ _EOF_ G_DIETPI-NOTIFY 2 "Creating /boot" - mkdir -p /boot - Error_Check + G_RUN_CMD mkdir -p /boot G_DIETPI-NOTIFY 2 "Moving to /boot" # - HW specific boot.ini uenv.txt if (( $G_HW_MODEL == 10 )); then - mv DietPi-*/boot_c1.ini /boot/boot.ini - Error_Check + G_RUN_CMD mv DietPi-*/boot_c1.ini /boot/boot.ini elif (( $G_HW_MODEL == 11 )); then - mv DietPi-*/boot_xu4.ini /boot/boot.ini - Error_Check + G_RUN_CMD mv DietPi-*/boot_xu4.ini /boot/boot.ini elif (( $G_HW_MODEL == 12 )); then - mv DietPi-*/boot_c2.ini /boot/boot.ini - Error_Check + G_RUN_CMD mv DietPi-*/boot_c2.ini /boot/boot.ini fi rm DietPi-*/*.ini - cp -R DietPi-*/* /boot/ - Error_Check + G_RUN_CMD cp -R DietPi-*/* /boot/ G_DIETPI-NOTIFY 2 "Cleaning up extracted files" - rm -R DietPi-* - Error_Check + G_RUN_CMD rm -R DietPi-* G_DIETPI-NOTIFY 2 "Setting execute permissions for /boot/dietpi" - chmod -R +x /boot/dietpi - Error_Check + G_RUN_CMD chmod -R +x /boot/dietpi #------------------------------------------------------------------------------------------------ echo -e '' @@ -859,8 +815,7 @@ _EOF_ G_DIETPI-NOTIFY 2 "Creating DietPi core environment" - /boot/dietpi/func/dietpi-set_core_environment - Error_Check + G_RUN_CMD /boot/dietpi/func/dietpi-set_core_environment echo -e "Samba client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking option: NAS/Misc menu" > /mnt/samba/readme.txt echo -e "FTP client mount can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking option: NAS/Misc menu" > /mnt/ftp_client/readme.txt @@ -872,8 +827,7 @@ _EOF_ G_DIETPI-NOTIFY 2 "Generating DietPi /etc/fstab" - /boot/dietpi/dietpi-drive_manager 4 - Error_Check + G_RUN_CMD /boot/dietpi/dietpi-drive_manager 4 # - HW Specific: # RPi requires PARTUUID for USB write: https://github.com/Fourdee/DietPi/issues/970 @@ -893,13 +847,11 @@ _EOF_ G_DIETPI-NOTIFY 2 "Starting DietPi-RAMdisk service" - systemctl start dietpi-ramdisk.service - Error_Check + G_RUN_CMD systemctl start dietpi-ramdisk.service G_DIETPI-NOTIFY 2 "Starting DietPi-RAMlog service" - systemctl start dietpi-ramlog.service - Error_Check + G_RUN_CMD systemctl start dietpi-ramlog.service G_DIETPI-NOTIFY 2 'Updating DietPi HW_INFO' @@ -908,8 +860,8 @@ _EOF_ G_DIETPI-NOTIFY 2 "Configuring Network:" rm -R /etc/network/interfaces &> /dev/null # armbian symlink for bulky network-manager - cp /boot/dietpi/conf/network_interfaces /etc/network/interfaces - Error_Check + + G_RUN_CMD cp /boot/dietpi/conf/network_interfaces /etc/network/interfaces # - enable allow-hotplug eth0 after copying. sed -i "/allow-hotplug eth/c\allow-hotplug eth0" /etc/network/interfaces @@ -945,12 +897,12 @@ _EOF_ ff02::1 ip6-allnodes ff02::2 ip6-allrouters _EOF_ - Error_Check + G_ERROR_HANDLER cat << _EOF_ > /etc/hostname DietPi _EOF_ - Error_Check + G_ERROR_HANDLER G_DIETPI-NOTIFY 2 "Configuring htop:" @@ -970,7 +922,7 @@ _EOF_ apm = 254 } _EOF_ - Error_Check + G_ERROR_HANDLER G_DIETPI-NOTIFY 2 "Configuring fakehwclock:" @@ -991,7 +943,7 @@ _EOF_ echo "Europe/London" > /etc/timezone dpkg-reconfigure -f noninteractive tzdata #Europe > London - Error_Check + G_ERROR_HANDLER G_DIETPI-NOTIFY 2 "Configuring regional settings (Keyboard):" @@ -1004,14 +956,14 @@ _EOF_ #locale-gen update-locale dpkg-reconfigure -f noninteractive locales # en_GB.UTF8 as only installed locale - Error_Check + G_ERROR_HANDLER # - Pump default locale into sys env: https://github.com/Fourdee/DietPi/issues/825 cat << _EOF_ > /etc/environment LC_ALL=en_GB.UTF-8 LANG=en_GB.UTF-8 _EOF_ - Error_Check + G_ERROR_HANDLER #G_HW_ARCH specific G_DIETPI-NOTIFY 2 "Applying G_HW_ARCH specific tweaks:" @@ -1266,7 +1218,7 @@ WantedBy=local-fs.target _EOF_ systemctl daemon-reload systemctl enable dietpi-fs_partition_resize.service - Error_Check + G_ERROR_HANDLER cat << _EOF_ > /etc/dietpi/fs_partition_resize.sh #!/bin/bash @@ -1308,9 +1260,9 @@ _EOF_1 reboot _EOF_ - Error_Check + G_ERROR_HANDLER chmod +x /etc/dietpi/fs_partition_resize.sh - Error_Check + G_ERROR_HANDLER G_DIETPI-NOTIFY 2 'Generating dietpi-fs_partition_expand for subsequent boot' @@ -1330,7 +1282,7 @@ WantedBy=local-fs.target _EOF_ systemctl daemon-reload systemctl enable dietpi-fs_expand.service - Error_Check + G_ERROR_HANDLER # #debug # systemctl start dietpi-fs_partition_resize.service @@ -1340,10 +1292,8 @@ _EOF_ G_DIETPI-NOTIFY 2 'Sync changes to disk and TRIM rootFS. Please wait, this may take some time...' - systemctl stop dietpi-ramlog - Error_Check - systemctl stop dietpi-ramdisk - Error_Check + G_RUN_CMD systemctl stop dietpi-ramlog + G_RUN_CMD systemctl stop dietpi-ramdisk sync fstrim -v / diff --git a/dietpi/boot b/dietpi/boot index d40b0862bb..06f935edc1 100644 --- a/dietpi/boot +++ b/dietpi/boot @@ -16,6 +16,7 @@ #Import DietPi-Globals --------------------------------------------------------------- /DietPi/dietpi/dietpi-obtain_hw_model # Running for the 1st time . /DietPi/dietpi/func/dietpi-globals + export G_PROGRAM_NAME='DietPi-Boot' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-autostart b/dietpi/dietpi-autostart index 0f683af15b..af55182261 100644 --- a/dietpi/dietpi-autostart +++ b/dietpi/dietpi-autostart @@ -27,6 +27,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER + export G_PROGRAM_NAME='DietPi-Autostart' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index 3dfdc0e692..cf7c53901a 100644 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -32,6 +32,7 @@ . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW + export G_PROGRAM_NAME='DietPi-Backup' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -238,8 +239,10 @@ G_DIETPI-NOTIFY 1 "Filesystem not supported in $FP_TARGET_BACKUP" - if (( $INPUT == 0 )); then + if (( $G_USER_INPUTS )); then + whiptail --title "Error" --msgbox "$FP_TARGET_BACKUP Has a filesystem of: $TARGET_FILESYSTEM_TYPE, and is not supported.\n\nThe filesystem must be EXT2/3/4 for symlink compatibility." --backtitle "$WHIP_BACKTITLE" 11 70 + fi } @@ -248,8 +251,10 @@ G_DIETPI-NOTIFY 1 "Target directory is not inside /mnt ($FP_TARGET_BACKUP)" - if (( $INPUT == 0 )); then + if (( $G_USER_INPUTS )); then + whiptail --title "Directory not supported" --msgbox "$FP_TARGET_BACKUP\n\nYour current location is not supported.\nThe location must be inside the /mnt/* directory.\n - eg: /mnt/dietpi-backup" --backtitle "$WHIP_BACKTITLE" 11 70 + fi } @@ -258,8 +263,10 @@ G_DIETPI-NOTIFY 1 "Target directory can not be contained within DietPi user data location ($FP_TARGET_BACKUP)" - if (( $INPUT == 0 )); then + if (( $G_USER_INPUTS )); then + whiptail --title "Directory not supported" --msgbox "$FP_TARGET_BACKUP\n\nYour current location is not supported.\nTarget directory can not be contained within DietPi user data location ($G_FP_DIETPI_USERDATA)" --backtitle "$WHIP_BACKTITLE" 13 70 + fi } @@ -269,9 +276,12 @@ G_DIETPI-NOTIFY 1 "Another Rsync process is already running." echo -e "$RSYNC_MODE_TEXT failed: $(date +"%d-%m-%Y_%H%M"). Rsync is already running." >> "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_SYSTEM" + #Menu - if (( $INPUT == 0 )); then + if (( $G_USER_INPUTS )); then + whiptail --title "$RSYNC_MODE_TEXT Error" --msgbox "A $RSYNC_MODE_TEXT could not be started as rsync is already running." --backtitle "$WHIP_BACKTITLE" 13 60 + fi } @@ -281,8 +291,10 @@ G_DIETPI-NOTIFY 1 "$RSYNC_MODE_TEXT failed." #Menu - if (( $INPUT == 0 )); then + if (( $G_USER_INPUTS )); then + whiptail --title "$RSYNC_MODE_TEXT failed" --msgbox "Your $RSYNC_MODE_TEXT has failed. Please see the Log file for more information:\n\n$LOGFILE" --backtitle "$WHIP_BACKTITLE" 12 60 + fi } @@ -438,8 +450,10 @@ _EOF_ #Error: Unable to create target folder. if [ ! -d "$FP_TARGET_BACKUP" ]; then - if (( $INPUT == 0 )); then + if (( $G_USER_INPUTS )); then + whiptail --title "$RSYNC_MODE_TEXT failed." --msgbox "Unable to create $FP_TARGET_BACKUP" --backtitle "$WHIP_BACKTITLE" 10 60 + fi #Error: Rsync is already running @@ -518,7 +532,7 @@ _EOF_ else - if (( $INPUT == 0 )); then + if (( $G_USER_INPUTS )); then RSYNC_MODE_TEXT='Backup' whiptail --title "$RSYNC_MODE_TEXT completed" --msgbox "Your $RSYNC_MODE_TEXT was saved to:\n$FP_TARGET_BACKUP\n\nLog file: $LOGFILE" --backtitle "$WHIP_BACKTITLE" 11 60 @@ -554,8 +568,10 @@ _EOF_ G_DIETPI-NOTIFY 2 "No Backup was found in $FP_TARGET_BACKUP" G_DIETPI-NOTIFY 1 "$RSYNC_MODE_TEXT Failed.\n" - if (( $INPUT == 0 )); then + if (( $G_USER_INPUTS )); then + whiptail --title "$RSYNC_MODE_TEXT failed" --msgbox "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_SYSTEM does not exist\n\nHave you created a backup?" --backtitle "$WHIP_BACKTITLE" 11 70 + fi #Error: Rsync is already running @@ -638,7 +654,7 @@ _EOF_ else - if (( $INPUT == 0 )); then + if (( $G_USER_INPUTS )); then RSYNC_MODE_TEXT='Restore' whiptail --title "$RSYNC_MODE_TEXT completed" --msgbox "$RSYNC_MODE_TEXT completed from:\n$FP_TARGET_BACKUP\n\nLog file: $LOGFILE\n\nA Reboot is required." --backtitle "$WHIP_BACKTITLE" 13 60 @@ -661,11 +677,6 @@ _EOF_ Check_Install_PreReqs(){ G_AG_CHECK_INSTALL_PREREQ rsync - if (( $? != 0 )); then - - exit 1 - - fi } @@ -758,11 +769,13 @@ _EOF_ #Run Backup if (( $INPUT == 1 )); then + export G_USER_INPUTS=0 Run_Backup #Run Restore elif (( $INPUT == -1 )); then + export G_USER_INPUTS=0 Run_Restore #----------------------------------------------------------------------------- diff --git a/dietpi/dietpi-banner b/dietpi/dietpi-banner index b4053a5ae4..2b1ef87374 100644 --- a/dietpi/dietpi-banner +++ b/dietpi/dietpi-banner @@ -24,6 +24,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals + export G_PROGRAM_NAME='DietPi-Banner' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-bugreport b/dietpi/dietpi-bugreport index ef9a31ce8c..f3423d1c24 100644 --- a/dietpi/dietpi-bugreport +++ b/dietpi/dietpi-bugreport @@ -17,6 +17,7 @@ . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW + export G_PROGRAM_NAME='DietPi-Bugreport' #Import DietPi-Globals --------------------------------------------------------------- # - byte diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index fc1f357cde..a7e721170b 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -26,6 +26,7 @@ . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW + export G_PROGRAM_NAME='DietPi-Cleaner' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-cloudshell b/dietpi/dietpi-cloudshell index 1393c03824..d78d0fe0c8 100644 --- a/dietpi/dietpi-cloudshell +++ b/dietpi/dietpi-cloudshell @@ -26,6 +26,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER + export G_PROGRAM_NAME='DietPi-Cloudshell' #Import DietPi-Globals --------------------------------------------------------------- #Version diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index ff37a25289..f8992c9691 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -32,6 +32,7 @@ . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW + export G_PROGRAM_NAME='DietPi-Config' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-cpu_set b/dietpi/dietpi-cpu_set index c1c968ff57..64a6e88588 100644 --- a/dietpi/dietpi-cpu_set +++ b/dietpi/dietpi-cpu_set @@ -17,6 +17,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER + export G_PROGRAM_NAME='DietPi-CPU_set' #Import DietPi-Globals --------------------------------------------------------------- #Exit path for VM diff --git a/dietpi/dietpi-cpuinfo b/dietpi/dietpi-cpuinfo index f79dc7124d..968bc6bbea 100644 --- a/dietpi/dietpi-cpuinfo +++ b/dietpi/dietpi-cpuinfo @@ -27,6 +27,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER + export G_PROGRAM_NAME='DietPi-CPU_info' #Import DietPi-Globals --------------------------------------------------------------- #Exit path for VM diff --git a/dietpi/dietpi-cron b/dietpi/dietpi-cron index 4e48a42944..fab9678cc0 100644 --- a/dietpi/dietpi-cron +++ b/dietpi/dietpi-cron @@ -18,6 +18,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER + export G_PROGRAM_NAME='DietPi-Cron' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 9e51c9937f..46029deab4 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -33,12 +33,14 @@ . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER + export G_PROGRAM_NAME='DietPi-Drive_Manager' # - Support for loading during PREP_SYSTEM elif [ -f "$HOME"/dietpi-globals ]; then . "$HOME"/dietpi-globals G_CHECK_ROOT_USER + export G_PROGRAM_NAME='DietPi-Drive_Manager' fi #Import DietPi-Globals --------------------------------------------------------------- diff --git a/dietpi/dietpi-funtime b/dietpi/dietpi-funtime index 6ca7f732a5..ef8a3ea0a0 100644 --- a/dietpi/dietpi-funtime +++ b/dietpi/dietpi-funtime @@ -23,6 +23,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals + export G_PROGRAM_NAME='DietPi-Funtime' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-launcher b/dietpi/dietpi-launcher index 61da70532a..37228b5fb1 100644 --- a/dietpi/dietpi-launcher +++ b/dietpi/dietpi-launcher @@ -18,6 +18,7 @@ . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW + export G_PROGRAM_NAME='DietPi-Launcher' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-letsencrypt b/dietpi/dietpi-letsencrypt index 0dbffd13ad..c910014837 100644 --- a/dietpi/dietpi-letsencrypt +++ b/dietpi/dietpi-letsencrypt @@ -27,6 +27,7 @@ . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW + export G_PROGRAM_NAME='DietPi-Letsencrypt' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-logclear b/dietpi/dietpi-logclear index 66aa24a249..a413bc415a 100644 --- a/dietpi/dietpi-logclear +++ b/dietpi/dietpi-logclear @@ -26,6 +26,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER + export G_PROGRAM_NAME='DietPi-Logclear' #Import DietPi-Globals --------------------------------------------------------------- #//////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-morsecode b/dietpi/dietpi-morsecode index 38c8065c1f..500a3fc22d 100644 --- a/dietpi/dietpi-morsecode +++ b/dietpi/dietpi-morsecode @@ -30,6 +30,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER + export G_PROGRAM_NAME='DietPi-Morsecode' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-process_tool b/dietpi/dietpi-process_tool index 9f77b03df7..cf115f7e53 100644 --- a/dietpi/dietpi-process_tool +++ b/dietpi/dietpi-process_tool @@ -28,6 +28,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER + export G_PROGRAM_NAME='DietPi-Process_tool' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index e979d3f8d5..8c17358221 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -28,6 +28,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER + export G_PROGRAM_NAME='DietPi-Services' #Import DietPi-Globals --------------------------------------------------------------- aSERVICE_NAME=( diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index deebbff755..e1bef28060 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -27,6 +27,7 @@ . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW + export G_PROGRAM_NAME='DietPi-Software' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -162,7 +163,7 @@ _EOF_ if (( $? != 0 )); then # Endless retry - if (( ! $USER_INPUTS )); then + if (( ! $G_USER_INPUTS )); then Reset_NTPD @@ -2625,7 +2626,7 @@ _EOF_ #Disable software installation, if user input is required for automated installs Install_Disable_Requires_UserInput(){ - if (( ! $USER_INPUTS )); then + if (( ! $G_USER_INPUTS )); then for ((i=0; i<$TOTAL_SOFTWARE_INDEXS; i++)) do @@ -3348,41 +3349,31 @@ _EOF_ } #apt-get install - AGI_ERROR_CHECKED(){ + AGI_ERROR_HANDLED(){ local string="$@" - G_AGI $string - if (( $? != 0 )); then - - Error_AptGet_Failed + export G_ERROR_HANDLER_ONERROR_USERMSG="DietPi-Software installation failed for:\n - Software Title = $G_ERROR_HANDLER_ONERROR_DPSOFTWARE_TITLE: $G_ERROR_HANDLER_ONERROR_DPSOFTWARE_DESC" - fi + G_AGI $string } #apt-get purge - AGP_ERROR_CHECKED(){ + AGP_ERROR_HANDLED(){ local string="$@" - G_AGP $string - if (( $? != 0 )); then - Error_AptGet_Failed + export G_ERROR_HANDLER_ONERROR_USERMSG="DietPi-Software uninstall failed:" - fi + G_AGP $string } #apt-get install -f - AGF_ERROR_CHECKED(){ + AGF_ERROR_HANDLED(){ G_AGF - if (( $? != 0 )); then - - Error_AptGet_Failed - - fi } @@ -3507,7 +3498,7 @@ _EOF_ # if (( $? == 0 )); then # # #Install Python and PIP - # AGI_ERROR_CHECKED python python-pip python-imaging + # AGI_ERROR_HANDLED python python-pip python-imaging # # cd "$HOME" # git clone --depth=1 "$INSTALL_URL_ADDRESS" @@ -3541,7 +3532,7 @@ _EOF_ if (( $? == 0 )); then - AGI_ERROR_CHECKED lxde upower policykit-1 iceweasel p7zip-full --no-install-recommends + AGI_ERROR_HANDLED lxde upower policykit-1 iceweasel p7zip-full --no-install-recommends #upower policykit-1. Needed for LXDE logout menu item to show shutdown/restart ...... else @@ -3565,7 +3556,7 @@ _EOF_ if (( $? == 0 )); then - AGI_ERROR_CHECKED mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full --no-install-recommends + AGI_ERROR_HANDLED mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full --no-install-recommends else @@ -3588,7 +3579,7 @@ _EOF_ if (( $? == 0 )); then - AGI_ERROR_CHECKED x-window-system-core wmaker gnustep gnustep-devel gnustep-games libc-dbg upower policykit-1 iceweasel p7zip-full --no-install-recommends + AGI_ERROR_HANDLED x-window-system-core wmaker gnustep gnustep-devel gnustep-games libc-dbg upower policykit-1 iceweasel p7zip-full --no-install-recommends else @@ -3611,7 +3602,7 @@ _EOF_ if (( $? == 0 )); then - AGI_ERROR_CHECKED xfce4 xfce4-terminal gnome-icon-theme tango-icon-theme iceweasel p7zip-full --no-install-recommends + AGI_ERROR_HANDLED xfce4 xfce4-terminal gnome-icon-theme tango-icon-theme iceweasel p7zip-full --no-install-recommends else @@ -3627,7 +3618,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED xrdp + AGI_ERROR_HANDLED xrdp fi @@ -3677,7 +3668,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED transmission-daemon + AGI_ERROR_HANDLED transmission-daemon fi @@ -3688,7 +3679,7 @@ _EOF_ Banner_Installing echo -e "proftpd-basic shared/proftpd/inetd_or_standalone select standalone" | debconf-set-selections - AGI_ERROR_CHECKED proftpd-basic + AGI_ERROR_HANDLED proftpd-basic fi @@ -3697,7 +3688,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED samba samba-common-bin --no-install-recommends + AGI_ERROR_HANDLED samba samba-common-bin --no-install-recommends fi @@ -3707,7 +3698,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED vsftpd --no-install-recommends + AGI_ERROR_HANDLED vsftpd --no-install-recommends fi @@ -3717,7 +3708,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED nfs-kernel-server nfs-common ucf rpcbind + AGI_ERROR_HANDLED nfs-kernel-server nfs-common ucf rpcbind fi @@ -3726,7 +3717,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED apache2 + AGI_ERROR_HANDLED apache2 fi @@ -3735,7 +3726,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED nginx xml-core --no-install-recommends + AGI_ERROR_HANDLED nginx xml-core --no-install-recommends fi @@ -3744,7 +3735,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED lighttpd + AGI_ERROR_HANDLED lighttpd fi @@ -3757,7 +3748,7 @@ _EOF_ debconf-set-selections <<< "mysql-server mysql-server/root_password password $GLOBAL_PW" debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $GLOBAL_PW" - AGI_ERROR_CHECKED mysql-server + AGI_ERROR_HANDLED mysql-server # Fix depricated key_buffer -> key_buffer_size per MySQL 5.x notification sed -i 's/^key_buffer[[:space:]]/key_buffer_size /g' /etc/mysql/my.cnf @@ -3773,7 +3764,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED mariadb-server + AGI_ERROR_HANDLED mariadb-server fi @@ -3782,7 +3773,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED sqlite3 + AGI_ERROR_HANDLED sqlite3 fi @@ -3791,11 +3782,11 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED redis-server + AGI_ERROR_HANDLED redis-server #Redis php module | == 2 to check for existing installs, if == 1, then module will be installed together with PHP, to prevent dependency installations if (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )); then - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-redis + AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-redis fi @@ -3810,30 +3801,30 @@ _EOF_ #Install base PHP packages/modules. if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME" libapache2-mod-"$PHP_APT_PACKAGE_NAME" + AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME" libapache2-mod-"$PHP_APT_PACKAGE_NAME" else - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-fpm "$PHP_APT_PACKAGE_NAME"-cgi + AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-fpm "$PHP_APT_PACKAGE_NAME"-cgi # 'php-xsl' does not exist for >= Stretch, 'php7.0-xsl' is just dummy for 'php7.0-xml': https://github.com/Fourdee/DietPi/issues/1286 - (( $G_DISTRO < 4 )) && AGI_ERROR_CHECKED php5-xsl + (( $G_DISTRO < 4 )) && AGI_ERROR_HANDLED php5-xsl fi #php-common modules, used by most web software - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-curl "$PHP_APT_PACKAGE_NAME"-gd "$PHP_APT_PACKAGE_NAME"-apcu "$PHP_APT_PACKAGE_NAME"-mcrypt + AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-curl "$PHP_APT_PACKAGE_NAME"-gd "$PHP_APT_PACKAGE_NAME"-apcu "$PHP_APT_PACKAGE_NAME"-mcrypt # + stretch extras if (( $G_DISTRO >= 4 )); then - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mbstring "$PHP_APT_PACKAGE_NAME"-zip "$PHP_APT_PACKAGE_NAME"-xml + AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-mbstring "$PHP_APT_PACKAGE_NAME"-zip "$PHP_APT_PACKAGE_NAME"-xml fi #php-SQL modules if (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 )); then - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mysql + AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-mysql fi @@ -3841,11 +3832,11 @@ _EOF_ if (( $G_DISTRO < 4 )); then #For <= Jessie, php5-mysqlnd provides the newer mysql client libraries compared to php5-mysql. - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mysqlnd + AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-mysqlnd else #For >= Stretch, php(7.X)-mysqlnd does not exist, thus php-mysql need to be installed: https://packages.debian.org/de/stretch/php-mysql - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-mysql + AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-mysql fi @@ -3853,14 +3844,14 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[87]} >= 1 )); then - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-sqlite* #wildcard for version (eg:3) + AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-sqlite* #wildcard for version (eg:3) fi #Redis php module if (( ${aSOFTWARE_INSTALL_STATE[91]} >= 1 )); then - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-redis + AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-redis fi @@ -3895,7 +3886,7 @@ _EOF_ fi - AGI_ERROR_CHECKED phpmyadmin + AGI_ERROR_HANDLED phpmyadmin fi @@ -3916,8 +3907,8 @@ _EOF_ if (( $? == 0 )); then #libupnp6 for net discov with upnp/avahi - AGI_ERROR_CHECKED libupnp6 - AGI_ERROR_CHECKED libmpdclient2 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file --no-install-recommends + AGI_ERROR_HANDLED libupnp6 + AGI_ERROR_HANDLED libmpdclient2 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file --no-install-recommends wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb @@ -3931,7 +3922,7 @@ _EOF_ else - AGI_ERROR_CHECKED mpd + AGI_ERROR_HANDLED mpd fi @@ -3968,7 +3959,7 @@ _EOF_ if (( $? == 0 )); then #Prereqs - AGI_ERROR_CHECKED libmpdclient2 libflac8 libyajl2 libavahi-client3 libvorbisfile3 libwavpack1 libmad0 libmpg123-0 libopus0 libavformat57 libfaad2 libcdio-paranoia1 libiso9660-8 libshout3 libid3tag0 + AGI_ERROR_HANDLED libmpdclient2 libflac8 libyajl2 libavahi-client3 libvorbisfile3 libwavpack1 libmad0 libmpg123-0 libopus0 libavformat57 libfaad2 libcdio-paranoia1 libiso9660-8 libshout3 libid3tag0 apt-mark unhold mpd &> /dev/null #??? Not required for dpkg -i installs @@ -4024,10 +4015,10 @@ _EOF_ if (( $? == 0 )); then - AGI_ERROR_CHECKED libsodium-dev automake autoconf pkg-config libtool libssl-dev libffi-dev python-dev openssl libzmq3-dev + AGI_ERROR_HANDLED libsodium-dev automake autoconf pkg-config libtool libssl-dev libffi-dev python-dev openssl libzmq3-dev #Not required. - #AGI_ERROR_CHECKED software-properties-common + #AGI_ERROR_HANDLED software-properties-common #add-apt-repository -y ppa:chris-lea/libsodium #G_AGUP @@ -4109,7 +4100,7 @@ _EOF_ if (( $? == 0 )); then # Install necessary PHP modules: https://doc.owncloud.org/server/latest/admin_manual/installation/source_installation.html#php-extensions - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis + AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis if [ ! -f /etc/apt/sources.list.d/owncloud.list ] && [ ! -f /var/www/owncloud/occ ]; then @@ -4128,7 +4119,7 @@ _EOF_ fi - [ -f /etc/apt/sources.list.d/owncloud.list ] && AGI_ERROR_CHECKED owncloud-files + [ -f /etc/apt/sources.list.d/owncloud.list ] && AGI_ERROR_HANDLED owncloud-files else @@ -4151,7 +4142,7 @@ _EOF_ if (( $? == 0 )); then # Install necessary PHP modules: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis + AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis if [ ! -f /var/www/nextcloud/occ ]; then @@ -4298,7 +4289,7 @@ _EOF_ if (( $? == 0 )); then - AGI_ERROR_CHECKED libpulse0 libfftw3-3 + AGI_ERROR_HANDLED libpulse0 libfftw3-3 wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb @@ -4331,14 +4322,14 @@ _EOF_ wget https://apt.mopidy.com/jessie.list -O /etc/apt/sources.list.d/mopidy.list G_AGUP - AGI_ERROR_CHECKED mopidy + AGI_ERROR_HANDLED mopidy #ARMv8 #NB: No ARM64 packages currently exist in mopidy repo. So it will throw a minor error when updating apt. #Mopidy web client extensions not loading in webpage... # if (( $G_HW_ARCH == 3 )); then - # AGI_ERROR_CHECKED build-essential python-dev + # AGI_ERROR_HANDLED build-essential python-dev # pip install mopidy #no effect, claims already upto date. # fi @@ -4362,29 +4353,29 @@ _EOF_ #Odroids if (( $G_HW_MODEL >= 10 )) && (( $G_HW_MODEL < 20 )); then - AGI_ERROR_CHECKED kodi-odroid + AGI_ERROR_HANDLED kodi-odroid #XU4 - requires pulse audio (fixes corrupt sound) if (( $G_HW_MODEL == 11 )); then - AGI_ERROR_CHECKED pulseaudio --no-install-recommends + AGI_ERROR_HANDLED pulseaudio --no-install-recommends fi #Everything else else - AGI_ERROR_CHECKED kodi + AGI_ERROR_HANDLED kodi fi # - libcurl3-gnutls required for C2. But lets apply to all: https://github.com/Fourdee/DietPi/issues/446 - AGI_ERROR_CHECKED libcurl3-gnutls + AGI_ERROR_HANDLED libcurl3-gnutls # - Add NFS support for kodi if (( $G_DISTRO == 3 )); then - AGI_ERROR_CHECKED libnfs4 + AGI_ERROR_HANDLED libnfs4 fi @@ -4410,7 +4401,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED minidlna + AGI_ERROR_HANDLED minidlna fi @@ -4468,12 +4459,12 @@ _EOF_ #Install if (( $? == 0 )); then - AGI_ERROR_CHECKED alsa-oss joystick libsdl-image1.2 libsdl-ttf2.0-0 libsdl-gfx1.2-5 libguichan-0.8.1-1* libguichan-allegro-0.8.1-1* libguichan-sdl-0.8.1-1* libguichan-opengl-0.8.1-1* libjpgalleg4.4 libxml2 libmpg123-0 + AGI_ERROR_HANDLED alsa-oss joystick libsdl-image1.2 libsdl-ttf2.0-0 libsdl-gfx1.2-5 libguichan-0.8.1-1* libguichan-allegro-0.8.1-1* libguichan-sdl-0.8.1-1* libguichan-opengl-0.8.1-1* libjpgalleg4.4 libxml2 libmpg123-0 #libmpeg2-4 # Required for dev branch # + SDL2 - AGI_ERROR_CHECKED libpng12-0 libflac8 libmpg123-0 libgoogle-perftools4 libfreetype6 libxxf86vm1 + AGI_ERROR_HANDLED libpng12-0 libflac8 libmpg123-0 libgoogle-perftools4 libfreetype6 libxxf86vm1 #Download binaries # - Backup existing autostart.uae for user @@ -4503,7 +4494,7 @@ _EOF_ #Install if (( $? == 0 )); then - AGI_ERROR_CHECKED libsdl-mixer1.2 libsdl1.2debian libphysfs1 + AGI_ERROR_HANDLED libsdl-mixer1.2 libsdl1.2debian libphysfs1 wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z -o"$G_FP_DIETPI_USERDATA" @@ -4547,7 +4538,7 @@ _EOF_ #ARMv8 source build if (( $G_HW_ARCH == 3 )); then - AGI_ERROR_CHECKED build-essential zlib1g-dev libcurl4-openssl-dev libcrypto++-dev sqlite3 + AGI_ERROR_HANDLED build-essential zlib1g-dev libcurl4-openssl-dev libcrypto++-dev sqlite3 wget "$INSTALL_URL_ADDRESS" -O package.tar tar xzvf package.tar @@ -4602,7 +4593,7 @@ _EOF_ #Install if (( $? == 0 )); then - AGI_ERROR_CHECKED ibsdl1.2debian libsdl-net1.2 --no-install-recommends + AGI_ERROR_HANDLED ibsdl1.2debian libsdl-net1.2 --no-install-recommends #Download binaries wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -4631,7 +4622,7 @@ _EOF_ if (( $? == 0 )); then #Install pre-reqs - AGI_ERROR_CHECKED gpac motion + AGI_ERROR_HANDLED gpac motion #Get source/binaries and extract wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -4680,7 +4671,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED deluged deluge-web deluge-webui deluge-console + AGI_ERROR_HANDLED deluged deluge-web deluge-webui deluge-console fi @@ -4690,7 +4681,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED python + AGI_ERROR_HANDLED python #Download Grasshopper local grasshopper_directory='/var/www' @@ -4753,7 +4744,7 @@ _EOF_ wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb - AGF_ERROR_CHECKED + AGF_ERROR_HANDLED rm package.deb @@ -4778,13 +4769,13 @@ _EOF_ echo -e "deb $INSTALL_URL_ADDRESS erasmus main" > /etc/apt/sources.list.d/openmediavault.list G_AGUP - AGI_ERROR_CHECKED openmediavault-keyring + AGI_ERROR_HANDLED openmediavault-keyring debconf-set-selections <<< "openmediavault openmediavault/run-initsystem note" debconf-set-selections <<< "postfix postfix/main_mailer_type select No configuration" G_AGUP - AGI_ERROR_CHECKED openmediavault postfix + AGI_ERROR_HANDLED openmediavault postfix else @@ -4825,7 +4816,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED darkice icecast2 + AGI_ERROR_HANDLED darkice icecast2 fi @@ -4866,7 +4857,7 @@ _EOF_ if (( $? == 0 )); then # - Pre-reqs: https://github.com/Fourdee/DietPi/issues/1282#issuecomment-350490524 - AGI_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-cgi "$PHP_APT_PACKAGE_NAME"-sqlite* + AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-cgi "$PHP_APT_PACKAGE_NAME"-sqlite* # - Check free available memory. Increase swapfile size to prevent gravity running out of mem. if (( $(free -m | grep -m1 'Mem:' | awk '{print $4}') < 512 )); then @@ -4916,7 +4907,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - #AGI_ERROR_CHECKED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 + #AGI_ERROR_HANDLED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 #Install SubSonic 5.3 wget "$INSTALL_URL_ADDRESS" -O package.deb @@ -4941,7 +4932,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - #AGI_ERROR_CHECKED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 + #AGI_ERROR_HANDLED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 #Install SubSonic 6.0 wget "$INSTALL_URL_ADDRESS" -O package.deb @@ -4995,12 +4986,12 @@ _EOF_ # >= v111 image if [ -f /etc/.dietpi_image_version ]; then - AGI_ERROR_CHECKED python-rpi.gpio python3-rpi.gpio + AGI_ERROR_HANDLED python-rpi.gpio python3-rpi.gpio # - < v111 Bug in older DietPi images with sources.list | Use pip, as offical repo = python3-rpi.gpio: Depends: python3 (< 3.3) but 3.4.2-2 is to be installed else - AGI_ERROR_CHECKED python3-pip + AGI_ERROR_HANDLED python3-pip pip3 install RPi.GPIO fi @@ -5088,12 +5079,12 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED python python3 + AGI_ERROR_HANDLED python python3 # - RPi, pre-reqs GPIO control for Node-Red if (( $G_HW_MODEL < 10 )); then - AGI_ERROR_CHECKED python-rpi.gpio + AGI_ERROR_HANDLED python-rpi.gpio fi @@ -5203,7 +5194,7 @@ _EOF_ G_AGUP - AGI_ERROR_CHECKED mosquitto + AGI_ERROR_HANDLED mosquitto else @@ -5231,7 +5222,7 @@ _EOF_ wget "$INSTALL_URL_ADDRESS" -O /etc/blynkserver/server.jar # - Install Blynk JS Libary - AGI_ERROR_CHECKED python + AGI_ERROR_HANDLED python npm install -g onoff npm install -g blynk-library @@ -5250,7 +5241,7 @@ _EOF_ Banner_Installing # - Skip license for NAA daemon if needed: - if (( ! $USER_INPUTS )); then + if (( ! $G_USER_INPUTS )); then debconf-set-selections <<< "networkaudiod networkaudiod/license note false" @@ -5289,12 +5280,12 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then # - Prereqs - AGI_ERROR_CHECKED libasound2 + AGI_ERROR_HANDLED libasound2 # - Stretch, install additional packages if (( $G_DISTRO >= 4 )); then - AGI_ERROR_CHECKED gcc-6-base libstdc++6 + AGI_ERROR_HANDLED gcc-6-base libstdc++6 fi @@ -5322,7 +5313,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED tomcat8 + AGI_ERROR_HANDLED tomcat8 fi @@ -5337,7 +5328,7 @@ _EOF_ if (( $? == 0 )); then #Python dev, pre-reqs - AGI_ERROR_CHECKED python-dev python-setuptools --no-install-recommends + AGI_ERROR_HANDLED python-dev python-setuptools --no-install-recommends #Install WEBIOPI wget "$INSTALL_URL_ADDRESS" -O package.tar @@ -5403,7 +5394,7 @@ _EOF_ cd haproxy-* #Pre-reqs - AGI_ERROR_CHECKED libpcre3-dev libssl-dev + AGI_ERROR_HANDLED libpcre3-dev libssl-dev #Compile and install make -j $G_HW_CPU_CORES TARGET=linux2628 CPU=generic USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 USE_LINUX_SPLICE=1 make install @@ -5446,7 +5437,7 @@ _EOF_ rm package.deb #https://github.com/Fourdee/DietPi/issues/736 - AGF_ERROR_CHECKED + AGF_ERROR_HANDLED #Stop service service logitechmediaserver stop @@ -5455,7 +5446,7 @@ _EOF_ # Compile pre-req CPAN modules??? # if (( $G_DISTRO >= 4 )); then - # AGI_ERROR_CHECKED yasm git build-essential automake cpanminus nasm libxml-parser-perl libexpat1-dev libgif-dev zlib1g-dev libjpeg-dev libpng-dev + # AGI_ERROR_HANDLED yasm git build-essential automake cpanminus nasm libxml-parser-perl libexpat1-dev libgif-dev zlib1g-dev libjpeg-dev libpng-dev # + ARMv6 cpan @@ -5468,8 +5459,8 @@ _EOF_ # + ARM64 cpan elif (( $G_HW_ARCH == 3 )); then - AGI_ERROR_CHECKED libxml-parser-perl - AGI_ERROR_CHECKED zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev # shared libs needed for Image::Scale@0.08 + AGI_ERROR_HANDLED libxml-parser-perl + AGI_ERROR_HANDLED zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev # shared libs needed for Image::Scale@0.08 wget http://dietpi.com/downloads/binaries/all/DietPi-LMS7.9-CPAN_arm64.zip -O package.zip unzip -o package.zip -d /usr/share/squeezeboxserver @@ -5516,7 +5507,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED tightvncserver x11vnc --no-install-recommends + AGI_ERROR_HANDLED tightvncserver x11vnc --no-install-recommends fi @@ -5526,12 +5517,12 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED vnc4server x11vnc --no-install-recommends + AGI_ERROR_HANDLED vnc4server x11vnc --no-install-recommends # - Stretch+ if (( $G_DISTRO >= 4 )); then - AGI_ERROR_CHECKED tigervnc-common + AGI_ERROR_HANDLED tigervnc-common fi @@ -5564,7 +5555,7 @@ _EOF_ # fi # - Available in Raspbian apt - AGI_ERROR_CHECKED realvnc-vnc-server + AGI_ERROR_HANDLED realvnc-vnc-server fi @@ -5576,7 +5567,7 @@ _EOF_ touch /var/log/auth.log #: https://github.com/Fourdee/DietPi/issues/475#issuecomment-310873879 - AGI_ERROR_CHECKED fail2ban --no-install-recommends + AGI_ERROR_HANDLED fail2ban --no-install-recommends fi @@ -5675,7 +5666,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED openvpn easy-rsa iptables + AGI_ERROR_HANDLED openvpn easy-rsa iptables fi @@ -5692,7 +5683,7 @@ _EOF_ #Install if (( $? == 0 )); then - AGI_ERROR_CHECKED lsb-release + AGI_ERROR_HANDLED lsb-release # - Requires underpriv user: https://github.com/Fourdee/DietPi/issues/570#issuecomment-255588307 useradd pivpn @@ -5739,17 +5730,17 @@ _EOF_ if (( $G_DISTRO >= 4 )); then - AGI_ERROR_CHECKED certbot + AGI_ERROR_HANDLED certbot if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then - AGI_ERROR_CHECKED python-certbot-apache + AGI_ERROR_HANDLED python-certbot-apache fi if (( ${aSOFTWARE_INSTALL_STATE[85]} >= 1 )); then - AGI_ERROR_CHECKED python-certbot-nginx + AGI_ERROR_HANDLED python-certbot-nginx fi @@ -5801,7 +5792,7 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - AGI_ERROR_CHECKED hostapd isc-dhcp-server iptables libnl-3-200 + AGI_ERROR_HANDLED hostapd isc-dhcp-server iptables libnl-3-200 wget "$INSTALL_URL_ADDRESS" -O package.zip unzip -o package.zip @@ -5924,7 +5915,7 @@ _EOF_ Banner_Installing # - Prereqs - AGI_ERROR_CHECKED tor + AGI_ERROR_HANDLED tor fi @@ -5964,10 +5955,10 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - AGI_ERROR_CHECKED openssl libsoxr0 libavahi-client3 libtool libconfig9 libpopt0 libdaemon0 --no-install-recommends + AGI_ERROR_HANDLED openssl libsoxr0 libavahi-client3 libtool libconfig9 libpopt0 libdaemon0 --no-install-recommends # This occured on C2: shairport-sync : Depends: libpopt-dev but it is not installed - #AGI_ERROR_CHECKED libpopt-dev + #AGI_ERROR_HANDLED libpopt-dev wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z -o/ @@ -6034,7 +6025,7 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - AGI_ERROR_CHECKED brutefir + AGI_ERROR_HANDLED brutefir wget -r -nH --cut-dirs=2 --no-parent --reject="index.htm*" -e robots=off "$INSTALL_URL_ADDRESS" mv BruteFIR /etc/ @@ -6086,7 +6077,7 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - AGI_ERROR_CHECKED squeezelite + AGI_ERROR_HANDLED squeezelite # - Overwrite binary with latest version: wget "$INSTALL_URL_ADDRESS" -O package.7z @@ -6144,7 +6135,7 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - AGI_ERROR_CHECKED minicom python-serial python-configobj --no-install-recommends + AGI_ERROR_HANDLED minicom python-serial python-configobj --no-install-recommends pip install paho-mqtt pydispatcher wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -6230,7 +6221,7 @@ _EOF_ if (( $? == 0 )); then # - For compression - AGI_ERROR_CHECKED --no-install-recommends zlib1g-dev + AGI_ERROR_HANDLED --no-install-recommends zlib1g-dev wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb @@ -6276,7 +6267,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED mumble-server + AGI_ERROR_HANDLED mumble-server fi @@ -6359,7 +6350,7 @@ _EOF_ fi - AGI_ERROR_CHECKED emby-server embymagick + AGI_ERROR_HANDLED emby-server embymagick else @@ -6413,12 +6404,12 @@ _EOF_ dpkg --add-architecture armhf G_AGUP - AGI_ERROR_CHECKED binutils:armhf plexmediaserver-installer:armhf + AGI_ERROR_HANDLED binutils:armhf plexmediaserver-installer:armhf #ARM32 else - AGI_ERROR_CHECKED plexmediaserver-installer + AGI_ERROR_HANDLED plexmediaserver-installer fi @@ -6486,7 +6477,7 @@ _EOF_ if (( $? == 0 )); then #prereqs - AGI_ERROR_CHECKED python python3 supervisor rdiff-backup screen rsync + AGI_ERROR_HANDLED python python3 supervisor rdiff-backup screen rsync mkdir -p "$G_FP_DIETPI_USERDATA"/mineos cd "$G_FP_DIETPI_USERDATA"/mineos @@ -6557,7 +6548,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED qbittorrent-nox + AGI_ERROR_HANDLED qbittorrent-nox fi @@ -6573,16 +6564,16 @@ _EOF_ #Install if (( $? == 0 )); then - AGI_ERROR_CHECKED rtorrent screen #mediainfo + AGI_ERROR_HANDLED rtorrent screen #mediainfo #Raspbian unrar free if (( $G_HW_MODEL < 10 )); then - AGI_ERROR_CHECKED unrar-free #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 + AGI_ERROR_HANDLED unrar-free #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 else - AGI_ERROR_CHECKED unrar #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 + AGI_ERROR_HANDLED unrar #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 fi @@ -6611,7 +6602,7 @@ _EOF_ if (( $G_DISTRO >= 4 )); then - AGI_ERROR_CHECKED aria2 + AGI_ERROR_HANDLED aria2 else @@ -6644,7 +6635,7 @@ _EOF_ if (( $? == 0 )); then # - prereqs - AGI_ERROR_CHECKED libc-ares2 + AGI_ERROR_HANDLED libc-ares2 wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z @@ -6694,16 +6685,16 @@ _EOF_ #Install if (( $? == 0 )); then - AGI_ERROR_CHECKED python libxslt1.1 libxml2 python-openssl python-xmltodict + AGI_ERROR_HANDLED python libxslt1.1 libxml2 python-openssl python-xmltodict #Raspbian unrar free if (( $G_HW_MODEL < 10 )); then - AGI_ERROR_CHECKED unrar-free + AGI_ERROR_HANDLED unrar-free else - AGI_ERROR_CHECKED unrar + AGI_ERROR_HANDLED unrar fi @@ -6817,7 +6808,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - AGI_ERROR_CHECKED libpng12-0 libfontconfig1 + AGI_ERROR_HANDLED libpng12-0 libfontconfig1 wget "$INSTALL_URL_ADDRESS" -O package.tar mkdir /etc/tonido @@ -6843,11 +6834,11 @@ _EOF_ if (( $G_HW_MODEL < 10 )); then - AGI_ERROR_CHECKED chromium-browser + AGI_ERROR_HANDLED chromium-browser else - AGI_ERROR_CHECKED chromium + AGI_ERROR_HANDLED chromium fi @@ -6876,11 +6867,11 @@ _EOF_ # - Odroid's, 'apt-get install -f' removes chromium package, rather than install required deps... if (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )); then - AGI_ERROR_CHECKED libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7 + AGI_ERROR_HANDLED libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7 else - AGF_ERROR_CHECKED + AGF_ERROR_HANDLED fi @@ -6932,7 +6923,7 @@ _EOF_ if (( $? == 0 )); then # - Prereqs - AGI_ERROR_CHECKED v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev libx264-142 libavcodec56 libavformat56 libmysqlclient18 libswscale3 libpq5 + AGI_ERROR_HANDLED v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev libx264-142 libavcodec56 libavformat56 libmysqlclient18 libswscale3 libpq5 # - Motion wget "$INSTALL_URL_ADDRESS" -O package.deb @@ -6952,9 +6943,9 @@ _EOF_ else # - Prereqs - AGI_ERROR_CHECKED v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev + AGI_ERROR_HANDLED v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev - AGI_ERROR_CHECKED motion + AGI_ERROR_HANDLED motion # - Motioneye pip install motioneye @@ -6983,7 +6974,7 @@ _EOF_ wget -q -O - https://davesteele.github.io/key-366150CE.pub.txt | apt-key add - G_AGUP - AGI_ERROR_CHECKED cloudprint-service + AGI_ERROR_HANDLED cloudprint-service else @@ -6993,7 +6984,7 @@ _EOF_ else - AGI_ERROR_CHECKED cloudprint-service + AGI_ERROR_HANDLED cloudprint-service fi @@ -7056,15 +7047,15 @@ _EOF_ if (( $? == 0 )); then #prereqs - AGI_ERROR_CHECKED par2 python-dev libffi-dev libssl-dev + AGI_ERROR_HANDLED par2 python-dev libffi-dev libssl-dev if (( $G_HW_MODEL < 10 )); then - AGI_ERROR_CHECKED unrar-free + AGI_ERROR_HANDLED unrar-free else - AGI_ERROR_CHECKED unrar + AGI_ERROR_HANDLED unrar fi @@ -7120,7 +7111,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - AGI_ERROR_CHECKED libffi-dev libssl-dev python-lxml python3-lxml + AGI_ERROR_HANDLED libffi-dev libssl-dev python-lxml python3-lxml wget "$INSTALL_URL_ADDRESS" -O package.zip unzip -o package.zip @@ -7152,7 +7143,7 @@ _EOF_ #Install if (( $? == 0 )); then - AGI_ERROR_CHECKED python + AGI_ERROR_HANDLED python wget "$INSTALL_URL_ADDRESS" -O package.zip unzip -o package.zip @@ -7197,7 +7188,7 @@ _EOF_ fi G_AGUP - AGI_ERROR_CHECKED nzbdrone + AGI_ERROR_HANDLED nzbdrone fi @@ -7214,7 +7205,7 @@ _EOF_ #Install if (( $? == 0 )); then - AGI_ERROR_CHECKED mono-devel mediainfo sqlite3 libmono-cil-dev + AGI_ERROR_HANDLED mono-devel mediainfo sqlite3 libmono-cil-dev wget $( curl -s "$INSTALL_URL_ADDRESS" | grep linux.tar.gz | grep browser_download_url | head -1 | cut -d \" -f 4 ) -O package.tar tar -xf package.tar -C /opt/ @@ -7241,7 +7232,7 @@ _EOF_ #Install if (( $? == 0 )); then - AGI_ERROR_CHECKED python + AGI_ERROR_HANDLED python git clone --depth=1 "$INSTALL_URL_ADDRESS" @@ -7268,7 +7259,7 @@ _EOF_ #Install if (( $? == 0 )); then - AGI_ERROR_CHECKED mono-devel + AGI_ERROR_HANDLED mono-devel wget $( curl -s "$INSTALL_URL_ADDRESS" | grep Jackett.Binaries.Mono.tar.gz | grep browser_download_url | head -1 | cut -d \" -f 4 ) -O package.tar tar -xvf package.tar @@ -7306,7 +7297,7 @@ _EOF_ G_AGUP - AGI_ERROR_CHECKED mediacenter22 + AGI_ERROR_HANDLED mediacenter22 else @@ -7357,7 +7348,7 @@ _EOF_ if (( $? == 0 )); then #Install Python and PIP - AGI_ERROR_CHECKED python python-pip python-imaging python-dev + AGI_ERROR_HANDLED python python-pip python-imaging python-dev cd "$HOME" git clone --depth=1 "$INSTALL_URL_ADDRESS" @@ -7386,7 +7377,7 @@ _EOF_ if (( $? == 0 )); then - AGI_ERROR_CHECKED python python-dev + AGI_ERROR_HANDLED python python-dev git clone "$INSTALL_URL_ADDRESS" mv OctoPrint* "$G_FP_DIETPI_USERDATA"/octoprint @@ -7414,7 +7405,7 @@ _EOF_ if (( $? == 0 )); then - AGI_ERROR_CHECKED libav-tools cifs-utils + AGI_ERROR_HANDLED libav-tools cifs-utils wget "$INSTALL_URL_ADDRESS" -O package.tar tar xvf package.tar @@ -7438,7 +7429,7 @@ _EOF_ debconf-set-selections <<< "steam steam/question select I AGREE" - AGI_ERROR_CHECKED steam + AGI_ERROR_HANDLED steam fi @@ -7674,7 +7665,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - AGI_ERROR_CHECKED libupnp6 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-alsa + AGI_ERROR_HANDLED 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 @@ -7712,7 +7703,7 @@ _EOF_ echo -e "deb https://dtcooper.github.io/raspotify jessie main" > /etc/apt/sources.list.d/raspotify.list G_AGUP - AGI_ERROR_CHECKED raspotify + AGI_ERROR_HANDLED raspotify else @@ -7738,23 +7729,23 @@ _EOF_ #Pre-Reqs ----------------------------------------------------------------------- # Core packages - AGI_ERROR_CHECKED rpi-update mpc memcached $PHP_APT_PACKAGE_NAME-memcache \ + AGI_ERROR_HANDLED 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_ERROR_CHECKED dnsmasq hostapd + AGI_ERROR_HANDLED dnsmasq hostapd # BT - AGI_ERROR_CHECKED bluez bluez-firmware \ + AGI_ERROR_HANDLED 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 (( $G_HW_MODEL < 10 )); then - AGI_ERROR_CHECKED pi-bluetooth + AGI_ERROR_HANDLED pi-bluetooth fi @@ -7868,7 +7859,7 @@ libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc Banner_Installing - AGI_ERROR_CHECKED alsa-utils + AGI_ERROR_HANDLED alsa-utils #Apply soundcard local soundcard=$(cat /DietPi/dietpi.txt | grep -m1 'soundcard=' | sed 's/.*=//') @@ -7899,7 +7890,7 @@ libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc Banner_Installing #Xserver Prereqs (ALL) - AGI_ERROR_CHECKED xcompmgr xterm xinit xauth xserver-xorg dbus-x11 xfonts-base x11-xserver-utils x11-common x11-utils --no-install-recommends + AGI_ERROR_HANDLED xcompmgr xterm xinit xauth xserver-xorg dbus-x11 xfonts-base x11-xserver-utils x11-common x11-utils --no-install-recommends #Improve performance on all desktops and devices (eg: removes window lag in desktops) by limiting compositions mkdir -p /etc/xdg/autostart @@ -7919,11 +7910,11 @@ _EOF_ #Odroid C2 elif (( $G_HW_MODEL == 12 )); then - AGI_ERROR_CHECKED aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump-odroid --no-install-recommends + AGI_ERROR_HANDLED aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump-odroid --no-install-recommends #cp /DietPi/dietpi/conf/xorg_c2.conf /etc/X11/xorg.conf # FBTURBO C2, provides much better desktop performance over Mali DDX: http://forum.odroid.com/viewtopic.php?f=138&t=19948&p=169808#p169808 - AGI_ERROR_CHECKED xf86-video-fbturbo-odroid + AGI_ERROR_HANDLED xf86-video-fbturbo-odroid cat << _EOF_ > /etc/X11/xorg.conf Section "Device" Identifier "FBTurbo" @@ -7937,14 +7928,14 @@ _EOF_ #Odroid XU4 elif (( $G_HW_MODEL == 11 )); then - AGI_ERROR_CHECKED firmware-samsung xf86-video-armsoc-odroid malit628-odroid --no-install-recommends + AGI_ERROR_HANDLED firmware-samsung xf86-video-armsoc-odroid malit628-odroid --no-install-recommends cp /DietPi/dietpi/conf/xorg_xu4.conf /etc/X11/xorg.conf #Odroid C1 elif (( $G_HW_MODEL == 10 )); then - AGI_ERROR_CHECKED aml-libs-odroid xf86-video-mali-odroid libump-odroid mali450-odroid --no-install-recommends + AGI_ERROR_HANDLED aml-libs-odroid xf86-video-mali-odroid libump-odroid mali450-odroid --no-install-recommends cp /DietPi/dietpi/conf/xorg_c1.conf /etc/X11/xorg.conf @@ -8003,10 +7994,10 @@ _EOF_ Banner_Installing #Install - AGI_ERROR_CHECKED nvidia-driver nvidia-xconfig + AGI_ERROR_HANDLED nvidia-driver nvidia-xconfig # + i386 OpenGL - AGI_ERROR_CHECKED libgl1-nvidia-glx:i386 + AGI_ERROR_HANDLED libgl1-nvidia-glx:i386 fi @@ -8016,7 +8007,7 @@ _EOF_ Banner_Installing - AGI_ERROR_CHECKED avahi-daemon + AGI_ERROR_HANDLED avahi-daemon fi @@ -8024,7 +8015,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED build-essential make autoconf automake --no-install-recommends + AGI_ERROR_HANDLED build-essential make autoconf automake --no-install-recommends fi @@ -8032,7 +8023,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED ntp + AGI_ERROR_HANDLED ntp # Remove service, as DietPi ntpd-mode launches the binary with custom commands systemctl stop ntp @@ -8046,7 +8037,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED git --no-install-recommends + AGI_ERROR_HANDLED git --no-install-recommends fi @@ -8054,7 +8045,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED vifm + AGI_ERROR_HANDLED vifm fi @@ -8062,7 +8053,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED vim + AGI_ERROR_HANDLED vim fi @@ -8070,7 +8061,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED vim-tiny + AGI_ERROR_HANDLED vim-tiny fi @@ -8078,7 +8069,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED neovim + AGI_ERROR_HANDLED neovim fi @@ -8086,7 +8077,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED emacs + AGI_ERROR_HANDLED emacs fi @@ -8094,7 +8085,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED iperf + AGI_ERROR_HANDLED iperf fi @@ -8102,7 +8093,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED mc + AGI_ERROR_HANDLED mc fi @@ -8110,7 +8101,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED jed + AGI_ERROR_HANDLED jed fi @@ -8118,7 +8109,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED iftop + AGI_ERROR_HANDLED iftop fi @@ -8126,7 +8117,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED iptraf + AGI_ERROR_HANDLED iptraf fi @@ -8134,7 +8125,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED mtr-tiny + AGI_ERROR_HANDLED mtr-tiny fi @@ -8142,7 +8133,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED nload + AGI_ERROR_HANDLED nload fi @@ -8150,7 +8141,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED tcpdump + AGI_ERROR_HANDLED tcpdump fi @@ -8158,7 +8149,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED openssh-client + AGI_ERROR_HANDLED openssh-client fi @@ -8170,7 +8161,7 @@ _EOF_ #Remove Information file rm /mnt/samba/readme.txt &> /dev/null - AGI_ERROR_CHECKED smbclient cifs-utils --no-install-recommends + AGI_ERROR_HANDLED smbclient cifs-utils --no-install-recommends fi @@ -8182,7 +8173,7 @@ _EOF_ #Remove information file rm /mnt/ftp_client/readme.txt &> /dev/null - AGI_ERROR_CHECKED curlftpfs + AGI_ERROR_HANDLED curlftpfs fi @@ -8194,7 +8185,7 @@ _EOF_ #Remove information file rm /mnt/nfs_client/readme.txt &> /dev/null - AGI_ERROR_CHECKED nfs-common + AGI_ERROR_HANDLED nfs-common fi @@ -8202,7 +8193,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED dropbear + AGI_ERROR_HANDLED dropbear #set to start on next boot sed -i '/NO_START=1/c\NO_START=0' /etc/default/dropbear @@ -8213,7 +8204,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED openssh-server --no-install-recommends + AGI_ERROR_HANDLED openssh-server --no-install-recommends # - Remove all references before adding the entry: https://github.com/Fourdee/DietPi/issues/604 @@ -8256,7 +8247,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED logrotate --no-install-recommends + AGI_ERROR_HANDLED logrotate --no-install-recommends fi @@ -8264,7 +8255,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_CHECKED rsyslog --no-install-recommends + AGI_ERROR_HANDLED rsyslog --no-install-recommends fi @@ -8296,7 +8287,7 @@ _EOF_ #Everything else else - AGI_ERROR_CHECKED ffmpeg + AGI_ERROR_HANDLED ffmpeg fi @@ -8310,7 +8301,7 @@ _EOF_ # - Raspbian if (( $G_HW_MODEL < 10 )); then - AGI_ERROR_CHECKED oracle-java8-jdk + AGI_ERROR_HANDLED oracle-java8-jdk # - Debian. Add repo else @@ -8326,7 +8317,7 @@ _EOF_ # - Accept the license: https://github.com/Fourdee/DietPi/issues/298 debconf-set-selections <<< "oracle-java8-installer shared/accepted-oracle-license-v1-1 boolean true" - AGI_ERROR_CHECKED oracle-java8-installer + AGI_ERROR_HANDLED oracle-java8-installer fi @@ -8371,13 +8362,13 @@ _EOF_ if (( $? == 0 )); then # - Preqs - AGI_ERROR_CHECKED python python-dev + AGI_ERROR_HANDLED python python-dev wget "$INSTALL_URL_ADDRESS" -O install.py python ./install.py rm install.py - AGI_ERROR_CHECKED python-pip python3-pip + AGI_ERROR_HANDLED python-pip python3-pip else @@ -8398,7 +8389,7 @@ _EOF_ if (( $? == 0 )); then - #AGI_ERROR_CHECKED libxss1 #if using SDL2+rpi5 + #AGI_ERROR_HANDLED libxss1 #if using SDL2+rpi5 wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z -osdl2_rpi @@ -8436,7 +8427,7 @@ _EOF_ G_AGUP - AGI_ERROR_CHECKED mono-runtime + AGI_ERROR_HANDLED mono-runtime fi @@ -8459,15 +8450,15 @@ _EOF_ G_DIETPI-NOTIFY 2 "HA_PYTHON_VERSION: $HA_PYTHON_VERSION" # Install needed libraries - AGI_ERROR_CHECKED 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 + AGI_ERROR_HANDLED 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 (( $G_DISTRO == 3 )); then - AGI_ERROR_CHECKED libmysqlclient-dev + AGI_ERROR_HANDLED libmysqlclient-dev fi if (( $G_DISTRO >= 4 )); then - AGI_ERROR_CHECKED libmariadbclient-dev + AGI_ERROR_HANDLED libmariadbclient-dev fi @@ -10570,7 +10561,7 @@ _EOF_ ${aSOFTWARE_INSTALL_STATE[120]} == 1 )); then #User, enter PW - if (( $USER_INPUTS )); then + if (( $G_USER_INPUTS )); then local entering_pw=1 local loop_count=0 @@ -11402,7 +11393,7 @@ _EOF_ #For all ARM devices: # - en_US.UTF8 must be installed and the default locale on system. This is for SBC installs using dev2day repo: https://github.com/Fourdee/DietPi/issues/116#issuecomment-222195911 - if (( $USER_INPUTS && + if (( $G_USER_INPUTS && $G_HW_ARCH < 10 && ! $(locale | grep -ci -m1 'en_US.UTF-8') )); then sed -i '/en_US.UTF-8 UTF-8/c\en_US.UTF-8 UTF-8' /etc/locale.gen @@ -11657,7 +11648,7 @@ _EOF_ a2enmod rewrite #install scgi module - AGI_ERROR_CHECKED libapache2-mod-scgi + AGI_ERROR_HANDLED libapache2-mod-scgi htpasswd -cb /etc/.rutorrent-htaccess root "$GLOBAL_PW" cat << _EOF_ > /var/www/rutorrent/.htaccess @@ -13269,55 +13260,55 @@ _EOF_ elif (( $1 == 23 )); then - AGP_ERROR_CHECKED lxde lxde-* upower policykit-1 iceweasel p7zip-full + AGP_ERROR_HANDLED lxde lxde-* upower policykit-1 iceweasel p7zip-full elif (( $1 == 24 )); then - AGP_ERROR_CHECKED mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full + AGP_ERROR_HANDLED mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full elif (( $1 == 26 )); then - AGP_ERROR_CHECKED x-window-system-core wmaker gnustep gnustep-devel gnustep-games upower policykit-1 iceweasel p7zip-full + AGP_ERROR_HANDLED x-window-system-core wmaker gnustep gnustep-devel gnustep-games upower policykit-1 iceweasel p7zip-full elif (( $1 == 25 )); then - AGP_ERROR_CHECKED xfce4 gnome-icon-theme tango-icon-theme iceweasel p7zip-full + AGP_ERROR_HANDLED xfce4 gnome-icon-theme tango-icon-theme iceweasel p7zip-full elif (( $1 == 22 )); then - AGP_ERROR_CHECKED quiterss + AGP_ERROR_HANDLED quiterss elif (( $1 == 30 )); then - AGP_ERROR_CHECKED nomachine + AGP_ERROR_HANDLED nomachine elif (( $1 == 29 )); then - AGP_ERROR_CHECKED xrdp + AGP_ERROR_HANDLED xrdp elif (( $1 == 44 )); then - AGP_ERROR_CHECKED transmission-daemon + AGP_ERROR_HANDLED transmission-daemon rm /etc/init.d/transmission-daemon &> /dev/null rm /etc/systemd/system/transmission-daemon.service &> /dev/null elif (( $1 == 83 )); then - AGP_ERROR_CHECKED apache2 + AGP_ERROR_HANDLED apache2 elif (( $1 == 85 )); then - AGP_ERROR_CHECKED nginx + AGP_ERROR_HANDLED nginx elif (( $1 == 84 )); then - AGP_ERROR_CHECKED lighttpd + AGP_ERROR_HANDLED lighttpd elif (( $1 == 86 || $1 == 88 )); then - AGP_ERROR_CHECKED mysql-server mysql-client + AGP_ERROR_HANDLED mysql-server mysql-client - AGP_ERROR_CHECKED mariadb-server mariadb-client + AGP_ERROR_HANDLED mariadb-server mariadb-client # - custom confs rm /etc/mysql/conf.d/reduce_resources.cnf @@ -13331,17 +13322,17 @@ _EOF_ elif (( $1 == 87 )); then - AGP_ERROR_CHECKED sqlite3 + AGP_ERROR_HANDLED sqlite3 elif (( $1 == 91 )); then - AGP_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-redis redis-server redis-tools + AGP_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-redis redis-server redis-tools elif (( $1 == 89 )); then rm "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf rm "$FP_PHP_BASE_DIR"/mods-available/dietpi.ini 2> /dev/null - AGP_ERROR_CHECKED "$PHP_APT_PACKAGE_NAME"-* libapache2-mod-"$PHP_APT_PACKAGE_NAME" + AGP_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-* libapache2-mod-"$PHP_APT_PACKAGE_NAME" rm /var/www/phpinfo.php rm /var/www/apc.php rm /var/www/opcache.php @@ -13350,7 +13341,7 @@ _EOF_ elif (( $1 == 90 )); then - AGP_ERROR_CHECKED phpmyadmin + AGP_ERROR_HANDLED phpmyadmin elif (( $1 == 54 )); then @@ -13377,7 +13368,7 @@ _EOF_ mysqldump --lock-tables "$mysql_auth" owncloud > "$G_FP_DIETPI_USERDATA"/owncloud_data/mysql_backup.sql mysqladmin "$mysql_auth" drop owncloud -f # Purge APT package - AGP_ERROR_CHECKED owncloud-files owncloud owncloud-deps + AGP_ERROR_HANDLED owncloud-files owncloud owncloud-deps # Remove ownCloud installation folder rm -R /var/www/owncloud # Remove ownCloud repo @@ -13406,7 +13397,7 @@ _EOF_ elif (( $1 == 115 )); then - AGP_ERROR_CHECKED webmin + AGP_ERROR_HANDLED webmin elif (( $1 == 32 )); then @@ -13415,7 +13406,7 @@ _EOF_ elif (( $1 == 128 )); then - AGP_ERROR_CHECKED mpd libmpdclient2 + AGP_ERROR_HANDLED mpd libmpdclient2 userdel -f mpd &> /dev/null rm /lib/systemd/system/mpd.service rm -R "$G_FP_DIETPI_USERDATA"/.mpd_cache @@ -13433,20 +13424,20 @@ _EOF_ elif (( $1 == 123 )); then - AGP_ERROR_CHECKED mosquitto + AGP_ERROR_HANDLED mosquitto rm /etc/apt/sources.list.d/mosquitto-*.list elif (( $1 == 124 )); then - AGP_ERROR_CHECKED networkaudiod + AGP_ERROR_HANDLED networkaudiod elif (( $1 == 125 )); then - AGP_ERROR_CHECKED tomcat8 + AGP_ERROR_HANDLED tomcat8 elif (( $1 == 126 )); then - AGP_ERROR_CHECKED openmediavault + AGP_ERROR_HANDLED openmediavault rm /etc/apt/sources.list.d/openmediavault.list elif (( $1 == 129 )); then @@ -13457,7 +13448,7 @@ _EOF_ elif (( $1 == 130 )); then - AGP_ERROR_CHECKED python-pip python3-pip + AGP_ERROR_HANDLED python-pip python3-pip elif (( $1 == 131 )); then @@ -13471,7 +13462,7 @@ _EOF_ rm /usr/local/bin/aria2c rm -R /var/www/aria2 - AGP_ERROR_CHECKED aria2 + AGP_ERROR_HANDLED aria2 elif (( $1 == 133 )); then @@ -13492,13 +13483,13 @@ _EOF_ elif (( $1 == 135 )); then - AGP_ERROR_CHECKED darkice icecast2 + AGP_ERROR_HANDLED darkice icecast2 rm /etc/systemd/system/darkice.service elif (( $1 == 136 )); then - AGP_ERROR_CHECKED motion + AGP_ERROR_HANDLED motion rm -R /etc/motioneye @@ -13508,7 +13499,7 @@ _EOF_ elif (( $1 == 137 )); then - AGP_ERROR_CHECKED cloudprint-service + AGP_ERROR_HANDLED cloudprint-service if (( $G_DISTRO == 3 )); then rm /etc/apt/sources.list.d/cloudprint.list @@ -13530,7 +13521,7 @@ _EOF_ elif (( $1 == 140 )); then - AGP_ERROR_CHECKED libsdl2 libsdl2-image libsdl2-mixer libsdl2-net libsdl2-ttf libsmpeg2 + AGP_ERROR_HANDLED libsdl2 libsdl2-image libsdl2-mixer libsdl2-net libsdl2-ttf libsmpeg2 elif (( $1 == 141 )); then @@ -13556,7 +13547,7 @@ _EOF_ elif (( $1 == 144 )); then - AGP_ERROR_CHECKED nzbdrone + AGP_ERROR_HANDLED nzbdrone rm /etc/systemd/system/sonarr.service rm /etc/apt/sources.list.d/sonarr.list G_AGUP @@ -13579,7 +13570,7 @@ _EOF_ elif (( $1 == 148 )); then - AGP_ERROR_CHECKED mediacenter22 + AGP_ERROR_HANDLED mediacenter22 elif (( $1 == 149 )); then @@ -13593,18 +13584,18 @@ _EOF_ elif (( $1 == 150 )); then - #AGP_ERROR_CHECKED mono-runtime #shared lib + #AGP_ERROR_HANDLED mono-runtime #shared lib rm /etc/apt/sources.list.d/mono-xamarin.list G_AGUP elif (( $1 == 151 )); then - AGP_ERROR_CHECKED nvidia-driver nvidia-xconfig libgl1-nvidia-glx:i386 + AGP_ERROR_HANDLED nvidia-driver nvidia-xconfig libgl1-nvidia-glx:i386 elif (( $1 == 152 )); then - AGP_ERROR_CHECKED avahi-daemon + AGP_ERROR_HANDLED avahi-daemon elif (( $1 == 153 )); then @@ -13620,45 +13611,45 @@ _EOF_ elif (( $1 == 156 )); then - AGP_ERROR_CHECKED steam + AGP_ERROR_HANDLED steam rm -R "$HOME"/.steam rm -R "$G_FP_DIETPI_USERDATA"/steam elif (( $1 == 119 )); then - AGP_ERROR_CHECKED cava + AGP_ERROR_HANDLED cava rm "$HOME/.config/cava/config" rm "$HOME/cava.psf" elif (( $1 == 118 )); then - AGP_ERROR_CHECKED mopidy + AGP_ERROR_HANDLED mopidy rm /etc/apt/sources.list.d/mopidy.list pip uninstall -y Mopidy-MusicBox-Webclient Mopidy-Local-Images elif (( $1 == 31 )); then - AGP_ERROR_CHECKED kodi + AGP_ERROR_HANDLED kodi #+Odroids - AGP_ERROR_CHECKED kodi-odroid + AGP_ERROR_HANDLED kodi-odroid rm /usr/share/applications/kodi.desktop rm ~/Desktop/kodi.desktop elif (( $1 == 39 )); then - AGP_ERROR_CHECKED minidlna + AGP_ERROR_HANDLED minidlna elif (( $1 == 51 )); then - AGP_ERROR_CHECKED ibsdl1.2debian libsdl-net1.2 + AGP_ERROR_HANDLED ibsdl1.2debian libsdl-net1.2 rm -R /usr/local/games/opentyrian rm /usr/share/applications/opentyrian.desktop rm ~/Desktop/opentyrian.desktop elif (( $1 == 59 )); then - AGP_ERROR_CHECKED gpac + AGP_ERROR_HANDLED gpac rm -R /var/www/dietpicam rm /opt/vc/bin/raspimjpeg rm /usr/bin/raspimjpeg @@ -13667,25 +13658,25 @@ _EOF_ elif (( $1 == 45 )); then - AGP_ERROR_CHECKED deluged deluge-web deluge-webui deluge-console + AGP_ERROR_HANDLED deluged deluge-web deluge-webui deluge-console rm /etc/dietpi/dietpi-software/services/deluge.service rm -R ~/.config/deluge elif (( $1 == 94 )); then - AGP_ERROR_CHECKED proftpd-basic + AGP_ERROR_HANDLED proftpd-basic elif (( $1 == 96 )); then - AGP_ERROR_CHECKED samba samba-common-bin + AGP_ERROR_HANDLED samba samba-common-bin elif (( $1 == 95 )); then - AGP_ERROR_CHECKED vsftpd + AGP_ERROR_HANDLED vsftpd elif (( $1 == 109 )); then - AGP_ERROR_CHECKED nfs-kernel-server + AGP_ERROR_HANDLED nfs-kernel-server elif (( $1 == 67 )); then @@ -13703,7 +13694,7 @@ _EOF_ elif (( $1 == 93 )); then - AGP_ERROR_CHECKED dnsmasq + AGP_ERROR_HANDLED dnsmasq pihole uninstall #https://github.com/Fourdee/DietPi/issues/753 @@ -13719,7 +13710,7 @@ _EOF_ elif (( $1 == 33 || $1 == 34 )); then - AGP_ERROR_CHECKED subsonic + AGP_ERROR_HANDLED subsonic rm -R /var/subsonic elif (( $1 == 71 )); then @@ -13738,7 +13729,7 @@ _EOF_ rm "$HOME"/weaved_setup.bin # Remot3.it - AGP_ERROR_CHECKED weavedconnectd + AGP_ERROR_HANDLED weavedconnectd elif (( $1 == 62 )); then @@ -13763,11 +13754,11 @@ _EOF_ rm -r /etc/haproxy #Shared dev libraries. Leave these installed - #AGP_ERROR_CHECKED libpcre3-dev libssl-dev + #AGP_ERROR_HANDLED libpcre3-dev libssl-dev elif (( $1 == 35 )); then - AGP_ERROR_CHECKED logitechmediaserver + AGP_ERROR_HANDLED logitechmediaserver rm /etc/dietpi/dietpi-software/services/squeezeboxserver.service rm -R /var/lib/squeezeboxserver rm -R /usr/share/squeezeboxserver @@ -13778,11 +13769,11 @@ _EOF_ elif (( $1 == 27 || $1 == 28 || $1 == 120 )); then - AGP_ERROR_CHECKED tightvncserver - AGP_ERROR_CHECKED vnc4server - AGP_ERROR_CHECKED x11vnc - AGP_ERROR_CHECKED realvnc-vnc-server - AGP_ERROR_CHECKED tigervnc-* + AGP_ERROR_HANDLED tightvncserver + AGP_ERROR_HANDLED vnc4server + AGP_ERROR_HANDLED x11vnc + AGP_ERROR_HANDLED realvnc-vnc-server + AGP_ERROR_HANDLED tigervnc-* rm /etc/systemd/system/vncserver.service rm /etc/init.d/vncserver @@ -13797,7 +13788,7 @@ _EOF_ elif (( $1 == 73 )); then - AGP_ERROR_CHECKED fail2ban + AGP_ERROR_HANDLED fail2ban elif (( $1 == 64 )); then @@ -13824,14 +13815,14 @@ _EOF_ elif (( $1 == 97 )); then - AGP_ERROR_CHECKED openvpn + AGP_ERROR_HANDLED openvpn rm -R /etc/openvpn &> /dev/null elif (( $1 == 92 )); then if (( $G_DISTRO >= 4 )); then - AGP_ERROR_CHECKED python-certbot-apache python-certbot-nginx certbot + AGP_ERROR_HANDLED python-certbot-apache python-certbot-nginx certbot fi @@ -13840,11 +13831,11 @@ _EOF_ elif (( $1 == 69 )); then - AGP_ERROR_CHECKED python-rpi.gpio python3-rpi.gpio + AGP_ERROR_HANDLED python-rpi.gpio python3-rpi.gpio elif (( $1 == 72 )); then - AGP_ERROR_CHECKED i2c-tools + AGP_ERROR_HANDLED i2c-tools #Disable /DietPi/dietpi/func/dietpi-set_hardware i2c disable @@ -13854,7 +13845,7 @@ _EOF_ elif (( $1 == 60 )); then - AGP_ERROR_CHECKED hostapd isc-dhcp-server + AGP_ERROR_HANDLED hostapd isc-dhcp-server rm /etc/dhcp/dhcpd.conf &> /dev/null rm /etc/hostapd/hostapd.conf &> /dev/null @@ -13892,19 +13883,19 @@ _EOF_ elif (( $1 == 61 )); then - AGP_ERROR_CHECKED tor + AGP_ERROR_HANDLED tor # - uninstall WIFIHOTSPOT ALSO. Due to IPtables needing reset. Uninstall_Software 60 elif (( $1 == 37 )); then - AGP_ERROR_CHECKED shairport-sync* + AGP_ERROR_HANDLED shairport-sync* userdel -f shairport-sync elif (( $1 == 38 )); then - AGP_ERROR_CHECKED brutefir + AGP_ERROR_HANDLED brutefir rm -R /etc/BruteFIR rm /etc/dietpi/dietpi-software/services/brutefir.service @@ -13923,7 +13914,7 @@ _EOF_ elif (( $1 == 36 )); then - AGP_ERROR_CHECKED squeezelite + AGP_ERROR_HANDLED squeezelite rm -R /usr/bin/squeezelite* rm /etc/systemd/system/squeezelite.service @@ -13936,7 +13927,7 @@ _EOF_ elif (( $1 == 66 )); then - AGP_ERROR_CHECKED rpimonitor + AGP_ERROR_HANDLED rpimonitor elif (( $1 == 57 )); then @@ -13955,7 +13946,7 @@ _EOF_ groupdel netdata #1.2.0+ - AGP_ERROR_CHECKED netdata + AGP_ERROR_HANDLED netdata #1.0.0 rm /usr/sbin/netdata @@ -13968,11 +13959,11 @@ _EOF_ elif (( $1 == 43 )); then - AGP_ERROR_CHECKED mumble-server + AGP_ERROR_HANDLED mumble-server elif (( $1 == 41 )); then - AGP_ERROR_CHECKED emby-server + AGP_ERROR_HANDLED emby-server rm /etc/apt/sources.list.d/emby-server.list G_AGUP @@ -13984,7 +13975,7 @@ _EOF_ elif (( $1 == 42 )); then - AGP_ERROR_CHECKED plexmediaserver + AGP_ERROR_HANDLED plexmediaserver* rm -R /var/lib/plexmediaserver @@ -14021,7 +14012,7 @@ _EOF_ elif (( $1 == 46 )); then - AGP_ERROR_CHECKED qbittorrent-nox + AGP_ERROR_HANDLED qbittorrent-nox rm /etc/systemd/system/qbittorrent.service rm -R "$HOME"/.config/qBittorrent @@ -14040,7 +14031,7 @@ _EOF_ elif (( $1 == 107 )); then - AGP_ERROR_CHECKED rtorrent + AGP_ERROR_HANDLED rtorrent rm -R /var/www/rutorrent rm "$HOME"/.rtorrent.rc rm /etc/systemd/system/rtorrent.service @@ -14087,7 +14078,7 @@ _EOF_ rm /etc/chromium.d/custom_flags rm "$HOME"/.chromium-browser.init - AGP_ERROR_CHECKED chromium + AGP_ERROR_HANDLED chromium elif (( $1 == 157)); then @@ -14122,7 +14113,7 @@ _EOF_ elif (( $1 == 167 )); then - AGP_ERROR_CHECKED raspotify + AGP_ERROR_HANDLED raspotify rm /etc/apt/sources.list.d/raspotify.list G_AGUP @@ -14140,7 +14131,7 @@ _EOF_ elif (( $1 == 170 )); then Reset_NTPD - AGP_ERROR_CHECKED ntp + AGP_ERROR_HANDLED ntp elif (( $1 == 158 )); then @@ -14174,10 +14165,10 @@ _EOF_ if (( $G_HW_ARCH == 10 )); then # remove docker and all its unused dependencies - x86_64 package name is different - AGP_ERROR_CHECKED docker-ce + AGP_ERROR_HANDLED docker-ce else # remove docker and all its unused dependencies - ARM package name - AGP_ERROR_CHECKED docker-engine + AGP_ERROR_HANDLED docker-engine fi # delete data files - dietpi @@ -14195,7 +14186,7 @@ _EOF_ elif (( $1 == 163 )); then - AGP_ERROR_CHECKED gmrender + AGP_ERROR_HANDLED gmrender rm /etc/systemd/system/gmrender.service elif (( $1 == 159 || $1 == 160 )); then @@ -14211,57 +14202,57 @@ _EOF_ elif (( $1 == 15 )); then - AGP_ERROR_CHECKED tcpdump + AGP_ERROR_HANDLED tcpdump elif (( $1 == 14 )); then - AGP_ERROR_CHECKED nload + AGP_ERROR_HANDLED nload elif (( $1 == 13 )); then - AGP_ERROR_CHECKED mtr-tiny + AGP_ERROR_HANDLED mtr-tiny elif (( $1 == 11 )); then - AGP_ERROR_CHECKED iptraf + AGP_ERROR_HANDLED iptraf elif (( $1 == 10 )); then - AGP_ERROR_CHECKED iftop + AGP_ERROR_HANDLED iftop elif (( $1 == 19 )); then - AGP_ERROR_CHECKED jed + AGP_ERROR_HANDLED jed elif (( $1 == 3 )); then - AGP_ERROR_CHECKED mc + AGP_ERROR_HANDLED mc elif (( $1 == 18 )); then - AGP_ERROR_CHECKED emacs + AGP_ERROR_HANDLED emacs elif (( $1 == 20 || $i == 21 )); then - AGP_ERROR_CHECKED vim vim-tiny + AGP_ERROR_HANDLED vim vim-tiny elif (( $1 == 127 )); then - AGP_ERROR_CHECKED neovim + AGP_ERROR_HANDLED neovim elif (( $1 == 0 )); then #This also removes OpenSSH server. So lets check OpenSSH server isnt installed before hand. if (( $(dpkg -l | grep -ci -m1 'openssh-server') == 0 )); then - AGP_ERROR_CHECKED openssh-client + AGP_ERROR_HANDLED openssh-client fi elif (( $1 == 1 )); then umount -f /mnt/samba - AGP_ERROR_CHECKED smbclient + AGP_ERROR_HANDLED smbclient #Disable in fstab sed -i '/\/mnt\/samba/c\#\/mnt\/samba . Please use dietpi-config and the Networking Options: NAS menu to setup this mount' /etc/fstab #Add info file for installation method. @@ -14269,7 +14260,7 @@ _EOF_ elif (( $1 == 111 )); then - AGP_ERROR_CHECKED urbackup-server + AGP_ERROR_HANDLED urbackup-server #+sourcebuild rm /etc/systemd/system/urbackupsrv.service @@ -14287,7 +14278,7 @@ _EOF_ #nfs-kernel-server depends on nfs-common if (( ${aSOFTWARE_INSTALL_STATE[109]} == 0 )); then - AGP_ERROR_CHECKED nfs-common + AGP_ERROR_HANDLED nfs-common fi @@ -14299,28 +14290,28 @@ _EOF_ elif (( $1 == 16 )); then - AGP_ERROR_CHECKED build-essential + AGP_ERROR_HANDLED build-essential elif (( $1 == 17 )); then - AGP_ERROR_CHECKED git + AGP_ERROR_HANDLED git elif (( $1 == 5 )); then - AGP_ERROR_CHECKED alsa-utils + AGP_ERROR_HANDLED alsa-utils #DietPi-JustBoom, remove bash alias for config panel: sed -i '/dietpi-justboom/d' /etc/bash.bashrc &> /dev/null elif (( $1 == 6 )); then - AGP_ERROR_CHECKED xcompmgr xinit xauth xserver-xorg xfonts-base x11-xserver-utils x11-common x11-utils + AGP_ERROR_HANDLED xcompmgr xinit xauth xserver-xorg xfonts-base x11-xserver-utils x11-common x11-utils rm /etc/xdg/autostart/xcompmgr.desktop elif (( $1 == 2 )); then umount -f /mnt/ftp_client - AGP_ERROR_CHECKED curlftpfs + AGP_ERROR_HANDLED curlftpfs #Disable in fstab sed -i '/\/mnt\/ftp_client/c\#\/mnt\/ftp_client . Please use dietpi-config and the Networking Options: NAS menu to setup this mount' /etc/fstab @@ -14330,23 +14321,23 @@ _EOF_ elif (( $1 == 7 )); then - AGP_ERROR_CHECKED ffmpeg + AGP_ERROR_HANDLED ffmpeg # + RPi - AGP_ERROR_CHECKED libx264 libmp3lame libfdk-aac + AGP_ERROR_HANDLED libx264 libmp3lame libfdk-aac elif (( $1 == 8 )); then - AGP_ERROR_CHECKED oracle-java8-* + AGP_ERROR_HANDLED oracle-java8-* rm /etc/apt/sources.list.d/webupd8team-java.list G_AGUP elif (( $1 == 104 )); then - AGP_ERROR_CHECKED dropbear* #stretch | dropbear-initramfs dropbear-run + AGP_ERROR_HANDLED dropbear* #stretch | dropbear-initramfs dropbear-run elif (( $1 == 105 )); then - AGP_ERROR_CHECKED openssh-* + AGP_ERROR_HANDLED openssh-* # This also clears Openssh-client aSOFTWARE_INSTALL_STATE[0]=0 @@ -14357,15 +14348,15 @@ _EOF_ elif (( $1 == 101 )); then - AGP_ERROR_CHECKED logrotate + AGP_ERROR_HANDLED logrotate elif (( $1 == 102 )); then - AGP_ERROR_CHECKED rsyslog + AGP_ERROR_HANDLED rsyslog elif (( $1 == 9 )); then - AGP_ERROR_CHECKED nodejs + AGP_ERROR_HANDLED nodejs # - old install via repo if [ -f /etc/apt/sources.list.d/nodesource_nodejs.list ]; then @@ -14379,7 +14370,7 @@ _EOF_ elif (( $1 == 4 )); then - AGP_ERROR_CHECKED vifm + AGP_ERROR_HANDLED vifm else @@ -14473,30 +14464,16 @@ _EOF_ #Simluated apt installation to check for failures related to apt-cache. G_DIETPI-NOTIFY 2 "Running apt simulation to check for errors, please wait..." - local package_to_test='bash-doc' - apt-get install $package_to_test -qq -s -y 2>&1 | tee "$G_FP_LOG_APT" - local result=${PIPESTATUS[0]} - - G_DIETPI-NOTIFY -1 $result "Apt simulation |" - if (( $result != 0 )); then - - Error_AptGet_Failed simulation + local package_to_test='bash-doc' - fi + export G_ERROR_HANDLER_ONERROR_USERMSG="DietPi-Software APT simulation has failed:" + G_AGI $package_to_test -s #Upgrade Apt Banner_Setup Banner_Apt_Update - # - Set noninteractive | Allows automation for some software - local force_options='--force-yes' - - if (( $G_DISTRO >= 4 )); then - - force_options='--allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated' - - fi - DEBIAN_FRONTEND='noninteractive' apt-get upgrade -y $force_options + G_AGUG #Generate dir for dietpi-software installed "non-service" based control scripts mkdir -p /etc/dietpi/dietpi-software/services @@ -14774,7 +14751,7 @@ _EOF_ echo 1 > /DietPi/dietpi/.update_stage #Prompt user for reboot - if (( $USER_INPUTS )); then + if (( $G_USER_INPUTS )); then WHIP_TITLE='DietPi Update Completed' whiptail --title "$WHIP_TITLE" --msgbox "DietPi has been updated to the latest version.\nYour system will now reboot. Once completed, simply login to resume DietPi Setup. \n\nPress Enter to Continue." 13 65 @@ -14798,7 +14775,7 @@ _EOF_ Check_Internet_Connection(){ - #Max loops for USER_INPUTS=0 + #Max loops for G_USER_INPUTS=0 local max_loops=20 local current_loop=0 @@ -14813,7 +14790,7 @@ _EOF_ INTERNET_CONNECTED=1 - elif (( $USER_INPUTS )); then + elif (( $G_USER_INPUTS )); then Menu_No_Internet @@ -14843,9 +14820,6 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// # Globals #///////////////////////////////////////////////////////////////////////////////////// - #Enable all user inputs (eg: prompts) - USER_INPUTS=1 - Input_Modes(){ # - Skip menu @@ -15176,7 +15150,7 @@ _EOF_ #Automation | Save to logfile - if (( $USER_INPUTS )); then + if (( $G_USER_INPUTS )); then whiptail --title "Error" --msgbox "$ERROR_TEXT" 18 70 @@ -15193,39 +15167,8 @@ _EOF_ #Abort install aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]=0 - ERROR_TEXT="Unable to Install ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}\n\n$INSTALL_URL_ADDRESS is offline and/or unreachable." - Error_Display - - } - - Error_AptGet_Failed(){ - - #*=apt installation failed - #simulation=apt simulation failed - - if [ "$1" = "simulation" ]; then - - ERROR_TEXT="Apt-get simulation has failed.\n - Apt log = $(echo -e $G_FP_LOG_APT)\n\nDietPi-Software will now exit." - Error_Display - - else - - ERROR_TEXT="Apt-get has failed:\n - Apt string = $string\n - Error code = $result\n - Software Title = ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}\n - Apt log = $(echo -e $G_FP_LOG_APT)\n\nPlease report this issue to DietPi (INCLUDING THE APT LOG) so it can be investigated.\n\nDietPi-Software will now exit." - Error_Display - - fi - - G_DIETPI-NOTIFY 1 "The apt cache may be corrupt, apt mirror offline, or you have held broken packages. DietPi-Software will now exit.\n" - - G_DIETPI-NOTIFY 2 "Apt Log:\n$(cat $G_FP_LOG_APT)\n" - - G_DIETPI-NOTIFY 2 "Please try:" - G_DIETPI-NOTIFY 2 "- Fixing apt package errors with 'apt-get install -f'" - G_DIETPI-NOTIFY 2 "- Change apt mirror: 'dietpi-config' > 'Networking: NAS/MISC' > 'Apt Mirror'" - G_DIETPI-NOTIFY 2 "- Clear and refresh apt 'G_AGUP'" - G_DIETPI-NOTIFY 2 "- If problems persist, please create a Git ticket so DietPi can investigate the issue:\n - https://github.com/Fourdee/DietPi/issues\n" - - Exit_Destroy + export G_ERROR_HANDLER_ONERROR_USERMSG="Unable to Install ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}\n\n$INSTALL_URL_ADDRESS is offline and/or unreachable." + G_ERROR_HANDLER } @@ -16539,7 +16482,7 @@ _EOF_ if [ -n "$1" ]; then # - Disable user inputs and prompts. - USER_INPUTS=0 + export G_USER_INPUTS=0 # - Run input mode Input_Modes "$@" @@ -16557,14 +16500,14 @@ _EOF_ if (( $AUTOINSTALL_ENABLED >= 1 )); then # - Disable user inputs and prompts. - USER_INPUTS=0 + export G_USER_INPUTS=0 fi fi #GPL compliance prompt - if (( $G_DIETPI_INSTALL_STAGE == 0 && $USER_INPUTS )); then + if (( $G_DIETPI_INSTALL_STAGE == 0 && $G_USER_INPUTS )); then whiptail --title "DietPi - GPLv2 License" --msgbox "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see http://www.gnu.org/licenses/" --backtitle "DietPi - GPLv2 Compliance" 18 70 diff --git a/dietpi/dietpi-survey b/dietpi/dietpi-survey index f1598b9a44..d71062f11b 100644 --- a/dietpi/dietpi-survey +++ b/dietpi/dietpi-survey @@ -25,6 +25,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER + export G_PROGRAM_NAME='DietPi-Survey' #Import DietPi-Globals --------------------------------------------------------------- SURVEY_VERSION=3 diff --git a/dietpi/dietpi-sync b/dietpi/dietpi-sync index 9f2ca0787b..93ea9c60fa 100644 --- a/dietpi/dietpi-sync +++ b/dietpi/dietpi-sync @@ -27,6 +27,7 @@ . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW + export G_PROGRAM_NAME='DietPi-Sync' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -484,16 +485,23 @@ #Error: Folder not found if [ ! -d "$FP_TARGET" ]; then - if (( $INPUT == 0 )); then + + if (( $G_USER_INPUTS )); then + whiptail --title "Sync failed." --msgbox "Unable to create Target directory $FP_TARGET" --backtitle "$WHIP_BACKTITLE" 10 60 + fi #Error: Rsync is already running elif (( $(ps aux | grep -ci -m1 "[r]sync") == 1 )); then + echo -e "Sync failed: $(date +"%d-%m-%Y_%H%M"). Rsync is already running." >> "$FP_TARGET/$SYNC_STATS_FILENAME" + #Menu - if (( $INPUT == 0 )); then + if (( $G_USER_INPUTS )); then + whiptail --title "Sync Error" --msgbox "A sync job could not be started as rsync is already running." --backtitle "$WHIP_BACKTITLE" 13 60 + fi #Start sync @@ -539,28 +547,42 @@ #Success if (( $? == 0 )); then + echo -e "Sync completed: $(date +"%d-%m-%Y_%H%M")" >> "$FP_TARGET/$SYNC_STATS_FILENAME" + #Menu - if (( $INPUT == 0 )); then + if (( $G_USER_INPUTS )); then if (( $SYNC_DRY_RUN == 0 )); then + whiptail --title "Sync completed" --msgbox "$FP_SOURCE\n\nHas been synced to:\n$FP_TARGET\n\nLog file: $LOGFILE" --backtitle "$WHIP_BACKTITLE" 13 60 + else + whiptail --title "Dry Run Sync completed" --msgbox "$FP_SOURCE\n\nHas been synced with a Dry Run (NO modifications) to:\n$FP_TARGET\n\nLog file: $LOGFILE" --backtitle "$WHIP_BACKTITLE" 13 60 + fi + fi #Failed else + echo -e "Sync failed: $(date +"%d-%m-%Y_%H%M")" >> "$FP_TARGET/$SYNC_STATS_FILENAME" + #Menu - if (( $INPUT == 0 )); then + if (( $G_USER_INPUTS )); then if (( $SYNC_DRY_RUN == 0 )); then + whiptail --title "Sync failed" --msgbox "Your sync has failed. Please see the Log file for more information:\n\n$LOGFILE" --backtitle "$WHIP_BACKTITLE" 13 60 + else + whiptail --title "Dry Run Sync failed" --msgbox "Your sync has failed. Please see the Log file for more information:\n\n$LOGFILE" --backtitle "$WHIP_BACKTITLE" 13 60 + fi + fi fi @@ -574,11 +596,6 @@ Check_Install_PreReqs(){ G_AG_CHECK_INSTALL_PREREQ rsync - if (( $? != 0 )); then - - exit 1 - - fi } @@ -652,6 +669,7 @@ #Run Sync if (( $INPUT == 1 )); then + export G_USER_INPUTS=0 Run_Sync #----------------------------------------------------------------------------- diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 8ee1448e0d..30e81965c3 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -30,6 +30,7 @@ . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW + export G_PROGRAM_NAME='DietPi-Update' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/func/change_hostname b/dietpi/func/change_hostname index ad3a48b0d0..93f5fe4326 100644 --- a/dietpi/func/change_hostname +++ b/dietpi/func/change_hostname @@ -21,6 +21,7 @@ . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW + export G_PROGRAM_NAME='DietPi-Change_hostname' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/func/create_mysql_db b/dietpi/func/create_mysql_db index cbc8770ab0..82e39e1962 100644 --- a/dietpi/func/create_mysql_db +++ b/dietpi/func/create_mysql_db @@ -21,6 +21,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER + export G_PROGRAM_NAME='DietPi-Create_mysql_db' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index c40d9b648e..57d057957c 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -27,6 +27,16 @@ #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 cd "$HOME" + #To be exported by the originating script (eg: dietpi-software) + # - Used in: + # G_ERROR_ (info) + G_PROGRAM_NAME='' + + #User input? + # Affects: + # - G_ERROR_HANDLER whiptail display + G_USER_INPUTS=1 + # DietPi-Notify # $1: # -1=autodetect_fail_ok @@ -63,7 +73,7 @@ Print_Failed(){ - echo -ne " $bracket_string_l\e[31mFailed\e[0m$bracket_string_r" + echo -ne " $bracket_string_l\e[31mError\e[0m$bracket_string_r" } @@ -185,6 +195,190 @@ } + + #----------------------------------------------------------------------------------- + # DietPi Error Handler + #----------------------------------------------------------------------------------- + G_ERROR_HANDLER_EXITCODE='' #input value to use with G_ERROR_HANDLER + G_ERROR_HANDLER_COMMAND='' #eg: G_AGI: moooooooo + # For export: On error, following entries will be used + G_ERROR_HANDLER_ONERROR_EXIT=1 #Do we exit the program when the error occurs? 0=no 1=yes + G_ERROR_HANDLER_ONERROR_FPLOGFILE='' #FP to logfile, if available + G_ERROR_HANDLER_ONERROR_USERMSG='' #Additional Message we can show user (eg: apt installation failures, please report to us, fixing tips etc) + + #Runs automatically after G_ERROR_HANDLER to reset vars to default + G_ERROR_HANDLER_RESET(){ + + #unset originating program + unset G_ERROR_HANDLER_EXITCODE + unset G_ERROR_HANDLER_COMMAND + + unset G_ERROR_HANDLER_ONERROR_EXIT + unset G_ERROR_HANDLER_ONERROR_FPLOGFILE + unset G_ERROR_HANDLER_ONERROR_USERMSG + + G_ERROR_HANDLER_EXITCODE='' + G_ERROR_HANDLER_COMMAND='' + + G_ERROR_HANDLER_ONERROR_EXIT=1 + G_ERROR_HANDLER_ONERROR_FPLOGFILE='' + G_ERROR_HANDLER_ONERROR_USERMSG='' + + } + + #Handles exit code errors, as defined by G_ERROR_HANDLER_xxxx settings, and last exit code of previous command + # eg: mkdir /never/gonna/work + # G_ERROR_HANDLER + G_ERROR_HANDLER(){ + + #No exit code, grab current + if [ ! -n $G_ERROR_HANDLER_EXITCODE ]; then + + G_ERROR_HANDLER_EXITCODE=$? + + fi + + #Ok + if (( $G_ERROR_HANDLER_EXITCODE == 0 )); then + + G_DIETPI-NOTIFY 0 "$G_ERROR_HANDLER_COMMAND" + + #Error + else + + echo '' + if [ -n "$G_PROGRAM_NAME" ]; then + + G_DIETPI-NOTIFY 1 "$G_PROGRAM_NAME: $G_ERROR_HANDLER_COMMAND" + + else + + G_DIETPI-NOTIFY 1 "$G_ERROR_HANDLER_COMMAND" + + fi + + G_DIETPI-NOTIFY 2 "exit_code = $G_ERROR_HANDLER_EXITCODE" + G_DIETPI-NOTIFY 2 "HW_MODEL:$G_HW_MODEL | HW_ARCH:$G_HW_ARCH | DISTRO:$G_DISTRO" + + # - On Error: Display logfile FP, if set + if [ -n "$G_ERROR_HANDLER_ONERROR_FPLOGFILE" ]; then + + G_DIETPI-NOTIFY 2 "Logfile contents:\n$(tail -50 $G_ERROR_HANDLER_ONERROR_FPLOGFILE)" + + fi + + # - On Error: Display user message? + if [ -n "$G_ERROR_HANDLER_ONERROR_USERMSG" ]; then + + G_DIETPI-NOTIFY 2 "User message:\n$G_ERROR_HANDLER_ONERROR_USERMSG" + + fi + + # Display "please report to dietpi", if its one of our programs + if [ -n "$G_PROGRAM_NAME" ]; then + + G_DIETPI-NOTIFY 2 'If problems persist, please report this to DietPi for investigation, including a screenshot of this error! (https://github.com/Fourdee/DietPi/issues).' + + fi + + if (( $G_ERROR_HANDLER_ONERROR_EXIT )); then + + G_DIETPI-NOTIFY 2 'Unable to continue, the program will now terminate.' + + fi + + # - On Error: Display whip version? + if (( $G_USER_INPUTS )); then + + local whip_msg=() + if [ -n "$G_PROGRAM_NAME" ]; then + + whip_msg+="$G_PROGRAM_NAME: $G_ERROR_HANDLER_COMMAND" + + else + + whip_msg+="$G_ERROR_HANDLER_COMMAND" + + fi + + whip_msg+='\n' + whip_msg+=" - Exit code = $G_ERROR_HANDLER_EXITCODE" + whip_msg+='\n' + whip_msg+=" - HW_MODEL:$G_HW_MODEL | HW_ARCH:$G_HW_ARCH | DISTRO:$G_DISTRO" + whip_msg+='\n\n' + + # Display optional logfile? + if [ -n "$G_ERROR_HANDLER_ONERROR_FPLOGFILE" ]; then + + whip_msg+="Log file contents:\n$(tail -50 $G_ERROR_HANDLER_ONERROR_FPLOGFILE)" + whip_msg+='\n\n' + + fi + + # Display optional usermessage? + if [ -n "$G_ERROR_HANDLER_ONERROR_USERMSG" ]; then + + whip_msg+="$G_ERROR_HANDLER_ONERROR_USERMSG" + whip_msg+='\n\n' + + fi + + # Display "please report to dietpi", if its one of our programs + if [ -n "$G_PROGRAM_NAME" ]; then + + whip_msg+="If problems persist, please report this to DietPi for investigation, including a screenshot of this error! (https://github.com/Fourdee/DietPi/issues)." + + fi + + if (( $G_ERROR_HANDLER_ONERROR_EXIT )); then + + whip_msg+='\n\n' + whip_msg+='Unable to continue, the program will now terminate.' + + fi + + whiptail --title 'DietPi Error Handler:' --msgbox "$whip_msg" --scrolltext 22 85 + + fi + + # - On Error: Kill current script, excluding the shell. + if (( $G_ERROR_HANDLER_ONERROR_EXIT )); then + + G_DIETPI-NOTIFY 1 'Unable to continue, this program will now terminate.' + + # - Reset for next run + G_ERROR_HANDLER_RESET + + kill -INT $$ + + fi + + fi + + return $G_ERROR_HANDLER_EXITCODE + + # - Reset for next run + G_ERROR_HANDLER_RESET + + } + + #Run a command and send the output through the error handler. This has the same effect as running G_ERROR_HANDLER afterwards, however, allows for command used info, and log output/view when an error occurs + # $@ = input command + # eg: G_RUN_CMD mkdir /never/gonna/work + G_RUN_CMD(){ + + G_ERROR_HANDLER_COMMAND="$@" + + $G_ERROR_HANDLER_COMMAND &> /tmp/G_ERROR_HANDLER_COMMAND + G_ERROR_HANDLER_EXITCODE=$? + G_ERROR_HANDLER_ONERROR_FPLOGFILE='/tmp/G_ERROR_HANDLER_COMMAND' + + G_ERROR_HANDLER + + rm /tmp/G_ERROR_HANDLER_COMMAND &> /dev/null + + } + #----------------------------------------------------------------------------------- # DietPi First-Run Stage #----------------------------------------------------------------------------------- @@ -330,24 +524,29 @@ # URL Connection test #----------------------------------------------------------------------------------- # $1 = URL + # NB: automatically error handled (G_ERROR_HANDLER) G_CHECK_URL(){ - local exit_code=0 + local string="$1" local timeout=10 local retry=2 - G_DIETPI-NOTIFY 2 "Testing connection to $1" + G_ERROR_HANDLER_EXITCODE=0 + G_ERROR_HANDLER_COMMAND="Connection test: $string" + + G_DIETPI-NOTIFY 2 "Testing connection to $string" G_DIETPI-NOTIFY 2 "Max duration of $(($timeout * $retry)) seconds, please wait..." - wget -q --spider --timeout=$timeout --tries=$retry "$1" - exit_code=$? + wget -q --spider --timeout=$timeout --tries=$retry "$string" + G_ERROR_HANDLER_EXITCODE=$? #--no-check-certificate #https://github.com/Fourdee/DietPi/issues/352#issuecomment-221013166 - G_DIETPI-NOTIFY -1 $exit_code "Connection test |" + G_ERROR_HANDLER_ONERROR_USERMSG="Connection failed while trying to access: $string. The URL may be offline, or invalid." + G_ERROR_HANDLER - return $exit_code + return $G_ERROR_HANDLER_EXITCODE } @@ -364,11 +563,12 @@ # fi + #apt-get install + # NB: automatically error handled (G_ERROR_HANDLER) G_AGI(){ local string="$@" local force_options='' - local exit_code=0 if (( $G_DISTRO >= 4 )); then @@ -380,23 +580,28 @@ fi + G_ERROR_HANDLER_EXITCODE=0 + G_ERROR_HANDLER_COMMAND="G_AGI: $string" + G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" + + #-qq can add a slight period of appearing nothing is happening, lets inform user G_DIETPI-NOTIFY 2 "APT installation for: $string" G_DIETPI-NOTIFY 2 "APT is processing, please wait...\n" DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $force_options $string 2>&1 | tee "$G_FP_LOG_APT" - exit_code=${PIPESTATUS[0]} + G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} - G_DIETPI-NOTIFY -1 $exit_code 'G_AGI:' + G_ERROR_HANDLER - return $exit_code + return $G_ERROR_HANDLER_EXITCODE } #apt-get purge + # NB: automatically error handled (G_ERROR_HANDLER) G_AGP(){ - local exit_code=0 local string="$@" local options='' if (( $G_DISTRO >= 4 )); then @@ -405,86 +610,104 @@ fi + G_ERROR_HANDLER_EXITCODE=0 + G_ERROR_HANDLER_COMMAND="G_AGP: $string" + G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" + G_DIETPI-NOTIFY 2 "APT removal for: $string" - DEBIAN_FRONTEND=noninteractive apt-get purge -y $string $options - exit_code=${PIPESTATUS[0]} + DEBIAN_FRONTEND=noninteractive apt-get purge -y $string $options 2>&1 | tee "$G_FP_LOG_APT" + G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} - G_DIETPI-NOTIFY -1 $exit_code 'G_AGP:' + G_ERROR_HANDLER + + return $G_ERROR_HANDLER_EXITCODE - return $exit_code } #apt-get autoremove + # NB: automatically error handled (G_ERROR_HANDLER) G_AGA(){ - local exit_code=0 + G_ERROR_HANDLER_EXITCODE=0 + G_ERROR_HANDLER_COMMAND="G_AGA:" + G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" G_DIETPI-NOTIFY 2 "APT autoremove + purge" - DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y - exit_code=${PIPESTATUS[0]} + DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y 2>&1 | tee "$G_FP_LOG_APT" + G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} - G_DIETPI-NOTIFY -1 $exit_code 'G_AGA:' + G_ERROR_HANDLER - return $exit_code + return $G_ERROR_HANDLER_EXITCODE } #apt-get install -f + # NB: automatically error handled (G_ERROR_HANDLER) G_AGF(){ - local exit_code=0 + G_ERROR_HANDLER_EXITCODE=0 + G_ERROR_HANDLER_COMMAND="G_AGF:" + G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" G_DIETPI-NOTIFY 2 "APT fix" DEBIAN_FRONTEND=noninteractive apt-get install -f -y 2>&1 | tee "$G_FP_LOG_APT" - exit_code=${PIPESTATUS[0]} + G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} - G_DIETPI-NOTIFY -1 $exit_code 'G_AGF:' + G_ERROR_HANDLER - return $exit_code + return $G_ERROR_HANDLER_EXITCODE } #apt-get update + # NB: automatically error handled (G_ERROR_HANDLER) G_AGUP(){ - local exit_code=0 + G_ERROR_HANDLER_EXITCODE=0 + G_ERROR_HANDLER_COMMAND="G_AGUP:" + G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" G_DIETPI-NOTIFY 2 "APT update" DEBIAN_FRONTEND=noninteractive apt-get update 2>&1 | tee "$G_FP_LOG_APT" - exit_code=${PIPESTATUS[0]} + G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} - G_DIETPI-NOTIFY -1 $exit_code 'G_AGUP:' + G_ERROR_HANDLER - return $exit_code + return $G_ERROR_HANDLER_EXITCODE } #apt-get upgrade + # NB: automatically error handled (G_ERROR_HANDLER) G_AGUG(){ - local exit_code=0 + G_ERROR_HANDLER_EXITCODE=0 + G_ERROR_HANDLER_COMMAND="G_AGUG:" + G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" G_DIETPI-NOTIFY 2 "APT upgrade" DEBIAN_FRONTEND=noninteractive apt-get upgrade -y 2>&1 | tee "$G_FP_LOG_APT" - exit_code=${PIPESTATUS[0]} + G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} - G_DIETPI-NOTIFY -1 $exit_code 'G_AGUG:' + G_ERROR_HANDLER - return $exit_code + return $G_ERROR_HANDLER_EXITCODE } #apt-get dist-upgrade + # NB: automatically error handled (G_ERROR_HANDLER) G_AGDUG(){ - local exit_code=0 - local string="$@" - local force_options='' + G_ERROR_HANDLER_EXITCODE=0 + G_ERROR_HANDLER_COMMAND="G_AGDUG:" + G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" if (( $G_DISTRO >= 4 )); then @@ -499,16 +722,17 @@ G_DIETPI-NOTIFY 2 "APT dist-upgrade" DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y 2>&1 | tee "$G_FP_LOG_APT" - exit_code=${PIPESTATUS[0]} + G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} - G_DIETPI-NOTIFY -1 $exit_code 'G_AGDUG:' + G_ERROR_HANDLER - return $exit_code + return $G_ERROR_HANDLER_EXITCODE } #Checks for required APT packages, installs if needed. # $@ = list of required packages + # NB: automatically error handled (G_ERROR_HANDLER) G_AG_CHECK_INSTALL_PREREQ(){ local fp_temp='/tmp/.G_AG_CHECK_INSTALL_PREREQ' @@ -547,7 +771,7 @@ fi - G_DIETPI-NOTIFY -1 $exit_code 'G_AG_CHECK_INSTALL_PREREQ:' + #G_AGI now handles the error rm "$fp_temp" diff --git a/dietpi/func/dietpi-led_control b/dietpi/func/dietpi-led_control index 1d500eeb2f..66ac4e9dde 100644 --- a/dietpi/func/dietpi-led_control +++ b/dietpi/func/dietpi-led_control @@ -27,6 +27,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER + export G_PROGRAM_NAME='DietPi-LED_control' #Import DietPi-Globals --------------------------------------------------------------- FP_SETTINGS='/DietPi/dietpi/.dietpi-led_control' diff --git a/dietpi/func/dietpi-optimal_mtu b/dietpi/func/dietpi-optimal_mtu index 3e744aca1e..94ef856155 100644 --- a/dietpi/func/dietpi-optimal_mtu +++ b/dietpi/func/dietpi-optimal_mtu @@ -23,6 +23,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals + export G_PROGRAM_NAME='DietPi-Optimal_mtu' #Import DietPi-Globals --------------------------------------------------------------- MTU_SIZE=1500 diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index 9ce69dbc01..1f38e53cee 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -30,6 +30,7 @@ #Import DietPi-Globals ------------------------------------------------------------- . $FP_SCRIPTS/dietpi/func/dietpi-globals # NB: HW_* info are init only, not detected. G_CHECK_ROOT_USER + export G_PROGRAM_NAME='DietPi-Set_core_environment' #Import DietPi-Globals ------------------------------------------------------------- diff --git a/dietpi/func/dietpi-set_curlftpfs b/dietpi/func/dietpi-set_curlftpfs index 4af53140aa..ce5a8a60a2 100644 --- a/dietpi/func/dietpi-set_curlftpfs +++ b/dietpi/func/dietpi-set_curlftpfs @@ -27,6 +27,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals + export G_PROGRAM_NAME='DietPi-Set_curlftpfs' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/func/dietpi-set_dphys-swapfile b/dietpi/func/dietpi-set_dphys-swapfile index fc564e5874..c1659de7c6 100644 --- a/dietpi/func/dietpi-set_dphys-swapfile +++ b/dietpi/func/dietpi-set_dphys-swapfile @@ -24,6 +24,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER + export G_PROGRAM_NAME='DietPi-dphys-swapfile' #Import DietPi-Globals --------------------------------------------------------------- SWAP_SIZE_CURRENT=$(cat /etc/dphys-swapfile | grep -m1 '^CONF_SWAPSIZE=' | sed 's/.*=//') diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 539f78e5bb..5dd21cd7ef 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -50,6 +50,7 @@ $FP_SCRIPT lcdpanel target_panel (none to remove all) . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW + export G_PROGRAM_NAME='DietPi-Set_Hardware' #Import DietPi-Globals --------------------------------------------------------------- #Semi support non-dietpi Raspbian diff --git a/dietpi/func/dietpi-set_nfsclient b/dietpi/func/dietpi-set_nfsclient index 2658b480f9..1901d13d62 100644 --- a/dietpi/func/dietpi-set_nfsclient +++ b/dietpi/func/dietpi-set_nfsclient @@ -27,6 +27,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER + export G_PROGRAM_NAME='DietPi-Set_nfsclient' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/func/dietpi-set_smbclient b/dietpi/func/dietpi-set_smbclient index 1f1473a7a2..a9a4be7b47 100644 --- a/dietpi/func/dietpi-set_smbclient +++ b/dietpi/func/dietpi-set_smbclient @@ -28,6 +28,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER + export G_PROGRAM_NAME='DietPi-Set_smbclient' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index e0c7512904..e0d8619987 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -37,6 +37,7 @@ $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entrie . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW + export G_PROGRAM_NAME='DietPi-Set_software' #Import DietPi-Globals --------------------------------------------------------------- EXIT_CODE=0 diff --git a/dietpi/func/dietpi-set_userdata b/dietpi/func/dietpi-set_userdata index 5ea26c3918..dc7df06345 100644 --- a/dietpi/func/dietpi-set_userdata +++ b/dietpi/func/dietpi-set_userdata @@ -20,6 +20,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER + export G_PROGRAM_NAME='DietPi-Set_userdata' #Import DietPi-Globals --------------------------------------------------------------- EXIT_CODE=0 diff --git a/dietpi/func/obtain_network_details b/dietpi/func/obtain_network_details index bf2584025d..64fe56b378 100644 --- a/dietpi/func/obtain_network_details +++ b/dietpi/func/obtain_network_details @@ -26,6 +26,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals + export G_PROGRAM_NAME='DietPi-Obtain_network_details' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/func/run_ntpd b/dietpi/func/run_ntpd index 26bf68529f..43a64f4977 100644 --- a/dietpi/func/run_ntpd +++ b/dietpi/func/run_ntpd @@ -21,6 +21,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER + export G_PROGRAM_NAME='DietPi-Run_ntpd' #Import DietPi-Globals --------------------------------------------------------------- INPUT_MODE=$1 diff --git a/dietpi/login b/dietpi/login index b0a5640952..8611f9bc83 100644 --- a/dietpi/login +++ b/dietpi/login @@ -26,6 +26,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER + export G_PROGRAM_NAME='DietPi-Login' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/misc/dietpi-justboom b/dietpi/misc/dietpi-justboom index 5e7f74ce11..e678359ba0 100644 --- a/dietpi/misc/dietpi-justboom +++ b/dietpi/misc/dietpi-justboom @@ -18,6 +18,7 @@ . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW + export G_PROGRAM_NAME='DietPi-Justboom' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/misc/start_kodi b/dietpi/misc/start_kodi index a2110cbc38..6cd98bc88f 100644 --- a/dietpi/misc/start_kodi +++ b/dietpi/misc/start_kodi @@ -20,6 +20,7 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals + export G_PROGRAM_NAME='DietPi-Start_kodi' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/patch_file b/dietpi/patch_file index 9f9f097b09..ce99c41125 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -23,6 +23,7 @@ #Import DietPi-Globals --------------------------------------------------------------- /DietPi/dietpi/dietpi-obtain_hw_model # Always update . /DietPi/dietpi/func/dietpi-globals + export G_PROGRAM_NAME='DietPi-Patchfile' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// @@ -36,10 +37,9 @@ 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 - USER_INPUTS=0 + export G_USER_INPUTS=0 fi @@ -2475,7 +2475,7 @@ _EOF_ cp /boot/exynos5422-odroidxu3.dtb /boot/exynos5422-odroidxu4.dtb # Assume XU4 - if (( ! $USER_INPUTS )); then + if (( ! $G_USER_INPUTS )); then sed -i "s#exynos5422-odroidxu3.dtb#exynos5422-odroidxu4.dtb#g" /DietPi/boot.ini From 3514ccde7bad110bef45451b8e0c7bcb613d3137 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 26 Dec 2017 11:14:34 +0000 Subject: [PATCH 135/390] v160 + Tweaks: https://github.com/Fourdee/DietPi/issues/1311 --- PREP_SYSTEM_FOR_DIETPI.sh | 41 +++++++++++++++++++++----------------- dietpi/dietpi-software | 13 +++--------- dietpi/func/dietpi-globals | 27 +++++++++++++++---------- 3 files changed, 42 insertions(+), 39 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 3de34d97bc..9863b2639a 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -429,22 +429,26 @@ _EOF_ # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files G_DIETPI-NOTIFY 2 "Temporary disable automatic recommends/suggests installation and allow them to be autoremoved:" - cat << _EOF_ > /etc/apt/apt.conf.d/99dietpi_norecommends + export G_ERROR_HANDLER_COMMAND='/etc/apt/apt.conf.d/99dietpi_norecommends' + cat << _EOF_ > $G_ERROR_HANDLER_COMMAND APT::Install-Recommends "false"; APT::Install-Suggests "false"; APT::AutoRemove::RecommendsImportant "false"; APT::AutoRemove::SuggestsImportant "false"; _EOF_ + export G_ERROR_HANDLER_EXITCODE=$? G_ERROR_HANDLER G_DIETPI-NOTIFY 2 "Forcing use of existing apt configs if available" - cat << _EOF_ > /etc/apt/apt.conf.d/99dietpi_forceconf + export G_ERROR_HANDLER_COMMAND='/etc/apt/apt.conf.d/99dietpi_forceconf' + cat << _EOF_ > $G_ERROR_HANDLER_COMMAND Dpkg::options { "--force-confdef"; "--force-confold"; } _EOF_ + export G_ERROR_HANDLER_EXITCODE=$? G_ERROR_HANDLER @@ -890,18 +894,22 @@ _EOF_ G_DIETPI-NOTIFY 2 "Configuring Hosts:" - cat << _EOF_ > /etc/hosts + export G_ERROR_HANDLER_COMMAND='/etc/hosts' + cat << _EOF_ > $G_ERROR_HANDLER_COMMAND 127.0.0.1 localhost 127.0.1.1 DietPi ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters _EOF_ + export G_ERROR_HANDLER_EXITCODE=$? G_ERROR_HANDLER - cat << _EOF_ > /etc/hostname + export G_ERROR_HANDLER_COMMAND='/etc/hostname' + cat << _EOF_ > $G_ERROR_HANDLER_COMMAND DietPi _EOF_ + export G_ERROR_HANDLER_EXITCODE=$? G_ERROR_HANDLER G_DIETPI-NOTIFY 2 "Configuring htop:" @@ -911,7 +919,8 @@ _EOF_ G_DIETPI-NOTIFY 2 "Configuring hdparm:" - cat << _EOF_ >> /etc/hdparm.conf + export G_ERROR_HANDLER_COMMAND='/etc/hdparm.conf' + cat << _EOF_ >> $G_ERROR_HANDLER_COMMAND #DietPi external USB drive. Power management settings. /dev/sda { @@ -922,6 +931,7 @@ _EOF_ apm = 254 } _EOF_ + export G_ERROR_HANDLER_EXITCODE=$? G_ERROR_HANDLER G_DIETPI-NOTIFY 2 "Configuring fakehwclock:" @@ -942,8 +952,7 @@ _EOF_ G_DIETPI-NOTIFY 2 "Configuring regional settings (TZdata):" echo "Europe/London" > /etc/timezone - dpkg-reconfigure -f noninteractive tzdata #Europe > London - G_ERROR_HANDLER + G_RUN_CMD dpkg-reconfigure -f noninteractive tzdata #Europe > London G_DIETPI-NOTIFY 2 "Configuring regional settings (Keyboard):" @@ -955,14 +964,15 @@ _EOF_ sed -i '/en_GB.UTF-8 UTF-8/c\en_GB.UTF-8 UTF-8' /etc/locale.gen #locale-gen update-locale - dpkg-reconfigure -f noninteractive locales # en_GB.UTF8 as only installed locale - G_ERROR_HANDLER + G_RUN_CMD dpkg-reconfigure -f noninteractive locales # en_GB.UTF8 as only installed locale # - Pump default locale into sys env: https://github.com/Fourdee/DietPi/issues/825 - cat << _EOF_ > /etc/environment + export G_ERROR_HANDLER_COMMAND='/etc/environment' + cat << _EOF_ > $G_ERROR_HANDLER_COMMAND LC_ALL=en_GB.UTF-8 LANG=en_GB.UTF-8 _EOF_ + export G_ERROR_HANDLER_EXITCODE=$? G_ERROR_HANDLER #G_HW_ARCH specific @@ -1217,8 +1227,7 @@ StandardOutput=tty WantedBy=local-fs.target _EOF_ systemctl daemon-reload - systemctl enable dietpi-fs_partition_resize.service - G_ERROR_HANDLER + G_RUN_CMD systemctl enable dietpi-fs_partition_resize.service cat << _EOF_ > /etc/dietpi/fs_partition_resize.sh #!/bin/bash @@ -1260,9 +1269,7 @@ _EOF_1 reboot _EOF_ - G_ERROR_HANDLER - chmod +x /etc/dietpi/fs_partition_resize.sh - G_ERROR_HANDLER + G_RUN_CMD chmod +x /etc/dietpi/fs_partition_resize.sh G_DIETPI-NOTIFY 2 'Generating dietpi-fs_partition_expand for subsequent boot' @@ -1281,15 +1288,13 @@ StandardOutput=tty WantedBy=local-fs.target _EOF_ systemctl daemon-reload - systemctl enable dietpi-fs_expand.service - G_ERROR_HANDLER + G_RUN_CMD systemctl enable dietpi-fs_expand.service # #debug # systemctl start dietpi-fs_partition_resize.service # systemctl status dietpi-fs_partition_resize.service -l # cat /var/tmp/dietpi/logs/fs_partition_resize.log - G_DIETPI-NOTIFY 2 'Sync changes to disk and TRIM rootFS. Please wait, this may take some time...' G_RUN_CMD systemctl stop dietpi-ramlog diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index e1bef28060..cba5504615 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3370,13 +3370,6 @@ _EOF_ } - #apt-get install -f - AGF_ERROR_HANDLED(){ - - G_AGF - - } - #Return optimization values for BitTorrent servers based on device and hardware capabilities. Optimize_BitTorrent(){ @@ -4744,7 +4737,7 @@ _EOF_ wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb - AGF_ERROR_HANDLED + G_AGF rm package.deb @@ -5437,7 +5430,7 @@ _EOF_ rm package.deb #https://github.com/Fourdee/DietPi/issues/736 - AGF_ERROR_HANDLED + G_AGF #Stop service service logitechmediaserver stop @@ -6871,7 +6864,7 @@ _EOF_ else - AGF_ERROR_HANDLED + G_AGF fi diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 57d057957c..5aedada190 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -198,6 +198,7 @@ #----------------------------------------------------------------------------------- # DietPi Error Handler + # https://github.com/Fourdee/DietPi/issues/1311#issuecomment-353716344 #----------------------------------------------------------------------------------- G_ERROR_HANDLER_EXITCODE='' #input value to use with G_ERROR_HANDLER G_ERROR_HANDLER_COMMAND='' #eg: G_AGI: moooooooo @@ -226,18 +227,17 @@ } - #Handles exit code errors, as defined by G_ERROR_HANDLER_xxxx settings, and last exit code of previous command - # eg: mkdir /never/gonna/work - # G_ERROR_HANDLER + #Handles exit code errors, as defined by G_ERROR_HANDLER_xxxx settings + # Usage: + # export G_ERROR_HANDLER_COMMAND='Doing something usefull with Owncloud' + # export G_ERROR_HANDLER_ONERROR_EXIT=0 # Don't exit program on error, continue + # export G_ERROR_HANDLER_ONERROR_FPLOGFILE=/var/log/mylogfile # to print if error occurs + # export G_ERROR_HANDLER_ONERROR_USERMSG='Owncloud failed to pass a test, here is some info....' #optional user message if error occurs. + # occ --doing-something-useful + # export G_ERROR_HANDLER_EXITCODE=$? + # G_ERROR_HANDLER G_ERROR_HANDLER(){ - #No exit code, grab current - if [ ! -n $G_ERROR_HANDLER_EXITCODE ]; then - - G_ERROR_HANDLER_EXITCODE=$? - - fi - #Ok if (( $G_ERROR_HANDLER_EXITCODE == 0 )); then @@ -364,11 +364,16 @@ #Run a command and send the output through the error handler. This has the same effect as running G_ERROR_HANDLER afterwards, however, allows for command used info, and log output/view when an error occurs # $@ = input command - # eg: G_RUN_CMD mkdir /never/gonna/work + # eg: + # G_ERROR_HANDLER_ONERROR_USERMSG='We couldn't make a critical directory, holy cow!' #Optional user message if error occurs + # G_RUN_CMD mkdir /never/gonna/work G_RUN_CMD(){ G_ERROR_HANDLER_COMMAND="$@" + G_DIETPI-NOTIFY 2 "Running command: $G_ERROR_HANDLER_COMMAND" + G_DIETPI-NOTIFY 2 'Please wait...' + $G_ERROR_HANDLER_COMMAND &> /tmp/G_ERROR_HANDLER_COMMAND G_ERROR_HANDLER_EXITCODE=$? G_ERROR_HANDLER_ONERROR_FPLOGFILE='/tmp/G_ERROR_HANDLER_COMMAND' From a7c87d10cae0d50fd7089d69cddba74f6672e49c Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 26 Dec 2017 13:42:39 +0000 Subject: [PATCH 136/390] v160 + DietPi-Software | UrBackup: Installation updated to latest version 2.1.20. For new installations only: https://github.com/Fourdee/DietPi/issues/1335 --- CHANGELOG.txt | 1 + PREP_SYSTEM_FOR_DIETPI.sh | 2 +- dietpi/dietpi-software | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 28f6ce9906..862fb64155 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,7 @@ DietPi-Set_Hardware | Sparky SBC: enable aotg.aotg1_speed compatibility setting DietPi-Software | NAA Daemon: Updated to latest (3.5.2-36). Existing installs will be patched automatically: https://github.com/Fourdee/DietPi/issues/1305 DietPi-Software | PHP-FPM: Increased from "$CPU_CORES_TOTAL" to "pm.max_children = $(( $CPU_CORES_TOTAL * 3 ))". This should avoid failed forking of PHP-FPM processes/requests : https://github.com/Fourdee/DietPi/issues/1298 DietPi-Software | ownCloud/Nextcloud: Added option to choose data directory via dietpi.txt pre installation: https://github.com/Fourdee/DietPi/issues/1314#issuecomment-352782055 +DietPi-Software | UrBackup: Installation updated to latest version 2.1.20. For new installations only: https://github.com/Fourdee/DietPi/issues/1335 Bug Fixes: DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi drop during software installs/updates etc: https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 9863b2639a..bc10e418aa 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1196,7 +1196,7 @@ _EOF_ G_DIETPI-NOTIFY 2 'Clearing APT cache' - apt-get clean + G_RUN_CMD apt-get clean rm -R /var/lib/apt/lists/* -vf #lists cache: remove partial folder also, automatically gets regenerated on G_AGUP #rm /var/lib/dpkg/info/* #issue... #dpkg: warning: files list file for package 'libdbus-1-3:armhf' missing; assuming package has no files currently installed diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index cba5504615..fdbf84b9fc 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4509,16 +4509,16 @@ _EOF_ if (( $G_HW_ARCH == 10 )); then - INSTALL_URL_ADDRESS='http://hndl.urbackup.org/Server/2.1.19/urbackup-server_2.1.19_amd64.deb' + INSTALL_URL_ADDRESS='http://hndl.urbackup.org/Server/2.1.20/urbackup-server_2.1.20_amd64.deb' elif (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then - INSTALL_URL_ADDRESS='http://hndl.urbackup.org/Server/2.1.19/urbackup-server_2.1.19_armhf.deb' + INSTALL_URL_ADDRESS='http://hndl.urbackup.org/Server/2.1.20/urbackup-server_2.1.20_armhf.deb' #ARMv8 sourcebuild elif (( $G_HW_ARCH == 3 )); then - INSTALL_URL_ADDRESS='http://hndl.urbackup.org/Server/2.1.19/urbackup-server-2.1.19.tar.gz' + INSTALL_URL_ADDRESS='http://hndl.urbackup.org/Server/2.1.20/urbackup-server-2.1.20.tar.gz' fi From c548ec8022aee1850a0fc9c06624ebe0bb03c6bd Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 27 Dec 2017 10:05:00 +0000 Subject: [PATCH 137/390] v160 + General | FHS compliance completed. /etc/dietpi has moved to /var/lib/dietpi. RAMlog store has moved to /var/tmp/dietpi: https://github.com/Fourdee/DietPi/issues/1297#issuecomment-352241193 --- CHANGELOG.txt | 5 +- PREP_SYSTEM_FOR_DIETPI.sh | 24 ++++---- dietpi/conf/brutefir.service | 2 +- dietpi/conf/raspimjpeg.service | 2 +- dietpi/dietpi-banner | 16 ----- dietpi/dietpi-config | 10 ++-- dietpi/dietpi-ramlog | 2 +- dietpi/dietpi-services | 12 ++-- dietpi/dietpi-software | 49 ++++++++-------- dietpi/func/dietpi-set_core_environment | 11 ++-- dietpi/func/dietpi-set_hardware | 3 - dietpi/func/run_ntpd | 2 +- dietpi/patch_file | 78 +++++++++++++++---------- 13 files changed, 110 insertions(+), 106 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 862fb64155..58b678df27 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,12 +1,15 @@ v160 (xx/01/18) +Minor notes: +The XMAS tree has now been taken down, stored away on github for next year. Hope you all had a good one :D + Image Modifications: Changes / Improvements / Optimizations: General | We have completed much needed backbone work for DietPi, which will allow for improved expansion in source code. This includes the use of dietpi-globals. DietPi-Globals | New script which optimizes most used DietPi commands and vars, throughout our scripts. Also exported to bash session, please type 'G_' then press 'TAB' to see a full list of options. -General | Start of FHS compliance: https://github.com/Fourdee/DietPi/issues/1297#issuecomment-352241193 +General | FHS compliance completed. /etc/dietpi has moved to /var/lib/dietpi. RAMlog store has moved to /var/tmp/dietpi: https://github.com/Fourdee/DietPi/issues/1297#issuecomment-352241193 General | wget: Now set to prefer IPv4 by default (generally faster): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 General | APT: Now set to force IPv4 by default (generally faster): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 General | SparkySBC: CPU gov default changed to Performance, reports of increased stability. diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index bc10e418aa..ba16999911 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -206,7 +206,7 @@ rm -R /mnt/dietpi-sync &> /dev/null rm -R /mnt/dietpi_userdata &> /dev/null - rm -R /etc/dietpi &> /dev/null + rm -R /etc/dietpi &> /dev/null # Pre v160 rm -R /var/lib/dietpi &> /dev/null rm -R /var/tmp/dietpi &> /dev/null @@ -219,10 +219,6 @@ fi - #Recreate dietpi logs dir, used by G_AGx - G_RUN_CMD mkdir -p /var/tmp/dietpi/logs - - #------------------------------------------------------------------------------------------------ echo -e '' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' @@ -231,6 +227,9 @@ #------------------------------------------------------------------------------------------------ G_DIETPI-NOTIFY 2 'Updating APT:' + #Recreate dietpi logs dir, used by G_AGx + G_RUN_CMD mkdir -p /var/tmp/dietpi/logs + G_RUN_CMD apt-get clean G_AGUP @@ -1135,9 +1134,6 @@ _EOF_ G_DIETPI-NOTIFY 2 'Configuring kernel' - # - Disable installed flags - rm /etc/dietpi/.* - # - RPi install DietPi kernel by default if (( $G_HW_MODEL < 10 )); then @@ -1163,7 +1159,7 @@ _EOF_ G_DIETPI-NOTIFY 2 'Deleting DietPi-RAMlog storage' - rm -R /etc/dietpi/dietpi-ramlog/storage &> /dev/null + rm -R /var/lib/dietpi/dietpi-ramlog/storage/* &> /dev/null G_DIETPI-NOTIFY 2 'Deleting NTP drift file' @@ -1220,7 +1216,7 @@ Before=dietpi-ramdisk.service [Service] Type=oneshot RemainAfterExit=no -ExecStart=/bin/bash -c '/etc/dietpi/fs_partition_resize.sh | tee /var/tmp/dietpi/logs/fs_partition_resize.log' +ExecStart=/bin/bash -c '/var/lib/dietpi/fs_partition_resize.sh | tee /var/tmp/dietpi/logs/fs_partition_resize.log' StandardOutput=tty [Install] @@ -1229,7 +1225,7 @@ _EOF_ systemctl daemon-reload G_RUN_CMD systemctl enable dietpi-fs_partition_resize.service - cat << _EOF_ > /etc/dietpi/fs_partition_resize.sh + cat << _EOF_ > /var/lib/dietpi/fs_partition_resize.sh #!/bin/bash systemctl disable dietpi-fs_partition_resize.service @@ -1269,7 +1265,7 @@ _EOF_1 reboot _EOF_ - G_RUN_CMD chmod +x /etc/dietpi/fs_partition_resize.sh + G_RUN_CMD chmod +x /var/lib/dietpi/fs_partition_resize.sh G_DIETPI-NOTIFY 2 'Generating dietpi-fs_partition_expand for subsequent boot' @@ -1310,6 +1306,10 @@ _EOF_ G_DIETPI-NOTIFY 0 "Completed, disk can now be saved to .img for later use, or, reboot system to start first run of DietPi:" + #Cleanup + rm dietpi-globals + rm PREP_SYSTEM_FOR_DIETPI.sh + #Power off system #Read image diff --git a/dietpi/conf/brutefir.service b/dietpi/conf/brutefir.service index 8412ba07d9..5470aeefed 100644 --- a/dietpi/conf/brutefir.service +++ b/dietpi/conf/brutefir.service @@ -7,7 +7,7 @@ # Created by Daniel Knight / daniel.knight@dietpi.com / dietpi.com # # Info: - # - Location /etc/dietpi/dietpi-software/services/brutefir + # - Location /var/lib/dietpi/dietpi-software/services/brutefir # - Called from /DietPi/dietpi/dietpi-services # #//////////////////////////////////// diff --git a/dietpi/conf/raspimjpeg.service b/dietpi/conf/raspimjpeg.service index f55bab0f0c..2dfcdc0aa6 100644 --- a/dietpi/conf/raspimjpeg.service +++ b/dietpi/conf/raspimjpeg.service @@ -7,7 +7,7 @@ # Created by Daniel Knight / daniel.knight@dietpi.com / dietpi.com # # Info: - # - Location /etc/dietpi/dietpi-software/services/raspimjpeg.service + # - Location /var/lib/dietpi/dietpi-software/services/raspimjpeg.service # - Allows service control for Raspimjpeg and PHP schedule, used by RPI Camera Web # - Called from /DietPi/dietpi/dietpi-services # diff --git a/dietpi/dietpi-banner b/dietpi/dietpi-banner index 2b1ef87374..df489eb89e 100644 --- a/dietpi/dietpi-banner +++ b/dietpi/dietpi-banner @@ -62,21 +62,6 @@ } - Xmas_Print(){ - - echo -e " \e[31m^\e[0m - \e[31m*\e[0m\e[38;5;154m#\e[31m*\e[0m - \e[31m*\e[0m\e[38;5;154m###\e[31m*\e[0m \e[90m Lightweight Xmas Justice Tips:\e[0m - \e[31m*\e[0m\e[38;5;154m#####\e[31m*\e[0m \e[90m - Be good, Amazon do sell coal.\e[0m - \e[31m*\e[0m\e[38;5;154m#######\e[31m*\e[0m \e[90m - Cherish every moment, even the awkward family gatherings ;)\e[0m - \e[31m*\e[0m\e[38;5;154m#########\e[31m*\e[0m \e[90m - 'Ho Ho Ho, Green Giant' swaps his job! \e[0m - \e[31m*\e[0m\e[38;5;154mMerry Xmas\e[31m*\e[0m - \e[31m*\e[0m\e[38;5;154m#############\e[31m*\e[0m \e[90m All the best from everyone at DietPi =)) \e[0m - \e[100m \e[0m -" - - } - #///////////////////////////////////////////////////////////////////////////////////// #Top section additional Text. Update available / MOTD etc #///////////////////////////////////////////////////////////////////////////////////// @@ -162,7 +147,6 @@ Banner_TopText_Extras Banner_Dietpi Credits_Print - Xmas_Print fi #----------------------------------------------------------------------------------- diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index f8992c9691..1c9eb744e6 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -3392,7 +3392,7 @@ _EOF_ systemctl stop dietpi-wifi-monitor.service rm /etc/systemd/system/dietpi-wifi-monitor.service - rm /etc/dietpi/dietpi-wifi-monitor.sh + rm /var/lib/dietpi/dietpi-wifi-monitor.sh systemctl daemon-reload fi @@ -3401,7 +3401,7 @@ _EOF_ WiFi_Monitor_Enable(){ - cat << _EOF_ > /etc/dietpi/dietpi-wifi-monitor.sh + cat << _EOF_ > /var/lib/dietpi/dietpi-wifi-monitor.sh #!/bin/bash { URL_PING="$WIFI_GATEWAY" @@ -3433,7 +3433,7 @@ exit 0 } _EOF_ - chmod +x /etc/dietpi/dietpi-wifi-monitor.sh + chmod +x /var/lib/dietpi/dietpi-wifi-monitor.sh cat << _EOF_ > /etc/systemd/system/dietpi-wifi-monitor.service [Unit] @@ -3441,7 +3441,7 @@ Description=Monitors loss of WiFi connection and automatically reconnects After=network.target network-online.target [Service] Type=simple -ExecStart=/bin/bash -c /etc/dietpi/dietpi-wifi-monitor.sh +ExecStart=/bin/bash -c /var/lib/dietpi/dietpi-wifi-monitor.sh [Install] WantedBy=multi-user.target _EOF_ @@ -5067,7 +5067,7 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ # Kill all existing, refresh now killall -w /DietPi/dietpi/func/run_ntpd &> /dev/null killall -w ntpd &> /dev/null - rm /etc/dietpi/.ntpd_exit_status &> /dev/null + rm /var/lib/dietpi/.ntpd_exit_status &> /dev/null /DietPi/dietpi/func/run_ntpd status #Return to this Menu diff --git a/dietpi/dietpi-ramlog b/dietpi/dietpi-ramlog index 5707a18695..36daf6465d 100644 --- a/dietpi/dietpi-ramlog +++ b/dietpi/dietpi-ramlog @@ -35,7 +35,7 @@ #. /DietPi/dietpi/func/dietpi-globals # Not compatible until dietpi-boot.service #Import DietPi-Globals --------------------------------------------------------------- - FILEPATH_DIETPI_RAMLOG_SAVE='/var/lib/dietpi/dietpi-ramlog_store' + FILEPATH_DIETPI_RAMLOG_SAVE='/var/lib/dietpi/dietpi-ramlog/storage' #///////////////////////////////////////////////////////////////////////////////////// #Funcs diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index 8c17358221..c4b98ec148 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -211,9 +211,9 @@ index=0 aDIETPISERVICE_FP=() aDIETPISERVICE_NAME=() - aDIETPISERVICE_NAME[$index]='BruteFIR';aDIETPISERVICE_FP[$index]='/etc/dietpi/dietpi-software/services/brutefir.service';((index++)); - aDIETPISERVICE_NAME[$index]='JackD';aDIETPISERVICE_FP[$index]='/etc/dietpi/dietpi-software/services/jackd.service';((index++)); - aDIETPISERVICE_NAME[$index]='Jconvolver';aDIETPISERVICE_FP[$index]='/etc/dietpi/dietpi-software/services/jconvolver.service';((index++)); + aDIETPISERVICE_NAME[$index]='BruteFIR';aDIETPISERVICE_FP[$index]='/var/lib/dietpi/dietpi-software/services/brutefir.service';((index++)); + aDIETPISERVICE_NAME[$index]='JackD';aDIETPISERVICE_FP[$index]='/var/lib/dietpi/dietpi-software/services/jackd.service';((index++)); + aDIETPISERVICE_NAME[$index]='Jconvolver';aDIETPISERVICE_FP[$index]='/var/lib/dietpi/dietpi-software/services/jconvolver.service';((index++)); for ((i=0; i<${#aDIETPISERVICE_NAME[@]}; i++)) do @@ -290,9 +290,9 @@ index=0 aDIETPISERVICE_FP=() aDIETPISERVICE_NAME=() - aDIETPISERVICE_NAME[$index]='RaspimJpeg';aDIETPISERVICE_FP[$index]='/etc/dietpi/dietpi-software/services/raspimjpeg.service';((index++)); - aDIETPISERVICE_NAME[$index]='Deluge';aDIETPISERVICE_FP[$index]='/etc/dietpi/dietpi-software/services/deluge.service';((index++)); - aDIETPISERVICE_NAME[$index]='SqueezeBox Server';aDIETPISERVICE_FP[$index]='/etc/dietpi/dietpi-software/services/squeezeboxserver.service';((index++)); + aDIETPISERVICE_NAME[$index]='RaspimJpeg';aDIETPISERVICE_FP[$index]='/var/lib/dietpi/dietpi-software/services/raspimjpeg.service';((index++)); + aDIETPISERVICE_NAME[$index]='Deluge';aDIETPISERVICE_FP[$index]='/var/lib/dietpi/dietpi-software/services/deluge.service';((index++)); + aDIETPISERVICE_NAME[$index]='SqueezeBox Server';aDIETPISERVICE_FP[$index]='/var/lib/dietpi/dietpi-software/services/squeezeboxserver.service';((index++)); for ((i=0; i<${#aDIETPISERVICE_NAME[@]}; i++)) do diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index fdbf84b9fc..366cd85aa7 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -148,7 +148,7 @@ _EOF_ killall -w /DietPi/dietpi/func/run_ntpd &> /dev/null killall -w ntpd &> /dev/null - rm /etc/dietpi/.ntpd_exit_status &> /dev/null + rm /var/lib/dietpi/.ntpd_exit_status &> /dev/null } @@ -178,8 +178,8 @@ _EOF_ else Reset_NTPD - echo 0 > /etc/dietpi/.ntpd_exit_status - echo 1 > /etc/dietpi/.ntpd_override + echo 0 > /var/lib/dietpi/.ntpd_exit_status + echo 1 > /var/lib/dietpi/.ntpd_override fi @@ -3309,11 +3309,14 @@ _EOF_ ln -sf /usr/share/applications/dietpi-launcher.desktop "$HOME"/Desktop/dietpi-launcher.desktop #Download icons - mkdir -p /etc/dietpi/desktop_icons - wget http://dietpi.com/downloads/conf/desktop/dietpi-icon.png -O /etc/dietpi/desktop_icons/dietpi-icon.png - wget http://dietpi.com/downloads/conf/desktop/grey_16x16.png -O /etc/dietpi/desktop_icons/grey_16x16.png - wget http://dietpi.com/downloads/conf/desktop/kodi-icon.png -O /etc/dietpi/desktop_icons/kodi-icon.png - wget http://dietpi.com/downloads/conf/desktop/justboom.png -O /etc/dietpi/desktop_icons/justboom.png + mkdir -p /var/lib/dietpi/dietpi-software/installed/desktop_icons + wget http://dietpi.com/downloads/conf/desktop/dietpi-icon.png -O /var/lib/dietpi/dietpi-software/installed/desktop_icons/dietpi-icon.png + wget http://dietpi.com/downloads/conf/desktop/grey_16x16.png -O /var/lib/dietpi/dietpi-software/installed/desktop_icons/grey_16x16.png + wget http://dietpi.com/downloads/conf/desktop/kodi-icon.png -O /var/lib/dietpi/dietpi-software/installed/desktop_icons/kodi-icon.png + wget http://dietpi.com/downloads/conf/desktop/justboom.png -O /var/lib/dietpi/dietpi-software/installed/desktop_icons/justboom.png + + # - Replace icon dir in .desktop from /etc/dietpi/desktop_icons + sed -i 's#^Icon=/etc/dietpi/desktop_icons#/var/lib/dietpi/dietpi-software/installed/desktop_icons#g' /var/lib/dietpi/dietpi-software/installed/desktop_icons/*.desktop # - Set execute to prevent "untrusted" prompt in Mate, and possibily other desktops. chmod +x /usr/share/applications/* @@ -10251,7 +10254,7 @@ _EOF_ usermod -a -G video www-data # - raspimjpeg/php schedule startup and control script - cp /DietPi/dietpi/conf/raspimjpeg.service /etc/dietpi/dietpi-software/services/raspimjpeg.service + cp /DietPi/dietpi/conf/raspimjpeg.service /var/lib/dietpi/dietpi-software/services/raspimjpeg.service # - Setup Data directory local dietpicam_media_directory=$G_FP_DIETPI_USERDATA @@ -10270,7 +10273,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then #copy init - cp /DietPi/dietpi/conf/deluge.service /etc/dietpi/dietpi-software/services/deluge.service + cp /DietPi/dietpi/conf/deluge.service /var/lib/dietpi/dietpi-software/services/deluge.service #Generate deluge default config deluged @@ -10531,7 +10534,7 @@ _EOF_ rm /etc/init.d/logitechmediaserver #DietPi-Services init - cp /DietPi/dietpi/conf/squeezeboxserver.service /etc/dietpi/dietpi-software/services/squeezeboxserver.service + cp /DietPi/dietpi/conf/squeezeboxserver.service /var/lib/dietpi/dietpi-software/services/squeezeboxserver.service #Grab our test media for user Download_Test_Media @@ -11133,7 +11136,7 @@ _EOF_ #Copy configs and services cp /DietPi/dietpi/conf/brutefir_config /etc/BruteFIR/ - cp /DietPi/dietpi/conf/brutefir.service /etc/dietpi/dietpi-software/services/brutefir.service + cp /DietPi/dietpi/conf/brutefir.service /var/lib/dietpi/dietpi-software/services/brutefir.service #Modules echo -e "snd-aloop" > /etc/modules-load.d/brutefir-alsa-loopback.conf @@ -12831,9 +12834,9 @@ _EOF_ INSTALLING_INDEX=166 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - mkdir -p /etc/dietpi/audiophonics/pi-spc + mkdir -p /var/lib/dietpi/dietpi-software/installed/pi-spc - cat << _EOF_ > /etc/dietpi/audiophonics/pi-spc/sds.sh + cat << _EOF_ > /var/lib/dietpi/dietpi-software/installed/pi-spc/sds.sh #!/bin/bash #DietPi version PATH=/usr/bin:/home/pi/wiringPi/gpio:/usr/local/bin @@ -12872,7 +12875,7 @@ done exit 0 _EOF_ - chmod +x /etc/dietpi/audiophonics/pi-spc/sds.sh + chmod +x /var/lib/dietpi/dietpi-software/installed/pi-spc/sds.sh cat << _EOF_ > /etc/systemd/system/pi-spc.service [Unit] @@ -12883,7 +12886,7 @@ Type=simple StandardOutput=tty User=root -ExecStart=/bin/bash -c '/etc/dietpi/audiophonics/pi-spc/sds.sh' +ExecStart=/bin/bash -c '/var/lib/dietpi/dietpi-software/installed/pi-spc/sds.sh' [Install] WantedBy=multi-user.target @@ -13646,13 +13649,13 @@ _EOF_ rm -R /var/www/dietpicam rm /opt/vc/bin/raspimjpeg rm /usr/bin/raspimjpeg - rm /etc/dietpi/dietpi-software/services/raspimjpeg.service + rm /var/lib/dietpi/dietpi-software/services/raspimjpeg.service rm /etc/raspimjpeg elif (( $1 == 45 )); then AGP_ERROR_HANDLED deluged deluge-web deluge-webui deluge-console - rm /etc/dietpi/dietpi-software/services/deluge.service + rm /var/lib/dietpi/dietpi-software/services/deluge.service rm -R ~/.config/deluge elif (( $1 == 94 )); then @@ -13752,7 +13755,7 @@ _EOF_ elif (( $1 == 35 )); then AGP_ERROR_HANDLED logitechmediaserver - rm /etc/dietpi/dietpi-software/services/squeezeboxserver.service + rm /var/lib/dietpi/dietpi-software/services/squeezeboxserver.service rm -R /var/lib/squeezeboxserver rm -R /usr/share/squeezeboxserver @@ -13891,7 +13894,7 @@ _EOF_ AGP_ERROR_HANDLED brutefir rm -R /etc/BruteFIR - rm /etc/dietpi/dietpi-software/services/brutefir.service + rm /var/lib/dietpi/dietpi-software/services/brutefir.service rm /etc/asound.conf rm /etc/modules-load.d/brutefir-alsa-loopback.conf @@ -14102,7 +14105,7 @@ _EOF_ elif (( $1 == 166 )); then rm /etc/systemd/system/pi-spc.service - rm -R /etc/dietpi/audiophonics/pi-spc + rm -R /var/lib/dietpi/dietpi-software/installed/pi-spc elif (( $1 == 167 )); then @@ -14469,8 +14472,8 @@ _EOF_ G_AGUG #Generate dir for dietpi-software installed "non-service" based control scripts - mkdir -p /etc/dietpi/dietpi-software/services - chmod -R +x /etc/dietpi/dietpi-software/services + mkdir -p /var/lib/dietpi/dietpi-software/services + chmod -R +x /var/lib/dietpi/dietpi-software/services #Disable software installation, if user input is required for automated installs Install_Disable_Requires_UserInput diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index 1f38e53cee..e894c24470 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -186,9 +186,6 @@ _EOF_ G_DIETPI-NOTIFY 2 'Configuring DietPi Directories:' - # - /etc/dietpi , in process of moving this over to /var/lib/dietpi and /var/tmp/dietpi - mkdir -p /etc/dietpi - # - /var/lib/dietpi : Core storage for installed non-standard APT software, outside of /mnt/dietpi_userdata mkdir -p /var/lib/dietpi chown dietpi:dietpi /var/lib/dietpi @@ -197,7 +194,13 @@ _EOF_ # Storage locations for program specifc additional data mkdir -p /var/lib/dietpi/dietpi-autostart mkdir -p /var/lib/dietpi/dietpi-config - mkdir -p /var/lib/dietpi/dietpi-software + + #mkdir -p /var/lib/dietpi/dietpi-ramlog + mkdir -p /var/lib/dietpi/dietpi-ramlog/storage + + #mkdir -p /var/lib/dietpi/dietpi-software + mkdir -p /var/lib/dietpi/dietpi-software/services #non systemd services for installed software + mkdir -p /var/lib/dietpi/dietpi-software/installed #Additional storage for installed apps, eg: custom scripts and data # - /var/tmp/dietpi : Temp storage saved during reboots, eg: logs outside of /var/log mkdir -p /var/tmp/dietpi/logs diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 5dd21cd7ef..d82eac3286 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -523,9 +523,6 @@ _EOF_ rm package.zip - # - flag - echo 1 > /etc/dietpi/.dietpi_rpi - else G_DIETPI-NOTIFY 1 "Failed to install $INPUT_DEVICE_NAME. $install_url_address may be offline or unreachable." diff --git a/dietpi/func/run_ntpd b/dietpi/func/run_ntpd index 43a64f4977..2639ea15aa 100644 --- a/dietpi/func/run_ntpd +++ b/dietpi/func/run_ntpd @@ -28,7 +28,7 @@ EXIT_CODE=-1 - FP_EXIT_CODE='/etc/dietpi/.ntpd_exit_status' + FP_EXIT_CODE='/var/lib/dietpi/.ntpd_exit_status' NTPD_UPDATE_MODE=$(grep -m1 '^ntpd_update_mode=' /DietPi/dietpi.txt | sed 's/.*=//') Update_NTPD(){ diff --git a/dietpi/patch_file b/dietpi/patch_file index ce99c41125..5770e0d170 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -487,14 +487,14 @@ _EOF_ /DietPi/dietpi/dietpi-apt-get_update 1 #------------------------------------------------------------------------------- #New location for dietpi-software installed "non-service" based control scripts - mkdir -p /etc/dietpi/dietpi-software/services + mkdir -p /var/lib/dietpi/dietpi-software/services # - move to new location, if installed - mv /etc/deluge_init /etc/dietpi/dietpi-software/services/deluge.service &> /dev/null - mv /etc/raspimjpeg_init /etc/dietpi/dietpi-software/services/raspimjpeg.service &> /dev/null - mv /etc/squeezeboxserver_init /etc/dietpi/dietpi-software/services/squeezeboxserver.service &> /dev/null - mv /etc/BruteFIR/brutefir.service /etc/dietpi/dietpi-software/services/brutefir.service &> /dev/null - chmod -R +x /etc/dietpi/dietpi-software/services + mv /etc/deluge_init /var/lib/dietpi/dietpi-software/services/deluge.service &> /dev/null + mv /etc/raspimjpeg_init /var/lib/dietpi/dietpi-software/services/raspimjpeg.service &> /dev/null + mv /etc/squeezeboxserver_init /var/lib/dietpi/dietpi-software/services/squeezeboxserver.service &> /dev/null + mv /etc/BruteFIR/brutefir.service /var/lib/dietpi/dietpi-software/services/brutefir.service &> /dev/null + chmod -R +x /var/lib/dietpi/dietpi-software/services #------------------------------------------------------------------------------- #DietPi-Software additions: if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_WEBSERVER_REDIS=') == 0 )); then @@ -2038,11 +2038,11 @@ _EOF_ ln -sf /usr/share/applications/dietpi-launcher.desktop "$HOME"/Desktop/dietpi-launcher.desktop #Download icons - mkdir -p /etc/dietpi/desktop_icons - wget http://dietpi.com/downloads/conf/desktop/dietpi-icon.png -O /etc/dietpi/desktop_icons/dietpi-icon.png - wget http://dietpi.com/downloads/conf/desktop/grey_16x16.png -O /etc/dietpi/desktop_icons/grey_16x16.png - wget http://dietpi.com/downloads/conf/desktop/kodi-icon.png -O /etc/dietpi/desktop_icons/kodi-icon.png - wget http://dietpi.com/downloads/conf/desktop/justboom.png -O /etc/dietpi/desktop_icons/justboom.png + mkdir -p /var/lib/dietpi/dietpi-software/installed/desktop_icons + wget http://dietpi.com/downloads/conf/desktop/dietpi-icon.png -O /var/lib/dietpi/dietpi-software/installed/desktop_icons/dietpi-icon.png + wget http://dietpi.com/downloads/conf/desktop/grey_16x16.png -O /var/lib/dietpi/dietpi-software/installed/desktop_icons/grey_16x16.png + wget http://dietpi.com/downloads/conf/desktop/kodi-icon.png -O /var/lib/dietpi/dietpi-software/installed/desktop_icons/kodi-icon.png + wget http://dietpi.com/downloads/conf/desktop/justboom.png -O /var/lib/dietpi/dietpi-software/installed/desktop_icons/justboom.png #Kodi if (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 '^aSOFTWARE_INSTALL_STATE\[31\]=2') )); then @@ -2749,10 +2749,6 @@ _EOF_ #RPi update DietPi kernel: if (( $G_HW_MODEL < 10 )); then - # - remove old flags - rm /etc/dietpi/.dietpi_rpi &> /dev/null - rm /etc/dietpi/.384khz_rpi &> /dev/null - /DietPi/dietpi/func/dietpi-set_hardware kernel dietpi_rpi # Sabre module update @@ -2875,6 +2871,39 @@ _EOF_ #Verify/update dietpi.txt entries: #NB: After v160, dietpi-update will do this prior to each update /DietPi/dietpi/func/dietpi-set_software verify_dietpi.txt + #------------------------------------------------------------------------------- + #FHS changes: https://github.com/Fourdee/DietPi/issues/1297 + # APT now IPv4 forced: + # - Update core ENV + sed -i '/prefer_ipversion=/c\Sprefer_ipversion=ipv4' /DietPi/dietpi.txt + /DietPi/dietpi/func/dietpi-set_core_environment + + # - Revert of https://github.com/Fourdee/DietPi/issues/1329#issuecomment-353586754 + # Disabled/replaced in /DietPi/dietpi/func/dietpi-set_core_environment generation + unset LD_LIBRARY_PATH + ldconfig + + # - DietPi-autostart custom script moved + mkdir -p /var/lib/dietpi/dietpi-autostart &> /dev/null + mv /etc/dietpi/autostart.sh /var/lib/dietpi/dietpi-autostart/custom.sh &> /dev/null + + # - wifi-monitor moved + mv /etc/dietpi/dietpi-wifi-monitor.sh /var/lib/dietpi/dietpi-wifi-monitor.sh &> /dev/null + + # - /etc/dietpi/.ntpd_exit_status moved, although, we can simply delete this and have it regened on run + rm /etc/dietpi/.ntpd_exit_status &> /dev/null + + # - DietPi-software non-systemD services moved + mv /etc/dietpi/dietpi-software/services /var/lib/dietpi/dietpi-software &> /dev/null + + # - Remove kernel flags (not used in our scripts) + rm /etc/dietpi/.dietpi_rpi &> /dev/null + rm /etc/dietpi/.384khz_rpi &> /dev/null + + # - Desktop icons + mv /etc/dietpi/desktop_icons /var/lib/dietpi/dietpi-software/installed/ &> /dev/null + sed -i 's#^Icon=/etc/dietpi/desktop_icons#/var/lib/dietpi/dietpi-software/installed/desktop_icons#g' /var/lib/dietpi/dietpi-software/installed/desktop_icons/*.desktop *> /dev/null + #------------------------------------------------------------------------------- #Sparky SBC patches if (( $G_HW_MODEL == 70 )); then @@ -2940,7 +2969,7 @@ _EOF_ # OC # Squeezelite # YMPD - # + # Pi-SPC (due to FHS changes, moved script) update-rc.d ympd remove &> /dev/null # switch to systemD rm /etc/init.d/ympd &> /dev/null # switch to systemD @@ -2949,7 +2978,7 @@ _EOF_ sudo -u www-data php /var/www/owncloud/occ maintenance:mode --on &> /dev/null sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on &> /dev/null - /DietPi/dietpi/dietpi-software reinstall 159 128 124 114 47 36 32 + /DietPi/dietpi/dietpi-software reinstall 159 128 124 114 47 36 32 166 #------------------------------------------------------------------------------- #DietPi-Globals: https://github.com/Fourdee/DietPi/issues/1311 if (( ! $(grep -ci -m1 'dietpi-globals' /root/.bashrc) )); then @@ -2965,21 +2994,6 @@ _EOF_ fi #------------------------------------------------------------------------------- - #FHS changes: https://github.com/Fourdee/DietPi/issues/1297 - # APT now IPv4 forced: - # - Update core ENV - sed -i '/prefer_ipversion=/c\Sprefer_ipversion=ipv4' /DietPi/dietpi.txt - /DietPi/dietpi/func/dietpi-set_core_environment - - # - Revert of https://github.com/Fourdee/DietPi/issues/1329#issuecomment-353586754 - # Disabled/replaced in /DietPi/dietpi/func/dietpi-set_core_environment generation - unset LD_LIBRARY_PATH - ldconfig - - # - DietPi-autostart custom script moved - mkdir -p /var/lib/dietpi/dietpi-autostart &> /dev/null - mv /etc/dietpi/autostart.sh /var/lib/dietpi/dietpi-autostart/custom.sh &> /dev/null - #------------------------------------------------------------------------------- fi From d110000d9e1fb2ebc21c893e4fe40ed85596b6de Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 27 Dec 2017 14:56:57 +0100 Subject: [PATCH 138/390] v160 + DietPi-Software | Several updates --- dietpi/dietpi-software | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 366cd85aa7..ff74bbba52 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3981,7 +3981,7 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS='https://www.phpbb.com/files/release/phpBB-3.1.6.zip' + INSTALL_URL_ADDRESS='https://www.phpbb.com/files/release/phpBB-3.2.1.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install @@ -4131,7 +4131,7 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS='https://download.nextcloud.com/server/releases/latest-12.zip' + INSTALL_URL_ADDRESS='https://download.nextcloud.com/server/releases/latest.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install @@ -4315,8 +4315,16 @@ _EOF_ if (( $? == 0 )); then wget -q -O - "$INSTALL_URL_ADDRESS" | apt-key add - - wget https://apt.mopidy.com/jessie.list -O /etc/apt/sources.list.d/mopidy.list + # No Buster list available yet, use stretch.list for testing: + if (( $G_DISTRO > 4 )); then + wget https://apt.mopidy.com/stretch.list -O /etc/apt/sources.list.d/mopidy.list + + else + + wget https://apt.mopidy.com/"$G_DISTRO_NAME".list -O /etc/apt/sources.list.d/mopidy.list + + fi G_AGUP AGI_ERROR_HANDLED mopidy @@ -4899,7 +4907,7 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS='http://sourceforge.net/projects/subsonic/files/subsonic/5.3/subsonic-5.3.deb/download' + INSTALL_URL_ADDRESS='https://sourceforge.net/projects/subsonic/files/subsonic/5.3/subsonic-5.3.deb/download' G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -4924,7 +4932,7 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS='https://sourceforge.net/projects/subsonic/files/subsonic/6.0/subsonic-6.0.deb/download' + INSTALL_URL_ADDRESS='https://sourceforge.net/projects/subsonic/files/subsonic/6.1.3/subsonic-6.1.3.deb/download' G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -5319,7 +5327,7 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS='http://sourceforge.net/projects/webiopi/files/WebIOPi-0.7.1.tar.gz/download' + INSTALL_URL_ADDRESS='https://sourceforge.net/projects/webiopi/files/WebIOPi-0.7.1.tar.gz/download' G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -5376,7 +5384,7 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS='http://www.haproxy.org/download/1.7/src/haproxy-1.7.2.tar.gz' + INSTALL_URL_ADDRESS='https://www.haproxy.org/download/1.8/src/haproxy-1.8.2.tar.gz' G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install @@ -6159,7 +6167,7 @@ _EOF_ Banner_Installing #check, is online - INSTALL_URL_ADDRESS='https://github.com/XavierBerger/RPi-Monitor-deb/raw/a7ae61cec8589b0fe1a835170ff34a268ab4a295/packages/rpimonitor_2.11-r5_all.deb' + INSTALL_URL_ADDRESS='https://github.com/XavierBerger/RPi-Monitor-deb/raw/master/packages/rpimonitor_2.12-r0_all.deb' G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install @@ -6367,7 +6375,7 @@ _EOF_ #x86_64 if (( $G_HW_ARCH == 10 )); then - INSTALL_URL_ADDRESS='https://downloads.plex.tv/plex-media-server/1.5.6.3790-4613ce077/plexmediaserver_1.5.6.3790-4613ce077_amd64.deb' + INSTALL_URL_ADDRESS='https://downloads.plex.tv/plex-media-server/1.10.1.4602-f54242b6b/plexmediaserver_1.10.1.4602-f54242b6b_amd64.deb' #ARM else @@ -6720,17 +6728,17 @@ _EOF_ # - armv6+ if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then - INSTALL_URL_ADDRESS='https://github.com/syncthing/syncthing/releases/download/v0.14.40/syncthing-linux-arm-v0.14.40.tar.gz' + INSTALL_URL_ADDRESS='https://github.com/syncthing/syncthing/releases/download/v0.14.42/syncthing-linux-arm-v0.14.42.tar.gz' # - arm64 elif (( $G_HW_ARCH == 3 )); then - INSTALL_URL_ADDRESS='https://github.com/syncthing/syncthing/releases/download/v0.14.40/syncthing-linux-arm64-v0.14.40.tar.gz' + INSTALL_URL_ADDRESS='https://github.com/syncthing/syncthing/releases/download/v0.14.42/syncthing-linux-arm64-v0.14.42.tar.gz' # - x86_64 elif (( $G_HW_ARCH == 10 )); then - INSTALL_URL_ADDRESS='https://github.com/syncthing/syncthing/releases/download/v0.14.40/syncthing-linux-amd64-v0.14.40.tar.gz' + INSTALL_URL_ADDRESS='https://github.com/syncthing/syncthing/releases/download/v0.14.42/syncthing-linux-amd64-v0.14.42.tar.gz' fi @@ -6830,7 +6838,7 @@ _EOF_ if (( $G_HW_MODEL < 10 )); then - AGI_ERROR_HANDLED chromium-browser + AGI_ERROR_HANDLED chromium-browser else @@ -6912,7 +6920,7 @@ _EOF_ #Jessie, prefer latest motion release. if (( $G_DISTRO == 3 )); then - INSTALL_URL_ADDRESS='http://github.com/Motion-Project/motion/releases/download/release-4.0.1/pi_jessie_motion_4.0.1-1_armhf.deb' + INSTALL_URL_ADDRESS='https://github.com/Motion-Project/motion/releases/download/release-4.1.1/pi_jessie_motion_4.1.1-1_armhf.deb' #url/redireect always fails wget spider test... G_CHECK_URL "http://github.com/Motion-Project/motion" @@ -7035,7 +7043,7 @@ _EOF_ Banner_Installing - local version='2.3.1' + local version='2.3.2' INSTALL_URL_ADDRESS="https://github.com/sabnzbd/sabnzbd/archive/$version.zip" @@ -7132,7 +7140,7 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS='https://github.com/phanan/koel/archive/v3.6.2.zip' + INSTALL_URL_ADDRESS='https://github.com/phanan/koel/archive/v3.7.0.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" @@ -7567,7 +7575,7 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS='https://dl.gitea.io/gitea/1.3.1/gitea-1.3.1-' + INSTALL_URL_ADDRESS='https://dl.gitea.io/gitea/1.3.1/gitea-1.3.2-' #armv6 if (( $G_HW_ARCH == 1 )); then From 9eda8a494283e9833d1ed997d195f4cf11eb9e01 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 27 Dec 2017 18:51:26 +0100 Subject: [PATCH 139/390] v160 + DietPi-Software | Fix HAProxy installation on Stretch+ --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index ff74bbba52..48a56e71ee 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5398,7 +5398,7 @@ _EOF_ cd haproxy-* #Pre-reqs - AGI_ERROR_HANDLED libpcre3-dev libssl-dev + AGI_ERROR_HANDLED libpcre3-dev libssl-dev zlib1g-dev #Compile and install make -j $G_HW_CPU_CORES TARGET=linux2628 CPU=generic USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 USE_LINUX_SPLICE=1 make install From 133790cf67fb303c9845f511f945ad26edfc8b98 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 27 Dec 2017 19:27:08 +0100 Subject: [PATCH 140/390] v160 + DietPi-Software | Gitea: Fix typo in download URL --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index ff74bbba52..452d323a77 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7575,7 +7575,7 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS='https://dl.gitea.io/gitea/1.3.1/gitea-1.3.2-' + INSTALL_URL_ADDRESS='https://dl.gitea.io/gitea/1.3.2/gitea-1.3.2-' #armv6 if (( $G_HW_ARCH == 1 )); then From c4e5909dbed8fd553af5468e72b0a1103d85898f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 28 Dec 2017 04:25:59 +0100 Subject: [PATCH 141/390] v160 + DietPi-Software | ownCloud/Nextcloud: Enable pretty URLs (without index.php) on Apache --- dietpi/dietpi-software | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index ff74bbba52..695a2f6ffb 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9328,6 +9328,14 @@ _EOF_ # Set CLI URL to ownCloud sub directory: sed -i "s|'http://localhost'|'http://localhost/owncloud'|g" $config_php + + # Set pretty URLs (without /index.php/) on Apache: + if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then + + grep -q "^\s*'htaccess.RewriteBase' => '" $config_php || sed -i "/^\s*'overwrite.cli.url' => '/a \ \ 'htaccess.RewriteBase' => '/owncloud'," $config_php + occ maintenance:update:htaccess + + fi # APCu Memcache if (( ! $(cat $config_php | grep -ci -m1 "'memcache.local'") )); then @@ -9371,7 +9379,7 @@ _EOF_ occ background:cron # Enable maintenance mode to allow handling by dietpi-services: - grep -q "'maintenance' => true," $config_php &>/dev/null || occ maintenance:mode --on + grep -q "'maintenance' => true," $config_php || occ maintenance:mode --on fi @@ -9502,6 +9510,14 @@ _EOF_ # Set CLI URL to Nextcloud sub directory: sed -i "s|'http://localhost'|'http://localhost/nextcloud'|g" $config_php + # Set pretty URLs (without /index.php/) on Apache: + if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then + + grep -q "^\s*'htaccess.RewriteBase' => '" $config_php || sed -i "/^\s*'overwrite.cli.url' => '/a \ \ 'htaccess.RewriteBase' => '/nextcloud'," $config_php + ncc maintenance:update:htaccess + + fi + # APCu Memcache if (( ! $(cat $config_php | grep -ci -m1 "'memcache.local'") )); then @@ -9544,7 +9560,7 @@ _EOF_ ncc background:cron # Enable maintenance mode to allow handling by dietpi-services: - grep -q "'maintenance' => true," $config_php &>/dev/null || ncc maintenance:mode --on + grep -q "'maintenance' => true," $config_php || ncc maintenance:mode --on fi From 8b2dac62fd81677bcb1dc4cfd329d42da0a25a3c Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 28 Dec 2017 10:18:14 +0000 Subject: [PATCH 142/390] v160 + General | Fix for kill-ssh-user-sessions-before-network.service reporting failed during shutdown: https://github.com/Fourdee/DietPi/issues/1330 --- CHANGELOG.txt | 4 ++++ dietpi/func/dietpi-set_core_environment | 21 +++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 58b678df27..aac51eec8b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,10 @@ v160 (xx/01/18) +#####In_Progress +General | Fix for kill-ssh-user-sessions-before-network.service reporting failed during shutdown: https://github.com/Fourdee/DietPi/issues/1330 +##### + Minor notes: The XMAS tree has now been taken down, stored away on github for next year. Hope you all had a good one :D diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index e894c24470..e743483b37 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -199,7 +199,7 @@ _EOF_ mkdir -p /var/lib/dietpi/dietpi-ramlog/storage #mkdir -p /var/lib/dietpi/dietpi-software - mkdir -p /var/lib/dietpi/dietpi-software/services #non systemd services for installed software + mkdir -p /var/lib/dietpi/dietpi-software/services #non systemd custom services for installed software mkdir -p /var/lib/dietpi/dietpi-software/installed #Additional storage for installed apps, eg: custom scripts and data # - /var/tmp/dietpi : Temp storage saved during reboots, eg: logs outside of /var/log @@ -334,7 +334,8 @@ Before=network.target shutdown.target [Service] Type=oneshot -ExecStart=/bin/bash -c 'killall sshd &> /dev/null; killall dropbear &> /dev/null' +#ExecStart=/bin/bash -c 'killall sshd &> /dev/null; killall dropbear &> /dev/null' +ExecStart=/bin/bash -c '/var/lib/dietpi/dietpi-software/services/kill-ssh-user-sessions-before-network.sh' [Install] WantedBy=poweroff.target halt.target reboot.target @@ -342,6 +343,22 @@ _EOF_ systemctl daemon-reload systemctl enable kill-ssh-user-sessions-before-network + cat << _EOF_ > /var/lib/dietpi/dietpi-software/services/kill-ssh-user-sessions-before-network.sh +#!/bin/bash +if (( $(ps x | grep -ci -m1 '[s]shd' ) )); then + + killall -w sshd + +elif (( $(ps x | grep -ci -m1 '[d]ropbear' ) )); then + + killall -w dropbear + +fi + +exit 0 +_EOF_ + chmod +x /var/lib/dietpi/dietpi-software/services/kill-ssh-user-sessions-before-network.sh + #----------------------------------------------------------------------------------- #Cron Jobs From c9938eb255f58ee4be7f1ac14deb9de03dd34bf3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 28 Dec 2017 17:07:06 +0100 Subject: [PATCH 143/390] v160 + DietPi | Fix apt-daily.service error on boot --- dietpi/func/dietpi-set_core_environment | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index e743483b37..1f8804f230 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -412,10 +412,16 @@ _EOF_ #----------------------------------------------------------------------------------- #MISC - G_DIETPI-NOTIFY 2 "Disabling apt-daily services (prevents random APT cache lock):" + G_DIETPI-NOTIFY 2 "Disabling apt-daily services on Stretch+ (prevents random APT cache lock):" - systemctl mask apt-daily.service &> /dev/null - systemctl mask apt-daily-upgrade.timer &> /dev/null + if (( G_DISTRO > 3 )); then + + systemctl mask apt-daily.service &> /dev/null + systemctl mask apt-daily.timer &> /dev/null + systemctl mask apt-daily-upgrade.service &> /dev/null + systemctl mask apt-daily-upgrade.timer &> /dev/null + + fi G_DIETPI-NOTIFY 2 "Setting vm.swappiness=1:" From e48cb12599d7b2d7ffdf2a4703ddb7db8e0b1fdc Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 28 Dec 2017 17:10:47 +0100 Subject: [PATCH 144/390] v160 + DietPi | Fix apt-daily.service boot error on update --- dietpi/patch_file | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index 5770e0d170..04e8ad1dc3 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2994,7 +2994,16 @@ _EOF_ fi #------------------------------------------------------------------------------- + #Fix apt-daily.service error on boot: https://github.com/Fourdee/DietPi/issues/1330 + if (( G_DISTRO > 3 )); then + systemctl mask apt-daily.service &> /dev/null + systemctl mask apt-daily.timer &> /dev/null + systemctl mask apt-daily-upgrade.service &> /dev/null + systemctl mask apt-daily-upgrade.timer &> /dev/null + + fi + #------------------------------------------------------------------------------- fi From 7271a8f0856e95abf822fe8dfce1ddfaa0391632 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 28 Dec 2017 17:15:40 +0100 Subject: [PATCH 145/390] v160 + DietPi | Add systemd error message fixes to changelog --- CHANGELOG.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index aac51eec8b..c0282a9f59 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,10 +1,6 @@ v160 (xx/01/18) -#####In_Progress -General | Fix for kill-ssh-user-sessions-before-network.service reporting failed during shutdown: https://github.com/Fourdee/DietPi/issues/1330 -##### - Minor notes: The XMAS tree has now been taken down, stored away on github for next year. Hope you all had a good one :D @@ -29,6 +25,7 @@ DietPi-Software | ownCloud/Nextcloud: Added option to choose data directory via DietPi-Software | UrBackup: Installation updated to latest version 2.1.20. For new installations only: https://github.com/Fourdee/DietPi/issues/1335 Bug Fixes: +General | Fixed two systemd error messages during shutdown and boot: https://github.com/Fourdee/DietPi/issues/1330 DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi drop during software installs/updates etc: https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480 DietPi-Software | Resolved an issue where our custom LD_LIBRARY_PATH would cause APT failures. LD_LIBRARY_PATH has now been reverted, apologies if this effected your system: https://github.com/Fourdee/DietPi/issues/1329 DietPi-Software | Resolved an issue where APT installations would fail if services were masked. All known DietPi software services, will be enabled/unmasked, before installation: https://github.com/Fourdee/DietPi/issues/1320 From 276a7eed00c70666ad8d81b645b80eb44db12594 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 29 Dec 2017 09:27:30 +0000 Subject: [PATCH 146/390] v160 + escape $ during cat --- dietpi/func/dietpi-set_core_environment | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index e743483b37..0d8f17a73e 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -345,11 +345,11 @@ _EOF_ cat << _EOF_ > /var/lib/dietpi/dietpi-software/services/kill-ssh-user-sessions-before-network.sh #!/bin/bash -if (( $(ps x | grep -ci -m1 '[s]shd' ) )); then +if (( \$(ps x | grep -ci -m1 '[s]shd' ) )); then killall -w sshd -elif (( $(ps x | grep -ci -m1 '[d]ropbear' ) )); then +elif (( \$(ps x | grep -ci -m1 '[d]ropbear' ) )); then killall -w dropbear From 930b3ce18dcf9f03fe91a2fe27ac63229a13d56b Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 29 Dec 2017 10:16:46 +0000 Subject: [PATCH 147/390] v160 + whoopsie! --- dietpi/patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 5770e0d170..1fe2062484 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2902,7 +2902,7 @@ _EOF_ # - Desktop icons mv /etc/dietpi/desktop_icons /var/lib/dietpi/dietpi-software/installed/ &> /dev/null - sed -i 's#^Icon=/etc/dietpi/desktop_icons#/var/lib/dietpi/dietpi-software/installed/desktop_icons#g' /var/lib/dietpi/dietpi-software/installed/desktop_icons/*.desktop *> /dev/null + sed -i 's#^Icon=/etc/dietpi/desktop_icons#/var/lib/dietpi/dietpi-software/installed/desktop_icons#g' /var/lib/dietpi/dietpi-software/installed/desktop_icons/*.desktop &> /dev/null #------------------------------------------------------------------------------- #Sparky SBC patches From be5bf3c2ff4862d213bb9a8436415f9634c4ce73 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 29 Dec 2017 11:14:00 +0000 Subject: [PATCH 148/390] v160 + DietPi-Software | Google AIY: Updated install to gitbranch=voicekit. Many thanks to @mpember for the heads up: https://github.com/Fourdee/DietPi/issues/1065#issuecomment-354304388 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index aac51eec8b..595653a9c0 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -39,6 +39,7 @@ DietPi-Software | MariaDB: Resolved an issue where MariaDB would fail to uninsta DietPi-Software | Aira2 (Stretch): Resolved installation, now used APT installation: https://github.com/Fourdee/DietPi/issues/1310 DietPi-Software | Mosquitto (Stretch): Resolved issue with failed install, due to unavailable pre-req libs in Debian/Mosq repos: https://github.com/Fourdee/DietPi/issues/1306 DietPi-Software | ownCloud/Nextcloud: Fixed an installation issue on Jessie with MariaDB: https://github.com/Fourdee/DietPi/pull/1319 +DietPi-Software | Google AIY: Updated install to gitbranch=voicekit. Many thanks to @mpember for the heads up: https://github.com/Fourdee/DietPi/issues/1065#issuecomment-354304388 DietPi-Update | dietpi.txt is now checked for missing entries, and, will now be patched during the update: https://github.com/Fourdee/DietPi/issues/1292#issuecomment-350818969 Sparky SBC | Kernel patch will be applied which resolves issues with HQPlayer playback: https://www.computeraudiophile.com/forums/topic/32132-allo-sparky-usbridge/?do=findComment&comment=753100 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index ea0ff19d32..9db64a912d 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7817,7 +7817,7 @@ libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then - git clone "$INSTALL_URL_ADDRESS" "$G_FP_DIETPI_USERDATA"/voice-recognizer-raspi + git clone -b voicekit "$INSTALL_URL_ADDRESS" "$G_FP_DIETPI_USERDATA"/voice-recognizer-raspi cd "$G_FP_DIETPI_USERDATA"/voice-recognizer-raspi pip3 install --upgrade pip virtualenv @@ -9328,7 +9328,7 @@ _EOF_ # Set CLI URL to ownCloud sub directory: sed -i "s|'http://localhost'|'http://localhost/owncloud'|g" $config_php - + # Set pretty URLs (without /index.php/) on Apache: if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then From be7675518d4ae4b3fea889ad6b4f4fdb1df2a628 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 29 Dec 2017 12:12:47 +0000 Subject: [PATCH 149/390] v160 + DietPi-Software | NodeRed: Corrected user which nodered runs under, now runs as its own user, created during install: https://github.com/Fourdee/DietPi/issues/1294#issuecomment-354314318 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 595653a9c0..ad2320a867 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -27,6 +27,7 @@ DietPi-Software | NAA Daemon: Updated to latest (3.5.2-36). Existing installs wi DietPi-Software | PHP-FPM: Increased from "$CPU_CORES_TOTAL" to "pm.max_children = $(( $CPU_CORES_TOTAL * 3 ))". This should avoid failed forking of PHP-FPM processes/requests : https://github.com/Fourdee/DietPi/issues/1298 DietPi-Software | ownCloud/Nextcloud: Added option to choose data directory via dietpi.txt pre installation: https://github.com/Fourdee/DietPi/issues/1314#issuecomment-352782055 DietPi-Software | UrBackup: Installation updated to latest version 2.1.20. For new installations only: https://github.com/Fourdee/DietPi/issues/1335 +DietPi-Software | NodeRed: Corrected user which nodered runs under, now runs as its own user, created during install: https://github.com/Fourdee/DietPi/issues/1294#issuecomment-354314318 Bug Fixes: DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi drop during software installs/updates etc: https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 9db64a912d..5e16802eba 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8706,6 +8706,9 @@ _EOF_ # - FuguHub chown -R bd:bd "$G_FP_DIETPI_USERDATA"/fuguhub-data/ + # - Nodered + chown -R nodered:nodered "$G_FP_DIETPI_USERDATA"/node-red + } #///////////////////////////////////////////////////////////////////////////////////// @@ -9849,13 +9852,15 @@ _EOF_ mkdir -p "$G_FP_DIETPI_USERDATA"/node-red + adduser nodered --system --group --no-create-home --shell=/bin/nologin + cat << _EOF_ > /etc/systemd/system/node-red.service [Unit] Description=Node-Red [Service] Type=simple -User=root +User=nodered ExecStart=/usr/local/bin/node-red -u $G_FP_DIETPI_USERDATA/node-red [Install] @@ -12405,6 +12410,7 @@ _EOF_ sed -i "/FFMPEG_PATH=/c\FFMPEG_PATH=$(which ffmpeg)" .env php artisan koel:init + #php artisan db:seed --force cd "$HOME" @@ -13442,6 +13448,8 @@ _EOF_ rm "$HOME"/.node-red rm -R "$G_FP_DIETPI_USERDATA"/node-red + userdel -f nodered + elif (( $1 == 123 )); then AGP_ERROR_HANDLED mosquitto From 136875c6bc14a8951a92c10840a96d3e65473abd Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 29 Dec 2017 15:18:20 +0100 Subject: [PATCH 150/390] v160 --- dietpi/func/dietpi-set_core_environment | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index 1f8804f230..a0207ecb90 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -414,7 +414,7 @@ _EOF_ G_DIETPI-NOTIFY 2 "Disabling apt-daily services on Stretch+ (prevents random APT cache lock):" - if (( G_DISTRO > 3 )); then + if (( $G_DISTRO > 3 )); then systemctl mask apt-daily.service &> /dev/null systemctl mask apt-daily.timer &> /dev/null From 63684b95ef9cadddae278098bac43eb03c22dc8e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 29 Dec 2017 15:18:45 +0100 Subject: [PATCH 151/390] v160 --- dietpi/patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 04e8ad1dc3..3705b9bebb 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2995,7 +2995,7 @@ _EOF_ fi #------------------------------------------------------------------------------- #Fix apt-daily.service error on boot: https://github.com/Fourdee/DietPi/issues/1330 - if (( G_DISTRO > 3 )); then + if (( $G_DISTRO > 3 )); then systemctl mask apt-daily.service &> /dev/null systemctl mask apt-daily.timer &> /dev/null From e0bc54099e9654254334b9fcfdbf4e555cbe86b9 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 30 Dec 2017 04:52:13 +0100 Subject: [PATCH 152/390] v160 + Fix HTTPS check for Nginx, as old script does not exist any more and G_CHECK_URL terminates installation on $? != 0. + Some grep/sed hardening, consequently using [[:blank:]] for horizontal spaces. + Show errors on enabling Apache modules and sites, if something is missing/not installed, just hide the unnecessary "already enabled" messages. --- dietpi/dietpi-software | 48 ++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 5e16802eba..1f1ad64e36 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9228,7 +9228,7 @@ _EOF_ # Apache: https://doc.owncloud.org/server/latest/admin_manual/installation/source_installation.html#configure-apache-web-server if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then - a2enmod rewrite headers env dir mime &> /dev/null + a2enmod rewrite headers env dir mime 1> /dev/null local owncloud_conf='/etc/apache2/sites-available/owncloud.conf' # Do not overwrite existing config. if [ -f $owncloud_conf ]; then @@ -9240,7 +9240,7 @@ _EOF_ sed -i 's/nextcloud/owncloud/g' $owncloud_conf # OPcache adjustment is just asked by Nextcloud sed -i 's/php_admin_value/#php_admin_value/' $owncloud_conf - a2ensite owncloud &> /dev/null + a2ensite owncloud 1> /dev/null fi @@ -9265,7 +9265,7 @@ _EOF_ fi # Set HTTPS on, if SSL connection is available, even with self-signed/untrusted certificate. - DietPi/dietpi/func/check_connection https://localhost &> /dev/null + wget -q --spider --timeout=10 --tries=2 https://localhost &> /dev/null if (( $? == 0 || $? == 5)); then sed -i 's/#fastcgi_param HTTPS on;/fastcgi_param HTTPS on;/g' $owncloud_config @@ -9316,7 +9316,7 @@ _EOF_ # Enable MySQL 4-byte support for new installations only, to prevent risky database conversion tasks: if (( $oc_is_fresh == 1 )); then - grep -q "'mysql.utf8mb4' => " $config_php || sed -i "/'dbpassword'/a \ \ 'mysql.utf8mb4' => true," $config_php + grep -q "^[[:blank:]]*'mysql.utf8mb4'" $config_php || sed -i "/^[[:blank:]]*'dbpassword'/a \ \ 'mysql.utf8mb4' => true," $config_php fi @@ -9335,25 +9335,21 @@ _EOF_ # Set pretty URLs (without /index.php/) on Apache: if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then - grep -q "^\s*'htaccess.RewriteBase' => '" $config_php || sed -i "/^\s*'overwrite.cli.url' => '/a \ \ 'htaccess.RewriteBase' => '/owncloud'," $config_php + grep -q "^[[:blank:]]*'htaccess.RewriteBase'" $config_php || sed -i "/^[[:blank:]]*'overwrite.cli.url'/a \ \ 'htaccess.RewriteBase' => '/owncloud'," $config_php occ maintenance:update:htaccess fi # APCu Memcache - if (( ! $(cat $config_php | grep -ci -m1 "'memcache.local'") )); then - - sed -i "/'version'/a 'memcache.local' => '\\\OC\\\Memcache\\\APCu'," $config_php - - fi + grep -q "^[[:blank:]]*'memcache.local'" $config_php || sed -i "/^[[:blank:]]*'version'/a \ \ 'memcache.local' => '\\\OC\\\Memcache\\\APCu'," $config_php # Redis for transactional file locking: # https://doc.owncloud.org/server/latest/admin_manual/configuration/server/caching_configura$ # - Enable Redis socket and grant www-data access to it: local redis_conf="/etc/redis/redis*.conf" - grep -q "^\s*unixsocket /" $redis_conf || grep -q '#unixsocket /' $redis_conf && sed -i 's|#unixsocket /|unixsocket /|' $redis_conf || echo 'unixsocket /var/run/redis/redis.sock' >> $redis_conf - grep -q "^\s*#?unixsocketperm " $redis_conf && sed -i "/^\s*#?unixsocketperm /c\unixsocketperm 770" $redis_conf || echo 'unixsocketperm 770' >> $redis_conf - local redis_sock=$(grep "^\s*unixsocket " $redis_conf | sed "s/\s*unixsocket //") + grep -q "^[[:blank:]]*unixsocket /" $redis_conf || grep -q '^[[:blank:]]*#unixsocket /' $redis_conf && sed -i 's|^[[:blank:]]*#unixsocket /|unixsocket /|' $redis_conf || echo 'unixsocket /var/run/redis/redis.sock' >> $redis_conf + grep -q "^[[:blank:]]*#?unixsocketperm " $redis_conf && sed -i "/^[[:blank:]]*#?unixsocketperm /c\unixsocketperm 770" $redis_conf || echo 'unixsocketperm 770' >> $redis_conf + local redis_sock=$(grep "^[[:blank:]]*unixsocket /" $redis_conf | sed "s/^[[:blank:]]*unixsocket //") usermod -a -G redis www-data # - Enable ownCloud to use Redis socket: if (( ! $(cat $config_php | grep -ci -m1 "'memcache.locking'") )); then @@ -9382,7 +9378,7 @@ _EOF_ occ background:cron # Enable maintenance mode to allow handling by dietpi-services: - grep -q "'maintenance' => true," $config_php || occ maintenance:mode --on + grep -q "^[[:blank:]]*'maintenance' => true," $config_php || occ maintenance:mode --on fi @@ -9414,7 +9410,7 @@ _EOF_ # 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 &> /dev/null + a2enmod rewrite headers env dir mime 1> /dev/null local nextcloud_conf='/etc/apache2/sites-available/nextcloud.conf' # Do not overwrite existing config. if [ -f $nextcloud_conf ]; then @@ -9423,7 +9419,7 @@ _EOF_ fi cp /DietPi/dietpi/conf/apache.ownnextcloud.conf $nextcloud_conf - a2ensite nextcloud &> /dev/null + a2ensite nextcloud 1> /dev/null fi @@ -9448,7 +9444,7 @@ _EOF_ fi # Set HTTPS on, if SSL connection is available, even with self-signed/untrusted certificate. - DietPi/dietpi/func/check_connection https://localhost &> /dev/null + wget -q --spider --timeout=10 --tries=2 https://localhost &> /dev/null if (( $? == 0 || $? == 5)); then sed -i 's/#fastcgi_param HTTPS on;/fastcgi_param HTTPS on;/g' $nextcloud_config @@ -9499,7 +9495,7 @@ _EOF_ # Enable MySQL 4-byte support for new installations only, to prevent risky database conversion tasks: if (( $nc_is_fresh == 1 )); then - grep -q "'mysql.utf8mb4' => " $config_php || sed -i "/'dbpassword'/a \ \ 'mysql.utf8mb4' => true," $config_php + grep -q "^[[:blank:]]*'mysql.utf8mb4'" $config_php || sed -i "/^[[:blank:]]*'dbpassword'/a \ \ 'mysql.utf8mb4' => true," $config_php fi @@ -9516,25 +9512,21 @@ _EOF_ # Set pretty URLs (without /index.php/) on Apache: if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then - grep -q "^\s*'htaccess.RewriteBase' => '" $config_php || sed -i "/^\s*'overwrite.cli.url' => '/a \ \ 'htaccess.RewriteBase' => '/nextcloud'," $config_php + grep -q "^[[:blank:]]*'htaccess.RewriteBase'" $config_php || sed -i "/^[[:blank:]]*'overwrite.cli.url'/a \ \ 'htaccess.RewriteBase' => '/nextcloud'," $config_php ncc maintenance:update:htaccess fi # APCu Memcache - if (( ! $(cat $config_php | grep -ci -m1 "'memcache.local'") )); then - - sed -i "/'version'/a 'memcache.local' => '\\\OC\\\Memcache\\\APCu'," $config_php - - fi + grep -q "^[[:blank:]]*'memcache.local'" $config_php || sed -i "/^[[:blank:]]*'version'/a \ \ 'memcache.local' => '\\\OC\\\Memcache\\\APCu'," $config_php # Redis for transactional file locking: # https://docs.nextcloud.com/server/12/admin_manual/configuration_files/files_locking_transactional.html # - Enable Redis socket and grant www-data access to it: local redis_conf="/etc/redis/redis*.conf" - grep -q "^\s*unixsocket /" $redis_conf || grep -q '#unixsocket /' $redis_conf && sed -i 's|#unixsocket /|unixsocket /|' $redis_conf || echo 'unixsocket /var/run/redis/redis.sock' >> $redis_conf - grep -q "^\s*#?unixsocketperm " $redis_conf && sed -i "/^\s*#?unixsocketperm /c\unixsocketperm 770" $redis_conf || echo 'unixsocketperm 770' >> $redis_conf - local redis_sock=$(grep "^\s*unixsocket " $redis_conf | sed "s/\s*unixsocket //") + grep -q "^[[:blank:]]*unixsocket /" $redis_conf || grep -q '^[[:blank:]]*#unixsocket /' $redis_conf && sed -i 's|^[[:blank:]]*#unixsocket /|unixsocket /|' $redis_conf || echo 'unixsocket /var/run/redis/redis.sock' >> $redis_conf + grep -q "^[[:blank:]]*#?unixsocketperm " $redis_conf && sed -i "/^[[:blank:]]*#?unixsocketperm /c\unixsocketperm 770" $redis_conf || echo 'unixsocketperm 770' >> $redis_conf + local redis_sock=$(grep "^[[:blank:]]*unixsocket /" $redis_conf | sed "s/^[[:blank:]]*unixsocket //") usermod -a -G redis www-data # - Enable Nextloud to use Redis socket: if (( ! $(cat $config_php | grep -ci -m1 "'memcache.locking'") )); then @@ -9563,7 +9555,7 @@ _EOF_ ncc background:cron # Enable maintenance mode to allow handling by dietpi-services: - grep -q "'maintenance' => true," $config_php || ncc maintenance:mode --on + grep -q "^[[:blank:]]*'maintenance' => true," $config_php || ncc maintenance:mode --on fi From e2701cbb82e0f942450bfd08a8fd5e147f3319ca Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 30 Dec 2017 10:17:26 +0000 Subject: [PATCH 153/390] v160 + removal of uimage/boot binaries from bug report (40MB+ reports are too big). + Minor rc.local --- dietpi/dietpi-bugreport | 35 +++++++++++++++++++++++-- dietpi/func/dietpi-set_core_environment | 1 + 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-bugreport b/dietpi/dietpi-bugreport index f3423d1c24..17b6d44775 100644 --- a/dietpi/dietpi-bugreport +++ b/dietpi/dietpi-bugreport @@ -46,7 +46,7 @@ Generate_Template_Doc(){ -cat << _EOF_ > "$FILE_BUGREPORT_TEXT" + cat << _EOF_ > "$FILE_BUGREPORT_TEXT" ---------------------------------------------------------------- DietPi : Bug Report #Date @@ -123,9 +123,14 @@ _EOF_ # - DietPi scripts / logs "/DietPi/*" - "/boot/*" + "/boot/dietpi.txt" + "/boot/config.txt" + "/boot/dietpi/*" "/var/tmp/dietpi/logs/*" + # - /var/lib/dietpi + "/var/lib/dietpi/*" + # - confs "/etc/X11/xorg.conf" "/etc/bash.bashrc" @@ -137,6 +142,8 @@ _EOF_ "/etc/sysctl.conf" "/etc/sysctl.d/*" + "/root/.bashrc" + # - Services "/etc/init.d/*" "/etc/systemd/*" @@ -209,26 +216,37 @@ _EOF_ #Check if we have a working internet connection beforehand G_CHECK_URL "$FTP_ADDR" if (( $? == 0 )); then + INTERNET_AVAILABLE=1 + fi # - Prompt user if they wish to continue. Offline mode. No Network. if (( $INTERNET_AVAILABLE == 0 )); then + clear + whiptail --title "Offline" --yesno "Error: Unable to connect to $FTP_ADDR\n- Make sure a network device is installed.\n- Check your network connection is functional.\n- $FTP_ADDR may be offline.\n\n Would you like to generate an offline bug report?\n - /DietPi/bugreport.zip" --yes-button "Ok" --no-button "Exit" --defaultno --backtitle "DietPi Bug Report" 14 70 CHOICE=$? if (( $CHOICE == 0 )); then + ONLINE_BUG_REPORT=0 CREATE_BUG_REPORT=1 + fi + # - Prompt user if they wish to continue. Online Upload. else + whiptail --title "Send DietPi Bug Report?" --yesno "DietPi will generate and upload a bug report for your system.\n\nThis file will contain:\n- Your description of the bug/issue.\n- DietPi settings.\n- Log files.\n- Config files specific to DietPi.\n\nDo you wish to continue?" --yes-button "Ok" --no-button "Exit" --defaultno --backtitle "DietPi Bug Report" 15 70 CHOICE=$? if (( $CHOICE == 0 )); then + ONLINE_BUG_REPORT=1 CREATE_BUG_REPORT=1 + fi + fi #---------------------------------------------------------------- @@ -249,7 +267,9 @@ _EOF_ #---------------------------------------------------------------- #Load .bug_id if [ -f "$FILE_BUG_NUMBER" ]; then + UNIQUE_ID_BUGNUMBER=$(cat "$FILE_BUG_NUMBER") + fi #---------------------------------------------------------------- @@ -291,7 +311,9 @@ _EOF_ fi else + BUG_REPORT_COMPLETED=-1 + fi fi @@ -303,10 +325,13 @@ _EOF_ #Inform user if (( $ONLINE_BUG_REPORT == 0 )); then + whiptail --title "Bug Report Created" --msgbox "Your offline bug report has been generated:\n - /DietPi/bugreport.zip\n\nContact DietPi for support using one of the below:\n- Github Issue : https://github.com/Fourdee/DietPi/issues\n- RPi Forum : https://goo.gl/QzyTVm\n- Odroid Forum : http://goo.gl/26owYc\n- DietPi Forum : http://dietpi.com/phpbb/viewforum.php?f=9" --backtitle "DietPi Bug Report" 16 70 /DietPi/dietpi/dietpi-banner 1 echo -e "\n Bug report generated. /DietPi/bugreport.zip \n " + else + #inform user of their unique ID that can be used to track issue whiptail --title "Bug Report Sent" --msgbox "Your bug report has been sent.\nPlease make note of your reference code below. This will need to be used when contacting DietPi for support.\n\n Reference CODE: $UNIQUE_ID_HW-$UNIQUE_ID_BUGNUMBER \n\nContact DietPi for support using one of the below:\n- Github Issue : https://github.com/Fourdee/DietPi/issues\n- RPi Forum : https://goo.gl/QzyTVm\n- Odroid Forum : http://goo.gl/26owYc\n- DietPi Forum : http://dietpi.com/phpbb/viewforum.php?f=9" --backtitle "DietPi Bug Report" 18 70 @@ -322,16 +347,22 @@ _EOF_ #Failed to upload - Connection error elif (( $BUG_REPORT_COMPLETED == -1 )); then + whiptail --title "Upload failed" --msgbox "Error: Unable to upload Bug report.\n\nConnection to $FTP_ADDR has failed:\n- Check your network connection is functional.\n- Please try again later." --backtitle "DietPi Bug Report" 12 70 /DietPi/dietpi/dietpi-banner 1 + #Failed to upload - Filesize too big elif (( $BUG_REPORT_COMPLETED == -2 )); then + whiptail --title "Bug report upload failed" --msgbox "Error: Bug report file exceeds size limit\n - Max size = $(( $UPLOAD_FILESIZE_LIMIT / 1024 / 1024 ))MB\n - Bug report size = $(( $UPLOAD_FILESIZE / 1024 / 1024 ))MB\n\nThis bug report has NOT been sent." --backtitle "DietPi Bug Report" 12 60 /DietPi/dietpi/dietpi-banner 1 + #Aborted elif (( $CREATE_BUG_REPORT == 0 )); then + /DietPi/dietpi/dietpi-banner 1 echo -e "\nBug report aborted by user.\n" + fi #---------------------------------------------------------------- diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index cbf849ffb0..91dc6abc60 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -321,6 +321,7 @@ if (( \$(cat /DietPi/dietpi/.install_stage) == 1 )); then fi /DietPi/dietpi/dietpi-banner 0 echo -e " Default Login:\n Username = root\n Password = dietpi\n" +echo -e " Please login to continue\n" exit 0 _EOF_ chmod +x /etc/rc.local From a26322f797c0a6dc342346b91e36073a2d4c32a0 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 30 Dec 2017 10:27:43 +0000 Subject: [PATCH 154/390] v160 + dpkg --add-architecture armhf: https://github.com/Fourdee/DietPi/issues/1277#issuecomment-354538657 --- dietpi/dietpi-software | 1 + 1 file changed, 1 insertion(+) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 1f1ad64e36..696e0b5731 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7184,6 +7184,7 @@ _EOF_ if (( $G_HW_ARCH == 3 )); then echo -e "deb [arch=armhf] https://apt.sonarr.tv/ master main" > /etc/apt/sources.list.d/sonarr.list + dpkg --add-architecture armhf else From c54c657b4b9a1aefc0b26c5bd13e56e8b37b44f4 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 30 Dec 2017 12:20:53 +0000 Subject: [PATCH 155/390] v160 + G_FILE_EXISTS https://github.com/Fourdee/DietPi/issues/1311#issuecomment-354541417 --- dietpi/func/dietpi-globals | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 5aedada190..cfea93803f 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -363,6 +363,7 @@ } #Run a command and send the output through the error handler. This has the same effect as running G_ERROR_HANDLER afterwards, however, allows for command used info, and log output/view when an error occurs + #NB: This command does not support inputs with redirects. For file creation, use G_FILE_EXISTS afterwards to check it exists: https://github.com/Fourdee/DietPi/issues/1311#issuecomment-354541417 # $@ = input command # eg: # G_ERROR_HANDLER_ONERROR_USERMSG='We couldn't make a critical directory, holy cow!' #Optional user message if error occurs @@ -384,6 +385,45 @@ } + #Checks if a file/folder exists + # Automatically passed through G_ERROR_HANDLER + G_FILE_EXISTS(){ + + G_ERROR_HANDLER_COMMAND="$@" + G_ERROR_HANDLER_EXITCODE=0 + + G_DIETPI-NOTIFY 2 "Checking file/folder exists: $G_ERROR_HANDLER_COMMAND" + G_DIETPI-NOTIFY 2 'Please wait...' + + local string='' + + if [ -f "$G_ERROR_HANDLER_COMMAND" ]; then + + string="File exists" + + elif [ -d "$G_ERROR_HANDLER_COMMAND" ]; then + + string="Folder exists" + + else + + string="File/folder does not exist" + G_ERROR_HANDLER_EXITCODE=1 + + fi + + string+=" | $G_ERROR_HANDLER_COMMAND" + + echo -e "$string" > /tmp/G_ERROR_HANDLER_COMMAND + G_ERROR_HANDLER_ONERROR_FPLOGFILE='/tmp/G_ERROR_HANDLER_COMMAND' + G_ERROR_HANDLER_COMMAND="$string" + + G_ERROR_HANDLER + + rm /tmp/G_ERROR_HANDLER_COMMAND &> /dev/null + + } + #----------------------------------------------------------------------------------- # DietPi First-Run Stage #----------------------------------------------------------------------------------- From 153d8e77608fd970e89cde516e3c286c10f4a304 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 30 Dec 2017 12:23:11 +0000 Subject: [PATCH 156/390] v160 + [dupe] removal https://github.com/Fourdee/DietPi/issues/1311 --- dietpi/func/dietpi-globals | 6 ------ 1 file changed, 6 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index cfea93803f..5e4e9a045a 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -281,12 +281,6 @@ fi - if (( $G_ERROR_HANDLER_ONERROR_EXIT )); then - - G_DIETPI-NOTIFY 2 'Unable to continue, the program will now terminate.' - - fi - # - On Error: Display whip version? if (( $G_USER_INPUTS )); then From ccd99ae74583b990344ec298151f76d14878a7f9 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 30 Dec 2017 12:41:02 +0000 Subject: [PATCH 157/390] v160 + optimize duped printout: https://github.com/Fourdee/DietPi/issues/1311 --- dietpi/func/dietpi-globals | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 5e4e9a045a..b29ad6d27c 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -246,6 +246,12 @@ #Error else + local print_hw_info="VERSION:v$(cat /DietPi/dietpi/.version) | HW_MODEL:$G_HW_MODEL | HW_ARCH:$G_HW_ARCH | DISTRO:$G_DISTRO" + local print_exitcode_info="exit_code = $G_ERROR_HANDLER_EXITCODE" + local print_logfile_info="Log file contents:\n$(tail -50 $G_ERROR_HANDLER_ONERROR_FPLOGFILE)" + local print_report_to_dietpi_info='If problems persist, please report this to DietPi for investigation, including a screenshot of this error! (https://github.com/Fourdee/DietPi/issues).' + local print_unable_to_continue='Unable to continue, the program will now terminate.' + echo '' if [ -n "$G_PROGRAM_NAME" ]; then @@ -257,13 +263,13 @@ fi - G_DIETPI-NOTIFY 2 "exit_code = $G_ERROR_HANDLER_EXITCODE" - G_DIETPI-NOTIFY 2 "HW_MODEL:$G_HW_MODEL | HW_ARCH:$G_HW_ARCH | DISTRO:$G_DISTRO" + G_DIETPI-NOTIFY 2 "$print_exitcode_info" + G_DIETPI-NOTIFY 2 "$print_hw_info" # - On Error: Display logfile FP, if set if [ -n "$G_ERROR_HANDLER_ONERROR_FPLOGFILE" ]; then - G_DIETPI-NOTIFY 2 "Logfile contents:\n$(tail -50 $G_ERROR_HANDLER_ONERROR_FPLOGFILE)" + G_DIETPI-NOTIFY 2 "$print_logfile_info" fi @@ -277,7 +283,7 @@ # Display "please report to dietpi", if its one of our programs if [ -n "$G_PROGRAM_NAME" ]; then - G_DIETPI-NOTIFY 2 'If problems persist, please report this to DietPi for investigation, including a screenshot of this error! (https://github.com/Fourdee/DietPi/issues).' + G_DIETPI-NOTIFY 2 "$print_report_to_dietpi_info" fi @@ -296,15 +302,15 @@ fi whip_msg+='\n' - whip_msg+=" - Exit code = $G_ERROR_HANDLER_EXITCODE" + whip_msg+=" - $print_exitcode_info" whip_msg+='\n' - whip_msg+=" - HW_MODEL:$G_HW_MODEL | HW_ARCH:$G_HW_ARCH | DISTRO:$G_DISTRO" + whip_msg+=" - $print_hw_info" whip_msg+='\n\n' # Display optional logfile? if [ -n "$G_ERROR_HANDLER_ONERROR_FPLOGFILE" ]; then - whip_msg+="Log file contents:\n$(tail -50 $G_ERROR_HANDLER_ONERROR_FPLOGFILE)" + whip_msg+="$print_logfile_info" whip_msg+='\n\n' fi @@ -320,14 +326,14 @@ # Display "please report to dietpi", if its one of our programs if [ -n "$G_PROGRAM_NAME" ]; then - whip_msg+="If problems persist, please report this to DietPi for investigation, including a screenshot of this error! (https://github.com/Fourdee/DietPi/issues)." + whip_msg+="$print_report_to_dietpi_info" fi if (( $G_ERROR_HANDLER_ONERROR_EXIT )); then whip_msg+='\n\n' - whip_msg+='Unable to continue, the program will now terminate.' + whip_msg+="$print_unable_to_continue" fi @@ -338,7 +344,7 @@ # - On Error: Kill current script, excluding the shell. if (( $G_ERROR_HANDLER_ONERROR_EXIT )); then - G_DIETPI-NOTIFY 1 'Unable to continue, this program will now terminate.' + G_DIETPI-NOTIFY 1 "$print_unable_to_continue" # - Reset for next run G_ERROR_HANDLER_RESET From aacefe92dcae99e85340e245e01fe784c738e6a4 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 30 Dec 2017 13:20:59 +0000 Subject: [PATCH 158/390] v160 + Github ticket generation on failures: https://github.com/Fourdee/DietPi/issues/1311#issuecomment-354544907 --- CHANGELOG.txt | 2 +- dietpi/func/dietpi-globals | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fa123e24ba..24defb97a4 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,7 +8,7 @@ Image Modifications: Changes / Improvements / Optimizations: General | We have completed much needed backbone work for DietPi, which will allow for improved expansion in source code. This includes the use of dietpi-globals. -DietPi-Globals | New script which optimizes most used DietPi commands and vars, throughout our scripts. Also exported to bash session, please type 'G_' then press 'TAB' to see a full list of options. +DietPi-Globals | New script which optimizes most used DietPi commands and vars, throughout our scripts. Also exported to bash session, please type 'G_' then press 'TAB' to see a full list of options: https://github.com/Fourdee/DietPi/issues/1311 General | FHS compliance completed. /etc/dietpi has moved to /var/lib/dietpi. RAMlog store has moved to /var/tmp/dietpi: https://github.com/Fourdee/DietPi/issues/1297#issuecomment-352241193 General | wget: Now set to prefer IPv4 by default (generally faster): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 General | APT: Now set to force IPv4 by default (generally faster): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index b29ad6d27c..9cf7e8d295 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -344,6 +344,44 @@ # - On Error: Kill current script, excluding the shell. if (( $G_ERROR_HANDLER_ONERROR_EXIT )); then + # - Github printout: + echo -e " +\e[41m +-------------------------------------------------------------------- +- DietPi has encounted an error, and, is unable to continue - +- Please create a ticket: https://github.com/Fourdee/DietPi/issues - +- Copy and paste the BLUE lines below, into the ticket - +-------------------------------------------------------------------- +\e[0m +\e[44m +#### Required Information: +- DietPi Version | v$(cat /DietPi/dietpi/.version) +- SBC Device | $G_HW_MODEL_DESCRIPTION (index=$G_HW_MODEL) +- Distro | $G_DISTRO_NAME (index=$G_DISTRO) +- Command | $G_ERROR_HANDLER_COMMAND +- Error Handler | G_ERROR_HANDLER + +#### Additional Information (if applicable): +- Software title | $G_PROGRAM_NAME + +#### Expected behaviour: + + +#### Actual behaviour: + + +#### Steps to reproduce: + + +#### Additional logs: +\`\`\` +$print_logfile_info +\`\`\` +\e[0m + +\e[41m--------------------------------------------------------------------\e[0m +" + G_DIETPI-NOTIFY 1 "$print_unable_to_continue" # - Reset for next run From 1aa2cbed70bd57226103799c7287143c3b0ae079 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 31 Dec 2017 01:26:43 +0100 Subject: [PATCH 159/390] v160 + As AGP_ERROR_HANDLED breaks, if the package does not exist in repo, we need to use G_RUN_CMD dpkg -P instead for all packages, installed via dpkg -i. + Basically we could use dpkg -P for all purging, means inside G_AGP, as there is really no difference. APT just has the advantage of dependency handling on installation. The only downside is, that you can't use "package*" to purge all packages with this prefix together. All packages have to be fully named, no * or similar accepted, otherwise we could handle this within G_AGP script by grep/sed for "*" and add full names by using dpkg --get-selections. --- dietpi/dietpi-software | 61 +++++++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 21 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 696e0b5731..bf6a6b3d46 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -13299,7 +13299,7 @@ _EOF_ elif (( $1 == 30 )); then - AGP_ERROR_HANDLED nomachine + G_RUN_CMD dpkg -P nomachine elif (( $1 == 29 )); then @@ -13416,7 +13416,7 @@ _EOF_ elif (( $1 == 115 )); then - AGP_ERROR_HANDLED webmin + G_RUN_CMD dpkg -P webmin elif (( $1 == 32 )); then @@ -13425,7 +13425,9 @@ _EOF_ elif (( $1 == 128 )); then - AGP_ERROR_HANDLED mpd libmpdclient2 + apt-mark auto libavformat57 libupnp6 libmpdclient2 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file &> /dev/null + apt-mark unhold mpd 1> /dev/null + (( $G_DISTRO == 3 && $G_HW_ARCH != 3 )) && AGP_ERROR_HANDLED mpd || G_RUN_CMD dpkg -P mpd userdel -f mpd &> /dev/null rm /lib/systemd/system/mpd.service rm -R "$G_FP_DIETPI_USERDATA"/.mpd_cache @@ -13445,12 +13447,14 @@ _EOF_ elif (( $1 == 123 )); then + apt-mark auto libssl1.0.0 libwebsockets3 &> /dev/null AGP_ERROR_HANDLED mosquitto rm /etc/apt/sources.list.d/mosquitto-*.list elif (( $1 == 124 )); then - AGP_ERROR_HANDLED networkaudiod + apt-mark auto gcc-6-base libstdc++6 &> /dev/null + G_RUN_CMD dpkg -P networkaudiod elif (( $1 == 125 )); then @@ -13494,6 +13498,8 @@ _EOF_ elif (( $1 == 134 )); then + apt-mark auto libjpeg8 libpng12-0 libfontconfig1 &> /dev/null + rm /etc/systemd/system/tonido.service rm -R /etc/tonido @@ -13510,7 +13516,8 @@ _EOF_ elif (( $1 == 136 )); then - AGP_ERROR_HANDLED motion + apt-mark auto v4l-utils python python-dev libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev libx264-142 libavcodec56 libavformat56 libmysqlclient18 libswscale3 libpq5 &> /dev/null + (( $G_DISTRO > 3 )) && AGP_ERROR_HANDLED motion || G_RUN_CMD dpkg -P motion rm -R /etc/motioneye @@ -13542,7 +13549,7 @@ _EOF_ elif (( $1 == 140 )); then - AGP_ERROR_HANDLED libsdl2 libsdl2-image libsdl2-mixer libsdl2-net libsdl2-ttf libsmpeg2 + G_RUN_CMD dpkg -P libsdl2 libsdl2-image libsdl2-mixer libsdl2-net libsdl2-ttf libsmpeg2 elif (( $1 == 141 )); then @@ -13731,7 +13738,7 @@ _EOF_ elif (( $1 == 33 || $1 == 34 )); then - AGP_ERROR_HANDLED subsonic + G_RUN_CMD dpkg -P subsonic rm -R /var/subsonic elif (( $1 == 71 )); then @@ -13750,7 +13757,7 @@ _EOF_ rm "$HOME"/weaved_setup.bin # Remot3.it - AGP_ERROR_HANDLED weavedconnectd + G_RUN_CMD dpkg -P weavedconnectd elif (( $1 == 62 )); then @@ -13779,7 +13786,8 @@ _EOF_ elif (( $1 == 35 )); then - AGP_ERROR_HANDLED logitechmediaserver + apt-mark auto libxml-parser-perl zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev &> /dev/null + G_RUN_CMD dpkg -P logitechmediaserver rm /var/lib/dietpi/dietpi-software/services/squeezeboxserver.service rm -R /var/lib/squeezeboxserver rm -R /usr/share/squeezeboxserver @@ -13866,6 +13874,7 @@ _EOF_ elif (( $1 == 60 )); then + apt-mark auto libssl1.0.0 &> /dev/null AGP_ERROR_HANDLED hostapd isc-dhcp-server rm /etc/dhcp/dhcpd.conf &> /dev/null @@ -13911,7 +13920,11 @@ _EOF_ elif (( $1 == 37 )); then - AGP_ERROR_HANDLED shairport-sync* + apt-mark auto libssl1.0.0 openssl libsoxr0 libavahi-client3 libtool libconfig9 libpopt0 libdaemon0 &> /dev/null + #No package is installed anymore, files are directly extracted into places, need to remove them manually? + #https://github.com/Fourdee/DietPi/blob/testing/dietpi/dietpi-software#L5968 + #G_RUN_CMD dpkg -P shairport-sync + rm /lib/systemd/system/shairport-sync.service /usr/local/bin/shairport-sync /usr/local/etc/shairport-sync.conf* /usr/local/share/man/man7/shairport-sync.7.gz &> /dev/null userdel -f shairport-sync elif (( $1 == 38 )); then @@ -13948,7 +13961,7 @@ _EOF_ elif (( $1 == 66 )); then - AGP_ERROR_HANDLED rpimonitor + G_RUN_CMD dpkg -P rpimonitor elif (( $1 == 57 )); then @@ -13960,6 +13973,8 @@ _EOF_ elif (( $1 == 65 )); then + apt-mark auto zlib1g-dev &> /dev/null + #all rm /etc/systemd/system/netdata.service @@ -13967,7 +13982,7 @@ _EOF_ groupdel netdata #1.2.0+ - AGP_ERROR_HANDLED netdata + G_RUN_CMD dpkg -P netdata #1.0.0 rm /usr/sbin/netdata @@ -13984,7 +13999,7 @@ _EOF_ elif (( $1 == 41 )); then - AGP_ERROR_HANDLED emby-server + AGP_ERROR_HANDLED emby-server embymagick rm /etc/apt/sources.list.d/emby-server.list G_AGUP @@ -13996,7 +14011,7 @@ _EOF_ elif (( $1 == 42 )); then - AGP_ERROR_HANDLED plexmediaserver* + (( $G_HW_ARCH == 10 )) && G_RUN_CMD dpkg -P plexmediaserver plexmediaserver-installer || AGP_ERROR_HANDLED plexmediaserver-installer rm -R /var/lib/plexmediaserver @@ -14094,12 +14109,13 @@ _EOF_ elif (( $1 == 113 )); then + apt-mark auto libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7 &> /dev/null apt-mark unhold chromium chromedriver rm /etc/chromium.d/custom_flags rm "$HOME"/.chromium-browser.init - AGP_ERROR_HANDLED chromium + (( $G_DISTRO >=4 )) && AGP_ERROR_HANDLED chromium* || G_RUN_CMD dpkg -P chromium chromedriver elif (( $1 == 157)); then @@ -14207,7 +14223,8 @@ _EOF_ elif (( $1 == 163 )); then - AGP_ERROR_HANDLED gmrender + apt-mark auto libupnp6 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-alsa &> /dev/null + G_RUN_CMD dpkg -P gmrender rm /etc/systemd/system/gmrender.service elif (( $1 == 159 || $1 == 160 )); then @@ -14281,7 +14298,7 @@ _EOF_ elif (( $1 == 111 )); then - AGP_ERROR_HANDLED urbackup-server + G_RUN_CMD dpkg -P urbackup-server #+sourcebuild rm /etc/systemd/system/urbackupsrv.service @@ -14326,8 +14343,9 @@ _EOF_ elif (( $1 == 6 )); then - AGP_ERROR_HANDLED xcompmgr xinit xauth xserver-xorg xfonts-base x11-xserver-utils x11-common x11-utils - rm /etc/xdg/autostart/xcompmgr.desktop + apt-mark auto aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump* xf86-video-fbturbo* firmware-samsung xf86-video-armsoc-odroid malit628-odroid &> /dev/null + AGP_ERROR_HANDLED xcompmgr xterm xinit xauth xserver-xorg dbus-x11 xfonts-base x11-xserver-utils x11-common x11-utils + rm /etc/xdg/autostart/xcompmgr.desktop /etc/X11/xorg.conf &> /dev/null elif (( $1 == 2 )); then @@ -14343,8 +14361,9 @@ _EOF_ elif (( $1 == 7 )); then AGP_ERROR_HANDLED ffmpeg - # + RPi - AGP_ERROR_HANDLED libx264 libmp3lame libfdk-aac + # + RPi, use dpkg -P as packages were installed via dpkg -i and APT can produce error/terminate dietpi-software: + # https://github.com/Fourdee/DietPi/issues/1352#issuecomment-354552622 + (( $G_HW_MODEL < 10 )) && G_RUN_CMD dpkg -P libx264 libmp3lame libfdk-aac elif (( $1 == 8 )); then From 0fae63e29f00154a8e6fd782ac39ba84831a9055 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 31 Dec 2017 11:09:43 +0000 Subject: [PATCH 160/390] v6.0 Testing --- dietpi/server_version-6 | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 dietpi/server_version-6 diff --git a/dietpi/server_version-6 b/dietpi/server_version-6 new file mode 100644 index 0000000000..cdfade7aba --- /dev/null +++ b/dietpi/server_version-6 @@ -0,0 +1,2 @@ +6 +0 From 9e45be7036799ddd7de10bffe1d297ad922ab37a Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 31 Dec 2017 12:00:30 +0000 Subject: [PATCH 161/390] v6.0 Start of v6.0 update changes: https://github.com/Fourdee/DietPi/issues/1355 --- dietpi/.version | 3 +- dietpi/dietpi-backup | 64 +- dietpi/dietpi-banner | 51 +- dietpi/dietpi-bugreport | 3 +- dietpi/dietpi-cloudshell | 19 +- dietpi/dietpi-survey | 21 +- dietpi/dietpi-sync | 157 +- dietpi/dietpi-update | 89 +- dietpi/func/dietpi-globals | 4 +- dietpi/patch_file | 2961 +----------------------------------- dietpi/server_version | 2 +- 11 files changed, 340 insertions(+), 3034 deletions(-) diff --git a/dietpi/.version b/dietpi/.version index 9da06a1833..cdfade7aba 100644 --- a/dietpi/.version +++ b/dietpi/.version @@ -1 +1,2 @@ -160 \ No newline at end of file +6 +0 diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index cf7c53901a..cab1be45b0 100644 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -50,12 +50,16 @@ local backup_last_completed_system='System backup not found. Create one.' if [ -f "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_SYSTEM" ]; then + backup_last_completed_system=$(grep 'Completed' "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_SYSTEM" | tail -1) + fi local backup_last_completed_userdata='User data backup not found (requires "Full" backup mode)' if [ -f "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_USERDATA" ]; then + backup_last_completed_userdata=$(grep 'Completed' "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME_USERDATA" | tail -1) + fi local text_backup_mode='System only' @@ -67,7 +71,7 @@ fi - WHIP_TITLE='- DietPi-Backup -' + WHIP_TITLE='DietPi-Backup' OPTION=$(whiptail --title "$WHIP_TITLE" --menu "Current backup and restore location:\n - $FP_TARGET_BACKUP\n - $backup_last_completed_system\n - $backup_last_completed_userdata" --cancel-button "Exit" --default-item "$MENU_LASTITEM" --backtitle "$WHIP_BACKTITLE" 16 80 5 \ "Help" "What does DietPi-Backup do?" \ "Location" "Change where your backup will be saved and restored from." \ @@ -81,9 +85,13 @@ MENU_LASTITEM="$OPTION" case "$OPTION" in + Location) + TARGETMENUID=1 + ;; + "Backup mode") OPTION=$(whiptail --title "$WHIP_TITLE" --menu "Please select a backup mode:\n\n - System only\nOnly the system is backed up and restored, this does not include your DietPi user data ($G_FP_DIETPI_USERDATA).\n\n - Full:\nSystem and user data ($G_FP_DIETPI_USERDATA) is backed up and restored.\n\nMore information on what DietPi user data is:\nhttp://dietpi.com/phpbb/viewtopic.php?f=8&t=478#p2087" --cancel-button "Exit" --default-item "$BACKUP_MODE" --backtitle "$WHIP_BACKTITLE" 20 80 2 \ @@ -97,29 +105,45 @@ fi ;; + Help) + whiptail --title "DietPi-Backup Help" --msgbox "DietPi-Backup is a program that allows you to Backup and Restore your DietPi system.\n\nIf you have broken your system, or want to reset your system to an earlier date, this can all be done with DietPi-Backup.\n\nSimply choose a location where you want to save and restore your backups from, then, select Backup or Restore.\n\nMore information:\n - http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=256#p255" --backtitle "$WHIP_BACKTITLE" 20 75 + ;; + Backup) + WHIP_TITLE=' Start backup? ' whiptail --title "$WHIP_TITLE" --yesno "Your $text_start_mode_desc will be backed up to:\n$FP_TARGET_BACKUP\n\nDo you wish to continue?" --yes-button "Ok" --no-button "Back" --defaultno --backtitle "$WHIP_BACKTITLE" 11 65 CHOICE=$? if (( $CHOICE == 0 )); then + Run_Backup + fi + ;; + Restore) + WHIP_TITLE=' Start restore? ' whiptail --title "$WHIP_TITLE" --yesno "Your $text_start_mode_desc will be restored from:\n$FP_TARGET_BACKUP\n\nDo you wish to continue?" --yes-button "Ok" --no-button "Back" --defaultno --backtitle "$WHIP_BACKTITLE" 11 65 CHOICE=$? if (( $CHOICE == 0 )); then + Run_Restore + fi + ;; + esac else + Menu_Exit + fi } @@ -132,7 +156,9 @@ #Exit if (( $CHOICE == 0 )); then + TARGETMENUID=-1 + fi } @@ -161,28 +187,36 @@ #Do we have any results? if (( $(cat "$fp_search_results" | wc -l) > 0 )); then + readarray search_results_list < "$fp_search_results" #Create List for Whiptail local search_results_whiptail=() for ((i=0; i<${#search_results_list[@]}; i++)) do + local last_backup_date=$( grep 'Completed' ${search_results_list[$i]} | tail -1 | sed 's/.*: //' ) # Date of last backup for this backup local backup_directory=$( echo -e ${search_results_list[$i]} | sed 's/\/'"$BACKUP_STATS_FILENAME_SYSTEM"'//g' ) # Backup directory (minus the backup file), that we can use for target backup directory. search_results_whiptail+=("$backup_directory" ": $last_backup_date") + done OPTION=$(whiptail --title "Backups found." --menu "Please select a previous backup to use:" --cancel-button "Back" --backtitle "$WHIP_BACKTITLE" 12 70 3 "${search_results_whiptail[@]}" 3>&1 1>&2 2>&3) CHOICE=$? if (( $CHOICE == 0 )); then + FP_TARGET_BACKUP="$OPTION" + fi #delete[] array unset search_results_list unset search_results_whiptail rm "$fp_search_results" &> /dev/null + else + whiptail --title "No results" --msgbox "No previous backups were found in /mnt/*" --backtitle "$WHIP_BACKTITLE" 10 60 + fi ;; @@ -210,14 +244,18 @@ esac else + #Return to main menu TARGETMENUID=0 + fi Check_Supported_Directory_Location # - Not supported, reset directory target to previous if (( $TARGET_DIRECTORY_SUPPORTED == 0 )); then + FP_TARGET_BACKUP="$current_directory" + fi } @@ -227,7 +265,9 @@ OPTION=$(whiptail --inputbox "Please enter the filepath to your directory. \neg: /mnt/dietpi-backup\n - Must be located inside /mnt/* \n - Must be symlink compatible filesystem (ext2/3/4)" 10 70 "$FP_TARGET_BACKUP" --title "Manual backup directory" --backtitle "$WHIP_BACKTITLE" 3>&1 1>&2 2>&3) CHOICE=$? if (( $CHOICE == 0 )); then + FP_TARGET_BACKUP="$OPTION" + fi } @@ -695,32 +735,44 @@ _EOF_ #Generate the target directory if it doesnt exist. So we can check what filesystem it will be. local directory_generated=0 if [ ! -d "$FP_TARGET_BACKUP" ]; then + mkdir -p "$FP_TARGET_BACKUP" directory_generated=1 + fi TARGET_FILESYSTEM_TYPE="$( df -T $FP_TARGET_BACKUP | sed -n '2p' | awk '{print $2}')" for ((i=0; i<${#aSUPPORTED_FILESYSTEMS[@]}; i++)) do + if [ "$TARGET_FILESYSTEM_TYPE" = "${aSUPPORTED_FILESYSTEMS[$i]}" ]; then + TARGET_DIRECTORY_SUPPORTED=1 break + fi + done #Delete directory if tested if (( $directory_generated == 1 )); then + rm -R "$FP_TARGET_BACKUP" + fi #Not ext2/3/4 if (( $TARGET_DIRECTORY_SUPPORTED == 0 )); then + Error_Filesystem_Not_Supported + fi #Not inside /mnt else + Error_Not_Mnt_Directory + fi } @@ -761,8 +813,10 @@ _EOF_ Read_Settings_File # $2 Optional directory input. - if [ "$2" != "" ]; then + if [ -n "$2" ]; then + FP_TARGET_BACKUP=$2 + fi #----------------------------------------------------------------------------- @@ -787,9 +841,13 @@ _EOF_ clear if (( $TARGETMENUID == 0 )); then + Menu_Main + elif (( $TARGETMENUID == 1 )); then + Menu_Set_Directory + fi done @@ -805,6 +863,6 @@ _EOF_ #delete[] array unset aSUPPORTED_FILESYSTEMS #----------------------------------------------------------------------------------- - exit + exit 0 #----------------------------------------------------------------------------------- } diff --git a/dietpi/dietpi-banner b/dietpi/dietpi-banner index df489eb89e..be00ab54c0 100644 --- a/dietpi/dietpi-banner +++ b/dietpi/dietpi-banner @@ -30,7 +30,7 @@ #///////////////////////////////////////////////////////////////////////////////////// #Globals #///////////////////////////////////////////////////////////////////////////////////// - DIETPI_VERSION=$(cat /DietPi/dietpi/.version) + DIETPI_VERSION="$(sed -n 1p /DietPi/dietpi/.version).$(sed -n 2p /DietPi/dietpi/.version)" IMAGE_ADDITIONAL_CREDITS=$(sed -n 8p /DietPi/dietpi/.hw_model) IP_ADDRESS=$(sed -n 4p /DietPi/dietpi/.network) @@ -45,7 +45,7 @@ Hardware_Model_Print(){ - echo -e " \e[39;49;1mV$DIETPI_VERSION\e[0m \e[90m| $G_HW_MODEL_DESCRIPTION\e[0m\n \e[38;5;154m───────────────────────────────────────\e[0m" + echo -e " \e[39;49;1mv$DIETPI_VERSION\e[0m \e[90m| $G_HW_MODEL_DESCRIPTION\e[0m\n \e[38;5;154m───────────────────────────────────────\e[0m" } @@ -65,7 +65,7 @@ #///////////////////////////////////////////////////////////////////////////////////// #Top section additional Text. Update available / MOTD etc #///////////////////////////////////////////////////////////////////////////////////// - TEXT_TOP="" + TEXT_TOP='' UPDATE_AVAILABLE=0 #///////////////////////////////////////////////////////////////////////////////////// @@ -78,10 +78,14 @@ UPDATE_AVAILABLE=$(cat /DietPi/dietpi/.update_available) - if (( $UPDATE_AVAILABLE > 0 )); then - TEXT_TOP="\e[90m|\e[0m \e[91m\e[33;49;1mUpdate available\e[0m" - elif (( $UPDATE_AVAILABLE == -1 )); then + if [ "$UPDATE_AVAILABLE" = '-1' ]; then + TEXT_TOP="\e[90m|\e[0m \e[91m\e[33;49;1mImage available\e[0m" + + else + + TEXT_TOP="\e[90m|\e[0m \e[91m\e[33;49;1mUpdate available\e[0m" + fi #Use TEXT_TOP for storing helpful info @@ -107,7 +111,8 @@ } Credits_Print(){ - echo -e "" + + echo -e '' echo -e "\e[90m Created by : Daniel Knight\e[0m" echo -e "\e[90m Web : http://DietPi.com\e[0m" echo -e "\e[90m Twitter : http://twitter.com/dietpi_\e[0m" @@ -115,38 +120,54 @@ if [ -n "$IMAGE_ADDITIONAL_CREDITS" ]; then - echo -e "" + echo -e '' echo -e "\e[90m Device image possible thanks to: $IMAGE_ADDITIONAL_CREDITS\e[0m" fi echo -e "\e[90m DietPi's web hosting is powered by: MyVirtualServer.com\e[0m" - echo -e "" + echo -e '' echo -e "\e[1m dietpi-launcher\e[0m = All the DietPi programs in one place." echo -e "\e[1m dietpi-config\e[0m = Feature rich configuration tool for your device." echo -e "\e[1m dietpi-software\e[0m = Select optimized software for installation." - #Update available - if (( $UPDATE_AVAILABLE > 0 )); then - echo -e "\e[1m dietpi-update\e[0m = \e[91mRun now to update DietPi (from V$DIETPI_VERSION to V$UPDATE_AVAILABLE).\e[0m" - elif (( $UPDATE_AVAILABLE == -1 )); then - echo -e "\n\e[91m An updated DietPi image is available, please goto:\e[0m\n http://dietpi.com/phpbb/viewtopic.php?f=8&t=9#p9\n" + + #Update available? + if [ -n "$UPDATE_AVAILABLE" ]; then + + if [ "$UPDATE_AVAILABLE" = '-1' ]; then + + echo -e "\n\e[91m An updated DietPi image is available, please goto:\e[0m\n http://dietpi.com/download\n" + + else + + echo -e "\e[1m dietpi-update\e[0m = \e[91mRun now to update DietPi (from v$DIETPI_VERSION to v$UPDATE_AVAILABLE).\e[0m" + + fi + fi + echo -e "\e[1m htop\e[0m = Resource monitor." echo -e "\e[1m cpu\e[0m = Shows CPU information and stats." - echo -e "" + echo -e '' + } #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// if (( $INPUT == 0 )); then + Banner_TopText_Extras Banner_Dietpi elif (( $INPUT == 1 )); then + Banner_TopText_Extras Banner_Dietpi Credits_Print + fi #----------------------------------------------------------------------------------- + exit 0 + #----------------------------------------------------------------------------------- diff --git a/dietpi/dietpi-bugreport b/dietpi/dietpi-bugreport index 17b6d44775..e63b59f00f 100644 --- a/dietpi/dietpi-bugreport +++ b/dietpi/dietpi-bugreport @@ -371,6 +371,7 @@ _EOF_ rm -R "$FILEPATH_TEMP" &> /dev/null #----------------------------------------------------------------------------------- - exit + exit 0 #----------------------------------------------------------------------------------- + } diff --git a/dietpi/dietpi-cloudshell b/dietpi/dietpi-cloudshell index d78d0fe0c8..dea9273398 100644 --- a/dietpi/dietpi-cloudshell +++ b/dietpi/dietpi-cloudshell @@ -534,13 +534,13 @@ #DietPi DIETPI_VERSION_CURRENT=0 DIETPI_UPDATE_AVAILABLE=0 - DIETPI_WEBSITE="dietpi.com" + DIETPI_WEBSITE='dietpi.com' DIETPI_TWITTER="@dietpi_" DIETPI_HW_DESCRIPTION="N/A" Obtain_DIETPIINFO(){ #DietPi version - DIETPI_VERSION_CURRENT="${aCOLOUR[2]}$(cat /DietPi/dietpi/.version)$C_RESET" + DIETPI_VERSION_CURRENT="${aCOLOUR[2]}$(sed -n 1p /DietPi/dietpi/.version).$(sed -n 2p /DietPi/dietpi/.version)$C_RESET" #Current HW DIETPI_HW_DESCRIPTION=$(sed -n 2p /DietPi/dietpi/.hw_model) @@ -550,22 +550,25 @@ if [ -f /DietPi/dietpi/.update_available ]; then #Set current version to red - DIETPI_VERSION_CURRENT="${aCOLOUR[1]}$(cat /DietPi/dietpi/.version)$C_RESET" + DIETPI_VERSION_CURRENT="${aCOLOUR[1]}$(sed -n 1p /DietPi/dietpi/.version).$(sed -n 2p /DietPi/dietpi/.version)$C_RESET" local update_version=$(cat /DietPi/dietpi/.update_available) - if (( $update_version > 0 )); then - DIETPI_UPDATE_AVAILABLE="${aCOLOUR[2]}$update_version$C_RESET" + if [ "$update_version" = '-1' ]; then - elif (( $update_version == -1 )); then DIETPI_UPDATE_AVAILABLE="${aCOLOUR[2]}New Image$C_RESET" + + else + + DIETPI_UPDATE_AVAILABLE="${aCOLOUR[2]}$update_version$C_RESET" + fi - fi + fi } #Network Details - NETWORK_DETAILS_ADAPTER="eth0" + NETWORK_DETAILS_ADAPTER='eth0' NETWORK_DETAILS_IP_INT=0 NETWORK_DETAILS_MAC_ADDRESS=0 NETWORK_DETAILS_SIGNAL_STRENGTH=0 diff --git a/dietpi/dietpi-survey b/dietpi/dietpi-survey index d71062f11b..acd4576bd9 100644 --- a/dietpi/dietpi-survey +++ b/dietpi/dietpi-survey @@ -28,12 +28,12 @@ export G_PROGRAM_NAME='DietPi-Survey' #Import DietPi-Globals --------------------------------------------------------------- - SURVEY_VERSION=3 + SURVEY_VERSION=4 SURVEY_SENTCOUNT=1 OPTED_IN=1 - DIETPI_VERSION=$(cat /DietPi/dietpi/.version) + DIETPI_VERSION="$(sed -n 1p /DietPi/dietpi/.version).$(sed -n 2p /DietPi/dietpi/.version)" G_HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model) UNIQUE_ID=$(sed -n 5p /DietPi/dietpi/.hw_model) @@ -66,11 +66,14 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// #Read data from .dietpi-survey file if [ -f "$FP_SETTINGS" ]; then + Read_Settings #Create new file + generate UUID else + Write_Settings + fi #----------------------------------------------------------------------------------- @@ -94,15 +97,15 @@ _EOF_ cat << _EOF_ > "$FILENAME_FORMAT" ------------------------- -DietPi-Survey V$SURVEY_VERSION +DietPi-Survey v$SURVEY_VERSION ------------------------- Upload Count : $SURVEY_SENTCOUNT -DietPi Version : $(cat /DietPi/dietpi/.version) +DietPi Version : $DIETPI_VERSION Mac Address : $( ifconfig -a | grep -m1 "$active_network_adapter" | awk '{print $NF}' | sed 's/://g') -Hardware Index : $(sed -n 1p /DietPi/dietpi/.hw_model) -Hardware Name : $(sed -n 2p /DietPi/dietpi/.hw_model) -Distro Index : $(sed -n 3p /DietPi/dietpi/.hw_model) +Hardware Index : $G_HW_MODEL +Hardware Name : $G_HW_MODEL_DESCRIPTION +Distro Index : $G_DISTRO Autoboot Index : $(cat /DietPi/dietpi/.dietpi-autostart_index) Country : $(curl --max-time 4 -s http://whatismycountry.com/ | sed -n 's|.*,\(.*\)|\1|p') Hostname : $(cat /etc/hostname) @@ -110,7 +113,7 @@ Hostname : $(cat /etc/hostname) ------------------------- DietPi-Software Installed ------------------------- -$(cat /DietPi/dietpi/.installed) +$(cat /DietPi/dietpi/.installed | grep ' =2 ') ------------------------- FileSystem @@ -132,6 +135,6 @@ _EOF_ fi #----------------------------------------------------------------------------------- - exit + exit 0 #----------------------------------------------------------------------------------- } \ No newline at end of file diff --git a/dietpi/dietpi-sync b/dietpi/dietpi-sync index 93ea9c60fa..0cfbcced02 100644 --- a/dietpi/dietpi-sync +++ b/dietpi/dietpi-sync @@ -40,40 +40,48 @@ TARGETMENUID=0 FTP_MOUNT_AVAILABLE=0 - FTP_MOUNT_TEXT="Not available" + FTP_MOUNT_TEXT='Not available' SAMBA_MOUNT_AVAILABLE=0 - SAMBA_MOUNT_TEXT="Not available" + SAMBA_MOUNT_TEXT='Not available' SYNC_DRY_RUN=0 - SYNC_MODE_TEXT="Disabled" - SYNC_COMPRESSION_TEXT="Disabled" - SYNC_CRONDAILY_TEXT="Disabled" + SYNC_MODE_TEXT='Disabled' + SYNC_COMPRESSION_TEXT='Disabled' + SYNC_CRONDAILY_TEXT='Disabled' #TARGETMENUID=0 Menu_Main(){ - SYNC_MODE_TEXT="Disabled" + SYNC_MODE_TEXT='Disabled' if (( $SYNC_DELETE_MODE == 1 )); then - SYNC_MODE_TEXT="Enabled" + + SYNC_MODE_TEXT='Enabled' + fi - SYNC_COMPRESSION_TEXT="Disabled" + SYNC_COMPRESSION_TEXT='Disabled' if (( $SYNC_COMPRESSION == 1 )); then - SYNC_COMPRESSION_TEXT="Enabled" + + SYNC_COMPRESSION_TEXT='Enabled' + fi - SYNC_CRONDAILY_TEXT="Disabled" + SYNC_CRONDAILY_TEXT='Disabled' if (( $SYNC_CRONDAILY == 1 )); then - SYNC_CRONDAILY_TEXT="Enabled" + + SYNC_CRONDAILY_TEXT='Enabled' + fi local sync_last_completed='No previous sync found in target directory.' if [ -f "$FP_TARGET/$SYNC_STATS_FILENAME" ]; then + sync_last_completed=$(grep '^Sync completed' "$FP_TARGET/$SYNC_STATS_FILENAME" | tail -1 | awk '{print $3}') + fi - WHIP_TITLE='- DietPi-Sync -' + WHIP_TITLE='DietPi-Sync' OPTION=$(whiptail --title "$WHIP_TITLE" --menu "Source location:\n $FP_SOURCE\n\nTarget location:\n $FP_TARGET\n\nMost recent successful sync date:\n $sync_last_completed" --cancel-button "Exit" --backtitle "$WHIP_BACKTITLE" 23 73 8 \ "Help" "What does DietPi-Sync do?" \ "Source Location" "Change the Source directory." \ @@ -89,45 +97,75 @@ case "$OPTION" in "Source Location") + TARGETMENUID=2 + ;; + "Target Location") + TARGETMENUID=1 + ;; + Help) + whiptail --title "DietPi-Sync Help" --msgbox "DietPi-Sync is a program that allows you to duplicate a directory from one location (Source) to another (Target).\n\nFor example: If we want to duplicate (sync) the data on our external USB HDD to another location, we simply select the USB HDD as the source, then, select a target location. The target location can be anything from a networked samba fileserver, or even a FTP server.\n\nIf you would like to test a sync without modifiying any data, simply select Dry Run.\n\nMore information:\n - http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=256#p256" --backtitle "$WHIP_BACKTITLE" 19 75 + ;; + "Delete Mode") + TARGETMENUID=3 + ;; + Compression) + TARGETMENUID=4 + ;; + "Sync: Daily") + TARGETMENUID=5 + ;; + "Sync: Dry Run") + WHIP_TITLE=' Test Dry Run Sync? ' whiptail --title "$WHIP_TITLE" --yesno "Source location:\n$FP_SOURCE/*\n\nTarget location:\n$FP_TARGET/*\n\nThis is a Dry Run for testing. No data will be modified.\n\nDo you wish to continue?" --yes-button "Ok" --no-button "Back" --defaultno --backtitle "$WHIP_BACKTITLE" 16 72 CHOICE=$? if (( $CHOICE == 0 )); then + SYNC_DRY_RUN=1 Run_Sync + fi + ;; + "Sync: Now") + WHIP_TITLE=' Start Sync? ' whiptail --title "$WHIP_TITLE" --yesno "Source location:\n$FP_SOURCE/*\n\nTarget location:\n$FP_TARGET/*\n\nA copy of all the files and folders inside your Source location, will be created at the Target location.\n\nDo you wish to continue?" --yes-button "Ok" --no-button "Back" --defaultno --backtitle "$WHIP_BACKTITLE" 16 72 CHOICE=$? if (( $CHOICE == 0 )); then + SYNC_DRY_RUN=0 Run_Sync + fi + ;; + esac else + Menu_Exit + fi } @@ -140,7 +178,9 @@ #Exit if (( $CHOICE == 0 )); then + TARGETMENUID=-1 + fi } @@ -156,10 +196,12 @@ local whip_description_text="Please select the $current_mode_text location.\nA copy of all the files and folders in the Source location will be created here.\n\nCurrent Target location:\n$FP_TARGET" WHIP_TITLE='Select your Sync Target location' if (( $TARGETMENUID == 2 )); then + current_directory="$FP_SOURCE" current_mode_text="Source" whip_description_text="Please select the $current_mode_text location.\nA copy of all the files and folder in this Source location, will be created at the Target location.\n\nCurrent Source location:\n$FP_SOURCE" WHIP_TITLE='Select your Sync Source location' + fi Check_Available_DietPi_Mounts @@ -203,41 +245,71 @@ ;; "Samba Client") if (( $SAMBA_MOUNT_AVAILABLE == 1 )); then + if (( $TARGETMENUID == 2 )); then + FP_SOURCE="$FP_SAMBA_MOUNT" + else + FP_TARGET="$FP_SAMBA_MOUNT/dietpi-sync" + fi + else + Prompt_Setup_Samba_Mount if (( $TARGETMENUID == 2 )); then + FP_SOURCE="$current_directory" + else + FP_TARGET="$current_directory" + fi + fi + ;; + "FTP Client") if (( $FTP_MOUNT_AVAILABLE == 1 )); then + if (( $TARGETMENUID == 2 )); then + FP_SOURCE="$FP_FTP_MOUNT" + else + FP_TARGET="$FP_FTP_MOUNT/dietpi-sync" + fi + else + Prompt_Setup_FTP_Mount if (( $TARGETMENUID == 2 )); then + FP_SOURCE="$current_directory" + else + FP_TARGET="$current_directory" + fi + fi + ;; + esac else + #Return to main menu TARGETMENUID=0 + fi } @@ -254,12 +326,19 @@ if (( $CHOICE == 0 )); then case "$OPTION" in + Disabled) + SYNC_DELETE_MODE=0 + ;; + Enabled) + SYNC_DELETE_MODE=1 + ;; + esac fi @@ -281,12 +360,19 @@ if (( $CHOICE == 0 )); then case "$OPTION" in + Disabled) + SYNC_COMPRESSION=0 + ;; + Enabled) + SYNC_COMPRESSION=1 + ;; + esac fi @@ -308,12 +394,19 @@ if (( $CHOICE == 0 )); then case "$OPTION" in + Disabled) + SYNC_CRONDAILY=0 + ;; + Enabled) + SYNC_CRONDAILY=1 + ;; + esac fi @@ -330,19 +423,26 @@ #Target if (( $TARGETMENUID == 1 )); then + OPTION=$(whiptail --inputbox "Please enter the filepath to your Target directory. \neg: /mnt/target" 8 70 "$FP_TARGET" --title "Manual sync directory" --backtitle "$WHIP_BACKTITLE" 3>&1 1>&2 2>&3) CHOICE=$? if (( $CHOICE == 0 )); then + FP_TARGET="$OPTION" + fi #Source elif (( $TARGETMENUID == 2 )); then + OPTION=$(whiptail --inputbox "Please enter the filepath to your Source directory. \neg: /mnt/source" 8 70 "$FP_SOURCE" --title "Manual sync directory" --backtitle "$WHIP_BACKTITLE" 3>&1 1>&2 2>&3) CHOICE=$? if (( $CHOICE == 0 )); then + FP_SOURCE="$OPTION" + fi + fi } @@ -352,8 +452,10 @@ whiptail --title "Not available. Setup Now?" --yesno "$SAMBA_MOUNT_TEXT\n\nWould you like to run DietPi-Config and setup your Samba Client Mount now?" --yes-button "Ok" --no-button "Back" --defaultno --backtitle "$WHIP_BACKTITLE" 11 70 CHOICE=$? if (( $CHOICE == 0 )); then + #Run configure /DietPi/dietpi/dietpi-config 16 1 + fi } @@ -363,8 +465,10 @@ whiptail --title "Not available. Setup Now?" --yesno "$FTP_MOUNT_TEXT\n\nWould you like to run DietPi-Config and setup your FTP Client Mount now?" --yes-button "Ok" --no-button "Back" --defaultno --backtitle "$WHIP_BACKTITLE" 11 70 CHOICE=$? if (( $CHOICE == 0 )); then + #Run configure /DietPi/dietpi/dietpi-config 16 1 + fi } @@ -468,7 +572,9 @@ local mode='Sync' #Dry Run? if (( $SYNC_DRY_RUN == 1 )); then + mode='Dry Run' + fi G_DIETPI-NOTIFY 3 DietPi-Sync "$mode" @@ -522,17 +628,23 @@ #Compression? if (( $SYNC_COMPRESSION == 1 )); then + rync_options+="z" + fi #Dry Run? if (( $SYNC_DRY_RUN == 1 )); then + rync_options+="n" + fi #Delete mode? if (( $SYNC_DELETE_MODE == 1 )); then + rync_options+=" --delete" + fi #Write new logfile @@ -608,16 +720,20 @@ SAMBA_MOUNT_AVAILABLE=0 SAMBA_MOUNT_TEXT="Not mounted ($FP_SAMBA_MOUNT). Select to setup." if (( $(cat "$temp_file_mounts" | grep -ci -m1 "/mnt/samba") == 1 )); then + SAMBA_MOUNT_AVAILABLE=1 SAMBA_MOUNT_TEXT="Size: $(df -h | grep /mnt/samba | awk '{print $2}')B | Available: $(df -h | grep /mnt/samba | awk '{print $4}')B" + fi #FTP Client FTP_MOUNT_AVAILABLE=0 FTP_MOUNT_TEXT="Not mounted ($FP_FTP_MOUNT). Select to setup." if (( $(cat "$temp_file_mounts" | grep -ci -m1 "/mnt/ftp_client") == 1 )); then + FTP_MOUNT_AVAILABLE=1 FTP_MOUNT_TEXT="Mounted and online." + fi rm "$temp_file_mounts" @@ -645,12 +761,14 @@ Read_Settings_File(){ if [ -f "$FP_DIETPISYNC_SETTINGS" ]; then + local sed_index=1 FP_SOURCE=$(sed -n "$sed_index"p "$FP_DIETPISYNC_SETTINGS");((sed_index++)) FP_TARGET=$(sed -n "$sed_index"p "$FP_DIETPISYNC_SETTINGS");((sed_index++)) SYNC_DELETE_MODE=$(sed -n "$sed_index"p "$FP_DIETPISYNC_SETTINGS");((sed_index++)) SYNC_COMPRESSION=$(sed -n "$sed_index"p "$FP_DIETPISYNC_SETTINGS");((sed_index++)) SYNC_CRONDAILY=$(sed -n "$sed_index"p "$FP_DIETPISYNC_SETTINGS");((sed_index++)) + fi } @@ -681,16 +799,26 @@ clear if (( $TARGETMENUID == 0 )); then + Menu_Main + elif (( $TARGETMENUID == 1 )) || (( $TARGETMENUID == 2 )); then + Menu_Set_Directories + elif (( $TARGETMENUID == 3 )); then + Menu_Set_Sync_Delete_Mode + elif (( $TARGETMENUID == 4 )); then + Menu_Set_Compression + elif (( $TARGETMENUID == 5 )); then + Menu_Set_CronDaily + fi done @@ -705,6 +833,7 @@ rm "$FP_INCLUDE_GLOBAL" &> /dev/null rm "$FP_EXCLUDE_GLOBAL" &> /dev/null #----------------------------------------------------------------------------------- - exit + exit 0 #----------------------------------------------------------------------------------- -} \ No newline at end of file + +} diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 30e81965c3..541f2f6bff 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -43,8 +43,7 @@ #UPDATE Vars #///////////////////////////////////////////////////////////////////////////////////// FP_LOG='/var/tmp/dietpi/logs/dietpi-update.log' - DIETPIUPDATE_VERSION_CURRENT=5 # Version of dietpi-update / set server_version line two to value++ and obsolete previous dietpi-update scripts - DIETPIUPDATE_VERSION_REQUIRED=0 + DIETPIUPDATE_COREVERSION_CURRENT=6 # Version of dietpi-update / set server_version-6 line one to value++ and obsolete previous dietpi-update scripts FILEPATH_TEMP="/tmp/dietpi-update" @@ -53,14 +52,17 @@ UPDATE_REQUIRESNEWIMAGE=0 RUN_UPDATE=0 - VERSION_CURRENT=0 - VERSION_SERVER=0 + COREVERSION_CURRENT=0 + SUBVERSION_CURRENT=0 + + COREVERSION_SERVER=0 + SUBVERSION_SERVER=0 URL_MIRROR_INDEX=0 URL_MIRROR_SERVERVERSION=( - "http://dietpi.com/downloads/dietpi-update_mirror/$GITBRANCH/server_version" - "https://raw.githubusercontent.com/${GITFORKOWNER:-Fourdee}/DietPi/$GITBRANCH/dietpi/server_version" + "http://dietpi.com/downloads/dietpi-update_mirror/$GITBRANCH/server_version-6" + "https://raw.githubusercontent.com/${GITFORKOWNER:-Fourdee}/DietPi/$GITBRANCH/dietpi/server_version-6" ) @@ -73,7 +75,8 @@ Get_Client_Version(){ - VERSION_CURRENT=$(cat /DietPi/dietpi/.version) + COREVERSION_CURRENT=$(sed -n 1p /DietPi/dietpi/.version) + SUBVERSION_CURRENT=$(sed -n 2p /DietPi/dietpi/.version) } @@ -90,11 +93,11 @@ if (( $? == 0 )); then #Get server Version info - VERSION_SERVER=$(sed -n 1p "$FILEPATH_TEMP"/server_version) - DIETPIUPDATE_VERSION_REQUIRED=$(sed -n 2p "$FILEPATH_TEMP"/server_version) + COREVERSION_SERVER=$(sed -n 1p "$FILEPATH_TEMP"/server_version) + SUBVERSION_SERVER=$(sed -n 2p "$FILEPATH_TEMP"/server_version) #Check if server_version is a valid interger. - if [[ $VERSION_SERVER =~ ^-?[0-9]+$ ]]; then + if [[ $SUBVERSION_SERVER =~ ^-?[0-9]+$ ]]; then SERVER_ONLINE=1 G_DIETPI-NOTIFY 0 "Using update server: ${URL_MIRROR_SERVERVERSION[$i]}" @@ -114,6 +117,7 @@ fi done + } Check_Update_Available(){ @@ -125,29 +129,31 @@ if (( $SERVER_ONLINE )); then #Update Requires new image? - if (( $DIETPIUPDATE_VERSION_CURRENT < $DIETPIUPDATE_VERSION_REQUIRED )); then + if (( $DIETPIUPDATE_COREVERSION_CURRENT < $COREVERSION_SERVER )); then UPDATE_REQUIRESNEWIMAGE=1 echo -e "-1" > /DietPi/dietpi/.update_available #Update available - elif (( $VERSION_CURRENT < $VERSION_SERVER )); then + elif (( $SUBVERSION_CURRENT < $SUBVERSION_SERVER )); then UPDATE_AVAILABLE=1 echo -e "" G_DIETPI-NOTIFY 0 "Update available" - G_DIETPI-NOTIFY 2 "Current Version : $VERSION_CURRENT" - G_DIETPI-NOTIFY 2 "Server Version : $VERSION_SERVER" + G_DIETPI-NOTIFY 2 "Current Version : $COREVERSION_CURRENT.$SUBVERSION_CURRENT" + G_DIETPI-NOTIFY 2 "Server Version : $COREVERSION_SERVER.$SUBVERSION_SERVER" #Write update available version to file. - echo -e "$VERSION_SERVER" > /DietPi/dietpi/.update_available + cat << _EOF_ > /DietPi/dietpi/.update_available +$COREVERSION_SERVER.$SUBVERSION_SERVER +_EOF_ fi else G_DIETPI-NOTIFY 1 "Unable to access update servers. Please check your connection, then run dietpi-update again." - exit + exit 1 fi @@ -156,7 +162,7 @@ #///////////////////////////////////////////////////////////////////////////////////// # MENUS #///////////////////////////////////////////////////////////////////////////////////// - WHIP_BACKTITLE='- DietPi-Update -' + WHIP_BACKTITLE='DietPi-Update' WHIP_TITLE=$WHIP_BACKTITLE CHOICE=0 OPTION=0 @@ -164,8 +170,8 @@ Menu_Update(){ whiptail --title "$WHIP_TITLE" --yesno "Update available : https://goo.gl/G9ikqn -Installed version : $VERSION_CURRENT -Latest version : $VERSION_SERVER +Installed version : $COREVERSION_CURRENT.$SUBVERSION_CURRENT +Latest version : $COREVERSION_SERVER.$SUBVERSION_SERVER ---------------------------------Notice------------------------------------- The benefit of DietPi is we use standard linux configurations and commands. The downside is we can't possibly accommodate or predict, every modifcation to Linux configurations files by the end user, during the update. @@ -176,7 +182,7 @@ You can create a system backup, by running: - dietpi-backup ---------------------------------------------------------------------------- -Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok" --no-button "Exit" --defaultno --backtitle "$WHIP_BACKTITLE" 24 80 +Do you wish to continue and update DietPi to v$COREVERSION_SERVER.$SUBVERSION_SERVER?" --yes-button "Ok" --no-button "Exit" --defaultno --backtitle "$WHIP_BACKTITLE" 24 80 CHOICE=$? if (( $CHOICE == 0 )); then @@ -216,21 +222,24 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok /DietPi/dietpi/func/dietpi-set_software verify_dietpi.txt #Run Patch file - while (( $VERSION_CURRENT < $VERSION_SERVER )); do + while (( $SUBVERSION_CURRENT < $SUBVERSION_SERVER )); do - G_DIETPI-NOTIFY 3 DietPi-Update "Updating DietPi" - G_DIETPI-NOTIFY 2 "Current Version : $VERSION_CURRENT" - G_DIETPI-NOTIFY 2 "Server Version : $VERSION_SERVER\n" + G_DIETPI-NOTIFY 3 'DietPi-Update Updating DietPi' + G_DIETPI-NOTIFY 2 "Current Version : $COREVERSION_CURRENT.$SUBVERSION_CURRENT" + G_DIETPI-NOTIFY 2 "Server Version : $COREVERSION_SERVER.$SUBVERSION_SERVER\n" #Run patch file - G_DIETPI-NOTIFY 2 "Patching $VERSION_CURRENT to $(( $VERSION_CURRENT + 1 ))" - /DietPi/dietpi/patch_file "$VERSION_CURRENT" "$VERSION_SERVER" + G_DIETPI-NOTIFY 2 "Patching $COREVERSION_CURRENT.$SUBVERSION_CURRENT to $COREVERSION_CURRENT.$(( $SUBVERSION_CURRENT + 1 ))" + /DietPi/dietpi/patch_file $SUBVERSION_CURRENT $SUBVERSION_SERVER #Update Local Version ID - ((VERSION_CURRENT++)) - echo -e "$VERSION_CURRENT" > /DietPi/dietpi/.version + ((SUBVERSION_CURRENT++)) + cat << _EOF_ > /DietPi/dietpi/.version +$COREVERSION_CURRENT +$SUBVERSION_CURRENT +_EOF_ - G_DIETPI-NOTIFY 0 "Patch $VERSION_CURRENT completed\n" + G_DIETPI-NOTIFY 0 "Patch $COREVERSION_CURRENT.$SUBVERSION_CURRENT completed\n" Get_Client_Version @@ -247,7 +256,7 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok else G_DIETPI-NOTIFY 1 "Download failed, unable to run update. Please try running dietpi-update again." - exit + exit 1 fi @@ -258,7 +267,7 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok #///////////////////////////////////////////////////////////////////////////////////// #---------------------------------------------------------------- #Inform user - G_DIETPI-NOTIFY 3 DietPi-Update "Checking for DietPi updates" + G_DIETPI-NOTIFY 3 'DietPi-Update Checking for DietPi updates' #---------------------------------------------------------------- #Create temp directory used in dietpi-update rm -R "$FILEPATH_TEMP" &> /dev/null @@ -290,10 +299,10 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok elif (( $UPDATE_REQUIRESNEWIMAGE == 1 )); then #Cannot update, Image required - whiptail --title "New image required" --msgbox " Your version of DietPi is now obsolete and cannot be updated. \n\n Please download the latest DietPi image:\n - http://dietpi.com/downloads/images \n\n - Current Version : $VERSION_CURRENT \n - Server Version : $VERSION_SERVER \n " 13 70 + whiptail --title "New image required" --msgbox " Your version of DietPi is now obsolete and cannot be updated. \n\n Please download the latest DietPi image:\n - http://dietpi.com/downloads/images \n\n - Current Version : $SUBVERSION_CURRENT \n - Server Version : $SUBVERSION_SERVER \n " 13 70 G_DIETPI-NOTIFY 1 "Your version of DietPi is now obsolete and cannot be updated." - echo -e "Please download the latest DietPi image:\n - http://dietpi.com/download \n\n - Current Version : $VERSION_CURRENT \n - Server Version : $VERSION_SERVER \n " + echo -e "Please download the latest DietPi image:\n - http://dietpi.com/download \n\n - Current Version : $SUBVERSION_CURRENT \n - Server Version : $SUBVERSION_SERVER \n " #Update available elif (( $UPDATE_AVAILABLE == 1 )); then @@ -308,8 +317,8 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok elif (( $INPUT == 1 )); then G_DIETPI-NOTIFY 0 "Updates have been found and are being applied, please wait..." - G_DIETPI-NOTIFY 2 "Current Version : $VERSION_CURRENT" - G_DIETPI-NOTIFY 2 "Server Version : $VERSION_SERVER" + G_DIETPI-NOTIFY 2 "Current Version : $COREVERSION_CURRENT.$SUBVERSION_CURRENT" + G_DIETPI-NOTIFY 2 "Server Version : $COREVERSION_SERVER.$SUBVERSION_SERVER" /DietPi/dietpi/dietpi-funtime 0 @@ -327,8 +336,8 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok echo -e "" G_DIETPI-NOTIFY 0 "No updates required, your DietPi installation is up to date.\n" - G_DIETPI-NOTIFY 2 "Current Version : $VERSION_CURRENT" - G_DIETPI-NOTIFY 2 "Server Version : $VERSION_SERVER" + G_DIETPI-NOTIFY 2 "Current Version : $COREVERSION_CURRENT.$SUBVERSION_CURRENT" + G_DIETPI-NOTIFY 2 "Server Version : $COREVERSION_SERVER.$SUBVERSION_SERVER" sleep 2 fi @@ -365,8 +374,8 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok #Done G_DIETPI-NOTIFY 3 DietPi-Update "Completed" - G_DIETPI-NOTIFY 2 "Current Version : $VERSION_CURRENT" - G_DIETPI-NOTIFY 2 "Server Version : $VERSION_SERVER" + G_DIETPI-NOTIFY 2 "Current Version : $COREVERSION_CURRENT.$SUBVERSION_CURRENT" + G_DIETPI-NOTIFY 2 "Server Version : $COREVERSION_SERVER.$SUBVERSION_SERVER" G_DIETPI-NOTIFY 0 "Update completed" echo -e "" echo -e "Please reboot your system now, using the command \e[31;49;1mreboot\e[0m" @@ -390,6 +399,6 @@ Do you wish to continue and update DietPi to v$VERSION_SERVER?" --yes-button "Ok unset URL_MIRROR_SERVERVERSION unset URL_MIRROR_ZIP #---------------------------------------------------------------- - exit + exit 0 #---------------------------------------------------------------- } diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 9cf7e8d295..36d8139aa2 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -246,7 +246,7 @@ #Error else - local print_hw_info="VERSION:v$(cat /DietPi/dietpi/.version) | HW_MODEL:$G_HW_MODEL | HW_ARCH:$G_HW_ARCH | DISTRO:$G_DISTRO" + local print_hw_info="VERSION:v$(sed -n 1p /DietPi/dietpi/.version).$(sed -n 2p /DietPi/dietpi/.version) | HW_MODEL:$G_HW_MODEL | HW_ARCH:$G_HW_ARCH | DISTRO:$G_DISTRO" local print_exitcode_info="exit_code = $G_ERROR_HANDLER_EXITCODE" local print_logfile_info="Log file contents:\n$(tail -50 $G_ERROR_HANDLER_ONERROR_FPLOGFILE)" local print_report_to_dietpi_info='If problems persist, please report this to DietPi for investigation, including a screenshot of this error! (https://github.com/Fourdee/DietPi/issues).' @@ -355,7 +355,7 @@ \e[0m \e[44m #### Required Information: -- DietPi Version | v$(cat /DietPi/dietpi/.version) +- DietPi Version | v$(sed -n 1p /DietPi/dietpi/.version).$(sed -n 2p /DietPi/dietpi/.version) - SBC Device | $G_HW_MODEL_DESCRIPTION (index=$G_HW_MODEL) - Distro | $G_DISTRO_NAME (index=$G_DISTRO) - Command | $G_ERROR_HANDLER_COMMAND diff --git a/dietpi/patch_file b/dietpi/patch_file index db73ca0284..f473f29c7e 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -13,12 +13,12 @@ # - Runs from dietpi-update # # Usage: - # - /DietPi/dietpi/patch_file iCurrentVersion iServerVersion + # - /DietPi/dietpi/patch_file $SUBVERSION_CURRENT $SUBVERSION_SERVER #//////////////////////////////////// #Grab input - VERSION_CURRENT=$1 - VERSION_SERVER=$2 + SUBVERSION_CURRENT=$1 + SUBVERSION_SERVER=$2 #Import DietPi-Globals --------------------------------------------------------------- /DietPi/dietpi/dietpi-obtain_hw_model # Always update @@ -43,2966 +43,47 @@ fi - FP_EMR='/DietPi/dietpi/.patch_emr' - EMR_INDEX=0 + # FP_EMR='/DietPi/dietpi/.patch_emr' + # EMR_INDEX=0 - Obtain_EMR_Index(){ + # Obtain_EMR_Index(){ - if [ ! -f "$FP_EMR" ]; then + # if [ ! -f "$FP_EMR" ]; then - echo 0 > "$FP_EMR" + # echo 0 > "$FP_EMR" - else + # else - EMR_INDEX=$(cat "$FP_EMR") + # EMR_INDEX=$(cat "$FP_EMR") - fi + # fi - } + # } - Update_EMR_Index(){ + # Update_EMR_Index(){ - ((EMR_INDEX++)) - echo $EMR_INDEX > "$FP_EMR" + # ((EMR_INDEX++)) + # echo $EMR_INDEX > "$FP_EMR" - } + # } #///////////////////////////////////////////////////////////////////////////////////// #Emergency Patch System: # This runs before all standard incremental patches. Useful for when shi* hits the ... + # Obtain_EMR_Index - Obtain_EMR_Index + # if (( $EMR_INDEX == 0 )); then - # - https://github.com/Fourdee/DietPi/issues/669 - # deb security repo now has a forced https redirect, which requires apt-transport-https to be installed, but is only installable from deb security repo........ - if (( $EMR_INDEX == 0 )); then - - if (( ! $(dpkg --get-selections | grep -ci -m1 '^apt-transport-https') )); then - - G_AGI apt-transport-https - if (( $? != 0 )); then - - # - armv7 - if (( $G_HW_ARCH == 2 )); then - - INSTALL_URL='http://security.debian.org/debian-security/pool/updates/main/c/curl/libcurl3-gnutls_7.38.0-4+deb8u5_armhf.deb' - - # - arm64 - elif (( $G_HW_ARCH == 3 )); then - - INSTALL_URL='http://security.debian.org/debian-security/pool/updates/main/c/curl/libcurl3-gnutls_7.38.0-4+deb8u5_arm64.deb' - - # - x86_64 - elif (( $G_HW_ARCH == 10 )); then - - INSTALL_URL='http://security.debian.org/debian-security/pool/updates/main/c/curl/libcurl3-gnutls_7.38.0-4+deb8u5_amd64.deb' - - fi - - wget "$INSTALL_URL" -O package.deb - dpkg -i package.deb - rm package.deb - - # - armv7 - if (( $G_HW_ARCH == 2 )); then - - INSTALL_URL='http://security.debian.org/debian-security/pool/updates/main/a/apt/libapt-pkg4.12_1.0.9.8.4_armhf.deb' - - # - arm64 - elif (( $G_HW_ARCH == 3 )); then - - INSTALL_URL='http://security.debian.org/debian-security/pool/updates/main/a/apt/libapt-pkg4.12_1.0.9.8.4_arm64.deb' - - # - x86_64 - elif (( $G_HW_ARCH == 10 )); then - - INSTALL_URL='http://security.debian.org/debian-security/pool/updates/main/a/apt/libapt-pkg4.12_1.0.9.8.4_amd64.deb' - - fi - - wget "$INSTALL_URL" -O package.deb - dpkg -i package.deb - rm package.deb - - # - armv7 - if (( $G_HW_ARCH == 2 )); then - - INSTALL_URL='http://security.debian.org/debian-security/pool/updates/main/a/apt/apt-transport-https_1.0.9.8.4_armhf.deb' - - # - arm64 - elif (( $G_HW_ARCH == 3 )); then - - INSTALL_URL='http://security.debian.org/debian-security/pool/updates/main/a/apt/apt-transport-https_1.0.9.8.4_arm64.deb' - - # - x86_64 - elif (( $G_HW_ARCH == 10 )); then - - INSTALL_URL='http://security.debian.org/debian-security/pool/updates/main/a/apt/apt-transport-https_1.0.9.8.4_amd64.deb' - - fi - - wget "$INSTALL_URL" -O package.deb - dpkg -i package.deb - rm package.deb - - fi - - fi - - Update_EMR_Index - - fi - - #Debian apt mirror fix: https://github.com/Fourdee/DietPi/issues/755 - if (( $EMR_INDEX == 1 )); then - - #------------------------------------------------------------------------------- - sed -i "s@debian.org/debian[[:space:]]@debian.org/debian/ @g" /etc/apt/sources.list - #------------------------------------------------------------------------------- - Update_EMR_Index - - fi - - #Placeholder - # if (( $EMR_INDEX == 2 )); then - - # Update_EMR_Index + # echo 0 # fi - #///////////////////////////////////////////////////////////////////////////////////// #Incremental patch system: + if (( $SUBVERSION_CURRENT == 0 )); then - if (( $VERSION_CURRENT == 102 )); then - #------------------------------------------------------------------------------- - #DNS fixes for STATIC. We MUST supply DNS servers if using STATIC, else /etc/resolv.conf will be empty. - # - Update curret network details - /DietPi/dietpi/func/obtain_network_details - # - Add missing disabled dns-nameservers to wlan. - sed -i "/wpa-psk /a #dns-nameservers 8.8.8.8 8.8.4.4" /etc/network/interfaces - # - If static IP is currently in use, enable google dns-nameservers. - active_network_adapter=$(sed -n 3p /DietPi/dietpi/.network) - if (( $( cat /etc/network/interfaces | grep -ci -m1 "iface $active_network_adapter inet static") == 1 )); then - sed -i 's/^#dns-nameservers/dns-nameservers/g' /etc/network/interfaces - fi - # - Delete 'Uncomment for Google DNS servers reference' - sed -i '/Uncomment for Google/d' /etc/network/interfaces - # - Add DNS entry to dietpi.txt - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'Static_DNS=') == 0 )); then - sed -i "/Static_Gateway=/a Static_DNS=8.8.8.8" /DietPi/dietpi.txt - fi - #------------------------------------------------------------------------------- - #Missing Resolvconf - /DietPi/dietpi/dietpi-apt-get_update 1 - G_AGI resolvconf - #------------------------------------------------------------------------------- - #New Bash Alias's - if (( $(cat /etc/bash.bashrc | grep -ci -m1 'dietpi-autostart=') == 0 )); then - sed -i "/#DietPi Additions/a alias dietpi-autostart='/DietPi/dietpi/dietpi-autostart'" /etc/bash.bashrc - fi - - if (( $(cat /etc/bash.bashrc | grep -ci -m1 'dietpi-affinity=') == 0 )); then - sed -i "/#DietPi Additions/a alias dietpi-affinity='/DietPi/dietpi/dietpi-affinity'" /etc/bash.bashrc - fi - - if (( $(cat /etc/bash.bashrc | grep -ci -m1 'dietpi-letsencrypt=') == 0 )); then - sed -i "/#DietPi Additions/a alias dietpi-letsencrypt='/DietPi/dietpi/dietpi-letsencrypt'" /etc/bash.bashrc - fi - # - DietPi-Cloudshell input cli changes - if (( $(cat /etc/bash.bashrc | grep -ci -m1 'dietpi-cloudshell=') == 1 )); then - sed -i '/alias dietpi-cloudshell=/d' /etc/bash.bashrc &> /dev/null - sed -i "/#DietPi Additions/a alias dietpi-cloudshell='/DietPi/dietpi/dietpi-cloudshell'" /etc/bash.bashrc - fi - #------------------------------------------------------------------------------- - #NTPD drift file ownership must match user that NTPD runs as, or it wont write to drift file (even though its ran as root.......) - chown root:root /var/lib/ntp/ntp.drift - #------------------------------------------------------------------------------- - #Information change for crontab (DietPi-Cron instead of dietpi-config) - sed -i '/#Please use dietpi-config/c\#Please use DietPi-Cron to change cron start times' /etc/crontab &> /dev/null - #------------------------------------------------------------------------------- - #Proftpd patch | to stop logging wtmp /var/log/wtmp: No such file or directory -Gordon Williams change - if [ -f /etc/proftpd/proftpd.conf ]; then - if (( $(cat /etc/proftpd/proftpd.conf | grep -ci -m1 'WtmpLog') == 0 )); then - sed -i "/SystemLog /a #to stop logging wtmp /var/log/wtmp: No such file or directory -Gordon Williams change\nWtmpLog off" /etc/proftpd/proftpd.conf - fi - fi - #------------------------------------------------------------------------------- - - - elif (( $VERSION_CURRENT == 103 )); then - #------------------------------------------------------------------------------- - # New automation/misc options > dietpi.txt - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 '^AUTO_AutoLogin=') == 0 )); then - sed -i "/# >> Automation Options/a #Automatically logs the root user in to start 1st run setup.\nAUTO_AutoLogin=0" /DietPi/dietpi.txt - fi - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 '^Hostname=') == 0 )); then - sed -i "/# >> Automation Options/a Hostname=DietPi" /DietPi/dietpi.txt - fi - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 '^Swapfile_Size=') == 0 )); then - sed -i "/# >> Automation Options/a Swapfile_Size=100" /DietPi/dietpi.txt - fi - #------------------------------------------------------------------------------- - #FP name change for autoboot (now DietPi-Autostart) - mv /DietPi/dietpi/.auto_boot_index /DietPi/dietpi/.dietpi-autostart_index - #------------------------------------------------------------------------------- - #DietPi-Cloudshell - 'c / 'f option / Target output - if [ -f /DietPi/dietpi/.dietpi-cloudshell ]; then - sed -i '4s/.*/1/' /DietPi/dietpi/.dietpi-cloudshell - sed -i '5s/.*/0/' /DietPi/dietpi/.dietpi-cloudshell - fi - #------------------------------------------------------------------------------- - #dphys-swapfile - add location to conf - if (( $(cat /etc/dphys-swapfile | grep -ci -m1 '^CONF_SWAPFILE=') == 0 )); then - echo -e "CONF_SWAPFILE=/var/swap" >> /etc/dphys-swapfile - fi - #------------------------------------------------------------------------------- - #PiHole Update - if [ -f /usr/local/bin/gravity.sh ]; then - #remove old lists (we need to regenerate) - rm /etc/pihole/list.* - rm /etc/pihole/pihole.* - rm /etc/pihole/gravity.list - - cp /DietPi/dietpi/conf/pihole_gravity /usr/local/bin/gravity.sh - chmod +x /usr/local/bin/gravity.sh - /usr/local/bin/gravity.sh - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 104 )); then - #------------------------------------------------------------------------------- - #DietPi-Software additions - # - automation add option - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_WIFIHOTSPOT=') == 0 )); then - sed -i "/AUTO_DietpiSoftware_Install_WEBSERVER_MYADMINPHP=/a AUTO_DietpiSoftware_Install_WIFIHOTSPOT=0" /DietPi/dietpi.txt - fi - - #------------------------------------------------------------------------------- - #dietpi-cleaner alias missing from bashrc - if (( $(cat /etc/bash.bashrc | grep -ci -m1 'dietpi-cleaner=') == 0 )); then - sed -i "/#DietPi Additions/a alias dietpi-cleaner='/DietPi/dietpi/dietpi-cleaner'" /etc/bash.bashrc - fi - #------------------------------------------------------------------------------- - #Wifi Hotspot settings - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'wifi_hotspot_ssid=') == 0 )); then - sed -i "/ntpd_update_mode=/a\ \n#Wifi Hotspot\nwifi_hotspot_ssid=DietPi-HotSpot\n# - minimum of 8 characters\nwifi_hotspot_key=dietpihotspot\nwifi_hotspot_channel=3" /DietPi/dietpi.txt - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 105 )); then - #------------------------------------------------------------------------------- - #DietPi-Software additions - # - automation add option - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_SHAIRPORTSYNC=') == 0 )); then - sed -i "/AUTO_DietpiSoftware_Install_WEBSERVER_MYADMINPHP=/a AUTO_DietpiSoftware_Install_SHAIRPORTSYNC=0" /DietPi/dietpi.txt - fi - #------------------------------------------------------------------------------- - #dbus-x11 now installed by default with xserver installations. Required for ibus, fcitx etc. inputs. - if [ -f /DietPi/dietpi/.installed ]; then - if (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'XSERVERXORG 2') == 1 )); then - /DietPi/dietpi/dietpi-apt-get_update 1 - G_AGI dbus-x11 - fi - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 106 )); then - #------------------------------------------------------------------------------- - # DietPi-Process Tool - # - bash alias add dietpi-process_control - if (( $(cat /etc/bash.bashrc | grep -ci -m1 'dietpi-process_tool=') == 0 )); then - sed -i "/#DietPi Additions/a alias dietpi-process_tool='/DietPi/dietpi/dietpi-process_tool'" /etc/bash.bashrc - fi - # - bash alias, remove nice/affinity - sed -i '/dietpi-nice/d' /etc/bash.bashrc - sed -i '/dietpi-affinity/d' /etc/bash.bashrc - #remove .dietpi-nice .dietpi-affinity settings - rm /DietPi/dietpi/.dietpi-nice - rm /DietPi/dietpi/.dietpi-affinity - #------------------------------------------------------------------------------- - #Prompt user regarding nice/affinity changes - if [ -f /DietPi/dietpi/.installed ]; then - whiptail --title "Info: DietPi-Process_Tool" --msgbox "DietPi-Affinity and DietPi-Nice has now been replaced by DietPi-Process_Tool.\n\nIf you have used these programs in the past, you will need to reapply your nice and affinity settings by running the following command, after you reboot the system.\n\ndietpi-process_tool" 14 70 - fi - #------------------------------------------------------------------------------- - #Enable IPv6 for all DietPi images by default - rm /etc/modprobe.d/blacklist-ipv6.conf &> /dev/null - #Update /etc/hosts with ipv6 - if (( $(cat /etc/hosts | grep -ci -m1 'ip6-localhost') == 0 )); then - cat << _EOF_ >> /etc/hosts -::1 localhost ip6-localhost ip6-loopback -ff02::1 ip6-allnodes -ff02::2 ip6-allrouters -_EOF_ - fi - #------------------------------------------------------------------------------- - #DietPi-Software additions - # - automation add option - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_BRUTEFIR=') == 0 )); then - sed -i "/AUTO_DietpiSoftware_Install_WEBSERVER_MYADMINPHP=/a AUTO_DietpiSoftware_Install_BRUTEFIR=0" /DietPi/dietpi.txt - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 107 )); then - #------------------------------------------------------------------------------- - #DietPi-Software additions - # - automation add option - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_PYDIO=') == 0 )); then - sed -i "/AUTO_DietpiSoftware_Install_WEBSERVER_MYADMINPHP=/a AUTO_DietpiSoftware_Install_PYDIO=0" /DietPi/dietpi.txt - fi - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_SQUEEZELITE=') == 0 )); then - sed -i "/AUTO_DietpiSoftware_Install_WEBSERVER_MYADMINPHP=/a AUTO_DietpiSoftware_Install_SQUEEZELITE=0" /DietPi/dietpi.txt - fi - #------------------------------------------------------------------------------- - #DESKTOP_LXDE dietpi-nice > dietpi-process_tool - if [ -f /DietPi/dietpi/.installed ]; then - if (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'DESKTOP_LXDE 2') == 1 )); then - rm /usr/share/applications/dietpi-nice.desktop - ln -sf /DietPi/dietpi/conf/desktop/dietpi-process_tool.desktop /usr/share/applications/dietpi-process_tool.desktop - fi - fi - #------------------------------------------------------------------------------- - elif (( $VERSION_CURRENT == 108 )); then - #------------------------------------------------------------------------------- - #Pydrio: Impossible write into the AJXP_DATA_PATH folder https://github.com/Fourdee/DietPi/issues/186 - chown -R www-data:www-data /pydio_data &> /dev/null - chown -R www-data:www-data /mnt/usb_1/pydio_data &> /dev/null - #------------------------------------------------------------------------------- - #PiHole webstats patch https://github.com/Fourdee/DietPi/issues/187#issue-131328814 - if [ -f /usr/local/bin/gravity.sh ]; then - wget https://raw.githubusercontent.com/pi-hole/pi-hole/master/advanced/Scripts/chronometer.sh -O /usr/local/bin/chronometer.sh - chmod +x /usr/local/bin/chronometer.sh - - /DietPi/dietpi/dietpi-apt-get_update 1 - G_AGI bc - fi - #------------------------------------------------------------------------------- - #DietPi-Software additions - # - Lighttpd - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_WEBSERVER_LLMP=') == 0 )); then - sed -i "/AUTO_DietpiSoftware_Install_WEBSERVER_MYADMINPHP=/a AUTO_DietpiSoftware_Install_WEBSERVER_LLMP=0" /DietPi/dietpi.txt - fi - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_WEBSERVER_LLSP=') == 0 )); then - sed -i "/AUTO_DietpiSoftware_Install_WEBSERVER_MYADMINPHP=/a AUTO_DietpiSoftware_Install_WEBSERVER_LLSP=0" /DietPi/dietpi.txt - fi - - # - MariaDB - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_WEBSERVER_LAAP=') == 0 )); then - sed -i "/AUTO_DietpiSoftware_Install_WEBSERVER_MYADMINPHP=/a AUTO_DietpiSoftware_Install_WEBSERVER_LAAP=0" /DietPi/dietpi.txt - fi - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_WEBSERVER_LEAP=') == 0 )); then - sed -i "/AUTO_DietpiSoftware_Install_WEBSERVER_MYADMINPHP=/a AUTO_DietpiSoftware_Install_WEBSERVER_LEAP=0" /DietPi/dietpi.txt - fi - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_WEBSERVER_LLAP=') == 0 )); then - sed -i "/AUTO_DietpiSoftware_Install_WEBSERVER_MYADMINPHP=/a AUTO_DietpiSoftware_Install_WEBSERVER_LLAP=0" /DietPi/dietpi.txt - fi - - #------------------------------------------------------------------------------- - #Disable powersaving for 8188eu wifi chipsets - echo -e "options 8188eu rtw_power_mgnt=0" > /etc/modprobe.d/8188eu.conf - #------------------------------------------------------------------------------- - #debconf-get-selections mising from odroid's - /DietPi/dietpi/dietpi-apt-get_update 1 - G_AGI debconf-utils - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 109 )); then - #------------------------------------------------------------------------------- - #Put XU4 kernel updates on hold to prevent automated installations causing broken kernel/modules. - #https://github.com/Fourdee/DietPi/issues/185#issuecomment-183343474 - if (( $G_HW_MODEL == 11 )); then - apt-mark hold linux-headers-armhf-odroid-xu3 linux-image-armhf-odroid-xu3 - fi - #------------------------------------------------------------------------------- - #LXDE desktop, remove dietpi-nice.desktop links, add dietpi-process_tool - if [ -f /DietPi/dietpi/.installed ]; then - if (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'DESKTOP_LXDE 2') == 1 )); then - rm /usr/share/applications/dietpi-nice.desktop - ln -sf /DietPi/dietpi/conf/desktop/dietpi-process_tool.desktop /usr/share/applications/dietpi-process_tool.desktop - fi - fi - #------------------------------------------------------------------------------- - #DietPi.txt | new option to override user/personal data target directory in DietPi-Software: https://github.com/Fourdee/DietPi/issues/198 - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'dietpi_userdata_basedirectory=') == 0 )); then - sed -i "/wifi_hotspot_channel=/a #------------------------------------------------------------------------------------------------------\n# D I E T - P I\n# DietPi-Software settings.\n#------------------------------------------------------------------------------------------------------\n#Override target directory for user/personal data.\n#This is applied to software configurations when installing software (eg: owncloud, bittorrent downloads etc).\n# Auto = Automatic (default). If USB dedicated drive was setup /mnt/usb_1, else, /root\n# /mnt/Where/I/Want/My/Data = Example\n# /mnt/user_data = Example\ndietpi_userdata_basedirectory=Auto\n" /DietPi/dietpi.txt - fi - #------------------------------------------------------------------------------- - #Updated network details script , rerun - /DietPi/dietpi/func/obtain_network_details - #------------------------------------------------------------------------------- - #BC is now installed by default on all DietPi systems. bc is needed for bash floating point calculations that many scripts rely on. - /DietPi/dietpi/dietpi-apt-get_update 1 - G_AGI bc - #------------------------------------------------------------------------------- - #Cloudshell new option | NETWORK_USAGE_CURRENT_OUTPUT_TYPE - if [ -f /DietPi/dietpi/.dietpi-cloudshell ]; then - sed -i '6s/.*/0/' /DietPi/dietpi/.dietpi-cloudshell - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 110 )); then - #------------------------------------------------------------------------------- - #DietPi-Software additions: - # - Oracle Java 8 jdk - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_ORACLEJAVA=') == 0 )); then - sed -i "/AUTO_DietpiSoftware_Install_FFMPEG=/a AUTO_DietpiSoftware_Install_ORACLEJAVA=0" /DietPi/dietpi.txt - fi - #------------------------------------------------------------------------------- - #RPI Jessie: - # - remove /etc/apt/sources.list.d/collabora.list. This was left over from Wheezy dist-upgrade and is not required. - # - Update /etc/apt/sources.list.d/raspi.list to match Raspbian Jessie raspi.list. - if (( $G_HW_MODEL < 10 )) && (( $G_DISTRO == 3 )); then - rm /etc/apt/sources.list.d/collabora.list - cat << _EOF_ > /etc/apt/sources.list.d/raspi.list -deb http://archive.raspberrypi.org/debian/ jessie main ui -# Uncomment line below then 'apt-get update' to enable 'apt-get source' -#deb-src http://archive.raspberrypi.org/debian/ jessie main ui -_EOF_ - /DietPi/dietpi/dietpi-apt-get_update 2 - fi - #------------------------------------------------------------------------------- - #RPI - snd-bcm2835 is now disabled by default. - if (( $G_HW_MODEL < 10 )) && (( $(dpkg -l | grep -ci -m1 'alsa') == 0 )); then - /DietPi/dietpi/func/dietpi-set_hardware soundcard none - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 111 )); then - #------------------------------------------------------------------------------- - #RPi 3 - WiFi hotspot. Internal Wifi fix. - # - Disable driver definition - # - Use non-modified hostapd binary from Jessie repo. - if (( $G_HW_MODEL == 3 )) && (( $(dpkg -l | grep -ci -m1 'hostapd') == 1 )); then - apt-get remove hostapd -y - G_AGI hostapd - sed -i '/driver=/c\#driver=rtl871xdrv/' /etc/hostapd/hostapd.conf - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 112 )); then - #------------------------------------------------------------------------------- - #/DietPi/dietpi/dietpi-apt-get_update 1 is now called in dietpi-update, before this patch file is launched. - # - Run it now for previous DietPi versions. As dietpi-update is loaded into memory, it wont be updated until a reboot. - /DietPi/dietpi/dietpi-apt-get_update 1 - #------------------------------------------------------------------------------- - #New location for dietpi-software installed "non-service" based control scripts - mkdir -p /var/lib/dietpi/dietpi-software/services - - # - move to new location, if installed - mv /etc/deluge_init /var/lib/dietpi/dietpi-software/services/deluge.service &> /dev/null - mv /etc/raspimjpeg_init /var/lib/dietpi/dietpi-software/services/raspimjpeg.service &> /dev/null - mv /etc/squeezeboxserver_init /var/lib/dietpi/dietpi-software/services/squeezeboxserver.service &> /dev/null - mv /etc/BruteFIR/brutefir.service /var/lib/dietpi/dietpi-software/services/brutefir.service &> /dev/null - chmod -R +x /var/lib/dietpi/dietpi-software/services - #------------------------------------------------------------------------------- - #DietPi-Software additions: - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_WEBSERVER_REDIS=') == 0 )); then - sed -i "/AUTO_DietpiSoftware_Install_WEBSERVER_MYADMINPHP=/a AUTO_DietpiSoftware_Install_WEBSERVER_REDIS=0" /DietPi/dietpi.txt - fi - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_EMONHUB=') == 0 )); then - sed -i "/AUTO_DietpiSoftware_Install_SQUEEZELITE=/a AUTO_DietpiSoftware_Install_EMONHUB=0" /DietPi/dietpi.txt - fi - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_EMONCMS=') == 0 )); then - sed -i "/AUTO_DietpiSoftware_Install_SQUEEZELITE=/a AUTO_DietpiSoftware_Install_EMONCMS=0" /DietPi/dietpi.txt - fi - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_NODEJS=') == 0 )); then - sed -i "/AUTO_DietpiSoftware_Install_BUILDESSENTIAL=/a AUTO_DietpiSoftware_Install_NODEJS=0" /DietPi/dietpi.txt - fi - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_RPIMONITOR=') == 0 )); then - sed -i "/AUTO_DietpiSoftware_Install_SQUEEZELITE=/a AUTO_DietpiSoftware_Install_RPIMONITOR=0" /DietPi/dietpi.txt - fi - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_BAIKAL=') == 0 )); then - sed -i "/AUTO_DietpiSoftware_Install_SQUEEZELITE=/a AUTO_DietpiSoftware_Install_BAIKAL=0" /DietPi/dietpi.txt - fi - #------------------------------------------------------------------------------- - #PiHole webstats update - if [ -f /var/www/pihole/index.php ]; then - cd ~/ - rm -R /var/www/pihole/* - wget https://github.com/Fourdee/AdminLTE/archive/master.zip -O package.zip - unzip package.zip - rm package.zip - mv AdminLTE*/* /var/www/pihole/ - rm -R AdminLTE* - fi - #------------------------------------------------------------------------------- - #RPi Jessie DietPi v111 image missing ipv6 in hosts. Add if it doesnt exist - if (( $(cat /etc/hosts | grep -ci -m1 'ip6-localhost') == 0 )); then - cat << _EOF_ >> /etc/hosts -::1 localhost ip6-localhost ip6-loopback -ff02::1 ip6-allnodes -ff02::2 ip6-allrouters -_EOF_ - fi - #------------------------------------------------------------------------------- - #Odroid C2 - Kodi sound fix - if (( $G_HW_MODEL == 12 )); then - if (( $(dpkg -l | grep -ci -m1 'kodi-odroid') == 1 )); then - - # - upgrade kodi - G_AGUP - G_AGUG - - # - Remove pulse audio workaround fix we used. - apt-get purge pulseaudio -y - apt-get autoremove --purge -y - - # - Asound.conf by Oversun. - cat << _EOF_ > /etc/asound.conf -pcm.!default { - type plug - slave { - pcm "hw:0,0" - format S32_LE - } -} -_EOF_ - fi - fi - #------------------------------------------------------------------------------- - #fbset now installed by default - G_AGI fbset - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 113 )); then - #------------------------------------------------------------------------------- - #DietPi-Software Additions - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_TORHOTSPOT=') == 0 )); then - sed -i "/AUTO_DietpiSoftware_Install_WIFIHOTSPOT=/a AUTO_DietpiSoftware_Install_TORHOTSPOT=0" /DietPi/dietpi.txt - fi - #------------------------------------------------------------------------------- - # New dietpi-software options > dietpi.txt - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 '^dietpi_emonhub_apikey=') == 0 )); then - sed -i "/dietpi_userdata_basedirectory=/a #Enter your EmonCMS.org write API key here. It will be applied automatically during EmonPi/Hub installation.\n# - eg: dietpi_emonhub_apikey=b4dfmk2o203mmxx93a\ndietpi_emonhub_apikey=" /DietPi/dietpi.txt - fi - #------------------------------------------------------------------------------- - #C1 - Ondemand does not work, replace with interactive: https://github.com/Fourdee/DietPi/issues/248 - if (( $G_HW_MODEL == 10 )) && (( $(cat /DietPi/dietpi.txt | grep -ci -m1 '^cpu_governor=ondemand') == 1 )); then - sed -i "/cpu_governor=/c\cpu_governor=interactive" /DietPi/dietpi.txt - /DietPi/dietpi/dietpi-cpu_set - fi - #------------------------------------------------------------------------------- - #RPi | Enable max usb current by default - sed -i '/max_usb_current=/c\max_usb_current=1' /DietPi/config.txt - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 114 )); then - #------------------------------------------------------------------------------- - #OPi PC - Comminuty Fix vcore/freq: https://github.com/Fourdee/DietPi/issues/263 - if (( $G_HW_MODEL == 30 )); then - - # - Warn user of OPi-PC only support after this is run. - whiptail --title "OPi-PC vcore/stability fix" --yesno "This will apply the community vcore/stability fix on your system. The fix resolves known issues with the H3 clockspeeds and vcore voltages. Whilst this patch has been tested on OPi-PC systems, there is no guarantee the fix will work, and, could render your system unbootable.\n\nNB: If you NOT using an OPi-PC, say no.\n\nDo you wish to apply the community H3 patch?" --backtitle "DietPi-Update" --defaultno 16 70 - CHOICE=$? - if (( $CHOICE == 0 )); then - wget http://dietpi.com/downloads/misc/community/h3_fix_vcore_clock.sh -O patch - chmod +x patch - ./patch - rm patch - fi - - fi - #------------------------------------------------------------------------------- - #Webserver preference system - # - update .installed file with new options. - if [ -f /DietPi/dietpi/.installed ]; then - - index=-2 #lighttpd - - if (( $(dpkg -l | awk '{print $2}' | grep -ci -m1 'apache2') )); then - index=0 - elif (( $(dpkg -l | awk '{print $2}' | grep -ci -m1 'nginx') )); then - index=-1 - fi - - cat << _EOF_ >> /DietPi/dietpi/.installed -#DietPi Preference System: Webserver base -INDEX_WEBSERVER_CURRENT $index -INDEX_WEBSERVER_TARGET $index -_EOF_ - - fi - - # - Add automation support for Webserver preference to dietpi.txt. - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_WebserverIndex=') == 0 )); then - sed -i "/AUTO_DietpiSoftware_LoggingIndex=/a #Webserver Preference Selection:\n# NB: This will get ignored, if you have manually selected any WEBSERVER_Stacks.\n# 0=Apache2\n# -1=Nginx\n# -2=Lighttpd\nAUTO_DietpiSoftware_WebserverIndex=-2" /DietPi/dietpi.txt - fi - #------------------------------------------------------------------------------- - # Possible missing dietpi.txt global vars for < v109 images. Add them if required. - # - To prevent this from occuring again: - # For AUTO_ entries, use sed to insert at specific line - # For global VARs, just echo the value to the end of dietpi.txt - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'wifi_hotspot_ssid=') == 0 )); then - echo -e "wifi_hotspot_ssid=DietPi-HotSpot" >> /DietPi/dietpi.txt - fi - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'wifi_hotspot_key=') == 0 )); then - echo -e "wifi_hotspot_key=dietpihotspot" >> /DietPi/dietpi.txt - fi - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'wifi_hotspot_channel=') == 0 )); then - echo -e "wifi_hotspot_channel=3" >> /DietPi/dietpi.txt - fi - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'dietpi_userdata_basedirectory=') == 0 )); then - echo -e "dietpi_userdata_basedirectory=Auto" >> /DietPi/dietpi.txt - fi - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'dietpi_emonhub_apikey=') == 0 )); then - echo -e "dietpi_emonhub_apikey=" >> /DietPi/dietpi.txt - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 115 )); then - #------------------------------------------------------------------------------- - # Add netdata to existing dietpi.txt automation file - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_NETDATA=') == 0 )); then - sed -i "/AUTO_DietpiSoftware_Install_LINUXDASH=/a AUTO_DietpiSoftware_Install_NETDATA=0" /DietPi/dietpi.txt - fi - - # + DietPi.txt Proxy settings - # NB: Always add extra line to cat feed: https://github.com/Fourdee/DietPi/issues/301#issue-151214787 - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 '^proxy_address=') == 0 )); then - cat << _EOF_ >> /DietPi/dietpi.txt - -#Proxy settings | System-wide proxy settings. Use dietpi-config > networking options to apply. -proxy_enabled=0 -proxy_address=MyProxyServer.com -proxy_port=8080 -proxy_username= -proxy_password= -_EOF_ - fi - #------------------------------------------------------------------------------- - #Odroid C1 WiFi fix (missing packages): https://github.com/Fourdee/DietPi/issues/273#issuecomment-210410651 - if (( $G_HW_MODEL == 10 )); then - G_AGI wireless-regdb iw crda wpasupplicant - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 116 )); then - #------------------------------------------------------------------------------- - #DietPi-Software additions - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_DietpiSoftware_Install_MUMBLESERVER=') == 0 )); then - sed -i "/AUTO_DietpiSoftware_Install_EMONHUB=/a AUTO_DietpiSoftware_Install_MUMBLESERVER=0" /DietPi/dietpi.txt - fi - #------------------------------------------------------------------------------- - #update .installed file to new format - if [[ -f /DietPi/dietpi/.installed ]]; then - sed -i -re 's/(^[^#]\S*) (.*)/\1=\2/' /DietPi/dietpi/.installed - fi - - #update cron jobs to use new .installed format - cp /DietPi/dietpi/conf/cron.daily_dietpi /etc/cron.daily/dietpi - chmod +x /etc/cron.daily/dietpi - cp /DietPi/dietpi/conf/cron.hourly_dietpi /etc/cron.hourly/dietpi - chmod +x /etc/cron.hourly/dietpi - #------------------------------------------------------------------------------- - #ifmetric: https://github.com/Fourdee/DietPi/issues/273#issuecomment-213951519 - G_AGI ifmetric - if (( $(cat /etc/network/interfaces | grep -ci -m1 '^metric ') == 0 )); then - # - eth - sed -i "/iface eth$(sed -n 1p /DietPi/dietpi/.network)/a metric 0" /etc/network/interfaces - # - wlan - sed -i "/iface wlan$(sed -n 2p /DietPi/dietpi/.network)/a metric 1" /etc/network/interfaces - fi - #------------------------------------------------------------------------------- - #netplug. Resolves issues with unplugging eth and breaking all connections, when WiFi is also active: https://github.com/Fourdee/DietPi/issues/273#issuecomment-215996025 - G_AGI netplug - cat << _EOF_ > /etc/netplug/netplugd.conf -eth* -wlan* -_EOF_ - #------------------------------------------------------------------------------- - #Roll out allow-hotplug as default: https://github.com/Fourdee/DietPi/issues/305 - # - Active - # eth - sed -i "/^auto eth$(sed -n 1p /DietPi/dietpi/.network)/c\allow-hotplug eth$(sed -n 1p /DietPi/dietpi/.network)" /etc/network/interfaces - # wlan - sed -i "/^auto wlan$(sed -n 2p /DietPi/dietpi/.network)/c\allow-hotplug wlan$(sed -n 2p /DietPi/dietpi/.network)" /etc/network/interfaces - # - inactive - # eth - sed -i "/^#auto eth$(sed -n 1p /DietPi/dietpi/.network)/c\#allow-hotplug eth$(sed -n 1p /DietPi/dietpi/.network)" /etc/network/interfaces - # wlan - sed -i "/^#auto wlan$(sed -n 2p /DietPi/dietpi/.network)/c\#allow-hotplug wlan$(sed -n 2p /DietPi/dietpi/.network)" /etc/network/interfaces - #------------------------------------------------------------------------------- - #apply to all DietPi systems (but targeted at Odroid XU4) - missing WiFi packages. - G_AGI wireless-regdb iw crda wpasupplicant - #------------------------------------------------------------------------------- - #Missing line at EOF - echo -e "" >> /etc/network/interfaces - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 117 )); then - #------------------------------------------------------------------------------- - #DietPi-Software additions: - # NB: We no longer need to do this. - # Users can download and copy the latest dietpi.txt file to SD, prior to boot, which will contain all current automation options. - # Theres no need for us to add them in during patching to their dietpi.txt. - #------------------------------------------------------------------------------- - #WiFi country code - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'wifi_country_code=') == 0 )); then - echo -e "\n#WiFi country code. 2 character value (eg GB US DE JP): https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\nwifi_country_code=" >> /DietPi/dietpi.txt - fi - #------------------------------------------------------------------------------- - #Remove _ from installed file: https://github.com/Fourdee/DietPi/issues/322 - if [ -f /DietPi/dietpi/.installed ]; then - sed -i '/^_$/d' /DietPi/dietpi/.installed - fi - #------------------------------------------------------------------------------- - #Subsonic now has two installation versions, v5 being the previous installation option.: https://github.com/Fourdee/DietPi/issues/330 - if [ -f /DietPi/dietpi/.installed ]; then - sed -i 's/^SUBSONIC=/SUBSONIC5=/' /DietPi/dietpi/.installed - fi - #------------------------------------------------------------------------------- - #Patch PineA64 to include xz-utils for firmware upgrades (only needed w/ alpha v118 image - if (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then - G_AGUP - G_AGI xz-utils - - /usr/local/sbin/pine64_update_uboot.sh - /usr/local/sbin/pine64_update_kernel.sh - /usr/local/sbin/pine64_fix_whatever.sh - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 118 )); then - #------------------------------------------------------------------------------- - #Transmission, service starts before network via SystemD, instead of "dietpi-services start": https://github.com/Fourdee/DietPi/issues/350 - if [ -f /DietPi/dietpi/.installed ] && - (( $G_DISTRO == 3 )) && - (( $( cat /DietPi/dietpi/.installed | grep -ci -m1 '^TRANSMISSION=2' ) )); then - - rm /etc/init.d/transmission-daemon - rm /etc/systemd/system/transmission-daemon.service - cat << _EOF_ > /etc/systemd/system/transmission-daemon.service -[Unit] -Description=Barebones transmission-daemon service -DefaultDependencies=no - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/transmission-daemon --config-dir /var/lib/transmission-daemon/info -ExecStop=/usr/bin/killall -w transmission-daemon -StandardOutput=tty - -[Install] -WantedBy=multi-user.target -_EOF_ - systemctl enable transmission-daemon.service - systemctl daemon-reload - /DietPi/dietpi/dietpi-services dietpi_controlled - - fi - #------------------------------------------------------------------------------- - #dietpi.txt global vnc settings - if (( ! $(cat /DietPi/dietpi.txt | grep -ci -m1 '^dietpi_vncserver_height=') )); then - echo -e "\n#VNC Server Options\ndietpi_vncserver_width=1280\ndietpi_vncserver_height=720\ndietpi_vncserver_depth=16\ndietpi_vncserver_display=0" >> /DietPi/dietpi.txt - fi - #------------------------------------------------------------------------------- - #VNC servers, now start automatically during boot via service. - if [ -f /DietPi/dietpi/.installed ] && - (( $( cat /DietPi/dietpi/.installed | grep -ci -m1 '^TIGHTVNCSERVER=2' ) )); then - - #Wheezy - if (( $G_DISTRO == 1 )); then - - cat << _EOF_ > /etc/init.d/vncserver -#!/bin/bash -e -### BEGIN INIT INFO -# Provides: VNC server -# Required-Start: \$all -# Should-Start: -# Required-Stop: \$local_fs \$network -# Should-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Description: DietPi VNC server control -### END INIT INFO - -#Wheezy, to prevent "vncserver: The HOME/USER environment variable is not set" -export USER=root -export HOME='/root' - -start(){ - - /usr/local/bin/vncserver start - -} - -stop(){ - - /usr/local/bin/vncserver stop - -} - -case "\$1" in - start) - start - ;; - stop) - stop - ;; - restart) - stop - start - ;; - *) - echo "Usage: \$0 {start|stop|restart}" - ;; -esac -_EOF_ - - chmod +x /etc/init.d/vncserver - update-rc.d vncserver defaults 00 80 - - - #Jessie - elif (( $G_DISTRO == 3 )); then - - cat << _EOF_ > /etc/systemd/system/vncserver.service -[Unit] -Description=Manage VNC Server -After=dietpi-service.service -After=rc.local.service - -[Service] -Type=idle -RemainAfterExit=yes -ExecStart=/bin/bash /usr/local/bin/vncserver start -ExecStop=/bin/bash /usr/local/bin/vncserver stop -User=root - -[Install] -WantedBy=multi-user.target -_EOF_ - - systemctl enable vncserver.service - systemctl daemon-reload - - fi - - # - Both - cat << _EOF_ > /usr/local/bin/vncserver -#!/bin/bash - -#Globals -VNC_INSTALLED=0 -BINARY_FP=0 - -WIDTH=\$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_vncserver_width=' | sed 's/.*=//') -HEIGHT=\$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_vncserver_height=' | sed 's/.*=//') -DEPTH=\$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_vncserver_depth=' | sed 's/.*=//') -DISPLAY=\$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_vncserver_display=' | sed 's/.*=//') - -#TightVNC or VNC4server? -if [ -f /usr/bin/vnc4server ]; then - BINARY_FP='/usr/bin/vnc4server' - VNC_INSTALLED=1 -elif [ -f /usr/bin/vncserver ]; then - BINARY_FP='/usr/bin/vncserver' - VNC_INSTALLED=1 -fi - -#Exit if no VNC binary found -if (( ! \$VNC_INSTALLED )); then - exit 1 -fi - -case "\$1" in - start) - \$BINARY_FP :\$DISPLAY -geometry \$WIDTH'x'\$HEIGHT -depth \$DEPTH - ;; - - stop) - \$BINARY_FP -kill :\$DISPLAY - ;; - -esac - -exit 0 -_EOF_ - chmod +x /usr/local/bin/vncserver - - fi - #------------------------------------------------------------------------------- - #Removal of VNC server from DietPi-Autostart. Reset to console, manual login. - if (( $(cat /DietPi/dietpi/.dietpi-autostart_index) == 6 )); then - echo 0 > /DietPi/dietpi/.dietpi-autostart_index - fi - #------------------------------------------------------------------------------- - #dietpi.txt | Serial console global var - # - Set this to 0 disabled (the previous default for all DietPi images). Future images will have this enabled by default. - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'serial_console_enabled=') == 0 )); then - echo -e "\n#Serial Console: If you dont know what this is, you can safely disable it (=0) to reduce system resource usage.\nserial_console_enabled=0" >> /DietPi/dietpi.txt - fi - #------------------------------------------------------------------------------- - #dietpi.txt | Soundcard global var - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'soundcard=') == 0 )); then - echo -e "\n#Soundcard\nsoundcard=none" >> /DietPi/dietpi.txt - fi - #------------------------------------------------------------------------------- - #Odroid C2 boot.ini changes: https://github.com/Fourdee/DietPi/issues/366#issue-157399983 - # I dont want to risk patching these additional options in, so lets overwrite the users boot.ini with the new one. - if (( $G_HW_MODEL == 12 )); then - - DEBIAN_FRONTEND='noninteractive' apt-get upgrade -y linux-headers-arm64-odroid-c2 linux-image-arm64-odroid-c2 - - whiptail --title "Kernel Upgrade" --msgbox "If the next screen shows a Yes/No prompt. Select No." 8 60 - DEBIAN_FRONTEND='noninteractive' apt-get autoremove --purge -y - - # - Because removing 3.14.29 also removes 3.14.65 (most likley same locations) we need to reinstall 3.14.65+ - G_AGI --reinstall linux-headers-3.14.65+ linux-image-3.14.65+ - - wget https://raw.githubusercontent.com/Fourdee/DietPi/e8e0edf7193c61d6084bf252397561081e335dc5/boot_c2.ini -O /DietPi/boot.ini - - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 119 )); then - #------------------------------------------------------------------------------- - #RPi 3 75 thermal limit: https://github.com/Fourdee/DietPi/issues/356#issuecomment-223282185 - if (( $G_HW_MODEL == 3 )); then - - sed -i '/temp_limit=/c\temp_limit=75' /DietPi/config.txt - - fi - #------------------------------------------------------------------------------- - #Disable internal WiFi and BT by default on new installs - if [ ! -f /DietPi/dietpi/.installed ]; then - - # - changed from RPi3 only script to all devices, remove old references - rm /etc/modprobe.d/disable_rpi3_bt.conf &> /dev/null - rm /etc/modprobe.d/disable_rpi3_wifi.conf &> /dev/null - - /DietPi/dietpi/func/dietpi-set_hardware bluetooth disable - - #enable WiFi for automation - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'Wifi_Enabled=1') )); then - /DietPi/dietpi/func/dietpi-set_hardware wifimodules enable - else - /DietPi/dietpi/func/dietpi-set_hardware wifimodules disable - fi - - fi - #------------------------------------------------------------------------------- - #Pine A64 image, disable systemd-timesyncd as we use ntp/d. New installs only. - if (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )) && [ ! -f /DietPi/dietpi/.installed ]; then - systemctl disable systemd-timesyncd - systemctl mask systemd-timesyncd - fi - #------------------------------------------------------------------------------- - #Netplug is now installed on demand in dietpi-config, when both adapters are enabled. - apt-get purge netplug -y - #------------------------------------------------------------------------------- - #DietPi-Cloudshell - New poweroff screen at specific time - if [ -f /DietPi/dietpi/.dietpi-cloudshell ]; then - sed -i '7s/.*/0/' /DietPi/dietpi/.dietpi-cloudshell #Enabled? - sed -i '8s/.*/22/' /DietPi/dietpi/.dietpi-cloudshell #Start time (hour) - sed -i '9s/.*/8/' /DietPi/dietpi/.dietpi-cloudshell #End time (hour) - fi - #------------------------------------------------------------------------------- - #Pine A64, now using fbturbo driver: https://github.com/Fourdee/DietPi/issues/380 - if (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )) && - [ -f /DietPi/dietpi/.installed ] && - (( $( cat /DietPi/dietpi/.installed | grep -ci -m1 '^XSERVERXORG=2' ) )); then - - wget http://dietpi.com/downloads/binaries/all/libump_1-1_arm64.deb -O package.deb - dpkg -i package.deb - rm package.deb - - wget http://dietpi.com/downloads/binaries/all/xf86-video-fbturbo_1-1_arm64.deb -O package.deb - dpkg -i package.deb - rm package.deb - - fi #------------------------------------------------------------------------------- - #Always ensure dietpi_userdata directory exists - mkdir -p "$G_FP_DIETPI_USERDATA" &> /dev/null - - #Setup dietpi_userdata symlink for existing installs, if not on flash drive - if [ -f /DietPi/dietpi/.installed ]; then - - DIETPI_USERDATA_BASEDIRECTORY=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_userdata_basedirectory=' | sed 's/.*=//' | tr '[:upper:]' '[:lower:]') - - if [ -n "$DIETPI_USERDATA_BASEDIRECTORY" ]; then - - #Auto - if [ "$DIETPI_USERDATA_BASEDIRECTORY" = "auto" ]; then - - #USBDRIVE - if (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'USBDRIVE=2') && $(df | grep -ci -m1 '/mnt/usb_1') )); then - /DietPi/dietpi/func/dietpi-set_userdata "$G_FP_DIETPI_USERDATA" /mnt/usb_1 - fi - - #CUSTOM - else - /DietPi/dietpi/func/dietpi-set_userdata "$G_FP_DIETPI_USERDATA" "$DIETPI_USERDATA_BASEDIRECTORY" - fi - - # - dietpi-set_userdata restarts services, so stop them. - /DietPi/dietpi/dietpi-services stop - - else - - read -p "Error: Unable to setup DietPi Userdata directories. dietpi_userdata_basedirectory= is missing or invalid value in dietpi.txt. It is highly recommended you backup any personal data on this system, then reinstall DietPi using the latest image available from http://dietpi.com/download. Press any key to continue..." - - fi - - fi - #------------------------------------------------------------------------------- - #xz-utils missing from some images, required for decompress tar.xz support. - G_AGI xz-utils - #------------------------------------------------------------------------------- - #I left the serial console enabled for all the v120 images (my bad). Disable if not enabled in dietpi.txt - if (( ! $(cat /DietPi/dietpi.txt | grep -ci -m1 '^serial_console_enabled=1') )); then - /DietPi/dietpi/func/dietpi-set_hardware serialconsole disable - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 120 )); then - #------------------------------------------------------------------------------- - #Update cron daily (Added daily filesystem TRIM for capable devices, eg: flash) - cp /DietPi/dietpi/conf/cron.daily_dietpi /etc/cron.daily/dietpi - chmod +x /etc/cron.daily/dietpi - #------------------------------------------------------------------------------- - #Xterm now installed by default with xserverxorg: https://github.com/Fourdee/DietPi/issues/388 - if [ -f /DietPi/dietpi/.installed ]; then - - if (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'XSERVERXORG=2') )); then - G_AGI xterm - fi - - # Mate: https://github.com/Fourdee/DietPi/issues/388 - if (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'DESKTOP_MATE=2') )); then - - # - Set execute to prevent "untrusted" prompt in Mate, and possibily other desktops. - chmod +x /usr/share/applications/* - - # - remove pcmanfm link - rm "$HOME"/Desktop/pcmanfm.desktop - - fi - - fi - #------------------------------------------------------------------------------- - #C2 X11 GPU/VPU patches: https://github.com/Fourdee/DietPi/issues/399 - # - boot.ini - if (( $G_HW_MODEL == 12 )); then - - if [ -f /DietPi/dietpi/.installed ]; then - - whiptail --title "boot.ini updated" --msgbox "/DietPi/boot.ini has been overwritten and updated with the latest C2 options. Values such as display resolution and serial console have been reset.\nPlease check the file and adjust as needed." 10 70 - - fi - - wget http://raw.githubusercontent.com/Fourdee/DietPi/f289eb0b3d1ab54980adf8e5d025b46d4c55c85d/boot_c2.ini -O /DietPi/boot.ini - - # - Xserver/LXDE - if [ -f /DietPi/dietpi/.installed ]; then - - # - Xserver - if (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'XSERVERXORG=2') )); then - - # - Update/Upgrade apt - /DietPi/dietpi/dietpi-apt-get_update 2 - G_AGUP - - # - Reinstall all packages, including the X11 additions (xf86-video-mali-odroid libump-odroid) - G_AGI xcompmgr aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump-odroid - cp /DietPi/dietpi/conf/xorg_c2.conf /etc/X11/xorg.conf - - fi - - # - LXDE xcompmgr - if (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'DESKTOP_LXDE=2') )); then - - cat << _EOF_ > /etc/xdg/lxsession/LXDE/autostart -xcompmgr -a -@lxpanel --profile LXDE -@pcmanfm --desktop --profile LXDE -@xscreensaver -no-splash -_EOF_ - - fi - - fi - - fi - #------------------------------------------------------------------------------- - #Weekly cronjob to update Pihole adlist - if [ -f /DietPi/dietpi/.installed ] && (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'PIHOLE=2') )); then - - cat << _EOF_ > /etc/cron.weekly/pihole_adlist_update -#!/bin/bash -{ - service dnsmasq stop - - echo -e "--------------------------------------------------------------------\n\n\$(date)\nDietPi - Running weekly adlist update" >> /var/log/pihole.log - /usr/local/bin/gravity.sh &>> /var/log/pihole.log - echo -e "--------------------------------------------------------------------\n" >> /var/log/pihole.log - - service dnsmasq start - - exit 0 -} - -_EOF_ - - chmod +x /etc/cron.weekly/pihole_adlist_update - - fi - #------------------------------------------------------------------------------- - #MineOS requires rsync: https://github.com/Fourdee/DietPi/issues/403 - if [ -f /DietPi/dietpi/.installed ] && (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'MINEOS=2') )); then - - G_AGI rsync - - fi - #------------------------------------------------------------------------------- - - - elif (( $VERSION_CURRENT == 121 )); then - #------------------------------------------------------------------------------- - echo -e "Nothing here" &> /dev/null - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 122 )); then - #------------------------------------------------------------------------------- - #Pine a64 resolution option in dietpi-config: https://github.com/Fourdee/DietPi/issues/398 - if (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then - - if (( ! $(cat /DietPi/uEnv.txt | grep -ci -m1 '^optargs=disp.screen0_output_mode=') )); then - - echo -e "\noptargs=disp.screen0_output_mode=1080p60" >> /DietPi/uEnv.txt - - fi - - fi - #------------------------------------------------------------------------------- - #MPD software mixer control - if [ -f /DietPi/dietpi/.installed ] && (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'HIFI=2') )); then - - sed -i '/mixer_device/c\mixer_type "software"' /etc/mpd.conf - - fi - #------------------------------------------------------------------------------- - #PiHole, prevent warning of a "file not found" when running gravity.sh: https://github.com/Fourdee/DietPi/issues/311#issuecomment-230342269 - # + log-async for rsyslog - if [ -f /DietPi/dietpi/.installed ] && (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'PIHOLE=2') )); then - - echo -e "#nothing here" > /etc/dnsmasq.d/01-pihole.conf - - if (( ! $(cat /etc/dnsmasq.conf | grep -ci -m1 'log-async') )); then - - echo -e "log-async" >> /etc/dnsmasq.conf - - fi - - fi - #------------------------------------------------------------------------------- - #RPi Monitor USB drive patch - if [ -f /DietPi/dietpi/.installed ] && - (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'RPIMONITOR=2') )) && - (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'USBDRIVE=2') )) && - (( ! $(cat /etc/rpimonitor/data.conf | grep -ci -m1 'usb_hdd.conf') )); then - - sed -i '\/include=\/etc\/rpimonitor\/template\/sdcard.conf/a include=\/etc\/rpimonitor\/template\/usb_hdd.conf' /etc/rpimonitor/data.conf - - cat << _EOF_ > /etc/rpimonitor/template/usb_hdd.conf -######################################################################## -# Extract USB HDD (sda1) information -# Page: 1 -# Information Status Statistics -# - USBHDD1 total - yes - yes -# - USBHDD1 used - yes - yes -######################################################################## -static.10.name=usbhdd_total -static.10.source=df -t ext4 -static.10.regexp=sda1\s+(\d+) -static.10.postprocess=\$1/1024 - -dynamic.14.name=usbhdd_used -dynamic.14.source=df -t ext4 -dynamic.14.regexp=sda1\s+\d+\s+(\d+) -dynamic.14.postprocess=\$1/1024 -dynamic.14.rrd=GAUGE - -web.status.1.content.9.name=USB HDD -web.status.1.content.9.icon=usb_hdd.png -web.status.1.content.9.line.1="/sda1 Used: "+KMG(data.usbhdd_used,'M')+" ("+Percent(data.udbhdd_used,data.usbhdd_total,'M')+") Free: "+KMG(data.usbhdd_total-data.usbhdd_used,'M')+ " Total: "+ KMG(data.usbhdd_total,'M') +"" -web.status.1.content.9.line.2=ProgressBar(data.usbhdd_used,data.usbhdd_total) - -web.statistics.1.content.9.name=USB HDD -web.statistics.1.content.9.graph.1=usbhdd_total -web.statistics.1.content.9.graph.2=usbhdd_used -web.statistics.1.content.9.ds_graph_options.usbhdd_total.label=USB HDD total space (MB) -web.statistics.1.content.9.ds_graph_options.usbhdd_total.color="#FF7777" -web.statistics.1.content.9.ds_graph_options.usbhdd_used.label=USB HDD used space (MB) -web.statistics.1.content.9.ds_graph_options.usbhdd_used.lines={ fill: true } -web.statistics.1.content.9.ds_graph_options.usbhdd_used.color="#7777FF" -_EOF_ - fi - #------------------------------------------------------------------------------- - #Kodi add NFS support: - if [ -f /DietPi/dietpi/.installed ] && (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'KODI=2') )); then - - G_AGI libnfs4 - - fi - #------------------------------------------------------------------------------- - #Odroid C2, define default pulseaudio sink: https://github.com/Fourdee/DietPi/issues/415 - if (( $G_HW_MODEL == 12 )) && - [ -f /DietPi/dietpi/.installed ] && - (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 'DESKTOP_MATE=2') )) && - (( ! $(cat /etc/pulse/default.pa | grep -ci -m1 '^set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo') )); then - - echo -e "set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo" >> /etc/pulse/default.pa - - fi - #------------------------------------------------------------------------------- - #ARMbian images, install armbian repo and update packages - if (( $G_HW_MODEL == 30 || $G_HW_MODEL == 50 || $G_HW_MODEL == 51 )) && - [ ! -f /proc/sunxi_debug/sunxi_debug ]; then # Skip the replaced OPi PC loboris image. - - echo "deb http://apt.armbian.com jessie main" > /etc/apt/sources.list.d/armbian.list - apt-key adv --keyserver keys.gnupg.net --recv-keys 0x93D6889F9F0E78D5 - G_AGUP - - # - remove ye-olde packages - apt-get purge -y armbian-firmware - - #BPi m2+ - if (( $G_HW_MODEL == 50 )); then - - G_AGI linux-u-boot-bananapim2plus-default linux-firmware-image-sun8i linux-image-sun8i - - #OPi PC - elif (( $G_HW_MODEL == 30 )); then - - # - remove ye-olde packages - apt-get purge -y linux-jessie-root-orangepih3 linux-u-boot-orangepih3-default - - G_AGI linux-u-boot-orangepipc-default linux-firmware-image-sun8i linux-image-sun8i - - #BPi pro - elif (( $G_HW_MODEL == 51 )); then - - G_AGI linux-image-sun7i linux-firmware-image-sun7i linux-u-boot-bananapipro-default - - fi - - fi - - #------------------------------------------------------------------------------- - #alias sudo='sudo ' # https://github.com/Fourdee/DietPi/issues/424#issuecomment-232016646 - if (( ! $(cat /etc/bash.bashrc | grep -ci -m1 '^alias sudo=') )); then - - echo -e "alias sudo='sudo ' # https://github.com/Fourdee/DietPi/issues/424" >> /etc/bash.bashrc - - fi - #------------------------------------------------------------------------------- - #RPi add dtparam=spi=off to config by default - if (( $G_HW_MODEL < 10 && - ! $(cat /DietPi/config.txt | grep -ci -m1 'dtparam=spi=') )); then - - echo -e "\ndtparam=spi=off" >> /DietPi/config.txt - - fi - - #------------------------------------------------------------------------------- - #DietPi-Config > LCD Panel addon - if (( ! $(cat /DietPi/dietpi.txt | grep -ci -m1 '^lcdpanel=') )); then - - echo -e "\nlcdpanel=none" >> /DietPi/dietpi.txt - - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 123 )); then - #------------------------------------------------------------------------------- - #Pine remove vim-* (was left on latest image) for new installations. - if [ ! -f /DietPi/dietpi/.installed ] && (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then - - apt-get purge -y vim-common vim-tiny - - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 124 )); then - #------------------------------------------------------------------------------- - #Disable daily fstrim until testing can be performed to ensure this isnt causing the recent influx of filesystem corruptions. - cp /DietPi/dietpi/conf/cron.daily_dietpi /etc/cron.daily/dietpi - chmod +x /etc/cron.daily/dietpi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 125 )); then - #------------------------------------------------------------------------------- - #libcurl3-gnutls required for C2. But lets apply to all: https://github.com/Fourdee/DietPi/issues/446 - if [ -f /DietPi/dietpi/.installed ] && - (( $( cat /DietPi/dietpi/.installed | grep -ci -m1 '^KODI=2' ) )); then - - G_AGI libcurl3-gnutls - - fi - #------------------------------------------------------------------------------- - #C2 remove asound.conf for hdmi: https://github.com/Fourdee/DietPi/issues/447 - if (( $G_HW_MODEL == 12 )) && [ -f /etc/asound.conf ] && - (( $(cat /etc/asound.conf | grep -ci -m1 'format S32_LE') )); then - - rm /etc/asound.conf - - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 126 )); then - #------------------------------------------------------------------------------- - #NanoPi Neo, left test account on image, remove it - if (( $G_HW_MODEL == 60 )); then - - userdel -f test - - fi - #------------------------------------------------------------------------------- - #remove dietpi-uninstall from bash alias - sed -i '/alias dietpi-uninstall/d' /etc/bash.bashrc - #------------------------------------------------------------------------------- - #Update dietpi.txt automation var name change - sed -i 's/AUTO_Install_Index=/AUTO_Install_Enable=/g' /DietPi/dietpi.txt - #------------------------------------------------------------------------------- - #patch: Convert all .installed files to the new array system - if [ -f /DietPi/dietpi/.installed ]; then - - sed -i "s/^SSHCLIENT=/aSOFTWARE_INSTALL_STATE[0]=/g" /DietPi/dietpi/.installed - sed -i "s/^SMBCLIENT=/aSOFTWARE_INSTALL_STATE[1]=/g" /DietPi/dietpi/.installed - sed -i "s/^CURLFTPFS=/aSOFTWARE_INSTALL_STATE[2]=/g" /DietPi/dietpi/.installed - sed -i "s/^MIDNIGHTCOMMANDER=/aSOFTWARE_INSTALL_STATE[3]=/g" /DietPi/dietpi/.installed - sed -i "s/^VIFM=/aSOFTWARE_INSTALL_STATE[4]=/g" /DietPi/dietpi/.installed - sed -i "s/^ALSABASE=/aSOFTWARE_INSTALL_STATE[5]=/g" /DietPi/dietpi/.installed - sed -i "s/^XSERVERXORG=/aSOFTWARE_INSTALL_STATE[6]=/g" /DietPi/dietpi/.installed - sed -i "s/^FFMPEG=/aSOFTWARE_INSTALL_STATE[7]=/g" /DietPi/dietpi/.installed - sed -i "s/^ORACLEJAVA=/aSOFTWARE_INSTALL_STATE[8]=/g" /DietPi/dietpi/.installed - sed -i "s/^NODEJS=/aSOFTWARE_INSTALL_STATE[9]=/g" /DietPi/dietpi/.installed - sed -i "s/^IFTOP=/aSOFTWARE_INSTALL_STATE[10]=/g" /DietPi/dietpi/.installed - sed -i "s/^IPTRAF=/aSOFTWARE_INSTALL_STATE[11]=/g" /DietPi/dietpi/.installed - sed -i "s/^IPERF=/aSOFTWARE_INSTALL_STATE[12]=/g" /DietPi/dietpi/.installed - sed -i "s/^MTRTINY=/aSOFTWARE_INSTALL_STATE[13]=/g" /DietPi/dietpi/.installed - sed -i "s/^NLOAD=/aSOFTWARE_INSTALL_STATE[14]=/g" /DietPi/dietpi/.installed - sed -i "s/^TCPDUMP=/aSOFTWARE_INSTALL_STATE[15]=/g" /DietPi/dietpi/.installed - sed -i "s/^BUILDESSENTIAL=/aSOFTWARE_INSTALL_STATE[16]=/g" /DietPi/dietpi/.installed - sed -i "s/^GITCLIENT=/aSOFTWARE_INSTALL_STATE[17]=/g" /DietPi/dietpi/.installed - sed -i "s/^GNUEMACS=/aSOFTWARE_INSTALL_STATE[18]=/g" /DietPi/dietpi/.installed - sed -i "s/^JED=/aSOFTWARE_INSTALL_STATE[19]=/g" /DietPi/dietpi/.installed - sed -i "s/^VIMFULL=/aSOFTWARE_INSTALL_STATE[20]=/g" /DietPi/dietpi/.installed - sed -i "s/^VIMTINY=/aSOFTWARE_INSTALL_STATE[21]=/g" /DietPi/dietpi/.installed - sed -i "s/^QUITERSS=/aSOFTWARE_INSTALL_STATE[22]=/g" /DietPi/dietpi/.installed - sed -i "s/^DESKTOP_LXDE=/aSOFTWARE_INSTALL_STATE[23]=/g" /DietPi/dietpi/.installed - sed -i "s/^DESKTOP_MATE=/aSOFTWARE_INSTALL_STATE[24]=/g" /DietPi/dietpi/.installed - sed -i "s/^DESKTOP_XFCE=/aSOFTWARE_INSTALL_STATE[25]=/g" /DietPi/dietpi/.installed - sed -i "s/^DESKTOP_GNUSTEP=/aSOFTWARE_INSTALL_STATE[26]=/g" /DietPi/dietpi/.installed - sed -i "s/^TIGHTVNCSERVER=/aSOFTWARE_INSTALL_STATE[27]=/g" /DietPi/dietpi/.installed - sed -i "s/^VNC4SERVER=/aSOFTWARE_INSTALL_STATE[28]=/g" /DietPi/dietpi/.installed - sed -i "s/^XRDP=/aSOFTWARE_INSTALL_STATE[29]=/g" /DietPi/dietpi/.installed - sed -i "s/^NOMACHINE=/aSOFTWARE_INSTALL_STATE[30]=/g" /DietPi/dietpi/.installed - sed -i "s/^KODI=/aSOFTWARE_INSTALL_STATE[31]=/g" /DietPi/dietpi/.installed - sed -i "s/^HIFI=/aSOFTWARE_INSTALL_STATE[32]=/g" /DietPi/dietpi/.installed - sed -i "s/^SUBSONIC5=/aSOFTWARE_INSTALL_STATE[33]=/g" /DietPi/dietpi/.installed - sed -i "s/^SUBSONIC6=/aSOFTWARE_INSTALL_STATE[34]=/g" /DietPi/dietpi/.installed - sed -i "s/^SQUEEZEBOXSERVER=/aSOFTWARE_INSTALL_STATE[35]=/g" /DietPi/dietpi/.installed - sed -i "s/^SQUEEZELITE=/aSOFTWARE_INSTALL_STATE[36]=/g" /DietPi/dietpi/.installed - sed -i "s/^SHAIRPORTSYNC=/aSOFTWARE_INSTALL_STATE[37]=/g" /DietPi/dietpi/.installed - sed -i "s/^BRUTEFIR=/aSOFTWARE_INSTALL_STATE[38]=/g" /DietPi/dietpi/.installed - sed -i "s/^MINIDLNA=/aSOFTWARE_INSTALL_STATE[39]=/g" /DietPi/dietpi/.installed - sed -i "s/^AMPACHE=/aSOFTWARE_INSTALL_STATE[40]=/g" /DietPi/dietpi/.installed - sed -i "s/^EMBYSERVER=/aSOFTWARE_INSTALL_STATE[41]=/g" /DietPi/dietpi/.installed - sed -i "s/^PLEXMEDIASERVER=/aSOFTWARE_INSTALL_STATE[42]=/g" /DietPi/dietpi/.installed - sed -i "s/^MUMBLESERVER=/aSOFTWARE_INSTALL_STATE[43]=/g" /DietPi/dietpi/.installed - sed -i "s/^TRANSMISSION=/aSOFTWARE_INSTALL_STATE[44]=/g" /DietPi/dietpi/.installed - sed -i "s/^DELUGE=/aSOFTWARE_INSTALL_STATE[45]=/g" /DietPi/dietpi/.installed - sed -i "s/^QBITTORRENT=/aSOFTWARE_INSTALL_STATE[46]=/g" /DietPi/dietpi/.installed - sed -i "s/^OWNCLOUD=/aSOFTWARE_INSTALL_STATE[47]=/g" /DietPi/dietpi/.installed - sed -i "s/^PYDIO=/aSOFTWARE_INSTALL_STATE[48]=/g" /DietPi/dietpi/.installed - sed -i "s/^GOGS=/aSOFTWARE_INSTALL_STATE[49]=/g" /DietPi/dietpi/.installed - sed -i "s/^SYNCTHING=/aSOFTWARE_INSTALL_STATE[50]=/g" /DietPi/dietpi/.installed - sed -i "s/^OPENTYRIAN=/aSOFTWARE_INSTALL_STATE[51]=/g" /DietPi/dietpi/.installed - sed -i "s/^CUBERITE=/aSOFTWARE_INSTALL_STATE[52]=/g" /DietPi/dietpi/.installed - sed -i "s/^MINEOS=/aSOFTWARE_INSTALL_STATE[53]=/g" /DietPi/dietpi/.installed - sed -i "s/^PHPBB=/aSOFTWARE_INSTALL_STATE[54]=/g" /DietPi/dietpi/.installed - sed -i "s/^WORDPRESS=/aSOFTWARE_INSTALL_STATE[55]=/g" /DietPi/dietpi/.installed - sed -i "s/^PHPIMAGEGALLERY=/aSOFTWARE_INSTALL_STATE[56]=/g" /DietPi/dietpi/.installed - sed -i "s/^BAIKAL=/aSOFTWARE_INSTALL_STATE[57]=/g" /DietPi/dietpi/.installed - sed -i "s/^OPENBAZAAR=/aSOFTWARE_INSTALL_STATE[58]=/g" /DietPi/dietpi/.installed - sed -i "s/^DIETPICAM=/aSOFTWARE_INSTALL_STATE[59]=/g" /DietPi/dietpi/.installed - sed -i "s/^WIFIHOTSPOT=/aSOFTWARE_INSTALL_STATE[60]=/g" /DietPi/dietpi/.installed - sed -i "s/^TORHOTSPOT=/aSOFTWARE_INSTALL_STATE[61]=/g" /DietPi/dietpi/.installed - sed -i "s/^DIETPICLOUDSHELL=/aSOFTWARE_INSTALL_STATE[62]=/g" /DietPi/dietpi/.installed - sed -i "s/^LINUXDASH=/aSOFTWARE_INSTALL_STATE[63]=/g" /DietPi/dietpi/.installed - sed -i "s/^PHPSYSINFO=/aSOFTWARE_INSTALL_STATE[64]=/g" /DietPi/dietpi/.installed - sed -i "s/^NETDATA=/aSOFTWARE_INSTALL_STATE[65]=/g" /DietPi/dietpi/.installed - sed -i "s/^RPIMONITOR=/aSOFTWARE_INSTALL_STATE[66]=/g" /DietPi/dietpi/.installed - sed -i "s/^NOIPDYNDNS=/aSOFTWARE_INSTALL_STATE[67]=/g" /DietPi/dietpi/.installed - sed -i "s/^WEAVED=/aSOFTWARE_INSTALL_STATE[68]=/g" /DietPi/dietpi/.installed - sed -i "s/^RPIGPIO=/aSOFTWARE_INSTALL_STATE[69]=/g" /DietPi/dietpi/.installed - sed -i "s/^WIRINGPI=/aSOFTWARE_INSTALL_STATE[70]=/g" /DietPi/dietpi/.installed - sed -i "s/^WEBIOPI=/aSOFTWARE_INSTALL_STATE[71]=/g" /DietPi/dietpi/.installed - sed -i "s/^RPII2C=/aSOFTWARE_INSTALL_STATE[72]=/g" /DietPi/dietpi/.installed - sed -i "s/^FAIL2BAN=/aSOFTWARE_INSTALL_STATE[73]=/g" /DietPi/dietpi/.installed - sed -i "s/^WEBSERVER_LAMP=/aSOFTWARE_INSTALL_STATE[74]=/g" /DietPi/dietpi/.installed - sed -i "s/^WEBSERVER_LASP=/aSOFTWARE_INSTALL_STATE[75]=/g" /DietPi/dietpi/.installed - sed -i "s/^WEBSERVER_LAAP=/aSOFTWARE_INSTALL_STATE[76]=/g" /DietPi/dietpi/.installed - sed -i "s/^WEBSERVER_LEMP=/aSOFTWARE_INSTALL_STATE[77]=/g" /DietPi/dietpi/.installed - sed -i "s/^WEBSERVER_LESP=/aSOFTWARE_INSTALL_STATE[78]=/g" /DietPi/dietpi/.installed - sed -i "s/^WEBSERVER_LEAP=/aSOFTWARE_INSTALL_STATE[79]=/g" /DietPi/dietpi/.installed - sed -i "s/^WEBSERVER_LLMP=/aSOFTWARE_INSTALL_STATE[80]=/g" /DietPi/dietpi/.installed - sed -i "s/^WEBSERVER_LLSP=/aSOFTWARE_INSTALL_STATE[81]=/g" /DietPi/dietpi/.installed - sed -i "s/^WEBSERVER_LLAP=/aSOFTWARE_INSTALL_STATE[82]=/g" /DietPi/dietpi/.installed - sed -i "s/^WEBSERVER_APACHE=/aSOFTWARE_INSTALL_STATE[83]=/g" /DietPi/dietpi/.installed - sed -i "s/^WEBSERVER_LIGHTTPD=/aSOFTWARE_INSTALL_STATE[84]=/g" /DietPi/dietpi/.installed - sed -i "s/^WEBSERVER_NGINX=/aSOFTWARE_INSTALL_STATE[85]=/g" /DietPi/dietpi/.installed - sed -i "s/^WEBSERVER_MYSQL=/aSOFTWARE_INSTALL_STATE[86]=/g" /DietPi/dietpi/.installed - sed -i "s/^WEBSERVER_SQLITE=/aSOFTWARE_INSTALL_STATE[87]=/g" /DietPi/dietpi/.installed - sed -i "s/^WEBSERVER_MARIADB=/aSOFTWARE_INSTALL_STATE[88]=/g" /DietPi/dietpi/.installed - sed -i "s/^WEBSERVER_PHP=/aSOFTWARE_INSTALL_STATE[89]=/g" /DietPi/dietpi/.installed - sed -i "s/^WEBSERVER_MYADMINPHP=/aSOFTWARE_INSTALL_STATE[90]=/g" /DietPi/dietpi/.installed - sed -i "s/^WEBSERVER_REDIS=/aSOFTWARE_INSTALL_STATE[91]=/g" /DietPi/dietpi/.installed - sed -i "s/^LETSENCRYPT=/aSOFTWARE_INSTALL_STATE[92]=/g" /DietPi/dietpi/.installed - sed -i "s/^PIHOLE=/aSOFTWARE_INSTALL_STATE[93]=/g" /DietPi/dietpi/.installed - sed -i "s/^FILESERVER_PROFTP=/aSOFTWARE_INSTALL_STATE[94]=/g" /DietPi/dietpi/.installed - sed -i "s/^FILESERVER_VSFTPD=/aSOFTWARE_INSTALL_STATE[95]=/g" /DietPi/dietpi/.installed - sed -i "s/^FILESERVER_SAMBA=/aSOFTWARE_INSTALL_STATE[96]=/g" /DietPi/dietpi/.installed - sed -i "s/^OPENVPNSERVER=/aSOFTWARE_INSTALL_STATE[97]=/g" /DietPi/dietpi/.installed - sed -i "s/^HAPROXY=/aSOFTWARE_INSTALL_STATE[98]=/g" /DietPi/dietpi/.installed - sed -i "s/^EMONHUB=/aSOFTWARE_INSTALL_STATE[99]=/g" /DietPi/dietpi/.installed - sed -i "s/^GRASSHOPPER=/aSOFTWARE_INSTALL_STATE[100]=/g" /DietPi/dietpi/.installed - sed -i "s/^LOGGING_LOGROTATE=/aSOFTWARE_INSTALL_STATE[101]=/g" /DietPi/dietpi/.installed - sed -i "s/^LOGGING_RSYSLOG=/aSOFTWARE_INSTALL_STATE[102]=/g" /DietPi/dietpi/.installed - sed -i "s/^LOGGING_RAMLOG=/aSOFTWARE_INSTALL_STATE[103]=/g" /DietPi/dietpi/.installed - sed -i "s/^SSHSERVER_DROPBEAR=/aSOFTWARE_INSTALL_STATE[104]=/g" /DietPi/dietpi/.installed - sed -i "s/^SSHSERVER_OPENSSH=/aSOFTWARE_INSTALL_STATE[105]=/g" /DietPi/dietpi/.installed - sed -i "s/^RASPCONTROL=/aSOFTWARE_INSTALL_STATE[106]=/g" /DietPi/dietpi/.installed - - fi - #------------------------------------------------------------------------------- - #VNC server, set screen :1 as default: https://github.com/Fourdee/DietPi/issues/454#issuecomment-237655998 - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'dietpi_vncserver_display=0') )); then - - sed -i '/^dietpi_vncserver_display=/c\dietpi_vncserver_display=1' /DietPi/dietpi.txt - - fi - #------------------------------------------------------------------------------- - #Remove bulky header packages on new images 40MB+, located in /usr/src, not required unless native kernel compile. - if [ ! -f /DietPi/dietpi/.installed ]; then - - apt-get purge -y --force-yes linux-headers* - - fi - #------------------------------------------------------------------------------- - #Remove dietpi-uninstall script (moved to dietpi-software) - rm /DietPi/dietpi/dietpi-uninstall - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 127 )); then - #------------------------------------------------------------------------------- - #Fix mysql key_buffer_size: - sed -i '/^key_buffer/c\key_buffer_size = 16M' /etc/mysql/my.cnf &> /dev/null - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 128 )); then - #------------------------------------------------------------------------------- - #Zero, set overclock back to default and disable: - if (( $(cat /DietPi/dietpi/.hw_model | tr '[:upper:]' '[:lower:]' | grep -ci -m1 'rpi zero') )); then - - sed -i '/over_voltage=/c\#over_voltage=0' /DietPi/config.txt - sed -i '/arm_freq=/c\#arm_freq=1000' /DietPi/config.txt - sed -i '/core_freq=/c\#core_freq=400' /DietPi/config.txt - sed -i '/sdram_freq=/c\#sdram_freq=450' /DietPi/config.txt - - fi - #------------------------------------------------------------------------------- - #RPi 2/3 - Set correct sdram speed if not active. Used by dietpi-config for reading value. - if (( $G_HW_MODEL == 2 || $G_HW_MODEL == 3 )); then - - sed -i '/^#sdram_freq=/c\#sdram_freq=450' /DietPi/config.txt - - fi - #------------------------------------------------------------------------------- - #RPi new installs - if [ ! -f /DietPi/dietpi/.installed ] && (( $G_HW_MODEL < 10 )); then - - # - RPi-update backup left on image, remove - rm -R /boot.bak &> /dev/null - - # - Timezone left on American for v127 img, change back to London - echo -e "Europe/London" > /etc/timezone - dpkg-reconfigure -f noninteractive tzdata - - fi - - #------------------------------------------------------------------------------- - #Only start dietpi-services if system is at final install stage - if [ -f /DietPi/dietpi/.installed ]; then - - mv /etc/rc.local /etc/rc.local.bak - whiptail --title "/etc/rc.local updated" --msgbox "/etc/rc.local has been overwritten with an updated version. A backup of your previous rc.local can be found below:\n\n/etc/rc.local.bak" 11 70 - - fi - - cat << _EOF_ > /etc/rc.local -#!/bin/bash -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" -exit 0 -_EOF_ - chmod +x /etc/rc.local - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 129 )); then - #------------------------------------------------------------------------------- - #apt-get pref ip version: https://github.com/Fourdee/DietPi/issues/472 - if (( ! $(cat /DietPi/dietpi.txt | grep -ci -m1 '^prefer_ipversion=') )); then - - echo -e "\nprefer_ipversion=auto\n" >> /DietPi/dietpi.txt - - fi - #------------------------------------------------------------------------------- - #Removal of dietpi-apt-get_update, revert back to standard apt-get update. - if [ -f /DietPi/dietpi/dietpi-apt-get_update ]; then #Doesnt exist on v129.5 AmiBerry image, so check exists. - - /DietPi/dietpi/dietpi-apt-get_update 1 #wait for existing job if running. - rm /DietPi/dietpi/dietpi-apt-get_update - - fi - #------------------------------------------------------------------------------- - #Scroll lock fix for RPi by Midwan: https://github.com/Fourdee/DietPi/issues/474#issuecomment-243215674 - if (( $G_HW_MODEL < 10 )); then - - cat << _EOF_ > /etc/udev/rules.d/50-leds.rules -ACTION=="add", SUBSYSTEM=="leds", ENV{DEVPATH}=="*/input*::scrolllock", ATTR{trigger}="kbd-scrollock" -_EOF_ - - fi - #------------------------------------------------------------------------------- - #Desktop xcompmgr roll out. Patch existing systems and reinstall xserver. - - # - remove LXDE xcomp line for c1/c2 on LXDE autostart conf - sed -i '/^xcompmgr/d' /etc/xdg/lxsession/LXDE/autostart &> /dev/null - - # - New function, will only reinstall if the program is currently installed. - /DietPi/dietpi/dietpi-software reinstall 6 - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 130 )); then - #------------------------------------------------------------------------------- - #C2 v130 image: apt-get update prior to this script has no effect. No apt-cache: https://github.com/Fourdee/DietPi/issues/508#issuecomment-246196842 - #NB: Regardless, run for all devices. - G_AGUP - - #C2: apt-get upgrade 'uboot' package update without 'linux-image' at the same time = failed boot. - #NB: Apply to odroids as we also hold kernel packages for XU4. - if (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )); then - - - apt-mark unhold linux-* - G_AGDUG - - fi - #------------------------------------------------------------------------------- - #Auto mount USB drive by default https://github.com/Fourdee/DietPi/issues/501 - # - All excluding VM images - if (( $G_HW_MODEL != 20 )); then - - cp /etc/fstab /etc/fstab.v130 - - # - Remove old FStab entries - sed -i '/\/dev\/sd[a-z]1[[:space:]]/d' /etc/fstab - sed -i '/\/mnt\/usb_[0-9][[:space:]]/d' /etc/fstab - - sed -i '/^#External Drives-/d' /etc/fstab - sed -i '/^# - Try and use only ext4 for USB drives/d' /etc/fstab - sed -i '/^# - Faster performance than NTFS, espically on RPi v1/d' /etc/fstab - sed -i '/^#NB: Please use dietpi-drive_manager/d' /etc/fstab - - # - Add new automount entries that supports all FS types - cat << _EOF_ >> /etc/fstab - -#External Drives--------------------------------------------------- -#NB: Please use dietpi-drive_manager to setup and control your external drives. -/dev/sda1 /mnt/usb_1 auto defaults,noatime,nofail,x-systemd.automount 0 0 -#/dev/sdb1 /mnt/usb_2 auto defaults,noatime,nofail,x-systemd.automount 0 0 -#/dev/sdc1 /mnt/usb_3 auto defaults,noatime,nofail,x-systemd.automount 0 0 -#/dev/sdd1 /mnt/usb_4 auto defaults,noatime,nofail,x-systemd.automount 0 0 -#/dev/sde1 /mnt/usb_5 auto defaults,noatime,nofail,x-systemd.automount 0 0 -_EOF_ - - systemctl daemon-reload - - fi - #------------------------------------------------------------------------------- - #add HFS+ FS support for all DietPi systems by default: https://github.com/Fourdee/DietPi/issues/271#issuecomment-245651818 - G_AGI hfsplus #hfsprogs is for format capabilities - #------------------------------------------------------------------------------- - #NFS: https://github.com/Fourdee/DietPi/issues/246 - mkdir -p /mnt/nfs_client - echo -e "NFS client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking Options: NAS/Misc menu" > /mnt/nfs_client/readme.txt - - # - fstab template entry - if (( ! $(cat /etc/fstab | grep -ci -m1 '/mnt/nfs_client') )); then - - echo -e "\n#NFS Client Mount--------------------------------------------------\n#/mnt/nfs_client . Please use dietpi-config and the Networking Options: NAS menu to setup this mount" >> /etc/fstab - - fi - - # - dietpi.txt entries - if (( ! $(cat /DietPi/dietpi.txt | grep -ci -m1 '^nfsclient_ipaddress=') )); then - - echo -e "\nnfsclient_ipaddress=" >> /DietPi/dietpi.txt - - fi - #------------------------------------------------------------------------------- - #DietPi-Drive_Manager - # - remove old program - rm /DietPi/dietpi/dietpi-external_drive_setup - # - setup alias - if (( ! $(cat /etc/bash.bashrc | grep -ci -m1 'dietpi-drive_manager=') )); then - - sed -i "/#DietPi Additions/a alias dietpi-drive_manager='/DietPi/dietpi/dietpi-drive_manager'" /etc/bash.bashrc - - fi - #------------------------------------------------------------------------------- - #New rc.local : boottime - if [ -f /DietPi/dietpi/.installed ]; then - - mv /etc/rc.local /etc/rc.local.bak - whiptail --title "/etc/rc.local updated" --msgbox "/etc/rc.local has been overwritten with an updated version. A backup of your previous rc.local can be found below:\n\n/etc/rc.local.bak" 11 70 - - fi - - cat << _EOF_ > /etc/rc.local -#!/bin/bash -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" -exit 0 -_EOF_ - chmod +x /etc/rc.local - #------------------------------------------------------------------------------- - #AmiBerry v2 binary update - /DietPi/dietpi/dietpi-software reinstall 108 - #------------------------------------------------------------------------------- - #ifmetric: https://github.com/Fourdee/DietPi/issues/515 - apt-get purge ifmetric -y - sed -i '/^metric /d' /etc/network/interfaces - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 131 )); then - #------------------------------------------------------------------------------- - #Install p7zip by default on all DietPi systems - G_AGI p7zip-full - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 132 )); then - #------------------------------------------------------------------------------- - #Interactive CPU gov by default: - CPU_GOVERNOR_CURRENT=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_governor=' | sed 's/.*=//') - if [ "$CPU_GOVERNOR_CURRENT" = "ondemand" ]; then - - sed -i "/^cpu_governor=/c\cpu_governor=interactive" /DietPi/dietpi.txt - /DietPi/dietpi/dietpi-cpu_set - - fi - #------------------------------------------------------------------------------- - #dietpi.txt entries : https://github.com/Fourdee/DietPi/issues/533 - if (( ! $(cat /DietPi/dietpi.txt | grep -ci -m1 '^AUTO_Global_Password=') )); then - - echo -e "\nAUTO_Global_Password=dietpi\n" >> /DietPi/dietpi.txt - - fi - if (( ! $(cat /DietPi/dietpi.txt | grep -ci -m1 '^Apt_Raspbian_Mirror=') )); then - - echo -e "\nApt_Raspbian_Mirror=http://mirror.ox.ac.uk/sites/archive.raspbian.org/archive/raspbian\n" >> /DietPi/dietpi.txt - - fi - if (( ! $(cat /DietPi/dietpi.txt | grep -ci -m1 '^Apt_Debian_Mirror=') )); then - - echo -e "\nApt_Debian_Mirror=http://ftp.debian.org/debian\n" >> /DietPi/dietpi.txt - - fi - if (( ! $(cat /DietPi/dietpi.txt | grep -ci -m1 '^AUTO_Dedicated_Usb_Drive_Format_Filesystem=') )); then - - echo -e "\nAUTO_Dedicated_Usb_Drive_Format_Filesystem=0\n" >> /DietPi/dietpi.txt - - fi - if (( ! $(cat /DietPi/dietpi.txt | grep -ci -m1 '^dietpi_nextcloud_username=') )); then - - echo -e "\ndietpi_nextcloud_username=admin\n" >> /DietPi/dietpi.txt - - fi - #------------------------------------------------------------------------------- - #FriendlyARM images, remove custom services: - if (( $G_HW_MODEL == 61 || $G_HW_MODEL == 62 )); then - - rm /lib/systemd/system/lcd4linux.service - rm /lib/systemd/system/hwservice.service - rm /lib/systemd/system/hwservice_monitor.service - systemctl daemon-reload - - fi - #------------------------------------------------------------------------------- - #ethtool: - G_AGI ethtool - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 133 )); then - #------------------------------------------------------------------------------- - #NanoPi T2 bluetooth + patch by AWL29: http://dietpi.com/phpbb/viewtopic.php?f=12&t=622&start=40#p3280 - if (( $G_HW_MODEL == 61 )); then - - BT_USER_ENABLED=0 - if (( $(lsmod | grep -ci -m1 '^bluetooth') )); then - - BT_USER_ENABLED=1 - - fi - - wget http://dietpi.com/downloads/binaries/all/ap6212_bt_patch.7z -O package.7z - 7z x -y package.7z -o/ - - chmod +x /bin/brcm_patchram_plus - chmod +x /bin/bumpRTSCTS - chmod +x /etc/init.d/brcm_patchram_plus - chmod +x /lib/systemd/system/brcm_patchram_plus.service - - # - BT modules must be enabled before installation. Else, apt-get install will fail on bluetooth package init. - /DietPi/dietpi/func/dietpi-set_hardware bluetooth enable # will fail on bluetooth service start. Expected, as not installed yet. - G_DIETPI-NOTIFY 2 "If the above returns an error, it can safely be ignored as BT isnt installed yet." - - G_AGI bluetooth - - # - Disable BT modules, if the user had it disabled before hand: - if (( ! $BT_USER_ENABLED )); then - - G_DIETPI-NOTIFY 2 "BT was in a disabled state previously, setting back to disabled." - /DietPi/dietpi/func/dietpi-set_hardware bluetooth disable - - fi - - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 134 )); then - #------------------------------------------------------------------------------- - #DietPi services updated to SystemD: - - # - Stop and remove old service - #/DietPi/dietpi/dietpi-services stop # not required, ran from dietpi-update script before hand - systemctl stop dietpi-service - - systemctl disable dietpi-service - update-rc.d dietpi-service remove - rm /etc/init.d/dietpi-service - - # - Install new services - cat << _EOF_ > /etc/systemd/system/dietpi-ramdisk.service -[Unit] -Description=DietPi-RAMdisk - -[Service] -Type=forking -RemainAfterExit=yes -ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramdisk 0' -ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramdisk 1' - -[Install] -WantedBy=local-fs.target -_EOF_ - systemctl enable dietpi-ramdisk.service - systemctl daemon-reload - systemctl start dietpi-ramdisk.service - - # DietPi-Ramlog -cat << _EOF_ > /etc/systemd/system/dietpi-ramlog.service -[Unit] -Description=DietPi-RAMlog -Before=rsyslog.service syslog.service - -[Service] -Type=forking -RemainAfterExit=yes -ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramlog 0' -ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramlog 1' - -[Install] -WantedBy=local-fs.target -_EOF_ - systemctl enable dietpi-ramlog.service - systemctl daemon-reload - systemctl start dietpi-ramlog.service - - # Boot - cat << _EOF_ > /etc/systemd/system/dietpi-boot.service -[Unit] -Description=DietPi-Boot -After=network-online.target network.target networking.service dietpi-ramdisk.service dietpi-ramlog.service -Requires=dietpi-ramdisk.service - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/bin/bash -c '/DietPi/dietpi/boot' -StandardOutput=tty - -[Install] -WantedBy=multi-user.target -_EOF_ - systemctl enable dietpi-boot.service - - cat << _EOF_ > /etc/systemd/system/rc-local.service -[Unit] -Description=/etc/rc.local Compatibility -After=dietpi-boot.service dietpi-ramdisk.service dietpi-ramlog.service -Requires=dietpi-boot.service dietpi-ramdisk.service - -[Service] -Type=idle -ExecStart=/etc/rc.local -StandardOutput=tty -RemainAfterExit=yes - -[Install] -WantedBy=multi-user.target -_EOF_ - systemctl enable rc-local.service - - if [ -f /DietPi/dietpi/.installed ]; then - - mv /etc/rc.local /etc/rc.local.bak - whiptail --title "/etc/rc.local updated" --msgbox "/etc/rc.local has been overwritten with an updated version. A backup of your previous rc.local can be found below:\n\n/etc/rc.local.bak" 11 70 - - fi - - cat << _EOF_ > /etc/rc.local -#!/bin/bash -#Precaution: Wait for DietPi Ramdisk to finish -while [ ! -f /DietPi/.ramdisk ] -do - - G_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" -exit 0 -_EOF_ - chmod +x /etc/rc.local - systemctl daemon-reload - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 135 )); then - #------------------------------------------------------------------------------- - #Soundcard fixes & changes, requires a reapply to overwrite and patch existing settings. - # JustBoom, pattern match as end of string may contain '-noeq' due to: https://github.com/Fourdee/DietPi/issues/585 - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 '^soundcard=justboom-dac') )); then - - /DietPi/dietpi/func/dietpi-set_hardware soundcard justboom-dac-eq - - elif (( $(cat /DietPi/dietpi.txt | grep -ci -m1 '^soundcard=justboom-digi') )); then - - /DietPi/dietpi/func/dietpi-set_hardware soundcard justboom-digi-eq - - # - Reapply active card - else - - /DietPi/dietpi/func/dietpi-set_hardware soundcard $(cat /DietPi/dietpi.txt | grep -m1 'soundcard=' | sed 's/.*=//') - - fi - - #Reinstall ALSA to enable bash alias for dietpi-justboom on all soundcards. - #Reinstall HiFi to update YMPD clients to latest version. - /DietPi/dietpi/dietpi-software reinstall 5 32 - - #------------------------------------------------------------------------------- - #Force use of existing installed configs if available, else install new. Also disables end user prompt from dpkg - cat << _EOF_ > /etc/apt/apt.conf.d/local -Dpkg::Options { - "--force-confdef"; - "--force-confold"; -} -_EOF_ - - #------------------------------------------------------------------------------- - #NoIP2 systemd service patch: https://github.com/Fourdee/DietPi/issues/589 - if [ -f /etc/init.d/noip2 ]; then - - update-rc.d noip2 remove - rm /etc/init.d/noip2 - cat << _EOF_ > /etc/systemd/system/noip2.service -[Unit] -Description=noip2 -After=network.target network-online.target rsyslog.service - -[Service] -Type=forking -RemainAfterExit=yes - -ExecStart=/usr/local/bin/noip2 -ExecStop=/usr/bin/killall -w noip2 - -[Install] -WantedBy=multi-user.target -_EOF_ - systemctl daemon-reload - - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 136 )); then - #------------------------------------------------------------------------------- - #Reinstalls - # - MySQL: Apply optimizations for reduced memory usage: https://github.com/Fourdee/DietPi/issues/605 - # - DietPi-Cloudshell: Reinstall to apply new service for tty1 use - # - vnc servers: Reinstall to allow use of new shared desktop mode - /DietPi/dietpi/dietpi-software reinstall 86 62 27 28 - - # - requires new save file - if [ -f /DietPi/dietpi/.dietpi-cloudshell ]; then - - whiptail --title "DietPi-Cloudshell Upgrade" --msgbox "DietPi-Cloudshell has been updated to the latest version. This version has significant changes to the settings/savefile system, which requires your current settings to be reset.\n\nYour previous settings have been cleared. Please run dietpi-cloudshell to reconfigure as needed." 12 70 - rm /DietPi/dietpi/.dietpi-cloudshell - - fi - - #Add roon to dietpi-process_tool: http://dietpi.com/phpbb/viewtopic.php?f=9&t=826#p3711 - - #------------------------------------------------------------------------------- - #Shared VNC server options: https://github.com/Fourdee/DietPi/issues/607 - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 'dietpi_vncserver_shared_desktop=') )); then - - echo -e "\ndietpi_vncserver_shared_desktop=0" >> /DietPi/dietpi.txt - - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 137 )); then - #------------------------------------------------------------------------------- - #Updated desktop icons: https://github.com/Fourdee/DietPi/issues/616 - - # - Desktop confs are now located online, so remove from DietPi-Ramdisk to save some memory. - rm -R /DietPi/dietpi/conf/desktop - - if [ -f /DietPi/dietpi/.installed ]; then - - #23 24 25 26 - if (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 '^aSOFTWARE_INSTALL_STATE\[23\]=2') || - $(cat /DietPi/dietpi/.installed | grep -ci -m1 '^aSOFTWARE_INSTALL_STATE\[24\]=2') || - $(cat /DietPi/dietpi/.installed | grep -ci -m1 '^aSOFTWARE_INSTALL_STATE\[25\]=2') || - $(cat /DietPi/dietpi/.installed | grep -ci -m1 '^aSOFTWARE_INSTALL_STATE\[26\]=2') )); then - - # - Remove old symlinks - rm /usr/share/applications/dietpi-* - rm "$HOME"/Desktop/dietpi-* - - # - reinstall new - mkdir -p /usr/share/applications - wget http://dietpi.com/downloads/conf/desktop/dietpi-software.desktop -O /usr/share/applications/dietpi-software.desktop - wget http://dietpi.com/downloads/conf/desktop/dietpi-update.desktop -O /usr/share/applications/dietpi-update.desktop - wget http://dietpi.com/downloads/conf/desktop/dietpi-config.desktop -O /usr/share/applications/dietpi-config.desktop - wget http://dietpi.com/downloads/conf/desktop/dietpi-uninstall.desktop -O /usr/share/applications/dietpi-uninstall.desktop - wget http://dietpi.com/downloads/conf/desktop/dietpi-backup.desktop -O /usr/share/applications/dietpi-backup.desktop - wget http://dietpi.com/downloads/conf/desktop/dietpi-sync.desktop -O /usr/share/applications/dietpi-sync.desktop - wget http://dietpi.com/downloads/conf/desktop/dietpi-bugreport.desktop -O /usr/share/applications/dietpi-bugreport.desktop - wget http://dietpi.com/downloads/conf/desktop/dietpi-process_tool.desktop -O /usr/share/applications/dietpi-process_tool.desktop - wget http://dietpi.com/downloads/conf/desktop/dietpi-cleaner.desktop -O /usr/share/applications/dietpi-cleaner.desktop - wget http://dietpi.com/downloads/conf/desktop/dietpi-cron.desktop -O /usr/share/applications/dietpi-cron.desktop - wget http://dietpi.com/downloads/conf/desktop/dietpi-launcher.desktop -O /usr/share/applications/dietpi-launcher.desktop - wget http://dietpi.com/downloads/conf/desktop/dietpi-justboom.desktop -O /usr/share/applications/dietpi-justboom.desktop - - #DietPi Desktop symlinks - ln -sf /usr/share/applications/dietpi-software.desktop "$HOME"/Desktop/dietpi-software.desktop - ln -sf /usr/share/applications/dietpi-config.desktop "$HOME"/Desktop/dietpi-config.desktop - ln -sf /usr/share/applications/dietpi-launcher.desktop "$HOME"/Desktop/dietpi-launcher.desktop - - #Download icons - mkdir -p /var/lib/dietpi/dietpi-software/installed/desktop_icons - wget http://dietpi.com/downloads/conf/desktop/dietpi-icon.png -O /var/lib/dietpi/dietpi-software/installed/desktop_icons/dietpi-icon.png - wget http://dietpi.com/downloads/conf/desktop/grey_16x16.png -O /var/lib/dietpi/dietpi-software/installed/desktop_icons/grey_16x16.png - wget http://dietpi.com/downloads/conf/desktop/kodi-icon.png -O /var/lib/dietpi/dietpi-software/installed/desktop_icons/kodi-icon.png - wget http://dietpi.com/downloads/conf/desktop/justboom.png -O /var/lib/dietpi/dietpi-software/installed/desktop_icons/justboom.png - - #Kodi - if (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 '^aSOFTWARE_INSTALL_STATE\[31\]=2') )); then - - rm /usr/share/applications/kodi.desktop - wget http://dietpi.com/downloads/conf/desktop/kodi.desktop -O /usr/share/applications/kodi.desktop - ln -sf /usr/share/applications/kodi.desktop "$HOME"/Desktop/kodi.desktop - - fi - - # - Set execute to prevent "untrusted" prompt in Mate, and possibily other desktops. - chmod +x /usr/share/applications/* - - fi - - fi - #------------------------------------------------------------------------------- - #Reinstalls: - # C2: FBTURBO provides much better desktop performance over Mali DDX: http://forum.odroid.com/viewtopic.php?f=138&t=19948&p=169808#p169808 - # Squeezelite 1.8 update to enable -C flag: https://github.com/Fourdee/DietPi/issues/620 - /DietPi/dietpi/dietpi-software reinstall 6 36 - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 138 )); then - #------------------------------------------------------------------------------- - #nanoPi M3 image cleanup (some things we missed), but lets apply to all devices on fresh install: - if [ ! -f /DietPi/dietpi/.installed ]; then - - userdel -f fa - apt-get purge -y modemmanager hostapd libgoa-* libfm-* - - # - May as well remove unneeded RPi packages while we are here: https://github.com/Fourdee/DietPi/issues/598 - apt-get purge -y libboost-iostreams1.49.0 libboost-iostreams1.50.0 libboost-iostreams1.53.0 libboost-iostreams1.54.0 gcc-4.6-base gcc-4.7-base gcc-4.8-base libsigc++-1.2-5c2 - - apt-get autoremove -y --purge - - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 139 )); then - #------------------------------------------------------------------------------- - echo 0 - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 140 )); then - #------------------------------------------------------------------------------- - #C2 libc6 u7 breaking most installations, replace with u6: https://github.com/Fourdee/DietPi/issues/653 - # https://github.com/Fourdee/DietPi/issues/663#issuecomment-269867184 - if (( $G_HW_MODEL == 12 )); then - - wget http://ftp.us.debian.org/debian/pool/main/g/glibc/libc6_2.19-18+deb8u6_arm64.deb -O package.deb - dpkg -i package.deb - rm package.deb - - # - Just incase u6 is outdated by the time this patch is run, lets also update and upgrade apt: - G_AGUP - G_AGDUG - - fi - #------------------------------------------------------------------------------- - #Stretch, disable automatic updates and management of apt cache. Prevents unexpected lock on Apt cache and therefore failed apt installations. - # Very similar to a system DietPi had a while back that background threaded weekly apt-get updates, was removed as repo files change and without apt-get update prior to install, chance of package no longer existing (eg: package-1.2.3 changes to package-1.2.4), unless the apt list was also updated. - if (( $G_DISTRO == 4 )); then - - systemctl mask apt-daily.service - - fi - #------------------------------------------------------------------------------- - #Apt-transport install by default on all systems: - G_AGI apt-transport-https - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 141 )); then - #------------------------------------------------------------------------------- - #DietPi-Backup settings file has been recoded, must be generated again - if [ -f /DietPi/dietpi/.dietpi-backup_settings ]; then - - mv /DietPi/dietpi/.dietpi-backup_settings /DietPi/dietpi/.dietpi-backup_settings_v141 - - # - Inform user - whiptail --title "DietPi-Backup Changes:" --msgbox "Significant changes have been made to DietPi-Backup in v142. Due to this, existing backups, made with DietPi v141 or lower are no longer compatible.\nPlease see the url below for more information, and a method to restore a previous backup from DietPi v141 and lower:\n\nhttps://github.com/Fourdee/DietPi/issues/685#issuecomment-270145794" 15 75 - - fi - #------------------------------------------------------------------------------- - #Disable auto mounting of usb_1, if not in use: https://github.com/Fourdee/DietPi/issues/684 - if (( ! $(df -P | grep -ci -m1 '/mnt/usb_1') )); then - - sed -i '/\/mnt\/usb_1/c\#\/dev\/sda1 \/mnt\/usb_1 auto defaults,noatime,nofail,x-systemd.automount 0 0' /etc/fstab - systemctl daemon-reload - - fi - #------------------------------------------------------------------------------- - #RPi 3 Bluetooth packages missing: https://github.com/Fourdee/DietPi/issues/693 - if (( $G_HW_MODEL < 10 )); then - - G_AGI --reinstall pi-bluetooth - - # - Check if previously disabled, and reapply - if [ -f /etc/modprobe.d/disable_bt.conf ]; then - - /DietPi/dietpi/func/dietpi-set_hardware bluetooth disable - - fi - - fi - #------------------------------------------------------------------------------- - #Stretch RPi WiFi fix + firmware: https://github.com/Fourdee/DietPi/issues/475#issuecomment-270696515 - if (( $G_DISTRO == 4 && $G_HW_MODEL < 10 )); then - - G_AGDUG - wget https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/master/brcm80211/brcm/brcmfmac43430-sdio.txt -O /lib/firmware/brcm/brcmfmac43430-sdio.txt - - fi - #------------------------------------------------------------------------------- - #Sparky SBC fixes: - # Additional blacklist to disable touch screen, and dmesg errors associated with it: https://github.com/Fourdee/DietPi/issues/699#issuecomment-271362441 - if (( $G_HW_MODEL == 70 )); then - - cat << _EOF_ > /etc/modprobe.d/disable_sparkysbc_touchscreen.conf -blacklist ctp_gsl3680 -_EOF_ - - fi - #------------------------------------------------------------------------------- - #Alsamixer fix, reapply current soundcard with updated asound.conf: https://github.com/Fourdee/DietPi/issues/705 - if [ -f /DietPi/dietpi/.installed ]; then - - /DietPi/dietpi/func/dietpi-set_hardware soundcard $(cat /DietPi/dietpi.txt | grep -m1 'soundcard=' | sed 's/.*=//') - - fi - #------------------------------------------------------------------------------- - #RPi, install common rpi specific binaries by default (eg: raspistill) - if (( $G_HW_MODEL < 10 )); then - - G_AGI --reinstall libraspberrypi-bin - - fi - #------------------------------------------------------------------------------- - #Reinstalls: - # DietPi Cam: https://github.com/Fourdee/DietPi/issues/706 - # NetData 1.4 - # Move MySQL + MariaDB store to DietPi User data location: - /DietPi/dietpi/dietpi-software reinstall 59 65 86 88 - #------------------------------------------------------------------------------- - #switch from NTPD to systemd-timesyncd for drift mode (4): https://github.com/Fourdee/DietPi/issues/709 - if (( $(cat /DietPi/dietpi.txt | grep -m1 '^ntpd_update_mode=' | sed 's/.*=//') == 4 )); then - - timedatectl set-ntp true - - fi - #------------------------------------------------------------------------------- - #Inform our Allo Piano 2 users of updated sound card: - if [ -f /DietPi/dietpi/.installed ] && - (( $(cat /DietPi/dietpi.txt | grep 'soundcard=' | grep -ci -m1 'allo-piano') )); then - - whiptail --title "Allo Piano 2.1" --msgbox "The driver for the Allo Piano 2.1 DAC has been updated. \n\nIf you are using a Allo Piano DAC 2.1, please reselect this sound card from dietpi-config, to apply the updated driver." 12 70 - - fi - #------------------------------------------------------------------------------- - #Remove Meveric's CPU governor scripts, all Odroid images - if (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )); then - - systemctl disable cpu_governor &> /dev/null - rm /etc/init.d/cpu_governor &> /dev/null - rm /etc/systemd/system/cpu_governor.service &> /dev/null - systemctl daemon-reload - - fi - #------------------------------------------------------------------------------- - #Reduce DHCP request retry count and timeouts: https://github.com/Fourdee/DietPi/issues/711 - sed -i '/^#timeout /d' /etc/dhcp/dhclient.conf - sed -i '/^#retry /d' /etc/dhcp/dhclient.conf - sed -i '/^timeout /d' /etc/dhcp/dhclient.conf - sed -i '/^retry /d' /etc/dhcp/dhclient.conf - cat << _EOF_ >> /etc/dhcp/dhclient.conf -timeout 10; -retry 4; -_EOF_ - - #------------------------------------------------------------------------------- - #systemctl disable armhwinfo: Turns out this does more than just obtain info, also sets device specific "workarounds/fixes": https://github.com/igorpecovnik/lib/blob/73a4dd60a2b6ab9bd8008fb0ef06344e378a557f/scripts/armhwinfo - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 142 )); then - #------------------------------------------------------------------------------- - #OPi Zero (apply to all) | ARMbian, disable 1st run script: - systemctl disable firstrun &> /dev/null - rm /etc/init.d/firstrun &> /dev/null - #------------------------------------------------------------------------------- - #Pine A64, fb cursor: https://github.com/Fourdee/DietPi/issues/596#issuecomment-274328262 - if (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then - - cat << _EOF_ >> "$HOME"/.bashrc -infocmp > terminfo.txt -sed -i -e 's/?0c/?112c/g' -e 's/?8c/?48;0;64c/g' terminfo.txt -tic terminfo.txt -tput cnorm -_EOF_ - - fi - #------------------------------------------------------------------------------- - #Reinstalls: - # Netdata 1.5.0: https://github.com/Fourdee/DietPi/issues/728 - /DietPi/dietpi/dietpi-software reinstall 65 - # - #------------------------------------------------------------------------------- - #DietPi-Ramdisk: - # - add debugging: https://github.com/Fourdee/DietPi/issues/719 - # - after local-fs.target - # DietPi-Ramdisk - cat << _EOF_ > /etc/systemd/system/dietpi-ramdisk.service -[Unit] -Description=DietPi-RAMdisk -After=local-fs.target - -[Service] -Type=forking -RemainAfterExit=yes -ExecStartPre=/bin/mkdir -p /var/tmp/dietpi/logs -ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramdisk 0 &>> /var/tmp/dietpi/logs/dietpi-ramdisk.log' -ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramdisk 1 &>> /var/tmp/dietpi/logs/dietpi-ramdisk.log' - -[Install] -WantedBy=local-fs.target -_EOF_ - - # DietPi-Ramlog - cat << _EOF_ > /etc/systemd/system/dietpi-ramlog.service -[Unit] -Description=DietPi-RAMlog -Before=rsyslog.service syslog.service -After=local-fs.target - -[Service] -Type=forking -RemainAfterExit=yes -ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramlog 0' -ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramlog 1' - -[Install] -WantedBy=local-fs.target -_EOF_ - systemctl daemon-reload - - # - Restart RAMdisk now - systemctl restart dietpi-ramdisk.service - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 143 )); then - #------------------------------------------------------------------------------- - #Samba clients, remove _netdev: https://github.com/Fourdee/DietPi/issues/744 - if (( ! $(cat /etc/fstab | grep -ci -m1 '^#/mnt/samba') )); then - - /DietPi/dietpi/func/dietpi-set_smbclient 1 - - fi - #------------------------------------------------------------------------------- - #Sparky SBC kernel upgrade from Allo, improve USB DAC support: - if (( $G_HW_MODEL == 70 )); then - - /DietPi/dietpi/func/dietpi-set_hardware kernel sparky_sbc - - fi - #------------------------------------------------------------------------------- - #Reinstalls - # RoonBridge 1.3 update: https://github.com/Fourdee/DietPi/issues/749 - # AmiBerry 2.1: https://github.com/Fourdee/DietPi/issues/756 - /DietPi/dietpi/dietpi-software reinstall 108 121 - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 144 )); then - #------------------------------------------------------------------------------- - #Use our new EU mirror for mdrjr repo (Meveric's packages): - if (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )); then - - sed -i 's@http://oph.mdrjr.net/meveric@http://fuzon.co.uk/meveric@' /etc/apt/sources.list.d/* - - fi - #------------------------------------------------------------------------------- - #New installs, remove /mnt/usb_x entries in /etc/fstab and /mnt - if [ ! -f /DietPi/dietpi/.installed ]; then - - rm -R /mnt/usb_1 - sed -i "\@[[:space:]]/mnt/usb_[1-9][[:space:]]@d" /etc/fstab - - fi - #------------------------------------------------------------------------------- - #Disable ARMbian's log2ram: https://github.com/Fourdee/DietPi/issues/781 - systemctl disable log2ram.service - rm /usr/local/sbin/log2ram &> /dev/null - rm /etc/systemd/system/log2ram.service &> /dev/null - #------------------------------------------------------------------------------- - #Cleanup ARMbian's resize service (not automatically removed by ARMbian scripts...) - systemctl disable resize2fs &> /dev/null - rm /etc/systemd/system/resize2fs.service &> /dev/null - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 145 )); then - #------------------------------------------------------------------------------- - #/usr/bin/sudo: https://github.com/Fourdee/DietPi/issues/794 - chmod 4755 /usr/bin/sudo - #------------------------------------------------------------------------------- - #NTPD: Update DietPi Cron jobs: https://github.com/Fourdee/DietPi/issues/786 - cp /DietPi/dietpi/conf/cron.daily_dietpi /etc/cron.daily/dietpi - chmod +x /etc/cron.daily/dietpi - cp /DietPi/dietpi/conf/cron.hourly_dietpi /etc/cron.hourly/dietpi - chmod +x /etc/cron.hourly/dietpi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 146 )); then - #------------------------------------------------------------------------------- - #Shairport sync 3.0.2: https://github.com/Fourdee/DietPi/issues/819 - #MPD 19.21: https://github.com/Fourdee/DietPi/issues/821 - #NetData 1.6: https://github.com/Fourdee/DietPi/issues/832 - #Chromium: https://github.com/Fourdee/DietPi/issues/835 - /DietPi/dietpi/dietpi-software reinstall 37 65 113 128 - #------------------------------------------------------------------------------- - #New installs: pump default locale into sys env: https://github.com/Fourdee/DietPi/issues/825 - if [ ! -f /DietPi/dietpi/.installed ]; then - - cat << _EOF_ > /etc/environment -LC_ALL=en_GB.UTF-8 -LANG=en_GB.UTF-8 -_EOF_ - - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 147 )); then - #------------------------------------------------------------------------------- - #Apply WiFi country code to cfg80211 mod params, aswell as 'iw reg set' (currently): https://github.com/Fourdee/DietPi/issues/838 - echo -e "options cfg80211 ieee80211_regdom=$(cat /DietPi/dietpi.txt | grep -m1 '^wifi_country_code=' | sed 's/.*=//')" > /etc/modprobe.d/cfg80211.conf - #------------------------------------------------------------------------------- - #Delay boot until network is established: 0=disabled | 1=10 second wait max (default) | 2=infinite wait: https://github.com/Fourdee/DietPi/issues/842 - if (( ! $(cat /DietPi/dietpi.txt | grep -ci -m1 '^boot_wait_for_network=') )); then - - echo -e "\nboot_wait_for_network=1\n" >> /DietPi/dietpi.txt - - fi - #------------------------------------------------------------------------------- - #update cron jobs, removal of old df code for TRIM - cp /DietPi/dietpi/conf/cron.daily_dietpi /etc/cron.daily/dietpi - chmod +x /etc/cron.daily/dietpi - cp /DietPi/dietpi/conf/cron.hourly_dietpi /etc/cron.hourly/dietpi - chmod +x /etc/cron.hourly/dietpi - #------------------------------------------------------------------------------- - #ARMbian log2ram cron job cleanup: http://dietpi.com/phpbb/viewtopic.php?f=11&t=1580&p=6478#p6478 - rm /etc/cron.hourly/log2ram &> /dev/null - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 148 )); then - #------------------------------------------------------------------------------- - #Sudo UID bit (was missing from finalize script): https://github.com/Fourdee/DietPi/issues/794 - chmod 4755 /usr/bin/sudo - #------------------------------------------------------------------------------- - #Create DietPi user: https://github.com/Fourdee/DietPi/issues/796 - /DietPi/dietpi/func/dietpi-set_software useradd dietpi - #------------------------------------------------------------------------------- - #DietPi-Config + display rotation options: https://github.com/Fourdee/DietPi/issues/859 - if (( $G_HW_MODEL < 10 )); then - - if (( ! $(cat /DietPi/config.txt | grep -ci -m1 'display_rotate=') )); then - - echo -e "\ndisplay_rotate=0" >> /DietPi/config.txt - - fi - - if (( ! $(cat /DietPi/config.txt | grep -ci -m1 'lcd_rotate=') )); then - - echo -e "\nlcd_rotate=0" >> /DietPi/config.txt - - fi - - fi - #------------------------------------------------------------------------------- - #+ARMbian increase console verbose - sed -i '/verbosity=/c\verbosity=7' /boot/armbianEnv.txt &> /dev/null - #------------------------------------------------------------------------------- - #AmiBerry name change: https://github.com/Fourdee/DietPi/issues/850 - if [ -f /DietPi/dietpi/.installed ] && - (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 '^aSOFTWARE_INSTALL_STATE\[108\]=2') )); then - - killall -w uae4arm-rpi - - mv /etc/uae4arm-rpi /etc/amiberry - mv "$G_FP_DIETPI_USERDATA"/uae4arm-rpi "$G_FP_DIETPI_USERDATA"/amiberry - systemctl disable uae4arm-rpi.service - rm /etc/systemd/system/uae4arm-rpi.service - systemctl daemon-reload - - userdel -f amiberry - - fi - #------------------------------------------------------------------------------- - #Reinstalls (RPI) - # FFmpeg RPi (OpenMAX HW enc): https://github.com/Fourdee/DietPi/issues/869 - # AmiBerry (Name change): https://github.com/Fourdee/DietPi/issues/850 - if (( $G_HW_MODEL < 10 )); then - - /DietPi/dietpi/dietpi-software reinstall 7 108 - - fi - # (ALL) - # NAA Daemon: 3.5.1-35 - /DietPi/dietpi/dietpi-software reinstall 124 - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 149 )); then - #------------------------------------------------------------------------------- - #Remove ARMbian-config left on Neo image: - rm /etc/profile.d/check_first_login_reboot.sh &> /dev/null - #------------------------------------------------------------------------------- - #XU4 kernel 4.9 prep: https://github.com/Fourdee/DietPi/issues/899 - if (( $G_HW_MODEL == 11 && $(uname -r | grep -ci -m1 '^3.' ) )); then - - # - Replace /dev/mmcblk0p* in /etc/fstab + boot.ini with UUID as required by 4.9 kernel+uboot - # MMC0p1 - UUID_CURRENT=$(blkid /dev/mmcblk0p1 -s UUID -o value) - sed -i "s#^/dev/mmcblk0p1#UUID=$UUID_CURRENT#g" /etc/fstab - - # MMC0p2 - UUID_CURRENT=$(blkid /dev/mmcblk0p2 -s UUID -o value) - sed -i "s#^/dev/mmcblk0p2#UUID=$UUID_CURRENT#g" /etc/fstab - systemctl daemon-reload - - sed -i "s#root=/dev/mmcblk0p2#root=UUID=$UUID_CURRENT#g" /DietPi/boot.ini - - # - XU3/4 DTBs are now unique, but, we have no known way of knowing if XU3 or XU4 is current board via system cmds: - # Copy xu3 dtb to xu4 dtb so we can prep for this now when 4.9 arrives - cp /boot/exynos5422-odroidxu3.dtb /boot/exynos5422-odroidxu4.dtb - - # Assume XU4 - if (( ! $G_USER_INPUTS )); then - - sed -i "s#exynos5422-odroidxu3.dtb#exynos5422-odroidxu4.dtb#g" /DietPi/boot.ini - - # Request - else - - whiptail --title "XU4 4.9 Prep" --yesno "In preperation for the XU4 4.9 kernel, DTB's will be unique for XU3/4 boards.\n\nIs this board an Odroid XU4 (eg: NOT XU3)?" --backtitle "DietPi-Update" 12 70 - if (( $? == 0 )); then - - sed -i "s#exynos5422-odroidxu3.dtb#exynos5422-odroidxu4.dtb#g" /DietPi/boot.ini - - fi - - fi - - fi - #------------------------------------------------------------------------------- - #Minor tweaks to cron.hourly - cp /DietPi/dietpi/conf/cron.hourly_dietpi /etc/cron.hourly/dietpi - chmod +x /etc/cron.hourly/dietpi - #------------------------------------------------------------------------------- - #DietPi-Drive_Manager RO under '/': - cat << _EOF_ > /etc/systemd/system/dietpi-ramdisk.service -[Unit] -Description=DietPi-RAMdisk -After=local-fs.target - -[Service] -Type=forking -RemainAfterExit=yes -ExecStartPre=/bin/mkdir -p /var/tmp/dietpi/logs -ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramdisk 0' -ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramdisk 1' - -[Install] -WantedBy=local-fs.target -_EOF_ - systemctl enable dietpi-ramdisk.service - systemctl daemon-reload - #------------------------------------------------------------------------------- - #NanoPi M3 update DietPi kernel: https://github.com/Fourdee/DietPi/issues/763 + https://github.com/Fourdee/DietPi/issues/920 - if (( $G_HW_MODEL == 62 )); then - - /DietPi/dietpi/func/dietpi-set_hardware kernel nanopim3 - - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 150 )); then - #------------------------------------------------------------------------------- - #Fix for VM fstab: https://github.com/Fourdee/DietPi/issues/960 - # Removal of quotations in UUID entry - if (( $G_HW_MODEL == 20 )); then - - sed -i 's#"044766be-96ca-491a-a93f-913b75a843bd"#044766be-96ca-491a-a93f-913b75a843bd#g' /etc/fstab - systemctl daemon-reload - - fi - #------------------------------------------------------------------------------- - #Reinstalls - # Shairport-sync: https://github.com/Fourdee/DietPi/issues/962 - /DietPi/dietpi/dietpi-software reinstall 37 - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 151 )); then - #------------------------------------------------------------------------------- - #Reinstalls - # WiringPi: https://github.com/Fourdee/DietPi/issues/1001 - /DietPi/dietpi/dietpi-software reinstall 70 - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 152 )); then - #------------------------------------------------------------------------------- - #Disable /tmp tmpfs if RAM <= 512MB: https://github.com/Fourdee/DietPi/issues/1027 - if (( $(free -m | grep -m1 'Mem:' | awk '{print $2}') <= 512 )); then - - sed -i -e "\@[[:space:]]/tmp[[:space:]]@s@^#*@#@" /etc/fstab - systemctl daemon-reload - mount -a - - fi - #------------------------------------------------------------------------------- - #Disable SystemD daily apt processing: https://github.com/Fourdee/DietPi/issues/1032#issuecomment-311942730 - systemctl mask apt-daily.service &> /dev/null - systemctl mask apt-daily-upgrade.timer &> /dev/null - #------------------------------------------------------------------------------- - #Odroid C2 Stretch, missing gnupg, install on all systems by default: https://github.com/Fourdee/DietPi/issues/1032 - G_AGI gnupg - #------------------------------------------------------------------------------- - #Firmware for Native PC: https://github.com/Fourdee/DietPi/issues/1007#issuecomment-312442384 - if (( $G_HW_MODEL == 21 )); then - - G_AGI firmware-linux-nonfree - cp /boot/dietpi/conf/htoprc /root/.config/htop/htoprc # Also missing our htop cfg - - fi - #------------------------------------------------------------------------------- - #Sparky kernel update: - # v151 | Updated kernel.dtb for USB Bridge support - # v153 | Updated driver for Piano DAC + (dual output modes) - if (( $G_HW_MODEL == 70 )); then - - wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/usb-port1-enable/kernel.dtb -O /boot/kernel.dtb - wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/piano-dac-plus-mono/snd-soc-allo-piano-dac-plus.ko -O /lib/modules/$(uname -r)/kernel/sound/soc/atc260x/snd-soc-allo-piano-dac-plus.ko - - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 153 )); then - #------------------------------------------------------------------------------- - #NTPD mirror: https://github.com/Fourdee/DietPi/issues/1049 - if (( ! $(cat /DietPi/dietpi.txt | grep -ci -m1 '^NTPD_Mirror=') )); then - - cat << _EOF_ >> /DietPi/dietpi.txt -#NTPD mirror, applied to /etc/ntp.conf -# For a full list, please see http://www.pool.ntp.org -# Please remove the initial interger and full stop from the value (removing 0.). eg: debian.pool.ntp.org -NTPD_Mirror=debian.pool.ntp.org -_EOF_ - - fi - #------------------------------------------------------------------------------- - # + RPi SDTV modes: https://github.com/Fourdee/DietPi/issues/1058 - if (( ! $(cat /DietPi/config.txt | grep -ci -m1 'sdtv_mode=') )); then - - cat << _EOF_ >> /DietPi/config.txt -#sdtv_mode=0 -_EOF_ - - fi - #------------------------------------------------------------------------------- - # Purge unnecessary pciutils package: https://github.com/Fourdee/DietPi/issues/1068 - G_AGP pciutils - #------------------------------------------------------------------------------- - # RPi Stretch: Switch to new stretch repo on archive.raspberrypi.org: https://github.com/Fourdee/DietPi/issues/1077 - if (( $G_HW_MODEL < 10 && $G_DISTRO == 4 )); then # RPi + Stretch - echo "deb https://archive.raspberrypi.org/debian/ stretch main ui" > /etc/apt/sources.list.d/raspi.list - G_AGUP - G_AGDUG - fi - #------------------------------------------------------------------------------- - #Native PC, add i386 support by default - if (( $G_HW_MODEL == 21 )); then - - dpkg --add-architecture i386 - G_AGUP - - fi - #------------------------------------------------------------------------------- - #Open Bazaar SystemD service: - if [ -f /DietPi/dietpi/.installed ] && - (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 '^aSOFTWARE_INSTALL_STATE\[58\]=2') )); then - - cat << _EOF_ > /etc/systemd/system/openbazaar.service -[Unit] -Description=openbazaar - -[Service] -Type=simple -WorkingDirectory=/etc/openbazaar-server -ExecStart=$(which python) openbazaard.py start -a 0.0.0.0 - -[Install] -WantedBy=multi-user.target -_EOF_ - systemctl daemon-reload - /DietPi/dietpi/dietpi-services dietpi_controlled - - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 154 )); then - #------------------------------------------------------------------------------- - #Deb multimedia repo remove for ALL installs: https://github.com/Fourdee/DietPi/issues/1096#issuecomment-318076721 - rm /etc/apt/sources.list.d/deb-multimedia.list &> /dev/null - #------------------------------------------------------------------------------- - #Fix error log on disabled IPv6: https://github.com/Fourdee/DietPi/issues/1119 - sed -i '/net.ipv6.conf.all.disable_ipv6 /c\' /etc/sysctl.conf - sed -i '/net.ipv6.conf.default.disable_ipv6 /c\' /etc/sysctl.conf - sed -i '/net.ipv6.conf.lo.disable_ipv6 /c\' /etc/sysctl.conf - #------------------------------------------------------------------------------- - #Prefer to use wlan/eth naming for networked devices (eg: stretch) - ln -s /dev/null /etc/systemd/network/99-default.link - #------------------------------------------------------------------------------- - #Force auto size/gen of swapfile: https://github.com/Fourdee/DietPi/issues/1126#issuecomment-326749203 - /DietPi/dietpi/func/dietpi-set_dphys-swapfile 1 - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 155 )); then - #------------------------------------------------------------------------------- - #Sparky kernel update to resolve slow playback under 16bit: https://community.roonlabs.com/t/allo-usbridge-board/27487/148 - if (( $G_HW_MODEL == 70 )); then - - /DietPi/dietpi/func/dietpi-set_hardware kernel sparky_sbc - - # - Update disabled modules - cat << _EOF_ > /etc/modprobe.d/disable_sparkysbc_touchscreen.conf -blacklist owl_camera -blacklist gsensor_stk8313 -blacklist ctp_ft5x06 -blacklist ctp_gsl3680 -blacklist gsensor_bma222 -blacklist gsensor_mir3da -_EOF_ - - cat << _EOF_ > /etc/modprobe.d/disable_sparkysbc_gpu.conf -blacklist pvrsrvkm -blacklist drm -blacklist videobuf2_vmalloc -blacklist bc_example -_EOF_ - - fi - #------------------------------------------------------------------------------- - #dietpi.txt entry for cpu_min_freq: https://github.com/Fourdee/DietPi/pull/1148 - if (( ! $(cat /DietPi/dietpi.txt | grep -ci -m1 '^cpu_min_frequency=') )); then - - cat << _EOF_ >> /DietPi/dietpi.txt -cpu_min_frequency=Disabled -_EOF_ - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 156 )); then - #------------------------------------------------------------------------------- - #Set Ondemand as default CPU gov: https://github.com/Fourdee/DietPi/issues/1141 - sed -i "/cpu_governor=/c\cpu_governor=ondemand" /DietPi/dietpi.txt - #------------------------------------------------------------------------------- - - 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 "$G_FP_DIETPI_USERDATA"/roon/RoonBridge/Settings/unique_id - rm "$G_FP_DIETPI_USERDATA"/roon/RAATServer/Settings/unique_id - - fi - #------------------------------------------------------------------------------- - #Reinstalls - # Squeezelite / Shairport-sync - /DietPi/dietpi/dietpi-software reinstall 36 37 - #------------------------------------------------------------------------------- - #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 - -[Service] -Type=oneshot -ExecStart=/bin/bash -c 'killall sshd &> /dev/null; killall dropbear &> /dev/null' - -[Install] -WantedBy=poweroff.target halt.target reboot.target -_EOF_ - systemctl daemon-reload - systemctl enable kill-ssh-user-sessions-before-network - #------------------------------------------------------------------------------- - #config.txt missing newline on older images, and uploaded/shared confs (<145) - echo -e "\n" >> /DietPi/config.txt - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 158 )); then - #------------------------------------------------------------------------------- - #RPi update DietPi kernel: - if (( $G_HW_MODEL < 10 )); then - - /DietPi/dietpi/func/dietpi-set_hardware kernel dietpi_rpi - - # Sabre module update - if (( $(cat /DietPi/config.txt | grep -ci -m1 'dtoverlay=i-sabre-k2m') )); then - - 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 - - fi - #------------------------------------------------------------------------------- - #x86_64, blacklist by nouveau default, prefer Nvidia driver installer - # Disable nouveau: https://github.com/Fourdee/DietPi/issues/1244 // http://dietpi.com/phpbb/viewtopic.php?f=11&t=2462&p=9688#p9688 - if (( $G_HW_ARCH == 10 )); then - - cat << _EOF_ > /etc/modprobe.d/blacklist-nouveau.conf -blacklist nouveau -blacklist lbm-nouveau -options nouveau modeset=0 -alias nouveau off -alias lbm-nouveau off -_EOF_ - - echo -e "options nouveau modeset=0" > /etc/modprobe.d/nouveau-kms.conf - - update-initramfs -u - - fi - #------------------------------------------------------------------------------- - #WiFi, switch to wpa_supplicant.conf: https://github.com/Fourdee/DietPi/issues/1262 - # Netplug no longer compatible - apt-get purge netplug -y - - # + dietpi.txt entries - if (( ! $(grep -ci -m1 'Wifi_KEYMGR=' /DietPi/dietpi.txt) )); then - - cat << _EOF_ >> /DietPi/dietpi.txt -Wifi_KEYMGR=WPA-PSK -_EOF_ - - fi - - # Patch - if (( $(grep -ci -m1 'wpa-psk' /etc/network/interfaces) )); then - - # get current - WIFI_SSID=$(grep -m1 '^wpa-ssid' /etc/network/interfaces | sed 's/wpa-ssid[[:space:]]//') - WIFI_KEY=$(grep -m1 '^wpa-psk' /etc/network/interfaces | sed 's/wpa-psk[[:space:]]//') - WIFI_COUNTRY_CODE=$( grep -m1 '^wifi_country_code=' /DietPi/dietpi.txt | sed 's/.*=//') - - # update globals - sed -i "/^Wifi_SSID=/c\Wifi_SSID=$WIFI_SSID" /DietPi/dietpi.txt - sed -i "/^Wifi_KEY=/c\Wifi_KEY=$WIFI_KEY" /DietPi/dietpi.txt - - # remove entries, replaced by wpa_supp - sed -i '/wireless-essid[[:space:]]/d' /etc/network/interfaces - sed -i '/wireless-key[[:space:]]/d' /etc/network/interfaces - sed -i '/wireless-mode[[:space:]]/d' /etc/network/interfaces - sed -i '/wpa-ssid[[:space:]]/d' /etc/network/interfaces - sed -i '/wpa-psk[[:space:]]/d' /etc/network/interfaces - - # + wpa supp config link (exclude hotspot) - if [ ! -f /usr/sbin/hostapd ]; then - - sed -i "/wireless-power/a\wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf" /etc/network/interfaces - - fi - - systemctl daemon-reload - - /DietPi/dietpi/func/dietpi-set_hardware wificreds set - - fi - #------------------------------------------------------------------------------- - #PHP: Fix 'upload_tmp_dir': https://github.com/Fourdee/DietPi/issues/1259 - if [ -f /lib/systemd/system/apache2.service ]; then - - PHP_SERVICE='/lib/systemd/system/apache2.service' - - else - - PHP_SERVICE='/lib/systemd/system/php*-fpm.service' - - fi - if grep -q '^\s*PrivateTmp=true' $PHP_SERVICE &> /dev/null; then - - if (( $G_DISTRO >= 4 )); then - - DIETPI_PHP_INI="/etc/php/7.0/mods-available/dietpi.ini" - PHP_BIN="php" - - else - - DIETPI_PHP_INI="/etc/php5/mods-available/dietpi.ini" - PHP_BIN="php5" - - fi - grep -q 'upload_tmp_dir' $DIETPI_PHP_INI && - sed -i '/upload_tmp_dir/c\upload_tmp_dir = /var/tmp' $DIETPI_PHP_INI || - echo 'upload_tmp_dir = /var/tmp' >> $DIETPI_PHP_INI - ${PHP_BIN}enmod dietpi - - fi - #------------------------------------------------------------------------------- - #XU4 FFMPEG fix. Prefer debian.org over Meveric for backports: https://github.com/Fourdee/DietPi/issues/1273 - if (( $G_HW_MODEL == 11 && $G_DISTRO == 3 )); then - - cat << _EOF_ > /etc/apt/preferences.d/backports -Package: * -Pin: release a=jessie-backports -Pin: origin "fuzon.co.uk" -Pin-Priority: 99 -_EOF_ - - fi - #------------------------------------------------------------------------------- - - elif (( $VERSION_CURRENT == 159 )); then - #------------------------------------------------------------------------------- - #Verify/update dietpi.txt entries: - #NB: After v160, dietpi-update will do this prior to each update - /DietPi/dietpi/func/dietpi-set_software verify_dietpi.txt - #------------------------------------------------------------------------------- - #FHS changes: https://github.com/Fourdee/DietPi/issues/1297 - # APT now IPv4 forced: - # - Update core ENV - sed -i '/prefer_ipversion=/c\Sprefer_ipversion=ipv4' /DietPi/dietpi.txt - /DietPi/dietpi/func/dietpi-set_core_environment - - # - Revert of https://github.com/Fourdee/DietPi/issues/1329#issuecomment-353586754 - # Disabled/replaced in /DietPi/dietpi/func/dietpi-set_core_environment generation - unset LD_LIBRARY_PATH - ldconfig - - # - DietPi-autostart custom script moved - mkdir -p /var/lib/dietpi/dietpi-autostart &> /dev/null - mv /etc/dietpi/autostart.sh /var/lib/dietpi/dietpi-autostart/custom.sh &> /dev/null - - # - wifi-monitor moved - mv /etc/dietpi/dietpi-wifi-monitor.sh /var/lib/dietpi/dietpi-wifi-monitor.sh &> /dev/null - - # - /etc/dietpi/.ntpd_exit_status moved, although, we can simply delete this and have it regened on run - rm /etc/dietpi/.ntpd_exit_status &> /dev/null - - # - DietPi-software non-systemD services moved - mv /etc/dietpi/dietpi-software/services /var/lib/dietpi/dietpi-software &> /dev/null - - # - Remove kernel flags (not used in our scripts) - rm /etc/dietpi/.dietpi_rpi &> /dev/null - rm /etc/dietpi/.384khz_rpi &> /dev/null - - # - Desktop icons - mv /etc/dietpi/desktop_icons /var/lib/dietpi/dietpi-software/installed/ &> /dev/null - sed -i 's#^Icon=/etc/dietpi/desktop_icons#/var/lib/dietpi/dietpi-software/installed/desktop_icons#g' /var/lib/dietpi/dietpi-software/installed/desktop_icons/*.desktop &> /dev/null - - #------------------------------------------------------------------------------- - #Sparky SBC patches - if (( $G_HW_MODEL == 70 )); then - - # Updated kernel which resolves HQplayer playback issues. - wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dragon_fly_check/uImage -O /boot/uImage - wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dragon_fly_check/3.10.38.bz2 -O package.tar - tar xvf package.tar -C /lib/modules/ - rm package.tar - - cat << _EOF_ > /DietPi/uEnv.txt -uenvcmd=setenv os_type linux; -bootargs=earlyprintk clk_ignore_unused selinux=0 scandelay console=tty0 loglevel=1 real_rootflag=rw root=/dev/mmcblk0p2 rootwait init=/lib/systemd/systemd aotg.urb_fix=1 aotg.aotg1_speed=0 -_EOF_ - - # enable aotg.aotg1_speed compatibility setting for USB 1.1, when USB-DAC configured: https://github.com/Fourdee/DietPi/issues/1301 - if (( $(grep -ci -m1 '^soundcard=usb-dac' /DietPi/dietpi.txt) )); then - - sed -i 's/aotg.aotg1_speed=0/aotg.aotg1_speed=1/' /DietPi/uEnv.txt - - fi - - # Set performance CPU gov for stability - sed -i "/^cpu_governor=/c\cpu_governor=performance" /DietPi/dietpi.txt - /DietPi/dietpi/dietpi-cpu_set - - fi - #------------------------------------------------------------------------------- - #@MichaIng Move Stretch instances from MySQL to MariaDB: https://github.com/Fourdee/DietPi/pull/1280 - if grep -q 'aSOFTWARE_INSTALL_STATE\[86\]=2' /DietPi/dietpi/.installed && (( $G_DISTRO > 3 )); then - - apt -y install mariadb-server - apt -y purge mysql-server default-mysql-server - sed -i 's/aSOFTWARE_INSTALL_STATE\[86\]=2/aSOFTWARE_INSTALL_STATE\[86\]=0/' /DietPi/dietpi/.installed - sed -i 's/aSOFTWARE_INSTALL_STATE\[88\]=0/aSOFTWARE_INSTALL_STATE\[88\]=2/' /DietPi/dietpi/.installed - # Also manually switch webstacks to MariaDB: - if grep -q 'aSOFTWARE_INSTALL_STATE\[74\]=2' /DietPi/dietpi/.installed; then - - sed -i 's/aSOFTWARE_INSTALL_STATE\[74\]=2/aSOFTWARE_INSTALL_STATE\[74\]=0/' /DietPi/dietpi/.installed - sed -i 's/aSOFTWARE_INSTALL_STATE\[76\]=0/aSOFTWARE_INSTALL_STATE\[76\]=2/' /DietPi/dietpi/.installed - - fi - if grep -q 'aSOFTWARE_INSTALL_STATE\[77\]=2' /DietPi/dietpi/.installed; then - - sed -i 's/aSOFTWARE_INSTALL_STATE\[77\]=2/aSOFTWARE_INSTALL_STATE\[77\]=0/' /DietPi/dietpi/.installed - sed -i 's/aSOFTWARE_INSTALL_STATE\[79\]=0/aSOFTWARE_INSTALL_STATE\[79\]=2/' /DietPi/dietpi/.installed - - fi - if grep -q 'aSOFTWARE_INSTALL_STATE\[80\]=2' /DietPi/dietpi/.installed; then - - sed -i 's/aSOFTWARE_INSTALL_STATE\[80\]=2/aSOFTWARE_INSTALL_STATE\[80\]=0/' /DietPi/dietpi/.installed - sed -i 's/aSOFTWARE_INSTALL_STATE\[82\]=0/aSOFTWARE_INSTALL_STATE\[82\]=2/' /DietPi/dietpi/.installed - - fi - - fi - #------------------------------------------------------------------------------- - #Reinstalls | Moved from v159 - # Allo GUI (full) - # MPD - # NAA Daemon - # NC - # OC - # Squeezelite - # YMPD - # Pi-SPC (due to FHS changes, moved script) - update-rc.d ympd remove &> /dev/null # switch to systemD - rm /etc/init.d/ympd &> /dev/null # switch to systemD - - # Enable ownCloud/Nextcloud maintenance mode before reinstall: - systemctl start mysql &> /dev/null - sudo -u www-data php /var/www/owncloud/occ maintenance:mode --on &> /dev/null - sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on &> /dev/null - - /DietPi/dietpi/dietpi-software reinstall 159 128 124 114 47 36 32 166 - #------------------------------------------------------------------------------- - #DietPi-Globals: https://github.com/Fourdee/DietPi/issues/1311 - if (( ! $(grep -ci -m1 'dietpi-globals' /root/.bashrc) )); then - - cat << _EOF_ >> /root/.bashrc -. /DietPi/dietpi/func/dietpi-globals -_EOF_ - - cat << _EOF_ >> /home/dietpi/.bashrc -. /DietPi/dietpi/func/dietpi-globals -_EOF_ - chown dietpi:dietpi /home/dietpi/.bashrc - - fi - #------------------------------------------------------------------------------- - #Fix apt-daily.service error on boot: https://github.com/Fourdee/DietPi/issues/1330 - if (( $G_DISTRO > 3 )); then - - systemctl mask apt-daily.service &> /dev/null - systemctl mask apt-daily.timer &> /dev/null - systemctl mask apt-daily-upgrade.service &> /dev/null - systemctl mask apt-daily-upgrade.timer &> /dev/null - - fi + echo 0 #------------------------------------------------------------------------------- fi diff --git a/dietpi/server_version b/dietpi/server_version index 7fce2b5853..c76772f8fe 100644 --- a/dietpi/server_version +++ b/dietpi/server_version @@ -1,2 +1,2 @@ 160 -5 +6 From 67de77a360aea3d873d0b70e5b4395bf4f8d3a5d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 31 Dec 2017 14:40:12 +0100 Subject: [PATCH 162/390] v6.0 + Revert apt-mark auto manually installed dependencies, as we cannot guarantee, that not other software needs them. --- dietpi/dietpi-software | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index bf6a6b3d46..c7590400e3 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -13425,7 +13425,7 @@ _EOF_ elif (( $1 == 128 )); then - apt-mark auto libavformat57 libupnp6 libmpdclient2 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file &> /dev/null + #apt-mark auto libavformat57 libupnp6 libmpdclient2 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file &> /dev/null apt-mark unhold mpd 1> /dev/null (( $G_DISTRO == 3 && $G_HW_ARCH != 3 )) && AGP_ERROR_HANDLED mpd || G_RUN_CMD dpkg -P mpd userdel -f mpd &> /dev/null @@ -13447,13 +13447,13 @@ _EOF_ elif (( $1 == 123 )); then - apt-mark auto libssl1.0.0 libwebsockets3 &> /dev/null + #apt-mark auto libssl1.0.0 libwebsockets3 &> /dev/null AGP_ERROR_HANDLED mosquitto rm /etc/apt/sources.list.d/mosquitto-*.list elif (( $1 == 124 )); then - apt-mark auto gcc-6-base libstdc++6 &> /dev/null + #apt-mark auto gcc-6-base libstdc++6 &> /dev/null G_RUN_CMD dpkg -P networkaudiod elif (( $1 == 125 )); then @@ -13498,7 +13498,7 @@ _EOF_ elif (( $1 == 134 )); then - apt-mark auto libjpeg8 libpng12-0 libfontconfig1 &> /dev/null + #apt-mark auto libjpeg8 libpng12-0 libfontconfig1 &> /dev/null rm /etc/systemd/system/tonido.service @@ -13516,7 +13516,7 @@ _EOF_ elif (( $1 == 136 )); then - apt-mark auto v4l-utils python python-dev libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev libx264-142 libavcodec56 libavformat56 libmysqlclient18 libswscale3 libpq5 &> /dev/null + #apt-mark auto v4l-utils python python-dev libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev libx264-142 libavcodec56 libavformat56 libmysqlclient18 libswscale3 libpq5 &> /dev/null (( $G_DISTRO > 3 )) && AGP_ERROR_HANDLED motion || G_RUN_CMD dpkg -P motion rm -R /etc/motioneye @@ -13786,7 +13786,7 @@ _EOF_ elif (( $1 == 35 )); then - apt-mark auto libxml-parser-perl zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev &> /dev/null + #apt-mark auto libxml-parser-perl zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev &> /dev/null G_RUN_CMD dpkg -P logitechmediaserver rm /var/lib/dietpi/dietpi-software/services/squeezeboxserver.service rm -R /var/lib/squeezeboxserver @@ -13874,7 +13874,7 @@ _EOF_ elif (( $1 == 60 )); then - apt-mark auto libssl1.0.0 &> /dev/null + #apt-mark auto libssl1.0.0 &> /dev/null AGP_ERROR_HANDLED hostapd isc-dhcp-server rm /etc/dhcp/dhcpd.conf &> /dev/null @@ -13920,7 +13920,7 @@ _EOF_ elif (( $1 == 37 )); then - apt-mark auto libssl1.0.0 openssl libsoxr0 libavahi-client3 libtool libconfig9 libpopt0 libdaemon0 &> /dev/null + #apt-mark auto libssl1.0.0 openssl libsoxr0 libavahi-client3 libtool libconfig9 libpopt0 libdaemon0 &> /dev/null #No package is installed anymore, files are directly extracted into places, need to remove them manually? #https://github.com/Fourdee/DietPi/blob/testing/dietpi/dietpi-software#L5968 #G_RUN_CMD dpkg -P shairport-sync @@ -13973,7 +13973,7 @@ _EOF_ elif (( $1 == 65 )); then - apt-mark auto zlib1g-dev &> /dev/null + #apt-mark auto zlib1g-dev &> /dev/null #all rm /etc/systemd/system/netdata.service @@ -14109,7 +14109,7 @@ _EOF_ elif (( $1 == 113 )); then - apt-mark auto libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7 &> /dev/null + #apt-mark auto libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7 &> /dev/null apt-mark unhold chromium chromedriver rm /etc/chromium.d/custom_flags @@ -14223,7 +14223,7 @@ _EOF_ elif (( $1 == 163 )); then - apt-mark auto libupnp6 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-alsa &> /dev/null + #apt-mark auto libupnp6 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-alsa &> /dev/null G_RUN_CMD dpkg -P gmrender rm /etc/systemd/system/gmrender.service @@ -14343,7 +14343,7 @@ _EOF_ elif (( $1 == 6 )); then - apt-mark auto aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump* xf86-video-fbturbo* firmware-samsung xf86-video-armsoc-odroid malit628-odroid &> /dev/null + #apt-mark auto aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump* xf86-video-fbturbo* firmware-samsung xf86-video-armsoc-odroid malit628-odroid &> /dev/null AGP_ERROR_HANDLED xcompmgr xterm xinit xauth xserver-xorg dbus-x11 xfonts-base x11-xserver-utils x11-common x11-utils rm /etc/xdg/autostart/xcompmgr.desktop /etc/X11/xorg.conf &> /dev/null From a934f39b7412a4e70da958425c7883d1c2a9741a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 31 Dec 2017 14:43:45 +0100 Subject: [PATCH 163/390] v6.0 + Purge libmpdclient2 on uninstalling mpd. --- dietpi/dietpi-software | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index c7590400e3..b2c5097138 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -13425,9 +13425,9 @@ _EOF_ elif (( $1 == 128 )); then - #apt-mark auto libavformat57 libupnp6 libmpdclient2 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file &> /dev/null + #apt-mark auto libavformat57 libupnp6 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file &> /dev/null apt-mark unhold mpd 1> /dev/null - (( $G_DISTRO == 3 && $G_HW_ARCH != 3 )) && AGP_ERROR_HANDLED mpd || G_RUN_CMD dpkg -P mpd + (( $G_DISTRO == 3 && $G_HW_ARCH != 3 )) && AGP_ERROR_HANDLED mpd libmpdclient2 || G_RUN_CMD dpkg -P mpd libmpdclient2 userdel -f mpd &> /dev/null rm /lib/systemd/system/mpd.service rm -R "$G_FP_DIETPI_USERDATA"/.mpd_cache From 5af55db4d6e13701076ed02e17464aa784b7f478 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 31 Dec 2017 14:19:17 +0000 Subject: [PATCH 164/390] v6.0 + Prevent duplicate checks under same session: https://github.com/Fourdee/DietPi/issues/1311 --- dietpi/func/dietpi-globals | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 36d8139aa2..09eaac5579 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -165,31 +165,46 @@ } + G_CHECK_ROOT_USER_VERIFIED=${G_CHECK_ROOT_USER_VERIFIED:=0} #only check once for each session G_CHECK_ROOT_USER(){ - G_DIETPI-NOTIFY 2 'Checking for (elevated) root access, please wait..' + if (( ! $G_CHECK_ROOT_USER_VERIFIED )); then - if (( $UID != 0 )); then + G_DIETPI-NOTIFY 2 'Checking for (elevated) root access, please wait..' - G_DIETPI-NOTIFY 1 'Error: Root privileges required. Please run the command with "sudo"\n' - exit 1 + if (( $UID != 0 )); then - else + G_DIETPI-NOTIFY 1 'Error: Root privileges required. Please run the command with "sudo"\n' + exit 1 + + else - G_DIETPI-NOTIFY 0 'Root access verified.' + G_DIETPI-NOTIFY 0 'Root access verified.' + export G_CHECK_ROOT_USER_VERIFIED=1 + + fi fi } + G_CHECK_ROOTFS_RW_VERIFIED=${G_CHECK_ROOTFS_RW_VERIFIED:=0} #only check once for each session G_CHECK_ROOTFS_RW(){ - #RootFS RW check - /DietPi/dietpi/dietpi-drive_manager 3 - if (( $? != 0 )); then + if (( ! $G_CHECK_ROOTFS_RW_VERIFIED )); then + + #RootFS RW check + /DietPi/dietpi/dietpi-drive_manager 3 + if (( $? != 0 )); then - G_DIETPI-NOTIFY 1 'Error: RootFS is currently Read Only, unable to continue.\n' - exit 1 + G_DIETPI-NOTIFY 1 'Error: RootFS is currently Read Only, unable to continue.\n' + exit 1 + + else + + export G_CHECK_ROOTFS_RW_VERIFIED=1 + + fi fi @@ -865,4 +880,5 @@ $print_logfile_info #----------------------------------------------------------------------------------- G_DIETPI-NOTIFY 2 'DietPi-Globals loaded\n' #----------------------------------------------------------------------------------- + } From 1906d6a9c850a593f83a4b191676d435a06beff3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 31 Dec 2017 16:35:54 +0100 Subject: [PATCH 165/390] v6.0 DietPi-Prep + Adjust conf.d file naming to 99-dietpi-*, so we can easily find/reset/remove those in the future. + Make wget prefer IPv4 failure prove. Maybe we can build a script like this to savely adjust values inside config files, including to option to preserve or overwrite existing values, something like: G_EDIT_CONF -o "prefer-family =" "prefer-family = IPv4" "/etc/wgetrc" + Fix https://github.com/Fourdee/DietPi/issues/1285#issuecomment-354602594 by installing kernel/firmware/bootloader packages directly. This allows autoremove of older/different packages. + Some typos... --- PREP_SYSTEM_FOR_DIETPI.sh | 79 ++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 38 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index ba16999911..6c2d7efd39 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -35,7 +35,7 @@ ) # - APT force IPv4 - echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99force-ipv + echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99-dietpi-force-ipv4 for (( i=0; i<${#a_MIN_APT_PREREQS[@]}; i++)) do @@ -46,7 +46,7 @@ apt-get install -y ${a_MIN_APT_PREREQS[$i]} if (( $? != 0 )); then - echo -e "Error: unable to install ${a_MIN_APT_PREREQS[$i]}, please install it manually with\n - apt-get install ${a_MIN_APT_PREREQS[$i]} -y" + echo -e "Error: Unable to install ${a_MIN_APT_PREREQS[$i]}, please install it manually with\n - apt-get install -y ${a_MIN_APT_PREREQS[$i]}" exit 1 fi @@ -58,7 +58,11 @@ unset a_MIN_APT_PREREQS # - Wget prefer IPv4 - sed -i '/prefer-family =/c\prefer-family = IPv4' /etc/wgetrc &> /dev/null + grep -q '^[[:blank:]]*prefer-family =' /etc/wgetrc && + sed -i '/^[[:blank:]]*prefer-family =/c\prefer-family = IPv4' /etc/wgetrc || + grep -q '^[[:blank:]#;]*prefer-family =' /etc/wgetrc && + sed -i '/^[[:blank:]#;]*prefer-family =/c\prefer-family = IPv4' /etc/wgetrc || + echo 'prefer-family = IPv4' >> /etc/wgetrc #------------------------------------------------------------------------------------------------ #Globals @@ -236,7 +240,7 @@ G_DIETPI-NOTIFY 2 'Installing core packages, required for next stage of this script:' - G_AGI apt-transport-https wget unzip whiptail + G_AGI apt-transport-https unzip whiptail #------------------------------------------------------------------------------------------------ echo -e '' @@ -282,7 +286,7 @@ '20' 'x86_64 VMware/VirtualBox' '13' 'oDroid U3' '12' 'oDroid C2' - '11' 'oDroid XU3/4' + '11' 'oDroid XU3/4/HC1' '10' 'oDroid C1' '3' 'Raspberry Pi 3' '2' 'Raspberry Pi 2' @@ -306,13 +310,13 @@ G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ - WHIP_TITLE='Distro Selection:' + WHIP_TITLE='Distro selection:' WHIP_DESC="Please select a distro to install on this system. Selecting a distro that is older than the current installed on system, is not supported.\n\nCurrently installed:\n - $G_DISTRO $G_DISTRO_NAME" WHIP_DEFAULT_ITEM=$G_DISTRO DISTRO_LIST_ARRAY=( '3' 'Jessie (oldstable, just if you need to avoid upgrade to current release)' '4' 'Stretch (current stable release, recommended)' - '5' 'Buster (testing only, not officially suppoted)' + '5' 'Buster (testing only, not officially supported)' ) # - Enable/list available options based on criteria @@ -329,12 +333,12 @@ temp_distro_available=0 # - RPi disable buster - elif (( $temp_distro_index == 5 && $G_HW_MODEL < 10 )); then + #elif (( $temp_distro_index == 5 && $G_HW_MODEL < 10 )); then - G_DIETPI-NOTIFY 2 "Disabled Buster for RPi: index $temp_distro_index" - temp_distro_available=0 + # G_DIETPI-NOTIFY 2 "Disabled Buster for RPi: index $temp_distro_index" + # temp_distro_available=0 - fi + #fi # - Enable option if (( $temp_distro_available )); then @@ -376,6 +380,7 @@ #rm /etc/apt/sources.list.d/* &> /dev/null #Probably a bad idea rm /etc/apt/sources.list.d/deb-multimedia.list &> /dev/null #meveric + #rm /etc/apt/sources.list.d/armbian.list G_DIETPI-NOTIFY 2 "Setting APT sources.list: $DISTRO_TARGET_NAME $DISTRO_TARGET" @@ -390,6 +395,9 @@ _EOF_ deb https://archive.raspberrypi.org/debian/ $DISTRO_TARGET_NAME main ui _EOF_ + # Reset raspo.list to max available distro Stretch, which at least worked on first tests with Buster." + (( $DISTRO_TARGET > 4 )) && sed -i "s/$DISTRO_TARGET_NAME/stretch/" /etc/apt/sources.list.d/raspi.list + # - Set debian else @@ -421,14 +429,14 @@ _EOF_ G_AGUP # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files - G_DIETPI-NOTIFY 2 "Marking all packages as auto installed first, to allow allow effective autoremove afterwards" + G_DIETPI-NOTIFY 2 "Marking all packages as auto installed first, to allow effective autoremove afterwards" G_RUN_CMD apt-mark auto $(apt-mark showmanual) # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files G_DIETPI-NOTIFY 2 "Temporary disable automatic recommends/suggests installation and allow them to be autoremoved:" - export G_ERROR_HANDLER_COMMAND='/etc/apt/apt.conf.d/99dietpi_norecommends' + export G_ERROR_HANDLER_COMMAND='/etc/apt/apt.conf.d/99-dietpi-norecommends' cat << _EOF_ > $G_ERROR_HANDLER_COMMAND APT::Install-Recommends "false"; APT::Install-Suggests "false"; @@ -438,9 +446,9 @@ _EOF_ export G_ERROR_HANDLER_EXITCODE=$? G_ERROR_HANDLER - G_DIETPI-NOTIFY 2 "Forcing use of existing apt configs if available" + G_DIETPI-NOTIFY 2 "Forcing use of modified apt configs" - export G_ERROR_HANDLER_COMMAND='/etc/apt/apt.conf.d/99dietpi_forceconf' + export G_ERROR_HANDLER_COMMAND='/etc/apt/apt.conf.d/99-dietpi-forceconf' cat << _EOF_ > $G_ERROR_HANDLER_COMMAND Dpkg::options { "--force-confdef"; @@ -508,13 +516,14 @@ _EOF_ ) # - G_HW_ARCH specific required packages + # As these are kernel, firmware or bootloader packages, we need to install them directly to allow autoremove of in case older kernel packages: + # https://github.com/Fourdee/DietPi/issues/1285#issuecomment-354602594 # x86_64 if (( $G_HW_ARCH == 10 )); then - aPACKAGES_REQUIRED_INSTALL+=('linux-image-amd64') - grep 'vendor_id' /proc/cpuinfo | grep -qi 'intel' && aPACKAGES_REQUIRED_INSTALL+=('intel-microcode') - grep 'vendor_id' /proc/cpuinfo | grep -qi 'amd' && aPACKAGES_REQUIRED_INSTALL+=('amd64-microcode') - aPACKAGES_REQUIRED_INSTALL+=('firmware-linux-nonfree') + G_AGI linux-image-amd64 firmware-linux-nonfree + grep 'vendor_id' /proc/cpuinfo | grep -qi 'intel' && G_AGI intel-microcode + grep 'vendor_id' /proc/cpuinfo | grep -qi 'amd' && G_AGI amd64-microcode #aPACKAGES_REQUIRED_INSTALL+=('firmware-misc-nonfree') #aPACKAGES_REQUIRED_INSTALL+=('dmidecode') @@ -522,12 +531,12 @@ _EOF_ if (( $(dpkg --get-selections | grep -ci -m1 '^grub-efi-amd64[[:space:]]') )) || [ -d /boot/efi ]; then - aPACKAGES_REQUIRED_INSTALL+=('grub-efi-amd64') + G_AGI grub-efi-amd64 # Grub BIOS else - aPACKAGES_REQUIRED_INSTALL+=('grub-pc') + G_AGI grub-pc fi @@ -537,38 +546,33 @@ _EOF_ # RPi if (( $G_HW_MODEL < 10 )); then - aPACKAGES_REQUIRED_INSTALL+=('libraspberrypi-bin') - aPACKAGES_REQUIRED_INSTALL+=('libraspberrypi0') - aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-bootloader') - aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-kernel') - aPACKAGES_REQUIRED_INSTALL+=('raspberrypi-sys-mods') - aPACKAGES_REQUIRED_INSTALL+=('raspi-copies-and-fills') + G_AGI libraspberrypi-bin libraspberrypi0 raspberrypi-bootloader raspberrypi-kernel raspberrypi-sys-mods raspi-copies-and-fills # Odroid C2 elif (( $G_HW_MODEL == 12 )); then - aPACKAGES_REQUIRED_INSTALL+=('linux-image-arm64-odroid-c2') + G_AGI linux-image-arm64-odroid-c2 - # Odroid XU3/4 + # Odroid XU3/4/HC1 elif (( $G_HW_MODEL == 11 )); then - #aPACKAGES_REQUIRED_INSTALL+=('linux-image-4.9-armhf-odroid-xu3') - aPACKAGES_REQUIRED_INSTALL+=('linux-image-armhf-odroid-xu3') + G_AGI linux-image-4.9-armhf-odroid-xu3 + #aPACKAGES_REQUIRED_INSTALL+=('linux-image-armhf-odroid-xu3') # Odroid C1 elif (( $G_HW_MODEL == 10 )); then - aPACKAGES_REQUIRED_INSTALL+=('linux-image-armhf-odroid-c1') + G_AGI linux-image-armhf-odroid-c1 # Rock64 elif (( $G_HW_MODEL == 43 )); then - aPACKAGES_REQUIRED_INSTALL+=('linux-rock64-package') + G_AGI linux-rock64-package # BBB elif (( $G_HW_MODEL == 71 )); then - aPACKAGES_REQUIRED_INSTALL+=('device-tree-compiler') #Kern + G_AGI device-tree-compiler #Kern fi @@ -678,7 +682,7 @@ _EOF_ # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files G_DIETPI-NOTIFY 2 "Returning installation of recommends back to default" - rm /etc/apt/apt-conf.d/99dietpi_norecommends &> /dev/null + G_RUN_CMD rm /etc/apt/apt-conf.d/99-dietpi-norecommends G_DIETPI-NOTIFY 2 "Purging APT with autoremoval (in case of DISTRO upgrade/downgrade):" @@ -718,7 +722,7 @@ _EOF_ G_DIETPI-NOTIFY 2 "Moving to /boot" - # - HW specific boot.ini uenv.txt + # - HW specific boot.ini uEnv.txt if (( $G_HW_MODEL == 10 )); then G_RUN_CMD mv DietPi-*/boot_c1.ini /boot/boot.ini @@ -791,7 +795,6 @@ _EOF_ rm -R /usr/share/fonts/* &> /dev/null rm -R /usr/share/icons/* &> /dev/null - #rm /etc/apt/sources.list.d/armbian.list rm /etc/init.d/resize2fs &> /dev/null rm /etc/update-motd.d/* &> /dev/null # ARMbian @@ -891,7 +894,7 @@ timeout 10; retry 4; _EOF_ - G_DIETPI-NOTIFY 2 "Configuring Hosts:" + G_DIETPI-NOTIFY 2 "Configuring hosts:" export G_ERROR_HANDLER_COMMAND='/etc/hosts' cat << _EOF_ > $G_ERROR_HANDLER_COMMAND From ca4a2266ebef775769b4836eab2fbb1b6280e976 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 31 Dec 2017 17:34:27 +0100 Subject: [PATCH 166/390] v6.0 + Switch to "echo" in forgotten case, before dietpi-globals were loaded. --- PREP_SYSTEM_FOR_DIETPI.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 6c2d7efd39..4c80f69d68 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -94,7 +94,7 @@ else - echo -e 'Error: Unknown or unsupported distribution version, aborting...\n' + echo -e 'Error: Unknown or unsupported distribution version. Aborting...\n' exit 1 fi @@ -120,7 +120,7 @@ else - G_DIETPI-NOTIFY 1 "Error: Unknown or unsupported CPU architecture $G_HW_ARCH_DESCRIPTION, aborting..." + echo -e "Error: Unknown or unsupported CPU architecture $G_HW_ARCH_DESCRIPTION. Aborting..." exit 1 fi @@ -168,7 +168,7 @@ else - G_DIETPI-NOTIFY 1 'No choices detected, aborting' + G_DIETPI-NOTIFY 1 'No choices detected, aborting...' exit 0 fi From 6f0b6da210782a552c45a001f4b98f418e187aa8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 31 Dec 2017 21:08:57 +0100 Subject: [PATCH 167/390] DietPi-Globals | Standardize/Shorten output + Introduce processing messages, that will be overwritten by any kind of success/failure/info message. --- dietpi/func/dietpi-globals | 72 +++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 28 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 09eaac5579..424a0513a0 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -9,12 +9,12 @@ #//////////////////////////////////// # # Info: - # - Allows export of shared DietPi global variables/funcs into current bash session, and, other scripts + # - Allows export of shared DietPi global variables/funcs into current bash session, and other scripts # # Excluded scripts, which do NOT load these globals # - dietpi-ramlog # - dietpi-ramdisk - # - dietpi.txt (and all other .txt .ini files) + # - dietpi.txt (and all other .txt .ini or config files) # #//////////////////////////////////// @@ -57,23 +57,33 @@ #header_line="\e[38;5;154m─────────────────────────────────────────────────────\e[0m" local header_line="\e[90m─────────────────────────────────────────────────────\e[0m" - local status_text_ok="\e[32mOk\e[0m" - local status_text_failed="\e[31mFailed:\e[0m" + #Line overwriting string: + local overwrite_string="\\r\\033[K" + + local status_text_process="\e[33mProcessing\e[0m" + local status_text_ok="\e[32m Ok \e[0m" + local status_text_error="\e[31m Error \e[0m" local bracket_string_l="\e[90m[\e[0m" local bracket_string_r="\e[90m]\e[0m" #Funcs + Print_Process(){ + + echo -ne "$overwrite_string $bracket_string_l$status_text_process$bracket_string_r" + + } + Print_Ok(){ - echo -ne " $bracket_string_l\e[32mOk\e[0m$bracket_string_r" + echo -ne "$overwrite_string $bracket_string_l$status_text_ok$bracket_string_r" } Print_Failed(){ - echo -ne " $bracket_string_l\e[31mError\e[0m$bracket_string_r" + echo -ne "$overwrite_string $bracket_string_l$status_text_error$bracket_string_r" } @@ -87,7 +97,7 @@ echo -ne " ${ainput_string[$i]}" done - echo -e "" + #echo -e "" # echo -e "SIZE = ${#ainput_string}" @@ -125,12 +135,20 @@ fi #-------------------------------------------------------------------------------------- + #Status Processing + #$@ = txt desc + elif (( $1 == -2 )); then + + Print_Process + Print_Input_String 1 + #Status Ok #$@ = txt desc elif (( $1 == 0 )); then Print_Ok Print_Input_String 1 + echo -e '' #Status failed #$@ = txt desc @@ -138,25 +156,27 @@ Print_Failed Print_Input_String 1 + echo -e '' #Status Info #$@ = txt desc elif (( $1 == 2 )); then - echo -ne " $bracket_string_l\e[0mInfo\e[0m$bracket_string_r" + echo -ne "$overwrite_string $bracket_string_l\e[0m Info \e[0m$bracket_string_r" echo -ne "\e[90m" Print_Input_String 1 - echo -ne "\e[0m" + echo -e "\e[0m" #DietPi banner style #$2 = txt program name #$3 = txt mode elif (( $1 == 3 )); then - echo -e "\n \e[38;5;154m$2\e[0m" + echo -e "$overwrite_string\n \e[38;5;154m$2\e[0m" echo -e "$header_line" echo -e " \e[90mMode:\e[0m$(Print_Input_String 2)" echo -e " \e[90mPlease wait...\e[0m\n" + #Print_Process fi #----------------------------------------------------------------------------------- @@ -170,11 +190,11 @@ if (( ! $G_CHECK_ROOT_USER_VERIFIED )); then - G_DIETPI-NOTIFY 2 'Checking for (elevated) root access, please wait..' + G_DIETPI-NOTIFY -2 'Checking for (elevated) root access, please wait..' if (( $UID != 0 )); then - G_DIETPI-NOTIFY 1 'Error: Root privileges required. Please run the command with "sudo"\n' + G_DIETPI-NOTIFY 1 'Root privileges required. Please run the command with "sudo"\n' exit 1 else @@ -197,7 +217,7 @@ /DietPi/dietpi/dietpi-drive_manager 3 if (( $? != 0 )); then - G_DIETPI-NOTIFY 1 'Error: RootFS is currently Read Only, unable to continue.\n' + G_DIETPI-NOTIFY 1 'RootFS is currently Read Only, unable to continue.\n' exit 1 else @@ -425,8 +445,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="$@" - G_DIETPI-NOTIFY 2 "Running command: $G_ERROR_HANDLER_COMMAND" - G_DIETPI-NOTIFY 2 'Please wait...' + G_DIETPI-NOTIFY -2 "Running command: $G_ERROR_HANDLER_COMMAND, please wait..." $G_ERROR_HANDLER_COMMAND &> /tmp/G_ERROR_HANDLER_COMMAND G_ERROR_HANDLER_EXITCODE=$? @@ -445,8 +464,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="$@" G_ERROR_HANDLER_EXITCODE=0 - G_DIETPI-NOTIFY 2 "Checking file/folder exists: $G_ERROR_HANDLER_COMMAND" - G_DIETPI-NOTIFY 2 'Please wait...' + G_DIETPI-NOTIFY -2 "Checking file/folder exists: $G_ERROR_HANDLER_COMMAND, please wait..." local string='' @@ -632,8 +650,7 @@ $print_logfile_info G_ERROR_HANDLER_EXITCODE=0 G_ERROR_HANDLER_COMMAND="Connection test: $string" - G_DIETPI-NOTIFY 2 "Testing connection to $string" - G_DIETPI-NOTIFY 2 "Max duration of $(($timeout * $retry)) seconds, please wait..." + G_DIETPI-NOTIFY -2 "Testing connection to $string for max $(($timeout * $retry)) seconds, please wait..." wget -q --spider --timeout=$timeout --tries=$retry "$string" G_ERROR_HANDLER_EXITCODE=$? @@ -684,8 +701,7 @@ $print_logfile_info #-qq can add a slight period of appearing nothing is happening, lets inform user - G_DIETPI-NOTIFY 2 "APT installation for: $string" - G_DIETPI-NOTIFY 2 "APT is processing, please wait...\n" + G_DIETPI-NOTIFY -2 "APT installation for: $string, please wait..." DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $force_options $string 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} @@ -712,7 +728,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="G_AGP: $string" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" - G_DIETPI-NOTIFY 2 "APT removal for: $string" + G_DIETPI-NOTIFY -2 "APT removal for: $string, please wait" DEBIAN_FRONTEND=noninteractive apt-get purge -y $string $options 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} @@ -731,7 +747,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="G_AGA:" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" - G_DIETPI-NOTIFY 2 "APT autoremove + purge" + G_DIETPI-NOTIFY -2 "APT autoremove + purge, please wait" DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} @@ -750,7 +766,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="G_AGF:" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" - G_DIETPI-NOTIFY 2 "APT fix" + G_DIETPI-NOTIFY -2 "APT fix, please wait..." DEBIAN_FRONTEND=noninteractive apt-get install -f -y 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} @@ -769,7 +785,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="G_AGUP:" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" - G_DIETPI-NOTIFY 2 "APT update" + G_DIETPI-NOTIFY -2 "APT update, please wait..." DEBIAN_FRONTEND=noninteractive apt-get update 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} @@ -788,7 +804,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="G_AGUG:" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" - G_DIETPI-NOTIFY 2 "APT upgrade" + G_DIETPI-NOTIFY -2 "APT upgrade, please wait..." DEBIAN_FRONTEND=noninteractive apt-get upgrade -y 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} @@ -817,7 +833,7 @@ $print_logfile_info fi - G_DIETPI-NOTIFY 2 "APT dist-upgrade" + G_DIETPI-NOTIFY -2 "APT dist-upgrade, please wait..." DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} @@ -859,7 +875,7 @@ $print_logfile_info if [ -n "$packages_to_install" ]; then - G_DIETPI-NOTIFY 2 "Installing pre-req APT packages, please wait..." + G_DIETPI-NOTIFY -2 "Installing pre-req APT packages, please wait..." G_AGI $packages_to_install exit_code=$? From 7eb498447680b05a8a81dc84d83afc0ddcbac41c Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 1 Jan 2018 11:19:25 +0000 Subject: [PATCH 168/390] v160 + DietPi-Automation | All dietpi.txt entries have been renamed and cleaned up: https://github.com/Fourdee/DietPi/issues/1355 --- CHANGELOG.txt | 23 +- PREP_SYSTEM_FOR_DIETPI.sh | 4 +- TESTING-BRANCH.md | 2 +- dietpi.txt | 301 ++++++++++++------------ dietpi/boot | 40 ++-- dietpi/conf/cron.daily_dietpi | 4 +- dietpi/conf/cron.hourly_dietpi | 2 +- dietpi/dietpi-config | 92 ++++---- dietpi/dietpi-cpu_set | 22 +- dietpi/dietpi-cpuinfo | 2 +- dietpi/dietpi-software | 64 ++--- dietpi/dietpi-survey | 3 +- dietpi/dietpi-update | 4 +- dietpi/func/dietpi-set_core_environment | 1 - dietpi/func/dietpi-set_curlftpfs | 12 +- dietpi/func/dietpi-set_dphys-swapfile | 2 +- dietpi/func/dietpi-set_hardware | 22 +- dietpi/func/dietpi-set_nfsclient | 4 +- dietpi/func/dietpi-set_smbclient | 16 +- dietpi/func/dietpi-set_software | 14 +- dietpi/func/run_ntpd | 2 +- dietpi/login | 2 +- dietpi/misc/dietpi-justboom | 2 +- dietpi/patch_file | 2 +- 24 files changed, 324 insertions(+), 318 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 24defb97a4..0b524919a2 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,4 +1,4 @@ -v160 +v6.0 (xx/01/18) Minor notes: @@ -13,6 +13,7 @@ General | FHS compliance completed. /etc/dietpi has moved to /var/lib/dietpi. RA General | wget: Now set to prefer IPv4 by default (generally faster): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 General | APT: Now set to force IPv4 by default (generally faster): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 General | SparkySBC: CPU gov default changed to Performance, reports of increased stability. +DietPi-Automation | All dietpi.txt entries have been renamed and cleaned up. DietPi-Boot | Improved the method of initial FS_partition and FS_expansion during 1st run, via systemD services. 'fs_force_resize=' in dietpi.txt is no longer supported: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352159930 DietPi-Banner | IP: Will now also list the active network adapter used (eg: eth0/wlan0) DietPi-Config | Dion Audio LOCO V1/V2: Soundcards added for RPi. @@ -153,7 +154,7 @@ General | Ondemand is now the default CPU governor for all devices. Previously I General | Improved notifications for when DietPi is installing system with automated flags. General | DietPi RPi Kernel: Updated to 4.9.52 General | RPi Stretch: Updated, matching official release of 2017-09-07-raspbian-stretch-lite -General | DietPi-Automation: "AUTO_Global_Password=" in "dietpi.txt" will also be applied to the "dietpi" user account. Please note this will only take effect on v157 and higher DietPi images, due to "boot" script requiring an update: https://github.com/Fourdee/DietPi/issues/1134 +General | DietPi-Automation: "AUTO_SETUP_GLOBAL_PASSWORD=" in "dietpi.txt" will also be applied to the "dietpi" user account. Please note this will only take effect on v157 and higher DietPi images, due to "boot" script requiring an update: https://github.com/Fourdee/DietPi/issues/1134 DietPi-Update | Added logging for updates > /var/tmp/dietpi/logs/dietpi-update.log DietPi-LetsEncrypt | Added support for Nginx on Stretch. Many thanks to @Bridouz for contributing this: https://github.com/Fourdee/DietPi/pull/1166 DietPi-Software | Apache2 + NextCloud: Various optimizations. For new installations only. Many thanks to @MichaIng for this contribution: https://github.com/Fourdee/DietPi/issues/1067 @@ -426,7 +427,7 @@ DietPi-Software | AmiBerry: Renamed all references of uae4arm to AmiBerry: https DietPi-Software | NAA Daemon: Updated to latest version (3.5.1-35). Many thanks to volpone for the heads up: http://dietpi.com/phpbb/viewtopic.php?f=11&t=1832 General | DietPi RPi Kernel: Now supports 384KHz audio output. Tested with Allo BOSS DAC and JustBoom-DAC: https://github.com/Fourdee/DietPi/issues/900#issuecomment-297775790 General | ARMbian built images: Console boot verbosity increase. -General | DietPi user: Now created for testing "dietpi". We are aiming to phase out root with our DietPi user in the future, currently, this account is for testing/debugging only. Default password is "dietpi" if "AUTO_Global_Password=" is unchanged in dietpi.txt: https://github.com/Fourdee/DietPi/issues/796 +General | DietPi user: Now created for testing "dietpi". We are aiming to phase out root with our DietPi user in the future, currently, this account is for testing/debugging only. Default password is "dietpi" if "AUTO_SETUP_GLOBAL_PASSWORD=" is unchanged in dietpi.txt: https://github.com/Fourdee/DietPi/issues/796 General | RPi Jessie: Image updated to latest General | AmiBerry: Image updated to latest @@ -651,7 +652,7 @@ DietPi-Software | UrBackup Server: Updated to latest version (2.0.38). Applies t Bug fixes: DietPi-Automation | Resolved an issue where static IPs were not being applied during 1st run dietpi-update stage. This fix applies to v140 and higher images: https://github.com/Fourdee/DietPi/issues/660 DietPi-Software | Resolved an issue where the DietPi installed version of Chromium was being overwritten by Debian repo during dist-upgrade: https://github.com/Fourdee/DietPi/issues/658 -DietPi-Software | Resolved an issue where custom global password ('AUTO_Global_Password=') was not being used as MySQL login password, causing MySQL DB creations to fail: https://github.com/Fourdee/DietPi/issues/666 +DietPi-Software | Resolved an issue where custom global password ('AUTO_SETUP_GLOBAL_PASSWORD=') was not being used as MySQL login password, causing MySQL DB creations to fail: https://github.com/Fourdee/DietPi/issues/666 DietPi-Software | Resolved an issue where LMS failed to installed on Odroid C2: https://github.com/Fourdee/DietPi/issues/663 General | apt-transport-https: Is now installed by default on all devices. Required for https apt usage and resolves issues with apt simulation failing: https://github.com/Fourdee/DietPi/issues/669 @@ -677,7 +678,7 @@ Bug fixes: DietPi-Cloudshell | Resolved an issue where Cloudshell would fail to start, due to tput failing the service on some devices. Many thanks to @Fabian0587, @rooted and @Saturn7 for their valuable assistance with testing: https://github.com/Fourdee/DietPi/issues/649 DietPi-Software | Wordpress: Resolved an issue where php-mysql module was not installed in some instances. Many thanks to @prp2 for reporting this: http://dietpi.com/phpbb/viewtopic.php?f=11&t=1026&p=4434#p4407 DietPi-Software | Plex Media Server: Is now disabled for ARMv6 devices. This is due to available repos removing support/packages for ARMv6 devices: https://github.com/Fourdee/DietPi/issues/648 -DietPi-Software | 'AUTO_Global_Password=' in dietpi.txt: Is now also applied as the password for generated MySQL databases. +DietPi-Software | 'AUTO_SETUP_GLOBAL_PASSWORD=' in dietpi.txt: Is now also applied as the password for generated MySQL databases. DietPi-Services | RPImonitor: This service is now triggered. Many thanks to K-Plan for reporting this. General | C2: Resolved an issue where libc6 u6 is required, but u7 was installed: https://github.com/Fourdee/DietPi/issues/653 @@ -838,9 +839,9 @@ DietPi-Config | Added ability to tweak Ondemand sampling rates in the performanc DietPi-Drive_Manager | To support large filesystems, GPT is now the default paritition table type on format, (previously MBR). Many thanks to Zone22: https://github.com/Fourdee/DietPi/issues/531 DietPi-Drive_Manager | Current userdata location is now shown in the main menu. DietPi-Set_Cpu | If the target CPU gov is not available on the system, an alternative will be set and saved automatically. -DietPi-Automation | Added a global password var (AUTO_Global_Password=) in dietpi.txt, which will be applied to root login, and, during dietpi-software installations, for all software that use a password: https://github.com/Fourdee/DietPi/issues/533 +DietPi-Automation | Added a global password var (AUTO_SETUP_GLOBAL_PASSWORD=) in dietpi.txt, which will be applied to root login, and, during dietpi-software installations, for all software that use a password: https://github.com/Fourdee/DietPi/issues/533 DietPi-Automation | Added filesystem format type for USB drive format (AUTO_Dedicated_Usb_Drive_Format_Filesystem=) in dietpi.txt: https://github.com/Fourdee/DietPi/issues/537 -DietPi-Automation | Added ability to force ethernet link speeds on 1st run (Ethernet_Force_Speed=) in dietpi.txt: https://github.com/Fourdee/DietPi/issues/544#issuecomment-252068249 +DietPi-Automation | Added ability to force ethernet link speeds on 1st run (AUTO_SETUP_NET_ETH_FORCE_SPEED=) in dietpi.txt: https://github.com/Fourdee/DietPi/issues/544#issuecomment-252068249 General | Interactive is now the default CPU gov, provides improved response times: https://github.com/Fourdee/DietPi/issues/535 General | Ethtool is now installed by default. Mainly used to provide a workaround for known HW failure Pine A64 1Gbit boards: https://github.com/Fourdee/DietPi/issues/544#issuecomment-252068249 @@ -998,7 +999,7 @@ v126 Changes / Improvements / Optimizations: DietPi-Software | Coding improvements to allow for command line inputs and automated installations. General | Updated my email address in all source code (daniel.knight[at]dietpi.com). -DietPi-Automation | Simplified automation code. One variable to enable automated installation "AUTO_Install_Enable=1" in dietpi.txt. This will now enable a completely automated installation, with no user inputs. This feature requires a v126 image or higher, v126+ images will be available at a later date. +DietPi-Automation | Simplified automation code. One variable to enable automated installation "AUTO_SETUP_AUTOMATED=1" in dietpi.txt. This will now enable a completely automated installation, with no user inputs. This feature requires a v126 image or higher, v126+ images will be available at a later date. Bug fixes: DietPi-Software | Gogs: Resolved an issue where missing binary ssh-keygen would cause gogs service to fail: https://github.com/Fourdee/DietPi/issues/442. OpenSSH needs to be installed. @@ -1253,7 +1254,7 @@ DietPi-Software | Resolved an issue where NODEJS was not being set to "installed DietPi-Software | Resolved an issue where NODEJS would not install on Odroid C2. We have compiled a ARM64.deb package and will be used in new installations: https://github.com/Fourdee/DietPi/issues/276#issuecomment-209900955 General | Resolved an issue where WiFi WPA connections were unable to connect on the Odroid C1. General | Resolved various issues with non-English system Locale when using English based parsing throughout DietPi scripts: https://github.com/Fourdee/DietPi/issues/291 -DietPi-Apt_Get_Update | Will now ignore waiting for (and killing) NTPD if ntpd_update_mode=0 (disabled) or ntpd_update_mode=4 (daemon): https://github.com/Fourdee/DietPi/issues/289 +DietPi-Apt_Get_Update | Will now ignore waiting for (and killing) NTPD if CONFIG_NTP_MODE=0 (disabled) or CONFIG_NTP_MODE=4 (daemon): https://github.com/Fourdee/DietPi/issues/289 ----------------------------------------------------------------------------------------------------------- @@ -1825,7 +1826,7 @@ DietPi-Config | Added Interactive CPU gov option (if available on device). Odroid C1/XU4 | Changed default CPU gov from ondemand to interactive. This resolves the issue with Odroid c1 ondemand not scaling (http://forum.odroid.com/viewtopic.php?f=117&t=12057), and, performs much better. Odroid XU4 | Fixed issue with missing curl pre-reqs. Curl is now installed by default (to be consistent with all DietPi images). DietPi-Ramlog | Now also saves filenames and generates those files on boot as blank files. Basically ensures log file permissions are set correctly during boot. -/DietPi/dietpi.txt cpu_max_frequency= | You can now limit the max cpu frequency (MHz) for all cores. | 0=disabled | Useful for lowering temp/power usage on your device. +/DietPi/dietpi.txt CONFIG_CPU_MAX_FREQ= | You can now limit the max cpu frequency (MHz) for all cores. | 0=disabled | Useful for lowering temp/power usage on your device. DietPi-BugReport | Will now also send /etc/init.d/* and ls /etc/rc*.d/* services startup orders. General | Rolled out -m1 to the majority of DietPi code. This should improve performance with DietPi scripts. @@ -1873,7 +1874,7 @@ Release Notes: DietPi-Software | Added DietPi optimized installation option for Pi-hole (DNS server that blocks adverts on your network). http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&start=20#p174 Optimization | ipv6 is now fully disabled for RPi, honest. http://dietpi.com/phpbb/viewtopic.php?f=9&t=37&p=152#p152 Security | Dropbear will generate a unique SSH key during 1st run setup. Thanks to DietPirate (http://dietpi.com/phpbb/viewtopic.php?f=9&t=37#p156). -DietPi-Update | Added option to disable DietPi automatically checking for updates (dietpi.txt dietpi_check_for_updates=0-1) +DietPi-Update | Added option to disable DietPi automatically checking for updates (dietpi.txt CONFIG_CHECK_DIETPI_UPDATES=0-1) ----------------------------------------------------------------------------------------------------------- diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index ba16999911..5250196620 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1025,7 +1025,7 @@ blacklist bc_example _EOF_ # Use performance gov for stability. - sed -i "/^cpu_governor=/c\cpu_governor=performance" /DietPi/dietpi.txt + sed -i "/^CONFIG_CPU_GOVERNOR=/c\CONFIG_CPU_GOVERNOR=performance" /DietPi/dietpi.txt /DietPi/dietpi/dietpi-cpu_set # - RPI: Scroll lock fix for RPi by Midwan: https://github.com/Fourdee/DietPi/issues/474#issuecomment-243215674 @@ -1099,7 +1099,7 @@ _EOF_ # BBB disable swapfile gen if (( $G_HW_MODEL == 71 )); then - sed -i '/Swapfile_Size=/c\Swapfile_Size=0' /DietPi/dietpi.txt + sed -i '/AUTO_SETUP_SWAPFILE_SIZE=/c\AUTO_SETUP_SWAPFILE_SIZE=0' /DietPi/dietpi.txt fi diff --git a/TESTING-BRANCH.md b/TESTING-BRANCH.md index fc3dcbb802..ff88095d7e 100644 --- a/TESTING-BRANCH.md +++ b/TESTING-BRANCH.md @@ -3,5 +3,5 @@ 1. Write the DietPi image to SD card. 2. Open the file on the 1st partition ```/boot/dietpi.txt``` -3. Change ```gitbranch=master``` to ```gitbranch=testing``` (located at the bottom of file) +3. Change ```DEV_GITBRANCH=master``` to ```DEV_GITBRANCH=testing``` (located at the bottom of file) 4. Save the file, eject media and power on. \ No newline at end of file diff --git a/dietpi.txt b/dietpi.txt index c539be54c9..38877d7a25 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -1,229 +1,230 @@ #Modifications to /boot/* files, will not be saved when powered on. #Please ensure you edit from the DietPi-RamDisk location /DietPi/* +#NB: This is intended for advanced users, unless you know what you are doing, do not edit this file. Please use the DietPi programs instead. +#NB: Do not remove uncommented lines, as the items are scraped by DietPi programs, on demand. + #------------------------------------------------------------------------------------------------------ -# D I E T - P I -# 1st run settings +# DietPi-Automation # All settings below will be applied on the 1st boot of DietPi, ONCE. #------------------------------------------------------------------------------------------------------ -# >> Networking Options ----------------------------- -#If both Ethernet and Wifi are enabled, Wifi will take priority and Ethernet will be disabled. -# 1=enabled -Ethernet_Enabled=1 -Wifi_Enabled=0 - -#Enter your Wifi details below, if applicable (Case Sensitive). -Wifi_SSID=MySuperDooperWiFi -Wifi_KEY=0123456789 + +##### Networking Options ##### + +# If both Ethernet and Wifi are enabled, Wifi will take priority and Ethernet will be disabled. +# 1=enabled +AUTO_SETUP_NET_ETHERNET_ENABLED=1 +AUTO_SETUP_NET_WIFI_ENABLED=0 + +# Enter your Wifi details below, if applicable (Case Sensitive). +AUTO_SETUP_NET_WIFI_SSID=MySuperDooperWiFi +AUTO_SETUP_NET_WIFI_KEY=0123456789 # available | WPA-PSK / NONE | WEP=No longer supported -Wifi_KEYMGR=WPA-PSK - -#Enter your Static Network details below, if applicable. -Use_Static=0 -Static_IP=192.168.0.100 -Static_Mask=255.255.255.0 -Static_Gateway=192.168.0.1 -Static_DNS=8.8.8.8 - -#Hostname -Hostname=DietPi - -#Force ethernet speeds -#NB: This is mainly aimed towards Pine A64's which may have a HW issue that causes unstable 1Gbit link. -# 0=automatic speed | 10 = 10mbit, 100 = 100mbit etc -Ethernet_Force_Speed=0 - -# >> Misc Options ----------------------------------- -#Size of dphys-swapfile to generate (MB) -# 0=Disabled | 1=auto (2GB-RAM = size) | 2+=manual -Swapfile_Size=1 - -# >> Automation Options ----------------------------- -#NB: Following options are only executed on 1st run of DietPi. - -#Fully automate installation -# 1=Automated installation with no user inputs. -AUTO_Install_Enable=0 - -#Global Password to be applied for the system -# Affects user "root" and "dietpi" login passwords, and, all software installed by dietpi-software, that requires a password -# eg: MySQL, Transmission, Deluge etc. -# WARN: Passwords with the any of the following characters are not supported: \"$ -# WARN: Do NOT change this entry, after 1st run setup of DietPi has been completed. It is always scraped by dietpi-software. -AUTO_Global_Password=dietpi - -#DietPi-Software to automatically install. | requires AUTO_Install_Enable=1 +AUTO_SETUP_NET_WIFI_KEYMGR=WPA-PSK + +# Enter your Static Network details below, if applicable. +AUTO_SETUP_NET_USESTATIC=0 +AUTO_SETUP_NET_STATIC_IP=192.168.0.100 +AUTO_SETUP_NET_STATIC_MASK=255.255.255.0 +AUTO_SETUP_NET_STATIC_GATEWAY=192.168.0.1 +AUTO_SETUP_NET_STATIC_DNS=8.8.8.8 + +# Hostname +AUTO_SETUP_NET_HOSTNAME=DietPi + +# Force ethernet speeds +# NB: This is mainly aimed towards Pine A64's which may have a HW issue that causes unstable 1Gbit link. +# 0=automatic speed | 10 = 10mbit, 100 = 100mbit etc +AUTO_SETUP_NET_ETH_FORCE_SPEED=0 + +##### Misc Options ##### + +# Size of dphys-swapfile to generate (MB) +# 0=Disabled | 1=auto (2GB-RAM = size) | 2+=manual +AUTO_SETUP_SWAPFILE_SIZE=1 + +##### Software Automation Options ##### + +# Fully automate installation +# 1=Automated installation with no user inputs. +AUTO_SETUP_AUTOMATED=0 + +# Global Password to be applied for the system +# Affects user "root" and "dietpi" login passwords, and, all software installed by dietpi-software, that requires a password +# eg: MySQL, Transmission, Deluge etc. +# WARN: Passwords with the any of the following characters are not supported: \"$ +# WARN: Do NOT change this entry, after 1st run setup of DietPi has been completed. It is always scraped by dietpi-software. +AUTO_SETUP_GLOBAL_PASSWORD=dietpi + +# DietPi-Software to automatically install. | requires AUTO_SETUP_AUTOMATED=1 # For a list of software index's (ID's), run '/DietPi/dietpi/dietpi-software list' # No limit on number entires, add as many as you need and uncomment the line. # DietPi will automatically install all pre-reqs (eg: ALSA/XSERVER for desktops etc) # - Examples: -#AUTO_DietpiSoftware_Install_ID=23 #will install Desktop LXDE -#AUTO_DietpiSoftware_Install_ID=74 #will install LAMP webserver stack -#AUTO_DietpiSoftware_Install_ID=44 #will install Bittorrent transmission - -#DietPi-Software Choice System -#SSH Server Selection: -# 0=none -# -1=dropbear -# -2=opensshserver -AUTO_DietpiSoftware_SSHServerIndex=-1 - -#File Server Selection: -# 0=none/manual -# -1=proftp -# -2=samba -AUTO_DietpiSoftware_FileServerIndex=0 - -#Logging Mode Selection: -# 0=none/manual -# -1=ramlog 1h clear -# -2=ramlog 1h save clear -# -3=logrotate + rsyslog -AUTO_DietpiSoftware_LoggingIndex=-1 - -#Webserver Preference Selection: -# NB: This will get ignored, if you have manually selected any WEBSERVER_Stacks. -# 0=Apache2 -# -1=Nginx -# -2=Lighttpd -AUTO_DietpiSoftware_WebserverIndex=-2 - -#DietPi-Autostart | Requires AUTO_Install_Enable=1 -# After installation is completed, which program should the system boot to? -# 0=Console 7=Console+auto root login | 1=Kodi 2=Desktops (LXDE/MATE etc) 5=DietPi-Cloudshell 6=Uae4ARM (Fastboot) 8=Uae4ARM (standard boot) 9=dxx-rebirth -AUTO_AutoStartTarget=0 - -#Language/Regional settings | Requires AUTO_Install_Enable=1 -# Timezone eg: Europe/London America/New_York | Full list (TZ*): https://en.wikipedia.org/wiki/List_of_tz_database_time_zones -AUTO_Timezone=Europe/London -# Locale eg: en_GB OR en_US etc. One entry ONLY. DietPi automatically applies .UTF-8 to your locale | Full list: cat /etc/locale.gen -AUTO_Locale=en_GB -# Keyboard Layout eg: gb us de fr -AUTO_KeyboardLayout=gb - -#Custom Script | Requires AUTO_Install_Enable=1 -# Allows you to automatically execute a custom script at the end of DietPi installation. -# Option 1 = Copy your script to /boot/Automation_Custom_Script.sh and it will be executed automatically. -# Option 2 = Host your script online, then use AUTO_CustomScriptURL=http://myweb.com/myscript.sh , it will be downloaded and executed automatically. | 0=disabled -AUTO_CustomScriptURL=0 +#AUTO_SETUP_INSTALL_SOFTWARE_ID=23 #will install Desktop LXDE +#AUTO_SETUP_INSTALL_SOFTWARE_ID=74 #will install LAMP webserver stack +#AUTO_SETUP_INSTALL_SOFTWARE_ID=44 #will install Bittorrent transmission + +# DietPi-Software Choice System +# SSH Server Selection: +# 0=none +# -1=dropbear +# -2=opensshserver +AUTO_SETUP_SSH_SERVER_INDEX=-1 + +# File Server Selection: +# 0=none/manual +# -1=proftp +# -2=samba +AUTO_SETUP_FILE_SERVER_INDEX=0 + +# Logging Mode Selection: +# 0=none/manual +# -1=ramlog 1h clear +# -2=ramlog 1h save clear +# -3=logrotate + rsyslog +AUTO_SETUP_LOGGING_INDEX=-1 + +# Webserver Preference Selection: +# NB: This will get ignored, if you have manually selected any WEBSERVER_Stacks. +# 0=Apache2 +# -1=Nginx +# -2=Lighttpd +AUTO_SETUP_WEB_SERVER_INDEX=-2 + +# DietPi-Autostart | Requires AUTO_SETUP_AUTOMATED=1 +# After installation is completed, which program should the system boot to? +# 0=Console 7=Console+auto root login | 1=Kodi 2=Desktops (LXDE/MATE etc) 5=DietPi-Cloudshell 6=Uae4ARM (Fastboot) 8=Uae4ARM (standard boot) 9=dxx-rebirth +AUTO_SETUP_AUTOSTART_TARGET_INDEX=0 + +# Language/Regional settings | Requires AUTO_SETUP_AUTOMATED=1 +# Timezone eg: Europe/London America/New_York | Full list (TZ*): https://en.wikipedia.org/wiki/List_of_tz_database_time_zones +AUTO_SETUP_TIMEZONE=Europe/London +# Locale eg: en_GB OR en_US etc. One entry ONLY. DietPi automatically applies .UTF-8 to your locale | Full list: cat /etc/locale.gen +AUTO_SETUP_LOCALE=en_GB +# Keyboard Layout eg: gb us de fr +AUTO_SETUP_KEYBOARD_LAYOUT=gb + +# Custom Script | Requires AUTO_SETUP_AUTOMATED=1 +# Allows you to automatically execute a custom script at the end of DietPi installation. +# Option 1 = Copy your script to /boot/Automation_Custom_Script.sh and it will be executed automatically. +# Option 2 = Host your script online, then use AUTO_SETUP_CUSTOM_SCRIPT_EXEC=http://myweb.com/myscript.sh , it will be downloaded and executed automatically. | 0=disabled +AUTO_SETUP_CUSTOM_SCRIPT_EXEC=0 #------------------------------------------------------------------------------------------------------ # D I E T - P I # DietPi-Config settings. #------------------------------------------------------------------------------------------------------ #RPi Hdmi output (if 0, sets tvservice -o and framebuffer 16x 16y 8z on boot, headless) -rpi_hdmi_output=1 +CONFIG_HDMI_OUTPUT=1 #Cpu Governor | ondemand | powersave | performance | conservative -cpu_governor=ondemand -cpu_usage_throttle_up=50 +CONFIG_CPU_GOVERNOR=ondemand +CONFIG_CPU_USAGE_THROTTLE_UP=50 #Limit the max cpu frequency (Mhz) for all cores. | Disabled=disabled | Useful for lowering temp/power usage on your device. -cpu_max_frequency=Disabled +CONFIG_CPU_MAX_FREQ=Disabled #Limit the min cpu frequency (Mhz) for all cores. | Disabled=disabled | Useful for 1-wire correct support (eg. 480Mhz). -cpu_min_frequency=Disabled +CONFIG_CPU_MIN_FREQ=Disabled #Min value 10000 microseconds (10ms) -cpu_ondemand_sampling_rate=25000 +CONFIG_CPU_ONDEMAND_SAMPLE_RATE=25000 #sampling rate * down factor / 1000 = Miliseconds (40 = 1000ms when sampling rate is 25000) -cpu_ondemand_sampling_down_factor=80 +CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=80 #Samba Client Details (Used by DietPi-Config | Networking NAS | Samba Client) -SambaClient_ComputerName=computername -SambaClient_ShareName=sharename -SambaClient_Username=username -SambaClient_Password=password +CONFIG_SMBCLIENT_COMPUTERNAME=computername +CONFIG_SMBCLIENT_SHARENAME=sharename +CONFIG_SMBCLIENT_USERNAME=username +CONFIG_SMBCLIENT_PASSWORD=password #FTP Client Filesystem Mount (CurlFtpFs) (Used by DietPi-Config | Networking NAS | FTP Client) -curlftpfs_clientaddress=192.168.0.100 -curlftpfs_clientusername=username -curlftpfs_clientpassword=password +CONFIG_CURLFTPFS_ADDRESS=192.168.0.100 +CONFIG_CURLFTPFS_USERNAME=username +CONFIG_CURLFTPFS_PASSWORD=password #NFS Client Filesystem Mount (Used by DietPi-Config | Networking NAS | NFS Client) -nfsclient_ipaddress= +CONFIG_NFSCLIENT_ADDRESS= #Proxy settings | System-wide proxy settings. Use dietpi-config > networking options to apply. -proxy_enabled=0 -proxy_address=MyProxyServer.com -proxy_port=8080 -proxy_username= -proxy_password= +CONFIG_PROXY_ENABLED=0 +CONFIG_PROXY_ADDRESS=MyProxyServer.com +CONFIG_PROXY_PORT=8080 +CONFIG_PROXY_USERNAME= +CONFIG_PROXY_PASSWORD= #Delay boot until network is established: 0=disabled | 1=10 second wait max (default) | 2=infinite wait -boot_wait_for_network=1 +CONFIG_BOOT_WAIT_FOR_NETWORK=1 #DietPi check for updates (allows dietpi to check for updates on a daily basis and boot using a <1kb file download.) -dietpi_check_for_updates=1 +CONFIG_CHECK_DIETPI_UPDATES=1 #NTPD Update Mode: 0=disabled | 1=boot only | 2=boot + daily | 3=boot + hourly | 4=Daemon + Drift -ntpd_update_mode=2 - -#Wifi Hotspot -wifi_hotspot_ssid=DietPi-HotSpot -# - minimum of 8 characters -wifi_hotspot_key=dietpihotspot -wifi_hotspot_channel=3 +CONFIG_NTP_MODE=2 #WiFi country code. 2 character value (eg GB US DE JP): https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 -wifi_country_code=GB +CONFIG_WIFI_COUNTRY_CODE=GB #Serial Console: Set to 1 if you require a serial console during 1st run of DietPi. -serial_console_enabled=0 +CONFIG_SERIAL_CONSOLE_ENABLE=0 #Soundcard -soundcard=none +CONFIG_SOUNDCARD=none #LCD Panel addon -lcdpanel=none +CONFIG_LCDPANEL=none -#Prefer IPversion (for: APT) | auto (let system decide) / ipv4 (force) / ipv6 (force) | eg: force IPv4 with prefer_ipversion=ipv4 -prefer_ipversion=ipv4 +#Prefer IPversion (for: APT) | auto (let system decide) / ipv4 (force) / ipv6 (force) | eg: force IPv4 with CONFIG_PREFER_IPVERSION=ipv4 +CONFIG_PREFER_IPVERSION=ipv4 #Apt mirrors which are applied to /etc/apt/sources.list | Values here will also be applied during 1st run setup # Raspbian = https://www.raspbian.org/RaspbianMirrors # Debian = https://www.debian.org/mirror/official#list -Apt_Raspbian_Mirror=https://www.mirrorservice.org/sites/archive.raspbian.org/raspbian -Apt_Debian_Mirror=http://ftp.debian.org/debian/ +CONFIG_APT_RASPBIAN_MIRROR=https://www.mirrorservice.org/sites/archive.raspbian.org/raspbian +CONFIG_APT_DEBIAN_MIRROR=http://ftp.debian.org/debian/ #NTPD mirror, applied to /etc/ntp.conf # For a full list, please see http://www.pool.ntp.org # Please remove the initial interger and full stop from the value (removing 0.). eg: debian.pool.ntp.org -NTPD_Mirror=debian.pool.ntp.org +CONFIG_NTP_MIRROR=debian.pool.ntp.org #------------------------------------------------------------------------------------------------------ # D I E T - P I # DietPi-Software settings. #------------------------------------------------------------------------------------------------------ #Enter your EmonCMS.org write API key here. It will be applied automatically during EmonPi/Hub installation. -# - eg: dietpi_emonhub_apikey=b4dfmk2o203mmxx93a -dietpi_emonhub_apikey= +# eg: SOFTWARE_EMONHUB_APIKEY=b4dfmk2o203mmxx93a +SOFTWARE_EMONHUB_APIKEY= #VNC Server Options -dietpi_vncserver_width=1280 -dietpi_vncserver_height=720 -dietpi_vncserver_depth=16 -dietpi_vncserver_display=1 -dietpi_vncserver_shared_desktop=0 +SOFTWARE_VNCSERVER_WIDTH=1280 +SOFTWARE_VNCSERVER_HEIGHT=720 +SOFTWARE_VNCSERVER_DEPTH=16 +SOFTWARE_VNCSERVER_DISPLAY_INDEX=1 +SOFTWARE_VNCSERVER_SHARE_DESKTOP=0 #Optional username for ownCloud/Nextcloud admin account, default is 'admin'. Applied during installation. -dietpi_ownnextcloud_username=admin +SOFTWARE_OWNCLOUD_NEXTCLOUD_USERNAME=admin #Optional data directory for ownCloud, default is '/mnt/dietpi_userdata/owncloud_data'. Applied during installation. # This option is for advanced users. For full compatibility, please keep this options defaults, and, use dietpi-drive_manager to move the DietPi user data location. -dietpi_owncloud_datadir=/mnt/dietpi_userdata/owncloud_data +SOFTWARE_OWNCLOUD_DATADIR=/mnt/dietpi_userdata/owncloud_data #Optional data directory for Nextcloud, default is '/mnt/dietpi_userdata/nextcloud_data'. Applied during installation. # This option is for advanced users. For full compatibility, please keep this options defaults, and, use dietpi-drive_manager to move the DietPi user data location. -dietpi_nextcloud_datadir=/mnt/dietpi_userdata/nextcloud_data +SOFTWARE_NEXTCLOUD_DATADIR=/mnt/dietpi_userdata/nextcloud_data + +#Wifi Hotspot +SOFTWARE_WIFI_HOTSPOT_SSID=DietPi-HotSpot +# minimum of 8 characters +SOFTWARE_WIFI_HOTSPOT_KEY=dietpihotspot +SOFTWARE_WIFI_HOTSPOT_CHANNEL=3 #------------------------------------------------------------------------------------------------------ # D I E T - P I # Dev settings #------------------------------------------------------------------------------------------------------ -gitbranch=master -gitforkowner=Fourdee - -# - Max size of rootfs resize (%) -rootfs_resize_limit=100 +DEV_GITBRANCH=master +DEV_GITOWNER=Fourdee diff --git a/dietpi/boot b/dietpi/boot index 06f935edc1..c1acd2e433 100644 --- a/dietpi/boot +++ b/dietpi/boot @@ -98,14 +98,14 @@ sed -i "s/wlan0/wlan$index_wlan/g" /etc/network/interfaces #Grab user requested settings from /dietpi.txt - local Ethernet_Enabled=$(cat /DietPi/dietpi.txt | grep -ci -m1 'Ethernet_Enabled=1') - local Wifi_Enabled=$(cat /DietPi/dietpi.txt | grep -ci -m1 'Wifi_Enabled=1') + local Ethernet_Enabled=$(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_SETUP_NET_ETHERNET_ENABLED=1') + local Wifi_Enabled=$(cat /DietPi/dietpi.txt | grep -ci -m1 'AUTO_SETUP_NET_WIFI_ENABLED=1') - local Use_Static=$(cat /DietPi/dietpi.txt | grep -ci -m1 '^Use_Static=1') - local Static_IP=$(cat /DietPi/dietpi.txt | grep -m1 '^Static_IP' | sed 's/.*=//') - local Static_Mask=$(cat /DietPi/dietpi.txt | grep -m1 '^Static_Mask' | sed 's/.*=//') - local Static_Gateway=$(cat /DietPi/dietpi.txt | grep -m1 '^Static_Gateway' | sed 's/.*=//') - local Static_Dns=$(cat /DietPi/dietpi.txt | grep -m1 '^Static_DNS' | sed 's/.*=//') + local Use_Static=$(cat /DietPi/dietpi.txt | grep -ci -m1 '^AUTO_SETUP_NET_USESTATIC=1') + local Static_IP=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_NET_STATIC_IP=' | sed 's/.*=//') + local Static_Mask=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_NET_STATIC_MASK=' | sed 's/.*=//') + local Static_Gateway=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_NET_STATIC_GATEWAY=' | sed 's/.*=//') + local Static_Dns=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_NET_STATIC_DNS=' | sed 's/.*=//') # - Wifi if (( $Wifi_Enabled == 1 )); then @@ -171,7 +171,7 @@ fi #Apply forced eth speed if set in dietpi.txt - /DietPi/dietpi/func/dietpi-set_hardware eth-forcespeed $(cat /DietPi/dietpi.txt | grep -m1 '^Ethernet_Force_Speed=' | sed 's/.*=//' ) + /DietPi/dietpi/func/dietpi-set_hardware eth-forcespeed $(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_NET_ETH_FORCE_SPEED=' | sed 's/.*=//' ) #Wait for active connection, then update network details file Wait_For_Valid_Network_Connection @@ -184,7 +184,7 @@ local max_loops=1 # Wait mode, max time - local boot_wait_for_network=$(cat /DietPi/dietpi.txt | grep -m1 '^boot_wait_for_network=' | sed 's/.*=//') + local boot_wait_for_network=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_BOOT_WAIT_FOR_NETWORK=' | sed 's/.*=//') if (( $boot_wait_for_network == 1 )); then max_loops=10 @@ -249,7 +249,7 @@ #---------------------------------------------------------------- #Disable RPi hdmi output if set in dietpi.txt if (( $G_HW_MODEL < 10 && - $(cat /DietPi/dietpi.txt | grep -ci -m1 '^rpi_hdmi_output=0'))); then + $(cat /DietPi/dietpi.txt | grep -ci -m1 '^CONFIG_HDMI_OUTPUT=0'))); then #FBset value below allows for reduced memory bandwidth usage from VideoCore (eg: Faster RAM bandwidth/performance) fbset -xres 16 -yres 16 -vxres 16 -vyres 16 -depth 8 &> /dev/null @@ -302,7 +302,7 @@ Wait_For_Valid_Network_Connection - if (( $( cat /DietPi/dietpi.txt | grep -ci -m1 '^dietpi_check_for_updates=1') )); then + if (( $( cat /DietPi/dietpi.txt | grep -ci -m1 '^CONFIG_CHECK_DIETPI_UPDATES=1') )); then #Check for DietPi updates (+thread) echo -e "$(date) | +Thread: checking for DietPi-Updates" >> "$FP_LOGFILE" @@ -322,25 +322,25 @@ /DietPi/dietpi/dietpi-banner 0 #Set hostname - /DietPi/dietpi/func/change_hostname "$(cat /DietPi/dietpi.txt | grep -m1 '^Hostname=' | sed 's/.*=//')" + /DietPi/dietpi/func/change_hostname "$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_NET_HOSTNAME=' | sed 's/.*=//')" #Automation # - Set auto login for next bootup - if (( $(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_Install_Enable=' | sed 's/.*=//') >= 1 )); then + if (( $(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_AUTOMATED=' | sed 's/.*=//') >= 1 )); then /DietPi/dietpi/dietpi-autostart 7 fi # - Enable serial console? - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 '^serial_console_enabled=1') )); then + if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 '^CONFIG_SERIAL_CONSOLE_ENABLE=1') )); then /DietPi/dietpi/func/dietpi-set_hardware serialconsole enable fi # - Set root password? - ROOT_PASSWORD=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_Global_Password=' | sed 's/.*=//') + ROOT_PASSWORD=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_GLOBAL_PASSWORD=' | sed 's/.*=//') if [ -n "$ROOT_PASSWORD" ]; then chpasswd <<< "root:$ROOT_PASSWORD" @@ -349,17 +349,17 @@ fi # - Set apt mirror - TARGET_REPO='Apt_Debian_Mirror' + TARGET_REPO='CONFIG_APT_DEBIAN_MIRROR' if (( $G_HW_MODEL < 10 )); then - TARGET_REPO='Apt_Raspbian_Mirror' + TARGET_REPO='CONFIG_APT_RASPBIAN_MIRROR' fi - /DietPi/dietpi/func/dietpi-set_software apt-mirror $(cat /DietPi/dietpi.txt | grep -m1 "^$target_repo=" | sed 's/.*=//') + /DietPi/dietpi/func/dietpi-set_software apt-mirror $(cat /DietPi/dietpi.txt | grep -m1 "^$TARGET_REPO=" | sed 's/.*=//') # - Set NTPD mirror - /DietPi/dietpi/func/dietpi-set_software ntpd-mirror $(cat /DietPi/dietpi.txt | grep -m1 '^NTPD_Mirror=' | sed 's/.*=//') + /DietPi/dietpi/func/dietpi-set_software ntpd-mirror $(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_NTP_MIRROR=' | sed 's/.*=//') #Disable /tmp tmpfs if RAM <= 512MB: https://github.com/Fourdee/DietPi/issues/1027 if (( $(free -m | grep -m1 'Mem:' | awk '{print $2}') <= 512 )); then @@ -371,7 +371,7 @@ fi #Enable/Create swapfile. - /DietPi/dietpi/func/dietpi-set_dphys-swapfile $(cat /DietPi/dietpi.txt | grep -m1 '^Swapfile_Size=' | sed 's/.*=//' ) + /DietPi/dietpi/func/dietpi-set_dphys-swapfile $(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_SWAPFILE_SIZE=' | sed 's/.*=//' ) #Generate unique Dropbear host-key: rm /etc/dropbear/*key &> /dev/null diff --git a/dietpi/conf/cron.daily_dietpi b/dietpi/conf/cron.daily_dietpi index c40614d36d..8a9b95cef8 100644 --- a/dietpi/conf/cron.daily_dietpi +++ b/dietpi/conf/cron.daily_dietpi @@ -10,7 +10,7 @@ # #//////////////////////////////////// - NTPD_UPDATE_MODE=$(cat /DietPi/dietpi.txt | grep -m1 '^ntpd_update_mode=' | sed 's/.*=//') + NTPD_UPDATE_MODE=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_NTP_MODE=' | sed 's/.*=//') #---------------------------------------------------------------- # Main Loop @@ -23,7 +23,7 @@ fi #---------------------------------------------------------------- #check for dietpi updates - if (( $(grep -ci -m1 'dietpi_check_for_updates=1' /DietPi/dietpi.txt) == 1 )); then + if (( $(grep -ci -m1 'CONFIG_CHECK_DIETPI_UPDATES=1' /DietPi/dietpi.txt) == 1 )); then /DietPi/dietpi/dietpi-update 2 &> /dev/null & fi #---------------------------------------------------------------- diff --git a/dietpi/conf/cron.hourly_dietpi b/dietpi/conf/cron.hourly_dietpi index 3ba603b68d..f0cd6aaa69 100644 --- a/dietpi/conf/cron.hourly_dietpi +++ b/dietpi/conf/cron.hourly_dietpi @@ -17,7 +17,7 @@ fi - NTPD_UPDATE_MODE=$(cat /DietPi/dietpi.txt | grep -m1 '^ntpd_update_mode=' | sed 's/.*=//') + NTPD_UPDATE_MODE=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_NTP_MODE=' | sed 's/.*=//') #---------------------------------------------------------------- # Main Loop diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 1c9eb744e6..b5d871e46e 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -282,7 +282,7 @@ whiptail_menu_array+=("1" "Change Resolution") whiptail_menu_array+=("2" "GPU/RAM Memory Split") - local lcdpanel_text=$(cat /DietPi/dietpi.txt | grep -m1 '^lcdpanel=' | sed 's/.*=//') + local lcdpanel_text=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_LCDPANEL=' | sed 's/.*=//') whiptail_menu_array+=("3" "LCD Panel addon: $lcdpanel_text") fi @@ -858,7 +858,7 @@ fi #check for headless - if (($(cat /DietPi/dietpi.txt | grep -ci -m1 'rpi_hdmi_output=0') == 1)); then + if (($(cat /DietPi/dietpi.txt | grep -ci -m1 'CONFIG_HDMI_OUTPUT=0') == 1)); then display_output_text="Headless" @@ -890,7 +890,7 @@ TARGETMENUID=2 # - Always enable HDMI output by default - sed -i "/rpi_hdmi_output=/c\rpi_hdmi_output=1" /DietPi/dietpi.txt + sed -i "/CONFIG_HDMI_OUTPUT=/c\CONFIG_HDMI_OUTPUT=1" /DietPi/dietpi.txt # - Always disable composite by default sed -i '/sdtv_mode=/c\#sdtv_mode=0' /DietPi/config.txt @@ -951,7 +951,7 @@ ;; Headless) whiptail --title "$WHIP_TITLE" --msgbox " Using the Headless option will: \n - Disable HDMI output \n - Lower energy consumption by 0.1+ Watts \n - Set framebuffer to 16x16xD8 \n - Improve RAM performance by 1-5% (VideoCore shares RAM bandwidth) \n - More info here : https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p105008" --backtitle "$WHIP_BACKTITLE" 14 75 - sed -i "/rpi_hdmi_output=/c\rpi_hdmi_output=0" /DietPi/dietpi.txt + sed -i "/CONFIG_HDMI_OUTPUT=/c\CONFIG_HDMI_OUTPUT=0" /DietPi/dietpi.txt ;; esac @@ -1171,7 +1171,7 @@ whiptail_menu_array+=("Swapfile size" ": $swap_text") #NTPD - local ntpd_mode_current=$(cat /DietPi/dietpi.txt | grep -m1 '^ntpd_update_mode=' | sed 's/.*=//') + local ntpd_mode_current=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_NTP_MODE=' | sed 's/.*=//') local ntpd_mode_text="" if (( $ntpd_mode_current == 0 )); then ntpd_mode_text="Disabled" @@ -1186,7 +1186,7 @@ fi whiptail_menu_array+=("Time sync mode" ": $ntpd_mode_text") - serialconsole_state=$(cat /DietPi/dietpi.txt | grep -m1 '^serial_console_enabled=' | sed 's/.*=//') + serialconsole_state=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_SERIAL_CONSOLE_ENABLE=' | sed 's/.*=//') serialconsole_text='Disabled' if (( $serialconsole_state == 1 )); then serialconsole_text='Enabled' @@ -1496,7 +1496,7 @@ TARGETMENUID=0 #All devices - local current_cpu_governor=$(grep -m1 '^cpu_governor=' /DietPi/dietpi.txt | sed 's/.*=//') + local current_cpu_governor=$(grep -m1 '^CONFIG_CPU_GOVERNOR=' /DietPi/dietpi.txt | sed 's/.*=//') local frequency_min_cpu_governor=1 local fp_frequency_min_cpu_governor='/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq' @@ -1544,7 +1544,7 @@ [ "$current_cpu_governor" = "conservative" ] || [ "$current_cpu_governor" = "interactive" ]; then - local current_cpu_throttle_up=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_usage_throttle_up' | sed 's/.*=//') + local current_cpu_throttle_up=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_CPU_USAGE_THROTTLE_UP=' | sed 's/.*=//') whiptail_menu_array+=("CPU Throttle Up" ": $current_cpu_throttle_up%") fi @@ -1553,7 +1553,7 @@ #Ondemand extras if [ "$current_cpu_governor" = ondemand ]; then - local current_cpu_sample_rate=$(( $(cat /DietPi/dietpi.txt | grep -m1 '^cpu_ondemand_sampling_rate=' | sed 's/.*=//') / 1000 )) #convert to ms + local current_cpu_sample_rate=$(( $(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_CPU_ONDEMAND_SAMPLE_RATE=' | sed 's/.*=//') / 1000 )) #convert to ms whiptail_menu_array+=("Ondemand Sample Rate" ": $current_cpu_sample_rate ms") local current_cpu_down_factor=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_ondemand_sampling_down_factor=' | sed 's/.*=//') @@ -1564,7 +1564,7 @@ # User Scaling Max Freq limit. - local user_frequency_max_current=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_max_frequency=' | sed 's/.*=//') + local user_frequency_max_current=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_CPU_MAX_FREQ=' | sed 's/.*=//') local user_frequency_max_text="$user_frequency_max_current MHz" if (( ! $user_frequency_max_current )); then user_frequency_max_text="Disabled" @@ -1573,7 +1573,7 @@ whiptail_menu_array+=("CPU Max Freq Limit" ": $user_frequency_max_text") # User Scaling Min Freq limit. - local user_frequency_min_current=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_min_frequency=' | sed 's/.*=//') + local user_frequency_min_current=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_CPU_MIN_FREQ=' | sed 's/.*=//') local user_frequency_min_text="$user_frequency_min_current MHz" if (( ! $user_frequency_min_current )); then user_frequency_min_text="Disabled" @@ -1675,7 +1675,7 @@ if [[ $OPTION =~ ^-?[0-9]+$ ]] && (($OPTION <= $MAX_VALUE)) && (($OPTION >= $MIN_VALUE)); then - sed -i "/cpu_ondemand_sampling_rate=/c\cpu_ondemand_sampling_rate=$(($OPTION * 1000))" /DietPi/dietpi.txt + sed -i "/CONFIG_CPU_ONDEMAND_SAMPLE_RATE=/c\CONFIG_CPU_ONDEMAND_SAMPLE_RATE=$(($OPTION * 1000))" /DietPi/dietpi.txt #Apply changes /DietPi/dietpi/dietpi-cpu_set @@ -1769,12 +1769,12 @@ # Set max > return to default if [ "$OPTION" = "Disabled" ]; then - sed -i "/cpu_max_frequency=/c\cpu_max_frequency=$max_clock" /DietPi/dietpi.txt + sed -i "/CONFIG_CPU_MAX_FREQ=/c\CONFIG_CPU_MAX_FREQ=$max_clock" /DietPi/dietpi.txt /DietPi/dietpi/dietpi-cpu_set fi - sed -i "/cpu_max_frequency=/c\cpu_max_frequency=$OPTION" /DietPi/dietpi.txt + sed -i "/CONFIG_CPU_MAX_FREQ=/c\CONFIG_CPU_MAX_FREQ=$OPTION" /DietPi/dietpi.txt /DietPi/dietpi/dietpi-cpu_set fi @@ -1826,12 +1826,12 @@ # Set min > return to default if [ "$OPTION" = "Disabled" ]; then - sed -i "/cpu_min_frequency=/c\cpu_min_frequency=$min_clock" /DietPi/dietpi.txt + sed -i "/CONFIG_CPU_MIN_FREQ=/c\CONFIG_CPU_MIN_FREQ=$min_clock" /DietPi/dietpi.txt /DietPi/dietpi/dietpi-cpu_set fi - sed -i "/cpu_min_frequency=/c\cpu_min_frequency=$OPTION" /DietPi/dietpi.txt + sed -i "/CONFIG_CPU_MIN_FREQ=/c\CONFIG_CPU_MIN_FREQ=$OPTION" /DietPi/dietpi.txt /DietPi/dietpi/dietpi-cpu_set fi @@ -1910,7 +1910,7 @@ if (( $CHOICE == 0 )); then - sed -i "/cpu_governor=/c\cpu_governor=$OPTION" /DietPi/dietpi.txt + sed -i "/CONFIG_CPU_GOVERNOR=/c\CONFIG_CPU_GOVERNOR=$OPTION" /DietPi/dietpi.txt /DietPi/dietpi/dietpi-cpu_set fi @@ -1931,7 +1931,7 @@ if [[ $OPTION =~ ^-?[0-9]+$ ]] && (($OPTION <= $MAX_VALUE)) && (($OPTION >= $MIN_VALUE)); then - sed -i "/cpu_usage_throttle_up=/c\cpu_usage_throttle_up=$OPTION" /DietPi/dietpi.txt + sed -i "/CONFIG_CPU_USAGE_THROTTLE_UP=/c\CONFIG_CPU_USAGE_THROTTLE_UP=$OPTION" /DietPi/dietpi.txt #Apply changes /DietPi/dietpi/dietpi-cpu_set @@ -2546,13 +2546,13 @@ _EOF_ if (( $WIFI_HOTSPOT == 0 )); then # - Update globals - sed -i "/^Wifi_SSID=/c\Wifi_SSID=$WIFI_SSID" /DietPi/dietpi.txt - sed -i "/^Wifi_KEY=/c\Wifi_KEY=$WIFI_KEY" /DietPi/dietpi.txt + sed -i "/^AUTO_SETUP_NET_WIFI_SSID=/c\AUTO_SETUP_NET_WIFI_SSID=$WIFI_SSID" /DietPi/dietpi.txt + sed -i "/^AUTO_SETUP_NET_WIFI_KEY=/c\AUTO_SETUP_NET_WIFI_KEY=$WIFI_KEY" /DietPi/dietpi.txt # Open host if [ -z "$WIFI_KEY" ]; then - sed -i '/Wifi_KEYMGR=/c\Wifi_KEYMGR=NONE' /DietPi/dietpi.txt + sed -i '/AUTO_SETUP_NET_WIFI_KEYMGR=/c\AUTO_SETUP_NET_WIFI_KEYMGR=NONE' /DietPi/dietpi.txt # Key host @@ -2560,7 +2560,7 @@ _EOF_ # WEP tests failed, dropping support as its outdated and not secure. WPA-PSK is recommended for router. else - sed -i '/Wifi_KEYMGR=/c\Wifi_KEYMGR=WPA-PSK' /DietPi/dietpi.txt + sed -i '/AUTO_SETUP_NET_WIFI_KEYMGR=/c\AUTO_SETUP_NET_WIFI_KEYMGR=WPA-PSK' /DietPi/dietpi.txt fi @@ -2944,8 +2944,8 @@ _EOF_ WIFI_CONNECTED=$(ip r | grep -ci -m1 "wlan$WIFI_INDEX") #Wifi Extras - WIFI_SSID="$(grep -m1 '^Wifi_SSID' /DietPi/dietpi.txt | sed 's/.*=//')" - WIFI_KEY="$(grep -m1 '^Wifi_KEY' /DietPi/dietpi.txt | sed 's/.*=//')" + WIFI_SSID="$(grep -m1 '^AUTO_SETUP_NET_WIFI_SSID=' /DietPi/dietpi.txt | sed 's/.*=//')" + WIFI_KEY="$(grep -m1 '^AUTO_SETUP_NET_WIFI_KEY=' /DietPi/dietpi.txt | sed 's/.*=//')" #Enabled and Connected if (( $WIFI_DISABLED == 0 )) && (( $WIFI_CONNECTED == 1 )); then @@ -3678,9 +3678,9 @@ _EOF_ Apply) if (( $WIFI_HOTSPOT == 1 )); then # - update dietpi.txt - sed -i "/wifi_hotspot_ssid=/c\wifi_hotspot_ssid=$HOTSPOT_SSID" /DietPi/dietpi.txt - sed -i "/wifi_hotspot_channel=/c\wifi_hotspot_channel=$HOTSPOT_CHANNEL" /DietPi/dietpi.txt - sed -i "/wifi_hotspot_key=/c\wifi_hotspot_key=$HOTSPOT_KEY" /DietPi/dietpi.txt + sed -i "/SOFTWARE_WIFI_HOTSPOT_SSID=/c\SOFTWARE_WIFI_HOTSPOT_SSID=$HOTSPOT_SSID" /DietPi/dietpi.txt + sed -i "/SOFTWARE_WIFI_HOTSPOT_CHANNEL=/c\SOFTWARE_WIFI_HOTSPOT_CHANNEL=$HOTSPOT_CHANNEL" /DietPi/dietpi.txt + sed -i "/SOFTWARE_WIFI_HOTSPOT_KEY=/c\SOFTWARE_WIFI_HOTSPOT_KEY=$HOTSPOT_KEY" /DietPi/dietpi.txt # - update hostapd conf sed -i "/ssid=/c\ssid=$HOTSPOT_SSID" /etc/hostapd/hostapd.conf @@ -4395,7 +4395,7 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ TARGETMENUID=0 - local soundcard_current=$(grep -m1 'soundcard=' /DietPi/dietpi.txt | sed 's/.*=//') + local soundcard_current=$(grep -m1 '^CONFIG_SOUNDCARD=' /DietPi/dietpi.txt | sed 's/.*=//') local whiptail_menu_array=() @@ -4410,8 +4410,8 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ # - RPi, low power mode (PSU noise ripple reduction): https://github.com/Fourdee/DietPi/issues/757 if (( $G_HW_MODEL < 10 )); then - local current_cpu_governor=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_governor=' | sed 's/.*=//') - local hdmi_output=$(cat /DietPi/dietpi.txt | grep -m1 'rpi_hdmi_output=' | sed 's/.*=//') + local current_cpu_governor=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_CPU_GOVERNOR=' | sed 's/.*=//') + local hdmi_output=$(cat /DietPi/dietpi.txt | grep -m1 'CONFIG_HDMI_OUTPUT=' | sed 's/.*=//') local psu_noise_reduction_enabled=0 if [ "$current_cpu_governor" = "powersave" ] && (( ! $hdmi_output )); then @@ -4441,17 +4441,17 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ whiptail --title "PSU noise reduction" --msgbox "This mode attempts to reduce power consumption on your SBC. In turn, this may reduce PSU inflicted noise, that may degrade audio output quality.\n\nThe following has now been set:\n - CPU gov = Powersave\n - HDMI output = Disabled" --backtitle "$WHIP_BACKTITLE" 14 70 - sed -i "/cpu_governor=/c\cpu_governor=powersave" /DietPi/dietpi.txt + sed -i "/CONFIG_CPU_GOVERNOR=/c\CONFIG_CPU_GOVERNOR=powersave" /DietPi/dietpi.txt /DietPi/dietpi/dietpi-cpu_set - sed -i "/rpi_hdmi_output=/c\rpi_hdmi_output=0" /DietPi/dietpi.txt + sed -i "/CONFIG_HDMI_OUTPUT=/c\CONFIG_HDMI_OUTPUT=0" /DietPi/dietpi.txt else - sed -i "/cpu_governor=/c\cpu_governor=ondemand" /DietPi/dietpi.txt + sed -i "/CONFIG_CPU_GOVERNOR=/c\CONFIG_CPU_GOVERNOR=ondemand" /DietPi/dietpi.txt /DietPi/dietpi/dietpi-cpu_set - sed -i "/rpi_hdmi_output=/c\rpi_hdmi_output=1" /DietPi/dietpi.txt + sed -i "/CONFIG_HDMI_OUTPUT=/c\CONFIG_HDMI_OUTPUT=1" /DietPi/dietpi.txt fi @@ -4901,7 +4901,7 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ fi #Network boot wait - local boot_wait_for_network=$(cat /DietPi/dietpi.txt | grep -m1 '^boot_wait_for_network=' | sed 's/.*=//') + local boot_wait_for_network=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_BOOT_WAIT_FOR_NETWORK=' | sed 's/.*=//') local boot_wait_for_network_text=': ' if (( $boot_wait_for_network == 0 )); then @@ -4943,7 +4943,7 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ CHOICE=$? if (( $CHOICE == 0 )); then - sed -i "/^boot_wait_for_network=/c boot_wait_for_network=$OPTION" /DietPi/dietpi.txt + sed -i "/^CONFIG_BOOT_WAIT_FOR_NETWORK=/c CONFIG_BOOT_WAIT_FOR_NETWORK=$OPTION" /DietPi/dietpi.txt #Return to this Menu TARGETMENUID=16 @@ -5200,11 +5200,11 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ #So we can call this in other menus (eg: submenu of this) Load_Proxy_Vars(){ - PROXY_ENABLED=$(cat /DietPi/dietpi.txt | grep -m1 '^proxy_enabled=' | sed 's/.*=//') - PROXY_ADDRESS=$(cat /DietPi/dietpi.txt | grep -m1 '^proxy_address=' | sed 's/.*=//') - PROXY_PORT=$(cat /DietPi/dietpi.txt | grep -m1 '^proxy_port=' | sed 's/.*=//') - PROXY_USERNAME=$(cat /DietPi/dietpi.txt | grep -m1 '^proxy_username=' | sed 's/.*=//') - PROXY_PASSWORD=$(cat /DietPi/dietpi.txt | grep -m1 '^proxy_password=' | sed 's/.*=//') + PROXY_ENABLED=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_PROXY_ENABLED=' | sed 's/.*=//') + PROXY_ADDRESS=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_PROXY_ADDRESS=' | sed 's/.*=//') + PROXY_PORT=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_PROXY_PORT=' | sed 's/.*=//') + PROXY_USERNAME=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_PROXY_USERNAME=' | sed 's/.*=//') + PROXY_PASSWORD=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_PROXY_PASSWORD=' | sed 's/.*=//') } @@ -5293,11 +5293,11 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ Apply) # - Save settings to dietpi.txt - sed -i "/^proxy_enabled=/c\proxy_enabled=$PROXY_ENABLED" /DietPi/dietpi.txt - sed -i "/^proxy_address=/c\proxy_address=$PROXY_ADDRESS" /DietPi/dietpi.txt - sed -i "/^proxy_port=/c\proxy_port=$PROXY_PORT" /DietPi/dietpi.txt - sed -i "/^proxy_username=/c\proxy_username=$PROXY_USERNAME" /DietPi/dietpi.txt - sed -i "/^proxy_password=/c\proxy_password=$PROXY_PASSWORD" /DietPi/dietpi.txt + sed -i "/^CONFIG_PROXY_ENABLED=/c\CONFIG_PROXY_ENABLED=$PROXY_ENABLED" /DietPi/dietpi.txt + sed -i "/^CONFIG_PROXY_ADDRESS=/c\CONFIG_PROXY_ADDRESS=$PROXY_ADDRESS" /DietPi/dietpi.txt + sed -i "/^CONFIG_PROXY_PORT=/c\CONFIG_PROXY_PORT=$PROXY_PORT" /DietPi/dietpi.txt + sed -i "/^CONFIG_PROXY_USERNAME=/c\CONFIG_PROXY_USERNAME=$PROXY_USERNAME" /DietPi/dietpi.txt + sed -i "/^CONFIG_PROXY_PASSWORD=/c\CONFIG_PROXY_PASSWORD=$PROXY_PASSWORD" /DietPi/dietpi.txt # - Delete active export vars #unset {http,https,ftp}_proxy #Does not apply to system when running from a bash script. diff --git a/dietpi/dietpi-cpu_set b/dietpi/dietpi-cpu_set index 64a6e88588..e1f0d7af3b 100644 --- a/dietpi/dietpi-cpu_set +++ b/dietpi/dietpi-cpu_set @@ -28,9 +28,9 @@ fi - CPU_GOVERNOR=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_governor=' | sed 's/.*=//') - CPU_MAX_FREQ=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_max_frequency=' | sed 's/.*=//') - CPU_MIN_FREQ=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_min_frequency=' | sed 's/.*=//') + CPU_GOVERNOR=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_CPU_GOVERNOR=' | sed 's/.*=//') + CPU_MAX_FREQ=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_CPU_MAX_FREQ=' | sed 's/.*=//') + CPU_MIN_FREQ=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_CPU_MIN_FREQ=' | sed 's/.*=//') Check_GPU_Gov_Available(){ @@ -56,7 +56,7 @@ G_DIETPI-NOTIFY 2 "Switching to CPU gov: $CPU_GOVERNOR" # - Update dietpi.txt - sed -i "/^cpu_governor=/c\cpu_governor=$CPU_GOVERNOR" /DietPi/dietpi.txt + sed -i "/^CONFIG_CPU_GOVERNOR=/c\CONFIG_CPU_GOVERNOR=$CPU_GOVERNOR" /DietPi/dietpi.txt fi @@ -108,7 +108,7 @@ fi - local cpu_throttle_up_percent=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_usage_throttle_up' | sed 's/.*=//') + local cpu_throttle_up_percent=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_CPU_USAGE_THROTTLE_UP=' | sed 's/.*=//') #Set CPU governor interactive settings if [ "$input_gov_name" = interactive ]; then @@ -124,8 +124,8 @@ #Set CPU governor ondemand settings elif [ "$input_gov_name" = ondemand ]; then - local cpu_ondemand_sampling_rate=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_ondemand_sampling_rate' | sed 's/.*=//') - local cpu_ondemand_sampling_down_factor=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_ondemand_sampling_down_factor' | sed 's/.*=//') + local cpu_ondemand_sampling_rate=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_CPU_ONDEMAND_SAMPLE_RATE=' | sed 's/.*=//') + local cpu_ondemand_sampling_down_factor=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=' | sed 's/.*=//') G_DIETPI-NOTIFY 2 "Setting up_threshold: $cpu_throttle_up_percent %" G_DIETPI-NOTIFY 2 "Setting sampling_rate: $cpu_ondemand_sampling_rate microseconds" @@ -152,20 +152,24 @@ fi #Set CPU governor conservative settings - elif [ "$input_gov_name" = conservative ]; then + elif [ "$input_gov_name" = 'conservative' ]; then - cpu_throttle_up_percent=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_usage_throttle_up' | sed 's/.*=//') + cpu_throttle_up_percent=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_CPU_USAGE_THROTTLE_UP=' | sed 's/.*=//') #XU3/4 different path (must apply to each core) if (( $G_HW_MODEL == 11 )); then for ((i=$input_core_start; i<$input_core_end; i++)) do + echo "$cpu_throttle_up_percent" > /sys/devices/system/cpu/cpu"$i"/cpufreq/conservative/up_threshold + done else + echo "$cpu_throttle_up_percent" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold + fi fi diff --git a/dietpi/dietpi-cpuinfo b/dietpi/dietpi-cpuinfo index 968bc6bbea..48f7c79c4e 100644 --- a/dietpi/dietpi-cpuinfo +++ b/dietpi/dietpi-cpuinfo @@ -169,7 +169,7 @@ if [ "$CPU_GOV_CURRENT" = "ondemand" ] || [ "$CPU_GOV_CURRENT" = "conservative" ]; then - echo -e " Throttle up \e[90m|\e[0m $(cat /DietPi/dietpi.txt | grep -m1 '^cpu_usage_throttle_up' | sed 's/.*=//')% CPU usage" + echo -e " Throttle up \e[90m|\e[0m $(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_CPU_USAGE_THROTTLE_UP=' | sed 's/.*=//')% CPU usage" fi diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 696e0b5731..cf283d0f48 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -204,7 +204,7 @@ _EOF_ DISABLE_REBOOT=0 #Global Password: Exception to AUTO first run init. - GLOBAL_PW=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_Global_Password=' | sed 's/.*=//') + GLOBAL_PW=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_GLOBAL_PASSWORD=' | sed 's/.*=//') if [ ! -n "$GLOBAL_PW" ]; then GLOBAL_PW='dietpi' @@ -7867,7 +7867,7 @@ libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc AGI_ERROR_HANDLED alsa-utils #Apply soundcard - local soundcard=$(cat /DietPi/dietpi.txt | grep -m1 'soundcard=' | sed 's/.*=//') + local soundcard=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_SOUNDCARD=' | sed 's/.*=//') # - RPi enable internal HDMI+Analogue if currently set to 'none' if (( $G_HW_MODEL < 10 )) && @@ -8689,11 +8689,11 @@ _EOF_ chown -R www-data:www-data "$G_FP_DIETPI_USERDATA"/dietpicam chown -R www-data:www-data "$G_FP_DIETPI_USERDATA"/pydio_data - local datadir=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_owncloud_datadir=' | sed 's/.*=//') + local datadir=$(cat /DietPi/dietpi.txt | grep -m1 '^SOFTWARE_OWNCLOUD_DATADIR=' | sed 's/.*=//') [ ! -n "$datadir" ] && datadir="$G_FP_DIETPI_USERDATA/owncloud_data" chown -R www-data:www-data "$datadir" - datadir=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_nextcloud_datadir=' | sed 's/.*=//') + datadir=$(cat /DietPi/dietpi.txt | grep -m1 '^SOFTWARE_NEXTCLOUD_DATADIR=' | sed 's/.*=//') [ ! -n "$datadir" ] && datadir="$G_FP_DIETPI_USERDATA/nextcloud_data" chown -R www-data:www-data "$datadir" @@ -9298,12 +9298,12 @@ _EOF_ local config_php='/var/www/owncloud/config/config.php' # Terminal installation: - local datadir=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_owncloud_datadir=' | sed 's/.*=//') + local datadir=$(cat /DietPi/dietpi.txt | grep -m1 '^SOFTWARE_OWNCLOUD_DATADIR=' | sed 's/.*=//') [ ! -n "$datadir" ] && datadir="$G_FP_DIETPI_USERDATA/owncloud_data" mkdir -p "$datadir" Install_Apply_Permissions &> /dev/null - local username=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_ownnextcloud_username=' | sed 's/.*=//') + local username=$(cat /DietPi/dietpi.txt | grep -m1 '^SOFTWARE_OWNCLOUD_NEXTCLOUD_USERNAME=' | sed 's/.*=//') [ ! -n "$username" ] && username='admin' systemctl start mysql @@ -9477,12 +9477,12 @@ _EOF_ local config_php='/var/www/nextcloud/config/config.php' # Terminal installation: - local datadir=$(grep -m1 '^dietpi_nextcloud_datadir=' /DietPi/dietpi.txt | sed 's/.*=//') + local datadir=$(grep -m1 '^SOFTWARE_NEXTCLOUD_DATADIR=' /DietPi/dietpi.txt | sed 's/.*=//') [ ! -n "$datadir" ] && datadir="$G_FP_DIETPI_USERDATA/nextcloud_data" mkdir -p "$datadir" Install_Apply_Permissions &> /dev/null - local username=$(grep -m1 '^dietpi_ownnextcloud_username=' /DietPi/dietpi.txt | sed 's/.*=//') + local username=$(grep -m1 '^SOFTWARE_OWNCLOUD_NEXTCLOUD_USERNAME=' /DietPi/dietpi.txt | sed 's/.*=//') [ ! -n "$username" ] && username='admin' systemctl start mysql @@ -9731,7 +9731,7 @@ _EOF_ chmod 0666 /etc/mpd.conf #JustBoom specials - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 '^soundcard=justboom') )); then + if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 '^CONFIG_SOUNDCARD=justboom') )); then # - Name displayed in YMPD sound button local justboom_soundcard_desc='JustBoom DietPi' @@ -10645,11 +10645,11 @@ VNC_INSTALLED=0 BINARY_FP=0 SHARED_MODE=0 -WIDTH=\$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_vncserver_width=' | sed 's/.*=//') -HEIGHT=\$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_vncserver_height=' | sed 's/.*=//') -DEPTH=\$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_vncserver_depth=' | sed 's/.*=//') -DISPLAY=\$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_vncserver_display=' | sed 's/.*=//') -SHARED_MODE=\$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_vncserver_shared_desktop=' | sed 's/.*=//') +WIDTH=\$(cat /DietPi/dietpi.txt | grep -m1 '^SOFTWARE_VNCSERVER_WIDTH=' | sed 's/.*=//') +HEIGHT=\$(cat /DietPi/dietpi.txt | grep -m1 '^SOFTWARE_VNCSERVER_HEIGHT=' | sed 's/.*=//') +DEPTH=\$(cat /DietPi/dietpi.txt | grep -m1 '^SOFTWARE_VNCSERVER_DEPTH=' | sed 's/.*=//') +DISPLAY=\$(cat /DietPi/dietpi.txt | grep -m1 '^SOFTWARE_VNCSERVER_DISPLAY_INDEX=' | sed 's/.*=//') +SHARED_MODE=\$(cat /DietPi/dietpi.txt | grep -m1 '^SOFTWARE_VNCSERVER_SHARE_DESKTOP=' | sed 's/.*=//') #RealVNC | Slightly different launch method to VNC4server REALVNC=0 @@ -11026,14 +11026,14 @@ _EOF_ cat << _EOF_ > /etc/hostapd/hostapd.conf interface=wlan$wifi_index driver=nl80211 -ssid=$(cat /DietPi/dietpi.txt | grep -m1 '^wifi_hotspot_ssid=' | sed 's/.*=//') +ssid=$(cat /DietPi/dietpi.txt | grep -m1 '^SOFTWARE_WIFI_HOTSPOT_SSID=' | sed 's/.*=//') hw_mode=g -channel=$(cat /DietPi/dietpi.txt | grep -m1 '^wifi_hotspot_channel=' | sed 's/.*=//') +channel=$(cat /DietPi/dietpi.txt | grep -m1 '^SOFTWARE_WIFI_HOTSPOT_CHANNEL=' | sed 's/.*=//') macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 -wpa_passphrase=$(cat /DietPi/dietpi.txt | grep -m1 '^wifi_hotspot_key=' | sed 's/.*=//') +wpa_passphrase=$(cat /DietPi/dietpi.txt | grep -m1 '^SOFTWARE_WIFI_HOTSPOT_KEY=' | sed 's/.*=//') wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP @@ -11277,7 +11277,7 @@ _EOF_ /DietPi/dietpi/func/dietpi-set_hardware serialconsole disable # - Apply user API KEY - USER_EMONHUB_APIKEY_CURRENT=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_emonhub_apikey=' | sed 's/.*=//') + USER_EMONHUB_APIKEY_CURRENT=$(cat /DietPi/dietpi.txt | grep -m1 '^SOFTWARE_EMONHUB_APIKEY=' | sed 's/.*=//') sed -i "/apikey/c\ apikey = $USER_EMONHUB_APIKEY_CURRENT" /etc/emonhub/conf/emonhub.conf fi @@ -13203,7 +13203,7 @@ _EOF_ #RPi if (( $G_HW_MODEL < 10 )); then - sed -i "/rpi_hdmi_output=/c\rpi_hdmi_output=1" /DietPi/dietpi.txt + sed -i "/CONFIG_HDMI_OUTPUT=/c\CONFIG_HDMI_OUTPUT=1" /DietPi/dietpi.txt #odroid C1 elif (( $G_HW_MODEL == 10 )); then @@ -14690,20 +14690,20 @@ _EOF_ FirstRun_Automation_Init(){ #Get settings - AUTOINSTALL_ENABLED=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_Install_Enable=' | sed 's/.*=//') + AUTOINSTALL_ENABLED=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_AUTOMATED=' | sed 's/.*=//') - AUTOINSTALL_AUTOSTARTTARGET=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_AutoStartTarget=' | sed 's/.*=//' ) + AUTOINSTALL_AUTOSTARTTARGET=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_AUTOSTART_TARGET_INDEX=' | sed 's/.*=//' ) - AUTOINSTALL_SSHINDEX=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_DietpiSoftware_SSHServerIndex=' | sed 's/.*=//') - AUTOINSTALL_FILESERVERINDEX=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_DietpiSoftware_FileServerIndex=' | sed 's/.*=//') - AUTOINSTALL_LOGGINGINDEX=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_DietpiSoftware_LoggingIndex=' | sed 's/.*=//') - AUTOINSTALL_WEBSERVERINDEX=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_DietpiSoftware_WebserverIndex=' | sed 's/.*=//') + AUTOINSTALL_SSHINDEX=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_SSH_SERVER_INDEX=' | sed 's/.*=//') + AUTOINSTALL_FILESERVERINDEX=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_FILE_SERVER_INDEX=' | sed 's/.*=//') + AUTOINSTALL_LOGGINGINDEX=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_LOGGING_INDEX=' | sed 's/.*=//') + AUTOINSTALL_WEBSERVERINDEX=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_WEB_SERVER_INDEX=' | sed 's/.*=//') - AUTOINSTALL_TIMEZONE=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_Timezone=' | sed 's/.*=//' ) - AUTOINSTALL_LANGUAGE=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_Locale=' | sed 's/.*=//' ) - AUTOINSTALL_KEYBOARD=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_KeyboardLayout=' | sed 's/.*=//' ) + AUTOINSTALL_TIMEZONE=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_TIMEZONE=' | sed 's/.*=//' ) + AUTOINSTALL_LANGUAGE=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_LOCALE=' | sed 's/.*=//' ) + AUTOINSTALL_KEYBOARD=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_KEYBOARD_LAYOUT=' | sed 's/.*=//' ) - AUTOINSTALL_CUSTOMSCRIPTURL=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_CustomScriptURL=' | sed 's/AUTO_CustomScriptURL=//') + AUTOINSTALL_CUSTOMSCRIPTURL=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_CUSTOM_SCRIPT_EXEC=' | sed 's/AUTO_SETUP_CUSTOM_SCRIPT_EXEC=//') } @@ -14746,7 +14746,7 @@ _EOF_ INDEX_WEBSERVER_TARGET=$AUTOINSTALL_WEBSERVERINDEX # - IPversion preference: https://github.com/Fourdee/DietPi/issues/472 - /DietPi/dietpi/func/dietpi-set_hardware preferipversion "$(cat /DietPi/dietpi.txt | grep -m1 '^prefer_ipversion=' | sed 's/.*=//')" + /DietPi/dietpi/func/dietpi-set_hardware preferipversion "$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_PREFER_IPVERSION=' | sed 's/.*=//')" } @@ -16026,7 +16026,7 @@ _EOF_ # - Enter API KEY # - Grab key from dietpi.txt - USER_EMONHUB_APIKEY_CURRENT=$(cat /DietPi/dietpi.txt | grep -m1 '^dietpi_emonhub_apikey=' | sed 's/.*=//') + USER_EMONHUB_APIKEY_CURRENT=$(cat /DietPi/dietpi.txt | grep -m1 '^SOFTWARE_EMONHUB_APIKEY=' | sed 's/.*=//') while (( $USER_EMONHUB_APIKEY_COMPLETED == 0 )); do @@ -16045,7 +16045,7 @@ _EOF_ if (( $CHOICE == 0 )); then # - update dietpi.txt so the value will be applied during installation. - sed -i "/^dietpi_emonhub_apikey=/c\dietpi_emonhub_apikey=$USER_EMONHUB_APIKEY_CURRENT" /DietPi/dietpi.txt + sed -i "/^SOFTWARE_EMONHUB_APIKEY=/c\SOFTWARE_EMONHUB_APIKEY=$USER_EMONHUB_APIKEY_CURRENT" /DietPi/dietpi.txt USER_EMONHUB_APIKEY_COMPLETED=1 diff --git a/dietpi/dietpi-survey b/dietpi/dietpi-survey index acd4576bd9..d9d01e675d 100644 --- a/dietpi/dietpi-survey +++ b/dietpi/dietpi-survey @@ -24,8 +24,9 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - G_CHECK_ROOT_USER export G_PROGRAM_NAME='DietPi-Survey' + export G_USER_INPUTS=0 + G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- SURVEY_VERSION=4 diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 541f2f6bff..fd43668967 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -36,8 +36,8 @@ #///////////////////////////////////////////////////////////////////////////////////// #GIT Branch | master / testing #///////////////////////////////////////////////////////////////////////////////////// - GITBRANCH=$(grep -m1 '^gitbranch=' /DietPi/dietpi.txt | sed 's/.*=//') - GITFORKOWNER=$(grep -m1 '^gitforkowner=' /DietPi/dietpi.txt | sed 's/.*=//') + GITBRANCH=$(grep -m1 '^DEV_GITBRANCH=' /DietPi/dietpi.txt | sed 's/.*=//') + GITFORKOWNER=$(grep -m1 '^DEV_GITOWNER=' /DietPi/dietpi.txt | sed 's/.*=//') #///////////////////////////////////////////////////////////////////////////////////// #UPDATE Vars diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index 91dc6abc60..ebf237d577 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -335,7 +335,6 @@ Before=network.target shutdown.target [Service] Type=oneshot -#ExecStart=/bin/bash -c 'killall sshd &> /dev/null; killall dropbear &> /dev/null' ExecStart=/bin/bash -c '/var/lib/dietpi/dietpi-software/services/kill-ssh-user-sessions-before-network.sh' [Install] diff --git a/dietpi/func/dietpi-set_curlftpfs b/dietpi/func/dietpi-set_curlftpfs index ce5a8a60a2..b2368de29e 100644 --- a/dietpi/func/dietpi-set_curlftpfs +++ b/dietpi/func/dietpi-set_curlftpfs @@ -35,9 +35,9 @@ #///////////////////////////////////////////////////////////////////////////////////// OPTION=0 CHOICE=0 - curlftpfs_clientaddress=$(cat /DietPi/dietpi.txt | grep -m1 '^curlftpfs_clientaddress' | sed 's/.*=//') - curlftpfs_clientusername=$(cat /DietPi/dietpi.txt | grep -m1 '^curlftpfs_clientusername' | sed 's/.*=//') - curlftpfs_clientpassword=$(cat /DietPi/dietpi.txt | grep -m1 '^curlftpfs_clientpassword' | sed 's/.*=//') + curlftpfs_clientaddress=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_CURLFTPFS_ADDRESS=' | sed 's/.*=//') + curlftpfs_clientusername=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_CURLFTPFS_USERNAME=' | sed 's/.*=//') + curlftpfs_clientpassword=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_CURLFTPFS_PASSWORD=' | sed 's/.*=//') Apply_And_Mount(){ @@ -78,9 +78,9 @@ umount /mnt/ftp_client &> /dev/null #Save to Dietpi.txt - sed -i "/curlftpfs_clientaddress/c\curlftpfs_clientaddress=$curlftpfs_clientaddress" /DietPi/dietpi.txt - sed -i "/curlftpfs_clientusername/c\curlftpfs_clientusername=$curlftpfs_clientusername" /DietPi/dietpi.txt - sed -i "/curlftpfs_clientpassword/c\curlftpfs_clientpassword=$curlftpfs_clientpassword" /DietPi/dietpi.txt + sed -i "/CONFIG_CURLFTPFS_ADDRESS/c\CONFIG_CURLFTPFS_ADDRESS=$curlftpfs_clientaddress" /DietPi/dietpi.txt + sed -i "/CONFIG_CURLFTPFS_USERNAME/c\CONFIG_CURLFTPFS_USERNAME=$curlftpfs_clientusername" /DietPi/dietpi.txt + sed -i "/CONFIG_CURLFTPFS_PASSWORD/c\CONFIG_CURLFTPFS_PASSWORD=$curlftpfs_clientpassword" /DietPi/dietpi.txt Apply_And_Mount fi diff --git a/dietpi/func/dietpi-set_dphys-swapfile b/dietpi/func/dietpi-set_dphys-swapfile index c1659de7c6..b1df7f6444 100644 --- a/dietpi/func/dietpi-set_dphys-swapfile +++ b/dietpi/func/dietpi-set_dphys-swapfile @@ -52,7 +52,7 @@ sed -i "/CONF_SWAPFILE/c\CONF_SWAPFILE=$SWAP_LOCATION_TARGET" /etc/dphys-swapfile # DietPi.txt - sed -i "/^Swapfile_Size=/c\Swapfile_Size=$SWAP_SIZE_TARGET" /DietPi/dietpi.txt + sed -i "/^AUTO_SETUP_SWAPFILE_SIZE=/c\AUTO_SETUP_SWAPFILE_SIZE=$SWAP_SIZE_TARGET" /DietPi/dietpi.txt } diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index d82eac3286..1df48fcc82 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -711,7 +711,7 @@ _EOF_ #Update dietpi.txt entry? if (( $update_dietpitxt )); then - sed -i "/^lcdpanel=/c\lcdpanel=$INPUT_DEVICE_VALUE" /DietPi/dietpi.txt + sed -i "/^CONFIG_LCDPANEL=/c\CONFIG_LCDPANEL=$INPUT_DEVICE_VALUE" /DietPi/dietpi.txt fi @@ -1287,7 +1287,7 @@ _EOF_ fi #Update dietpi.txt global - sed -i "/^prefer_ipversion=/c\prefer_ipversion=$INPUT_DEVICE_VALUE" /DietPi/dietpi.txt + sed -i "/^CONFIG_PREFER_IPVERSION=/c\CONFIG_PREFER_IPVERSION=$INPUT_DEVICE_VALUE" /DietPi/dietpi.txt } @@ -1439,12 +1439,12 @@ _EOF_ if [ "$INPUT_DEVICE_VALUE" = "set" ]; then - local Wifi_KEYMGR=$(grep -m1 '^Wifi_KEYMGR' /DietPi/dietpi.txt | sed 's/.*=//') - local Wifi_KEY="$(grep -m1 '^Wifi_KEY' /DietPi/dietpi.txt | sed 's/.*=//')" - local Wifi_SSID="$(grep -m1 '^Wifi_SSID' /DietPi/dietpi.txt | sed 's/.*=//')" + local Wifi_KEYMGR=$(grep -m1 '^AUTO_SETUP_NET_WIFI_KEYMGR=' /DietPi/dietpi.txt | sed 's/.*=//') + local Wifi_KEY="$(grep -m1 '^AUTO_SETUP_NET_WIFI_KEY=' /DietPi/dietpi.txt | sed 's/.*=//')" + local Wifi_SSID="$(grep -m1 '^AUTO_SETUP_NET_WIFI_SSID=' /DietPi/dietpi.txt | sed 's/.*=//')" cat << _EOF_ > /etc/wpa_supplicant/wpa_supplicant.conf -country=$(grep -m1 '^wifi_country_code=' /DietPi/dietpi.txt | sed 's/.*=//') +country=$(grep -m1 '^CONFIG_WIFI_COUNTRY_CODE=' /DietPi/dietpi.txt | sed 's/.*=//') ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 @@ -1501,7 +1501,7 @@ _EOF_ INPUT_DEVICE_VALUE=$(echo -e "$INPUT_DEVICE_VALUE" | tr '[:lower:]' '[:upper:]') # - Apply value to DietPi.txt - sed -i "/^wifi_country_code=/c\wifi_country_code=$INPUT_DEVICE_VALUE" /DietPi/dietpi.txt + sed -i "/^CONFIG_WIFI_COUNTRY_CODE=/c\CONFIG_WIFI_COUNTRY_CODE=$INPUT_DEVICE_VALUE" /DietPi/dietpi.txt # - Update wpa_supplicant.conf if [ -f /etc/wpa_supplicant/wpa_supplicant.conf ]; then @@ -1592,7 +1592,7 @@ _EOF_ fi # - Update dietpi.txt global var - sed -i '/^serial_console_enabled=/c\serial_console_enabled=1' /DietPi/dietpi.txt + sed -i '/^CONFIG_SERIAL_CONSOLE_ENABLE=/c\CONFIG_SERIAL_CONSOLE_ENABLE=1' /DietPi/dietpi.txt #------------------------------------------------------------------------------------- @@ -1652,7 +1652,7 @@ _EOF_ fi # - Update dietpi.txt global var - sed -i '/^serial_console_enabled=/c\serial_console_enabled=0' /DietPi/dietpi.txt + sed -i '/^CONFIG_SERIAL_CONSOLE_ENABLE=/c\CONFIG_SERIAL_CONSOLE_ENABLE=0' /DietPi/dietpi.txt else Unknown_Input_Mode @@ -1867,7 +1867,7 @@ _EOF_ fi # - Update DietPi global soundcard var - sed -i "/^soundcard=/c\soundcard=$INPUT_DEVICE_VALUE" /DietPi/dietpi.txt + sed -i "/^CONFIG_SOUNDCARD=/c\CONFIG_SOUNDCARD=$INPUT_DEVICE_VALUE" /DietPi/dietpi.txt # - RPi: Enable DTPARAM audio setting if (( $G_HW_MODEL < 10 )); then @@ -1907,7 +1907,7 @@ _EOF_ EXIT_CODE=1 # - Reset - sed -i "/^soundcard=/c\soundcard=none" /DietPi/dietpi.txt + sed -i "/^CONFIG_SOUNDCARD=/c\CONFIG_SOUNDCARD=none" /DietPi/dietpi.txt fi diff --git a/dietpi/func/dietpi-set_nfsclient b/dietpi/func/dietpi-set_nfsclient index 1901d13d62..f74839328e 100644 --- a/dietpi/func/dietpi-set_nfsclient +++ b/dietpi/func/dietpi-set_nfsclient @@ -35,7 +35,7 @@ #///////////////////////////////////////////////////////////////////////////////////// OPTION=0 CHOICE=0 - nfsclient_ipaddress=$(cat /DietPi/dietpi.txt | grep -m1 '^nfsclient_ipaddress=' | sed 's/.*=//') + nfsclient_ipaddress=$(grep -m1 '^CONFIG_NFSCLIENT_ADDRESS=' /DietPi/dietpi.txt | sed 's/.*=//') Apply_And_Mount(){ @@ -66,7 +66,7 @@ umount /mnt/nfs_client &> /dev/null #Save to Dietpi.txt - sed -i "/nfsclient_ipaddress=/c\nfsclient_ipaddress=$nfsclient_ipaddress" /DietPi/dietpi.txt + sed -i "/CONFIG_NFSCLIENT_ADDRESS=/c\CONFIG_NFSCLIENT_ADDRESS=$nfsclient_ipaddress" /DietPi/dietpi.txt Apply_And_Mount diff --git a/dietpi/func/dietpi-set_smbclient b/dietpi/func/dietpi-set_smbclient index a9a4be7b47..ea85edf474 100644 --- a/dietpi/func/dietpi-set_smbclient +++ b/dietpi/func/dietpi-set_smbclient @@ -36,10 +36,10 @@ #///////////////////////////////////////////////////////////////////////////////////// OPTION=0 CHOICE=0 - samba_clientname=$(cat /DietPi/dietpi.txt | grep -m1 '^SambaClient_ComputerName' | sed 's/.*=//') - samba_clientshare=$(cat /DietPi/dietpi.txt | grep -m1 '^SambaClient_ShareName' | sed 's/.*=//') - samba_clientusename=$(cat /DietPi/dietpi.txt | grep -m1 '^SambaClient_Username' | sed 's/.*=//') - samba_clientpassword=$(cat /DietPi/dietpi.txt | grep -m1 '^SambaClient_Password' | sed 's/.*=//') + samba_clientname=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_SMBCLIENT_COMPUTERNAME=' | sed 's/.*=//') + samba_clientshare=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_SMBCLIENT_SHARENAME=' | sed 's/.*=//') + samba_clientusename=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_SMBCLIENT_USERNAME=' | sed 's/.*=//') + samba_clientpassword=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_SMBCLIENT_PASSWORD=' | sed 's/.*=//') Apply_And_Mount(){ @@ -88,10 +88,10 @@ umount /mnt/samba &> /dev/null #Save to Dietpi.txt - sed -i "/SambaClient_ComputerName/c\SambaClient_ComputerName=$samba_clientname" /DietPi/dietpi.txt - sed -i "/SambaClient_ShareName/c\SambaClient_ShareName=$samba_clientshare" /DietPi/dietpi.txt - sed -i "/SambaClient_Username/c\SambaClient_Username=$samba_clientusename" /DietPi/dietpi.txt - sed -i "/SambaClient_Password/c\SambaClient_Password=$samba_clientpassword" /DietPi/dietpi.txt + sed -i "/CONFIG_SMBCLIENT_COMPUTERNAME/c\CONFIG_SMBCLIENT_COMPUTERNAME=$samba_clientname" /DietPi/dietpi.txt + sed -i "/CONFIG_SMBCLIENT_SHARENAME/c\CONFIG_SMBCLIENT_SHARENAME=$samba_clientshare" /DietPi/dietpi.txt + sed -i "/CONFIG_SMBCLIENT_USERNAME/c\CONFIG_SMBCLIENT_USERNAME=$samba_clientusename" /DietPi/dietpi.txt + sed -i "/CONFIG_SMBCLIENT_PASSWORD/c\CONFIG_SMBCLIENT_PASSWORD=$samba_clientpassword" /DietPi/dietpi.txt Apply_And_Mount fi diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index e0d8619987..748249bd0a 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -91,7 +91,7 @@ deb https://archive.raspberrypi.org/debian/ $G_DISTRO_NAME main ui _EOF_ # Update dietpi.txt entry - sed -i "/Apt_Raspbian_Mirror=/c\Apt_Raspbian_Mirror=$INPUT_MODE_VALUE" /DietPi/dietpi.txt + sed -i "/CONFIG_APT_RASPBIAN_MIRROR=/c\CONFIG_APT_RASPBIAN_MIRROR=$INPUT_MODE_VALUE" /DietPi/dietpi.txt # - Set debian else @@ -116,7 +116,7 @@ _EOF_ fi # Update dietpi.txt entry - sed -i "/Apt_Debian_Mirror=/c\Apt_Debian_Mirror=$INPUT_MODE_VALUE" /DietPi/dietpi.txt + sed -i "/CONFIG_APT_DEBIAN_MIRROR=/c\CONFIG_APT_DEBIAN_MIRROR=$INPUT_MODE_VALUE" /DietPi/dietpi.txt fi @@ -151,7 +151,7 @@ _EOF_ done # - Update DietPi.txt - sed -i "/NTPD_Mirror=/c\NTPD_Mirror=$INPUT_MODE_VALUE" /DietPi/dietpi.txt + sed -i "/CONFIG_NTP_MIRROR=/c\CONFIG_NTP_MIRROR=$INPUT_MODE_VALUE" /DietPi/dietpi.txt else @@ -169,7 +169,7 @@ _EOF_ if [ -n "$INPUT_MODE_VALUE" ]; then # - Reset global to disabled, prevents run_ntpd in dietpi-software - sed -i "/ntpd_update_mode=/c\ntpd_update_mode=0" /DietPi/dietpi.txt + sed -i "/CONFIG_NTP_MODE=/c\CONFIG_NTP_MODE=0" /DietPi/dietpi.txt #Install ntp if required if (( $INPUT_MODE_VALUE >= 1 && $INPUT_MODE_VALUE <= 3 )); then @@ -206,7 +206,7 @@ _EOF_ fi # - Update DietPi.txt - sed -i "/ntpd_update_mode=/c\ntpd_update_mode=$INPUT_MODE_VALUE" /DietPi/dietpi.txt + sed -i "/CONFIG_NTP_MODE=/c\CONFIG_NTP_MODE=$INPUT_MODE_VALUE" /DietPi/dietpi.txt # - Update now /DietPi/dietpi/func/run_ntpd status @@ -260,7 +260,7 @@ _EOF_ 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/.*=//')" + chpasswd <<< "$INPUT_MODE_VALUE:$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_GLOBAL_PASSWORD=' | sed 's/.*=//')" # Copy existing profile/bashrc cp /root/.profile /home/$INPUT_MODE_VALUE/ @@ -340,7 +340,7 @@ _EOF_ Verify_DietPi_Txt(){ #Verify entries with git dietpi.txt - local gitbranch=$(grep -m1 '^gitbranch=' /DietPi/dietpi.txt | sed 's/.*=//') + local gitbranch=$(grep -m1 '^DEV_GITBRANCH=' /DietPi/dietpi.txt | sed 's/.*=//') if [ -z "$gitbranch" ]; then gitbranch='master' diff --git a/dietpi/func/run_ntpd b/dietpi/func/run_ntpd index 2639ea15aa..525c24c822 100644 --- a/dietpi/func/run_ntpd +++ b/dietpi/func/run_ntpd @@ -29,7 +29,7 @@ EXIT_CODE=-1 FP_EXIT_CODE='/var/lib/dietpi/.ntpd_exit_status' - NTPD_UPDATE_MODE=$(grep -m1 '^ntpd_update_mode=' /DietPi/dietpi.txt | sed 's/.*=//') + NTPD_UPDATE_MODE=$(grep -m1 '^CONFIG_NTP_MODE=' /DietPi/dietpi.txt | sed 's/.*=//') Update_NTPD(){ diff --git a/dietpi/login b/dietpi/login index 8611f9bc83..5b804cb6c7 100644 --- a/dietpi/login +++ b/dietpi/login @@ -200,7 +200,7 @@ do # - Automated - if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 '^AUTO_Install_Enable=1') )); then + if (( $(cat /DietPi/dietpi.txt | grep -ci -m1 '^AUTO_SETUP_AUTOMATED=1') )); then G_DIETPI-NOTIFY 2 'DietPi is currently installing and configuring your system. Please wait for this to complete, check back later.' diff --git a/dietpi/misc/dietpi-justboom b/dietpi/misc/dietpi-justboom index e678359ba0..d0888ec864 100644 --- a/dietpi/misc/dietpi-justboom +++ b/dietpi/misc/dietpi-justboom @@ -100,7 +100,7 @@ Read_Globals(){ - SOUNDCARD_CURRENT=$(cat /DietPi/dietpi.txt | grep -m1 'soundcard=' | sed 's/.*=//') + SOUNDCARD_CURRENT=$(cat /DietPi/dietpi.txt | grep -m1 'CONFIG_SOUNDCARD=' | sed 's/.*=//') EQ_ENABLED=$(cat /etc/asound.conf | grep -ci -m1 '^pcm.plugequal') diff --git a/dietpi/patch_file b/dietpi/patch_file index f473f29c7e..da2f9c9857 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -36,7 +36,7 @@ fi - AUTOINSTALL_ENABLED=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_Install_Enable=' | sed 's/.*=//') + AUTOINSTALL_ENABLED=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_AUTOMATED=' | sed 's/.*=//') if (( $AUTOINSTALL_ENABLED == 1 && $(cat /DietPi/dietpi/.install_stage) <= 0 )); then #Automated export G_USER_INPUTS=0 From d5b7c01d0c95ce9ac846d44adf02a6ae0f9ab8cd Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 1 Jan 2018 12:27:27 +0000 Subject: [PATCH 169/390] v6.0 + Fix for: https://github.com/Fourdee/DietPi/issues/1311#issuecomment-354649433 No need to escape backslash. --- dietpi/func/dietpi-globals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 424a0513a0..76d6d92702 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -58,7 +58,7 @@ local header_line="\e[90m─────────────────────────────────────────────────────\e[0m" #Line overwriting string: - local overwrite_string="\\r\\033[K" + local overwrite_string="\r\033[K" local status_text_process="\e[33mProcessing\e[0m" local status_text_ok="\e[32m Ok \e[0m" From 4b059b09bd908a8db1bbde3c579d838f37901e1d Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 1 Jan 2018 12:39:08 +0000 Subject: [PATCH 170/390] v6.0 + fix for [Processing] APT autoremove + purge, please waitReading package lists... --- dietpi/func/dietpi-globals | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 76d6d92702..95a85850b6 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -728,7 +728,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="G_AGP: $string" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" - G_DIETPI-NOTIFY -2 "APT removal for: $string, please wait" + G_DIETPI-NOTIFY -2 "APT removal for: $string, please wait..." DEBIAN_FRONTEND=noninteractive apt-get purge -y $string $options 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} @@ -747,7 +747,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="G_AGA:" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" - G_DIETPI-NOTIFY -2 "APT autoremove + purge, please wait" + G_DIETPI-NOTIFY -2 "APT autoremove + purge, please wait..." DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} From b4239c1ea322342d8c5446918009bca3a0dd34cc Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 1 Jan 2018 14:57:54 +0100 Subject: [PATCH 171/390] v6.0 + Fix missing "fi" --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 4c80f69d68..21023e1ada 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -338,7 +338,7 @@ # G_DIETPI-NOTIFY 2 "Disabled Buster for RPi: index $temp_distro_index" # temp_distro_available=0 - #fi + fi # - Enable option if (( $temp_distro_available )); then From 741035212a314ae58534cab62fcdb591408ccf4a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 1 Jan 2018 17:12:48 +0100 Subject: [PATCH 172/390] v6.0 + Fixed typo, leading to not removed APT norecommends config. --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 21023e1ada..e15fe50d84 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -682,7 +682,7 @@ _EOF_ # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files G_DIETPI-NOTIFY 2 "Returning installation of recommends back to default" - G_RUN_CMD rm /etc/apt/apt-conf.d/99-dietpi-norecommends + G_RUN_CMD rm /etc/apt/apt.conf.d/99-dietpi-norecommends G_DIETPI-NOTIFY 2 "Purging APT with autoremoval (in case of DISTRO upgrade/downgrade):" From b02674eca84ff097b36bbf334db828bc3ddc3a95 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 1 Jan 2018 20:37:39 +0100 Subject: [PATCH 173/390] v6.0 + Keeping currently installed kernel on Odroid devices, install linux-image-armhf-odroid-xu3 otherwise. --- PREP_SYSTEM_FOR_DIETPI.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index e15fe50d84..91e42da00c 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -556,8 +556,9 @@ _EOF_ # Odroid XU3/4/HC1 elif (( $G_HW_MODEL == 11 )); then - G_AGI linux-image-4.9-armhf-odroid-xu3 - #aPACKAGES_REQUIRED_INSTALL+=('linux-image-armhf-odroid-xu3') + #G_AGI linux-image-4.9-armhf-odroid-xu3 + G_AGI $(dpkg --get-selections | grep "linux-image*" | awk '{print $1}') + [ ! -n "$(dpkg --get-selections | grep "linux-image*" ] && G_AGI linux-image-armhf-odroid-xu3 # Odroid C1 elif (( $G_HW_MODEL == 10 )); then From d73c2f9afe979e62581e8fcffa55933acfc0dbc5 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 1 Jan 2018 21:00:29 +0100 Subject: [PATCH 174/390] v6.0 + Simplify/Fix processing messages --- dietpi/func/dietpi-globals | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 95a85850b6..f64d7bfa56 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -57,9 +57,6 @@ #header_line="\e[38;5;154m─────────────────────────────────────────────────────\e[0m" local header_line="\e[90m─────────────────────────────────────────────────────\e[0m" - #Line overwriting string: - local overwrite_string="\r\033[K" - local status_text_process="\e[33mProcessing\e[0m" local status_text_ok="\e[32m Ok \e[0m" local status_text_error="\e[31m Error \e[0m" @@ -71,19 +68,19 @@ Print_Process(){ - echo -ne "$overwrite_string $bracket_string_l$status_text_process$bracket_string_r" + echo -ne " $bracket_string_l$status_text_process$bracket_string_r" } Print_Ok(){ - echo -ne "$overwrite_string $bracket_string_l$status_text_ok$bracket_string_r" + echo -ne " $bracket_string_l$status_text_ok$bracket_string_r" } Print_Failed(){ - echo -ne "$overwrite_string $bracket_string_l$status_text_error$bracket_string_r" + echo -ne " $bracket_string_l$status_text_error$bracket_string_r" } @@ -141,6 +138,7 @@ Print_Process Print_Input_String 1 + echo -ne "\r" #Status Ok #$@ = txt desc @@ -162,7 +160,7 @@ #$@ = txt desc elif (( $1 == 2 )); then - echo -ne "$overwrite_string $bracket_string_l\e[0m Info \e[0m$bracket_string_r" + echo -ne " $bracket_string_l\e[0m Info \e[0m$bracket_string_r" echo -ne "\e[90m" Print_Input_String 1 echo -e "\e[0m" @@ -172,11 +170,11 @@ #$3 = txt mode elif (( $1 == 3 )); then - echo -e "$overwrite_string\n \e[38;5;154m$2\e[0m" + echo -e "\n \e[38;5;154m$2\e[0m" echo -e "$header_line" - echo -e " \e[90mMode:\e[0m$(Print_Input_String 2)" - echo -e " \e[90mPlease wait...\e[0m\n" - #Print_Process + echo -e " \e[90mMode:\e[0m$(Print_Input_String 2)\n" + Print_Process + echo -ne " \e[90mPlease wait...\e[0m\r" fi #----------------------------------------------------------------------------------- From 5d9fb55d01551bfa7f2b84cbd29bcb65adbc3ead Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 1 Jan 2018 23:00:59 +0100 Subject: [PATCH 175/390] v6.0 + Assue, that Ok, Error and Info messages clean the whole line of in case prior process messages. --- dietpi/func/dietpi-globals | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index f64d7bfa56..d16df00dee 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -60,6 +60,7 @@ local status_text_process="\e[33mProcessing\e[0m" local status_text_ok="\e[32m Ok \e[0m" local status_text_error="\e[31m Error \e[0m" + local status_text_info="\e[0m Info \e[0m" local bracket_string_l="\e[90m[\e[0m" local bracket_string_r="\e[90m]\e[0m" @@ -74,13 +75,19 @@ Print_Ok(){ - echo -ne " $bracket_string_l$status_text_ok$bracket_string_r" + echo -ne "\033[K $bracket_string_l$status_text_ok$bracket_string_r" } Print_Failed(){ - echo -ne " $bracket_string_l$status_text_error$bracket_string_r" + echo -ne "\033[K $bracket_string_l$status_text_error$bracket_string_r" + + } + + Print_Info(){ + + echo -ne "\033[K $bracket_string_l$status_text_info$bracket_string_r" } @@ -160,7 +167,7 @@ #$@ = txt desc elif (( $1 == 2 )); then - echo -ne " $bracket_string_l\e[0m Info \e[0m$bracket_string_r" + Print_Info echo -ne "\e[90m" Print_Input_String 1 echo -e "\e[0m" @@ -188,7 +195,7 @@ if (( ! $G_CHECK_ROOT_USER_VERIFIED )); then - G_DIETPI-NOTIFY -2 'Checking for (elevated) root access, please wait..' + G_DIETPI-NOTIFY -2 'Checking for (elevated) root access' if (( $UID != 0 )); then @@ -462,7 +469,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="$@" G_ERROR_HANDLER_EXITCODE=0 - G_DIETPI-NOTIFY -2 "Checking file/folder exists: $G_ERROR_HANDLER_COMMAND, please wait..." + G_DIETPI-NOTIFY -2 "Checking file/folder exists: $G_ERROR_HANDLER_COMMAND" local string='' @@ -648,7 +655,7 @@ $print_logfile_info G_ERROR_HANDLER_EXITCODE=0 G_ERROR_HANDLER_COMMAND="Connection test: $string" - G_DIETPI-NOTIFY -2 "Testing connection to $string for max $(($timeout * $retry)) seconds, please wait..." + G_DIETPI-NOTIFY -2 "Testing connection to $string for max $(($timeout * $retry)) seconds" wget -q --spider --timeout=$timeout --tries=$retry "$string" G_ERROR_HANDLER_EXITCODE=$? @@ -726,7 +733,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="G_AGP: $string" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" - G_DIETPI-NOTIFY -2 "APT removal for: $string, please wait..." + G_DIETPI-NOTIFY -2 "APT removal for: $string" DEBIAN_FRONTEND=noninteractive apt-get purge -y $string $options 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} @@ -745,7 +752,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="G_AGA:" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" - G_DIETPI-NOTIFY -2 "APT autoremove + purge, please wait..." + G_DIETPI-NOTIFY -2 "APT autoremove + purge" DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} @@ -764,7 +771,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="G_AGF:" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" - G_DIETPI-NOTIFY -2 "APT fix, please wait..." + G_DIETPI-NOTIFY -2 "APT fix" DEBIAN_FRONTEND=noninteractive apt-get install -f -y 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} @@ -783,7 +790,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="G_AGUP:" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" - G_DIETPI-NOTIFY -2 "APT update, please wait..." + G_DIETPI-NOTIFY -2 "APT update" DEBIAN_FRONTEND=noninteractive apt-get update 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} @@ -802,7 +809,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="G_AGUG:" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" - G_DIETPI-NOTIFY -2 "APT upgrade, please wait..." + G_DIETPI-NOTIFY -2 "APT upgrade" DEBIAN_FRONTEND=noninteractive apt-get upgrade -y 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} @@ -831,7 +838,7 @@ $print_logfile_info fi - G_DIETPI-NOTIFY -2 "APT dist-upgrade, please wait..." + G_DIETPI-NOTIFY -2 "APT dist-upgrade" DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} @@ -873,7 +880,7 @@ $print_logfile_info if [ -n "$packages_to_install" ]; then - G_DIETPI-NOTIFY -2 "Installing pre-req APT packages, please wait..." + G_DIETPI-NOTIFY -2 "Installing pre-req APT packages" G_AGI $packages_to_install exit_code=$? From 57f6bc2cd8c2a08a1c9b7263439fa97f43ef7357 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 1 Jan 2018 23:02:55 +0100 Subject: [PATCH 176/390] v6.0 + Also process messages should overwrite prior ones. --- dietpi/func/dietpi-globals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index d16df00dee..2b77eea360 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -69,7 +69,7 @@ Print_Process(){ - echo -ne " $bracket_string_l$status_text_process$bracket_string_r" + echo -ne "\033[K $bracket_string_l$status_text_process$bracket_string_r" } From ef251289c0cca1b124318df0a6267efa2cbb1299 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 1 Jan 2018 23:06:49 +0100 Subject: [PATCH 177/390] v6.0 --- dietpi/func/dietpi-globals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 2b77eea360..80ebd01c7c 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -177,7 +177,7 @@ #$3 = txt mode elif (( $1 == 3 )); then - echo -e "\n \e[38;5;154m$2\e[0m" + echo -e "\033[K\n \e[38;5;154m$2\e[0m" echo -e "$header_line" echo -e " \e[90mMode:\e[0m$(Print_Input_String 2)\n" Print_Process From 9f90b9085fe60af44c06380959925e4108ccc007 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 2 Jan 2018 09:55:24 +0000 Subject: [PATCH 178/390] v6.0 + DietPi-Software | qBittorrent: Resolved an issue with inability to log into web interface: https://github.com/Fourdee/DietPi/issues/1366 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0b524919a2..51b3c6f3d9 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -29,6 +29,7 @@ DietPi-Software | NodeRed: Corrected user which nodered runs under, now runs as Bug Fixes: General | Fixed two systemd error messages during shutdown and boot: https://github.com/Fourdee/DietPi/issues/1330 DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi drop during software installs/updates etc: https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480 +DietPi-Software | qBittorrent: Resolved an issue with inability to log into web interface: https://github.com/Fourdee/DietPi/issues/1366 DietPi-Software | Resolved an issue where our custom LD_LIBRARY_PATH would cause APT failures. LD_LIBRARY_PATH has now been reverted, apologies if this effected your system: https://github.com/Fourdee/DietPi/issues/1329 DietPi-Software | Resolved an issue where APT installations would fail if services were masked. All known DietPi software services, will be enabled/unmasked, before installation: https://github.com/Fourdee/DietPi/issues/1320 DietPi-Software | WiFi Hotspot (Stretch): Resolved an issue where hostapd would fail to run due to missing libssl1.0.0 lib, not available in repos: https://github.com/Fourdee/DietPi/issues/1299 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 6590085fde..a649d50534 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11620,7 +11620,8 @@ DynDNS\Service=0 DynDNS\Username= DynDNS\Password= DynDNS\DomainName=changeme.dyndns.org -WebUI\Password_ha1=@ByteArray(5e434b0004be6970cf8878fcf929baba) +WebUI\Password_ha1=@ByteArray($(echo -ne "$GLOBAL_PW" | md5sum | awk '{print $1}')) + [LegalNotice] Accepted=true From c8a962226b7ec2541559de695f807a321c3e2547 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 2 Jan 2018 10:11:39 +0000 Subject: [PATCH 179/390] v6.0 - generate log file for G_CHECK_URL: https://github.com/Fourdee/DietPi/issues/1311#issuecomment-354734046 --- dietpi/dietpi-software | 1 - dietpi/func/dietpi-globals | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a649d50534..49adfc7057 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -16438,7 +16438,6 @@ _EOF_ G_DIETPI-NOTIFY 3 DietPi-Software "Install software" echo -e " ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}" - G_DIETPI-NOTIFY 2 "Please wait...\n" /DietPi/dietpi/dietpi-funtime 0 } diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 80ebd01c7c..e5d285304a 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -654,10 +654,11 @@ $print_logfile_info G_ERROR_HANDLER_EXITCODE=0 G_ERROR_HANDLER_COMMAND="Connection test: $string" + G_ERROR_HANDLER_ONERROR_FPLOGFILE='/tmp/G_CHECK_URL' G_DIETPI-NOTIFY -2 "Testing connection to $string for max $(($timeout * $retry)) seconds" - wget -q --spider --timeout=$timeout --tries=$retry "$string" + wget --spider --timeout=$timeout --tries=$retry "$string" &> /tmp/G_CHECK_URL G_ERROR_HANDLER_EXITCODE=$? #--no-check-certificate From 8c8ac21605ce605aa889dc982e38463f71b6ab31 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 2 Jan 2018 10:12:12 +0000 Subject: [PATCH 180/390] v6.0 minor --- dietpi/func/dietpi-globals | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index e5d285304a..a6850c97c8 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -667,6 +667,8 @@ $print_logfile_info G_ERROR_HANDLER_ONERROR_USERMSG="Connection failed while trying to access: $string. The URL may be offline, or invalid." G_ERROR_HANDLER + rm /tmp/G_CHECK_URL + return $G_ERROR_HANDLER_EXITCODE } From 093dc52e0907c95c48f38ddd22590e2c38f4ebf9 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 2 Jan 2018 11:40:37 +0100 Subject: [PATCH 181/390] v6.0 + Add missing ")" --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 91e42da00c..c58692d6e9 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -558,7 +558,7 @@ _EOF_ #G_AGI linux-image-4.9-armhf-odroid-xu3 G_AGI $(dpkg --get-selections | grep "linux-image*" | awk '{print $1}') - [ ! -n "$(dpkg --get-selections | grep "linux-image*" ] && G_AGI linux-image-armhf-odroid-xu3 + [ ! -n "$(dpkg --get-selections | grep "linux-image*") ] && G_AGI linux-image-armhf-odroid-xu3 # Odroid C1 elif (( $G_HW_MODEL == 10 )); then From 40c2a2ffb6d47f83d623222cbad0fe5f02443d8b Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 2 Jan 2018 11:03:15 +0000 Subject: [PATCH 182/390] v6.0 + General | Swapfile generation is now completed during 1st run of dietpi-software: https://github.com/Fourdee/DietPi/issues/1270#issue-278797206 --- CHANGELOG.txt | 1 + dietpi/boot | 3 --- dietpi/dietpi-software | 9 ++++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 51b3c6f3d9..3fa3f1f5a2 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -13,6 +13,7 @@ General | FHS compliance completed. /etc/dietpi has moved to /var/lib/dietpi. RA General | wget: Now set to prefer IPv4 by default (generally faster): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 General | APT: Now set to force IPv4 by default (generally faster): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 General | SparkySBC: CPU gov default changed to Performance, reports of increased stability. +General | Swapfile generation is now completed during 1st run of dietpi-software (previously boot stage): https://github.com/Fourdee/DietPi/issues/1270#issue-278797206 DietPi-Automation | All dietpi.txt entries have been renamed and cleaned up. DietPi-Boot | Improved the method of initial FS_partition and FS_expansion during 1st run, via systemD services. 'fs_force_resize=' in dietpi.txt is no longer supported: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352159930 DietPi-Banner | IP: Will now also list the active network adapter used (eg: eth0/wlan0) diff --git a/dietpi/boot b/dietpi/boot index c1acd2e433..8623112618 100644 --- a/dietpi/boot +++ b/dietpi/boot @@ -370,9 +370,6 @@ fi - #Enable/Create swapfile. - /DietPi/dietpi/func/dietpi-set_dphys-swapfile $(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_SWAPFILE_SIZE=' | sed 's/.*=//' ) - #Generate unique Dropbear host-key: rm /etc/dropbear/*key &> /dev/null dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key &> /dev/null diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 49adfc7057..41dd94ff6a 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -14490,6 +14490,13 @@ _EOF_ # Stop Services /DietPi/dietpi/dietpi-services stop #------------------------------------------------------------ + #Generate Swapfile during 1st run (moved from boot: https://github.com/Fourdee/DietPi/issues/1270#issue-278797206) + if (( $G_DIETPI_INSTALL_STAGE == 0 )); then + + /DietPi/dietpi/func/dietpi-set_dphys-swapfile $(grep -m1 '^AUTO_SETUP_SWAPFILE_SIZE=' /DietPi/dietpi.txt | sed 's/.*=//') + + fi + #------------------------------------------------------------ #Generate userdata folders: Create_UserContent_Folders #------------------------------------------------------------ @@ -16568,7 +16575,7 @@ _EOF_ fi - #Apply 1st run automation and ask questions. + #Apply 1st run automation if (( $G_DIETPI_INSTALL_STAGE == 0 )); then #Activate automation settings from dietpi.txt, if set. From 9ebbafc321751525d0f0df210792ad77fa2403d5 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 2 Jan 2018 13:03:52 +0100 Subject: [PATCH 183/390] v6.0 + Real fix Odroid kernel handling --- PREP_SYSTEM_FOR_DIETPI.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index c58692d6e9..6067d11a66 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -557,8 +557,8 @@ _EOF_ elif (( $G_HW_MODEL == 11 )); then #G_AGI linux-image-4.9-armhf-odroid-xu3 - G_AGI $(dpkg --get-selections | grep "linux-image*" | awk '{print $1}') - [ ! -n "$(dpkg --get-selections | grep "linux-image*") ] && G_AGI linux-image-armhf-odroid-xu3 + G_AGI $(dpkg --get-selections | grep '^linux-image' | awk '{print $1}') + (( ! $(dpkg --get-selections | grep -ci -m1 '^linux-image') )) && G_AGI linux-image-armhf-odroid-xu3 # Odroid C1 elif (( $G_HW_MODEL == 10 )); then From 6826ec1938e23e8a904ac2430f602207114b6e3a Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 2 Jan 2018 12:12:33 +0000 Subject: [PATCH 184/390] v6.0 + Removal of Error_NoConnection_NoInstall https://github.com/Fourdee/DietPi/issues/1357 --- dietpi/dietpi-software | 2874 ++++++++++++++-------------------------- 1 file changed, 1011 insertions(+), 1863 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 41dd94ff6a..62ee85a011 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3490,23 +3490,18 @@ _EOF_ # INSTALL_URL_ADDRESS='https://github.com/Hellowlol/HTPC-Manager.git' # # G_CHECK_URL "$INSTALL_URL_ADDRESS" - # #Install - # if (( $? == 0 )); then # - # #Install Python and PIP - # AGI_ERROR_HANDLED python python-pip python-imaging + # #Install Python and PIP + # AGI_ERROR_HANDLED python python-pip python-imaging # - # cd "$HOME" - # git clone --depth=1 "$INSTALL_URL_ADDRESS" + # cd "$HOME" + # git clone --depth=1 "$INSTALL_URL_ADDRESS" # - # # - Move HTPC Manager to a 'better' location - # mkdir -p "$G_FP_DIETPI_USERDATA"/htpc-manager - # mv "$HOME"/HTPC-Manager/* "$G_FP_DIETPI_USERDATA"/htpc-manager/ - # rm -R "$HOME"/HTPC-Manager + # # - Move HTPC Manager to a 'better' location + # mkdir -p "$G_FP_DIETPI_USERDATA"/htpc-manager + # mv "$HOME"/HTPC-Manager/* "$G_FP_DIETPI_USERDATA"/htpc-manager/ + # rm -R "$HOME"/HTPC-Manager # - # else - # Error_NoConnection_NoInstall - # fi # fi # #///////////////////////////////////////////////////////////////////////////////////// @@ -3526,16 +3521,8 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - AGI_ERROR_HANDLED lxde upower policykit-1 iceweasel p7zip-full --no-install-recommends - #upower policykit-1. Needed for LXDE logout menu item to show shutdown/restart ...... - - else - - Error_NoConnection_NoInstall - - fi + AGI_ERROR_HANDLED lxde upower policykit-1 iceweasel p7zip-full --no-install-recommends + #upower policykit-1. Needed for LXDE logout menu item to show shutdown/restart ...... fi @@ -3550,15 +3537,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - AGI_ERROR_HANDLED mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full --no-install-recommends - - else - - Error_NoConnection_NoInstall - - fi + AGI_ERROR_HANDLED mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full --no-install-recommends fi @@ -3573,15 +3552,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - AGI_ERROR_HANDLED x-window-system-core wmaker gnustep gnustep-devel gnustep-games libc-dbg upower policykit-1 iceweasel p7zip-full --no-install-recommends - - else - - Error_NoConnection_NoInstall - - fi + AGI_ERROR_HANDLED x-window-system-core wmaker gnustep gnustep-devel gnustep-games libc-dbg upower policykit-1 iceweasel p7zip-full --no-install-recommends fi @@ -3596,15 +3567,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - AGI_ERROR_HANDLED xfce4 xfce4-terminal gnome-icon-theme tango-icon-theme iceweasel p7zip-full --no-install-recommends - - else - - Error_NoConnection_NoInstall - - fi + AGI_ERROR_HANDLED xfce4 xfce4-terminal gnome-icon-theme tango-icon-theme iceweasel p7zip-full --no-install-recommends fi @@ -3645,17 +3608,9 @@ _EOF_ # Now, check that the links are legitimate G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb - - else - - Error_NoConnection_NoInstall - - fi + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb fi @@ -3900,21 +3855,14 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/mpd_0.19.21_arm64.deb' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - #libupnp6 for net discov with upnp/avahi - AGI_ERROR_HANDLED libupnp6 - AGI_ERROR_HANDLED libmpdclient2 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file --no-install-recommends - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb + #libupnp6 for net discov with upnp/avahi + AGI_ERROR_HANDLED libupnp6 + AGI_ERROR_HANDLED libmpdclient2 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file --no-install-recommends - else - - Error_NoConnection_NoInstall - - fi + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb else @@ -3952,24 +3900,17 @@ _EOF_ INSTALL_URL_ADDRESS+='.deb' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - #Prereqs - AGI_ERROR_HANDLED libmpdclient2 libflac8 libyajl2 libavahi-client3 libvorbisfile3 libwavpack1 libmad0 libmpg123-0 libopus0 libavformat57 libfaad2 libcdio-paranoia1 libiso9660-8 libshout3 libid3tag0 + #Prereqs + AGI_ERROR_HANDLED libmpdclient2 libflac8 libyajl2 libavahi-client3 libvorbisfile3 libwavpack1 libmad0 libmpg123-0 libopus0 libavformat57 libfaad2 libcdio-paranoia1 libiso9660-8 libshout3 libid3tag0 - apt-mark unhold mpd &> /dev/null #??? Not required for dpkg -i installs + apt-mark unhold mpd &> /dev/null #??? Not required for dpkg -i installs - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb - - apt-mark hold mpd # prevent repo updates from overwriting - - else - - Error_NoConnection_NoInstall + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb - fi + apt-mark hold mpd # prevent repo updates from overwriting fi @@ -3984,18 +3925,9 @@ _EOF_ INSTALL_URL_ADDRESS='https://www.phpbb.com/files/release/phpBB-3.2.1.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip -d /var/www - rm package.zip - - else - - Error_NoConnection_NoInstall - - fi + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip -d /var/www + rm package.zip fi @@ -4007,55 +3939,45 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/OpenBazaar/OpenBazaar-Server.git' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - - if (( $? == 0 )); then - - AGI_ERROR_HANDLED libsodium-dev automake autoconf pkg-config libtool libssl-dev libffi-dev python-dev openssl libzmq3-dev - - #Not required. - #AGI_ERROR_HANDLED software-properties-common - #add-apt-repository -y ppa:chris-lea/libsodium - #G_AGUP - - pip install cryptography - cd "$HOME" - git clone --depth=1 https://github.com/zeromq/libzmq - git clone --depth=1 https://github.com/pyca/pynacl/ - git clone --depth=1 "$INSTALL_URL_ADDRESS" + AGI_ERROR_HANDLED libsodium-dev automake autoconf pkg-config libtool libssl-dev libffi-dev python-dev openssl libzmq3-dev - # - compile - cd "$HOME"/libzmq - ./autogen.sh && ./configure && make -j $G_HW_CPU_CORES - make check && make install && ldconfig + #Not required. + #AGI_ERROR_HANDLED software-properties-common + #add-apt-repository -y ppa:chris-lea/libsodium + #G_AGUP - cd "$HOME"/pynacl - python setup.py build && python setup.py install + pip install cryptography - cd "$HOME" - - # - Move OpenBazaar to a 'better' location - mkdir -p /etc/openbazaar-server - mv "$HOME"/OpenBazaar-Server/* /etc/openbazaar-server/ - rm -R "$HOME"/OpenBazaar-Server + cd "$HOME" + git clone --depth=1 https://github.com/zeromq/libzmq + git clone --depth=1 https://github.com/pyca/pynacl/ + git clone --depth=1 "$INSTALL_URL_ADDRESS" - # - install OpenBazaar - cd /etc/openbazaar-server - pip install -r requirements.txt + # - compile + cd "$HOME"/libzmq + ./autogen.sh && ./configure && make -j $G_HW_CPU_CORES + make check && make install && ldconfig - cd "$HOME" + cd "$HOME"/pynacl + python setup.py build && python setup.py install - # - Clean up, remove source libraries - rm -R "$HOME"/libzmq - rm -R "$HOME"/pynacl + cd "$HOME" + # - Move OpenBazaar to a 'better' location + mkdir -p /etc/openbazaar-server + mv "$HOME"/OpenBazaar-Server/* /etc/openbazaar-server/ + rm -R "$HOME"/OpenBazaar-Server - else + # - install OpenBazaar + cd /etc/openbazaar-server + pip install -r requirements.txt - Error_NoConnection_NoInstall + cd "$HOME" - fi + # - Clean up, remove source libraries + rm -R "$HOME"/libzmq + rm -R "$HOME"/pynacl fi @@ -4067,17 +3989,10 @@ _EOF_ INSTALL_URL_ADDRESS='http://yacy.net/release/yacy_v1.92_20161226_9000.tar.gz' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.tar.gz - tar xvf package.tar.gz -C /etc/ - rm package.tar.gz - else - - Error_NoConnection_NoInstall - - fi + wget "$INSTALL_URL_ADDRESS" -O package.tar.gz + tar xvf package.tar.gz -C /etc/ + rm package.tar.gz fi @@ -4092,37 +4007,29 @@ _EOF_ (( $G_DISTRO > 4 )) && INSTALL_URL_ADDRESS='https://download.owncloud.org/community/owncloud-latest.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - # Install necessary PHP modules: https://doc.owncloud.org/server/latest/admin_manual/installation/source_installation.html#php-extensions - AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis + # Install necessary PHP modules: https://doc.owncloud.org/server/latest/admin_manual/installation/source_installation.html#php-extensions + AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis - if [ ! -f /etc/apt/sources.list.d/owncloud.list ] && [ ! -f /var/www/owncloud/occ ]; then + if [ ! -f /etc/apt/sources.list.d/owncloud.list ] && [ ! -f /var/www/owncloud/occ ]; then - wget "$INSTALL_URL_ADDRESS" -O owncloud.key_or_zip - if (( $G_DISTRO < 5 )); then + wget "$INSTALL_URL_ADDRESS" -O owncloud.key_or_zip + if (( $G_DISTRO < 5 )); then - echo -e "deb https://download.owncloud.org/download/repositories/stable/Debian_$(( $G_DISTRO + 5 )).0/ /" > /etc/apt/sources.list.d/owncloud.list - apt-key add - < owncloud.key_or_zip && G_AGUP - - else + echo -e "deb https://download.owncloud.org/download/repositories/stable/Debian_$(( $G_DISTRO + 5 )).0/ /" > /etc/apt/sources.list.d/owncloud.list + apt-key add - < owncloud.key_or_zip && G_AGUP - unzip -o owncloud.key_or_zip -d /var/www + else - fi - rm owncloud.key_or_zip + unzip -o owncloud.key_or_zip -d /var/www fi - - [ -f /etc/apt/sources.list.d/owncloud.list ] && AGI_ERROR_HANDLED owncloud-files - - else - - Error_NoConnection_NoInstall + rm owncloud.key_or_zip fi + [ -f /etc/apt/sources.list.d/owncloud.list ] && AGI_ERROR_HANDLED owncloud-files + fi #Nextcloud @@ -4134,23 +4041,15 @@ _EOF_ INSTALL_URL_ADDRESS='https://download.nextcloud.com/server/releases/latest.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - # Install necessary PHP modules: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis - - if [ ! -f /var/www/nextcloud/occ ]; then - - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip -d /var/www - rm package.zip - fi + # Install necessary PHP modules: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation + AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis - else + if [ ! -f /var/www/nextcloud/occ ]; then - Error_NoConnection_NoInstall + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip -d /var/www + rm package.zip fi @@ -4165,48 +4064,39 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/ympd_1.2.3.7z' G_CHECK_URL "$INSTALL_URL_ADDRESS" - # Install - if (( $? == 0 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.7z - 7z x -y package.7z - - local binary_name='ympd_' - # - armv6 - if (( $G_HW_ARCH == 1 )); then - - binary_name+='armv6' - - # - armv7 - elif (( $G_HW_ARCH == 2 )); then + wget "$INSTALL_URL_ADDRESS" -O package.7z + 7z x -y package.7z - binary_name+='armv7' + local binary_name='ympd_' + # - armv6 + if (( $G_HW_ARCH == 1 )); then - # - arm64 - elif (( $G_HW_ARCH == 3 )); then + binary_name+='armv6' - binary_name+='armv8' + # - armv7 + elif (( $G_HW_ARCH == 2 )); then - # - x86_64 - elif (( $G_HW_ARCH == 10 )); then + binary_name+='armv7' - binary_name+='amd64' + # - arm64 + elif (( $G_HW_ARCH == 3 )); then - fi + binary_name+='armv8' - binary_name+="_$G_DISTRO_NAME" + # - x86_64 + elif (( $G_HW_ARCH == 10 )); then - mv "$binary_name" /usr/bin/ympd - chmod +x /usr/bin/ympd + binary_name+='amd64' - rm ympd_* - rm package.7z + fi - else + binary_name+="_$G_DISTRO_NAME" - Error_NoConnection_NoInstall + mv "$binary_name" /usr/bin/ympd + chmod +x /usr/bin/ympd - fi + rm ympd_* + rm package.7z fi @@ -4235,25 +4125,16 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - # Install - if (( $? == 0 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.tar.bz2 - tar xvf package.tar.bz2 - rm package.tar.bz2 - - # - reinstall, clear dir, prevent mv fail on non-empty dir - rm -R /etc/roonbridge &> /dev/null - - mkdir -p /etc/roonbridge - mv RoonBridge/* /etc/roonbridge - rm -R RoonBridge + wget "$INSTALL_URL_ADDRESS" -O package.tar.bz2 + tar xvf package.tar.bz2 + rm package.tar.bz2 - else - - Error_NoConnection_NoInstall + # - reinstall, clear dir, prevent mv fail on non-empty dir + rm -R /etc/roonbridge &> /dev/null - fi + mkdir -p /etc/roonbridge + mv RoonBridge/* /etc/roonbridge + rm -R RoonBridge fi @@ -4279,26 +4160,17 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/cava_0.4.2_arm64.deb' fi - G_CHECK_URL "$INSTALL_URL_ADDRESS" - # Install - if (( $? == 0 )); then - - - AGI_ERROR_HANDLED libpulse0 libfftw3-3 - - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb - - # + Font for cava, nice bars - wget http://dietpi.com/downloads/binaries/all/cava.psf -O "$HOME"/cava.psf + G_CHECK_URL "$INSTALL_URL_ADDRESS" - else + AGI_ERROR_HANDLED libpulse0 libfftw3-3 - Error_NoConnection_NoInstall + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb - fi + # + Font for cava, nice bars + wget http://dietpi.com/downloads/binaries/all/cava.psf -O "$HOME"/cava.psf fi @@ -4311,40 +4183,31 @@ _EOF_ INSTALL_URL_ADDRESS='https://apt.mopidy.com/mopidy.gpg' G_CHECK_URL "$INSTALL_URL_ADDRESS" - # Install - if (( $? == 0 )); then - - wget -q -O - "$INSTALL_URL_ADDRESS" | apt-key add - - # No Buster list available yet, use stretch.list for testing: - if (( $G_DISTRO > 4 )); then - - wget https://apt.mopidy.com/stretch.list -O /etc/apt/sources.list.d/mopidy.list - - else - - wget https://apt.mopidy.com/"$G_DISTRO_NAME".list -O /etc/apt/sources.list.d/mopidy.list + wget -q -O - "$INSTALL_URL_ADDRESS" | apt-key add - + # No Buster list available yet, use stretch.list for testing: + if (( $G_DISTRO > 4 )); then - fi - G_AGUP - AGI_ERROR_HANDLED mopidy + wget https://apt.mopidy.com/stretch.list -O /etc/apt/sources.list.d/mopidy.list - #ARMv8 - #NB: No ARM64 packages currently exist in mopidy repo. So it will throw a minor error when updating apt. - #Mopidy web client extensions not loading in webpage... - # if (( $G_HW_ARCH == 3 )); then + else - # AGI_ERROR_HANDLED build-essential python-dev - # pip install mopidy #no effect, claims already upto date. + wget https://apt.mopidy.com/"$G_DISTRO_NAME".list -O /etc/apt/sources.list.d/mopidy.list - # fi + fi + G_AGUP + AGI_ERROR_HANDLED mopidy - pip install Mopidy-MusicBox-Webclient Mopidy-Local-Images + #ARMv8 + #NB: No ARM64 packages currently exist in mopidy repo. So it will throw a minor error when updating apt. + #Mopidy web client extensions not loading in webpage... + # if (( $G_HW_ARCH == 3 )); then - else + # AGI_ERROR_HANDLED build-essential python-dev + # pip install mopidy #no effect, claims already upto date. - Error_NoConnection_NoInstall + # fi - fi + pip install Mopidy-MusicBox-Webclient Mopidy-Local-Images fi @@ -4433,21 +4296,12 @@ _EOF_ fi G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - #NoIp Binary install - wget "$INSTALL_URL_ADDRESS" -O dietpi-noip.zip - unzip -o dietpi-noip.zip - rm dietpi-noip.zip - mv noip_binary /usr/local/bin/noip2 - chmod +x /usr/local/bin/noip2 - - else - - Error_NoConnection_NoInstall - - fi + #NoIp Binary install + wget "$INSTALL_URL_ADDRESS" -O dietpi-noip.zip + unzip -o dietpi-noip.zip + rm dietpi-noip.zip + mv noip_binary /usr/local/bin/noip2 + chmod +x /usr/local/bin/noip2 fi @@ -4460,29 +4314,20 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/amiberry-rpi_v2.1.1.7z' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - AGI_ERROR_HANDLED alsa-oss joystick libsdl-image1.2 libsdl-ttf2.0-0 libsdl-gfx1.2-5 libguichan-0.8.1-1* libguichan-allegro-0.8.1-1* libguichan-sdl-0.8.1-1* libguichan-opengl-0.8.1-1* libjpgalleg4.4 libxml2 libmpg123-0 - - #libmpeg2-4 # Required for dev branch - - # + SDL2 - AGI_ERROR_HANDLED libpng12-0 libflac8 libmpg123-0 libgoogle-perftools4 libfreetype6 libxxf86vm1 + AGI_ERROR_HANDLED alsa-oss joystick libsdl-image1.2 libsdl-ttf2.0-0 libsdl-gfx1.2-5 libguichan-0.8.1-1* libguichan-allegro-0.8.1-1* libguichan-sdl-0.8.1-1* libguichan-opengl-0.8.1-1* libjpgalleg4.4 libxml2 libmpg123-0 - #Download binaries - # - Backup existing autostart.uae for user - mv "$G_FP_DIETPI_USERDATA"/amiberry/conf/autostart.uae "$G_FP_DIETPI_USERDATA"/amiberry/conf/autostart_pre-dietpi-update.uae &> /dev/null + #libmpeg2-4 # Required for dev branch - wget "$INSTALL_URL_ADDRESS" -O package.7z - 7z x -y package.7z -o/etc - rm package.7z - - else + # + SDL2 + AGI_ERROR_HANDLED libpng12-0 libflac8 libmpg123-0 libgoogle-perftools4 libfreetype6 libxxf86vm1 - Error_NoConnection_NoInstall + #Download binaries + # - Backup existing autostart.uae for user + mv "$G_FP_DIETPI_USERDATA"/amiberry/conf/autostart.uae "$G_FP_DIETPI_USERDATA"/amiberry/conf/autostart_pre-dietpi-update.uae &> /dev/null - fi + wget "$INSTALL_URL_ADDRESS" -O package.7z + 7z x -y package.7z -o/etc + rm package.7z fi @@ -4495,20 +4340,11 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/rpi/dxx-rebirth.7z' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - AGI_ERROR_HANDLED libsdl-mixer1.2 libsdl1.2debian libphysfs1 - - wget "$INSTALL_URL_ADDRESS" -O package.7z - 7z x -y package.7z -o"$G_FP_DIETPI_USERDATA" - rm package.7z - - else - - Error_NoConnection_NoInstall + AGI_ERROR_HANDLED libsdl-mixer1.2 libsdl1.2debian libphysfs1 - fi + wget "$INSTALL_URL_ADDRESS" -O package.7z + 7z x -y package.7z -o"$G_FP_DIETPI_USERDATA" + rm package.7z fi @@ -4535,51 +4371,41 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - - #ARMv8 source build - if (( $G_HW_ARCH == 3 )); then - - AGI_ERROR_HANDLED build-essential zlib1g-dev libcurl4-openssl-dev libcrypto++-dev sqlite3 - - wget "$INSTALL_URL_ADDRESS" -O package.tar - tar xzvf package.tar - rm package.tar - - cd urbackup-server-* + #ARMv8 source build + if (( $G_HW_ARCH == 3 )); then - ./configure - make -j $G_HW_CPU_CORES - make install + AGI_ERROR_HANDLED build-essential zlib1g-dev libcurl4-openssl-dev libcrypto++-dev sqlite3 - sed -i "/ExecStart=/c ExecStart=/usr/local/bin/urbackupsrv run --config /etc/default/urbackupsrv --no-consoletime" urbackup-server.service - cp urbackup-server.service /etc/systemd/system/urbackupsrv.service - cp defaults_server /etc/default/urbackupsrv - cp logrotate_urbackupsrv /etc/logrotate.d/urbackupsrv + wget "$INSTALL_URL_ADDRESS" -O package.tar + tar xzvf package.tar + rm package.tar - cd .. + cd urbackup-server-* - rm -R urbackup-server-* + ./configure + make -j $G_HW_CPU_CORES + make install - #Deb - else + sed -i "/ExecStart=/c ExecStart=/usr/local/bin/urbackupsrv run --config /etc/default/urbackupsrv --no-consoletime" urbackup-server.service + cp urbackup-server.service /etc/systemd/system/urbackupsrv.service + cp defaults_server /etc/default/urbackupsrv + cp logrotate_urbackupsrv /etc/logrotate.d/urbackupsrv - wget "$INSTALL_URL_ADDRESS" -O package.deb + cd .. - echo -e "urbackup-server urbackup/backuppath string $G_FP_DIETPI_USERDATA/urbackup" | debconf-set-selections - dpkg -i package.deb + rm -R urbackup-server-* - apt-get -f install -y + #Deb + else - rm package.deb + wget "$INSTALL_URL_ADDRESS" -O package.deb - fi + echo -e "urbackup-server urbackup/backuppath string $G_FP_DIETPI_USERDATA/urbackup" | debconf-set-selections + dpkg -i package.deb - else + apt-get -f install -y - Error_NoConnection_NoInstall + rm package.deb fi @@ -4594,22 +4420,13 @@ _EOF_ INSTALL_URL_ADDRESS="http://dietpi.com/downloads/binaries/rpi/opentyrian_armhf.zip" G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - AGI_ERROR_HANDLED ibsdl1.2debian libsdl-net1.2 --no-install-recommends - - #Download binaries - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip -d / - rm package.zip - chmod +x /usr/local/games/opentyrian/opentyrian - - else + AGI_ERROR_HANDLED ibsdl1.2debian libsdl-net1.2 --no-install-recommends - Error_NoConnection_NoInstall - - fi + #Download binaries + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip -d / + rm package.zip + chmod +x /usr/local/games/opentyrian/opentyrian fi @@ -4622,51 +4439,42 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/Fourdee/RPi_Cam_Web_Interface/archive/6.2.29.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - #Install pre-reqs - AGI_ERROR_HANDLED gpac motion - - #Get source/binaries and extract - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip - rm package.zip - - cd RPi_Cam* - - #Config /etc/motion - mkdir -p /etc/motion - cp etc/motion/motion.conf.1 /etc/motion/motion.conf + #Install pre-reqs + AGI_ERROR_HANDLED gpac motion - #Config /etc/raspimjpeg - cp etc/raspimjpeg/raspimjpeg.1 /etc/raspimjpeg + #Get source/binaries and extract + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip + rm package.zip - #Setup /var/www/dietpicam - mkdir -p /var/www/dietpicam/media - cp -R www/* /var/www/dietpicam/ - chmod +x /var/www/dietpicam/raspizip.sh - mknod /var/www/dietpicam/FIFO p - mknod /var/www/dietpicam/FIFO1 p + cd RPi_Cam* - #symlink cam preview and status - ln -sf /run/shm/mjpeg/cam.jpg /var/www/dietpicam/cam.jpg - ln -sf /run/shm/mjpeg/status_mjpeg.txt /var/www/dietpicam/status_mjpeg.txt + #Config /etc/motion + mkdir -p /etc/motion + cp etc/motion/motion.conf.1 /etc/motion/motion.conf - #Setup Raspimjpeg binary - cp bin/raspimjpeg /opt/vc/bin/raspimjpeg - chmod +x /opt/vc/bin/raspimjpeg - ln -s /opt/vc/bin/raspimjpeg /usr/bin/raspimjpeg + #Config /etc/raspimjpeg + cp etc/raspimjpeg/raspimjpeg.1 /etc/raspimjpeg - #Cleanup / remove extracted source - cd "$HOME" - rm -R "$HOME"/RPi_Cam* + #Setup /var/www/dietpicam + mkdir -p /var/www/dietpicam/media + cp -R www/* /var/www/dietpicam/ + chmod +x /var/www/dietpicam/raspizip.sh + mknod /var/www/dietpicam/FIFO p + mknod /var/www/dietpicam/FIFO1 p - else + #symlink cam preview and status + ln -sf /run/shm/mjpeg/cam.jpg /var/www/dietpicam/cam.jpg + ln -sf /run/shm/mjpeg/status_mjpeg.txt /var/www/dietpicam/status_mjpeg.txt - Error_NoConnection_NoInstall + #Setup Raspimjpeg binary + cp bin/raspimjpeg /opt/vc/bin/raspimjpeg + chmod +x /opt/vc/bin/raspimjpeg + ln -s /opt/vc/bin/raspimjpeg /usr/bin/raspimjpeg - fi + #Cleanup / remove extracted source + cd "$HOME" + rm -R "$HOME"/RPi_Cam* fi @@ -4691,21 +4499,14 @@ _EOF_ local grasshopper_directory='/var/www' INSTALL_URL_ADDRESS='http://sourceforge.net/projects/grasshopperwebapp/files/grasshopper_v5_application.zip/download' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - wget "$INSTALL_URL_ADDRESS" -O grasshopper.zip - unzip -o grasshopper.zip -d "$grasshopper_directory" - rm grasshopper.zip - - #Install - chmod +x "$grasshopper_directory"/install/install.sh - "$grasshopper_directory"/install/install.sh - - else - Error_NoConnection_NoInstall + wget "$INSTALL_URL_ADDRESS" -O grasshopper.zip + unzip -o grasshopper.zip -d "$grasshopper_directory" + rm grasshopper.zip - fi + #Install + chmod +x "$grasshopper_directory"/install/install.sh + "$grasshopper_directory"/install/install.sh fi @@ -4717,21 +4518,14 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/harmon25/raspcontrol/archive/master.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - wget "$INSTALL_URL_ADDRESS" -O package.zip + wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip - rm package.zip - mkdir -p /var/www/raspcontrol - mv raspcontrol-master/* /var/www/raspcontrol - rm -R raspcontrol-master - - else - - Error_NoConnection_NoInstall - - fi + unzip -o package.zip + rm package.zip + mkdir -p /var/www/raspcontrol + mv raspcontrol-master/* /var/www/raspcontrol + rm -R raspcontrol-master fi @@ -4743,20 +4537,13 @@ _EOF_ INSTALL_URL_ADDRESS='http://www.webmin.com/download/deb/webmin-current.deb' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - - G_AGF - - rm package.deb - else + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb - Error_NoConnection_NoInstall + G_AGF - fi + rm package.deb fi @@ -4768,24 +4555,17 @@ _EOF_ INSTALL_URL_ADDRESS='http://packages.openmediavault.org/public' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - echo -e "deb $INSTALL_URL_ADDRESS erasmus main" > /etc/apt/sources.list.d/openmediavault.list - G_AGUP - - AGI_ERROR_HANDLED openmediavault-keyring - debconf-set-selections <<< "openmediavault openmediavault/run-initsystem note" - debconf-set-selections <<< "postfix postfix/main_mailer_type select No configuration" - - G_AGUP - AGI_ERROR_HANDLED openmediavault postfix + echo -e "deb $INSTALL_URL_ADDRESS erasmus main" > /etc/apt/sources.list.d/openmediavault.list + G_AGUP - else + AGI_ERROR_HANDLED openmediavault-keyring - Error_NoConnection_NoInstall + debconf-set-selections <<< "openmediavault openmediavault/run-initsystem note" + debconf-set-selections <<< "postfix postfix/main_mailer_type select No configuration" - fi + G_AGUP + AGI_ERROR_HANDLED openmediavault postfix fi @@ -4797,20 +4577,13 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/ArturSierzant/OMPD/archive/master.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip -d /var/www/ - - rm -R /var/www/ompd &> /dev/null #Replace/upgrade existing installs - mv /var/www/OMPD* /var/www/ompd - rm package.zip - - else - Error_NoConnection_NoInstall + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip -d /var/www/ - fi + rm -R /var/www/ompd &> /dev/null #Replace/upgrade existing installs + mv /var/www/OMPD* /var/www/ompd + rm package.zip fi @@ -4832,21 +4605,14 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/afaqurk/linux-dash/archive/master.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.zip - - unzip -o package.zip - rm package.zip - mkdir -p /var/www/linuxdash - mv linux-dash-master/* /var/www/linuxdash - rm -R linux-dash-master - - else - Error_NoConnection_NoInstall + wget "$INSTALL_URL_ADDRESS" -O package.zip - fi + unzip -o package.zip + rm package.zip + mkdir -p /var/www/linuxdash + mv linux-dash-master/* /var/www/linuxdash + rm -R linux-dash-master fi @@ -4858,47 +4624,40 @@ _EOF_ INSTALL_URL_ADDRESS='http://install.pi-hole.net' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - # - Pre-reqs: https://github.com/Fourdee/DietPi/issues/1282#issuecomment-350490524 - AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-cgi "$PHP_APT_PACKAGE_NAME"-sqlite* - # - Check free available memory. Increase swapfile size to prevent gravity running out of mem. - if (( $(free -m | grep -m1 'Mem:' | awk '{print $4}') < 512 )); then + # - Pre-reqs: https://github.com/Fourdee/DietPi/issues/1282#issuecomment-350490524 + AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-cgi "$PHP_APT_PACKAGE_NAME"-sqlite* - if [ -f /etc/dphys-swapfile ] && - (( $(grep 'CONF_SWAPSIZE=' /etc/dphys-swapfile | sed 's/.*=//') < 512 )); then + # - Check free available memory. Increase swapfile size to prevent gravity running out of mem. + if (( $(free -m | grep -m1 'Mem:' | awk '{print $4}') < 512 )); then - G_DIETPI-NOTIFY 2 "Increasing swapfile size to 512MB before running gravity.sh, please wait...\n" - /DietPi/dietpi/func/dietpi-set_dphys-swapfile 512 + if [ -f /etc/dphys-swapfile ] && + (( $(grep 'CONF_SWAPSIZE=' /etc/dphys-swapfile | sed 's/.*=//') < 512 )); then - fi + G_DIETPI-NOTIFY 2 "Increasing swapfile size to 512MB before running gravity.sh, please wait...\n" + /DietPi/dietpi/func/dietpi-set_dphys-swapfile 512 fi - # NB: PiHole currently replaces the lighttpd.conf file entirly and restricts webserver use to PiHole only. We dont want a limited webserver dedicated to PiHole, so lets avoid it. - mv /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.bak &> /dev/null - - # - Install - wget "$INSTALL_URL_ADDRESS" -O install.sh - chmod +x install.sh - ./install.sh - local exit_code=$? - if (( $exit_code != 0 )); then - - G_DIETPI-NOTIFY 1 "Pi-Hole exited with code ($exit_code) and is not installed." - aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]=0 - - fi + fi - mv /etc/lighttpd/lighttpd.conf.bak /etc/lighttpd/lighttpd.conf &> /dev/null + # NB: PiHole currently replaces the lighttpd.conf file entirly and restricts webserver use to PiHole only. We dont want a limited webserver dedicated to PiHole, so lets avoid it. + mv /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.bak &> /dev/null - else + # - Install + wget "$INSTALL_URL_ADDRESS" -O install.sh + chmod +x install.sh + ./install.sh + local exit_code=$? + if (( $exit_code != 0 )); then - Error_NoConnection_NoInstall + G_DIETPI-NOTIFY 1 "Pi-Hole exited with code ($exit_code) and is not installed." + aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]=0 fi + mv /etc/lighttpd/lighttpd.conf.bak /etc/lighttpd/lighttpd.conf &> /dev/null + fi #SUBSONIC 5 @@ -4909,20 +4668,13 @@ _EOF_ INSTALL_URL_ADDRESS='https://sourceforge.net/projects/subsonic/files/subsonic/5.3/subsonic-5.3.deb/download' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - #AGI_ERROR_HANDLED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 - - #Install SubSonic 5.3 - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb - else - - Error_NoConnection_NoInstall + #AGI_ERROR_HANDLED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 - fi + #Install SubSonic 5.3 + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb fi @@ -4934,20 +4686,13 @@ _EOF_ INSTALL_URL_ADDRESS='https://sourceforge.net/projects/subsonic/files/subsonic/6.1.3/subsonic-6.1.3.deb/download' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - #AGI_ERROR_HANDLED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 - - #Install SubSonic 6.0 - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb - - else - Error_NoConnection_NoInstall + #AGI_ERROR_HANDLED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 - fi + #Install SubSonic 6.0 + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb fi @@ -4959,18 +4704,11 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/weaved/installer/raw/master/Raspbian%20deb/1.3-07/weavedconnectd_1.3-07v_armhf.deb' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - #Install WEAVED - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb - - else - - Error_NoConnection_NoInstall - fi + #Install WEAVED + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb fi @@ -5028,42 +4766,34 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - # - RPi - if (( $G_HW_MODEL < 10 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.tar - tar xfz package.tar - rm package.tar - - # - Odroid's / BPI - else - - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip package.zip - rm package.zip + # - RPi + if (( $G_HW_MODEL < 10 )); then - fi + wget "$INSTALL_URL_ADDRESS" -O package.tar + tar xfz package.tar + rm package.tar - if (( $G_HW_MODEL == 51 )); then + # - Odroid's / BPI + else - mv WiringBP* wiringPi + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip package.zip + rm package.zip - fi + fi - cd wiringPi* - chmod +x build - ./build - cd "$HOME" + if (( $G_HW_MODEL == 51 )); then - #rm -R /root/wiringPi* #Also Contains example code for users. + mv WiringBP* wiringPi - else + fi - Error_NoConnection_NoInstall + cd wiringPi* + chmod +x build + ./build + cd "$HOME" - fi + #rm -R /root/wiringPi* #Also Contains example code for users. fi @@ -5105,106 +4835,81 @@ _EOF_ INSTALL_URL_ADDRESS="http://repo.mosquitto.org/debian/mosquitto-$G_DISTRO_NAME.list" G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key - apt-key add mosquitto-repo.gpg.key - rm mosquitto-repo.gpg.key - - wget "$INSTALL_URL_ADDRESS" -O /etc/apt/sources.list.d/mosquitto-"$G_DISTRO_NAME".list - - # - ARM64 - if (( $G_HW_ARCH == 3 )); then - - echo -e "deb [arch=armhf] http://repo.mosquitto.org/debian $G_DISTRO_NAME main" > /etc/apt/sources.list.d/mosquitto-"$G_DISTRO_NAME".list - dpkg --add-architecture armhf - - fi - - #Pre-Req stretch - # - libssl1.0.0 no longer available: https://github.com/Fourdee/DietPi/issues/1299 - if (( $G_DISTRO >= 4 )); then - - INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/' - - # - ARMv6/7 - if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then - - INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_armhf.deb' - # - ARM64 - elif (( $G_HW_ARCH == 3 )); then + wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key + apt-key add mosquitto-repo.gpg.key + rm mosquitto-repo.gpg.key - INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_arm64.deb' + wget "$INSTALL_URL_ADDRESS" -O /etc/apt/sources.list.d/mosquitto-"$G_DISTRO_NAME".list - # - x86_64 - elif (( $G_HW_ARCH == 10 )); then - - INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_amd64.deb' - - fi + # - ARM64 + if (( $G_HW_ARCH == 3 )); then - G_CHECK_URL "$INSTALL_URL_ADDRESS" + echo -e "deb [arch=armhf] http://repo.mosquitto.org/debian $G_DISTRO_NAME main" > /etc/apt/sources.list.d/mosquitto-"$G_DISTRO_NAME".list + dpkg --add-architecture armhf - #Install - if (( $? == 0 )); then + fi - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb + #Pre-Req stretch + # - libssl1.0.0 no longer available: https://github.com/Fourdee/DietPi/issues/1299 + if (( $G_DISTRO >= 4 )); then - else + INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/' - Error_NoConnection_NoInstall + # - ARMv6/7 + if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then - fi + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_armhf.deb' - # - libwebsockets3 no longer available: https://github.com/Fourdee/DietPi/issues/1299 - INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/' + # - ARM64 + elif (( $G_HW_ARCH == 3 )); then - # - ARMv6/7 - if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_arm64.deb' - INSTALL_URL_ADDRESS+='libwebsockets3_1.2.2-1_armhf.deb' + # - x86_64 + elif (( $G_HW_ARCH == 10 )); then - # - ARM64 - elif (( $G_HW_ARCH == 3 )); then + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_amd64.deb' - INSTALL_URL_ADDRESS+='libwebsockets3_1.2.2-1_arm64.deb' + fi - # - x86_64 - elif (( $G_HW_ARCH == 10 )); then + G_CHECK_URL "$INSTALL_URL_ADDRESS" - INSTALL_URL_ADDRESS+='libwebsockets3_1.2.2-1_amd64.deb' + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb - fi + # - libwebsockets3 no longer available: https://github.com/Fourdee/DietPi/issues/1299 + INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/' - G_CHECK_URL "$INSTALL_URL_ADDRESS" + # - ARMv6/7 + if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then - #Install - if (( $? == 0 )); then + INSTALL_URL_ADDRESS+='libwebsockets3_1.2.2-1_armhf.deb' - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb + # - ARM64 + elif (( $G_HW_ARCH == 3 )); then - else + INSTALL_URL_ADDRESS+='libwebsockets3_1.2.2-1_arm64.deb' - Error_NoConnection_NoInstall + # - x86_64 + elif (( $G_HW_ARCH == 10 )); then - fi + INSTALL_URL_ADDRESS+='libwebsockets3_1.2.2-1_amd64.deb' fi - G_AGUP + G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED mosquitto + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb - else + fi - Error_NoConnection_NoInstall + G_AGUP - fi + AGI_ERROR_HANDLED mosquitto fi @@ -5218,23 +4923,15 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/blynkkk/blynk-server/releases' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - mkdir -p /etc/blynkserver - - INSTALL_URL_ADDRESS='https://github.com/blynkkk/blynk-server/releases/download/v0.29.2/server-0.29.2.jar' - wget "$INSTALL_URL_ADDRESS" -O /etc/blynkserver/server.jar - - # - Install Blynk JS Libary - AGI_ERROR_HANDLED python - npm install -g onoff - npm install -g blynk-library - - else + mkdir -p /etc/blynkserver - Error_NoConnection_NoInstall + INSTALL_URL_ADDRESS='https://github.com/blynkkk/blynk-server/releases/download/v0.29.2/server-0.29.2.jar' + wget "$INSTALL_URL_ADDRESS" -O /etc/blynkserver/server.jar - fi + # - Install Blynk JS Libary + AGI_ERROR_HANDLED python + npm install -g onoff + npm install -g blynk-library fi @@ -5270,39 +4967,27 @@ _EOF_ INSTALL_URL_ADDRESS="${apackages[$i]}" G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? != 0 )); then - - Error_NoConnection_NoInstall - - break - - fi done - # - install (Error_NoConnection_NoInstall() sets state to 0) - if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - - # - Prereqs - AGI_ERROR_HANDLED libasound2 - - # - Stretch, install additional packages - if (( $G_DISTRO >= 4 )); then + # - Prereqs + AGI_ERROR_HANDLED libasound2 - AGI_ERROR_HANDLED gcc-6-base libstdc++6 + # - Stretch, install additional packages + if (( $G_DISTRO >= 4 )); then - fi + AGI_ERROR_HANDLED gcc-6-base libstdc++6 - for ((i=0; i<${#apackages[@]}; i++)) - do + fi - wget "${apackages[$i]}" -O package.deb - dpkg -i package.deb - rm package.deb + for ((i=0; i<${#apackages[@]}; i++)) + do - done + wget "${apackages[$i]}" -O package.deb + dpkg -i package.deb + rm package.deb - fi + done unset apackages @@ -5329,35 +5014,28 @@ _EOF_ INSTALL_URL_ADDRESS='https://sourceforge.net/projects/webiopi/files/WebIOPi-0.7.1.tar.gz/download' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - #Python dev, pre-reqs - AGI_ERROR_HANDLED python-dev python-setuptools --no-install-recommends - #Install WEBIOPI - wget "$INSTALL_URL_ADDRESS" -O package.tar - tar xvzf package.tar - rm package.tar - - cd WebIOPi* - - #Automate Weaved prompt - sed -i '/read response/c\response="n"' setup.sh + #Python dev, pre-reqs + AGI_ERROR_HANDLED python-dev python-setuptools --no-install-recommends - #Run setup script - ./setup.sh - clear + #Install WEBIOPI + wget "$INSTALL_URL_ADDRESS" -O package.tar + tar xvzf package.tar + rm package.tar - cd .. + cd WebIOPi* - #Cleanup - rm -R WebIOPi* + #Automate Weaved prompt + sed -i '/read response/c\response="n"' setup.sh - else + #Run setup script + ./setup.sh + clear - Error_NoConnection_NoInstall + cd .. - fi + #Cleanup + rm -R WebIOPi* fi @@ -5387,40 +5065,31 @@ _EOF_ INSTALL_URL_ADDRESS='https://www.haproxy.org/download/1.8/src/haproxy-1.8.2.tar.gz' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - #Download HAPROXY - wget "$INSTALL_URL_ADDRESS" -O package.tar - tar -xvf package.tar - rm package.tar - - cd haproxy-* - - #Pre-reqs - AGI_ERROR_HANDLED libpcre3-dev libssl-dev zlib1g-dev - #Compile and install - make -j $G_HW_CPU_CORES TARGET=linux2628 CPU=generic USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 USE_LINUX_SPLICE=1 - make install - - mkdir /etc/haproxy + #Download HAPROXY + wget "$INSTALL_URL_ADDRESS" -O package.tar + tar -xvf package.tar + rm package.tar - #Exit directory - cd .. + cd haproxy-* - #Clean up - rm -R haproxy-* + #Pre-reqs + AGI_ERROR_HANDLED libpcre3-dev libssl-dev zlib1g-dev + #Compile and install + make -j $G_HW_CPU_CORES TARGET=linux2628 CPU=generic USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 USE_LINUX_SPLICE=1 + make install - #Install init script as service - cp /DietPi/dietpi/conf/haproxy_init /etc/init.d/haproxy - chmod +x /etc/init.d/haproxy - update-rc.d haproxy defaults + mkdir /etc/haproxy - else + #Exit directory + cd .. - Error_NoConnection_NoInstall + #Clean up + rm -R haproxy-* - fi + #Install init script as service + cp /DietPi/dietpi/conf/haproxy_init /etc/init.d/haproxy + chmod +x /etc/init.d/haproxy + update-rc.d haproxy defaults fi @@ -5433,48 +5102,39 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/logitechmediaserver_7.9.0_all.deb' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb - - #https://github.com/Fourdee/DietPi/issues/736 - G_AGF - - #Stop service - service logitechmediaserver stop + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb - #Stretch - # Compile pre-req CPAN modules??? - # if (( $G_DISTRO >= 4 )); then + #https://github.com/Fourdee/DietPi/issues/736 + G_AGF - # AGI_ERROR_HANDLED yasm git build-essential automake cpanminus nasm libxml-parser-perl libexpat1-dev libgif-dev zlib1g-dev libjpeg-dev libpng-dev + #Stop service + service logitechmediaserver stop + #Stretch + # Compile pre-req CPAN modules??? + # if (( $G_DISTRO >= 4 )); then - # + ARMv6 cpan - if (( $G_HW_ARCH == 1 )); then - - wget http://dietpi.com/downloads/binaries/all/logitechmediaserver_7.9.0_CPAN_5.20_armv6hf.tar.gz -O package.tar - tar xvzf package.tar -C / - rm package.tar + # AGI_ERROR_HANDLED yasm git build-essential automake cpanminus nasm libxml-parser-perl libexpat1-dev libgif-dev zlib1g-dev libjpeg-dev libpng-dev - # + ARM64 cpan - elif (( $G_HW_ARCH == 3 )); then - AGI_ERROR_HANDLED libxml-parser-perl - AGI_ERROR_HANDLED zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev # shared libs needed for Image::Scale@0.08 + # + ARMv6 cpan + if (( $G_HW_ARCH == 1 )); then - wget http://dietpi.com/downloads/binaries/all/DietPi-LMS7.9-CPAN_arm64.zip -O package.zip - unzip -o package.zip -d /usr/share/squeezeboxserver - rm package.zip + wget http://dietpi.com/downloads/binaries/all/logitechmediaserver_7.9.0_CPAN_5.20_armv6hf.tar.gz -O package.tar + tar xvzf package.tar -C / + rm package.tar - fi + # + ARM64 cpan + elif (( $G_HW_ARCH == 3 )); then - else + AGI_ERROR_HANDLED libxml-parser-perl + AGI_ERROR_HANDLED zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev # shared libs needed for Image::Scale@0.08 - Error_NoConnection_NoInstall + wget http://dietpi.com/downloads/binaries/all/DietPi-LMS7.9-CPAN_arm64.zip -O package.zip + unzip -o package.zip -d /usr/share/squeezeboxserver + rm package.zip fi @@ -5486,22 +5146,12 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS='https://wordpress.org/latest.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip -d /var/www/ - rm package.zip - - else - - Error_NoConnection_NoInstall - - fi + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip -d /var/www/ + rm package.zip fi @@ -5541,22 +5191,13 @@ _EOF_ # INSTALL_URL_ADDRESS='https://www.realvnc.com/download/binary/latest/debian/arm/' # G_CHECK_URL "$INSTALL_URL_ADDRESS" - ##Install - # if (( $? == 0 )); then - - # wget "$INSTALL_URL_ADDRESS" -O package.tar.gz - # tar xvf package.tar.gz - # rm package.tar.gz + # wget "$INSTALL_URL_ADDRESS" -O package.tar.gz + # tar xvf package.tar.gz + # rm package.tar.gz - # dpkg -i VNC*.deb + # dpkg -i VNC*.deb - # rm VNC*.deb - - # else - - # Error_NoConnection_NoInstall - - # fi + # rm VNC*.deb # - Available in Raspbian apt AGI_ERROR_HANDLED realvnc-vnc-server @@ -5585,19 +5226,10 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/phpsysinfo/phpsysinfo/archive/master.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip -d /var/www/ - rm package.zip - mv /var/www/phpsysinfo-* /var/www/phpsysinfo - - else - - Error_NoConnection_NoInstall - - fi + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip -d /var/www/ + rm package.zip + mv /var/www/phpsysinfo-* /var/www/phpsysinfo fi @@ -5611,20 +5243,11 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/Single_File_PHP_Gallery_4.6.1.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip -d /var/www/gallery + rm package.zip - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip -d /var/www/gallery - rm package.zip - - else - - Error_NoConnection_NoInstall - - fi - - fi + fi #AMPACHE INSTALLING_INDEX=40 @@ -5632,35 +5255,25 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS='https://github.com/ampache/ampache/archive/master.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip - rm package.zip - mv ampache-* /var/www/ampache - - #composer install required for 3.8.2 - php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php - php composer-setup.php - php -r "unlink('composer-setup.php');" - - mv composer.phar /usr/local/bin/composer + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip + rm package.zip + mv ampache-* /var/www/ampache - cd /var/www/ampache - composer install --prefer-source --no-interaction - cd "$HOME" - - else + #composer install required for 3.8.2 + php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php + php composer-setup.php + php -r "unlink('composer-setup.php');" - Error_NoConnection_NoInstall + mv composer.phar /usr/local/bin/composer - fi + cd /var/www/ampache + composer install --prefer-source --no-interaction + cd "$HOME" fi @@ -5680,49 +5293,43 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS='https://install.pivpn.io' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then + AGI_ERROR_HANDLED lsb-release - AGI_ERROR_HANDLED lsb-release + # - Requires underpriv user: https://github.com/Fourdee/DietPi/issues/570#issuecomment-255588307 + useradd pivpn + mkdir -p /home/pivpn - # - Requires underpriv user: https://github.com/Fourdee/DietPi/issues/570#issuecomment-255588307 - useradd pivpn - mkdir -p /home/pivpn + while true + do - while true - do + wget "$INSTALL_URL_ADDRESS" -O pivpn_install.sh + chmod +x pivpn_install.sh - wget "$INSTALL_URL_ADDRESS" -O pivpn_install.sh - chmod +x pivpn_install.sh + # - Disable reboot + sed -i '/shutdown[[:space:]]/d' pivpn_install.sh - # - Disable reboot - sed -i '/shutdown[[:space:]]/d' pivpn_install.sh + ./pivpn_install.sh + if (( $? != 0 )); then - ./pivpn_install.sh + whiptail --title "PiVPN failed/aborted" --yesno "The PiVPN installer was not successful and/or canceled prior to its completion.\n\nWould you like DietPi to run the PiVPN installer again?" --backtitle "$WHIP_BACKTITLE" --defaultno 12 70 if (( $? != 0 )); then - whiptail --title "PiVPN failed/aborted" --yesno "The PiVPN installer was not successful and/or canceled prior to its completion.\n\nWould you like DietPi to run the PiVPN installer again?" --backtitle "$WHIP_BACKTITLE" --defaultno 12 70 - if (( $? != 0 )); then - - aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]=0 - break - - fi - - else - - rm pivpn_install.sh + aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]=0 break fi - done + else - fi + rm pivpn_install.sh + break + + fi + + done fi @@ -5753,23 +5360,15 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/certbot/certbot/archive/master.zip' G_CHECK_URL "$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 + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip -d /root + rm package.zip + mv certbot* /etc/certbot_scripts - fi + # - Install packages + cd /etc/certbot_scripts + ./certbot-auto -n --os-packages-only + cd ~/ fi @@ -5792,120 +5391,102 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - # - Prereqs - AGI_ERROR_HANDLED hostapd isc-dhcp-server iptables libnl-3-200 - - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip - rm package.zip - - # - Check for RTL8188C* device, use the patched binary I compiled: https://github.com/pritambaral/hostapd-rtl871xdrv#why - if (( $(lsusb | grep -ci -m1 'RTL8188C') || - $G_HW_MODEL == 70 )); then #Force RTL for allo provided WiFi dongle - - WIFIHOTSPOT_RTL8188C_DEVICE=1 - - fi - - #Which binary to install - local filename_hostapd='' - local filename_hostapd_cli='' - - # - armv6 - if (( $G_HW_ARCH == 1 )); then + # - Prereqs + AGI_ERROR_HANDLED hostapd isc-dhcp-server iptables libnl-3-200 - filename_hostapd='hostapd-nl80211-armv6' - filename_hostapd_cli='hostapd_cli-armv6' + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip + rm package.zip - if (( $WIFIHOTSPOT_RTL8188C_DEVICE )); then + # - Check for RTL8188C* device, use the patched binary I compiled: https://github.com/pritambaral/hostapd-rtl871xdrv#why + if (( $(lsusb | grep -ci -m1 'RTL8188C') || + $G_HW_MODEL == 70 )); then #Force RTL for allo provided WiFi dongle - filename_hostapd='hostapd-rtl8188c-armv6' + WIFIHOTSPOT_RTL8188C_DEVICE=1 - fi + fi - # - armv7+ - elif (( $G_HW_ARCH == 2 )); then + #Which binary to install + local filename_hostapd='' + local filename_hostapd_cli='' - filename_hostapd='hostapd-nl80211-armv7' - filename_hostapd_cli='hostapd_cli-armv7' + # - armv6 + if (( $G_HW_ARCH == 1 )); then - if (( $WIFIHOTSPOT_RTL8188C_DEVICE )); then + filename_hostapd='hostapd-nl80211-armv6' + filename_hostapd_cli='hostapd_cli-armv6' - filename_hostapd='hostapd-rtl8188c-armv7' + if (( $WIFIHOTSPOT_RTL8188C_DEVICE )); then - fi + filename_hostapd='hostapd-rtl8188c-armv6' - # - arm64 - elif (( $G_HW_ARCH == 3 )); then + fi - filename_hostapd='hostapd-nl80211-arm64' - filename_hostapd_cli='hostapd_cli-arm64' + # - armv7+ + elif (( $G_HW_ARCH == 2 )); then - if (( $WIFIHOTSPOT_RTL8188C_DEVICE )); then + filename_hostapd='hostapd-nl80211-armv7' + filename_hostapd_cli='hostapd_cli-armv7' - filename_hostapd='hostapd-rtl8188c-arm64' + if (( $WIFIHOTSPOT_RTL8188C_DEVICE )); then - fi + filename_hostapd='hostapd-rtl8188c-armv7' fi - mv "$filename_hostapd" /usr/sbin/hostapd - mv "$filename_hostapd_cli" /usr/sbin/hostapd_cli - - chmod +x /usr/sbin/hostapd - chmod +x /usr/sbin/hostapd_cli + # - arm64 + elif (( $G_HW_ARCH == 3 )); then - rm hostapd-* + filename_hostapd='hostapd-nl80211-arm64' + filename_hostapd_cli='hostapd_cli-arm64' - #Enable wifi modules - /DietPi/dietpi/func/dietpi-set_hardware wifimodules enable + if (( $WIFIHOTSPOT_RTL8188C_DEVICE )); then - # - Stretch, libssl1.0.0 no longer available: https://github.com/Fourdee/DietPi/issues/1299 - # Possibly only needed for RPi, however, no harm in installing, cover all bases. - if (( $G_DISTRO >= 4 )); then + filename_hostapd='hostapd-rtl8188c-arm64' - INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/' + fi - # - ARMv6/7 - if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then + fi - INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_armhf.deb' + mv "$filename_hostapd" /usr/sbin/hostapd + mv "$filename_hostapd_cli" /usr/sbin/hostapd_cli - # - ARM64 - elif (( $G_HW_ARCH == 3 )); then + chmod +x /usr/sbin/hostapd + chmod +x /usr/sbin/hostapd_cli - INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_arm64.deb' + rm hostapd-* - # - x86_64 - elif (( $G_HW_ARCH == 10 )); then + #Enable wifi modules + /DietPi/dietpi/func/dietpi-set_hardware wifimodules enable - INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_amd64.deb' + # - Stretch, libssl1.0.0 no longer available: https://github.com/Fourdee/DietPi/issues/1299 + # Possibly only needed for RPi, however, no harm in installing, cover all bases. + if (( $G_DISTRO >= 4 )); then - fi + INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/' - G_CHECK_URL "$INSTALL_URL_ADDRESS" + # - ARMv6/7 + if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then - #Install - if (( $? == 0 )); then + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_armhf.deb' - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb + # - ARM64 + elif (( $G_HW_ARCH == 3 )); then - else + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_arm64.deb' - Error_NoConnection_NoInstall + # - x86_64 + elif (( $G_HW_ARCH == 10 )); then - fi + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_amd64.deb' fi - else + G_CHECK_URL "$INSTALL_URL_ADDRESS" - Error_NoConnection_NoInstall + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb fi @@ -5955,61 +5536,43 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - # - Prereqs - AGI_ERROR_HANDLED openssl libsoxr0 libavahi-client3 libtool libconfig9 libpopt0 libdaemon0 --no-install-recommends - - # This occured on C2: shairport-sync : Depends: libpopt-dev but it is not installed - #AGI_ERROR_HANDLED libpopt-dev - - wget "$INSTALL_URL_ADDRESS" -O package.7z - 7z x -y package.7z -o/ - rm package.7z - - # - Stretch, libssl1.0.0 no longer available - if (( $G_DISTRO >= 4 )); then - - INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/' - - # - ARMv6/7 - if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then - - INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_armhf.deb' - - # - ARM64 - elif (( $G_HW_ARCH == 3 )); then + # - Prereqs + AGI_ERROR_HANDLED openssl libsoxr0 libavahi-client3 libtool libconfig9 libpopt0 libdaemon0 --no-install-recommends - INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_arm64.deb' + # This occured on C2: shairport-sync : Depends: libpopt-dev but it is not installed + #AGI_ERROR_HANDLED libpopt-dev - # - x86_64 - elif (( $G_HW_ARCH == 10 )); then + wget "$INSTALL_URL_ADDRESS" -O package.7z + 7z x -y package.7z -o/ + rm package.7z - INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_amd64.deb' + # - Stretch, libssl1.0.0 no longer available + if (( $G_DISTRO >= 4 )); then - fi + INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/' - G_CHECK_URL "$INSTALL_URL_ADDRESS" + # - ARMv6/7 + if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then - #Install - if (( $? == 0 )); then + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_armhf.deb' - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb + # - ARM64 + elif (( $G_HW_ARCH == 3 )); then - else + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_arm64.deb' - Error_NoConnection_NoInstall + # - x86_64 + elif (( $G_HW_ARCH == 10 )); then - fi + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_amd64.deb' fi - else + G_CHECK_URL "$INSTALL_URL_ADDRESS" - Error_NoConnection_NoInstall + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb fi @@ -6025,20 +5588,11 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/conf/BruteFIR/' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - # - Prereqs - AGI_ERROR_HANDLED brutefir - - wget -r -nH --cut-dirs=2 --no-parent --reject="index.htm*" -e robots=off "$INSTALL_URL_ADDRESS" - mv BruteFIR /etc/ - - else - - Error_NoConnection_NoInstall + # - Prereqs + AGI_ERROR_HANDLED brutefir - fi + wget -r -nH --cut-dirs=2 --no-parent --reject="index.htm*" -e robots=off "$INSTALL_URL_ADDRESS" + mv BruteFIR /etc/ fi @@ -6052,19 +5606,10 @@ _EOF_ INSTALL_URL_ADDRESS='https://download.pydio.com/pub/core/archives/pydio-core-8.0.2.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip -d /var/www - mv /var/www/pydio-core-* /var/www/pydio - rm package.zip - - else - - Error_NoConnection_NoInstall - - fi + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip -d /var/www + mv /var/www/pydio-core-* /var/www/pydio + rm package.zip fi @@ -6077,51 +5622,41 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/squeezelite-1.8_all.7z' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - # - Prereqs - AGI_ERROR_HANDLED squeezelite - - # - Overwrite binary with latest version: - wget "$INSTALL_URL_ADDRESS" -O package.7z - 7z x -y package.7z -o/usr/bin - rm package.7z - - rm /usr/bin/squeezelite - - local target_binary='' + # - Prereqs + AGI_ERROR_HANDLED squeezelite - if (( $G_HW_ARCH == 1 )); then + # - Overwrite binary with latest version: + wget "$INSTALL_URL_ADDRESS" -O package.7z + 7z x -y package.7z -o/usr/bin + rm package.7z - target_binary='squeezelite_armv6' + rm /usr/bin/squeezelite - # - ARMv7 - elif (( $G_HW_ARCH == 2 )); then + local target_binary='' - target_binary='squeezelite_armv7' - - # - ARM64 - elif (( $G_HW_ARCH == 3 )); then + if (( $G_HW_ARCH == 1 )); then - target_binary='squeezelite_arm64' + target_binary='squeezelite_armv6' - # - x86_64 - elif (( $G_HW_ARCH == 10 )); then + # - ARMv7 + elif (( $G_HW_ARCH == 2 )); then - target_binary='squeezelite_amd64' + target_binary='squeezelite_armv7' - fi + # - ARM64 + elif (( $G_HW_ARCH == 3 )); then - ln -sf /usr/bin/"$target_binary" /usr/bin/squeezelite - chmod +x /usr/bin/squeezelite + target_binary='squeezelite_arm64' - else + # - x86_64 + elif (( $G_HW_ARCH == 10 )); then - Error_NoConnection_NoInstall + target_binary='squeezelite_amd64' fi + ln -sf /usr/bin/"$target_binary" /usr/bin/squeezelite + chmod +x /usr/bin/squeezelite fi @@ -6135,28 +5670,19 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/Fourdee/emonhub/archive/emon-pi.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - # - Prereqs - AGI_ERROR_HANDLED minicom python-serial python-configobj --no-install-recommends - pip install paho-mqtt pydispatcher - - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip - rm package.zip - - # - move everything to /etc/emonhub - rm -R /etc/emonhub - mkdir -p /etc/emonhub - mv emonhub-*/* /etc/emonhub/ - rm -R emonhub-* - - else + # - Prereqs + AGI_ERROR_HANDLED minicom python-serial python-configobj --no-install-recommends + pip install paho-mqtt pydispatcher - Error_NoConnection_NoInstall + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip + rm package.zip - fi + # - move everything to /etc/emonhub + rm -R /etc/emonhub + mkdir -p /etc/emonhub + mv emonhub-*/* /etc/emonhub/ + rm -R emonhub-* fi @@ -6170,21 +5696,12 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/XavierBerger/RPi-Monitor-deb/raw/master/packages/rpimonitor_2.12-r0_all.deb' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb - - # - Prereqs - apt-get -f -y install - - else - - Error_NoConnection_NoInstall + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb - fi + # - Prereqs + apt-get -f -y install fi @@ -6221,21 +5738,12 @@ _EOF_ #check, is online G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - # - For compression - AGI_ERROR_HANDLED --no-install-recommends zlib1g-dev - - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb - - else - - Error_NoConnection_NoInstall + # - For compression + AGI_ERROR_HANDLED --no-install-recommends zlib1g-dev - fi + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb fi @@ -6249,19 +5757,10 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/fruux/Baikal/archive/master.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip -d /var/www - rm package.zip - mv /var/www/Baikal* /var/www/baikal - - else - - Error_NoConnection_NoInstall - - fi + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip -d /var/www + rm package.zip + mv /var/www/Baikal* /var/www/baikal fi @@ -6310,58 +5809,50 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - echo -e "deb $INSTALL_URL_ADDRESS /" > /etc/apt/sources.list.d/emby-server.list - wget "$INSTALL_URL_ADDRESS"Release.key - apt-key add - < Release.key - rm Release.key - G_AGUP - - #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 (( $G_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 + echo -e "deb $INSTALL_URL_ADDRESS /" > /etc/apt/sources.list.d/emby-server.list + wget "$INSTALL_URL_ADDRESS"Release.key + apt-key add - < Release.key + rm Release.key + G_AGUP - #ARMv8 - elif (( $G_HW_ARCH == 3 )); then + #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 (( $G_HW_ARCH == 2 )); 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/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/libw/libwebp/libwebp5_0.4.1-1.2+b2_arm64.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 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://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 - 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 + #ARMv8 + elif (( $G_HW_ARCH == 3 )); then - fi + 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 - AGI_ERROR_HANDLED emby-server embymagick + 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 - else + 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 - Error_NoConnection_NoInstall + 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_ERROR_HANDLED emby-server embymagick + fi #PLEXMEDIASERVER @@ -6386,43 +5877,34 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - #x86_64 - if (( $G_HW_ARCH == 10 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb + #x86_64 + if (( $G_HW_ARCH == 10 )); then - #ARM - else + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb - echo -e "deb [arch=armhf] $INSTALL_URL_ADDRESS $G_DISTRO_NAME main" > /etc/apt/sources.list.d/plex.list - wget -O - "$INSTALL_URL_ADDRESS"dev2day-pms.gpg.key | apt-key add - - G_AGUP + #ARM + else - #ARMv8: Install 32bit binaries - if (( $G_HW_ARCH == 3 )); then + echo -e "deb [arch=armhf] $INSTALL_URL_ADDRESS $G_DISTRO_NAME main" > /etc/apt/sources.list.d/plex.list + wget -O - "$INSTALL_URL_ADDRESS"dev2day-pms.gpg.key | apt-key add - + G_AGUP - dpkg --add-architecture armhf - G_AGUP - AGI_ERROR_HANDLED binutils:armhf plexmediaserver-installer:armhf + #ARMv8: Install 32bit binaries + if (( $G_HW_ARCH == 3 )); then - #ARM32 - else + dpkg --add-architecture armhf + G_AGUP + AGI_ERROR_HANDLED binutils:armhf plexmediaserver-installer:armhf - AGI_ERROR_HANDLED plexmediaserver-installer + #ARM32 + else - fi + AGI_ERROR_HANDLED plexmediaserver-installer fi - else - - Error_NoConnection_NoInstall - fi fi @@ -6446,23 +5928,14 @@ _EOF_ fi G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then + wget "$INSTALL_URL_ADDRESS" -O package.tar + mkdir -p /etc/cubrite + tar xzvf package.tar -C /etc/cubrite + rm package.tar - wget "$INSTALL_URL_ADDRESS" -O package.tar - mkdir -p /etc/cubrite - tar xzvf package.tar -C /etc/cubrite - rm package.tar - - # - Move everything into base directory (cuberite) - mv /etc/cubrite/Server/* /etc/cubrite/ - rm -R /etc/cuberite/Server - - else - - Error_NoConnection_NoInstall - - fi + # - Move everything into base directory (cuberite) + mv /etc/cubrite/Server/* /etc/cubrite/ + rm -R /etc/cuberite/Server fi @@ -6477,29 +5950,20 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/hexparrot/mineos-node.git' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - #prereqs - AGI_ERROR_HANDLED python python3 supervisor rdiff-backup screen rsync - - mkdir -p "$G_FP_DIETPI_USERDATA"/mineos - cd "$G_FP_DIETPI_USERDATA"/mineos - git clone https://github.com/hexparrot/mineos-node.git minecraft + #prereqs + AGI_ERROR_HANDLED python python3 supervisor rdiff-backup screen rsync - cd minecraft - git config core.filemode false - chmod +x service.js mineos_console.js generate-sslcert.sh webui.js + mkdir -p "$G_FP_DIETPI_USERDATA"/mineos + cd "$G_FP_DIETPI_USERDATA"/mineos + git clone https://github.com/hexparrot/mineos-node.git minecraft - npm install + cd minecraft + git config core.filemode false + chmod +x service.js mineos_console.js generate-sslcert.sh webui.js - cd "$HOME" + npm install - else - - Error_NoConnection_NoInstall - - fi + cd "$HOME" fi @@ -6529,20 +5993,11 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip - rm package.zip - - mv gogs* /etc/gogs + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip + rm package.zip - else - - Error_NoConnection_NoInstall - - fi + mv gogs* /etc/gogs fi @@ -6565,36 +6020,27 @@ _EOF_ INSTALL_URL_ADDRESS='http://bintray.com/novik65/generic/download_file?file_path=ruTorrent-3.7.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - AGI_ERROR_HANDLED rtorrent screen #mediainfo - - #Raspbian unrar free - if (( $G_HW_MODEL < 10 )); then - - AGI_ERROR_HANDLED unrar-free #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 - - else + AGI_ERROR_HANDLED rtorrent screen #mediainfo - AGI_ERROR_HANDLED unrar #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 + #Raspbian unrar free + if (( $G_HW_MODEL < 10 )); then - fi + AGI_ERROR_HANDLED unrar-free #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 + else - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip - rm package.zip + AGI_ERROR_HANDLED unrar #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 - mkdir -p /var/www/rutorrent - mv ruTorrent-*/* /var/www/rutorrent/ - rm -R ruTorrent-* + fi - else - Error_NoConnection_NoInstall + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip + rm package.zip - fi + mkdir -p /var/www/rutorrent + mv ruTorrent-*/* /var/www/rutorrent/ + rm -R ruTorrent-* fi @@ -6636,23 +6082,16 @@ _EOF_ fi G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - # - prereqs - AGI_ERROR_HANDLED libc-ares2 - - wget "$INSTALL_URL_ADDRESS" -O package.7z - 7z x -y package.7z - rm package.7z - mv aria2_* /usr/local/bin/aria2c - chmod +x /usr/local/bin/aria2c + # - prereqs + AGI_ERROR_HANDLED libc-ares2 - else - - Error_NoConnection_NoInstall + wget "$INSTALL_URL_ADDRESS" -O package.7z + 7z x -y package.7z + rm package.7z - fi + mv aria2_* /usr/local/bin/aria2c + chmod +x /usr/local/bin/aria2c fi @@ -6660,20 +6099,13 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/ziahamza/webui-aria2/archive/master.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip - rm package.zip + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip + rm package.zip - cp -R webui-aria2* /var/www/aria2 - rm -R webui-aria2* - - else - - Error_NoConnection_NoInstall - - fi + cp -R webui-aria2* /var/www/aria2 + rm -R webui-aria2* fi @@ -6686,36 +6118,27 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/SickRage/SickRage/archive/master.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - AGI_ERROR_HANDLED python libxslt1.1 libxml2 python-openssl python-xmltodict - - #Raspbian unrar free - if (( $G_HW_MODEL < 10 )); then - - AGI_ERROR_HANDLED unrar-free - - else + AGI_ERROR_HANDLED python libxslt1.1 libxml2 python-openssl python-xmltodict - AGI_ERROR_HANDLED unrar + #Raspbian unrar free + if (( $G_HW_MODEL < 10 )); then - fi + AGI_ERROR_HANDLED unrar-free - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip - rm package.zip + else - mkdir -p /etc/sickrage + AGI_ERROR_HANDLED unrar - mv SickRage-*/* /etc/sickrage/ - rm -R SickRage-* + fi - else + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip + rm package.zip - Error_NoConnection_NoInstall + mkdir -p /etc/sickrage - fi + mv SickRage-*/* /etc/sickrage/ + rm -R SickRage-* fi @@ -6747,21 +6170,14 @@ _EOF_ #G_CHECK_URL "$INSTALL_URL_ADDRESS" G_CHECK_URL https://github.com/syncthing/syncthing - if (( $? == 0 )); then - wget "$INSTALL_URL_ADDRESS" -O package.tar - tar xzvf package.tar - rm package.tar + wget "$INSTALL_URL_ADDRESS" -O package.tar + tar xzvf package.tar + rm package.tar - mkdir -p /etc/syncthing - cp -R syncthing-*/syncthing /etc/syncthing/ - rm -R syncthing-* - - else - - Error_NoConnection_NoInstall - - fi + mkdir -p /etc/syncthing + cp -R syncthing-*/syncthing /etc/syncthing/ + rm -R syncthing-* fi @@ -6784,18 +6200,10 @@ _EOF_ fi G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb - - else - - Error_NoConnection_NoInstall - - fi + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb # - armv6+ if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then @@ -6810,20 +6218,13 @@ _EOF_ fi G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - AGI_ERROR_HANDLED libpng12-0 libfontconfig1 - - wget "$INSTALL_URL_ADDRESS" -O package.tar - mkdir /etc/tonido - tar xvf package.tar -C /etc/tonido - rm package.tar - - else - Error_NoConnection_NoInstall + AGI_ERROR_HANDLED libpng12-0 libfontconfig1 - fi + wget "$INSTALL_URL_ADDRESS" -O package.tar + mkdir /etc/tonido + tar xvf package.tar -C /etc/tonido + rm package.tar fi @@ -6862,50 +6263,42 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - - # - Odroid's, 'apt-get install -f' removes chromium package, rather than install required deps... - if (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )); then - - AGI_ERROR_HANDLED libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7 - - else + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb - G_AGF + # - Odroid's, 'apt-get install -f' removes chromium package, rather than install required deps... + if (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )); then - fi + AGI_ERROR_HANDLED libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7 - wget http://dietpi.com/downloads/binaries/all/chromium-l10n_52.0.2743.116-1-deb8u1.1_all.deb -O package.deb - dpkg -i package.deb + else - # armv6+ - if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then + G_AGF - wget http://dietpi.com/downloads/binaries/all/chromedriver_52.0.2743.116-1-deb8u1.1_armhf.deb -O package.deb - dpkg -i package.deb + fi - # arm64 - elif (( $G_HW_ARCH == 3 )); then + wget http://dietpi.com/downloads/binaries/all/chromium-l10n_52.0.2743.116-1-deb8u1.1_all.deb -O package.deb + dpkg -i package.deb - wget http://dietpi.com/downloads/binaries/all/chromedriver_52.0.2743.116-1-deb8u1.1_arm64.deb -O package.deb - dpkg -i package.deb + # armv6+ + if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then - fi + wget http://dietpi.com/downloads/binaries/all/chromedriver_52.0.2743.116-1-deb8u1.1_armhf.deb -O package.deb + dpkg -i package.deb - rm package.deb + # arm64 + elif (( $G_HW_ARCH == 3 )); then - # - Prevent Debian repo from replacing our chromium packages: https://github.com/Fourdee/DietPi/issues/658 - apt-mark hold chromium chromedriver + wget http://dietpi.com/downloads/binaries/all/chromedriver_52.0.2743.116-1-deb8u1.1_arm64.deb -O package.deb + dpkg -i package.deb - else + fi - Error_NoConnection_NoInstall + rm package.deb - fi + # - Prevent Debian repo from replacing our chromium packages: https://github.com/Fourdee/DietPi/issues/658 + apt-mark hold chromium chromedriver fi @@ -6924,24 +6317,17 @@ _EOF_ #url/redireect always fails wget spider test... G_CHECK_URL "http://github.com/Motion-Project/motion" - if (( $? == 0 )); then - # - Prereqs - AGI_ERROR_HANDLED v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev libx264-142 libavcodec56 libavformat56 libmysqlclient18 libswscale3 libpq5 - - # - Motion - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb - - # - Motioneye - pip install motioneye - - else + # - Prereqs + AGI_ERROR_HANDLED v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev libx264-142 libavcodec56 libavformat56 libmysqlclient18 libswscale3 libpq5 - Error_NoConnection_NoInstall + # - Motion + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb - fi + # - Motioneye + pip install motioneye #Stretch else @@ -6970,21 +6356,14 @@ _EOF_ #url/redirect fails wget spider test... G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - INSTALL_URL_ADDRESS+='/repo' - - echo -e "deb $INSTALL_URL_ADDRESS cloudprint-jessie main" > /etc/apt/sources.list.d/cloudprint.list - wget -q -O - https://davesteele.github.io/key-366150CE.pub.txt | apt-key add - - G_AGUP + INSTALL_URL_ADDRESS+='/repo' - AGI_ERROR_HANDLED cloudprint-service - - else - - Error_NoConnection_NoInstall + echo -e "deb $INSTALL_URL_ADDRESS cloudprint-jessie main" > /etc/apt/sources.list.d/cloudprint.list + wget -q -O - https://davesteele.github.io/key-366150CE.pub.txt | apt-key add - + G_AGUP - fi + AGI_ERROR_HANDLED cloudprint-service else @@ -7021,19 +6400,10 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - mkdir -p /etc/vhusbd - - wget "$INSTALL_URL_ADDRESS" -O /etc/vhusbd/vhusbd - chmod +x /etc/vhusbd/vhusbd - - else - - Error_NoConnection_NoInstall + mkdir -p /etc/vhusbd - fi + wget "$INSTALL_URL_ADDRESS" -O /etc/vhusbd/vhusbd + chmod +x /etc/vhusbd/vhusbd fi @@ -7048,36 +6418,29 @@ _EOF_ INSTALL_URL_ADDRESS="https://github.com/sabnzbd/sabnzbd/archive/$version.zip" G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - #prereqs - AGI_ERROR_HANDLED par2 python-dev libffi-dev libssl-dev + #prereqs + AGI_ERROR_HANDLED par2 python-dev libffi-dev libssl-dev - if (( $G_HW_MODEL < 10 )); then - - AGI_ERROR_HANDLED unrar-free - - else - - AGI_ERROR_HANDLED unrar + if (( $G_HW_MODEL < 10 )); then - fi + AGI_ERROR_HANDLED unrar-free - wget "$INSTALL_URL_ADDRESS" -O package.zip - mkdir -p /etc/sabnzbd - unzip -o package.zip -d /etc/sabnzbd - rm package.zip + else - mv /etc/sabnzbd/sabnzbd-"$version"/* /etc/sabnzbd/ - rm -R /etc/sabnzbd/sabnzbd-"$version" + AGI_ERROR_HANDLED unrar - pip install cheetah cryptography sabyenc + fi - else + wget "$INSTALL_URL_ADDRESS" -O package.zip + mkdir -p /etc/sabnzbd + unzip -o package.zip -d /etc/sabnzbd + rm package.zip - Error_NoConnection_NoInstall + mv /etc/sabnzbd/sabnzbd-"$version"/* /etc/sabnzbd/ + rm -R /etc/sabnzbd/sabnzbd-"$version" - fi + pip install cheetah cryptography sabyenc fi @@ -7085,23 +6448,16 @@ _EOF_ INSTALLING_INDEX=141 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - Banner_Installing - - INSTALL_URL_ADDRESS='https://github.com/Fornoth/spotify-connect-web/releases' #full path fails wget spider test... - G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - INSTALL_URL_ADDRESS+='/download/0.0.3-alpha/spotify-connect-web_0.0.3-alpha.tar.gz' - - wget "$INSTALL_URL_ADDRESS" -O package.tar - tar zxvf package.tar -C "$G_FP_DIETPI_USERDATA"/ - rm package.tar + Banner_Installing - else + INSTALL_URL_ADDRESS='https://github.com/Fornoth/spotify-connect-web/releases' #full path fails wget spider test... + G_CHECK_URL "$INSTALL_URL_ADDRESS" - Error_NoConnection_NoInstall + INSTALL_URL_ADDRESS+='/download/0.0.3-alpha/spotify-connect-web_0.0.3-alpha.tar.gz' - fi + wget "$INSTALL_URL_ADDRESS" -O package.tar + tar zxvf package.tar -C "$G_FP_DIETPI_USERDATA"/ + rm package.tar fi @@ -7113,24 +6469,17 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/CouchPotato/CouchPotatoServer/archive/master.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - AGI_ERROR_HANDLED libffi-dev libssl-dev python-lxml python3-lxml - - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip - rm package.zip - rm -R /etc/couchpotato &> /dev/null - mv CouchPotato* /etc/couchpotato + AGI_ERROR_HANDLED libffi-dev libssl-dev python-lxml python3-lxml - pip install --upgrade pyopenssl - - else + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip + rm package.zip - Error_NoConnection_NoInstall + rm -R /etc/couchpotato &> /dev/null + mv CouchPotato* /etc/couchpotato - fi + pip install --upgrade pyopenssl fi @@ -7144,33 +6493,24 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - AGI_ERROR_HANDLED python - - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip - rm package.zip - mv koel-* /var/www/koel - - php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php - php composer-setup.php - php -r "unlink('composer-setup.php');" - - mv composer.phar /usr/local/bin/composer + AGI_ERROR_HANDLED python - cd /var/www/koel - npm install yarn -g --unsafe-perm - composer install - npm install - cd "$HOME" + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip + rm package.zip + mv koel-* /var/www/koel - else + php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php + php composer-setup.php + php -r "unlink('composer-setup.php');" - Error_NoConnection_NoInstall + mv composer.phar /usr/local/bin/composer - fi + cd /var/www/koel + npm install yarn -g --unsafe-perm + composer install + npm install + cd "$HOME" fi @@ -7207,20 +6547,11 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - AGI_ERROR_HANDLED mono-devel mediainfo sqlite3 libmono-cil-dev - - wget $( curl -s "$INSTALL_URL_ADDRESS" | grep linux.tar.gz | grep browser_download_url | head -1 | cut -d \" -f 4 ) -O package.tar - tar -xf package.tar -C /opt/ - rm package.tar - - else - - Error_NoConnection_NoInstall + AGI_ERROR_HANDLED mono-devel mediainfo sqlite3 libmono-cil-dev - fi + wget $( curl -s "$INSTALL_URL_ADDRESS" | grep linux.tar.gz | grep browser_download_url | head -1 | cut -d \" -f 4 ) -O package.tar + tar -xf package.tar -C /opt/ + rm package.tar fi @@ -7234,20 +6565,11 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - AGI_ERROR_HANDLED python - - git clone --depth=1 "$INSTALL_URL_ADDRESS" - - mv plexpy /opt/ - - else + AGI_ERROR_HANDLED python - Error_NoConnection_NoInstall + git clone --depth=1 "$INSTALL_URL_ADDRESS" - fi + mv plexpy /opt/ fi @@ -7261,26 +6583,17 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - AGI_ERROR_HANDLED mono-devel - - wget $( curl -s "$INSTALL_URL_ADDRESS" | grep Jackett.Binaries.Mono.tar.gz | grep browser_download_url | head -1 | cut -d \" -f 4 ) -O package.tar - tar -xvf package.tar - rm package.tar - - mkdir /opt/jackett + AGI_ERROR_HANDLED mono-devel - mv Jackett/* /opt/jackett + wget $( curl -s "$INSTALL_URL_ADDRESS" | grep Jackett.Binaries.Mono.tar.gz | grep browser_download_url | head -1 | cut -d \" -f 4 ) -O package.tar + tar -xvf package.tar + rm package.tar - rm -R Jackett - - else + mkdir /opt/jackett - Error_NoConnection_NoInstall + mv Jackett/* /opt/jackett - fi + rm -R Jackett fi @@ -7294,21 +6607,12 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - wget -q -O - http://dist.jriver.com/mediacenter@jriver.com.gpg.key | apt-key add - - wget "$INSTALL_URL_ADDRESS" -O /etc/apt/sources.list.d/mediacenter22.list - - G_AGUP - - AGI_ERROR_HANDLED mediacenter22 - - else + wget -q -O - http://dist.jriver.com/mediacenter@jriver.com.gpg.key | apt-key add - + wget "$INSTALL_URL_ADDRESS" -O /etc/apt/sources.list.d/mediacenter22.list - Error_NoConnection_NoInstall + G_AGUP - fi + AGI_ERROR_HANDLED mediacenter22 fi @@ -7322,21 +6626,12 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - INSTALL_URL_ADDRESS+='/download/nzbget-latest-bin-linux.run' - - wget "$INSTALL_URL_ADDRESS" -O package.run - mkdir -p "$G_FP_DIETPI_USERDATA"/nzbget - sh package.run --destdir "$G_FP_DIETPI_USERDATA"/nzbget - rm package.run - - else - - Error_NoConnection_NoInstall + INSTALL_URL_ADDRESS+='/download/nzbget-latest-bin-linux.run' - fi + wget "$INSTALL_URL_ADDRESS" -O package.run + mkdir -p "$G_FP_DIETPI_USERDATA"/nzbget + sh package.run --destdir "$G_FP_DIETPI_USERDATA"/nzbget + rm package.run fi @@ -7349,26 +6644,21 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/Hellowlol/HTPC-Manager.git' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - #Install Python and PIP - AGI_ERROR_HANDLED python python-pip python-imaging python-dev + #Install Python and PIP + AGI_ERROR_HANDLED python python-pip python-imaging python-dev - cd "$HOME" - git clone --depth=1 "$INSTALL_URL_ADDRESS" + cd "$HOME" + git clone --depth=1 "$INSTALL_URL_ADDRESS" - # - Move HTPC Manager to a 'better' location - mkdir -p "$G_FP_DIETPI_USERDATA"/htpc-manager - mv "$HOME"/HTPC-Manager/* "$G_FP_DIETPI_USERDATA"/htpc-manager/ - rm -R "$HOME"/HTPC-Manager + # - Move HTPC Manager to a 'better' location + mkdir -p "$G_FP_DIETPI_USERDATA"/htpc-manager + mv "$HOME"/HTPC-Manager/* "$G_FP_DIETPI_USERDATA"/htpc-manager/ + rm -R "$HOME"/HTPC-Manager - # - psutil for system stats - pip install psutil + # - psutil for system stats + pip install psutil - else - Error_NoConnection_NoInstall - fi fi #OctoPrint @@ -7380,22 +6670,14 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/foosel/OctoPrint.git' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - AGI_ERROR_HANDLED python python-dev - - git clone "$INSTALL_URL_ADDRESS" - mv OctoPrint* "$G_FP_DIETPI_USERDATA"/octoprint - - cd "$G_FP_DIETPI_USERDATA"/octoprint - python setup.py install - cd "$HOME" + AGI_ERROR_HANDLED python python-dev - else - - Error_NoConnection_NoInstall + git clone "$INSTALL_URL_ADDRESS" + mv OctoPrint* "$G_FP_DIETPI_USERDATA"/octoprint - fi + cd "$G_FP_DIETPI_USERDATA"/octoprint + python setup.py install + cd "$HOME" fi @@ -7408,21 +6690,13 @@ _EOF_ INSTALL_URL_ADDRESS='http://download.roonlabs.com/builds/RoonServer_linuxx64.tar.bz2' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - AGI_ERROR_HANDLED libav-tools cifs-utils - - wget "$INSTALL_URL_ADDRESS" -O package.tar - tar xvf package.tar - rm package.tar - - mv RoonServer "$G_FP_DIETPI_USERDATA"/roonserver - - else + AGI_ERROR_HANDLED libav-tools cifs-utils - Error_NoConnection_NoInstall + wget "$INSTALL_URL_ADDRESS" -O package.tar + tar xvf package.tar + rm package.tar - fi + mv RoonServer "$G_FP_DIETPI_USERDATA"/roonserver fi @@ -7459,31 +6733,17 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - #Download executable - wget -O /usr/local/bin/minio $INSTALL_URL_ADDRESS - chmod +x /usr/local/bin/minio - MinioContinue=1 - else - Error_NoConnection_NoInstall - MinioContinue=0 - fi + #Download executable + wget -O /usr/local/bin/minio $INSTALL_URL_ADDRESS + chmod +x /usr/local/bin/minio # Check, Download, Install startup script INSTALL_URL_ADDRESS='https://github.com/minio/minio-service/raw/master/linux-systemd/minio.service' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - # Download the systemd service script - wget -O /etc/systemd/system/minio.service $INSTALL_URL_ADDRESS - MinioContinue=1 - else - Error_NoConnection_NoInstall - MinioContinue=0 - fi - - if ((MinioContinue == 1)); then + # Download the systemd service script + wget -O /etc/systemd/system/minio.service $INSTALL_URL_ADDRESS # Create no login, with home directory, with group of same name, user to run Minio in adduser --system --group minio-user @@ -7491,9 +6751,6 @@ _EOF_ # Create default data directory & grant minio-user proper access mkdir "$G_FP_DIETPI_USERDATA"/minio-data - - fi - fi #Docker @@ -7506,15 +6763,11 @@ _EOF_ G_CHECK_URL "$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 - else - Error_NoConnection_NoInstall - fi + # Offical Docker recommended install command + wget -O DockerInstall.sh "$INSTALL_URL_ADDRESS" + chmod +x DockerInstall.sh + ./DockerInstall.sh + #rm DockerInstall.sh fi @@ -7536,17 +6789,11 @@ _EOF_ G_CHECK_URL "$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 + 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 fi @@ -7560,62 +6807,48 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - mkdir /usr/local/bin/nukkit - wget -O /usr/local/bin/nukkit/nukkit.jar "$INSTALL_URL_ADDRESS" + 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.3.2/gitea-1.3.2-' - - #armv6 - if (( $G_HW_ARCH == 1 )); then - - INSTALL_URL_ADDRESS+='linux-arm-6' - - #armv7 - elif (( $G_HW_ARCH == 2 )); then + Banner_Installing - INSTALL_URL_ADDRESS+='linux-arm-7' + INSTALL_URL_ADDRESS='https://dl.gitea.io/gitea/1.3.2/gitea-1.3.2-' - #armv8 - elif (( $G_HW_ARCH == 3 )); then + #armv6 + if (( $G_HW_ARCH == 1 )); then - INSTALL_URL_ADDRESS+='linux-arm64' + INSTALL_URL_ADDRESS+='linux-arm-6' - #x86_64 - elif (( $G_HW_ARCH == 10 )); then + #armv7 + elif (( $G_HW_ARCH == 2 )); then - INSTALL_URL_ADDRESS+='linux-amd64' + INSTALL_URL_ADDRESS+='linux-arm-7' - fi + #armv8 + elif (( $G_HW_ARCH == 3 )); then - G_CHECK_URL "$INSTALL_URL_ADDRESS" + INSTALL_URL_ADDRESS+='linux-arm64' - #Install - if (( $? == 0 )); then + #x86_64 + elif (( $G_HW_ARCH == 10 )); then - # - Data storage / user data - mkdir -p "$G_FP_DIETPI_USERDATA"/gitea/gitea-repositories + INSTALL_URL_ADDRESS+='linux-amd64' - wget "$INSTALL_URL_ADDRESS" -O "$G_FP_DIETPI_USERDATA"/gitea/gitea - chmod +x "$G_FP_DIETPI_USERDATA"/gitea/gitea + fi - else + G_CHECK_URL "$INSTALL_URL_ADDRESS" - Error_NoConnection_NoInstall + # - Data storage / user data + mkdir -p "$G_FP_DIETPI_USERDATA"/gitea/gitea-repositories - fi + wget "$INSTALL_URL_ADDRESS" -O "$G_FP_DIETPI_USERDATA"/gitea/gitea + chmod +x "$G_FP_DIETPI_USERDATA"/gitea/gitea fi @@ -7628,17 +6861,10 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/allo_web_interface_v4.7z' G_CHECK_URL "$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 + wget "$INSTALL_URL_ADDRESS" -O package.7z + 7z x -y package.7z -o/var/www/ + rm package.7z fi @@ -7668,19 +6894,12 @@ _EOF_ fi G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - AGI_ERROR_HANDLED 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 + AGI_ERROR_HANDLED libupnp6 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-alsa - fi + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb fi @@ -7702,19 +6921,12 @@ _EOF_ INSTALL_URL_ADDRESS='https://dtcooper.github.io/raspotify/key.asc' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - 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 - G_AGUP - - AGI_ERROR_HANDLED raspotify - - else - Error_NoConnection_NoInstall + 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 + G_AGUP - fi + AGI_ERROR_HANDLED raspotify fi @@ -7726,85 +6938,78 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/moode/rel-stretch-r40b9.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - cd "$HOME" - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip + cd "$HOME" + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip - #Pre-Reqs ----------------------------------------------------------------------- - # Core packages - AGI_ERROR_HANDLED rpi-update mpc memcached $PHP_APT_PACKAGE_NAME-memcache \ + #Pre-Reqs ----------------------------------------------------------------------- + # Core packages + AGI_ERROR_HANDLED 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_ERROR_HANDLED dnsmasq hostapd + # WiFi Hotspot + AGI_ERROR_HANDLED dnsmasq hostapd - # BT - AGI_ERROR_HANDLED bluez bluez-firmware \ + # BT + AGI_ERROR_HANDLED 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 (( $G_HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )); then - AGI_ERROR_HANDLED pi-bluetooth + AGI_ERROR_HANDLED pi-bluetooth - fi + fi - #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 + #Disable Shell in box -------------------------------------------------------------------- + systemctl stop shellinabox + systemctl disable shellinabox - 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 ------------------------------------------------------------------ - # Installed via DietPi pre-built binaries. + #HostAPD/BT ------------------------------------------------------------------------------- + systemctl disable hostapd + systemctl disable dnsmasq - else + 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 - Error_NoConnection_NoInstall + mkdir -p /var/run/bluealsa - fi + #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 ------------------------------------------------------------------ + # Installed via DietPi pre-built binaries. fi @@ -7816,42 +7021,35 @@ libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc INSTALL_URL_ADDRESS='https://github.com/google/aiyprojects-raspbian.git' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - git clone -b voicekit "$INSTALL_URL_ADDRESS" "$G_FP_DIETPI_USERDATA"/voice-recognizer-raspi - cd "$G_FP_DIETPI_USERDATA"/voice-recognizer-raspi - pip3 install --upgrade pip virtualenv - virtualenv --system-site-packages -p python3 env - env/bin/pip install -r requirements.txt + git clone -b voicekit "$INSTALL_URL_ADDRESS" "$G_FP_DIETPI_USERDATA"/voice-recognizer-raspi + cd "$G_FP_DIETPI_USERDATA"/voice-recognizer-raspi - #??? ARMv7 only - if (( $G_HW_ARCH == 2 )); then + pip3 install --upgrade pip virtualenv + virtualenv --system-site-packages -p python3 env + env/bin/pip install -r requirements.txt - env/bin/pip install google-assistant-library==0.0.3 - - fi - - # - Services - sed -i "s#/home/pi#$G_FP_DIETPI_USERDATA#g" systemd/voice-recognizer.service - sed -i "/^User=/c\User=dietpi" systemd/voice-recognizer.service + #??? ARMv7 only + if (( $G_HW_ARCH == 2 )); then - cp systemd/voice-recognizer.service /etc/systemd/system/ - cp systemd/alsa-init.service /etc/systemd/system/ - #cp systemd/ntpdate.service /etc/systemd/system/ + env/bin/pip install google-assistant-library==0.0.3 - source env/bin/activate + fi - # - Enable default app for service start - cp src/assistant_library_with_button_demo.py src/main.py + # - Services + sed -i "s#/home/pi#$G_FP_DIETPI_USERDATA#g" systemd/voice-recognizer.service + sed -i "/^User=/c\User=dietpi" systemd/voice-recognizer.service - cd "$HOME" + cp systemd/voice-recognizer.service /etc/systemd/system/ + cp systemd/alsa-init.service /etc/systemd/system/ + #cp systemd/ntpdate.service /etc/systemd/system/ - else + source env/bin/activate - Error_NoConnection_NoInstall + # - Enable default app for service start + cp src/assistant_library_with_button_demo.py src/main.py - fi + cd "$HOME" fi @@ -7950,18 +7148,15 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/libump_1-1_arm64.deb' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb - wget http://dietpi.com/downloads/binaries/all/xf86-video-fbturbo_1-1_arm64.deb -O package.deb - dpkg -i package.deb - rm package.deb + wget http://dietpi.com/downloads/binaries/all/xf86-video-fbturbo_1-1_arm64.deb -O package.deb + dpkg -i package.deb + rm package.deb - cat << _EOF_ > /etc/X11/xorg.conf + cat << _EOF_ > /etc/X11/xorg.conf Section "Device" Identifier "Allwinner A10/A13 FBDEV" Driver "fbturbo" @@ -7970,12 +7165,6 @@ Section "Device" EndSection _EOF_ - else - - Error_NoConnection_NoInstall - - fi - #Asus TB # elif (( $G_HW_MODEL == 100 )); then @@ -8275,19 +7464,12 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/rpi/ffmpeg_rpi.7z' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - wget "$INSTALL_URL_ADDRESS" -O package.7z - 7z x -y package.7z -offmpeg_rpi - dpkg -i ffmpeg_rpi/*.deb - rm -R ffmpeg_rpi - rm package.7z - - else - - Error_NoConnection_NoInstall - fi + wget "$INSTALL_URL_ADDRESS" -O package.7z + 7z x -y package.7z -offmpeg_rpi + dpkg -i ffmpeg_rpi/*.deb + rm -R ffmpeg_rpi + rm package.7z #Everything else else @@ -8337,22 +7519,12 @@ _EOF_ INSTALL_URL_ADDRESS='http://raw.githubusercontent.com/taaem/nodejs-linux-installer/master/node-install.sh' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #Install - if (( $? == 0 )); then - - # - Preqs - wget "$INSTALL_URL_ADDRESS" -O node_install.sh - chmod +x node_install.sh - ./node_install.sh - - rm node_install.sh - + # - Preqs + wget "$INSTALL_URL_ADDRESS" -O node_install.sh + chmod +x node_install.sh + ./node_install.sh - else - - Error_NoConnection_NoInstall - - fi + rm node_install.sh fi @@ -8364,22 +7536,14 @@ _EOF_ INSTALL_URL_ADDRESS='https://bootstrap.pypa.io/get-pip.py' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - # - Preqs - AGI_ERROR_HANDLED python python-dev - - wget "$INSTALL_URL_ADDRESS" -O install.py - python ./install.py - rm install.py - - AGI_ERROR_HANDLED python-pip python3-pip + # - Preqs + AGI_ERROR_HANDLED python python-dev - else - - Error_NoConnection_NoInstall + wget "$INSTALL_URL_ADDRESS" -O install.py + python ./install.py + rm install.py - fi + AGI_ERROR_HANDLED python-pip python3-pip fi @@ -8392,22 +7556,14 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/rpi/sdl2_rpi.7z' G_CHECK_URL "$INSTALL_URL_ADDRESS" - if (( $? == 0 )); then - - #AGI_ERROR_HANDLED libxss1 #if using SDL2+rpi5 - - wget "$INSTALL_URL_ADDRESS" -O package.7z - 7z x -y package.7z -osdl2_rpi - rm package.7z - - dpkg -i sdl2_rpi/no_opengl_x11/*.deb - rm -R sdl2_rpi - - else + #AGI_ERROR_HANDLED libxss1 #if using SDL2+rpi5 - Error_NoConnection_NoInstall + wget "$INSTALL_URL_ADDRESS" -O package.7z + 7z x -y package.7z -osdl2_rpi + rm package.7z - fi + dpkg -i sdl2_rpi/no_opengl_x11/*.deb + rm -R sdl2_rpi fi @@ -15210,15 +14366,7 @@ _EOF_ } - Error_NoConnection_NoInstall(){ - - #Abort install - aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]=0 - - export G_ERROR_HANDLER_ONERROR_USERMSG="Unable to Install ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}\n\n$INSTALL_URL_ADDRESS is offline and/or unreachable." - G_ERROR_HANDLER - - } +# export G_ERROR_HANDLER_ONERROR_USERMSG="Unable to Install ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}\n\n$INSTALL_URL_ADDRESS is offline and/or unreachable." #///////////////////////////////////////////////////////////////////////////////////// # Whip menus From fc4b457f8209e643611af1f4e9d1602b69ea5a23 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 2 Jan 2018 12:22:36 +0000 Subject: [PATCH 185/390] v6.0 + Fix for incorrectly showing update available. --- dietpi/dietpi-banner | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dietpi/dietpi-banner b/dietpi/dietpi-banner index be00ab54c0..34400f763b 100644 --- a/dietpi/dietpi-banner +++ b/dietpi/dietpi-banner @@ -66,7 +66,7 @@ #Top section additional Text. Update available / MOTD etc #///////////////////////////////////////////////////////////////////////////////////// TEXT_TOP='' - UPDATE_AVAILABLE=0 + UPDATE_AVAILABLE_SUBVERSION='' #NULL=noupdate, -1 = image required, other value=latest version #///////////////////////////////////////////////////////////////////////////////////// # Banner Print @@ -76,9 +76,9 @@ #Update Available if [ -f /DietPi/dietpi/.update_available ]; then - UPDATE_AVAILABLE=$(cat /DietPi/dietpi/.update_available) + UPDATE_AVAILABLE_SUBVERSION=$(cat /DietPi/dietpi/.update_available) - if [ "$UPDATE_AVAILABLE" = '-1' ]; then + if [ "$UPDATE_AVAILABLE_SUBVERSION" = '-1' ]; then TEXT_TOP="\e[90m|\e[0m \e[91m\e[33;49;1mImage available\e[0m" @@ -132,15 +132,15 @@ echo -e "\e[1m dietpi-software\e[0m = Select optimized software for installation." #Update available? - if [ -n "$UPDATE_AVAILABLE" ]; then + if [ -n "$UPDATE_AVAILABLE_SUBVERSION" ]; then - if [ "$UPDATE_AVAILABLE" = '-1' ]; then + if [ "$UPDATE_AVAILABLE_SUBVERSION" = '-1' ]; then echo -e "\n\e[91m An updated DietPi image is available, please goto:\e[0m\n http://dietpi.com/download\n" else - echo -e "\e[1m dietpi-update\e[0m = \e[91mRun now to update DietPi (from v$DIETPI_VERSION to v$UPDATE_AVAILABLE).\e[0m" + echo -e "\e[1m dietpi-update\e[0m = \e[91mRun now to update DietPi (from v$DIETPI_VERSION to v$UPDATE_AVAILABLE_SUBVERSION).\e[0m" fi From 2d98da39aca70a4057431b8f2672142e496e69b1 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 2 Jan 2018 12:40:12 +0000 Subject: [PATCH 186/390] v6.0 Rewrite, wasnt happy with previous commit. --- dietpi/dietpi-banner | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/dietpi/dietpi-banner b/dietpi/dietpi-banner index 34400f763b..011963f2b0 100644 --- a/dietpi/dietpi-banner +++ b/dietpi/dietpi-banner @@ -43,6 +43,21 @@ } + UPDATE_AVAILABLE=0 + UPDATE_AVAILABLE_VERSION='' #-1 = image required, other value=latest version + + OBTAIN_UPDATE_AVAILABLE(){ + + #Update Available + if [ -f /DietPi/dietpi/.update_available ]; then + + UPDATE_AVAILABLE=1 + UPDATE_AVAILABLE_VERSION=$(cat /DietPi/dietpi/.update_available) + + fi + + } + Hardware_Model_Print(){ echo -e " \e[39;49;1mv$DIETPI_VERSION\e[0m \e[90m| $G_HW_MODEL_DESCRIPTION\e[0m\n \e[38;5;154m───────────────────────────────────────\e[0m" @@ -66,7 +81,6 @@ #Top section additional Text. Update available / MOTD etc #///////////////////////////////////////////////////////////////////////////////////// TEXT_TOP='' - UPDATE_AVAILABLE_SUBVERSION='' #NULL=noupdate, -1 = image required, other value=latest version #///////////////////////////////////////////////////////////////////////////////////// # Banner Print @@ -74,11 +88,9 @@ Banner_TopText_Extras(){ #Update Available - if [ -f /DietPi/dietpi/.update_available ]; then - - UPDATE_AVAILABLE_SUBVERSION=$(cat /DietPi/dietpi/.update_available) + if (( $UPDATE_AVAILABLE )); then - if [ "$UPDATE_AVAILABLE_SUBVERSION" = '-1' ]; then + if [ "$UPDATE_AVAILABLE_VERSION" = '-1' ]; then TEXT_TOP="\e[90m|\e[0m \e[91m\e[33;49;1mImage available\e[0m" @@ -132,15 +144,15 @@ echo -e "\e[1m dietpi-software\e[0m = Select optimized software for installation." #Update available? - if [ -n "$UPDATE_AVAILABLE_SUBVERSION" ]; then + if (( $UPDATE_AVAILABLE )); then - if [ "$UPDATE_AVAILABLE_SUBVERSION" = '-1' ]; then + if [ "$UPDATE_AVAILABLE_VERSION" = '-1' ]; then echo -e "\n\e[91m An updated DietPi image is available, please goto:\e[0m\n http://dietpi.com/download\n" else - echo -e "\e[1m dietpi-update\e[0m = \e[91mRun now to update DietPi (from v$DIETPI_VERSION to v$UPDATE_AVAILABLE_SUBVERSION).\e[0m" + echo -e "\e[1m dietpi-update\e[0m = \e[91mRun now to update DietPi (from v$DIETPI_VERSION to v$UPDATE_AVAILABLE_VERSION).\e[0m" fi @@ -157,11 +169,13 @@ #///////////////////////////////////////////////////////////////////////////////////// if (( $INPUT == 0 )); then + OBTAIN_UPDATE_AVAILABLE Banner_TopText_Extras Banner_Dietpi elif (( $INPUT == 1 )); then + OBTAIN_UPDATE_AVAILABLE Banner_TopText_Extras Banner_Dietpi Credits_Print From 3c44962ee0c1d171caa1bfe2f32d5304f9b44902 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 2 Jan 2018 12:40:51 +0000 Subject: [PATCH 187/390] v6.0 Minor --- dietpi/dietpi-banner | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-banner b/dietpi/dietpi-banner index 011963f2b0..ed1f92162f 100644 --- a/dietpi/dietpi-banner +++ b/dietpi/dietpi-banner @@ -46,7 +46,7 @@ UPDATE_AVAILABLE=0 UPDATE_AVAILABLE_VERSION='' #-1 = image required, other value=latest version - OBTAIN_UPDATE_AVAILABLE(){ + Obtain_Update_Available(){ #Update Available if [ -f /DietPi/dietpi/.update_available ]; then @@ -169,13 +169,13 @@ #///////////////////////////////////////////////////////////////////////////////////// if (( $INPUT == 0 )); then - OBTAIN_UPDATE_AVAILABLE + Obtain_Update_Available Banner_TopText_Extras Banner_Dietpi elif (( $INPUT == 1 )); then - OBTAIN_UPDATE_AVAILABLE + Obtain_Update_Available Banner_TopText_Extras Banner_Dietpi Credits_Print From 7ecb656476a2e807722e105b2e04250c749eaf3c Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 2 Jan 2018 12:43:34 +0000 Subject: [PATCH 188/390] v6.0 minor fix --- dietpi/dietpi-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index fd43668967..d0af60a1bc 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -267,7 +267,7 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// #---------------------------------------------------------------- #Inform user - G_DIETPI-NOTIFY 3 'DietPi-Update Checking for DietPi updates' + G_DIETPI-NOTIFY 3 DietPi-Update 'Checking for DietPi updates' #---------------------------------------------------------------- #Create temp directory used in dietpi-update rm -R "$FILEPATH_TEMP" &> /dev/null From db7d0cf9b5040ed0dd3db43c43bec629000f9357 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 2 Jan 2018 13:03:49 +0000 Subject: [PATCH 189/390] v6.0 + Always generate default /etc/dphys-swapfile: https://github.com/Fourdee/DietPi/pull/1362#issuecomment-354759731 --- dietpi/func/dietpi-set_dphys-swapfile | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-set_dphys-swapfile b/dietpi/func/dietpi-set_dphys-swapfile index b1df7f6444..a537b9a967 100644 --- a/dietpi/func/dietpi-set_dphys-swapfile +++ b/dietpi/func/dietpi-set_dphys-swapfile @@ -27,8 +27,14 @@ export G_PROGRAM_NAME='DietPi-dphys-swapfile' #Import DietPi-Globals --------------------------------------------------------------- - SWAP_SIZE_CURRENT=$(cat /etc/dphys-swapfile | grep -m1 '^CONF_SWAPSIZE=' | sed 's/.*=//') - SWAP_LOCATION_CURRENT=$(cat /etc/dphys-swapfile | grep -m1 '^CONF_SWAPFILE=' | sed 's/.*=//') + SWAP_SIZE_CURRENT=0 + SWAP_LOCATION_CURRENT='/var/swap' + if [ -f /etc/dphys-swapfile ]; then + + SWAP_SIZE_CURRENT=$(cat /etc/dphys-swapfile | grep -m1 '^CONF_SWAPSIZE=' | sed 's/.*=//') + SWAP_LOCATION_CURRENT=$(cat /etc/dphys-swapfile | grep -m1 '^CONF_SWAPFILE=' | sed 's/.*=//') + + fi SWAP_SIZE_TARGET=$SWAP_SIZE_CURRENT if [[ $1 =~ ^-?[0-9]+$ ]]; then @@ -42,12 +48,24 @@ SERVICE_MODE="" + Generate_Default_Conf(){ + + cat << _EOF_ > /etc/dphys-swapfile +CONF_SWAPSIZE=0 +CONF_SWAPFILE=/var/swap +_EOF_ + + } + Delete_Swapfile(){ + G_DIETPI-NOTIFY 2 "Deleting existing swapfile ($SWAP_LOCATION_CURRENT)\n" rm "$SWAP_LOCATION_CURRENT" &> /dev/null + } Update_Conf(){ + sed -i "/CONF_SWAPSIZE/c\CONF_SWAPSIZE=$SWAP_SIZE_TARGET" /etc/dphys-swapfile sed -i "/CONF_SWAPFILE/c\CONF_SWAPFILE=$SWAP_LOCATION_TARGET" /etc/dphys-swapfile @@ -62,6 +80,8 @@ SWAP_SIZE_TARGET=0 SERVICE_MODE="disable" + + Generate_Default_Conf dphys-swapfile swapoff Delete_Swapfile @@ -76,6 +96,7 @@ G_DIETPI-NOTIFY 2 "Location = $SWAP_LOCATION_TARGET" SERVICE_MODE="enable" + Generate_Default_Conf dphys-swapfile swapoff Delete_Swapfile From 9ccbf344e1e28b23154c71e696c5559afe161cfb Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 2 Jan 2018 13:05:13 +0000 Subject: [PATCH 190/390] Minor Default conf now generated inside script: https://github.com/Fourdee/DietPi/commit/db7d0cf9b5040ed0dd3db43c43bec629000f9357 --- PREP_SYSTEM_FOR_DIETPI.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 6067d11a66..3da3d68180 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1096,9 +1096,6 @@ _EOF_ G_DIETPI-NOTIFY 2 'Disabling swapfile' /DietPi/dietpi/func/dietpi-set_dphys-swapfile 0 /var/swap - # - Reset config - echo -e "CONF_SWAPSIZE=0" > /etc/dphys-swapfile - echo -e "CONF_SWAPFILE=/var/swap" >> /etc/dphys-swapfile # BBB disable swapfile gen if (( $G_HW_MODEL == 71 )); then From 2dd372f7fd5601766285f3b539ecc7699f3818e2 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 2 Jan 2018 15:11:45 +0100 Subject: [PATCH 191/390] v6.0 + Fix locales setting --- PREP_SYSTEM_FOR_DIETPI.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 3da3d68180..792b565a75 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -963,11 +963,10 @@ _EOF_ G_DIETPI-NOTIFY 2 "Configuring regional settings (Locale):" - sed -i 's/^\([^#]\)/#\1/g' /etc/locale.gen - sed -i '/en_GB.UTF-8 UTF-8/c\en_GB.UTF-8 UTF-8' /etc/locale.gen + echo 'en_GB.UTF-8 UTF-8' > /etc/locale.gen + G_RUN_CMD dpkg-reconfigure -f noninteractive locales # en_GB.UTF-8 as only installed locale #locale-gen - update-locale - G_RUN_CMD dpkg-reconfigure -f noninteractive locales # en_GB.UTF8 as only installed locale + #update-locale # - Pump default locale into sys env: https://github.com/Fourdee/DietPi/issues/825 export G_ERROR_HANDLER_COMMAND='/etc/environment' From 599f270d8824729a050a52b0a1391ebcb9ee8032 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 2 Jan 2018 15:33:23 +0100 Subject: [PATCH 192/390] v6.0 + Fix rm -R ./.. error. --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 792b565a75..2f47256271 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1167,7 +1167,7 @@ _EOF_ G_DIETPI-NOTIFY 2 'Resetting DietPi generated globals/files' - rm /DietPi/dietpi/.* + rm /DietPi/dietpi/.??* G_DIETPI-NOTIFY 2 'Storing current image version /etc/.dietpi_image_version' From 5d5a3dc7f4e0ea6b93da2e4c8c48cc0a35259ecf Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 2 Jan 2018 15:13:21 +0000 Subject: [PATCH 193/390] v6.0 + Globals. Do not overwrite existing values, if set: https://github.com/Fourdee/DietPi/pull/1362#issuecomment-354771875 https://github.com/Fourdee/DietPi/issues/1311 --- dietpi/func/dietpi-globals | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index a6850c97c8..61656a8a6b 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -84,7 +84,7 @@ echo -ne "\033[K $bracket_string_l$status_text_error$bracket_string_r" } - + Print_Info(){ echo -ne "\033[K $bracket_string_l$status_text_info$bracket_string_r" @@ -514,11 +514,11 @@ $print_logfile_info #----------------------------------------------------------------------------------- # Hardware Details #----------------------------------------------------------------------------------- - G_HW_MODEL=0 - G_HW_MODEL_DESCRIPTION='NULL' - G_HW_ARCH=0 - G_HW_CPU_CORES=1 - G_HW_CPUID=0 + G_HW_MODEL=${G_HW_MODEL:-0} + G_HW_MODEL_DESCRIPTION=${G_HW_MODEL_DESCRIPTION:-NULL} + G_HW_ARCH=${G_HW_ARCH:-0} + G_HW_CPU_CORES=${G_HW_CPU_CORES:-1} + G_HW_CPUID=${G_HW_CPUID:-0} # If already init, use existing value. G_DISTRO=${G_DISTRO:-0} From f14c2d3cb460d5a48ca359d2a7bc0e391fe54452 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 2 Jan 2018 20:04:36 +0100 Subject: [PATCH 194/390] v6.0 + Adding Nextcloud Lighttpd configuration to solve OPcache admin panel warning. --- dietpi/conf/lighttpd.nextcloud.conf | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 dietpi/conf/lighttpd.nextcloud.conf diff --git a/dietpi/conf/lighttpd.nextcloud.conf b/dietpi/conf/lighttpd.nextcloud.conf new file mode 100644 index 0000000000..99e9f17b4c --- /dev/null +++ b/dietpi/conf/lighttpd.nextcloud.conf @@ -0,0 +1,6 @@ +# Solve OPcache settings warning on Nextcloud admin panel: +$HTTP["url"] =~ "^/nextcloud($|/)" { + setenv.add-environment += ( + "PHP_ADMIN_VALUE" => "opcache.memory_consumption=128", + ) +} From 1eb2708686534494d4708af907bb8038020e9f63 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 2 Jan 2018 20:39:03 +0100 Subject: [PATCH 195/390] v6.0 + Integrate new Lighttpd configuration into Nextcloud script part. --- dietpi/dietpi-software | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 62ee85a011..8b156b8642 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8609,6 +8609,26 @@ _EOF_ fi fi + + # Lighttpd: So far just to solve OPcache warning on admin panel + if (( ${aSOFTWARE_INSTALL_STATE[84]} >= 1 )); then + + local lighttpd_conf=/etc/lighttpd/lighttpd.conf + + # Enable mod_setenv + grep -q '^[[:blank:]]*"mod_setenv",' $lighttpd_conf || + grep -q '^[[:blank:]#;]*"mod_setenv",' $lighttpd_conf && + sed -i '/^[[:blank:]#;]*"mod_setenv",/c\ "mod_setenv",' $lighttpd_conf || + sed -i '/^[[:blank:]]*server.modules = (/a\ "mod_setenv",' $lighttpd_conf + + # Move Nextcloud configuration file in place and activate it + [ ! -f /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf ] && cp /DietPi/dietpi/conf/lighttpd.nextcloud.conf /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf + lighttpd-enable-mod dietpi-nextcloud + service lighttpd force-reload + + unset lighttpd_conf + + fi # Enable MySQL 4-byte support: https://docs.nextcloud.com/server/12/admin_manual/configuration_database/mysql_4byte_support.html cat << _EOF_ > /etc/mysql/conf.d/99-dietpi-4bit.cnf From bf391459ce84646658b9486e1b8e7ace693da6d7 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 3 Jan 2018 09:03:29 +0000 Subject: [PATCH 196/390] Minor Encase var text in string --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 8b156b8642..d98e81b1b1 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8613,7 +8613,7 @@ _EOF_ # Lighttpd: So far just to solve OPcache warning on admin panel if (( ${aSOFTWARE_INSTALL_STATE[84]} >= 1 )); then - local lighttpd_conf=/etc/lighttpd/lighttpd.conf + local lighttpd_conf='/etc/lighttpd/lighttpd.conf' # Enable mod_setenv grep -q '^[[:blank:]]*"mod_setenv",' $lighttpd_conf || From 1d72d59119f4497dd652ad6a5c692ea8d831449f Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 3 Jan 2018 09:37:43 +0000 Subject: [PATCH 197/390] v6.0 + add the G_ERROR_HANDLER_ONERROR_USERMSG at the beginning of installation: https://github.com/Fourdee/DietPi/issues/1357#issuecomment-354831791 + Sparky SBC kernel install --- PREP_SYSTEM_FOR_DIETPI.sh | 11 +++++++++++ dietpi/dietpi-software | 9 +++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 52596d7e65..331f9a920a 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1010,6 +1010,17 @@ _EOF_ # - Sparky SBC ONLY: elif (( $G_HW_MODEL == 70 )); then + # Install latest kernel + wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dragon_fly_check/uImage -O /boot/uImage + wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dragon_fly_check/3.10.38.bz2 -O package.tar + tar xvf package.tar -C /lib/modules/ + rm package.tar + + cat << _EOF_ > /DietPi/uEnv.txt +uenvcmd=setenv os_type linux; +bootargs=earlyprintk clk_ignore_unused selinux=0 scandelay console=tty0 loglevel=1 real_rootflag=rw root=/dev/mmcblk0p2 rootwait init=/lib/systemd/systemd aotg.urb_fix=1 aotg.aotg1_speed=0 +_EOF_ + # Blacklist GPU and touch screen modules: https://github.com/Fourdee/DietPi/issues/699#issuecomment-271362441 cat << _EOF_ > /etc/modprobe.d/disable_sparkysbc_touchscreen.conf blacklist owl_camera diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d98e81b1b1..7968ee11ea 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3356,8 +3356,6 @@ _EOF_ local string="$@" - export G_ERROR_HANDLER_ONERROR_USERMSG="DietPi-Software installation failed for:\n - Software Title = $G_ERROR_HANDLER_ONERROR_DPSOFTWARE_TITLE: $G_ERROR_HANDLER_ONERROR_DPSOFTWARE_DESC" - G_AGI $string } @@ -13725,6 +13723,9 @@ _EOF_ /DietPi/dietpi/dietpi-services stop Install_Dietpi_Software + #Reset error user message (set in Banner_Installing). It is reset after G_ERROR_HANDLER, however, the error handler may not of been used and the msg will remain. + export G_ERROR_HANDLER_ONERROR_USERMSG='' + #Apply Uninstall script created by DietPi choice system Uninstall_NonSelected_Choices @@ -14386,8 +14387,6 @@ _EOF_ } -# export G_ERROR_HANDLER_ONERROR_USERMSG="Unable to Install ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}\n\n$INSTALL_URL_ADDRESS is offline and/or unreachable." - #///////////////////////////////////////////////////////////////////////////////////// # Whip menus #///////////////////////////////////////////////////////////////////////////////////// @@ -15612,6 +15611,8 @@ _EOF_ G_DIETPI-NOTIFY 3 DietPi-Software "Install software" + export G_ERROR_HANDLER_ONERROR_USERMSG="Failed to Install\n - ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}." + echo -e " ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}" /DietPi/dietpi/dietpi-funtime 0 From a0cdae31957a790b65881b32a12c6fb3ae8d8078 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 3 Jan 2018 10:19:57 +0000 Subject: [PATCH 198/390] v6.0 + Removal of dietpi-funtime + Banner_Configuration: https://github.com/Fourdee/DietPi/issues/1357#issuecomment-354965795 + nullify global loading message --- dietpi/dietpi-funtime | 198 ------------------------------ dietpi/dietpi-software | 242 +++++++++++++++++++++++++++++++++++-- dietpi/dietpi-update | 2 - dietpi/func/dietpi-globals | 3 +- 4 files changed, 233 insertions(+), 212 deletions(-) delete mode 100644 dietpi/dietpi-funtime diff --git a/dietpi/dietpi-funtime b/dietpi/dietpi-funtime deleted file mode 100644 index ef8a3ea0a0..0000000000 --- a/dietpi/dietpi-funtime +++ /dev/null @@ -1,198 +0,0 @@ -#!/bin/bash -{ - #//////////////////////////////////// - # DietPi funtime Script - # - #//////////////////////////////////// - # Created by Daniel Knight / daniel.knight@dietpi.com / dietpi.com - # - #//////////////////////////////////// - # - # Info: - # - Does absolutetly nothing useful, except: - # - LOOKS COOL! - # - # Usage: - # - Called from bordum, or, /DietPi/dietpi/dietpi-funtime iMODE - #//////////////////////////////////// - - INPUT=0 - if [[ $1 =~ ^-?[0-9]+$ ]]; then - INPUT=$1 - fi - - #Import DietPi-Globals --------------------------------------------------------------- - . /DietPi/dietpi/func/dietpi-globals - export G_PROGRAM_NAME='DietPi-Funtime' - #Import DietPi-Globals --------------------------------------------------------------- - - #///////////////////////////////////////////////////////////////////////////////////// - #Funtime_0 processing - #///////////////////////////////////////////////////////////////////////////////////// - - Funtime_0(){ - - local MAX_COUNT=28 - ((MAX_COUNT--)) - - #local count=$MAX_COUNT - #local mode=1 - #local MAX_PASSES=3 - local count=0 - local mode=0 - local MAX_PASSES=2 - - local passes=0 - - local marker=( - - '# processing | D i e t P i #' - 'D# processing | D i e t P i #g' - 'D # processing | D i e t P i #ng' - 'D i# processing | D i e t P i #ing' - 'D i # processing | D i e t P i #sing' - 'D i e# processing | D i e t P i #ssing' - 'D i e # processing | D i e t P i #essing' - 'D i e t# processing | D i e t P i #cessing' - 'D i e t # processing | D i e t P i #ocessing' - 'D i e t # processing | D i e t P i #rocessing' - 'D i e t P# processing | D i e t P i #processing' - 'D i e t P # processing | D i e t P i # processing' - 'D i e t P i# processing | D i e t P i # processing' - 'D i e t P i # processing | D i e t P i# processing' - 'D i e t P i # processing | D i e t P # processing' - 'D i e t P i #processing | D i e t P# processing' - 'D i e t P i #rocessing | D i e t # processing' - 'D i e t P i #ocessing | D i e t # processing' - 'D i e t P i #cessing | D i e t# processing' - 'D i e t P i #essing | D i e # processing' - 'D i e t P i #ssing | D i e# processing' - 'D i e t P i #sing | D i # processing' - 'D i e t P i #ing | D i# processing' - 'D i e t P i #ng | D # processing' - 'D i e t P i #g | D# processing' - 'D i e t P i # | # processing' - 'D i e t P i #|# processing' - 'D i e t P i # processing' - - ) - - while (( $passes < $MAX_PASSES )) - do - if (( $mode == 0 )); then - ((count++)) - if (( $count >= $MAX_COUNT )); then - count=$MAX_COUNT - mode=1 - ((passes++)) - fi - elif (( $mode == 1 )); then - ((count--)) - if (( $count <= 0 )); then - count=0 - mode=0 - ((passes++)) - fi - fi - - #color=$((228 + $count)) - color=154 - - #echo -ne "${marker[$count]}\r" - - echo -ne "\e[38;5;${color}m ${marker[$count]}\r" - #echo -e "\e[38;5;${color}m ${marker[$count]}\r" - - #echo -e "\e[38;5;154m ${marker[$count]}\r" - - #fSleep="0.0$count" - local fSleep=0.03 - sleep "$fSleep" - - done - - unset marker - - } - - Funtime_1(){ - local count=0 - local mode=0 - - local passes=0 - local MAX_PASSES=4 - - local MAX_COUNT=1 - ((MAX_COUNT--)) - local -a marker=( - ' | ' - ' | ' - ' | ' - ' | ' - ' | ' - ' | ' - ' | ' - ' | ' - - ) - - while (( $passes < $MAX_PASSES )) - do - if (( $mode == 0 )); then - ((count++)) - if (( $count >= $MAX_COUNT )); then - count=$MAX_COUNT - mode=1 - ((passes++)) - fi - elif (( $mode == 1 )); then - ((count--)) - if (( $count <= 0 )); then - count=0 - mode=0 - ((passes++)) - fi - fi - - #color=$((228 + $count)) - color=93 - - #echo -ne "${marker[$count]}\r" - - echo -ne "\e[38;5;${color}m ${marker[$count]}\r" - #echo -e "\e[38;5;${color}m ${marker[$count]}\r" - - #echo -e "\e[38;5;154m ${marker[$count]}\r" - - #fSleep="0.0$count" - local fSleep=0.03 - sleep "$fSleep" - - done - - unset marker - - } - - #///////////////////////////////////////////////////////////////////////////////////// - #Main Loop - #///////////////////////////////////////////////////////////////////////////////////// - #---------------------------------------------------------------- - #Hide cursor - tput civis - #---------------------------------------------------------------- - # Run - Funtime_"$INPUT" - #---------------------------------------------------------------- - #Put colours back to normal - echo -e "\e[0m" - - #Move a line down - echo -e "" - #---------------------------------------------------------------- - #enable cursor - tput cnorm - #----------------------------------------------------------------------------------- - exit - #----------------------------------------------------------------------------------- -} \ No newline at end of file diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 7968ee11ea..3763b02a1f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7912,6 +7912,8 @@ _EOF_ INSTALLING_INDEX=23 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Remove Lxrandr Menu item (monitor configuration tool as we set res in dietpi-config) rm /usr/share/applications/lxrandr.desktop &> /dev/null @@ -7942,6 +7944,8 @@ _EOF_ INSTALLING_INDEX=24 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # - file manager desktop icon ln -sf /usr/share/applications/caja.desktop "$HOME"/Desktop/caja.desktop @@ -7961,6 +7965,8 @@ _EOF_ INSTALLING_INDEX=26 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + Create_Desktop_Shared_Items fi @@ -7969,6 +7975,8 @@ _EOF_ INSTALLING_INDEX=25 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + Create_Desktop_Shared_Items fi @@ -7977,6 +7985,8 @@ _EOF_ INSTALLING_INDEX=83 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #create www directory mkdir -p /var/www @@ -8040,6 +8050,8 @@ _EOF_ INSTALLING_INDEX=85 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #create www directory mkdir -p /var/www @@ -8071,6 +8083,8 @@ _EOF_ INSTALLING_INDEX=84 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #create www directory mkdir -p /var/www @@ -8114,6 +8128,8 @@ _EOF_ INSTALLING_INDEX=89 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # - Apache2 has its own PHP module if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then @@ -8248,6 +8264,8 @@ _EOF_ INSTALLING_INDEX=86 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Optimize for reduced memory use: https://github.com/Fourdee/DietPi/issues/605#issue-188930987 cat << _EOF_ > /etc/mysql/conf.d/reduce_resources.cnf [mysqld] @@ -8264,6 +8282,8 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[86]} == 1 || ${aSOFTWARE_INSTALL_STATE[88]} == 1 )); then + Banner_Configuration + if [ "$(readlink /var/lib/mysql)" != "$G_FP_DIETPI_USERDATA/mysql" ]; then systemctl stop mysql @@ -8298,6 +8318,8 @@ _EOF_ INSTALLING_INDEX=90 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #NGINX LIGHTTPD symlink to var www if (( ${aSOFTWARE_INSTALL_STATE[84]} >= 1 || ${aSOFTWARE_INSTALL_STATE[85]} >= 1 )); then @@ -8312,6 +8334,8 @@ _EOF_ INSTALLING_INDEX=91 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # Enable redis php module, if installed: "$PHP_APT_PACKAGE_NAME"enmod redis 2> /dev/null @@ -8321,6 +8345,8 @@ _EOF_ INSTALLING_INDEX=58 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # - service cat << _EOF_ > /etc/systemd/system/openbazaar.service [Unit] @@ -8341,6 +8367,8 @@ _EOF_ INSTALLING_INDEX=133 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + chmod +x -R /etc/yacy cat << _EOF_ > /etc/systemd/system/yacy.service @@ -8367,6 +8395,8 @@ _EOF_ INSTALLING_INDEX=47 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # Enable necessary PHP modules: https://doc.owncloud.org/server/latest/admin_manual/installation/source_installation.html#php-extensions "$PHP_APT_PACKAGE_NAME"enmod curl gd intl json pdo_mysql opcache apcu redis # Following modules are switchable since Stretch: @@ -8541,6 +8571,8 @@ _EOF_ INSTALLING_INDEX=114 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # Enable necessary PHP modules: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation "$PHP_APT_PACKAGE_NAME"enmod curl gd intl json pdo_mysql opcache apcu redis # Following modules are switchable since Stretch: @@ -8607,10 +8639,10 @@ _EOF_ fi fi - + # Lighttpd: So far just to solve OPcache warning on admin panel if (( ${aSOFTWARE_INSTALL_STATE[84]} >= 1 )); then - + local lighttpd_conf='/etc/lighttpd/lighttpd.conf' # Enable mod_setenv @@ -8618,14 +8650,14 @@ _EOF_ grep -q '^[[:blank:]#;]*"mod_setenv",' $lighttpd_conf && sed -i '/^[[:blank:]#;]*"mod_setenv",/c\ "mod_setenv",' $lighttpd_conf || sed -i '/^[[:blank:]]*server.modules = (/a\ "mod_setenv",' $lighttpd_conf - + # Move Nextcloud configuration file in place and activate it [ ! -f /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf ] && cp /DietPi/dietpi/conf/lighttpd.nextcloud.conf /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf lighttpd-enable-mod dietpi-nextcloud service lighttpd force-reload - + unset lighttpd_conf - + fi # Enable MySQL 4-byte support: https://docs.nextcloud.com/server/12/admin_manual/configuration_database/mysql_4byte_support.html @@ -8738,6 +8770,8 @@ _EOF_ INSTALLING_INDEX=44 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Jessie, Transmission uses my systemd service: https://github.com/Fourdee/DietPi/issues/350#issuecomment-220828884 rm /etc/init.d/transmission-daemon rm /etc/systemd/system/transmission-daemon.service @@ -8844,6 +8878,8 @@ _EOF_ INSTALLING_INDEX=54 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + /DietPi/dietpi/func/create_mysql_db phpbb3 "$GLOBAL_PW" root "$GLOBAL_PW" fi @@ -8852,6 +8888,8 @@ _EOF_ INSTALLING_INDEX=128 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Create MPD env (based on moOde) #useradd mpd useradd -r -M mpd -G audio -s /usr/bin/nologin @@ -8933,6 +8971,8 @@ _EOF_ INSTALLING_INDEX=94 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + sed -i "/root/c\#root" /etc/ftpusers cp /DietPi/dietpi/conf/proftpd.conf /etc/proftpd/proftpd.conf sed -i "/DefaultRoot /c\DefaultRoot $G_FP_DIETPI_USERDATA" /etc/proftpd/proftpd.conf @@ -8943,6 +8983,8 @@ _EOF_ INSTALLING_INDEX=96 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + echo -e "dietpi\ndietpi" | smbpasswd -s -a root cp /DietPi/dietpi/conf/smb.conf /etc/samba/smb.conf @@ -8954,6 +8996,8 @@ _EOF_ INSTALLING_INDEX=95 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + sed -i '/root/c\#root' /etc/ftpusers cp /DietPi/dietpi/conf/vsftpd.conf /etc/vsftpd.conf @@ -8965,6 +9009,8 @@ _EOF_ INSTALLING_INDEX=109 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + cat << _EOF_ > /etc/exports $G_FP_DIETPI_USERDATA *(rw,async,no_root_squash,fsid=0,crossmnt,no_subtree_check) _EOF_ @@ -8975,6 +9021,8 @@ _EOF_ INSTALLING_INDEX=32 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #YMPD service cat << _EOF_ > /etc/systemd/system/ympd.service [Unit] @@ -8996,6 +9044,8 @@ _EOF_ INSTALLING_INDEX=121 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + mkdir -p "$G_FP_DIETPI_USERDATA"/roon cp /DietPi/dietpi/conf/roonbridge.service /etc/systemd/system/roonbridge.service @@ -9017,6 +9067,8 @@ _EOF_ INSTALLING_INDEX=122 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + mkdir -p "$G_FP_DIETPI_USERDATA"/node-red adduser nodered --system --group --no-create-home --shell=/bin/nologin @@ -9043,6 +9095,8 @@ _EOF_ INSTALLING_INDEX=125 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # - Possible locations for Java # sed -i "/JAVA_HOME=/c\JAVA_HOME=$(which java)" /etc/default/tomcat8 # This doesnt work... | c2=/usr/bin/java/bin/java (Not a directory) | RPi = /usr/bin/java/bin/java (Not a directory) local afp_java=( @@ -9073,6 +9127,8 @@ _EOF_ INSTALLING_INDEX=119 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # - Cava conf mkdir -p "$HOME"/.config/cava cp /DietPi/dietpi/conf/cava.conf "$HOME"/.config/cava/config @@ -9105,6 +9161,8 @@ _EOF_ INSTALLING_INDEX=118 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + sed -i "/User=/c\User=root" /lib/systemd/system/mopidy.service # - conf @@ -9166,6 +9224,8 @@ _EOF_ INSTALLING_INDEX=31 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Remove Kodi user (Whilst waving) userdel -r kodi &> /dev/null @@ -9195,6 +9255,8 @@ _EOF_ INSTALLING_INDEX=39 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Run as root sed -i '/USER=m/c\USER=root' /etc/init.d/minidlna # + SystemD @@ -9214,6 +9276,8 @@ _EOF_ INSTALLING_INDEX=67 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #noip2 service file cat << _EOF_ > /etc/systemd/system/noip2.service [Unit] @@ -9237,6 +9301,8 @@ _EOF_ INSTALLING_INDEX=108 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Allow binary execution chmod -R +x /etc/amiberry @@ -9393,6 +9459,8 @@ _EOF_ INSTALLING_INDEX=112 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Symlink savegames to root # - Remove existing syslinks rm -R "$HOME"/.d1x-rebirth &> /dev/null @@ -9424,6 +9492,8 @@ _EOF_ INSTALLING_INDEX=51 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Copy the DietPi run file for OpenTyrian cp /DietPi/dietpi/conf/opentyrian_run /usr/local/games/opentyrian/run chmod +x /usr/local/games/opentyrian/run @@ -9440,6 +9510,8 @@ _EOF_ INSTALLING_INDEX=59 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # - raspimjpeg conf chmod +x /etc/raspimjpeg ln -s /etc/raspimjpeg /var/www/dietpicam/raspimjpeg @@ -9468,6 +9540,8 @@ _EOF_ INSTALLING_INDEX=45 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #copy init cp /DietPi/dietpi/conf/deluge.service /var/lib/dietpi/dietpi-software/services/deluge.service @@ -9500,6 +9574,8 @@ _EOF_ INSTALLING_INDEX=106 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Setup login file mkdir -p /etc/raspcontrol @@ -9519,6 +9595,8 @@ _EOF_ INSTALLING_INDEX=93 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # - Create a symlink so users can use http://ip/pihole ln -sf /var/www/html/admin /var/www/pihole @@ -9548,10 +9626,12 @@ _EOF_ fi #SUBSONIC 5/6 - #INSTALLING_INDEX=33/34 + INSTALLING_INDEX=34 if (( ${aSOFTWARE_INSTALL_STATE[33]} == 1 || ${aSOFTWARE_INSTALL_STATE[34]} == 1 )); then + Banner_Configuration + #Optimize memory limit local subsonic_memory_max=$(( $RAM_TOTAL / 5 )) #Minimum cap 150mb @@ -9588,6 +9668,8 @@ _EOF_ INSTALLING_INDEX=71 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #auto start update-rc.d webiopi defaults @@ -9598,6 +9680,8 @@ _EOF_ INSTALLING_INDEX=62 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Enable DietPi-Cloudshell autostart /DietPi/dietpi/dietpi-autostart 5 @@ -9636,6 +9720,8 @@ _EOF_ INSTALLING_INDEX=98 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Create jail directory mkdir -p /var/lib/haproxy @@ -9725,6 +9811,8 @@ _EOF_ INSTALLING_INDEX=35 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Remove service update-rc.d logitechmediaserver remove rm /etc/init.d/logitechmediaserver @@ -9741,6 +9829,8 @@ _EOF_ INSTALLING_INDEX=55 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Create mysql DB /DietPi/dietpi/func/create_mysql_db wordpress "$GLOBAL_PW" root "$GLOBAL_PW" @@ -9752,6 +9842,8 @@ _EOF_ ${aSOFTWARE_INSTALL_STATE[28]} == 1 || ${aSOFTWARE_INSTALL_STATE[120]} == 1 )); then + #Banner_Configuration + #User, enter PW if (( $G_USER_INPUTS )); then @@ -9918,6 +10010,8 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} >= 1 || ${aSOFTWARE_INSTALL_STATE[120]} >= 1 )); then + Banner_Configuration + local cmd_launch_desktop='' #DESKTOP_LXDE if (( ${aSOFTWARE_INSTALL_STATE[23]} >= 1 )); then @@ -9959,6 +10053,8 @@ _EOF_ INSTALLING_INDEX=73 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + cat << _EOF_ > /etc/fail2ban/fail2ban.conf [Definition] # loglevel #1=error #2=warn #3=info @@ -9976,6 +10072,8 @@ _EOF_ INSTALLING_INDEX=64 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #conf cp /DietPi/dietpi/conf/phpsysinfo.ini /var/www/phpsysinfo/phpsysinfo.ini @@ -9985,6 +10083,8 @@ _EOF_ INSTALLING_INDEX=56 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Get test images mkdir -p /var/www/gallery/DietPi wget http://dietpi.com/images/dietpi-logo_256.png -O /var/www/gallery/DietPi/logo_256.png @@ -10006,6 +10106,8 @@ _EOF_ INSTALLING_INDEX=40 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + Download_Test_Media #create/insert our pre-made ampache sql db @@ -10026,6 +10128,8 @@ _EOF_ INSTALLING_INDEX=97 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + local key_size=1024 #Start Cert/Key generation. @@ -10149,6 +10253,8 @@ _EOF_ INSTALLING_INDEX=60 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + local eth_index=$(sed -n 1p /DietPi/dietpi/.network) local wifi_index=$(sed -n 2p /DietPi/dietpi/.network) @@ -10251,7 +10357,9 @@ _EOF_ INSTALLING_INDEX=61 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then -# - Tor config + Banner_Configuration + + # - Tor config cat << _EOF_ > /etc/tor/torrc Log notice file /var/log/tor/notices.log VirtualAddrNetwork 10.192.0.0/10 @@ -10290,6 +10398,8 @@ _EOF_ INSTALLING_INDEX=37 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Enable SOXR by default: cat << _EOF_ > /usr/local/etc/shairport-sync.conf general = @@ -10330,6 +10440,8 @@ _EOF_ INSTALLING_INDEX=38 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Copy configs and services cp /DietPi/dietpi/conf/brutefir_config /etc/BruteFIR/ cp /DietPi/dietpi/conf/brutefir.service /var/lib/dietpi/dietpi-software/services/brutefir.service @@ -10371,6 +10483,8 @@ _EOF_ INSTALLING_INDEX=48 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Configure apache2 # - Disable php output_buffering = sed -i '/output_buffering = /c\output_buffering = Off/' "$FP_PHP_BASE_DIR"/apache2/php.ini @@ -10403,6 +10517,8 @@ _EOF_ INSTALLING_INDEX=36 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # - Replace Sysinit service with SystemD echo -e "#This file is no longer used as service has been upgraded to SystemD.\n#Please see /etc/systemd/system/squeezelite.service to set start options" > /etc/default/squeezelite rm /etc/init.d/squeezelite @@ -10416,6 +10532,8 @@ _EOF_ INSTALLING_INDEX=99 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # - Copy configs cp /etc/emonhub/conf/default/emonhub /etc/default/emonhub @@ -10460,6 +10578,8 @@ _EOF_ INSTALLING_INDEX=66 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # - Update apt package stats /usr/share/rpimonitor/scripts/updatePackagesStatus.pl @@ -10510,6 +10630,8 @@ _EOF_ INSTALLING_INDEX=65 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # - service cp /DietPi/dietpi/conf/netdata.service /etc/systemd/system/netdata.service @@ -10532,6 +10654,8 @@ _EOF_ INSTALLING_INDEX=57 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + Install_Apply_Permissions &> /dev/null # - install/run composer | Also run for ampache. Move this to a global function.... @@ -10554,6 +10678,8 @@ _EOF_ INSTALLING_INDEX=43 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Cap total connections local max_users=$(( $G_HW_CPU_CORES * 8 )) sed -i "/users=/c\users=$max_users" /etc/mumble-server.ini @@ -10573,6 +10699,8 @@ _EOF_ INSTALLING_INDEX=41 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + Download_Test_Media fi @@ -10581,6 +10709,8 @@ _EOF_ INSTALLING_INDEX=42 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + Download_Test_Media #For all ARM devices: @@ -10604,6 +10734,8 @@ _EOF_ INSTALLING_INDEX=52 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + cat << _EOF_ > /etc/systemd/system/cuberite.service [Unit] Description=Cuberite Server @@ -10638,6 +10770,8 @@ _EOF_ INSTALLING_INDEX=53 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Stop mineos from running while we config it. When we didnt do this, the program would constantly overwrite our symlink from (/var/games/minecraft). /DietPi/dietpi/dietpi-services stop killall -w supervisord &> /dev/null @@ -10685,6 +10819,8 @@ _EOF_ INSTALLING_INDEX=49 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # - Data storage / user data mkdir -p "$G_FP_DIETPI_USERDATA"/gogs-repo @@ -10724,6 +10860,8 @@ _EOF_ INSTALLING_INDEX=46 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # - conf. mkdir -p "$HOME"/.config/qBittorrent cat << _EOF_ > "$HOME"/.config/qBittorrent/qBittorrent.conf @@ -10830,6 +10968,8 @@ _EOF_ INSTALLING_INDEX=107 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Create username/password for rutorrent based on webserver type. # - Apache2 if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then @@ -11074,6 +11214,8 @@ _EOF_ INSTALLING_INDEX=132 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + cat << _EOF_ > /etc/systemd/system/aria2.service [Unit] Description=DietPi Aria2 @@ -11092,6 +11234,8 @@ _EOF_ INSTALLING_INDEX=50 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # - Generate dir's mkdir -p "$G_FP_DIETPI_USERDATA"/syncthing mkdir -p "$G_FP_DIETPI_USERDATA"/syncthing_data @@ -11144,6 +11288,8 @@ _EOF_ INSTALLING_INDEX=111 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + mkdir -p "$G_FP_DIETPI_USERDATA"/urbackup/urbackup_tmp_files #As we have /tmp mounted to RAM, change tmp locations @@ -11158,6 +11304,8 @@ _EOF_ INSTALLING_INDEX=116 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + mkdir -p "$G_FP_DIETPI_USERDATA"/sickrage cat << _EOF_ > /etc/systemd/system/sickrage.service @@ -11213,6 +11361,8 @@ _EOF_ INSTALLING_INDEX=134 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #service cat << _EOF_ > /etc/systemd/system/tonido.service [Unit] @@ -11253,6 +11403,8 @@ _EOF_ INSTALLING_INDEX=113 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Allow root, start maximized and disable sandbox under root (blank screen without) local export_options="export CHROMIUM_FLAGS=\"\$CHROMIUM_FLAGS --no-sandbox --temp-profile --start-maximized --user-data-dir " @@ -11300,6 +11452,8 @@ _EOF_ INSTALLING_INDEX=126 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + omv-initsystem fi @@ -11308,6 +11462,8 @@ _EOF_ INSTALLING_INDEX=129 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + sed -i "/'mysqli_user'/c \$cfg[\'mysqli_user\'] = \'root\';" /var/www/ompd/include/config.inc.php sed -i "/'mysqli_password'/c \$cfg[\'mysqli_password\'] = \'$GLOBAL_PW\';" /var/www/ompd/include/config.inc.php sed -i "/'media_dir'/c \$cfg[\'media_dir\'] = \'/var/lib/mpd/music/\';" /var/www/ompd/include/config.inc.php @@ -11321,6 +11477,8 @@ _EOF_ INSTALLING_INDEX=135 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #icecast set passwords: sed -i '/\/c\\dietpi\<\/source-password\>' /etc/icecast2/icecast.xml sed -i '/\/c\\dietpi\<\/relay-password\>' /etc/icecast2/icecast.xml @@ -11393,6 +11551,8 @@ _EOF_ INSTALLING_INDEX=131 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # - service local fp_java_binary=$(which java) @@ -11420,6 +11580,8 @@ _EOF_ INSTALLING_INDEX=136 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Enable RPi cam if (( $G_HW_MODEL < 10 )); then @@ -11442,6 +11604,8 @@ _EOF_ INSTALLING_INDEX=137 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # - Enable web admin cupsctl --remote-admin usermod -a -G lpadmin root @@ -11452,6 +11616,8 @@ _EOF_ INSTALLING_INDEX=138 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + cat << _EOF_ > /etc/systemd/system/virtualhere.service [Unit] Description=VirtualHere DietPi service @@ -11475,6 +11641,8 @@ _EOF_ INSTALLING_INDEX=139 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + cat << _EOF_ > /etc/systemd/system/sabnzbd.service [Unit] Description=sabnzbd DietPi @@ -11523,6 +11691,8 @@ _EOF_ INSTALLING_INDEX=141 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + cat << _EOF_ > /etc/systemd/system/spotify-connect-web.service [Unit] Description=spotify-connect-web @@ -11543,6 +11713,8 @@ _EOF_ INSTALLING_INDEX=142 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + cp /etc/couchpotato/init/ubuntu.default /etc/default/couchpotato sed -i "/CP_USER=/c\CP_USER=root" /etc/default/couchpotato sed -i "/CP_HOME=/c\CP_HOME=/etc/couchpotato" /etc/default/couchpotato @@ -11559,6 +11731,8 @@ _EOF_ INSTALLING_INDEX=143 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + Download_Test_Media /DietPi/dietpi/func/create_mysql_db koel "$GLOBAL_PW" root "$GLOBAL_PW" @@ -11602,6 +11776,8 @@ _EOF_ INSTALLING_INDEX=144 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + cat << _EOF_ > /etc/systemd/system/sonarr.service [Unit] Description=Sonarr (NzbDrone) Daemon @@ -11625,6 +11801,8 @@ _EOF_ INSTALLING_INDEX=145 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + cat << _EOF_ > /etc/systemd/system/radarr.service [Unit] Description=Radarr Daemon @@ -11648,6 +11826,8 @@ _EOF_ INSTALLING_INDEX=146 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + mkdir -p "$G_FP_DIETPI_USERDATA"/plexpy cat << _EOF_ > /etc/systemd/system/plexpy.service @@ -11671,6 +11851,8 @@ _EOF_ INSTALLING_INDEX=147 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + cat << _EOF_ > /etc/systemd/system/jackett.service [Unit] Description=Jackett Daemon @@ -11694,6 +11876,8 @@ _EOF_ INSTALLING_INDEX=149 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + sed -i "/MainDir=/c\MainDir=$G_FP_DIETPI_USERDATA/downloads" "$G_FP_DIETPI_USERDATA"/nzbget/nzbget.conf sed -i "/DestDir=/c\DestDir=$G_FP_DIETPI_USERDATA/downloads/complete" "$G_FP_DIETPI_USERDATA"/nzbget/nzbget.conf @@ -11736,6 +11920,8 @@ _EOF_ INSTALLING_INDEX=155 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + cat << _EOF_ > /etc/systemd/system/htpc-manager.service [Unit] Description=HTPC Manager @@ -11755,6 +11941,8 @@ _EOF_ INSTALLING_INDEX=153 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + cat << _EOF_ > /etc/systemd/system/octoprint.service [Unit] Description=OctoPrint @@ -11774,6 +11962,8 @@ _EOF_ INSTALLING_INDEX=154 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + cat << _EOF_ > /etc/systemd/system/roonserver.service [Unit] Description=Roon Server @@ -11795,6 +11985,8 @@ _EOF_ INSTALLING_INDEX=156 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + mkdir -p "$G_FP_DIETPI_USERDATA"/steam mv "$HOME"/.steam/* "$G_FP_DIETPI_USERDATA"/steam/ rm -R "$HOME"/.steam @@ -11807,6 +11999,8 @@ _EOF_ INSTALLING_INDEX=157 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + cat << _EOF_ > /etc/systemd/system/home-assistant.service [Unit] Description=Home Assistant @@ -11835,6 +12029,8 @@ _EOF_ INSTALLING_INDEX=158 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # Create simple mandatory default configuration file cat << _EOF_ >> /etc/default/minio # Default file path @@ -11856,6 +12052,8 @@ _EOF_ INSTALLING_INDEX=162 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # Create directory for docker containers mkdir "$G_FP_DIETPI_USERDATA"/docker-data @@ -11872,6 +12070,8 @@ _EOF_ INSTALLING_INDEX=161 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # Setup Filestore DietPi appropriate # IF already present just create symlink if [ ! -f "$G_FP_DIETPI_USERDATA"/fuguhub-data/ ]; then @@ -11897,6 +12097,9 @@ _EOF_ #Nukkit Config INSTALLING_INDEX=164 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + + Banner_Configuration + # Conig file to autostart -- english default wget -O /usr/local/bin/nukkit/nukkit.yml https://github.com/Nukkit/Languages/raw/master/eng/nukkit.yml # create systemd file @@ -11918,6 +12121,8 @@ _EOF_ INSTALLING_INDEX=165 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # - service cat << _EOF_ > /etc/systemd/system/gitea.service @@ -11950,6 +12155,8 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 || ${aSOFTWARE_INSTALL_STATE[160]} == 1 )); then + Banner_Configuration + /DietPi/dietpi/func/create_mysql_db allo_db dietpi root dietpi mysql -u root -pdietpi allo_db < /var/www/allo_db.sql rm /var/www/allo_db.sql @@ -12024,6 +12231,8 @@ _EOF_ INSTALLING_INDEX=163 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + cp /DietPi/dietpi/conf/gmrender.service /etc/systemd/system/gmrender.service fi @@ -12032,6 +12241,8 @@ _EOF_ INSTALLING_INDEX=166 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + mkdir -p /var/lib/dietpi/dietpi-software/installed/pi-spc cat << _EOF_ > /var/lib/dietpi/dietpi-software/installed/pi-spc/sds.sh @@ -12096,6 +12307,8 @@ _EOF_ INSTALLING_INDEX=168 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + #Create moOde runtime environment --------------------------------------------------------- # Create Pi user, does not exist on DietPi systems. # - Required for some moOde bash scripts which live in /home/pi @@ -12308,6 +12521,8 @@ _EOF_ INSTALLING_INDEX=169 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # - Symlink userdata location for assistant.json ln -sf "$G_FP_DIETPI_USERDATA"/voice-recognizer-raspi/assistant.json /home/dietpi/assistant.json @@ -15614,7 +15829,16 @@ _EOF_ export G_ERROR_HANDLER_ONERROR_USERMSG="Failed to Install\n - ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}." echo -e " ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}" - /DietPi/dietpi/dietpi-funtime 0 + + } + + Banner_Configuration(){ + + G_DIETPI-NOTIFY 3 DietPi-Software "Configuring software" + + export G_ERROR_HANDLER_ONERROR_USERMSG="Failed to Configure\n - ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}." + + echo -e " ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}" } @@ -15631,7 +15855,6 @@ _EOF_ G_DIETPI-NOTIFY 3 DietPi-Software "Installation completed" echo -e "\n The system will now reboot. \n This completes the DietPi-Software installation.\n" - /DietPi/dietpi/dietpi-funtime 0 sleep 3 else @@ -15646,7 +15869,6 @@ _EOF_ G_DIETPI-NOTIFY 3 DietPi-Software "Optimize and configure software" G_DIETPI-NOTIFY 2 "Applying DietPi optimizations and configurations for $G_HW_MODEL_DESCRIPTION" G_DIETPI-NOTIFY 2 "Please wait...\n" - /DietPi/dietpi/dietpi-funtime 0 #List software due for configuration # for ((i=0; i<$TOTAL_SOFTWARE_INDEXS; i++)) diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index d0af60a1bc..bef18b6607 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -320,8 +320,6 @@ _EOF_ G_DIETPI-NOTIFY 2 "Current Version : $COREVERSION_CURRENT.$SUBVERSION_CURRENT" G_DIETPI-NOTIFY 2 "Server Version : $COREVERSION_SERVER.$SUBVERSION_SERVER" - /DietPi/dietpi/dietpi-funtime 0 - RUN_UPDATE=1 #Ask for update diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 61656a8a6b..b58733b585 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -235,7 +235,6 @@ } - #----------------------------------------------------------------------------------- # DietPi Error Handler # https://github.com/Fourdee/DietPi/issues/1311#issuecomment-353716344 @@ -902,7 +901,7 @@ $print_logfile_info } #----------------------------------------------------------------------------------- - G_DIETPI-NOTIFY 2 'DietPi-Globals loaded\n' + #G_DIETPI-NOTIFY 2 'DietPi-Globals loaded\n' #----------------------------------------------------------------------------------- } From 8a77f96ea6171489bef35ec389b3ef658e19c8a7 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 3 Jan 2018 10:49:32 +0000 Subject: [PATCH 199/390] v6.0 https://github.com/Fourdee/DietPi/issues/1357#issuecomment-354831791 --- dietpi/dietpi-software | 928 ++++++++++++++++++++--------------------- 1 file changed, 455 insertions(+), 473 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 3763b02a1f..da687a9bec 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3351,26 +3351,6 @@ _EOF_ } - #apt-get install - AGI_ERROR_HANDLED(){ - - local string="$@" - - G_AGI $string - - } - - #apt-get purge - AGP_ERROR_HANDLED(){ - - local string="$@" - - export G_ERROR_HANDLER_ONERROR_USERMSG="DietPi-Software uninstall failed:" - - G_AGP $string - - } - #Return optimization values for BitTorrent servers based on device and hardware capabilities. Optimize_BitTorrent(){ @@ -3490,7 +3470,7 @@ _EOF_ # G_CHECK_URL "$INSTALL_URL_ADDRESS" # # #Install Python and PIP - # AGI_ERROR_HANDLED python python-pip python-imaging + # G_AGI python python-pip python-imaging # # cd "$HOME" # git clone --depth=1 "$INSTALL_URL_ADDRESS" @@ -3519,7 +3499,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED lxde upower policykit-1 iceweasel p7zip-full --no-install-recommends + G_AGI lxde upower policykit-1 iceweasel p7zip-full --no-install-recommends #upower policykit-1. Needed for LXDE logout menu item to show shutdown/restart ...... fi @@ -3535,7 +3515,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full --no-install-recommends + G_AGI mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full --no-install-recommends fi @@ -3550,7 +3530,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED x-window-system-core wmaker gnustep gnustep-devel gnustep-games libc-dbg upower policykit-1 iceweasel p7zip-full --no-install-recommends + G_AGI x-window-system-core wmaker gnustep gnustep-devel gnustep-games libc-dbg upower policykit-1 iceweasel p7zip-full --no-install-recommends fi @@ -3565,7 +3545,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED xfce4 xfce4-terminal gnome-icon-theme tango-icon-theme iceweasel p7zip-full --no-install-recommends + G_AGI xfce4 xfce4-terminal gnome-icon-theme tango-icon-theme iceweasel p7zip-full --no-install-recommends fi @@ -3575,7 +3555,7 @@ _EOF_ Banner_Installing - AGI_ERROR_HANDLED xrdp + G_AGI xrdp fi @@ -3617,7 +3597,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED transmission-daemon + G_AGI transmission-daemon fi @@ -3628,7 +3608,7 @@ _EOF_ Banner_Installing echo -e "proftpd-basic shared/proftpd/inetd_or_standalone select standalone" | debconf-set-selections - AGI_ERROR_HANDLED proftpd-basic + G_AGI proftpd-basic fi @@ -3637,7 +3617,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED samba samba-common-bin --no-install-recommends + G_AGI samba samba-common-bin --no-install-recommends fi @@ -3647,7 +3627,7 @@ _EOF_ Banner_Installing - AGI_ERROR_HANDLED vsftpd --no-install-recommends + G_AGI vsftpd --no-install-recommends fi @@ -3657,7 +3637,7 @@ _EOF_ Banner_Installing - AGI_ERROR_HANDLED nfs-kernel-server nfs-common ucf rpcbind + G_AGI nfs-kernel-server nfs-common ucf rpcbind fi @@ -3666,7 +3646,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED apache2 + G_AGI apache2 fi @@ -3675,7 +3655,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED nginx xml-core --no-install-recommends + G_AGI nginx xml-core --no-install-recommends fi @@ -3684,7 +3664,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED lighttpd + G_AGI lighttpd fi @@ -3697,7 +3677,7 @@ _EOF_ debconf-set-selections <<< "mysql-server mysql-server/root_password password $GLOBAL_PW" debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $GLOBAL_PW" - AGI_ERROR_HANDLED mysql-server + G_AGI mysql-server # Fix depricated key_buffer -> key_buffer_size per MySQL 5.x notification sed -i 's/^key_buffer[[:space:]]/key_buffer_size /g' /etc/mysql/my.cnf @@ -3713,7 +3693,7 @@ _EOF_ Banner_Installing - AGI_ERROR_HANDLED mariadb-server + G_AGI mariadb-server fi @@ -3722,7 +3702,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED sqlite3 + G_AGI sqlite3 fi @@ -3731,11 +3711,11 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED redis-server + G_AGI redis-server #Redis php module | == 2 to check for existing installs, if == 1, then module will be installed together with PHP, to prevent dependency installations if (( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )); then - AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-redis + G_AGI "$PHP_APT_PACKAGE_NAME"-redis fi @@ -3750,30 +3730,30 @@ _EOF_ #Install base PHP packages/modules. if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then - AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME" libapache2-mod-"$PHP_APT_PACKAGE_NAME" + G_AGI "$PHP_APT_PACKAGE_NAME" libapache2-mod-"$PHP_APT_PACKAGE_NAME" else - AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-fpm "$PHP_APT_PACKAGE_NAME"-cgi + G_AGI "$PHP_APT_PACKAGE_NAME"-fpm "$PHP_APT_PACKAGE_NAME"-cgi # 'php-xsl' does not exist for >= Stretch, 'php7.0-xsl' is just dummy for 'php7.0-xml': https://github.com/Fourdee/DietPi/issues/1286 - (( $G_DISTRO < 4 )) && AGI_ERROR_HANDLED php5-xsl + (( $G_DISTRO < 4 )) && G_AGI php5-xsl fi #php-common modules, used by most web software - AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-curl "$PHP_APT_PACKAGE_NAME"-gd "$PHP_APT_PACKAGE_NAME"-apcu "$PHP_APT_PACKAGE_NAME"-mcrypt + G_AGI "$PHP_APT_PACKAGE_NAME"-curl "$PHP_APT_PACKAGE_NAME"-gd "$PHP_APT_PACKAGE_NAME"-apcu "$PHP_APT_PACKAGE_NAME"-mcrypt # + stretch extras if (( $G_DISTRO >= 4 )); then - AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-mbstring "$PHP_APT_PACKAGE_NAME"-zip "$PHP_APT_PACKAGE_NAME"-xml + G_AGI "$PHP_APT_PACKAGE_NAME"-mbstring "$PHP_APT_PACKAGE_NAME"-zip "$PHP_APT_PACKAGE_NAME"-xml fi #php-SQL modules if (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 )); then - AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-mysql + G_AGI "$PHP_APT_PACKAGE_NAME"-mysql fi @@ -3781,11 +3761,11 @@ _EOF_ if (( $G_DISTRO < 4 )); then #For <= Jessie, php5-mysqlnd provides the newer mysql client libraries compared to php5-mysql. - AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-mysqlnd + G_AGI "$PHP_APT_PACKAGE_NAME"-mysqlnd else #For >= Stretch, php(7.X)-mysqlnd does not exist, thus php-mysql need to be installed: https://packages.debian.org/de/stretch/php-mysql - AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-mysql + G_AGI "$PHP_APT_PACKAGE_NAME"-mysql fi @@ -3793,14 +3773,14 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[87]} >= 1 )); then - AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-sqlite* #wildcard for version (eg:3) + G_AGI "$PHP_APT_PACKAGE_NAME"-sqlite* #wildcard for version (eg:3) fi #Redis php module if (( ${aSOFTWARE_INSTALL_STATE[91]} >= 1 )); then - AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-redis + G_AGI "$PHP_APT_PACKAGE_NAME"-redis fi @@ -3835,7 +3815,7 @@ _EOF_ fi - AGI_ERROR_HANDLED phpmyadmin + G_AGI phpmyadmin fi @@ -3855,8 +3835,8 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" #libupnp6 for net discov with upnp/avahi - AGI_ERROR_HANDLED libupnp6 - AGI_ERROR_HANDLED libmpdclient2 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file --no-install-recommends + G_AGI libupnp6 + G_AGI libmpdclient2 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file --no-install-recommends wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb @@ -3864,7 +3844,7 @@ _EOF_ else - AGI_ERROR_HANDLED mpd + G_AGI mpd fi @@ -3900,7 +3880,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" #Prereqs - AGI_ERROR_HANDLED libmpdclient2 libflac8 libyajl2 libavahi-client3 libvorbisfile3 libwavpack1 libmad0 libmpg123-0 libopus0 libavformat57 libfaad2 libcdio-paranoia1 libiso9660-8 libshout3 libid3tag0 + G_AGI libmpdclient2 libflac8 libyajl2 libavahi-client3 libvorbisfile3 libwavpack1 libmad0 libmpg123-0 libopus0 libavformat57 libfaad2 libcdio-paranoia1 libiso9660-8 libshout3 libid3tag0 apt-mark unhold mpd &> /dev/null #??? Not required for dpkg -i installs @@ -3938,10 +3918,10 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/OpenBazaar/OpenBazaar-Server.git' G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED libsodium-dev automake autoconf pkg-config libtool libssl-dev libffi-dev python-dev openssl libzmq3-dev + G_AGI libsodium-dev automake autoconf pkg-config libtool libssl-dev libffi-dev python-dev openssl libzmq3-dev #Not required. - #AGI_ERROR_HANDLED software-properties-common + #G_AGI software-properties-common #add-apt-repository -y ppa:chris-lea/libsodium #G_AGUP @@ -4007,7 +3987,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" # Install necessary PHP modules: https://doc.owncloud.org/server/latest/admin_manual/installation/source_installation.html#php-extensions - AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis + G_AGI "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis if [ ! -f /etc/apt/sources.list.d/owncloud.list ] && [ ! -f /var/www/owncloud/occ ]; then @@ -4026,7 +4006,7 @@ _EOF_ fi - [ -f /etc/apt/sources.list.d/owncloud.list ] && AGI_ERROR_HANDLED owncloud-files + [ -f /etc/apt/sources.list.d/owncloud.list ] && G_AGI owncloud-files fi @@ -4041,7 +4021,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" # Install necessary PHP modules: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis + G_AGI "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis if [ ! -f /var/www/nextcloud/occ ]; then @@ -4161,7 +4141,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED libpulse0 libfftw3-3 + G_AGI libpulse0 libfftw3-3 wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb @@ -4193,14 +4173,14 @@ _EOF_ fi G_AGUP - AGI_ERROR_HANDLED mopidy + G_AGI mopidy #ARMv8 #NB: No ARM64 packages currently exist in mopidy repo. So it will throw a minor error when updating apt. #Mopidy web client extensions not loading in webpage... # if (( $G_HW_ARCH == 3 )); then - # AGI_ERROR_HANDLED build-essential python-dev + # G_AGI build-essential python-dev # pip install mopidy #no effect, claims already upto date. # fi @@ -4218,29 +4198,29 @@ _EOF_ #Odroids if (( $G_HW_MODEL >= 10 )) && (( $G_HW_MODEL < 20 )); then - AGI_ERROR_HANDLED kodi-odroid + G_AGI kodi-odroid #XU4 - requires pulse audio (fixes corrupt sound) if (( $G_HW_MODEL == 11 )); then - AGI_ERROR_HANDLED pulseaudio --no-install-recommends + G_AGI pulseaudio --no-install-recommends fi #Everything else else - AGI_ERROR_HANDLED kodi + G_AGI kodi fi # - libcurl3-gnutls required for C2. But lets apply to all: https://github.com/Fourdee/DietPi/issues/446 - AGI_ERROR_HANDLED libcurl3-gnutls + G_AGI libcurl3-gnutls # - Add NFS support for kodi if (( $G_DISTRO == 3 )); then - AGI_ERROR_HANDLED libnfs4 + G_AGI libnfs4 fi @@ -4266,7 +4246,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED minidlna + G_AGI minidlna fi @@ -4312,12 +4292,12 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/amiberry-rpi_v2.1.1.7z' G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED alsa-oss joystick libsdl-image1.2 libsdl-ttf2.0-0 libsdl-gfx1.2-5 libguichan-0.8.1-1* libguichan-allegro-0.8.1-1* libguichan-sdl-0.8.1-1* libguichan-opengl-0.8.1-1* libjpgalleg4.4 libxml2 libmpg123-0 + G_AGI alsa-oss joystick libsdl-image1.2 libsdl-ttf2.0-0 libsdl-gfx1.2-5 libguichan-0.8.1-1* libguichan-allegro-0.8.1-1* libguichan-sdl-0.8.1-1* libguichan-opengl-0.8.1-1* libjpgalleg4.4 libxml2 libmpg123-0 #libmpeg2-4 # Required for dev branch # + SDL2 - AGI_ERROR_HANDLED libpng12-0 libflac8 libmpg123-0 libgoogle-perftools4 libfreetype6 libxxf86vm1 + G_AGI libpng12-0 libflac8 libmpg123-0 libgoogle-perftools4 libfreetype6 libxxf86vm1 #Download binaries # - Backup existing autostart.uae for user @@ -4338,7 +4318,7 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/rpi/dxx-rebirth.7z' G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED libsdl-mixer1.2 libsdl1.2debian libphysfs1 + G_AGI libsdl-mixer1.2 libsdl1.2debian libphysfs1 wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z -o"$G_FP_DIETPI_USERDATA" @@ -4372,7 +4352,7 @@ _EOF_ #ARMv8 source build if (( $G_HW_ARCH == 3 )); then - AGI_ERROR_HANDLED build-essential zlib1g-dev libcurl4-openssl-dev libcrypto++-dev sqlite3 + G_AGI build-essential zlib1g-dev libcurl4-openssl-dev libcrypto++-dev sqlite3 wget "$INSTALL_URL_ADDRESS" -O package.tar tar xzvf package.tar @@ -4418,7 +4398,7 @@ _EOF_ INSTALL_URL_ADDRESS="http://dietpi.com/downloads/binaries/rpi/opentyrian_armhf.zip" G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED ibsdl1.2debian libsdl-net1.2 --no-install-recommends + G_AGI ibsdl1.2debian libsdl-net1.2 --no-install-recommends #Download binaries wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -4438,7 +4418,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install pre-reqs - AGI_ERROR_HANDLED gpac motion + G_AGI gpac motion #Get source/binaries and extract wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -4481,7 +4461,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED deluged deluge-web deluge-webui deluge-console + G_AGI deluged deluge-web deluge-webui deluge-console fi @@ -4491,7 +4471,7 @@ _EOF_ Banner_Installing - AGI_ERROR_HANDLED python + G_AGI python #Download Grasshopper local grasshopper_directory='/var/www' @@ -4557,13 +4537,13 @@ _EOF_ echo -e "deb $INSTALL_URL_ADDRESS erasmus main" > /etc/apt/sources.list.d/openmediavault.list G_AGUP - AGI_ERROR_HANDLED openmediavault-keyring + G_AGI openmediavault-keyring debconf-set-selections <<< "openmediavault openmediavault/run-initsystem note" debconf-set-selections <<< "postfix postfix/main_mailer_type select No configuration" G_AGUP - AGI_ERROR_HANDLED openmediavault postfix + G_AGI openmediavault postfix fi @@ -4591,7 +4571,7 @@ _EOF_ Banner_Installing - AGI_ERROR_HANDLED darkice icecast2 + G_AGI darkice icecast2 fi @@ -4624,7 +4604,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" # - Pre-reqs: https://github.com/Fourdee/DietPi/issues/1282#issuecomment-350490524 - AGI_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-cgi "$PHP_APT_PACKAGE_NAME"-sqlite* + G_AGI "$PHP_APT_PACKAGE_NAME"-cgi "$PHP_APT_PACKAGE_NAME"-sqlite* # - Check free available memory. Increase swapfile size to prevent gravity running out of mem. if (( $(free -m | grep -m1 'Mem:' | awk '{print $4}') < 512 )); then @@ -4667,7 +4647,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://sourceforge.net/projects/subsonic/files/subsonic/5.3/subsonic-5.3.deb/download' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #AGI_ERROR_HANDLED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 + #G_AGI lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 #Install SubSonic 5.3 wget "$INSTALL_URL_ADDRESS" -O package.deb @@ -4685,7 +4665,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://sourceforge.net/projects/subsonic/files/subsonic/6.1.3/subsonic-6.1.3.deb/download' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #AGI_ERROR_HANDLED lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 + #G_AGI lame #conflicts with our ffmpeg package: https://github.com/Fourdee/DietPi/issues/946#issuecomment-300738228 #Install SubSonic 6.0 wget "$INSTALL_URL_ADDRESS" -O package.deb @@ -4726,12 +4706,12 @@ _EOF_ # >= v111 image if [ -f /etc/.dietpi_image_version ]; then - AGI_ERROR_HANDLED python-rpi.gpio python3-rpi.gpio + G_AGI python-rpi.gpio python3-rpi.gpio # - < v111 Bug in older DietPi images with sources.list | Use pip, as offical repo = python3-rpi.gpio: Depends: python3 (< 3.3) but 3.4.2-2 is to be installed else - AGI_ERROR_HANDLED python3-pip + G_AGI python3-pip pip3 install RPi.GPIO fi @@ -4811,12 +4791,12 @@ _EOF_ Banner_Installing - AGI_ERROR_HANDLED python python3 + G_AGI python python3 # - RPi, pre-reqs GPIO control for Node-Red if (( $G_HW_MODEL < 10 )); then - AGI_ERROR_HANDLED python-rpi.gpio + G_AGI python-rpi.gpio fi @@ -4907,7 +4887,7 @@ _EOF_ G_AGUP - AGI_ERROR_HANDLED mosquitto + G_AGI mosquitto fi @@ -4927,7 +4907,7 @@ _EOF_ wget "$INSTALL_URL_ADDRESS" -O /etc/blynkserver/server.jar # - Install Blynk JS Libary - AGI_ERROR_HANDLED python + G_AGI python npm install -g onoff npm install -g blynk-library @@ -4969,12 +4949,12 @@ _EOF_ done # - Prereqs - AGI_ERROR_HANDLED libasound2 + G_AGI libasound2 # - Stretch, install additional packages if (( $G_DISTRO >= 4 )); then - AGI_ERROR_HANDLED gcc-6-base libstdc++6 + G_AGI gcc-6-base libstdc++6 fi @@ -5000,7 +4980,7 @@ _EOF_ Banner_Installing - AGI_ERROR_HANDLED tomcat8 + G_AGI tomcat8 fi @@ -5014,7 +4994,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" #Python dev, pre-reqs - AGI_ERROR_HANDLED python-dev python-setuptools --no-install-recommends + G_AGI python-dev python-setuptools --no-install-recommends #Install WEBIOPI wget "$INSTALL_URL_ADDRESS" -O package.tar @@ -5071,7 +5051,7 @@ _EOF_ cd haproxy-* #Pre-reqs - AGI_ERROR_HANDLED libpcre3-dev libssl-dev zlib1g-dev + G_AGI libpcre3-dev libssl-dev zlib1g-dev #Compile and install make -j $G_HW_CPU_CORES TARGET=linux2628 CPU=generic USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 USE_LINUX_SPLICE=1 make install @@ -5114,7 +5094,7 @@ _EOF_ # Compile pre-req CPAN modules??? # if (( $G_DISTRO >= 4 )); then - # AGI_ERROR_HANDLED yasm git build-essential automake cpanminus nasm libxml-parser-perl libexpat1-dev libgif-dev zlib1g-dev libjpeg-dev libpng-dev + # G_AGI yasm git build-essential automake cpanminus nasm libxml-parser-perl libexpat1-dev libgif-dev zlib1g-dev libjpeg-dev libpng-dev # + ARMv6 cpan @@ -5127,8 +5107,8 @@ _EOF_ # + ARM64 cpan elif (( $G_HW_ARCH == 3 )); then - AGI_ERROR_HANDLED libxml-parser-perl - AGI_ERROR_HANDLED zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev # shared libs needed for Image::Scale@0.08 + G_AGI libxml-parser-perl + G_AGI zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev # shared libs needed for Image::Scale@0.08 wget http://dietpi.com/downloads/binaries/all/DietPi-LMS7.9-CPAN_arm64.zip -O package.zip unzip -o package.zip -d /usr/share/squeezeboxserver @@ -5159,7 +5139,7 @@ _EOF_ Banner_Installing - AGI_ERROR_HANDLED tightvncserver x11vnc --no-install-recommends + G_AGI tightvncserver x11vnc --no-install-recommends fi @@ -5169,12 +5149,12 @@ _EOF_ Banner_Installing - AGI_ERROR_HANDLED vnc4server x11vnc --no-install-recommends + G_AGI vnc4server x11vnc --no-install-recommends # - Stretch+ if (( $G_DISTRO >= 4 )); then - AGI_ERROR_HANDLED tigervnc-common + G_AGI tigervnc-common fi @@ -5198,7 +5178,7 @@ _EOF_ # rm VNC*.deb # - Available in Raspbian apt - AGI_ERROR_HANDLED realvnc-vnc-server + G_AGI realvnc-vnc-server fi @@ -5210,7 +5190,7 @@ _EOF_ touch /var/log/auth.log #: https://github.com/Fourdee/DietPi/issues/475#issuecomment-310873879 - AGI_ERROR_HANDLED fail2ban --no-install-recommends + G_AGI fail2ban --no-install-recommends fi @@ -5281,7 +5261,7 @@ _EOF_ Banner_Installing - AGI_ERROR_HANDLED openvpn easy-rsa iptables + G_AGI openvpn easy-rsa iptables fi @@ -5294,7 +5274,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://install.pivpn.io' G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED lsb-release + G_AGI lsb-release # - Requires underpriv user: https://github.com/Fourdee/DietPi/issues/570#issuecomment-255588307 useradd pivpn @@ -5339,17 +5319,17 @@ _EOF_ if (( $G_DISTRO >= 4 )); then - AGI_ERROR_HANDLED certbot + G_AGI certbot if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then - AGI_ERROR_HANDLED python-certbot-apache + G_AGI python-certbot-apache fi if (( ${aSOFTWARE_INSTALL_STATE[85]} >= 1 )); then - AGI_ERROR_HANDLED python-certbot-nginx + G_AGI python-certbot-nginx fi @@ -5390,7 +5370,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" # - Prereqs - AGI_ERROR_HANDLED hostapd isc-dhcp-server iptables libnl-3-200 + G_AGI hostapd isc-dhcp-server iptables libnl-3-200 wget "$INSTALL_URL_ADDRESS" -O package.zip unzip -o package.zip @@ -5498,7 +5478,7 @@ _EOF_ Banner_Installing # - Prereqs - AGI_ERROR_HANDLED tor + G_AGI tor fi @@ -5535,10 +5515,10 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" # - Prereqs - AGI_ERROR_HANDLED openssl libsoxr0 libavahi-client3 libtool libconfig9 libpopt0 libdaemon0 --no-install-recommends + G_AGI openssl libsoxr0 libavahi-client3 libtool libconfig9 libpopt0 libdaemon0 --no-install-recommends # This occured on C2: shairport-sync : Depends: libpopt-dev but it is not installed - #AGI_ERROR_HANDLED libpopt-dev + #G_AGI libpopt-dev wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z -o/ @@ -5587,7 +5567,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" # - Prereqs - AGI_ERROR_HANDLED brutefir + G_AGI brutefir wget -r -nH --cut-dirs=2 --no-parent --reject="index.htm*" -e robots=off "$INSTALL_URL_ADDRESS" mv BruteFIR /etc/ @@ -5621,7 +5601,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" # - Prereqs - AGI_ERROR_HANDLED squeezelite + G_AGI squeezelite # - Overwrite binary with latest version: wget "$INSTALL_URL_ADDRESS" -O package.7z @@ -5669,7 +5649,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" # - Prereqs - AGI_ERROR_HANDLED minicom python-serial python-configobj --no-install-recommends + G_AGI minicom python-serial python-configobj --no-install-recommends pip install paho-mqtt pydispatcher wget "$INSTALL_URL_ADDRESS" -O package.zip @@ -5737,7 +5717,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" # - For compression - AGI_ERROR_HANDLED --no-install-recommends zlib1g-dev + G_AGI --no-install-recommends zlib1g-dev wget "$INSTALL_URL_ADDRESS" -O package.deb dpkg -i package.deb @@ -5768,7 +5748,7 @@ _EOF_ Banner_Installing - AGI_ERROR_HANDLED mumble-server + G_AGI mumble-server fi @@ -5849,7 +5829,7 @@ _EOF_ fi - AGI_ERROR_HANDLED emby-server embymagick + G_AGI emby-server embymagick fi @@ -5894,12 +5874,12 @@ _EOF_ dpkg --add-architecture armhf G_AGUP - AGI_ERROR_HANDLED binutils:armhf plexmediaserver-installer:armhf + G_AGI binutils:armhf plexmediaserver-installer:armhf #ARM32 else - AGI_ERROR_HANDLED plexmediaserver-installer + G_AGI plexmediaserver-installer fi @@ -5949,7 +5929,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" #prereqs - AGI_ERROR_HANDLED python python3 supervisor rdiff-backup screen rsync + G_AGI python python3 supervisor rdiff-backup screen rsync mkdir -p "$G_FP_DIETPI_USERDATA"/mineos cd "$G_FP_DIETPI_USERDATA"/mineos @@ -6005,7 +5985,7 @@ _EOF_ Banner_Installing - AGI_ERROR_HANDLED qbittorrent-nox + G_AGI qbittorrent-nox fi @@ -6018,16 +5998,16 @@ _EOF_ INSTALL_URL_ADDRESS='http://bintray.com/novik65/generic/download_file?file_path=ruTorrent-3.7.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED rtorrent screen #mediainfo + G_AGI rtorrent screen #mediainfo #Raspbian unrar free if (( $G_HW_MODEL < 10 )); then - AGI_ERROR_HANDLED unrar-free #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 + G_AGI unrar-free #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 else - AGI_ERROR_HANDLED unrar #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 + G_AGI unrar #https://github.com/Fourdee/DietPi/issues/176#issuecomment-240101365 fi @@ -6050,7 +6030,7 @@ _EOF_ if (( $G_DISTRO >= 4 )); then - AGI_ERROR_HANDLED aria2 + G_AGI aria2 else @@ -6082,7 +6062,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" # - prereqs - AGI_ERROR_HANDLED libc-ares2 + G_AGI libc-ares2 wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z @@ -6116,16 +6096,16 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/SickRage/SickRage/archive/master.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED python libxslt1.1 libxml2 python-openssl python-xmltodict + G_AGI python libxslt1.1 libxml2 python-openssl python-xmltodict #Raspbian unrar free if (( $G_HW_MODEL < 10 )); then - AGI_ERROR_HANDLED unrar-free + G_AGI unrar-free else - AGI_ERROR_HANDLED unrar + G_AGI unrar fi @@ -6217,7 +6197,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED libpng12-0 libfontconfig1 + G_AGI libpng12-0 libfontconfig1 wget "$INSTALL_URL_ADDRESS" -O package.tar mkdir /etc/tonido @@ -6237,11 +6217,11 @@ _EOF_ if (( $G_HW_MODEL < 10 )); then - AGI_ERROR_HANDLED chromium-browser + G_AGI chromium-browser else - AGI_ERROR_HANDLED chromium + G_AGI chromium fi @@ -6268,7 +6248,7 @@ _EOF_ # - Odroid's, 'apt-get install -f' removes chromium package, rather than install required deps... if (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )); then - AGI_ERROR_HANDLED libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7 + G_AGI libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7 else @@ -6317,7 +6297,7 @@ _EOF_ G_CHECK_URL "http://github.com/Motion-Project/motion" # - Prereqs - AGI_ERROR_HANDLED v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev libx264-142 libavcodec56 libavformat56 libmysqlclient18 libswscale3 libpq5 + G_AGI v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev libx264-142 libavcodec56 libavformat56 libmysqlclient18 libswscale3 libpq5 # - Motion wget "$INSTALL_URL_ADDRESS" -O package.deb @@ -6331,9 +6311,9 @@ _EOF_ else # - Prereqs - AGI_ERROR_HANDLED v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev + G_AGI v4l-utils python python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev - AGI_ERROR_HANDLED motion + G_AGI motion # - Motioneye pip install motioneye @@ -6361,11 +6341,11 @@ _EOF_ wget -q -O - https://davesteele.github.io/key-366150CE.pub.txt | apt-key add - G_AGUP - AGI_ERROR_HANDLED cloudprint-service + G_AGI cloudprint-service else - AGI_ERROR_HANDLED cloudprint-service + G_AGI cloudprint-service fi @@ -6418,15 +6398,15 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" #prereqs - AGI_ERROR_HANDLED par2 python-dev libffi-dev libssl-dev + G_AGI par2 python-dev libffi-dev libssl-dev if (( $G_HW_MODEL < 10 )); then - AGI_ERROR_HANDLED unrar-free + G_AGI unrar-free else - AGI_ERROR_HANDLED unrar + G_AGI unrar fi @@ -6468,7 +6448,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/CouchPotato/CouchPotatoServer/archive/master.zip' G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED libffi-dev libssl-dev python-lxml python3-lxml + G_AGI libffi-dev libssl-dev python-lxml python3-lxml wget "$INSTALL_URL_ADDRESS" -O package.zip unzip -o package.zip @@ -6491,7 +6471,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED python + G_AGI python wget "$INSTALL_URL_ADDRESS" -O package.zip unzip -o package.zip @@ -6531,7 +6511,7 @@ _EOF_ fi G_AGUP - AGI_ERROR_HANDLED nzbdrone + G_AGI nzbdrone fi @@ -6545,7 +6525,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED mono-devel mediainfo sqlite3 libmono-cil-dev + G_AGI mono-devel mediainfo sqlite3 libmono-cil-dev wget $( curl -s "$INSTALL_URL_ADDRESS" | grep linux.tar.gz | grep browser_download_url | head -1 | cut -d \" -f 4 ) -O package.tar tar -xf package.tar -C /opt/ @@ -6563,7 +6543,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED python + G_AGI python git clone --depth=1 "$INSTALL_URL_ADDRESS" @@ -6581,7 +6561,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED mono-devel + G_AGI mono-devel wget $( curl -s "$INSTALL_URL_ADDRESS" | grep Jackett.Binaries.Mono.tar.gz | grep browser_download_url | head -1 | cut -d \" -f 4 ) -O package.tar tar -xvf package.tar @@ -6610,7 +6590,7 @@ _EOF_ G_AGUP - AGI_ERROR_HANDLED mediacenter22 + G_AGI mediacenter22 fi @@ -6644,7 +6624,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" #Install Python and PIP - AGI_ERROR_HANDLED python python-pip python-imaging python-dev + G_AGI python python-pip python-imaging python-dev cd "$HOME" git clone --depth=1 "$INSTALL_URL_ADDRESS" @@ -6668,7 +6648,7 @@ _EOF_ INSTALL_URL_ADDRESS='https://github.com/foosel/OctoPrint.git' G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED python python-dev + G_AGI python python-dev git clone "$INSTALL_URL_ADDRESS" mv OctoPrint* "$G_FP_DIETPI_USERDATA"/octoprint @@ -6688,7 +6668,7 @@ _EOF_ INSTALL_URL_ADDRESS='http://download.roonlabs.com/builds/RoonServer_linuxx64.tar.bz2' G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED libav-tools cifs-utils + G_AGI libav-tools cifs-utils wget "$INSTALL_URL_ADDRESS" -O package.tar tar xvf package.tar @@ -6706,7 +6686,7 @@ _EOF_ debconf-set-selections <<< "steam steam/question select I AGREE" - AGI_ERROR_HANDLED steam + G_AGI steam fi @@ -6893,7 +6873,7 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" - AGI_ERROR_HANDLED libupnp6 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-alsa + G_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 @@ -6924,7 +6904,7 @@ _EOF_ echo -e "deb https://dtcooper.github.io/raspotify jessie main" > /etc/apt/sources.list.d/raspotify.list G_AGUP - AGI_ERROR_HANDLED raspotify + G_AGI raspotify fi @@ -6943,23 +6923,23 @@ _EOF_ #Pre-Reqs ----------------------------------------------------------------------- # Core packages - AGI_ERROR_HANDLED rpi-update mpc memcached $PHP_APT_PACKAGE_NAME-memcache \ + G_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_ERROR_HANDLED dnsmasq hostapd + G_AGI dnsmasq hostapd # BT - AGI_ERROR_HANDLED bluez bluez-firmware \ + G_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 (( $G_HW_MODEL < 10 )); then - AGI_ERROR_HANDLED pi-bluetooth + G_AGI pi-bluetooth fi @@ -7051,6 +7031,11 @@ libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc fi + #------------------------------------------------------------------- + #Reset error handler (eg: for usermsg clear set in Banner_Installing) + G_ERROR_HANDLER_RESET + #------------------------------------------------------------------- + } Install_Linux_Software(){ @@ -7060,7 +7045,7 @@ libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc Banner_Installing - AGI_ERROR_HANDLED alsa-utils + G_AGI alsa-utils #Apply soundcard local soundcard=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_SOUNDCARD=' | sed 's/.*=//') @@ -7091,7 +7076,7 @@ libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc Banner_Installing #Xserver Prereqs (ALL) - AGI_ERROR_HANDLED xcompmgr xterm xinit xauth xserver-xorg dbus-x11 xfonts-base x11-xserver-utils x11-common x11-utils --no-install-recommends + G_AGI xcompmgr xterm xinit xauth xserver-xorg dbus-x11 xfonts-base x11-xserver-utils x11-common x11-utils --no-install-recommends #Improve performance on all desktops and devices (eg: removes window lag in desktops) by limiting compositions mkdir -p /etc/xdg/autostart @@ -7111,11 +7096,11 @@ _EOF_ #Odroid C2 elif (( $G_HW_MODEL == 12 )); then - AGI_ERROR_HANDLED aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump-odroid --no-install-recommends + G_AGI aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump-odroid --no-install-recommends #cp /DietPi/dietpi/conf/xorg_c2.conf /etc/X11/xorg.conf # FBTURBO C2, provides much better desktop performance over Mali DDX: http://forum.odroid.com/viewtopic.php?f=138&t=19948&p=169808#p169808 - AGI_ERROR_HANDLED xf86-video-fbturbo-odroid + G_AGI xf86-video-fbturbo-odroid cat << _EOF_ > /etc/X11/xorg.conf Section "Device" Identifier "FBTurbo" @@ -7129,14 +7114,14 @@ _EOF_ #Odroid XU4 elif (( $G_HW_MODEL == 11 )); then - AGI_ERROR_HANDLED firmware-samsung xf86-video-armsoc-odroid malit628-odroid --no-install-recommends + G_AGI firmware-samsung xf86-video-armsoc-odroid malit628-odroid --no-install-recommends cp /DietPi/dietpi/conf/xorg_xu4.conf /etc/X11/xorg.conf #Odroid C1 elif (( $G_HW_MODEL == 10 )); then - AGI_ERROR_HANDLED aml-libs-odroid xf86-video-mali-odroid libump-odroid mali450-odroid --no-install-recommends + G_AGI aml-libs-odroid xf86-video-mali-odroid libump-odroid mali450-odroid --no-install-recommends cp /DietPi/dietpi/conf/xorg_c1.conf /etc/X11/xorg.conf @@ -7186,10 +7171,10 @@ _EOF_ Banner_Installing #Install - AGI_ERROR_HANDLED nvidia-driver nvidia-xconfig + G_AGI nvidia-driver nvidia-xconfig # + i386 OpenGL - AGI_ERROR_HANDLED libgl1-nvidia-glx:i386 + G_AGI libgl1-nvidia-glx:i386 fi @@ -7199,7 +7184,7 @@ _EOF_ Banner_Installing - AGI_ERROR_HANDLED avahi-daemon + G_AGI avahi-daemon fi @@ -7207,7 +7192,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED build-essential make autoconf automake --no-install-recommends + G_AGI build-essential make autoconf automake --no-install-recommends fi @@ -7215,7 +7200,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED ntp + G_AGI ntp # Remove service, as DietPi ntpd-mode launches the binary with custom commands systemctl stop ntp @@ -7229,7 +7214,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED git --no-install-recommends + G_AGI git --no-install-recommends fi @@ -7237,7 +7222,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED vifm + G_AGI vifm fi @@ -7245,7 +7230,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED vim + G_AGI vim fi @@ -7253,7 +7238,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED vim-tiny + G_AGI vim-tiny fi @@ -7261,7 +7246,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED neovim + G_AGI neovim fi @@ -7269,7 +7254,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED emacs + G_AGI emacs fi @@ -7277,7 +7262,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED iperf + G_AGI iperf fi @@ -7285,7 +7270,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED mc + G_AGI mc fi @@ -7293,7 +7278,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED jed + G_AGI jed fi @@ -7301,7 +7286,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED iftop + G_AGI iftop fi @@ -7309,7 +7294,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED iptraf + G_AGI iptraf fi @@ -7317,7 +7302,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED mtr-tiny + G_AGI mtr-tiny fi @@ -7325,7 +7310,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED nload + G_AGI nload fi @@ -7333,7 +7318,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED tcpdump + G_AGI tcpdump fi @@ -7341,7 +7326,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED openssh-client + G_AGI openssh-client fi @@ -7353,7 +7338,7 @@ _EOF_ #Remove Information file rm /mnt/samba/readme.txt &> /dev/null - AGI_ERROR_HANDLED smbclient cifs-utils --no-install-recommends + G_AGI smbclient cifs-utils --no-install-recommends fi @@ -7365,7 +7350,7 @@ _EOF_ #Remove information file rm /mnt/ftp_client/readme.txt &> /dev/null - AGI_ERROR_HANDLED curlftpfs + G_AGI curlftpfs fi @@ -7377,7 +7362,7 @@ _EOF_ #Remove information file rm /mnt/nfs_client/readme.txt &> /dev/null - AGI_ERROR_HANDLED nfs-common + G_AGI nfs-common fi @@ -7385,7 +7370,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED dropbear + G_AGI dropbear #set to start on next boot sed -i '/NO_START=1/c\NO_START=0' /etc/default/dropbear @@ -7396,7 +7381,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED openssh-server --no-install-recommends + G_AGI openssh-server --no-install-recommends # - Remove all references before adding the entry: https://github.com/Fourdee/DietPi/issues/604 @@ -7439,7 +7424,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED logrotate --no-install-recommends + G_AGI logrotate --no-install-recommends fi @@ -7447,7 +7432,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - AGI_ERROR_HANDLED rsyslog --no-install-recommends + G_AGI rsyslog --no-install-recommends fi @@ -7472,7 +7457,7 @@ _EOF_ #Everything else else - AGI_ERROR_HANDLED ffmpeg + G_AGI ffmpeg fi @@ -7486,7 +7471,7 @@ _EOF_ # - Raspbian if (( $G_HW_MODEL < 10 )); then - AGI_ERROR_HANDLED oracle-java8-jdk + G_AGI oracle-java8-jdk # - Debian. Add repo else @@ -7502,7 +7487,7 @@ _EOF_ # - Accept the license: https://github.com/Fourdee/DietPi/issues/298 debconf-set-selections <<< "oracle-java8-installer shared/accepted-oracle-license-v1-1 boolean true" - AGI_ERROR_HANDLED oracle-java8-installer + G_AGI oracle-java8-installer fi @@ -7535,13 +7520,13 @@ _EOF_ G_CHECK_URL "$INSTALL_URL_ADDRESS" # - Preqs - AGI_ERROR_HANDLED python python-dev + G_AGI python python-dev wget "$INSTALL_URL_ADDRESS" -O install.py python ./install.py rm install.py - AGI_ERROR_HANDLED python-pip python3-pip + G_AGI python-pip python3-pip fi @@ -7554,7 +7539,7 @@ _EOF_ INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/rpi/sdl2_rpi.7z' G_CHECK_URL "$INSTALL_URL_ADDRESS" - #AGI_ERROR_HANDLED libxss1 #if using SDL2+rpi5 + #G_AGI libxss1 #if using SDL2+rpi5 wget "$INSTALL_URL_ADDRESS" -O package.7z 7z x -y package.7z -osdl2_rpi @@ -7586,7 +7571,7 @@ _EOF_ G_AGUP - AGI_ERROR_HANDLED mono-runtime + G_AGI mono-runtime fi @@ -7609,15 +7594,15 @@ _EOF_ G_DIETPI-NOTIFY 2 "HA_PYTHON_VERSION: $HA_PYTHON_VERSION" # Install needed libraries - AGI_ERROR_HANDLED 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 + G_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 (( $G_DISTRO == 3 )); then - AGI_ERROR_HANDLED libmysqlclient-dev + G_AGI libmysqlclient-dev fi if (( $G_DISTRO >= 4 )); then - AGI_ERROR_HANDLED libmariadbclient-dev + G_AGI libmariadbclient-dev fi @@ -7657,6 +7642,9 @@ _EOF_ fi #------------------------------------------------------------------- + #Reset error handler (eg: for usermsg clear set in Banner_Installing) + G_ERROR_HANDLER_RESET + #------------------------------------------------------------------- } @@ -10981,7 +10969,7 @@ _EOF_ a2enmod rewrite #install scgi module - AGI_ERROR_HANDLED libapache2-mod-scgi + G_AGI libapache2-mod-scgi htpasswd -cb /etc/.rutorrent-htaccess root "$GLOBAL_PW" cat << _EOF_ > /var/www/rutorrent/.htaccess @@ -12633,19 +12621,23 @@ _EOF_ #NB: systemctl daemon-reload is executed after this func in Uninstall_Software_Finalize() + local index=$1 + #---------------------------------------------------------------------- #Inform User G_DIETPI-NOTIFY 3 DietPi-Software "Uninstall" + export G_ERROR_HANDLER_ONERROR_USERMSG="Failed to uninstall:\n - ${aSOFTWARE_WHIP_NAME[$index]}: ${aSOFTWARE_WHIP_DESC[$index]}." + echo -e "" - G_DIETPI-NOTIFY 0 "Uninstalling ${aSOFTWARE_WHIP_NAME[$1]}: ${aSOFTWARE_WHIP_DESC[$1]}\n" + G_DIETPI-NOTIFY 0 "Uninstalling ${aSOFTWARE_WHIP_NAME[$index]}: ${aSOFTWARE_WHIP_DESC[$index]}\n" #Was a uninstall event trigged? local valid_input=1 #---------------------------------------------------------------------- #DIETPI SOFTWARE - if (( $1 == 100 )); then + if (( $index == 100 )); then grasshopper_directory='/var/www' rm -R "$grasshopper_directory"/documentation @@ -12667,57 +12659,57 @@ _EOF_ update-rc.d grasshopper remove rm /etc/init.d/grasshopper - elif (( $1 == 23 )); then + elif (( $index == 23 )); then - AGP_ERROR_HANDLED lxde lxde-* upower policykit-1 iceweasel p7zip-full + G_AGP lxde lxde-* upower policykit-1 iceweasel p7zip-full - elif (( $1 == 24 )); then + elif (( $index == 24 )); then - AGP_ERROR_HANDLED mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full + G_AGP mate-desktop-environment-extras upower policykit-1 iceweasel p7zip-full - elif (( $1 == 26 )); then + elif (( $index == 26 )); then - AGP_ERROR_HANDLED x-window-system-core wmaker gnustep gnustep-devel gnustep-games upower policykit-1 iceweasel p7zip-full + G_AGP x-window-system-core wmaker gnustep gnustep-devel gnustep-games upower policykit-1 iceweasel p7zip-full - elif (( $1 == 25 )); then + elif (( $index == 25 )); then - AGP_ERROR_HANDLED xfce4 gnome-icon-theme tango-icon-theme iceweasel p7zip-full + G_AGP xfce4 gnome-icon-theme tango-icon-theme iceweasel p7zip-full - elif (( $1 == 22 )); then + elif (( $index == 22 )); then - AGP_ERROR_HANDLED quiterss + G_AGP quiterss - elif (( $1 == 30 )); then + elif (( $index == 30 )); then G_RUN_CMD dpkg -P nomachine - elif (( $1 == 29 )); then + elif (( $index == 29 )); then - AGP_ERROR_HANDLED xrdp + G_AGP xrdp - elif (( $1 == 44 )); then + elif (( $index == 44 )); then - AGP_ERROR_HANDLED transmission-daemon + G_AGP transmission-daemon rm /etc/init.d/transmission-daemon &> /dev/null rm /etc/systemd/system/transmission-daemon.service &> /dev/null - elif (( $1 == 83 )); then + elif (( $index == 83 )); then - AGP_ERROR_HANDLED apache2 + G_AGP apache2 - elif (( $1 == 85 )); then + elif (( $index == 85 )); then - AGP_ERROR_HANDLED nginx + G_AGP nginx - elif (( $1 == 84 )); then + elif (( $index == 84 )); then - AGP_ERROR_HANDLED lighttpd + G_AGP lighttpd - elif (( $1 == 86 || $1 == 88 )); then + elif (( $index == 86 || $index == 88 )); then - AGP_ERROR_HANDLED mysql-server mysql-client + G_AGP mysql-server mysql-client - AGP_ERROR_HANDLED mariadb-server mariadb-client + G_AGP mariadb-server mariadb-client # - custom confs rm /etc/mysql/conf.d/reduce_resources.cnf @@ -12729,36 +12721,36 @@ _EOF_ rm -R /var/lib/mysql rm -R "$G_FP_DIETPI_USERDATA"/mysql - elif (( $1 == 87 )); then + elif (( $index == 87 )); then - AGP_ERROR_HANDLED sqlite3 + G_AGP sqlite3 - elif (( $1 == 91 )); then + elif (( $index == 91 )); then - AGP_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-redis redis-server redis-tools + G_AGP "$PHP_APT_PACKAGE_NAME"-redis redis-server redis-tools - elif (( $1 == 89 )); then + elif (( $index == 89 )); then rm "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf rm "$FP_PHP_BASE_DIR"/mods-available/dietpi.ini 2> /dev/null - AGP_ERROR_HANDLED "$PHP_APT_PACKAGE_NAME"-* libapache2-mod-"$PHP_APT_PACKAGE_NAME" + G_AGP "$PHP_APT_PACKAGE_NAME"-* libapache2-mod-"$PHP_APT_PACKAGE_NAME" rm /var/www/phpinfo.php rm /var/www/apc.php rm /var/www/opcache.php # temp php uploads, if it was created rm -R /var/tmp/php_upload_tmp 2> /dev/null - elif (( $1 == 90 )); then + elif (( $index == 90 )); then - AGP_ERROR_HANDLED phpmyadmin + G_AGP phpmyadmin - elif (( $1 == 54 )); then + elif (( $index == 54 )); then systemctl start mysql mysqladmin -u root -p"$GLOBAL_PW" drop phpbb3 -f rm -R /var/www/phpBB3 - elif (( $1 == 47 )); then + elif (( $index == 47 )); then #ownCloud # Remove occ command binary rm /usr/local/bin/occ @@ -12777,13 +12769,13 @@ _EOF_ mysqldump --lock-tables "$mysql_auth" owncloud > "$G_FP_DIETPI_USERDATA"/owncloud_data/mysql_backup.sql mysqladmin "$mysql_auth" drop owncloud -f # Purge APT package - AGP_ERROR_HANDLED owncloud-files owncloud owncloud-deps + G_AGP owncloud-files owncloud owncloud-deps # Remove ownCloud installation folder rm -R /var/www/owncloud # Remove ownCloud repo rm /etc/apt/sources.list.d/owncloud.list 2> /dev/null - elif (( $1 == 114 )); then + elif (( $index == 114 )); then #Nextcloud # Remove occ command binary rm /usr/local/bin/ncc @@ -12804,30 +12796,30 @@ _EOF_ # Remove Nextcloud installation folder rm -R /var/www/nextcloud - elif (( $1 == 115 )); then + elif (( $index == 115 )); then G_RUN_CMD dpkg -P webmin - elif (( $1 == 32 )); then + elif (( $index == 32 )); then rm /usr/bin/ympd rm /etc/systemd/system/ympd.service - elif (( $1 == 128 )); then + elif (( $index == 128 )); then #apt-mark auto libavformat57 libupnp6 libao-common libao4 libasound2 libasound2-data libasyncns0 libaudiofile1 libavahi-client3 libavahi-common-data libavahi-common3 libavcodec56 libavformat56 libavresample2 libavutil54 libbinio1ldbl libcaca0 libcdio-cdda1 libcdio-paranoia1 libcdio13 libcups2 libcurl3-gnutls libdirectfb-1.2-9 libdnet libfaad2 libflac8 libfluidsynth1 libgme0 libgomp1 libgsm1 libice6 libid3tag0 libiso9660-8 libjack-jackd2-0 libjson-c2 libldb1 libmad0 libmikmod3 libmms0 libmodplug1 libmp3lame0 libmpcdec6 libmpg123-0 libnfs4 libntdb1 libogg0 libopenal-data libopenal1 libopenjpeg5 libopus0 liborc-0.4-0 libpulse0 libresid-builder0c2a libroar2 libsamplerate0 libschroedinger-1.0-0 libsdl1.2debian libshout3 libsidplay2 libsidutils0 libslp1 libsm6 libsmbclient libsndfile1 libsoxr0 libspeex1 libspeexdsp1 libsqlite3-0 libtalloc2 libtdb1 libtevent0 libtheora0 libupnp6 libva1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx1 libwavpack1 libwbclient0 libwildmidi-config libwildmidi1 libx11-6 libx11-data libx11-xcb1 libx264-142 libxau6 libxcb1 libxdmcp6 libxext6 libxi6 libxtst6 libxvidcore4 libyajl2 libzzip-0-13 mime-support python python-talloc python2.7 samba-libs x11-common file &> /dev/null apt-mark unhold mpd 1> /dev/null - (( $G_DISTRO == 3 && $G_HW_ARCH != 3 )) && AGP_ERROR_HANDLED mpd libmpdclient2 || G_RUN_CMD dpkg -P mpd libmpdclient2 + (( $G_DISTRO == 3 && $G_HW_ARCH != 3 )) && G_AGP mpd libmpdclient2 || G_RUN_CMD dpkg -P mpd libmpdclient2 userdel -f mpd &> /dev/null rm /lib/systemd/system/mpd.service rm -R "$G_FP_DIETPI_USERDATA"/.mpd_cache - elif (( $1 == 121 )); then + elif (( $index == 121 )); then rm /etc/systemd/system/roonbridge.service rm -R /etc/roonbridge - elif (( $1 == 122 )); then + elif (( $index == 122 )); then rm /etc/systemd/system/node-red.service rm "$HOME"/.node-red @@ -12835,58 +12827,58 @@ _EOF_ userdel -f nodered - elif (( $1 == 123 )); then + elif (( $index == 123 )); then #apt-mark auto libssl1.0.0 libwebsockets3 &> /dev/null - AGP_ERROR_HANDLED mosquitto + G_AGP mosquitto rm /etc/apt/sources.list.d/mosquitto-*.list - elif (( $1 == 124 )); then + elif (( $index == 124 )); then #apt-mark auto gcc-6-base libstdc++6 &> /dev/null G_RUN_CMD dpkg -P networkaudiod - elif (( $1 == 125 )); then + elif (( $index == 125 )); then - AGP_ERROR_HANDLED tomcat8 + G_AGP tomcat8 - elif (( $1 == 126 )); then + elif (( $index == 126 )); then - AGP_ERROR_HANDLED openmediavault + G_AGP openmediavault rm /etc/apt/sources.list.d/openmediavault.list - elif (( $1 == 129 )); then + elif (( $index == 129 )); then rm -R /var/www/ompd systemctl start mysql mysqladmin -u root -p"$GLOBAL_PW" drop ompd -f - elif (( $1 == 130 )); then + elif (( $index == 130 )); then - AGP_ERROR_HANDLED python-pip python3-pip + G_AGP python-pip python3-pip - elif (( $1 == 131 )); then + elif (( $index == 131 )); then rm /etc/systemd/system/blynkserver.service rm -R /etc/blynkserver - elif (( $1 == 132 )); then + elif (( $index == 132 )); then rm /etc/systemd/system/aria2.service rm /usr/local/bin/aria2c rm -R /var/www/aria2 - AGP_ERROR_HANDLED aria2 + G_AGP aria2 - elif (( $1 == 133 )); then + elif (( $index == 133 )); then rm /etc/systemd/system/yacy.service rm -R /etc/yacy - elif (( $1 == 134 )); then + elif (( $index == 134 )); then #apt-mark auto libjpeg8 libpng12-0 libfontconfig1 &> /dev/null @@ -12898,16 +12890,16 @@ _EOF_ rm "$HOME"/TonidoSync rm "$HOME"/TonidoSyncData - elif (( $1 == 135 )); then + elif (( $index == 135 )); then - AGP_ERROR_HANDLED darkice icecast2 + G_AGP darkice icecast2 rm /etc/systemd/system/darkice.service - elif (( $1 == 136 )); then + elif (( $index == 136 )); then #apt-mark auto v4l-utils python python-dev libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev libx264-142 libavcodec56 libavformat56 libmysqlclient18 libswscale3 libpq5 &> /dev/null - (( $G_DISTRO > 3 )) && AGP_ERROR_HANDLED motion || G_RUN_CMD dpkg -P motion + (( $G_DISTRO > 3 )) && G_AGP motion || G_RUN_CMD dpkg -P motion rm -R /etc/motioneye @@ -12915,9 +12907,9 @@ _EOF_ pip uninstall -y motioneye - elif (( $1 == 137 )); then + elif (( $index == 137 )); then - AGP_ERROR_HANDLED cloudprint-service + G_AGP cloudprint-service if (( $G_DISTRO == 3 )); then rm /etc/apt/sources.list.d/cloudprint.list @@ -12925,28 +12917,28 @@ _EOF_ fi - elif (( $1 == 138 )); then + elif (( $index == 138 )); then rm -R /etc/vhusbd rm /etc/systemd/system/virtualhere.service - elif (( $1 == 139 )); then + elif (( $index == 139 )); then rm -R /etc/sabnzbd rm /etc/systemd/system/sabnzbd.service - elif (( $1 == 140 )); then + elif (( $index == 140 )); then G_RUN_CMD dpkg -P libsdl2 libsdl2-image libsdl2-mixer libsdl2-net libsdl2-ttf libsmpeg2 - elif (( $1 == 141 )); then + elif (( $index == 141 )); then rm -R "$G_FP_DIETPI_USERDATA"/spotify-connect-web rm /etc/systemd/system/spotify-connect-web.service - elif (( $1 == 142 )); then + elif (( $index == 142 )); then rm -R /etc/couchpotato rm -R "$G_FP_DIETPI_USERDATA"/couchpotato @@ -12954,7 +12946,7 @@ _EOF_ #userdel -f couchpotato - elif (( $1 == 143 )); then + elif (( $index == 143 )); then systemctl start mysql mysqladmin -u root -p"$GLOBAL_PW" drop koel -f @@ -12963,156 +12955,156 @@ _EOF_ rm /etc/systemd/system/koel.service - elif (( $1 == 144 )); then + elif (( $index == 144 )); then - AGP_ERROR_HANDLED nzbdrone + G_AGP nzbdrone rm /etc/systemd/system/sonarr.service rm /etc/apt/sources.list.d/sonarr.list G_AGUP - elif (( $1 == 145 )); then + elif (( $index == 145 )); then rm -R /opt/Radarr rm /etc/systemd/system/radarr.service - elif (( $1 == 146 )); then + elif (( $index == 146 )); then rm -R /opt/plexpy rm -R "$G_FP_DIETPI_USERDATA"/plexpy rm /etc/systemd/system/plexpy.service - elif (( $1 == 147 )); then + elif (( $index == 147 )); then rm -R /opt/jackett rm /etc/systemd/system/jackett.service - elif (( $1 == 148 )); then + elif (( $index == 148 )); then - AGP_ERROR_HANDLED mediacenter22 + G_AGP mediacenter22 - elif (( $1 == 149 )); then + elif (( $index == 149 )); then rm -R "$G_FP_DIETPI_USERDATA"/nzbget rm /etc/systemd/system/nzbget.service - elif (( $1 == 155 )); then + elif (( $index == 155 )); then rm -R "$G_FP_DIETPI_USERDATA"/htpc-manager rm /etc/systemd/system/htpc-manager.service - elif (( $1 == 150 )); then + elif (( $index == 150 )); then - #AGP_ERROR_HANDLED mono-runtime #shared lib + #G_AGP mono-runtime #shared lib rm /etc/apt/sources.list.d/mono-xamarin.list G_AGUP - elif (( $1 == 151 )); then + elif (( $index == 151 )); then - AGP_ERROR_HANDLED nvidia-driver nvidia-xconfig libgl1-nvidia-glx:i386 + G_AGP nvidia-driver nvidia-xconfig libgl1-nvidia-glx:i386 - elif (( $1 == 152 )); then + elif (( $index == 152 )); then - AGP_ERROR_HANDLED avahi-daemon + G_AGP avahi-daemon - elif (( $1 == 153 )); then + elif (( $index == 153 )); then rm -R "$G_FP_DIETPI_USERDATA"/octoprint rm $(which octoprint) rm -R "$HOME"/.octoprint rm /etc/systemd/system/octoprint.service - elif (( $1 == 154 )); then + elif (( $index == 154 )); then rm -R "$G_FP_DIETPI_USERDATA"/roonserver rm /etc/systemd/system/roonserver.service - elif (( $1 == 156 )); then + elif (( $index == 156 )); then - AGP_ERROR_HANDLED steam + G_AGP steam rm -R "$HOME"/.steam rm -R "$G_FP_DIETPI_USERDATA"/steam - elif (( $1 == 119 )); then + elif (( $index == 119 )); then - AGP_ERROR_HANDLED cava + G_AGP cava rm "$HOME/.config/cava/config" rm "$HOME/cava.psf" - elif (( $1 == 118 )); then + elif (( $index == 118 )); then - AGP_ERROR_HANDLED mopidy + G_AGP mopidy rm /etc/apt/sources.list.d/mopidy.list pip uninstall -y Mopidy-MusicBox-Webclient Mopidy-Local-Images - elif (( $1 == 31 )); then + elif (( $index == 31 )); then - AGP_ERROR_HANDLED kodi + G_AGP kodi #+Odroids - AGP_ERROR_HANDLED kodi-odroid + G_AGP kodi-odroid rm /usr/share/applications/kodi.desktop rm ~/Desktop/kodi.desktop - elif (( $1 == 39 )); then + elif (( $index == 39 )); then - AGP_ERROR_HANDLED minidlna + G_AGP minidlna - elif (( $1 == 51 )); then + elif (( $index == 51 )); then - AGP_ERROR_HANDLED ibsdl1.2debian libsdl-net1.2 + G_AGP ibsdl1.2debian libsdl-net1.2 rm -R /usr/local/games/opentyrian rm /usr/share/applications/opentyrian.desktop rm ~/Desktop/opentyrian.desktop - elif (( $1 == 59 )); then + elif (( $index == 59 )); then - AGP_ERROR_HANDLED gpac + G_AGP gpac rm -R /var/www/dietpicam rm /opt/vc/bin/raspimjpeg rm /usr/bin/raspimjpeg rm /var/lib/dietpi/dietpi-software/services/raspimjpeg.service rm /etc/raspimjpeg - elif (( $1 == 45 )); then + elif (( $index == 45 )); then - AGP_ERROR_HANDLED deluged deluge-web deluge-webui deluge-console + G_AGP deluged deluge-web deluge-webui deluge-console rm /var/lib/dietpi/dietpi-software/services/deluge.service rm -R ~/.config/deluge - elif (( $1 == 94 )); then + elif (( $index == 94 )); then - AGP_ERROR_HANDLED proftpd-basic + G_AGP proftpd-basic - elif (( $1 == 96 )); then + elif (( $index == 96 )); then - AGP_ERROR_HANDLED samba samba-common-bin + G_AGP samba samba-common-bin - elif (( $1 == 95 )); then + elif (( $index == 95 )); then - AGP_ERROR_HANDLED vsftpd + G_AGP vsftpd - elif (( $1 == 109 )); then + elif (( $index == 109 )); then - AGP_ERROR_HANDLED nfs-kernel-server + G_AGP nfs-kernel-server - elif (( $1 == 67 )); then + elif (( $index == 67 )); then rm /usr/local/bin/noip2 rm /etc/systemd/system/noip2.service - elif (( $1 == 106 )); then + elif (( $index == 106 )); then rm -R /var/www/raspcontrol rm -R /etc/raspcontrol - elif (( $1 == 63 )); then + elif (( $index == 63 )); then rm -R /var/www/linuxdash - elif (( $1 == 93 )); then + elif (( $index == 93 )); then - AGP_ERROR_HANDLED dnsmasq + G_AGP dnsmasq pihole uninstall #https://github.com/Fourdee/DietPi/issues/753 @@ -13126,12 +13118,12 @@ _EOF_ rm /var/www/pihole rm /var/www/admin - elif (( $1 == 33 || $1 == 34 )); then + elif (( $index == 33 || $index == 34 )); then G_RUN_CMD dpkg -P subsonic rm -R /var/subsonic - elif (( $1 == 71 )); then + elif (( $index == 71 )); then update-rc.d webiopi remove rm -R /etc/webiopi @@ -13139,7 +13131,7 @@ _EOF_ rm /usr/bin/webiopi rm /etc/init.d/webiopi - elif (( $1 == 68 )); then + elif (( $index == 68 )); then # <= v150 (weaved) rm -R /etc/weaved @@ -13149,7 +13141,7 @@ _EOF_ # Remot3.it G_RUN_CMD dpkg -P weavedconnectd - elif (( $1 == 62 )); then + elif (( $index == 62 )); then #Kill systemctl stop dietpi-cloudshell @@ -13164,7 +13156,7 @@ _EOF_ #Remove alias sed -i '/dietpi-cloudshell=/d' /etc/bash.bashrc - elif (( $1 == 98 )); then + elif (( $index == 98 )); then update-rc.d haproxy remove rm /etc/init.d/haproxy @@ -13172,9 +13164,9 @@ _EOF_ rm -r /etc/haproxy #Shared dev libraries. Leave these installed - #AGP_ERROR_HANDLED libpcre3-dev libssl-dev + #G_AGP libpcre3-dev libssl-dev - elif (( $1 == 35 )); then + elif (( $index == 35 )); then #apt-mark auto libxml-parser-perl zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev &> /dev/null G_RUN_CMD dpkg -P logitechmediaserver @@ -13182,17 +13174,17 @@ _EOF_ rm -R /var/lib/squeezeboxserver rm -R /usr/share/squeezeboxserver - elif (( $1 == 55 )); then + elif (( $index == 55 )); then rm -R /var/www/wordpress - elif (( $1 == 27 || $1 == 28 || $1 == 120 )); then + elif (( $index == 27 || $index == 28 || $index == 120 )); then - AGP_ERROR_HANDLED tightvncserver - AGP_ERROR_HANDLED vnc4server - AGP_ERROR_HANDLED x11vnc - AGP_ERROR_HANDLED realvnc-vnc-server - AGP_ERROR_HANDLED tigervnc-* + G_AGP tightvncserver + G_AGP vnc4server + G_AGP x11vnc + G_AGP realvnc-vnc-server + G_AGP tigervnc-* rm /etc/systemd/system/vncserver.service rm /etc/init.d/vncserver @@ -13205,20 +13197,20 @@ _EOF_ systemctl disable vncserver-x11-serviced.service systemctl disable vncserver-virtuald.service - elif (( $1 == 73 )); then + elif (( $index == 73 )); then - AGP_ERROR_HANDLED fail2ban + G_AGP fail2ban - elif (( $1 == 64 )); then + elif (( $index == 64 )); then rm -R /var/www/phpsysinfo - elif (( $1 == 56 )); then + elif (( $index == 56 )); then rm /var/www/gallery/index.php rm -R /var/www/gallery/_sfpg_data - elif (( $1 == 40 )); then + elif (( $index == 40 )); then rm -R /var/www/ampache @@ -13226,46 +13218,46 @@ _EOF_ systemctl start mysql mysqladmin -u root -p"$GLOBAL_PW" drop ampache -f - elif (( $1 == 117 )); then + elif (( $index == 117 )); then rm /etc/apt/sources.list.d/swupdate.openvpn.net.list pivpn -u userdel -f pivpn - elif (( $1 == 97 )); then + elif (( $index == 97 )); then - AGP_ERROR_HANDLED openvpn + G_AGP openvpn rm -R /etc/openvpn &> /dev/null - elif (( $1 == 92 )); then + elif (( $index == 92 )); then if (( $G_DISTRO >= 4 )); then - AGP_ERROR_HANDLED python-certbot-apache python-certbot-nginx certbot + G_AGP python-certbot-apache python-certbot-nginx certbot fi rm -R /etc/letsencrypt_scripts &>/dev/null rm -R /etc/certbot_scripts &>/dev/null - elif (( $1 == 69 )); then + elif (( $index == 69 )); then - AGP_ERROR_HANDLED python-rpi.gpio python3-rpi.gpio + G_AGP python-rpi.gpio python3-rpi.gpio - elif (( $1 == 72 )); then + elif (( $index == 72 )); then - AGP_ERROR_HANDLED i2c-tools + G_AGP i2c-tools #Disable /DietPi/dietpi/func/dietpi-set_hardware i2c disable - elif (( $1 == 70 )); then + elif (( $index == 70 )); then rm -R /root/wiringPi* &> /dev/null - elif (( $1 == 60 )); then + elif (( $index == 60 )); then #apt-mark auto libssl1.0.0 &> /dev/null - AGP_ERROR_HANDLED hostapd isc-dhcp-server + G_AGP hostapd isc-dhcp-server rm /etc/dhcp/dhcpd.conf &> /dev/null rm /etc/hostapd/hostapd.conf &> /dev/null @@ -13301,14 +13293,14 @@ _EOF_ iptables -t nat -F iptables-save > /etc/iptables.ipv4.nat - elif (( $1 == 61 )); then + elif (( $index == 61 )); then - AGP_ERROR_HANDLED tor + G_AGP tor # - uninstall WIFIHOTSPOT ALSO. Due to IPtables needing reset. Uninstall_Software 60 - elif (( $1 == 37 )); then + elif (( $index == 37 )); then #apt-mark auto libssl1.0.0 openssl libsoxr0 libavahi-client3 libtool libconfig9 libpopt0 libdaemon0 &> /dev/null #No package is installed anymore, files are directly extracted into places, need to remove them manually? @@ -13317,9 +13309,9 @@ _EOF_ rm /lib/systemd/system/shairport-sync.service /usr/local/bin/shairport-sync /usr/local/etc/shairport-sync.conf* /usr/local/share/man/man7/shairport-sync.7.gz &> /dev/null userdel -f shairport-sync - elif (( $1 == 38 )); then + elif (( $index == 38 )); then - AGP_ERROR_HANDLED brutefir + G_AGP brutefir rm -R /etc/BruteFIR rm /var/lib/dietpi/dietpi-software/services/brutefir.service @@ -13328,7 +13320,7 @@ _EOF_ rm /etc/modules-load.d/brutefir-alsa-loopback.conf rm /etc/modprobe.d/brutefir-alsa-loopback.conf - elif (( $1 == 48 )); then + elif (( $index == 48 )); then rm -R /var/www/pydio @@ -13336,24 +13328,24 @@ _EOF_ systemctl start mysql mysqladmin -u root -p"$GLOBAL_PW" drop pydio -f - elif (( $1 == 36 )); then + elif (( $index == 36 )); then - AGP_ERROR_HANDLED squeezelite + G_AGP squeezelite rm -R /usr/bin/squeezelite* rm /etc/systemd/system/squeezelite.service - elif (( $1 == 99 )); then + elif (( $index == 99 )); then rm -R /etc/emonhub rm /etc/init.d/emonhub rm /etc/default/emonhub - elif (( $1 == 66 )); then + elif (( $index == 66 )); then G_RUN_CMD dpkg -P rpimonitor - elif (( $1 == 57 )); then + elif (( $index == 57 )); then rm -R /var/www/baikal @@ -13361,7 +13353,7 @@ _EOF_ systemctl start mysql mysqladmin -u root -p"$GLOBAL_PW" drop baikal -f - elif (( $1 == 65 )); then + elif (( $index == 65 )); then #apt-mark auto zlib1g-dev &> /dev/null @@ -13383,37 +13375,37 @@ _EOF_ rm -R /var/cache/netdata rm -R /var/log/netdata - elif (( $1 == 43 )); then + elif (( $index == 43 )); then - AGP_ERROR_HANDLED mumble-server + G_AGP mumble-server - elif (( $1 == 41 )); then + elif (( $index == 41 )); then - AGP_ERROR_HANDLED emby-server embymagick + G_AGP emby-server embymagick rm /etc/apt/sources.list.d/emby-server.list G_AGUP - elif (( $1 == 58 )); then + elif (( $index == 58 )); then rm -R /etc/openbazaar-server rm /etc/systemd/system/openbazaar.service - elif (( $1 == 42 )); then + elif (( $index == 42 )); then - (( $G_HW_ARCH == 10 )) && G_RUN_CMD dpkg -P plexmediaserver plexmediaserver-installer || AGP_ERROR_HANDLED plexmediaserver-installer + (( $G_HW_ARCH == 10 )) && G_RUN_CMD dpkg -P plexmediaserver plexmediaserver-installer || G_AGP plexmediaserver-installer rm -R /var/lib/plexmediaserver rm /etc/apt/sources.list.d/plex.list &> /dev/null G_AGUP - elif (( $1 == 52 )); then + elif (( $index == 52 )); then rm -R /etc/cuberite rm /etc/systemd/system/cuberite.service - elif (( $1 == 53 )); then + elif (( $index == 53 )); then rm -R "$USERDATA_DIRECTORY"/mineos rm -R /var/games/minecraft @@ -13425,7 +13417,7 @@ _EOF_ userdel -f mineos - elif (( $1 == 49 )); then + elif (( $index == 49 )); then rm -R /etc/gogs rm /etc/systemd/system/gogs.service @@ -13436,28 +13428,28 @@ _EOF_ systemctl start mysql mysqladmin -u root -p"$GLOBAL_PW" drop gogs -f - elif (( $1 == 46 )); then + elif (( $index == 46 )); then - AGP_ERROR_HANDLED qbittorrent-nox + G_AGP qbittorrent-nox rm /etc/systemd/system/qbittorrent.service rm -R "$HOME"/.config/qBittorrent - elif (( $1 == 50 )); then + elif (( $index == 50 )); then rm -R /etc/syncthing rm /usr/bin/syncthing &> /dev/null # DietPi v158 <= rm /etc/systemd/system/syncthing.service rm -R "$G_FP_DIETPI_USERDATA"/syncthing - elif (( $1 == 116 )); then + elif (( $index == 116 )); then rm /etc/systemd/system/sickrage.service rm -R /etc/sickrage - elif (( $1 == 107 )); then + elif (( $index == 107 )); then - AGP_ERROR_HANDLED rtorrent + G_AGP rtorrent rm -R /var/www/rutorrent rm "$HOME"/.rtorrent.rc rm /etc/systemd/system/rtorrent.service @@ -13475,7 +13467,7 @@ _EOF_ # apache2 rm /etc/apache2/sites-available/rutorrent.conf - elif (( $1 == 108 )); then + elif (( $index == 108 )); then rm -R /etc/amiberry rm /etc/systemd/system/amiberry.service @@ -13484,7 +13476,7 @@ _EOF_ #Disable autostart, revert boot index to console /DietPi/dietpi/dietpi-autostart 0 - elif (( $1 == 112 )); then + elif (( $index == 112 )); then rm "$G_FP_DIETPI_USERDATA"/dxx-rebirth/* rm -R "$G_FP_DIETPI_USERDATA"/dxx-rebirth/descent_1_game @@ -13497,7 +13489,7 @@ _EOF_ rm "$HOME"/Desktop/dxx-rebirth.desktop rm /usr/share/applications/dxx-rebirth.desktop - elif (( $1 == 113 )); then + elif (( $index == 113 )); then #apt-mark auto libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7 &> /dev/null apt-mark unhold chromium chromedriver @@ -13505,9 +13497,9 @@ _EOF_ rm /etc/chromium.d/custom_flags rm "$HOME"/.chromium-browser.init - (( $G_DISTRO >=4 )) && AGP_ERROR_HANDLED chromium* || G_RUN_CMD dpkg -P chromium chromedriver + (( $G_DISTRO >=4 )) && G_AGP chromium* || G_RUN_CMD dpkg -P chromium chromedriver - elif (( $1 == 157)); then + elif (( $index == 157)); then # Remove installationof HA. rm -R /srv/homeassistant @@ -13519,7 +13511,7 @@ _EOF_ # Remove the service. rm /etc/systemd/system/home-assistant.service - elif (( $1 == 165 )); then + elif (( $index == 165 )); then # Delete systemd files rm /etc/systemd/system/gitea.service @@ -13533,34 +13525,34 @@ _EOF_ mysqladmin -u root -p"$GLOBAL_PW" drop gitea -f systemctl stop mysql - elif (( $1 == 166 )); then + elif (( $index == 166 )); then rm /etc/systemd/system/pi-spc.service rm -R /var/lib/dietpi/dietpi-software/installed/pi-spc - elif (( $1 == 167 )); then + elif (( $index == 167 )); then - AGP_ERROR_HANDLED raspotify + G_AGP raspotify rm /etc/apt/sources.list.d/raspotify.list G_AGUP - elif (( $1 == 168 )); then + elif (( $index == 168 )); then echo -e "pending" - elif (( $1 == 169 )); then + elif (( $index == 169 )); then rm -R "$G_FP_DIETPI_USERDATA"/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 == 170 )); then + elif (( $index == 170 )); then Reset_NTPD - AGP_ERROR_HANDLED ntp + G_AGP ntp - elif (( $1 == 158 )); then + elif (( $index == 158 )); then # Remove service systemctl stop minio.service @@ -13574,7 +13566,7 @@ _EOF_ # Remove userdel userdel -r -f minio-user - elif (( $1 == 161 )); then + elif (( $index == 161 )); then /etc/init.d/bdd stop sleep 2 @@ -13588,14 +13580,14 @@ _EOF_ userdel -r bd - elif (( $1 == 162 )); then + elif (( $index == 162 )); then if (( $G_HW_ARCH == 10 )); then # remove docker and all its unused dependencies - x86_64 package name is different - AGP_ERROR_HANDLED docker-ce + G_AGP docker-ce else # remove docker and all its unused dependencies - ARM package name - AGP_ERROR_HANDLED docker-engine + G_AGP docker-engine fi # delete data files - dietpi @@ -13603,7 +13595,7 @@ _EOF_ # remove default unused folder rm -r /var/lib/docker - elif (( $1 == 164 )); then + elif (( $index == 164 )); then # Remove Service file rm /etc/systemd/system/nukkit.service @@ -13611,13 +13603,13 @@ _EOF_ # remove nukkit java file/folder rm -r /usr/local/bin/nukkit - elif (( $1 == 163 )); then + elif (( $index == 163 )); then #apt-mark auto libupnp6 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-alsa &> /dev/null G_RUN_CMD dpkg -P gmrender rm /etc/systemd/system/gmrender.service - elif (( $1 == 159 || $1 == 160 )); then + elif (( $index == 159 || $index == 160 )); then rm -R /var/www/allo systemctl start mysql @@ -13628,65 +13620,65 @@ _EOF_ #---------------------------------------------------------------------- #LINUX SOFTWARE - elif (( $1 == 15 )); then + elif (( $index == 15 )); then - AGP_ERROR_HANDLED tcpdump + G_AGP tcpdump - elif (( $1 == 14 )); then + elif (( $index == 14 )); then - AGP_ERROR_HANDLED nload + G_AGP nload - elif (( $1 == 13 )); then + elif (( $index == 13 )); then - AGP_ERROR_HANDLED mtr-tiny + G_AGP mtr-tiny - elif (( $1 == 11 )); then + elif (( $index == 11 )); then - AGP_ERROR_HANDLED iptraf + G_AGP iptraf - elif (( $1 == 10 )); then + elif (( $index == 10 )); then - AGP_ERROR_HANDLED iftop + G_AGP iftop - elif (( $1 == 19 )); then + elif (( $index == 19 )); then - AGP_ERROR_HANDLED jed + G_AGP jed - elif (( $1 == 3 )); then + elif (( $index == 3 )); then - AGP_ERROR_HANDLED mc + G_AGP mc - elif (( $1 == 18 )); then + elif (( $index == 18 )); then - AGP_ERROR_HANDLED emacs + G_AGP emacs - elif (( $1 == 20 || $i == 21 )); then + elif (( $index == 20 || $i == 21 )); then - AGP_ERROR_HANDLED vim vim-tiny + G_AGP vim vim-tiny - elif (( $1 == 127 )); then + elif (( $index == 127 )); then - AGP_ERROR_HANDLED neovim + G_AGP neovim - elif (( $1 == 0 )); then + elif (( $index == 0 )); then #This also removes OpenSSH server. So lets check OpenSSH server isnt installed before hand. if (( $(dpkg -l | grep -ci -m1 'openssh-server') == 0 )); then - AGP_ERROR_HANDLED openssh-client + G_AGP openssh-client fi - elif (( $1 == 1 )); then + elif (( $index == 1 )); then umount -f /mnt/samba - AGP_ERROR_HANDLED smbclient + G_AGP smbclient #Disable in fstab sed -i '/\/mnt\/samba/c\#\/mnt\/samba . Please use dietpi-config and the Networking Options: NAS menu to setup this mount' /etc/fstab #Add info file for installation method. echo -e "Samba client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking Options: NAS/Misc menu" > /mnt/samba/readme.txt - elif (( $1 == 111 )); then + elif (( $index == 111 )); then G_RUN_CMD dpkg -P urbackup-server @@ -13699,14 +13691,14 @@ _EOF_ rm /usr/bin/urbackupsrv rm -R /usr/share/urbackup - elif (( $1 == 110 )); then + elif (( $index == 110 )); then umount -f /mnt/nfs_client #nfs-kernel-server depends on nfs-common if (( ${aSOFTWARE_INSTALL_STATE[109]} == 0 )); then - AGP_ERROR_HANDLED nfs-common + G_AGP nfs-common fi @@ -13716,31 +13708,31 @@ _EOF_ #Add info file for installation method. echo -e "NFS client can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking Options: NAS/Misc menu" > /mnt/nfs_client/readme.txt - elif (( $1 == 16 )); then + elif (( $index == 16 )); then - AGP_ERROR_HANDLED build-essential + G_AGP build-essential - elif (( $1 == 17 )); then + elif (( $index == 17 )); then - AGP_ERROR_HANDLED git + G_AGP git - elif (( $1 == 5 )); then + elif (( $index == 5 )); then - AGP_ERROR_HANDLED alsa-utils + G_AGP alsa-utils #DietPi-JustBoom, remove bash alias for config panel: sed -i '/dietpi-justboom/d' /etc/bash.bashrc &> /dev/null - elif (( $1 == 6 )); then + elif (( $index == 6 )); then #apt-mark auto aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump* xf86-video-fbturbo* firmware-samsung xf86-video-armsoc-odroid malit628-odroid &> /dev/null - AGP_ERROR_HANDLED xcompmgr xterm xinit xauth xserver-xorg dbus-x11 xfonts-base x11-xserver-utils x11-common x11-utils + G_AGP xcompmgr xterm xinit xauth xserver-xorg dbus-x11 xfonts-base x11-xserver-utils x11-common x11-utils rm /etc/xdg/autostart/xcompmgr.desktop /etc/X11/xorg.conf &> /dev/null - elif (( $1 == 2 )); then + elif (( $index == 2 )); then umount -f /mnt/ftp_client - AGP_ERROR_HANDLED curlftpfs + G_AGP curlftpfs #Disable in fstab sed -i '/\/mnt\/ftp_client/c\#\/mnt\/ftp_client . Please use dietpi-config and the Networking Options: NAS menu to setup this mount' /etc/fstab @@ -13748,45 +13740,45 @@ _EOF_ #Add info file for installation method. echo -e "FTP client mount can be installed and setup by DietPi-Config.\nSimply run: dietpi-config and select the Networking Options: NAS/Misc menu" > /mnt/ftp_client/readme.txt - elif (( $1 == 7 )); then + elif (( $index == 7 )); then - AGP_ERROR_HANDLED ffmpeg + G_AGP ffmpeg # + RPi, use dpkg -P as packages were installed via dpkg -i and APT can produce error/terminate dietpi-software: # https://github.com/Fourdee/DietPi/issues/1352#issuecomment-354552622 (( $G_HW_MODEL < 10 )) && G_RUN_CMD dpkg -P libx264 libmp3lame libfdk-aac - elif (( $1 == 8 )); then + elif (( $index == 8 )); then - AGP_ERROR_HANDLED oracle-java8-* + G_AGP oracle-java8-* rm /etc/apt/sources.list.d/webupd8team-java.list G_AGUP - elif (( $1 == 104 )); then + elif (( $index == 104 )); then - AGP_ERROR_HANDLED dropbear* #stretch | dropbear-initramfs dropbear-run + G_AGP dropbear* #stretch | dropbear-initramfs dropbear-run - elif (( $1 == 105 )); then + elif (( $index == 105 )); then - AGP_ERROR_HANDLED openssh-* + G_AGP openssh-* # This also clears Openssh-client aSOFTWARE_INSTALL_STATE[0]=0 - elif (( $1 == 103 )); then + elif (( $index == 103 )); then sed -i '/\/var\/log/c\#\/var\/log DietPi Ramlog Disabled' /etc/fstab - elif (( $1 == 101 )); then + elif (( $index == 101 )); then - AGP_ERROR_HANDLED logrotate + G_AGP logrotate - elif (( $1 == 102 )); then + elif (( $index == 102 )); then - AGP_ERROR_HANDLED rsyslog + G_AGP rsyslog - elif (( $1 == 9 )); then + elif (( $index == 9 )); then - AGP_ERROR_HANDLED nodejs + G_AGP nodejs # - old install via repo if [ -f /etc/apt/sources.list.d/nodesource_nodejs.list ]; then @@ -13798,13 +13790,13 @@ _EOF_ rm /usr/local/bin/node - elif (( $1 == 4 )); then + elif (( $index == 4 )); then - AGP_ERROR_HANDLED vifm + G_AGP vifm else - G_DIETPI-NOTIFY 2 "Software index $1 is unknown, or, has no removal code." + G_DIETPI-NOTIFY 2 "Software index $index is unknown, or, has no removal code." valid_input=0 fi @@ -13817,10 +13809,15 @@ _EOF_ fi - echo -e "$1 | $(date)" >> /DietPi/dietpi/.uninstalled + echo -e "$index | $(date)" >> /DietPi/dietpi/.uninstalled #Update array installed state - aSOFTWARE_INSTALL_STATE[$1]=0 + aSOFTWARE_INSTALL_STATE[$index]=0 + + #---------------------------------------------------------------------- + #Reset error handler (eg: for usermsg clear) + G_ERROR_HANDLER_RESET + #---------------------------------------------------------------------- } @@ -13938,9 +13935,6 @@ _EOF_ /DietPi/dietpi/dietpi-services stop Install_Dietpi_Software - #Reset error user message (set in Banner_Installing). It is reset after G_ERROR_HANDLER, however, the error handler may not of been used and the msg will remain. - export G_ERROR_HANDLER_ONERROR_USERMSG='' - #Apply Uninstall script created by DietPi choice system Uninstall_NonSelected_Choices @@ -15826,7 +15820,7 @@ _EOF_ G_DIETPI-NOTIFY 3 DietPi-Software "Install software" - export G_ERROR_HANDLER_ONERROR_USERMSG="Failed to Install\n - ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}." + export G_ERROR_HANDLER_ONERROR_USERMSG="Failed to Install:\n - ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}." echo -e " ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}" @@ -15836,7 +15830,7 @@ _EOF_ G_DIETPI-NOTIFY 3 DietPi-Software "Configuring software" - export G_ERROR_HANDLER_ONERROR_USERMSG="Failed to Configure\n - ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}." + export G_ERROR_HANDLER_ONERROR_USERMSG="Failed to configure:\n - ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}." echo -e " ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}" @@ -15870,18 +15864,6 @@ _EOF_ G_DIETPI-NOTIFY 2 "Applying DietPi optimizations and configurations for $G_HW_MODEL_DESCRIPTION" G_DIETPI-NOTIFY 2 "Please wait...\n" - #List software due for configuration - # for ((i=0; i<$TOTAL_SOFTWARE_INDEXS; i++)) - # do - - # if (( ${aSOFTWARE_INSTALL_STATE[$i]} == 1 )); then - - # G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}" - - # fi - - # done - } Banner_Aborted(){ From 19f0b8dc0fa4be029b8cfbfea7f4e61670bc71c7 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 3 Jan 2018 11:42:02 +0000 Subject: [PATCH 200/390] v6.0 + Set version codes to -1 of current: https://github.com/Fourdee/DietPi/issues/1285 --- CHANGELOG.txt | 3 ++- PREP_SYSTEM_FOR_DIETPI.sh | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 3fa3f1f5a2..96769a6e00 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -14,6 +14,7 @@ General | wget: Now set to prefer IPv4 by default (generally faster): https://gi General | APT: Now set to force IPv4 by default (generally faster): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 General | SparkySBC: CPU gov default changed to Performance, reports of increased stability. General | Swapfile generation is now completed during 1st run of dietpi-software (previously boot stage): https://github.com/Fourdee/DietPi/issues/1270#issue-278797206 +General | DietPi-Funtime: Removed from DietPi. Although it looked pretty, it did absolutely nothing (except slow down a program) DietPi-Automation | All dietpi.txt entries have been renamed and cleaned up. DietPi-Boot | Improved the method of initial FS_partition and FS_expansion during 1st run, via systemD services. 'fs_force_resize=' in dietpi.txt is no longer supported: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352159930 DietPi-Banner | IP: Will now also list the active network adapter used (eg: eth0/wlan0) @@ -42,7 +43,7 @@ DietPi-Software | Mosquitto (Stretch): Resolved issue with failed install, due t DietPi-Software | ownCloud/Nextcloud: Fixed an installation issue on Jessie with MariaDB: https://github.com/Fourdee/DietPi/pull/1319 DietPi-Software | Google AIY: Updated install to gitbranch=voicekit. Many thanks to @mpember for the heads up: https://github.com/Fourdee/DietPi/issues/1065#issuecomment-354304388 DietPi-Update | dietpi.txt is now checked for missing entries, and, will now be patched during the update: https://github.com/Fourdee/DietPi/issues/1292#issuecomment-350818969 -Sparky SBC | Kernel patch will be applied which resolves issues with HQPlayer playback: https://www.computeraudiophile.com/forums/topic/32132-allo-sparky-usbridge/?do=findComment&comment=753100 +Sparky SBC | Kernel updated, which resolves issues with HQPlayer playback: https://www.computeraudiophile.com/forums/topic/32132-allo-sparky-usbridge/?do=findComment&comment=753100 Allo Web Interface v4: Sparky SBC: Matrix Audio X-SPDIF 2, native DSD is now added to kernel, many thanks @sudeep: https://github.com/sparkysbc/Linux/pull/3 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 331f9a920a..6313af799a 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1180,10 +1180,6 @@ _EOF_ rm /DietPi/dietpi/.??* - G_DIETPI-NOTIFY 2 'Storing current image version /etc/.dietpi_image_version' - - echo -e "$IMAGE_VERSION" > /etc/.dietpi_image_version - G_DIETPI-NOTIFY 2 'Setting DietPi-Autostart to console' echo 0 > /DietPi/dietpi/.dietpi-autostart_index @@ -1302,6 +1298,21 @@ _EOF_ # systemctl status dietpi-fs_partition_resize.service -l # cat /var/tmp/dietpi/logs/fs_partition_resize.log + G_DIETPI-NOTIFY 2 'Storing DietPi version ID' + + G_RUN_CMD wget https://raw.githubusercontent.com/Fourdee/DietPi/$GIT_BRANCH/dietpi/.version -O /DietPi/dietpi/.version + + # reduce sub_version by 1, allows us to create image, prior to release and patch if needed. + CORE_VERSION=$(sed -n 1p /DietPi/dietpi/.version) + SUB_VERSION=$(sed -n 2p /DietPi/dietpi/.version) + ((SUB_VERSION--)) + cat << _EOF_ > /DietPi/dietpi/.version +$CORE_VERSION +$SUB_VERSION +_EOF_ + + G_RUN_CMD cp /DietPi/dietpi/.version /var/lib/dietpi/.dietpi_image_version + G_DIETPI-NOTIFY 2 'Sync changes to disk and TRIM rootFS. Please wait, this may take some time...' G_RUN_CMD systemctl stop dietpi-ramlog From 533afb4ed8f4e32d1e02ba12254854eb14907824 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 3 Jan 2018 14:53:23 +0100 Subject: [PATCH 201/390] v6.0 + DietPi-Software | Nextcloud: Add Lighttpd config to uninstall --- dietpi/dietpi-software | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index da687a9bec..6348f73a61 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -12785,6 +12785,8 @@ _EOF_ 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 + lighttpd-disable-mod dietpi-nextcloud 2>/dev/null + rm /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf 2>/dev/null # Drop MySQL/MariaDB user and database systemctl start mysql local mysql_auth='-uroot' From e30395b13df518a954874218209aa8a625f5efe6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 3 Jan 2018 14:57:56 +0100 Subject: [PATCH 202/390] v6.0 + DietPi-Software | Nextcloud: Add Lighttpd OPcache fix to changelog --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 96769a6e00..efde3967e0 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -25,6 +25,7 @@ DietPi-Set_Hardware | Sparky SBC: enable aotg.aotg1_speed compatibility setting DietPi-Software | NAA Daemon: Updated to latest (3.5.2-36). Existing installs will be patched automatically: https://github.com/Fourdee/DietPi/issues/1305 DietPi-Software | PHP-FPM: Increased from "$CPU_CORES_TOTAL" to "pm.max_children = $(( $CPU_CORES_TOTAL * 3 ))". This should avoid failed forking of PHP-FPM processes/requests : https://github.com/Fourdee/DietPi/issues/1298 DietPi-Software | ownCloud/Nextcloud: Added option to choose data directory via dietpi.txt pre installation: https://github.com/Fourdee/DietPi/issues/1314#issuecomment-352782055 +DietPi-Software | Nextcloud: Resolve OPcache admin panel warnings on Lighttpd DietPi-Software | UrBackup: Installation updated to latest version 2.1.20. For new installations only: https://github.com/Fourdee/DietPi/issues/1335 DietPi-Software | NodeRed: Corrected user which nodered runs under, now runs as its own user, created during install: https://github.com/Fourdee/DietPi/issues/1294#issuecomment-354314318 From 6dfd2397298fc779f33fb99d80ca9fe6d749b4d4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 3 Jan 2018 15:00:53 +0100 Subject: [PATCH 203/390] v6.0 + DietPi-Software | ownCloud/Nextcloud: Add pretty URLs on Apache to changelog --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index efde3967e0..0d8f16553a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -25,6 +25,7 @@ DietPi-Set_Hardware | Sparky SBC: enable aotg.aotg1_speed compatibility setting DietPi-Software | NAA Daemon: Updated to latest (3.5.2-36). Existing installs will be patched automatically: https://github.com/Fourdee/DietPi/issues/1305 DietPi-Software | PHP-FPM: Increased from "$CPU_CORES_TOTAL" to "pm.max_children = $(( $CPU_CORES_TOTAL * 3 ))". This should avoid failed forking of PHP-FPM processes/requests : https://github.com/Fourdee/DietPi/issues/1298 DietPi-Software | ownCloud/Nextcloud: Added option to choose data directory via dietpi.txt pre installation: https://github.com/Fourdee/DietPi/issues/1314#issuecomment-352782055 +DietPi-Software | ownCloud/Nextcloud: Switch to pretty URLs (without "index.php") on Apache DietPi-Software | Nextcloud: Resolve OPcache admin panel warnings on Lighttpd DietPi-Software | UrBackup: Installation updated to latest version 2.1.20. For new installations only: https://github.com/Fourdee/DietPi/issues/1335 DietPi-Software | NodeRed: Corrected user which nodered runs under, now runs as its own user, created during install: https://github.com/Fourdee/DietPi/issues/1294#issuecomment-354314318 From d39706dfd8f5650c283f9f8c535dae6196ba4af7 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 4 Jan 2018 08:06:58 +0000 Subject: [PATCH 204/390] v6.0 + Check existing DietPi system via ramdisk service: https://github.com/Fourdee/DietPi/issues/1285 + Overwrite during extract --- PREP_SYSTEM_FOR_DIETPI.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 6313af799a..1f55d982b1 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -192,7 +192,7 @@ G_DIETPI-NOTIFY 0 'Step 0: Detecting existing DietPi system:' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ - if [ -f /DietPi/dietpi/.installed ]; then + if (( $(systemctl is-active dietpi-ramdisk | grep -ci -m1 'active') )); then G_DIETPI-NOTIFY 2 'DietPi system found, running pre-prep' @@ -705,7 +705,7 @@ _EOF_ G_DIETPI-NOTIFY 2 "Extracting DietPi sourcecode" - G_RUN_CMD unzip package.zip + G_RUN_CMD unzip -o package.zip rm package.zip From 4f9dc14dd0302517e57fc158d7ca324695f98f93 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 5 Jan 2018 12:29:47 +0000 Subject: [PATCH 205/390] v6.0 + Testing locale gen at start: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-355537143 --- PREP_SYSTEM_FOR_DIETPI.sh | 54 ++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 1f55d982b1..a55f1facb9 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -8,14 +8,11 @@ # - Active eth0 connection #------------------------------------------------------------------------------------------------ - #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. - LANG=en_GB.UTF-8 - #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 cd "$HOME" #------------------------------------------------------------------------------------------------ - # Critical checks with exit, prior to initial run of script + # Critical checks and pre-reqs, with exit, prior to initial run of script #------------------------------------------------------------------------------------------------ #Exit path for non-root logins. if (( $UID != 0 )); then @@ -25,24 +22,26 @@ fi - #Check for minimal APT Pre-Reqs + # - APT force IPv4 + echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99-dietpi-force-ipv4 + + #Check/install minimal APT Pre-Reqs a_MIN_APT_PREREQS=( 'wget' 'ca-certificates' 'sudo' + 'locale' ) - # - APT force IPv4 - echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99-dietpi-force-ipv4 - + apt-get clean + apt-get update for (( i=0; i<${#a_MIN_APT_PREREQS[@]}; i++)) do if (( ! $(dpkg --get-selections | grep -ci -m1 "^${a_MIN_APT_PREREQS[$i]}[[:space:]]") )); then - #attempt to install it: apt-get install -y ${a_MIN_APT_PREREQS[$i]} if (( $? != 0 )); then @@ -64,6 +63,27 @@ sed -i '/^[[:blank:]#;]*prefer-family =/c\prefer-family = IPv4' /etc/wgetrc || echo 'prefer-family = IPv4' >> /etc/wgetrc + #Setup locale + echo 'en_GB.UTF-8 UTF-8' > /etc/locale.gen + dpkg-reconfigure -f noninteractive locales; echo $? + if (( $? != 0 )); then + + echo -e 'Error: locale generation failed, aborting.' + exit 1 + + fi + #locale-gen + #update-locale + + # - Pump default locale into sys env: https://github.com/Fourdee/DietPi/issues/825 + cat << _EOF_ > /etc/environment +LC_ALL=en_GB.UTF-8 +LANG=en_GB.UTF-8 +_EOF_ + + #Force en_GB Locale for rest of script. Prevents incorrect parsing with non-english locales. + LANG=en_GB.UTF-8 + #------------------------------------------------------------------------------------------------ #Globals #------------------------------------------------------------------------------------------------ @@ -961,21 +981,9 @@ _EOF_ dpkg-reconfigure -f noninteractive keyboard-configuration #Keyboard must be plugged in for this to work! - G_DIETPI-NOTIFY 2 "Configuring regional settings (Locale):" + #G_DIETPI-NOTIFY 2 "Configuring regional settings (Locale):" - echo 'en_GB.UTF-8 UTF-8' > /etc/locale.gen - G_RUN_CMD dpkg-reconfigure -f noninteractive locales # en_GB.UTF-8 as only installed locale - #locale-gen - #update-locale - - # - Pump default locale into sys env: https://github.com/Fourdee/DietPi/issues/825 - export G_ERROR_HANDLER_COMMAND='/etc/environment' - cat << _EOF_ > $G_ERROR_HANDLER_COMMAND -LC_ALL=en_GB.UTF-8 -LANG=en_GB.UTF-8 -_EOF_ - export G_ERROR_HANDLER_EXITCODE=$? - G_ERROR_HANDLER + #Runs at start of script #G_HW_ARCH specific G_DIETPI-NOTIFY 2 "Applying G_HW_ARCH specific tweaks:" From 2eae65bce396c0b514d6e8484c21d656fe9323ac Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 5 Jan 2018 12:30:18 +0000 Subject: [PATCH 206/390] v6.0 User error. --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index a55f1facb9..a66cdbf206 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -65,7 +65,7 @@ #Setup locale echo 'en_GB.UTF-8 UTF-8' > /etc/locale.gen - dpkg-reconfigure -f noninteractive locales; echo $? + dpkg-reconfigure -f noninteractive locales if (( $? != 0 )); then echo -e 'Error: locale generation failed, aborting.' From 4561b2a1317c7ec0cb7eddb6e40ec1654b45bc49 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 5 Jan 2018 12:32:33 +0000 Subject: [PATCH 207/390] v6.0 User error. --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index a66cdbf206..851db784b9 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -31,7 +31,7 @@ 'wget' 'ca-certificates' 'sudo' - 'locale' + 'locales' ) From 0b8378c51ff2271931806a9d5286ef7fbb60d036 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 5 Jan 2018 12:35:58 +0000 Subject: [PATCH 208/390] v6.0 - Already exists, no need to re-download. --- PREP_SYSTEM_FOR_DIETPI.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 851db784b9..d4276cf951 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1308,8 +1308,6 @@ _EOF_ G_DIETPI-NOTIFY 2 'Storing DietPi version ID' - G_RUN_CMD wget https://raw.githubusercontent.com/Fourdee/DietPi/$GIT_BRANCH/dietpi/.version -O /DietPi/dietpi/.version - # reduce sub_version by 1, allows us to create image, prior to release and patch if needed. CORE_VERSION=$(sed -n 1p /DietPi/dietpi/.version) SUB_VERSION=$(sed -n 2p /DietPi/dietpi/.version) From 57db54b62045eeede99ac6424d961de12c3e209e Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 5 Jan 2018 12:49:50 +0000 Subject: [PATCH 209/390] Revert "v6.0" This reverts commit 0b8378c51ff2271931806a9d5286ef7fbb60d036. --- PREP_SYSTEM_FOR_DIETPI.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index d4276cf951..851db784b9 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1308,6 +1308,8 @@ _EOF_ G_DIETPI-NOTIFY 2 'Storing DietPi version ID' + G_RUN_CMD wget https://raw.githubusercontent.com/Fourdee/DietPi/$GIT_BRANCH/dietpi/.version -O /DietPi/dietpi/.version + # reduce sub_version by 1, allows us to create image, prior to release and patch if needed. CORE_VERSION=$(sed -n 1p /DietPi/dietpi/.version) SUB_VERSION=$(sed -n 2p /DietPi/dietpi/.version) From f90c43bbf83159aa4d791f55092af615c429d901 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 5 Jan 2018 14:56:23 +0100 Subject: [PATCH 210/390] v6.0 DietPi-Prep: + Solve HTTPS related APT messages, if initial system was Jessie or lower. + Possibly solve "Method https has died" issue: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-354602656 --- PREP_SYSTEM_FOR_DIETPI.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 851db784b9..31150278e3 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -17,7 +17,7 @@ #Exit path for non-root logins. if (( $UID != 0 )); then - echo -e 'Error: Root privileges required. Please run the command with "sudo"\n' + echo -e 'Error: Root privileges required. Please run the command with "sudo"\nIn case install the "sudo" package with root privileges: #apt-get install sudo\n' exit 1 fi @@ -30,7 +30,6 @@ 'wget' 'ca-certificates' - 'sudo' 'locales' ) @@ -45,7 +44,7 @@ apt-get install -y ${a_MIN_APT_PREREQS[$i]} if (( $? != 0 )); then - echo -e "Error: Unable to install ${a_MIN_APT_PREREQS[$i]}, please install it manually with\n - apt-get install -y ${a_MIN_APT_PREREQS[$i]}" + echo -e "Error: Unable to install ${a_MIN_APT_PREREQS[$i]}, please try to install it manually with\n - apt-get install -y ${a_MIN_APT_PREREQS[$i]}" exit 1 fi @@ -68,7 +67,7 @@ dpkg-reconfigure -f noninteractive locales if (( $? != 0 )); then - echo -e 'Error: locale generation failed, aborting.' + echo -e 'Error: Locale generation failed. Aborting...\n' exit 1 fi @@ -429,12 +428,12 @@ deb https://deb.debian.org/debian/ $DISTRO_TARGET_NAME-backports main contrib no _EOF_ # Jessie, switch to http: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 - if (( $DISTRO_TARGET == 3 )); then + if (( $DISTRO < 4 )); then sed -i 's/https/http/g' /etc/apt/sources.list # Buster, remove backports: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 - elif (( $DISTRO_TARGET == 5 )); then + elif (( $DISTRO_TARGET > 4 )); then sed -i '/backports/d' /etc/apt/sources.list @@ -662,6 +661,13 @@ _EOF_ # - Distro is now target (for APT purposes and G_AGX support due to installed binary, its here, instead of after G_AGUP) G_DISTRO=$DISTRO_TARGET G_DISTRO_NAME=$DISTRO_TARGET_NAME + + # Enable HTTPS for Debian ATP repo, after system was dist-upgraded to Stretch+ + if (( $DISTRO > 3 && $G_HW_MODEL > 9 )); then + + sed -i 's/http:/https:/g' /etc/apt/sources.list + + fi G_DIETPI-NOTIFY 2 "Disabling swapfile generation for dphys-swapfile during install" From 84198500ca652876bda3b8399b11e863990a7105 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 5 Jan 2018 14:44:32 +0000 Subject: [PATCH 211/390] v6.0 + fix; https://github.com/Fourdee/DietPi/issues/1285#issuecomment-355550635 --- PREP_SYSTEM_FOR_DIETPI.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 851db784b9..ec4912fe2e 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -32,6 +32,7 @@ 'ca-certificates' 'sudo' 'locales' + 'apt-transport-https' ) @@ -270,7 +271,7 @@ _EOF_ #------------------------------------------------------------------------------------------------ WHIP_TITLE='Hardware selection:' - WHIP_DESC='Please select the current device this is being installed on:' + WHIP_DESC='Please select the current device DietPi is being installed on:' WHIP_DEFAULT_ITEM=0 WHIP_MENU_ARRAY=( From d105cb8d1fecb45bfdf240c32aff1817db7467dd Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 5 Jan 2018 15:43:48 +0000 Subject: [PATCH 212/390] Revert "v6.0" This reverts commit 84198500ca652876bda3b8399b11e863990a7105. --- PREP_SYSTEM_FOR_DIETPI.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index ec4912fe2e..851db784b9 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -32,7 +32,6 @@ 'ca-certificates' 'sudo' 'locales' - 'apt-transport-https' ) @@ -271,7 +270,7 @@ _EOF_ #------------------------------------------------------------------------------------------------ WHIP_TITLE='Hardware selection:' - WHIP_DESC='Please select the current device DietPi is being installed on:' + WHIP_DESC='Please select the current device this is being installed on:' WHIP_DEFAULT_ITEM=0 WHIP_MENU_ARRAY=( From 90d22bc1bce0887691cda731351b2d75e4ce7006 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 5 Jan 2018 19:13:57 +0100 Subject: [PATCH 213/390] v6.0 + Fix G_DISTRO var --- PREP_SYSTEM_FOR_DIETPI.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 31150278e3..e09d849c26 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -428,7 +428,7 @@ deb https://deb.debian.org/debian/ $DISTRO_TARGET_NAME-backports main contrib no _EOF_ # Jessie, switch to http: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 - if (( $DISTRO < 4 )); then + if (( $G_DISTRO < 4 )); then sed -i 's/https/http/g' /etc/apt/sources.list @@ -663,7 +663,7 @@ _EOF_ G_DISTRO_NAME=$DISTRO_TARGET_NAME # Enable HTTPS for Debian ATP repo, after system was dist-upgraded to Stretch+ - if (( $DISTRO > 3 && $G_HW_MODEL > 9 )); then + if (( $G_DISTRO > 3 && $G_HW_MODEL > 9 )); then sed -i 's/http:/https:/g' /etc/apt/sources.list From 4ddd058fe3dce1b01741672471d12a5c672ad5f5 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 6 Jan 2018 09:59:11 +0000 Subject: [PATCH 214/390] v6.0 + disable discard and fstrim in preference of stability: https://github.com/Fourdee/DietPi/issues/1285 https://github.com/Fourdee/DietPi/pull/1373#issuecomment-355736098 --- PREP_SYSTEM_FOR_DIETPI.sh | 12 ++++++------ dietpi/dietpi-drive_manager | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index e09d849c26..c8dd644b6a 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -661,12 +661,12 @@ _EOF_ # - Distro is now target (for APT purposes and G_AGX support due to installed binary, its here, instead of after G_AGUP) G_DISTRO=$DISTRO_TARGET G_DISTRO_NAME=$DISTRO_TARGET_NAME - - # Enable HTTPS for Debian ATP repo, after system was dist-upgraded to Stretch+ + + # Enable HTTPS for Debian ATP repo, after system was dist-upgraded to Stretch+ if (( $G_DISTRO > 3 && $G_HW_MODEL > 9 )); then sed -i 's/http:/https:/g' /etc/apt/sources.list - + fi G_DIETPI-NOTIFY 2 "Disabling swapfile generation for dphys-swapfile during install" @@ -1327,14 +1327,14 @@ _EOF_ G_RUN_CMD cp /DietPi/dietpi/.version /var/lib/dietpi/.dietpi_image_version - G_DIETPI-NOTIFY 2 'Sync changes to disk and TRIM rootFS. Please wait, this may take some time...' + G_DIETPI-NOTIFY 2 'Sync changes to disk. Please wait, this may take some time...' G_RUN_CMD systemctl stop dietpi-ramlog G_RUN_CMD systemctl stop dietpi-ramdisk sync - fstrim -v / - sync + # fstrim -v / + # sync G_DIETPI-NOTIFY 2 'Please check and delete all non-required folders in /root/.xxxxxx' G_DIETPI-NOTIFY 2 'Please delete outdated modules' diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 46029deab4..25af34e53e 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -217,7 +217,7 @@ sed -i "\@^${aDRIVE_MOUNT_SOURCE[$i]}[[:space:]]@d" "$FP_TEMP_FSTAB" sed -i "\@^UUID=${aDRIVE_UUID[$i]}[[:space:]]@d" "$FP_TEMP_FSTAB" - local mount_options='defaults,noatime,nofail,discard' + local mount_options='defaults,noatime,nofail' # Disable x-systemd.automount for RootFS, breaks FS_partition if [ "${aDRIVE_MOUNT_TARGET[$i]}" != '/' ]; then @@ -511,7 +511,7 @@ sed -i "\@${aDRIVE_MOUNT_TARGET[$INDEX_DRIVE_BEING_EDITED]}[[:space:]]@d" /etc/fstab # Add new rootfs entry - sed -i "\@[[:space:]]/[[:space:]]@c UUID=${aDRIVE_UUID[$INDEX_DRIVE_BEING_EDITED]} / auto defaults,noatime,discard 0 1" /etc/fstab + sed -i "\@[[:space:]]/[[:space:]]@c UUID=${aDRIVE_UUID[$INDEX_DRIVE_BEING_EDITED]} / auto defaults,noatime 0 1" /etc/fstab # - install rsync if (( ! $(dpkg --get-selections | grep -ci -m1 '^rsync[[[:space:]]') )); then From eb01d56ce280b9d7ed64fe9d6bf6ab6cb5d0d3f6 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 6 Jan 2018 11:47:32 +0000 Subject: [PATCH 215/390] v6.0 + Recreate EFI GRUB: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-355738427 --- PREP_SYSTEM_FOR_DIETPI.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index c8dd644b6a..95118669fe 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -665,7 +665,7 @@ _EOF_ # Enable HTTPS for Debian ATP repo, after system was dist-upgraded to Stretch+ if (( $G_DISTRO > 3 && $G_HW_MODEL > 9 )); then - sed -i 's/http:/https:/g' /etc/apt/sources.list + sed -i 's/http:/https:/g' /etc/apt/sources.list fi @@ -1327,6 +1327,15 @@ _EOF_ G_RUN_CMD cp /DietPi/dietpi/.version /var/lib/dietpi/.dietpi_image_version + # - Native PC/EFI + if [ -d /boot/efi ]; then + + G_DIETPI-NOTIFY 2 'Recreating GRUB-EFI' + + G_RUN_CMD grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck + + fi + G_DIETPI-NOTIFY 2 'Sync changes to disk. Please wait, this may take some time...' G_RUN_CMD systemctl stop dietpi-ramlog From e375e1ea818aecdfb69cb94dbf004e5f349346b0 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 6 Jan 2018 12:20:46 +0000 Subject: [PATCH 216/390] v6.0 + Load globals before setting values. --- PREP_SYSTEM_FOR_DIETPI.sh | 46 +++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 95118669fe..2640c133a4 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -86,7 +86,27 @@ _EOF_ #------------------------------------------------------------------------------------------------ #Globals #------------------------------------------------------------------------------------------------ - #System + #Download DietPi-Globals + # - NB: we'll have to manually handle errors, until script is sucessfully loaded + wget https://raw.githubusercontent.com/Fourdee/DietPi/$GIT_BRANCH/dietpi/func/dietpi-globals -O dietpi-globals + if (( $? != 0 )); then + + echo -e 'Error: Unable to download dietpi-globals. Aborting...\n' + exit 1 + + fi + + # - load + chmod +x dietpi-globals + . ./dietpi-globals + if (( $? != 0 )); then + + echo -e 'Error: Unable to load dietpi-globals. Aborting...\n' + exit 1 + + fi + + export G_PROGRAM_NAME='DietPi-PREP_SYSTEM_FOR_DIETPI' export G_DISTRO=0 # Export to dietpi-globals export G_DISTRO_NAME='NULL' # Export to dietpi-globals DISTRO_TARGET=0 @@ -144,27 +164,6 @@ _EOF_ fi - #Download DietPi-Globals - # - NB: we'll have to manually handle errors, until script is sucessfully loaded - wget https://raw.githubusercontent.com/Fourdee/DietPi/$GIT_BRANCH/dietpi/func/dietpi-globals -O dietpi-globals - if (( $? != 0 )); then - - echo -e 'Error: Unable to download dietpi-globals. Aborting...\n' - exit 1 - - fi - - # - load - chmod +x dietpi-globals - . ./dietpi-globals - if (( $? != 0 )); then - - echo -e 'Error: Unable to load dietpi-globals. Aborting...\n' - exit 1 - - fi - export G_PROGRAM_NAME='DietPi-PREP_SYSTEM_FOR_DIETPI' - #URL connection test var holder INTERNET_ADDRESS='' @@ -430,7 +429,8 @@ _EOF_ # Jessie, switch to http: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 if (( $G_DISTRO < 4 )); then - sed -i 's/https/http/g' /etc/apt/sources.list + sed -i 's/https:/http:/g' /etc/apt/sources.list + #sed -i 's/https:/http:/g' /etc/apt/sources.list.d/* # Buster, remove backports: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 elif (( $DISTRO_TARGET > 4 )); then From 71999efb4a848193ee69ac8c069d1518cf692299 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 6 Jan 2018 12:58:37 +0000 Subject: [PATCH 217/390] v6.0 + Testing: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-355738427 --- PREP_SYSTEM_FOR_DIETPI.sh | 13 ++++++------- dietpi/func/dietpi-globals | 1 - 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 2640c133a4..bd19695ac0 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -662,13 +662,6 @@ _EOF_ G_DISTRO=$DISTRO_TARGET G_DISTRO_NAME=$DISTRO_TARGET_NAME - # Enable HTTPS for Debian ATP repo, after system was dist-upgraded to Stretch+ - if (( $G_DISTRO > 3 && $G_HW_MODEL > 9 )); then - - sed -i 's/http:/https:/g' /etc/apt/sources.list - - fi - G_DIETPI-NOTIFY 2 "Disabling swapfile generation for dphys-swapfile during install" G_RUN_CMD echo -e "CONF_SWAPSIZE=0" > /etc/dphys-swapfile @@ -715,6 +708,12 @@ _EOF_ G_AGA + # Enable HTTPS for Debian ATP repo, after system was dist-upgraded to Stretch+ + if (( $G_DISTRO > 3 && $G_HW_MODEL > 9 )); then + + sed -i 's/http:/https:/g' /etc/apt/sources.list + + fi #------------------------------------------------------------------------------------------------ echo -e '' diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index b58733b585..643b81f4aa 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -519,7 +519,6 @@ $print_logfile_info G_HW_CPU_CORES=${G_HW_CPU_CORES:-1} G_HW_CPUID=${G_HW_CPUID:-0} - # If already init, use existing value. G_DISTRO=${G_DISTRO:-0} G_DISTRO_NAME=${G_DISTRO_NAME:-NULL} From 44e78d6b6c304c229e23dc63ab1d3b614608dc3f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 6 Jan 2018 18:42:34 +0100 Subject: [PATCH 218/390] v6.0 + Move bash.bashrc adjustments into dietpi-globals. + Create animation for processing messages. --- dietpi/func/dietpi-globals | 139 ++++++++++++++++++++++++++++++------- 1 file changed, 114 insertions(+), 25 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 643b81f4aa..89ca0859f3 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -37,6 +37,63 @@ # - G_ERROR_HANDLER whiptail display G_USER_INPUTS=1 + # - DietPi Scripts, moved from /etc/bash.bashrc + alias sudo='sudo ' # https://github.com/Fourdee/DietPi/issues/424 + alias dietpi-process_tool='/DietPi/dietpi/dietpi-process_tool' + alias dietpi-letsencrypt='/DietPi/dietpi/dietpi-letsencrypt' + alias dietpi-autostart='/DietPi/dietpi/dietpi-autostart' + alias dietpi-cron='/DietPi/dietpi/dietpi-cron' + alias dietpi-launcher='/DietPi/dietpi/dietpi-launcher' + alias dietpi-cleaner='/DietPi/dietpi/dietpi-cleaner' + alias dietpi-morsecode='/DietPi/dietpi/dietpi-morsecode' + alias dietpi-sync='/DietPi/dietpi/dietpi-sync' + alias dietpi-backup='/DietPi/dietpi/dietpi-backup' + alias dietpi-bugreport='/DietPi/dietpi/dietpi-bugreport' + alias dietpi-services='/DietPi/dietpi/dietpi-services' + alias dietpi-config='/DietPi/dietpi/dietpi-config' + alias dietpi-software='/DietPi/dietpi/dietpi-software' + alias dietpi-update='/DietPi/dietpi/dietpi-update' + alias dietpi-drive_manager='/DietPi/dietpi/dietpi-drive_manager' + alias emulationstation='/opt/retropie/supplementary/emulationstation/emulationstation' + alias opentyrian='/usr/local/games/opentyrian/run' + + alias cpu='/DietPi/dietpi/dietpi-cpuinfo' + alias dietpi-logclear='/DietPi/dietpi/dietpi-logclear' + + #alias occ='sudo -u www-data php /var/www/owncloud/occ' + #alias ncc='sudo -u www-data php /var/www/nextcloud/occ' + + # - Treesize + treesize() + { + du -k --max-depth=1 | sort -nr | awk ' + BEGIN { + split("KB,MB,GB,TB", Units, ","); + } + { + u = 1; + while ($1 >= 1024) + { + $1 = $1 / 1024; + u += 1; + } + $1 = sprintf("%.1f %s", $1, Units[u]); + print $0; + } + ' + } + + # Wrappers to stop Print_Process_Animation: + echo(){ + [ -f /var/run/dietpi-process.pid ] && kill $( /var/run/dietpi-process.pid ) + fi #Status Ok #$@ = txt desc @@ -177,15 +256,25 @@ #$3 = txt mode elif (( $1 == 3 )); then - echo -e "\033[K\n \e[38;5;154m$2\e[0m" + echo -e "\n \e[38;5;154m$2\e[0m" echo -e "$header_line" - echo -e " \e[90mMode:\e[0m$(Print_Input_String 2)\n" + echo -e " \e[90mMode: \e[0m$(Print_Input_String 2)\n" Print_Process - echo -ne " \e[90mPlease wait...\e[0m\r" + echo -ne "\e[90mPlease wait...\e[0m" + if [ ! -f /var/run/dietpi-process.pid ]; then + ( Print_Process_Animation & builtin echo $! > /var/run/dietpi-process.pid ) + fi fi #----------------------------------------------------------------------------------- unset ainput_string + # Unset also internal functions, otherwise they are accessible from terminal. + unset Print_Process_Animation + unset Print_Ok + unset Print_Failed + unset Print_Info + unset Print_Process + unset Print_Input_String #----------------------------------------------------------------------------------- } @@ -449,7 +538,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="$@" - G_DIETPI-NOTIFY -2 "Running command: $G_ERROR_HANDLER_COMMAND, please wait..." + G_DIETPI-NOTIFY -2 "Running command: $G_ERROR_HANDLER_COMMAND" $G_ERROR_HANDLER_COMMAND &> /tmp/G_ERROR_HANDLER_COMMAND G_ERROR_HANDLER_EXITCODE=$? @@ -468,7 +557,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="$@" G_ERROR_HANDLER_EXITCODE=0 - G_DIETPI-NOTIFY -2 "Checking file/folder exists: $G_ERROR_HANDLER_COMMAND" + G_DIETPI-NOTIFY -2 "Checking for existance: $G_ERROR_HANDLER_COMMAND" local string='' @@ -769,7 +858,7 @@ $print_logfile_info G_AGF(){ G_ERROR_HANDLER_EXITCODE=0 - G_ERROR_HANDLER_COMMAND="G_AGF:" + G_ERROR_HANDLER_COMMAND="G_AGF" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" G_DIETPI-NOTIFY -2 "APT fix" @@ -788,7 +877,7 @@ $print_logfile_info G_AGUP(){ G_ERROR_HANDLER_EXITCODE=0 - G_ERROR_HANDLER_COMMAND="G_AGUP:" + G_ERROR_HANDLER_COMMAND="G_AGUP" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" G_DIETPI-NOTIFY -2 "APT update" @@ -807,7 +896,7 @@ $print_logfile_info G_AGUG(){ G_ERROR_HANDLER_EXITCODE=0 - G_ERROR_HANDLER_COMMAND="G_AGUG:" + G_ERROR_HANDLER_COMMAND="G_AGUG" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" G_DIETPI-NOTIFY -2 "APT upgrade" @@ -826,7 +915,7 @@ $print_logfile_info G_AGDUG(){ G_ERROR_HANDLER_EXITCODE=0 - G_ERROR_HANDLER_COMMAND="G_AGDUG:" + G_ERROR_HANDLER_COMMAND="G_AGDUG" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" if (( $G_DISTRO >= 4 )); then From 98c27ac7e211c44f96dc1413f71c92e6ded4a040 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 6 Jan 2018 18:48:52 +0100 Subject: [PATCH 219/390] v6.0 + Remove bash.bashrc adjustments from set_core_environment --- dietpi/func/dietpi-set_core_environment | 56 +------------------------ 1 file changed, 1 insertion(+), 55 deletions(-) diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index ebf237d577..b263adc47a 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -110,61 +110,7 @@ _EOF_ . /DietPi/dietpi/func/dietpi-globals _EOF_ - G_DIETPI-NOTIFY 2 "Configuring /etc/bash.bashrc:" - - sed -i '/#DietPi_Entries/,$d' /etc/bash.bashrc - sed -i '/LANG=/,$d' /etc/bash.bashrc # pre v160 images - cat << _EOF_ >> /etc/bash.bashrc -#DietPi_Entries -# - LANG -export \$(cat /etc/default/locale | grep LANG=) - -# - Define a default LD_LIBRARY_PATH for all systems -#export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/opt/vc/lib #Disabled due to https://github.com/Fourdee/DietPi/issues/1329#issuecomment-353586754 - -# - DietPi Scripts -alias sudo='sudo ' # https://github.com/Fourdee/DietPi/issues/424 -alias dietpi-process_tool='/DietPi/dietpi/dietpi-process_tool' -alias dietpi-letsencrypt='/DietPi/dietpi/dietpi-letsencrypt' -alias dietpi-autostart='/DietPi/dietpi/dietpi-autostart' -alias dietpi-cron='/DietPi/dietpi/dietpi-cron' -alias dietpi-launcher='/DietPi/dietpi/dietpi-launcher' -alias dietpi-cleaner='/DietPi/dietpi/dietpi-cleaner' -alias dietpi-morsecode='/DietPi/dietpi/dietpi-morsecode' -alias dietpi-sync='/DietPi/dietpi/dietpi-sync' -alias dietpi-backup='/DietPi/dietpi/dietpi-backup' -alias dietpi-bugreport='/DietPi/dietpi/dietpi-bugreport' -alias dietpi-services='/DietPi/dietpi/dietpi-services' -alias dietpi-config='/DietPi/dietpi/dietpi-config' -alias dietpi-software='/DietPi/dietpi/dietpi-software' -alias dietpi-update='/DietPi/dietpi/dietpi-update' -alias dietpi-drive_manager='/DietPi/dietpi/dietpi-drive_manager' -alias emulationstation='/opt/retropie/supplementary/emulationstation/emulationstation' -alias opentyrian='/usr/local/games/opentyrian/run' - -alias cpu='/DietPi/dietpi/dietpi-cpuinfo' -alias dietpi-logclear='/DietPi/dietpi/dietpi-logclear' - -# - Treesize -treesize() -{ - du -k --max-depth=1 | sort -nr | awk ' - BEGIN { - split("KB,MB,GB,TB", Units, ","); - } - { - u = 1; - while (\$1 >= 1024) - { - \$1 = \$1 / 1024; - u += 1; - } - \$1 = sprintf("%.1f %s", \$1, Units[u]); - print \$0; - } - ' -} -_EOF_ +# G_DIETPI-NOTIFY 2 "Configuring /etc/bash.bashrc:" # Moved into dietpi-globals #----------------------------------------------------------------------------------- #Create_DietPi_User From 6e0fce5be78bd2f759b52285d0369007c8998a19 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 6 Jan 2018 18:55:58 +0100 Subject: [PATCH 220/390] v6.0 + DietPi-Software | ownCloud/Nextcloud: Switch to occ/ncc alias --- dietpi/dietpi-software | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 6348f73a61..a1ba06f774 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8463,8 +8463,7 @@ _EOF_ fi # Add occ command shortcut: - echo -e '#!/bin/bash\nsudo -u www-data php /var/www/owncloud/occ $*' > /usr/local/bin/occ - chmod +x /usr/local/bin/occ + sed -i 's/#alias occ/alias occ/' /DietPi/dietpi/func/dietpi-globals # Adjusting config file: local config_php='/var/www/owncloud/config/config.php' @@ -8664,8 +8663,7 @@ _EOF_ fi # Add occ command shortcut, use 'ncc' as 'occ' is reserved for ownCloud: - echo -e '#!/bin/bash\nsudo -u www-data php /var/www/nextcloud/occ $*' > /usr/local/bin/ncc - chmod +x /usr/local/bin/ncc + sed -i 's/#alias ncc/alias ncc/' /DietPi/dietpi/func/dietpi-globals # Adjusting config file: local config_php='/var/www/nextcloud/config/config.php' @@ -12752,8 +12750,8 @@ _EOF_ elif (( $index == 47 )); then #ownCloud - # Remove occ command binary - rm /usr/local/bin/occ + # Remove occ command alias + sed -i 's/alias occ/#alias occ/' /DietPi/dietpi/func/dietpi-globals # Remove background cron job crontab -u www-data -l | grep -v '/var/www/owncloud/cron.php' | crontab -u www-data - # Disable and remove webservier configs @@ -12777,8 +12775,8 @@ _EOF_ elif (( $index == 114 )); then #Nextcloud - # Remove occ command binary - rm /usr/local/bin/ncc + # Remove occ command alias + sed -i 's/alias ncc/#alias ncc/' /DietPi/dietpi/func/dietpi-globals # Remove background cron job crontab -u www-data -l | grep -v '/var/www/nextcloud/cron.php' | crontab -u www-data - # Disable and remove webservier configs From 3dde4cfec088e989d8e1c73e859f9775b7a0a996 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 6 Jan 2018 19:01:25 +0100 Subject: [PATCH 221/390] v6.0 + Start ownCloud/Nextcloud maintenance:mode with G_RUN_CMD --- dietpi/dietpi-services | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index c4b98ec148..2c4307c93b 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -500,8 +500,8 @@ # Control ownCloud and Nextcloud maintenance mode: if [ "$INPUT_MODE" = "stop" ] || [ "$INPUT_MODE" = "restart" ]; then - grep -q "'maintenance' => false," /var/www/owncloud/config/config.php &>/dev/null && occ maintenance:mode --on 2> /dev/null - grep -q "'maintenance' => false," /var/www/nextcloud/config/config.php &>/dev/null && ncc maintenance:mode --on 2> /dev/null + grep -q "'maintenance' => false," /var/www/owncloud/config/config.php &> /dev/null && G_RUN_CMD occ maintenance:mode --on + grep -q "'maintenance' => false," /var/www/nextcloud/config/config.php &> /dev/null && G_RUN_CMD ncc maintenance:mode --on fi @@ -510,8 +510,8 @@ # Control ownCloud and Nextcloud maintenance mode: if [ "$INPUT_MODE" = "restart" ] || [ "$INPUT_MODE" = "start" ]; then - grep -q "'maintenance' => true," /var/www/owncloud/config/config.php &>/dev/null && occ maintenance:mode --off 2> /dev/null - grep -q "'maintenance' => true," /var/www/nextcloud/config/config.php &>/dev/null && ncc maintenance:mode --off 2> /dev/null + grep -q "'maintenance' => true," /var/www/owncloud/config/config.php &> /dev/null && G_RUN_CMD occ maintenance:mode --off + grep -q "'maintenance' => true," /var/www/nextcloud/config/config.php &> /dev/null && G_RUN_CMD ncc maintenance:mode --off fi From 35772d451631f49648691d0bb6cf01288a303328 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 6 Jan 2018 21:08:00 +0100 Subject: [PATCH 222/390] v6.0 + Fix missing line ending --- dietpi/func/dietpi-globals | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 89ca0859f3..51e5c8d6a0 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -85,13 +85,13 @@ # Wrappers to stop Print_Process_Animation: echo(){ - [ -f /var/run/dietpi-process.pid ] && kill $( Date: Sun, 7 Jan 2018 10:32:43 +0000 Subject: [PATCH 223/390] v6.0 + General | DietPi RPi kernel, now reverted to stock RPi kernel: https://github.com/Fourdee/DietPi/issues/1378 NB: Sparky kernel updated via manual patching. --- CHANGELOG.txt | 3 +- PREP_SYSTEM_FOR_DIETPI.sh | 10 --- dietpi/func/dietpi-set_hardware | 127 -------------------------------- 3 files changed, 1 insertion(+), 139 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0d8f16553a..baad357c2e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -7,6 +7,7 @@ The XMAS tree has now been taken down, stored away on github for next year. Hope Image Modifications: Changes / Improvements / Optimizations: +General | DietPi RPi kernel, now reverted to stock RPi kernel: https://github.com/Fourdee/DietPi/issues/1378 General | We have completed much needed backbone work for DietPi, which will allow for improved expansion in source code. This includes the use of dietpi-globals. DietPi-Globals | New script which optimizes most used DietPi commands and vars, throughout our scripts. Also exported to bash session, please type 'G_' then press 'TAB' to see a full list of options: https://github.com/Fourdee/DietPi/issues/1311 General | FHS compliance completed. /etc/dietpi has moved to /var/lib/dietpi. RAMlog store has moved to /var/tmp/dietpi: https://github.com/Fourdee/DietPi/issues/1297#issuecomment-352241193 @@ -222,8 +223,6 @@ New Image: Rock64 | Now available for beta testing: https://github.com/Fourdee/DietPi/issues/1102#issuecomment-325131437 Changes / Improvements / Optimizations: -General | RPi: Kernel updated to 4.9.40. Includes improved driver support for Allo Piano and DiGi One: https://github.com/raspberrypi/linux/pull/2149 -General | RT kernel for RPi is now available, can be installed with "/DietPi/dietpi/func/dietpi-set_hardware kernel dietpi_rpi_rt" General | Reworked the disabled modules for Sparky. Disables touchscreen and GPU modules (thanks @sudeep). General | Sparky Image updated to Stretch, includes kernel update for DSD256/512 support. DietPi-Config | Networking > WiFi: Added a feature which will monitor the Wifi connection and automatically reconnect, if the gateway is unavailable (eg: connection drop): https://github.com/Fourdee/DietPi/issues/1074 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index bd19695ac0..53e6bf0d1a 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1156,16 +1156,6 @@ _EOF_ #/DietPi/dietpi/func/dietpi-set_hardware preferipversion ipv4 #Already done at top of script, and now default in dietpi.txt - G_DIETPI-NOTIFY 2 'Configuring kernel' - - # - RPi install DietPi kernel by default - if (( $G_HW_MODEL < 10 )); then - - rm -R /lib/modules/* # Remove all modules from all kernels, ensures our kernel is installed. - /DietPi/dietpi/func/dietpi-set_hardware kernel dietpi_rpi_forced #forced, incase of kernel version match which would prevent install - - fi - G_DIETPI-NOTIFY 2 'Disabling soundcards by default' /DietPi/dietpi/func/dietpi-set_hardware soundcard none diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 1df48fcc82..5d6584e3e9 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -465,129 +465,6 @@ _EOF_ } - #///////////////////////////////////////////////////////////////////////////////////// - #Kernel - #///////////////////////////////////////////////////////////////////////////////////// - Kernel_Main(){ - - if [[ "$INPUT_DEVICE_VALUE" = "dietpi_rpi"* ]]; then - - local update_required=1 - local current_kernel='4.9.62-' - - #Avoid updating main kernel, if latest is already installed, and forced flag not used - if [[ "$INPUT_DEVICE_VALUE" != *"_forced"* ]] && - (( $(uname -r | grep -ci -m1 "$current_kernel") )); then - - update_required=0 - - fi - - # Default - local install_url_address='http://dietpi.com/downloads/binaries/rpi/dietpi_rpi_kernel_4.9.zip' - if [ "$INPUT_DEVICE_VALUE" = "dietpi_rpi_4.4" ]; then - - install_url_address='http://dietpi.com/downloads/binaries/rpi/dietpi_rpi_kernel_4.4.zip' - update_required=1 #Always update alternative kernel - - elif [ "$INPUT_DEVICE_VALUE" = "dietpi_rpi_rt" ]; then - - install_url_address='http://dietpi.com/downloads/binaries/rpi/dietpi_rpi_kernel_rt.zip' - update_required=1 #Always update alternative kernel - - fi - - if (( $update_required )); then - - G_CHECK_URL "$install_url_address" - - # Install - if (( $? == 0 )); then - - # - Prevent kernel/firmware/bootloader upgrades from Raspbian repo - apt-mark hold raspberrypi-bootloader raspberrypi-kernel - - wget "$install_url_address" -O package.zip - # Cleanup disabled: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298343932 - # rm -R /boot/overlays/* - # rm -R /lib/modules/* - # rm -R /lib/firmware/* - # rm /boot/*.img - - unzip -o package.zip -d / - if (( $? != 0 )); then - - G_DIETPI-NOTIFY 1 "Failed to extract $INPUT_DEVICE_NAME." - - fi - - rm package.zip - - else - - G_DIETPI-NOTIFY 1 "Failed to install $INPUT_DEVICE_NAME. $install_url_address may be offline or unreachable." - - fi - - else - - G_DIETPI-NOTIFY 2 "$INPUT_DEVICE_NAME: Currently running latest kernel, no updates required." - - fi - - elif [[ "$INPUT_DEVICE_VALUE" = "sparky_sbc"* ]]; then - - local install_url_address='http://dietpi.com/downloads/binaries/sparky/sparky_kernel.zip' - - # if [ "$INPUT_DEVICE_VALUE" = "sparky_sbc_rt" ]; then - - # install_url_address='http://dietpi.com/downloads/binaries/sparky/sparky_kernel_rt.zip' - - # fi - - G_CHECK_URL "$install_url_address" - if (( $? == 0 )); then - - wget "$install_url_address" -O package.zip - - unzip -o package.zip -d / - if (( $? != 0 )); then - - G_DIETPI-NOTIFY 1 "Failed to extract kernel $INPUT_DEVICE_NAME." - - fi - - rm package.zip - - fi - - elif [ "$INPUT_DEVICE_VALUE" = "nanopim3" ]; then - - local install_url_address='http://dietpi.com/downloads/binaries/nanopi/dietpi_m3_kernel.7z' - - G_CHECK_URL "$install_url_address" - - # Install - if (( $? == 0 )); then - - wget "$install_url_address" -O package.7z - 7z x -y package.7z -o/ - rm package.7z - - else - - G_DIETPI-NOTIFY 1 "Failed to install $INPUT_DEVICE_NAME. $install_url_address may be offline or unreachable." - - fi - - else - - Unknown_Input_Mode - - fi - - } - #///////////////////////////////////////////////////////////////////////////////////// #Ethernet force link speed #///////////////////////////////////////////////////////////////////////////////////// @@ -2356,10 +2233,6 @@ _EOF_ Eth_Force_Speed_Main - elif [ "$INPUT_DEVICE_NAME" = "kernel" ]; then - - Kernel_Main - elif [ "$INPUT_DEVICE_NAME" = "remoteir" ]; then RemoteIR_Main From b99849efb89a1fec2837ea6a5667b041b67e6bf7 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 7 Jan 2018 11:19:16 +0000 Subject: [PATCH 224/390] v6.0 + Fix inactive being detected: https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 53e6bf0d1a..69ed804f60 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -210,7 +210,7 @@ _EOF_ G_DIETPI-NOTIFY 0 'Step 0: Detecting existing DietPi system:' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ - if (( $(systemctl is-active dietpi-ramdisk | grep -ci -m1 'active') )); then + if (( $(systemctl is-active dietpi-ramdisk | grep -ci -m1 '^active') )); then G_DIETPI-NOTIFY 2 'DietPi system found, running pre-prep' From c1350b9685bb6f00f0a7302e2777439ecefb0fb7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 13:02:40 +0100 Subject: [PATCH 225/390] v6.0 + DietPi-Software | ownCloud/Nextcloud: Switch to file dependant occ alias --- dietpi/dietpi-software | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a1ba06f774..836797b662 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8462,8 +8462,8 @@ _EOF_ fi - # Add occ command shortcut: - sed -i 's/#alias occ/alias occ/' /DietPi/dietpi/func/dietpi-globals + # Add occ shortcut alias. Will be added by dietpi-globals afterwards: + alias occ='sudo -u www-data php /var/www/owncloud/occ' # Adjusting config file: local config_php='/var/www/owncloud/config/config.php' @@ -8662,8 +8662,8 @@ _EOF_ fi - # Add occ command shortcut, use 'ncc' as 'occ' is reserved for ownCloud: - sed -i 's/#alias ncc/alias ncc/' /DietPi/dietpi/func/dietpi-globals + # Add occ shortcut alias. Will be added by dietpi-globals afterwards. Use 'ncc' as 'occ' is reserved for ownCloud: + alias ncc='sudo -u www-data php /var/www/nextcloud/occ' # Adjusting config file: local config_php='/var/www/nextcloud/config/config.php' @@ -12750,8 +12750,6 @@ _EOF_ elif (( $index == 47 )); then #ownCloud - # Remove occ command alias - sed -i 's/alias occ/#alias occ/' /DietPi/dietpi/func/dietpi-globals # Remove background cron job crontab -u www-data -l | grep -v '/var/www/owncloud/cron.php' | crontab -u www-data - # Disable and remove webservier configs @@ -12775,8 +12773,6 @@ _EOF_ elif (( $index == 114 )); then #Nextcloud - # Remove occ command alias - sed -i 's/alias ncc/#alias ncc/' /DietPi/dietpi/func/dietpi-globals # Remove background cron job crontab -u www-data -l | grep -v '/var/www/nextcloud/cron.php' | crontab -u www-data - # Disable and remove webservier configs From 02221f9f83c53df2f30c955c3ba62d43c6cc9124 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 13:04:07 +0100 Subject: [PATCH 226/390] v6.0 + DietPi-Software | ownCloud/Nextcloud: Switch to file dependant occ alias --- dietpi/func/dietpi-globals | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 51e5c8d6a0..dbad698ee7 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -60,8 +60,8 @@ alias cpu='/DietPi/dietpi/dietpi-cpuinfo' alias dietpi-logclear='/DietPi/dietpi/dietpi-logclear' - #alias occ='sudo -u www-data php /var/www/owncloud/occ' - #alias ncc='sudo -u www-data php /var/www/nextcloud/occ' + [ -f /var/www/owncloud/occ ] && alias occ='sudo -u www-data php /var/www/owncloud/occ' + [ -f /var/www/nextcloud/occ ] && alias ncc='sudo -u www-data php /var/www/nextcloud/occ' # - Treesize treesize() From 04fa8c31d8ea1c2667a2a9d5be6abb2fccfce82c Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 7 Jan 2018 12:05:23 +0000 Subject: [PATCH 227/390] v6.0 + Testing fix for FS expansion: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-355759321 --- PREP_SYSTEM_FOR_DIETPI.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 69ed804f60..f93d9060d7 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1239,8 +1239,11 @@ _EOF_ #!/bin/bash systemctl disable dietpi-fs_partition_resize.service +systemctl enable dietpi-fs_expand.service systemctl daemon-reload +sync + TARGET_PARTITION=0 TARGET_DEV=\$(findmnt / -o source -n) @@ -1294,7 +1297,6 @@ StandardOutput=tty WantedBy=local-fs.target _EOF_ systemctl daemon-reload - G_RUN_CMD systemctl enable dietpi-fs_expand.service # #debug # systemctl start dietpi-fs_partition_resize.service From c08bb17458428a36e3028040e12b813fb991daa7 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 7 Jan 2018 12:14:28 +0000 Subject: [PATCH 228/390] v6.0 + tee not redirecting output to log. --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index f93d9060d7..38453982bb 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1290,7 +1290,7 @@ Before=dietpi-ramdisk.service [Service] Type=oneshot RemainAfterExit=no -ExecStart=/bin/bash -c "resize2fs \$(findmnt / -o source -n) | tee /var/tmp/dietpi/logs/fs_expand.log; systemctl disable dietpi-fs_expand.service; systemctl daemon-reload" +ExecStart=/bin/bash -c "resize2fs \$(findmnt / -o source -n) &> /var/tmp/dietpi/logs/fs_expand.log; systemctl disable dietpi-fs_expand.service; systemctl daemon-reload" StandardOutput=tty [Install] From 02827fd2a2f58c8341a143630375864d2c536343 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 7 Jan 2018 12:23:05 +0000 Subject: [PATCH 229/390] v6.0 + Pump locale into /etc/default/locale aswell: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-355759321 --- PREP_SYSTEM_FOR_DIETPI.sh | 7 ++++++- dietpi/dietpi-config | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 38453982bb..c9c86d21e5 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -72,12 +72,17 @@ fi #locale-gen - #update-locale # - Pump default locale into sys env: https://github.com/Fourdee/DietPi/issues/825 cat << _EOF_ > /etc/environment LC_ALL=en_GB.UTF-8 LANG=en_GB.UTF-8 +_EOF_ + + # - and default locale (jessie) + cat << _EOF_ > /etc/default/locale +LC_ALL=en_GB.UTF-8 +LANG=en_GB.UTF-8 _EOF_ #Force en_GB Locale for rest of script. Prevents incorrect parsing with non-english locales. diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index b5d871e46e..116e445eaf 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -2314,6 +2314,12 @@ cat << _EOF_ > /etc/environment LC_ALL=$locale_current LANG=$locale_current +_EOF_ + + # - and default locale (jessie/meveric) + cat << _EOF_ > /etc/default/locale +LC_ALL=$locale_current +LANG=$locale_current _EOF_ #Return to this menu From b21288184b329bd78e6e89789124abf361c19ed8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 13:23:50 +0100 Subject: [PATCH 230/390] v6.0 + DietPi-Software | OpenTyrian: Switch to conditional alias --- dietpi/dietpi-software | 1 + 1 file changed, 1 insertion(+) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 836797b662..b2926e9e1b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9483,6 +9483,7 @@ _EOF_ #Copy the DietPi run file for OpenTyrian cp /DietPi/dietpi/conf/opentyrian_run /usr/local/games/opentyrian/run chmod +x /usr/local/games/opentyrian/run + alias opentyrian='/usr/local/games/opentyrian/run' #Create .Desktop SymLinks mkdir -p "$HOME"/Desktop From d370137235bcb4fd03a15c691ac2cf0edc2d9da6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 13:27:23 +0100 Subject: [PATCH 231/390] v6.0 + DietPi-Software | OpenTyrian: Switch to conditional alias --- dietpi/func/dietpi-globals | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index dbad698ee7..52e445947f 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -55,11 +55,12 @@ alias dietpi-update='/DietPi/dietpi/dietpi-update' alias dietpi-drive_manager='/DietPi/dietpi/dietpi-drive_manager' alias emulationstation='/opt/retropie/supplementary/emulationstation/emulationstation' - alias opentyrian='/usr/local/games/opentyrian/run' alias cpu='/DietPi/dietpi/dietpi-cpuinfo' alias dietpi-logclear='/DietPi/dietpi/dietpi-logclear' + # - Optional DietPi software aliases + [ -f /usr/local/games/opentyrian/run ] && alias opentyrian='/usr/local/games/opentyrian/run' [ -f /var/www/owncloud/occ ] && alias occ='sudo -u www-data php /var/www/owncloud/occ' [ -f /var/www/nextcloud/occ ] && alias ncc='sudo -u www-data php /var/www/nextcloud/occ' From b93b8b1f08c7f3c5fc80ab5fe524eafa52e6101d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 14:12:54 +0100 Subject: [PATCH 232/390] v6.0 +Switch Prefer_IPversion() to new file name. --- dietpi/func/dietpi-set_hardware | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 1df48fcc82..a62a7e68f5 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1270,15 +1270,15 @@ _EOF_ if [ "$INPUT_DEVICE_VALUE" = "ipv4" ]; then - echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99force-ipv + echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99-dietpi-force-ipv4 elif [ "$INPUT_DEVICE_VALUE" = "ipv6" ]; then - echo 'Acquire::ForceIPv6 "true";' > /etc/apt/apt.conf.d/99force-ipv + echo 'Acquire::ForceIPv6 "true";' > /etc/apt/apt.conf.d/99-dietpi-force-ipv4 elif [ "$INPUT_DEVICE_VALUE" = "auto" ]; then - rm /etc/apt/apt.conf.d/99force-ipv &> /dev/null + rm /etc/apt/apt.conf.d/99-dietpi-force-ipv4 &> /dev/null else From 18f411292446c408843690e6644ee90e3e2fd30a Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 7 Jan 2018 13:40:24 +0000 Subject: [PATCH 233/390] v6.0 + after boot.mount fixes: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-355759321 + tee not reliable --- PREP_SYSTEM_FOR_DIETPI.sh | 5 ++++- dietpi/func/dietpi-set_core_environment | 12 ++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index c9c86d21e5..332f413205 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -34,6 +34,9 @@ ) + # - Meveric special: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-355759321 + rm /etc/apt/sources.list.d/deb-multimedia.list &> /dev/null + apt-get clean apt-get update for (( i=0; i<${#a_MIN_APT_PREREQS[@]}; i++)) @@ -79,7 +82,7 @@ LC_ALL=en_GB.UTF-8 LANG=en_GB.UTF-8 _EOF_ - # - and default locale (jessie) + # - and default locale (jessie/meveric) cat << _EOF_ > /etc/default/locale LC_ALL=en_GB.UTF-8 LANG=en_GB.UTF-8 diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index ebf237d577..935facc85d 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -231,13 +231,13 @@ _EOF_ [Unit] Description=DietPi-RAMdisk Before=rsyslog.service syslog.service -After=local-fs.target +After=local-fs.target boot.mount [Service] Type=forking RemainAfterExit=yes -ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramdisk 0 | tee -a /var/tmp/dietpi/logs/dietpi-ramdisk.log' -ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramdisk 1 | tee -a /var/tmp/dietpi/logs/dietpi-ramdisk.log' +ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramdisk 0 &>> /var/tmp/dietpi/logs/dietpi-ramdisk.log' +ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramdisk 1 &>> /var/tmp/dietpi/logs/dietpi-ramdisk.log' [Install] WantedBy=local-fs.target @@ -249,13 +249,13 @@ _EOF_ [Unit] Description=DietPi-RAMlog Before=rsyslog.service syslog.service -After=local-fs.target +After=local-fs.target boot.mount [Service] Type=forking RemainAfterExit=yes -ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramlog 0' -ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramlog 1' +ExecStart=/bin/bash -c '/boot/dietpi/dietpi-ramlog 0 &>> /var/tmp/dietpi/logs/dietpi-ramlog.log' +ExecStop=/bin/bash -c '/DietPi/dietpi/dietpi-ramlog 1 &>> /var/tmp/dietpi/logs/dietpi-ramlog.log' [Install] WantedBy=local-fs.target From 855010ab15866c001786f7879a28aa2df56fb606 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 7 Jan 2018 13:55:47 +0000 Subject: [PATCH 234/390] v6.0 + Install BT packages on demand: https://github.com/Fourdee/DietPi/issues/1285 + Cleanup of RPi BT control, will test. --- dietpi/func/dietpi-set_hardware | 71 ++++++--------------------------- 1 file changed, 12 insertions(+), 59 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 5d6584e3e9..9a4e2c75c8 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1033,13 +1033,7 @@ _EOF_ fi #bluetooth last - systemctl stop bluetooth 2> /dev/null - if (( $? != 0 && $(dpkg --get-selections | grep -ci -m1 '^bluetooth[[:space:]]') )); then - - G_DIETPI-NOTIFY 2 "Bluetooth service failed to stop" - EXIT_CODE=1 - - fi + G_RUN_CMD systemctl stop bluetooth systemctl disable bluetooth 2> /dev/null for ((i=$(( ${#aBLUETOOTH_MODULES[@]} - 1 )); i>=0; i--)) @@ -1053,6 +1047,14 @@ _EOF_ # - Enable elif [ "$INPUT_DEVICE_VALUE" = "enable" ]; then + #Pre-Reqs + G_AG_CHECK_INSTALL_PREREQ bluetooth bluez-firmware + if (( $G_HW_MODEL < 10 )); then + + G_AG_CHECK_INSTALL_PREREQ pi-bluetooth + + fi + #bluetooth first for ((i=0; i<${#aBLUETOOTH_MODULES[@]}; i++)) do @@ -1065,67 +1067,18 @@ _EOF_ if (( $G_HW_MODEL == 61 || $G_HW_MODEL == 62 )); then systemctl enable brcm_patchram_plus 2> /dev/null - systemctl start brcm_patchram_plus 2> /dev/null - if (( $? != 0 )); then - - G_DIETPI-NOTIFY 2 "brcm_patchram_plus service failed to start. Is it installed?" - EXIT_CODE=1 - - fi + G_RUN_CMD systemctl start brcm_patchram_plus fi systemctl enable bluetooth 2> /dev/null - systemctl start bluetooth 2> /dev/null - if (( $? != 0 )); then - - G_DIETPI-NOTIFY 2 "Bluetooth service failed to start. Is it installed?" - EXIT_CODE=1 - - fi - - # + RPi 3/ZeroW - if (( $HW_ONBOARD_WIFI == 1 )); then - - #pi-bluetooth contains hciuart service and also pulls in firmware: https://github.com/Fourdee/DietPi/issues/693 - # Installed by default as of v142 - if (( ! $(dpkg --get-selections | grep -ci -m1 '^pi-bluetooth') )); then - - G_AGI pi-bluetooth - - fi - - systemctl enable hciuart - - #Start service again, if it fails: https://github.com/Fourdee/DietPi/issues/376#issuecomment-230149754 - loop_count=0 - max_count=3 - while (( $(systemctl start hciuart;echo $?) != 0 )) - do - - if (( $loop_count >= $max_count )); then - - G_DIETPI-NOTIFY 1 "hciuart failed to start after $loop_count attempts." - EXIT_CODE=1 - break - - else - - G_DIETPI-NOTIFY 2 "hciuart failed to start. Attempting to restart it, please wait..." - ((loop_count++)) - sleep 1 - - fi - - done - - fi + G_RUN_CMD systemctl start bluetooth # + Asus TB if (( $G_HW_MODEL == 100 )); then systemctl enable hciuart - systemctl start hciuart + G_RUN_CMD systemctl start hciuart fi From 88e1e5bf56c639d261e77bdf14f6163193fb8af9 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 7 Jan 2018 14:02:30 +0000 Subject: [PATCH 235/390] v6.0 + Remove BT from PREP, install on demand in dietpi-config: https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 29 ----------------------------- dietpi/func/dietpi-set_hardware | 2 +- 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 332f413205..7725af841d 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -678,35 +678,6 @@ _EOF_ G_AGI $INSTALL_PACKAGES - G_DIETPI-NOTIFY 2 "Onboard Bluetooth selection" - - WHIP_TITLE='Bluetooth required?' - WHIP_DESC='Please select an option' - WHIP_DEFAULT_ITEM=0 - WHIP_MENU_ARRAY=( - - '0' "I don't require Bluetooth, do not install." - '1' 'Device has onboard Bluetooth and/or I require Bluetooth functionality.' - - ) - - Run_Whiptail - if (( $WHIP_RETURN_VALUE == 1 )); then - - G_DIETPI-NOTIFY 2 "Installing Bluetooth packages" - - G_AGI bluetooth bluez-firmware - - if (( $G_HW_MODEL < 10 )); then - - G_DIETPI-NOTIFY 2 "Installing Bluetooth packages specific to RPi" - - G_AGI pi-bluetooth - - fi - - fi - # - @MichaIng https://github.com/Fourdee/DietPi/pull/1266/files G_DIETPI-NOTIFY 2 "Returning installation of recommends back to default" diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 9a4e2c75c8..0ff154440b 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1033,7 +1033,7 @@ _EOF_ fi #bluetooth last - G_RUN_CMD systemctl stop bluetooth + systemctl stop bluetooth 2> /dev/null systemctl disable bluetooth 2> /dev/null for ((i=$(( ${#aBLUETOOTH_MODULES[@]} - 1 )); i>=0; i--)) From e410de19d65f08e6cb943decebd76068a4deba3f Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 7 Jan 2018 14:06:31 +0000 Subject: [PATCH 236/390] v6.0 + create dir, before write (does not exist on non-wifi PREP'd images): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-355825005 --- dietpi/func/dietpi-set_hardware | 1 + 1 file changed, 1 insertion(+) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 0ff154440b..4257e11e74 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1273,6 +1273,7 @@ _EOF_ local Wifi_KEY="$(grep -m1 '^AUTO_SETUP_NET_WIFI_KEY=' /DietPi/dietpi.txt | sed 's/.*=//')" local Wifi_SSID="$(grep -m1 '^AUTO_SETUP_NET_WIFI_SSID=' /DietPi/dietpi.txt | sed 's/.*=//')" + mkdir -p /etc/wpa_supplicant cat << _EOF_ > /etc/wpa_supplicant/wpa_supplicant.conf country=$(grep -m1 '^CONFIG_WIFI_COUNTRY_CODE=' /DietPi/dietpi.txt | sed 's/.*=//') ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev From 9797eb1e856e79d2c6489fa4860c9310aa8ec00b Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 7 Jan 2018 15:32:55 +0000 Subject: [PATCH 237/390] v6.0 + RPi BT fix (forgot to add back in ;) ) --- dietpi/func/dietpi-set_hardware | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 4257e11e74..3779dd501f 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1074,8 +1074,8 @@ _EOF_ systemctl enable bluetooth 2> /dev/null G_RUN_CMD systemctl start bluetooth - # + Asus TB - if (( $G_HW_MODEL == 100 )); then + # + RPi / Asus TB + if (( $G_HW_MODEL < 10 || $G_HW_MODEL == 100 )); then systemctl enable hciuart G_RUN_CMD systemctl start hciuart From bea766443d3d9958909093c48c6f4b344184d677 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 7 Jan 2018 15:38:00 +0000 Subject: [PATCH 238/390] v6.0 + Purge BT during disable + avoiding breaking PREP both packages also remove pi-bluetooth --- dietpi/func/dietpi-set_hardware | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 3779dd501f..33edc4288e 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1044,6 +1044,14 @@ _EOF_ done + #Purge packages + if (( $G_DIETPI_INSTALL_STAGE >= 0 )); then + + G_AGP bluetooth bluez-firmware + G_AGA + + fi + # - Enable elif [ "$INPUT_DEVICE_VALUE" = "enable" ]; then From 484f4f606ef67af3e21296d249f1402bb0a19ddb Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 16:46:47 +0100 Subject: [PATCH 239/390] v6.0 + DietPi-Globals | Processing: Remove echo/printf wrappers, as they have unexpected effects, e.g. adding garbage to echo > file. --- dietpi/func/dietpi-globals | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 52e445947f..4afacf7956 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -84,17 +84,6 @@ ' } - # Wrappers to stop Print_Process_Animation: - echo(){ - [ -f /var/run/dietpi-process.pid ] && kill $( Date: Sun, 7 Jan 2018 16:48:49 +0100 Subject: [PATCH 240/390] v6.0 + tiny --- dietpi/func/dietpi-globals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 4afacf7956..a4b423d7a8 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -832,7 +832,7 @@ $print_logfile_info G_AGA(){ G_ERROR_HANDLER_EXITCODE=0 - G_ERROR_HANDLER_COMMAND="G_AGA:" + G_ERROR_HANDLER_COMMAND="G_AGA" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" G_DIETPI-NOTIFY -2 "APT autoremove + purge" From 48b59d4a1b8350ffcf7539c412eade913ebacfad Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 16:58:32 +0100 Subject: [PATCH 241/390] v6.0 + DietPi-Prep | Fix locales for dropbear remote access --- PREP_SYSTEM_FOR_DIETPI.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 7725af841d..eb4c44786e 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -86,6 +86,13 @@ _EOF_ cat << _EOF_ > /etc/default/locale LC_ALL=en_GB.UTF-8 LANG=en_GB.UTF-8 +_EOF_ + + # - and force locale for remote access, especially dropbear, where receiving locale from client can't be suppressed: + cat << _EOF_ > /etc/default/locale +export LANG="en_GB.UTF-8" +export LC_ALL="en_GB.UTF-8" +export LANGUAGE="en_GB:en" _EOF_ #Force en_GB Locale for rest of script. Prevents incorrect parsing with non-english locales. From 8099a7bb7d62a7d662c10625a52700baa32ba554 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 17:21:32 +0100 Subject: [PATCH 242/390] v6.0 + DietPi-Prep | Fix locales for dropbear remote access --- dietpi/dietpi-config | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 116e445eaf..7128c4769e 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -2320,6 +2320,14 @@ _EOF_ cat << _EOF_ > /etc/default/locale LC_ALL=$locale_current LANG=$locale_current +_EOF_ + + # - and force locale for remote access, especially dropbear, where receiving locale from client can't be suppressed: + cat << _EOF_ > /etc/profile.d/99-dietpi-force-locale.sh +# To force server locales on SSH access, as dropbear does automatically overwrite them by client values: +export LANG="$locale_current" +export LC_ALL="$locale_current" +export LANGUAGE="$( echo $locale_current | sed 's/\..*//' ):$( echo $locale_current | sed 's/_.*//' )" _EOF_ #Return to this menu From 57400c3592c05196d31e3ea7419ff7ecfc3a3d82 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 17:22:32 +0100 Subject: [PATCH 243/390] v6.0 + tiny --- PREP_SYSTEM_FOR_DIETPI.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index eb4c44786e..c57451a17a 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -90,6 +90,7 @@ _EOF_ # - and force locale for remote access, especially dropbear, where receiving locale from client can't be suppressed: cat << _EOF_ > /etc/default/locale +# To force server locales on SSH access, as dropbear does automatically overwrite them by client values: export LANG="en_GB.UTF-8" export LC_ALL="en_GB.UTF-8" export LANGUAGE="en_GB:en" From 5232438b98782180b48b3652132ddcfe2188ccbb Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 18:15:17 +0100 Subject: [PATCH 244/390] v6.0 + typo --- PREP_SYSTEM_FOR_DIETPI.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index c57451a17a..98cf813fb3 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -89,13 +89,15 @@ LANG=en_GB.UTF-8 _EOF_ # - and force locale for remote access, especially dropbear, where receiving locale from client can't be suppressed: - cat << _EOF_ > /etc/default/locale + cat << _EOF_ > /etc/profile.d/99-dietpi-force-locale.sh # To force server locales on SSH access, as dropbear does automatically overwrite them by client values: export LANG="en_GB.UTF-8" export LC_ALL="en_GB.UTF-8" export LANGUAGE="en_GB:en" _EOF_ + + #Force en_GB Locale for rest of script. Prevents incorrect parsing with non-english locales. LANG=en_GB.UTF-8 From d331605e8e39905723ebba7f0736e7928c8e9dbf Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 18:43:29 +0100 Subject: [PATCH 245/390] v6.0 + DietPi-Software | ownCloud/Nextcloud: Revert to occ/ncc functions, as aliases are not accessible from non-interactive scripts. --- dietpi/dietpi-software | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index b2926e9e1b..47bcd8ff13 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8462,8 +8462,8 @@ _EOF_ fi - # Add occ shortcut alias. Will be added by dietpi-globals afterwards: - alias occ='sudo -u www-data php /var/www/owncloud/occ' + # Re-source dietpi-globals to load occ command shortcut: + . /DietPi/dietpi/func/dietpi-globals # Adjusting config file: local config_php='/var/www/owncloud/config/config.php' @@ -8662,8 +8662,8 @@ _EOF_ fi - # Add occ shortcut alias. Will be added by dietpi-globals afterwards. Use 'ncc' as 'occ' is reserved for ownCloud: - alias ncc='sudo -u www-data php /var/www/nextcloud/occ' + # Re-source dietpi-globals to load ncc command shortcut: + . /DietPi/dietpi/func/dietpi-globals # Adjusting config file: local config_php='/var/www/nextcloud/config/config.php' From 991fb234ef55f83ec17494bcf3a1937aa87ab853 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 19:02:00 +0100 Subject: [PATCH 246/390] v6.0 DietPi-Software | ownCloud/Nextcloud: Revert to occ/ncc functions, as aliases are not accessible from non-interactive scripts. --- dietpi/func/dietpi-globals | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index a4b423d7a8..a7b7eb000f 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -59,10 +59,11 @@ alias cpu='/DietPi/dietpi/dietpi-cpuinfo' alias dietpi-logclear='/DietPi/dietpi/dietpi-logclear' - # - Optional DietPi software aliases + # - Optional DietPi software aliases/functions [ -f /usr/local/games/opentyrian/run ] && alias opentyrian='/usr/local/games/opentyrian/run' - [ -f /var/www/owncloud/occ ] && alias occ='sudo -u www-data php /var/www/owncloud/occ' - [ -f /var/www/nextcloud/occ ] && alias ncc='sudo -u www-data php /var/www/nextcloud/occ' + # occ/ncc need to be global function, as aliases are not accessible from non-interactive scripts: + [ -f /var/www/owncloud/occ ] && occ(){ sudo -u www-data php /var/www/owncloud/occ "$@"; } + [ -f /var/www/nextcloud/occ ] && ncc(){ sudo -u www-data php /var/www/nextcloud/occ "$@"; } # - Treesize treesize() From 193e30fb3f2103913daceec2df5687a2dc9359f8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 20:37:21 +0100 Subject: [PATCH 247/390] v6.0 + Move aliases to dietpi-globalss --- dietpi/dietpi-software | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 47bcd8ff13..d95ae328f0 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7061,13 +7061,6 @@ libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc # - Apply /DietPi/dietpi/func/dietpi-set_hardware soundcard "$soundcard" - # - DietPi-JustBoom config panel Alias: - if (( ! $(cat /etc/bash.bashrc | grep -ci -m1 'dietpi-justboom=') )); then - - sed -i "/#DietPi Additions/a alias dietpi-justboom='/DietPi/dietpi/misc/dietpi-justboom'" /etc/bash.bashrc - - fi - fi INSTALLING_INDEX=6 @@ -9228,13 +9221,6 @@ _EOF_ wget http://dietpi.com/downloads/conf/desktop/kodi.desktop -O /usr/share/applications/kodi.desktop ln -sf /usr/share/applications/kodi.desktop "$HOME"/Desktop/kodi.desktop - #startkodi alias. - if (( $(cat /etc/bash.bashrc | grep -ci -m1 'startkodi') == 0 )); then - - echo -e "alias startkodi='/DietPi/dietpi/misc/start_kodi'" >> /etc/bash.bashrc - - fi - fi #MINIDLNA @@ -9458,13 +9444,6 @@ _EOF_ #+exe chmod +x -R "$G_FP_DIETPI_USERDATA"/dxx-rebirth/* - #Alias - if (( ! $(cat /etc/bash.bashrc | grep -ci -m1 'dxx-rebirth') )); then - - sed -i "/#DietPi Additions/a alias dxx-rebirth='$G_FP_DIETPI_USERDATA/dxx-rebirth/run.sh'" /etc/bash.bashrc - - fi - #Create .Desktop SymLinks mkdir -p "$HOME"/Desktop mkdir -p /usr/share/applications @@ -9483,7 +9462,6 @@ _EOF_ #Copy the DietPi run file for OpenTyrian cp /DietPi/dietpi/conf/opentyrian_run /usr/local/games/opentyrian/run chmod +x /usr/local/games/opentyrian/run - alias opentyrian='/usr/local/games/opentyrian/run' #Create .Desktop SymLinks mkdir -p "$HOME"/Desktop @@ -9672,13 +9650,6 @@ _EOF_ #Enable DietPi-Cloudshell autostart /DietPi/dietpi/dietpi-autostart 5 - #add alias - if (( $(cat /etc/bash.bashrc | grep -ci -m1 'dietpi-cloudshell=' ) == 0 )); then - - sed -i "/#DietPi Additions/a alias dietpi-cloudshell='/DietPi/dietpi/dietpi-cloudshell'" /etc/bash.bashrc - - fi - #Service cat << _EOF_ > /etc/systemd/system/dietpi-cloudshell.service [Unit] @@ -13150,9 +13121,6 @@ _EOF_ #Disable auto login, revert boot index to console /DietPi/dietpi/dietpi-autostart 0 - #Remove alias - sed -i '/dietpi-cloudshell=/d' /etc/bash.bashrc - elif (( $index == 98 )); then update-rc.d haproxy remove @@ -13717,9 +13685,6 @@ _EOF_ G_AGP alsa-utils - #DietPi-JustBoom, remove bash alias for config panel: - sed -i '/dietpi-justboom/d' /etc/bash.bashrc &> /dev/null - elif (( $index == 6 )); then #apt-mark auto aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump* xf86-video-fbturbo* firmware-samsung xf86-video-armsoc-odroid malit628-odroid &> /dev/null From cc77f1cbc5a2a2eb20f4c2797aa47f79f27b5e72 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 20:39:14 +0100 Subject: [PATCH 248/390] v6.0 + Move aliases to dietpi-globals. --- dietpi/func/dietpi-globals | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index a7b7eb000f..4f508ad51d 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -61,6 +61,10 @@ # - Optional DietPi software aliases/functions [ -f /usr/local/games/opentyrian/run ] && alias opentyrian='/usr/local/games/opentyrian/run' + [ -f /DietPi/dietpi/misc/dietpi-justboom ] && alias dietpi-justboom='/DietPi/dietpi/misc/dietpi-justboom' + [ -f "$G_FP_DIETPI_USERDATA"/dxx-rebirth/run.sh ] && alias dxx-rebirth="$G_FP_DIETPI_USERDATA/dxx-rebirth/run.sh" + [ -f /usr/share/applications/kodi.desktop] && alias startkodi='/DietPi/dietpi/misc/start_kodi' + [ -f /etc/systemd/system/dietpi-cloudshell.service] && alias dietpi-cloudshell='/DietPi/dietpi/dietpi-cloudshell # occ/ncc need to be global function, as aliases are not accessible from non-interactive scripts: [ -f /var/www/owncloud/occ ] && occ(){ sudo -u www-data php /var/www/owncloud/occ "$@"; } [ -f /var/www/nextcloud/occ ] && ncc(){ sudo -u www-data php /var/www/nextcloud/occ "$@"; } From 9d51da957926fe03abf50d428bc9836d91c24889 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 20:40:10 +0100 Subject: [PATCH 249/390] v6.0 tiny --- dietpi/func/dietpi-globals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 4f508ad51d..0216ad27f6 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -64,7 +64,7 @@ [ -f /DietPi/dietpi/misc/dietpi-justboom ] && alias dietpi-justboom='/DietPi/dietpi/misc/dietpi-justboom' [ -f "$G_FP_DIETPI_USERDATA"/dxx-rebirth/run.sh ] && alias dxx-rebirth="$G_FP_DIETPI_USERDATA/dxx-rebirth/run.sh" [ -f /usr/share/applications/kodi.desktop] && alias startkodi='/DietPi/dietpi/misc/start_kodi' - [ -f /etc/systemd/system/dietpi-cloudshell.service] && alias dietpi-cloudshell='/DietPi/dietpi/dietpi-cloudshell + [ -f /etc/systemd/system/dietpi-cloudshell.service] && alias dietpi-cloudshell='/DietPi/dietpi/dietpi-cloudshell' # occ/ncc need to be global function, as aliases are not accessible from non-interactive scripts: [ -f /var/www/owncloud/occ ] && occ(){ sudo -u www-data php /var/www/owncloud/occ "$@"; } [ -f /var/www/nextcloud/occ ] && ncc(){ sudo -u www-data php /var/www/nextcloud/occ "$@"; } From 0cf707f3b82044cd272902aad89ef8b2ddc05a8b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 20:41:46 +0100 Subject: [PATCH 250/390] v6.0 tiny --- dietpi/dietpi-software | 1 - 1 file changed, 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d95ae328f0..3a4e0bfbf9 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -13446,7 +13446,6 @@ _EOF_ rm "$G_FP_DIETPI_USERDATA"/dxx-rebirth/* rm -R "$G_FP_DIETPI_USERDATA"/dxx-rebirth/descent_1_game rm -R "$G_FP_DIETPI_USERDATA"/dxx-rebirth/descent_2_game - sed -i '/dxx-rebirth/d' /etc/bash.bashrc #Remove symlinks rm "$HOME"/.d1x-rebirth From 87c499ae45c978862585c9dbc62b2d9894651087 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 22:58:16 +0100 Subject: [PATCH 251/390] v6.0 + DietPi-Globals | Process notification integration --- dietpi/dietpi-services | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index 2c4307c93b..97d2197a51 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -188,12 +188,12 @@ #ok if (( $3 == 0 || $3 == 5 )); then - echo -e "\e[1A$(G_DIETPI-NOTIFY 0)\e[0m $1 : $2" + G_DIETPI-NOTIFY 0 "$1 : $2" #failed else - echo -e "\e[1A$(G_DIETPI-NOTIFY 1)\e[0m $1 : $2" + G_DIETPI-NOTIFY 1 "$1 : $2" fi @@ -220,7 +220,7 @@ if [ -f ${aDIETPISERVICE_FP[$i]} ]; then - echo -e "${aDIETPISERVICE_NAME[$i]}" + G_DIETPI-NOTIFY -2 "${aDIETPISERVICE_NAME[$i]}" ${aDIETPISERVICE_FP[$i]} $target_state &> /dev/null Print_Status $target_state ${aDIETPISERVICE_NAME[$i]} $? @@ -271,7 +271,7 @@ #Apply if (( ${aSERVICE_AVAILABLE[$i]} == 1 )); then - echo -e "${aSERVICE_NAME[$i]}" + G_DIETPI-NOTIFY -2 "${aSERVICE_NAME[$i]}" systemctl $target_state ${aSERVICE_NAME[$i]} &> /dev/null @@ -299,7 +299,7 @@ if [ -f ${aDIETPISERVICE_FP[$i]} ]; then - echo -e "${aDIETPISERVICE_NAME[$i]}" + G_DIETPI-NOTIFY -2 "${aDIETPISERVICE_NAME[$i]}" ${aDIETPISERVICE_FP[$i]} $target_state &> /dev/null Print_Status $target_state ${aDIETPISERVICE_NAME[$i]} $? @@ -354,7 +354,7 @@ #Apply if (( ${aSERVICE_AVAILABLE[$i]} == 1 )); then - echo -e "${aSERVICE_NAME[$i]}" + G_DIETPI-NOTIFY -2 "${aSERVICE_NAME[$i]}" systemctl $SYSTEMD_CMD ${aSERVICE_NAME[$i]} &> /dev/null @@ -520,7 +520,7 @@ #----------------------------------------------------------------------------------- #Invalid command else - echo -e "\nDietPi-Services\nAvailable commands:\n$AVAILABLE_OPTIONS\n" + G_DIETPI-NOTIFY 2 "Invalid command\e[0m\nAvailable commands:\n$AVAILABLE_OPTIONS\n" fi #----------------------------------------------------------------------------------- rm "$FP_TEMP" From bf493441f8c2bf9815b65ed95e600f1c0d78635d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 23:22:24 +0100 Subject: [PATCH 252/390] v6.0 + DietPi-Globals | Process notification integration --- dietpi/dietpi-software | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 3a4e0bfbf9..fb897f0ae2 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -15779,22 +15779,18 @@ _EOF_ Banner_Installing(){ - G_DIETPI-NOTIFY 3 DietPi-Software "Install software" + G_DIETPI-NOTIFY 3 DietPi-Software "Installing ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}" export G_ERROR_HANDLER_ONERROR_USERMSG="Failed to Install:\n - ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}." - echo -e " ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}" - } Banner_Configuration(){ - G_DIETPI-NOTIFY 3 DietPi-Software "Configuring software" + G_DIETPI-NOTIFY 3 DietPi-Software "Configuring ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}" export G_ERROR_HANDLER_ONERROR_USERMSG="Failed to configure:\n - ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}." - echo -e " ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}" - } Banner_Apt_Update(){ @@ -15809,7 +15805,7 @@ _EOF_ if (( ! $DISABLE_REBOOT )); then G_DIETPI-NOTIFY 3 DietPi-Software "Installation completed" - echo -e "\n The system will now reboot. \n This completes the DietPi-Software installation.\n" + G_DIETPI-NOTIFY 0 "The system will now reboot. \n This completes the DietPi-Software installation.\n" sleep 3 else @@ -15823,7 +15819,7 @@ _EOF_ G_DIETPI-NOTIFY 3 DietPi-Software "Optimize and configure software" G_DIETPI-NOTIFY 2 "Applying DietPi optimizations and configurations for $G_HW_MODEL_DESCRIPTION" - G_DIETPI-NOTIFY 2 "Please wait...\n" + G_DIETPI-NOTIFY -2 "Please wait...\n" } @@ -15833,7 +15829,7 @@ _EOF_ if (( $G_DIETPI_INSTALL_STAGE == 0 )); then /DietPi/dietpi/dietpi-banner 0 - echo -e "\n Installation Aborted by User \n Installation must be completed prior to using DietPi \n Please run dietpi-software to restart the installation \n" + G_DIETPI-NOTIFY 1 "\n Installation Aborted by User \n Installation must be completed prior to using DietPi \n Please run dietpi-software to restart the installation \n" #Standard abort else From fe45d113e4e7a168258a51ebdf83943c74e33856 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 23:34:51 +0100 Subject: [PATCH 253/390] v6.0 + DietPi-Globals | Process notification integration --- dietpi/func/dietpi-globals | 88 ++++++++++++++++++++++++-------------- 1 file changed, 55 insertions(+), 33 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 0216ad27f6..3d90e990f7 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -109,9 +109,9 @@ #header_line="\e[38;5;154m─────────────────────────────────────────────────────\e[0m" local header_line="\e[90m─────────────────────────────────────────────────────\e[0m" - local status_text_ok="\e[32mOk \e[0m" - local status_text_error="\e[31mError\e[0m" - local status_text_info="\e[0mInfo \e[0m" + local status_text_ok="\e[32m OK \e[0m" + local status_text_error="\e[31mFAILED\e[0m" + local status_text_info="\e[0m INFO \e[0m" local bracket_string_l="\e[90m[\e[0m" local bracket_string_r="\e[90m]\e[0m" @@ -121,25 +121,51 @@ Print_Process_Animation(){ local aprocess_string=( - "\e[90m[\e[33m. \e[90m]\e[0m" - "\e[90m[\e[33m . \e[90m]\e[0m" - "\e[90m[\e[33m . \e[90m]\e[0m" - "\e[90m[\e[33m . \e[90m]\e[0m" - "\e[90m[\e[33m .\e[90m]\e[0m" - "\e[90m[\e[33m . \e[90m]\e[0m" - "\e[90m[\e[33m . \e[90m]\e[0m" - "\e[90m[\e[33m . \e[90m]\e[0m" - ) + #"\e[90m[\e[1;93m\u23F9 \e[90m]\e[0m" + #"\e[90m[\e[2;33m\u23F9\e[0m\e[1;93m\u23F9 \e[90m]\e[0m" + #"\e[90m[ \e[2;33m\u23F9\e[0m\e[1;93m\u23F9 \e[90m]\e[0m" + #"\e[90m[ \e[2;33m\u23F9\e[0m\e[1;93m\u23F9 \e[90m]\e[0m" + #"\e[90m[ \e[2;33m\u23F9\e[0m\e[1;93m\u23F9 \e[90m]\e[0m" + #"\e[90m[ \e[2;33m\u23F9\e[0m\e[1;93m\u23F9\e[90m]\e[0m" + #"\e[90m[ \e[1;93m\u23F9\e[0m\e[2;33m\u23F9\e[90m]\e[0m" + #"\e[90m[ \e[1;93m\u23F9\e[0m\e[2;33m\u23F9 \e[90m]\e[0m" + #"\e[90m[ \e[1;93m\u23F9\e[0m\e[2;33m\u23F9 \e[90m]\e[0m" + #"\e[90m[ \e[1;93m\u23F9\e[0m\e[2;33m\u23F9 \e[90m]\e[0m" + #"\e[90m[\e[1;93m\u23F9\e[0m\e[2;33m\u23F9 \e[90m]\e[0m" + "\e[90m[\e[1;93m. \e[90m]\e[0m" + "\e[90m[\e[2;33m.\e[0m\e[1;93m. \e[90m]\e[0m" + "\e[90m[ \e[2;33m.\e[0m\e[1;93m. \e[90m]\e[0m" + "\e[90m[ \e[2;33m.\e[0m\e[1;93m. \e[90m]\e[0m" + "\e[90m[ \e[2;33m.\e[0m\e[1;93m. \e[90m]\e[0m" + "\e[90m[ \e[2;33m.\e[0m\e[1;93m.\e[90m]\e[0m" + "\e[90m[ \e[1;93m.\e[0m\e[2;33m.\e[90m]\e[0m" + "\e[90m[ \e[1;93m.\e[0m\e[2;33m. \e[90m]\e[0m" + "\e[90m[ \e[1;93m.\e[0m\e[2;33m. \e[90m]\e[0m" + "\e[90m[ \e[1;93m.\e[0m\e[2;33m. \e[90m]\e[0m" + "\e[90m[\e[1;93m.\e[0m\e[2;33m. \e[90m]\e[0m" + ) for (( i=0; i<=${#aprocess_string[*]}; i++ )); do - (( i == 8 )) && i=0 - builtin printf "\r ${aprocess_string[i]} " + (( i == 10 )) && i=1 + builtin printf "\r${aprocess_string[i]} " sleep 0.15 done } + + G_CLEAN-ANIMATION(){ + + if [ -f /var/run/dietpi-process.pid ]; then + + kill $( /dev/null + rm /var/run/dietpi-process.pid + + fi + echo -en "\r\e[K" + + } Print_Process(){ @@ -149,22 +175,22 @@ Print_Ok(){ - [ -f /var/run/dietpi-process.pid ] && kill $( /var/run/dietpi-process.pid ) - fi + [ ! -f /var/run/dietpi-process.pid ] && ( Print_Process_Animation & builtin echo $! > /var/run/dietpi-process.pid ) #Status Ok #$@ = txt desc @@ -259,9 +283,7 @@ echo -e " \e[90mMode: \e[0m$(Print_Input_String 2)\n" Print_Process echo -ne "\e[90mPlease wait...\e[0m" - if [ ! -f /var/run/dietpi-process.pid ]; then - ( Print_Process_Animation & builtin echo $! > /var/run/dietpi-process.pid ) - fi + [ ! -f /var/run/dietpi-process.pid ] && ( Print_Process_Animation & builtin echo $! > /var/run/dietpi-process.pid ) fi #----------------------------------------------------------------------------------- @@ -794,7 +816,7 @@ $print_logfile_info #-qq can add a slight period of appearing nothing is happening, lets inform user - G_DIETPI-NOTIFY -2 "APT installation for: $string, please wait..." + G_DIETPI-NOTIFY 2 "APT installation for: $string, please wait..." DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $force_options $string 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} @@ -821,7 +843,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="G_AGP: $string" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" - G_DIETPI-NOTIFY -2 "APT removal for: $string" + G_DIETPI-NOTIFY 2 "APT removal for: $string, please wait..." DEBIAN_FRONTEND=noninteractive apt-get purge -y $string $options 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} @@ -840,7 +862,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="G_AGA" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" - G_DIETPI-NOTIFY -2 "APT autoremove + purge" + G_DIETPI-NOTIFY 2 "APT autoremove + purge, please wait..." DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} @@ -859,7 +881,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="G_AGF" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" - G_DIETPI-NOTIFY -2 "APT fix" + G_DIETPI-NOTIFY 2 "APT fix, please wait..." DEBIAN_FRONTEND=noninteractive apt-get install -f -y 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} @@ -878,7 +900,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="G_AGUP" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" - G_DIETPI-NOTIFY -2 "APT update" + G_DIETPI-NOTIFY 2 "APT update, please wait..." DEBIAN_FRONTEND=noninteractive apt-get update 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} @@ -897,7 +919,7 @@ $print_logfile_info G_ERROR_HANDLER_COMMAND="G_AGUG" G_ERROR_HANDLER_ONERROR_FPLOGFILE="$G_FP_LOG_APT" - G_DIETPI-NOTIFY -2 "APT upgrade" + G_DIETPI-NOTIFY 2 "APT upgrade, please wait..." DEBIAN_FRONTEND=noninteractive apt-get upgrade -y 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} @@ -926,7 +948,7 @@ $print_logfile_info fi - G_DIETPI-NOTIFY -2 "APT dist-upgrade" + G_DIETPI-NOTIFY 2 "APT dist-upgrade, please wait..." DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y 2>&1 | tee "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} From 58a4ae1509014e079b8ba90272fcb1ad409b7f4b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 23:38:26 +0100 Subject: [PATCH 254/390] v6.0 + DietPi-Globals | Process notification integration --- dietpi/dietpi-process_tool | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-process_tool b/dietpi/dietpi-process_tool index cf115f7e53..9fcacfef61 100644 --- a/dietpi/dietpi-process_tool +++ b/dietpi/dietpi-process_tool @@ -73,6 +73,7 @@ aPID[$i]=$line #info + G_CLEAN_ANIMATION echo -e " ${aNAME[$i]} (${aPID[$i]})" # - Check if PID exists (this can occur with programs like netdata that run as root initally, create a new process under a different user, then terminate the original root process. @@ -95,7 +96,7 @@ fi - status_text+=" \e[90mNice ${aNICE[$i]}\e[0m" + status_text+="\e[90mNice ${aNICE[$i]}\e[0m" echo -e "$status_text" # - Affinity @@ -111,7 +112,7 @@ fi - status_text+=" \e[90mAffinity ${aAFFINITY[$i]}\e[0m" + status_text+="\e[90mAffinity ${aAFFINITY[$i]}\e[0m" echo -e "$status_text" # - schedule @@ -172,7 +173,7 @@ fi - status_text+=" \e[90mScheduler ${aSCHEDULE_POLICY[$i]} ${aSCHEDULE_PRIORITY[$i]}\e[0m" + status_text+="\e[90mScheduler ${aSCHEDULE_POLICY[$i]} ${aSCHEDULE_PRIORITY[$i]}\e[0m" echo -e "$status_text" fi From d37cbcfbe4762804c67e308f5c321a6277e81d35 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 23:43:16 +0100 Subject: [PATCH 255/390] v6.0 + fix --- dietpi/func/dietpi-globals | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 3d90e990f7..d1ff947186 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -154,7 +154,7 @@ done } - + G_CLEAN-ANIMATION(){ if [ -f /var/run/dietpi-process.pid ]; then @@ -175,21 +175,21 @@ Print_Ok(){ - G_CLEAN-ANIMATION() + G_CLEAN-ANIMATION echo -ne "$bracket_string_l$status_text_ok$bracket_string_r " } Print_Failed(){ - G_CLEAN-ANIMATION() + G_CLEAN-ANIMATION echo -ne "$bracket_string_l$status_text_error$bracket_string_r " } Print_Info(){ - G_CLEAN-ANIMATION() + G_CLEAN-ANIMATION echo -ne "$bracket_string_l$status_text_info$bracket_string_r " } From ab025a28bf19b3918987d8c6c78395bfde0bc8d5 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2018 23:50:54 +0100 Subject: [PATCH 256/390] v6.0 + tiny --- dietpi/func/dietpi-globals | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index d1ff947186..19a386a065 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -63,8 +63,8 @@ [ -f /usr/local/games/opentyrian/run ] && alias opentyrian='/usr/local/games/opentyrian/run' [ -f /DietPi/dietpi/misc/dietpi-justboom ] && alias dietpi-justboom='/DietPi/dietpi/misc/dietpi-justboom' [ -f "$G_FP_DIETPI_USERDATA"/dxx-rebirth/run.sh ] && alias dxx-rebirth="$G_FP_DIETPI_USERDATA/dxx-rebirth/run.sh" - [ -f /usr/share/applications/kodi.desktop] && alias startkodi='/DietPi/dietpi/misc/start_kodi' - [ -f /etc/systemd/system/dietpi-cloudshell.service] && alias dietpi-cloudshell='/DietPi/dietpi/dietpi-cloudshell' + [ -f /usr/share/applications/kodi.desktop ] && alias startkodi='/DietPi/dietpi/misc/start_kodi' + [ -f /etc/systemd/system/dietpi-cloudshell.service ] && alias dietpi-cloudshell='/DietPi/dietpi/dietpi-cloudshell' # occ/ncc need to be global function, as aliases are not accessible from non-interactive scripts: [ -f /var/www/owncloud/occ ] && occ(){ sudo -u www-data php /var/www/owncloud/occ "$@"; } [ -f /var/www/nextcloud/occ ] && ncc(){ sudo -u www-data php /var/www/nextcloud/occ "$@"; } From 4883bf0f8e0facc595934f0fcacf1e75594ad620 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Jan 2018 00:01:10 +0100 Subject: [PATCH 257/390] v6.0 + DietPi-Globals | Processing notification integration --- dietpi/dietpi-logclear | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-logclear b/dietpi/dietpi-logclear index a413bc415a..4ca445f10f 100644 --- a/dietpi/dietpi-logclear +++ b/dietpi/dietpi-logclear @@ -244,8 +244,7 @@ #How to use print. if (( $INPUT == -1 )); then - echo -e "" - echo -e "\e[90m Available commands:\e[0m" + G_DIETPI-NOTIFY 2 'Available commands:' echo -e "" echo -e "\e[1m dietpi-logclear 0\e[0m" echo -e "\e[38;5;244m Backup contents of all log files from $FILEPATH_LOGFOLDER to $FILEPATH_BACKUPFOLDER/*.\n Also clears the contents of all logs files in $FILEPATH_LOGFOLDER.\e[0m" @@ -274,7 +273,7 @@ fi #Print Info - echo -e " \e[38;5;244mInfo:\e[0m" + G_DIETPI-NOTIFY 2 echo -e " - Log file directory \e[90m|\e[0m $FILEPATH_LOGFOLDER" echo -e " - Processed files \e[90m|\e[0m $INFO_FILES_PROCESSED" @@ -310,4 +309,4 @@ #----------------------------------------------------------------------------------- exit #----------------------------------------------------------------------------------- -} \ No newline at end of file +} From a581c062b14e1a1f299f33c3f72561f16eeb19fb Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Jan 2018 00:41:37 +0100 Subject: [PATCH 258/390] v6.0 + DietPi-Globals | Revert Animation with G_DIETPI-NOTIFY 3 --- dietpi/dietpi-process_tool | 1 - 1 file changed, 1 deletion(-) diff --git a/dietpi/dietpi-process_tool b/dietpi/dietpi-process_tool index 9fcacfef61..15bb6d1557 100644 --- a/dietpi/dietpi-process_tool +++ b/dietpi/dietpi-process_tool @@ -73,7 +73,6 @@ aPID[$i]=$line #info - G_CLEAN_ANIMATION echo -e " ${aNAME[$i]} (${aPID[$i]})" # - Check if PID exists (this can occur with programs like netdata that run as root initally, create a new process under a different user, then terminate the original root process. From 2094f3e1c381a23e7954bfd63ddcf7d301c9370c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Jan 2018 00:46:13 +0100 Subject: [PATCH 259/390] v6.0 + DietPi-Globals | Revert Animation with G_DIETPI-NOTIFY 3 --- dietpi/dietpi-software | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index fb897f0ae2..3b017d8f3e 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -15818,8 +15818,7 @@ _EOF_ Banner_Configs(){ G_DIETPI-NOTIFY 3 DietPi-Software "Optimize and configure software" - G_DIETPI-NOTIFY 2 "Applying DietPi optimizations and configurations for $G_HW_MODEL_DESCRIPTION" - G_DIETPI-NOTIFY -2 "Please wait...\n" + G_DIETPI-NOTIFY 2 "Applying DietPi optimizations and configurations for $G_HW_MODEL_DESCRIPTION", please wait...\n" } From 3f0f9e0dcb58f2e0c6cdd51ba68bdd476fe705a6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Jan 2018 00:49:17 +0100 Subject: [PATCH 260/390] v6.0 DietPi-Globals | Revert animation on G_DIETPI-NOTIFY 3 --- dietpi/func/dietpi-globals | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 19a386a065..a9a46a2872 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -155,7 +155,7 @@ } - G_CLEAN-ANIMATION(){ + Clean_Process_Animation(){ if [ -f /var/run/dietpi-process.pid ]; then @@ -175,21 +175,21 @@ Print_Ok(){ - G_CLEAN-ANIMATION + Clean_Process_Animation echo -ne "$bracket_string_l$status_text_ok$bracket_string_r " } Print_Failed(){ - G_CLEAN-ANIMATION + Clean_Process_Animation echo -ne "$bracket_string_l$status_text_error$bracket_string_r " } Print_Info(){ - G_CLEAN-ANIMATION + Clean_Process_Animation echo -ne "$bracket_string_l$status_text_info$bracket_string_r " } @@ -281,20 +281,20 @@ echo -e "\n \e[38;5;154m$2\e[0m" echo -e "$header_line" echo -e " \e[90mMode: \e[0m$(Print_Input_String 2)\n" - Print_Process - echo -ne "\e[90mPlease wait...\e[0m" - [ ! -f /var/run/dietpi-process.pid ] && ( Print_Process_Animation & builtin echo $! > /var/run/dietpi-process.pid ) + #Print_Process + #echo -ne "\e[90mPlease wait...\e[0m" + #[ ! -f /var/run/dietpi-process.pid ] && ( Print_Process_Animation & builtin echo $! > /var/run/dietpi-process.pid ) fi #----------------------------------------------------------------------------------- - unset ainput_string + #unset ainput_string # Unset also internal functions, otherwise they are accessible from terminal. - unset Print_Process_Animation - unset Print_Ok - unset Print_Failed - unset Print_Info - unset Print_Process - unset Print_Input_String + #unset Print_Process_Animation + #unset Print_Ok + #unset Print_Failed + #unset Print_Info + #unset Print_Process + #unset Print_Input_String #----------------------------------------------------------------------------------- } From d75cf6943a26cf555b7c95804be0f0f5794f5876 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Jan 2018 00:52:29 +0100 Subject: [PATCH 261/390] v6.0 DietPi-Globals | Fix processing animation --- dietpi/func/dietpi-globals | 42 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index a9a46a2872..f529263d42 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -122,32 +122,32 @@ local aprocess_string=( #"\e[90m[\e[1;93m\u23F9 \e[90m]\e[0m" - #"\e[90m[\e[2;33m\u23F9\e[0m\e[1;93m\u23F9 \e[90m]\e[0m" - #"\e[90m[ \e[2;33m\u23F9\e[0m\e[1;93m\u23F9 \e[90m]\e[0m" - #"\e[90m[ \e[2;33m\u23F9\e[0m\e[1;93m\u23F9 \e[90m]\e[0m" - #"\e[90m[ \e[2;33m\u23F9\e[0m\e[1;93m\u23F9 \e[90m]\e[0m" - #"\e[90m[ \e[2;33m\u23F9\e[0m\e[1;93m\u23F9\e[90m]\e[0m" - #"\e[90m[ \e[1;93m\u23F9\e[0m\e[2;33m\u23F9\e[90m]\e[0m" - #"\e[90m[ \e[1;93m\u23F9\e[0m\e[2;33m\u23F9 \e[90m]\e[0m" - #"\e[90m[ \e[1;93m\u23F9\e[0m\e[2;33m\u23F9 \e[90m]\e[0m" - #"\e[90m[ \e[1;93m\u23F9\e[0m\e[2;33m\u23F9 \e[90m]\e[0m" - #"\e[90m[\e[1;93m\u23F9\e[0m\e[2;33m\u23F9 \e[90m]\e[0m" + #"\e[90m[\e[2;33m\u23F9\e[0m\e[1;93m\u23F9 \e[0m\e[90m]\e[0m" + #"\e[90m[ \e[2;33m\u23F9\e[0m\e[1;93m\u23F9 \e[0m\e[90m]\e[0m" + #"\e[90m[ \e[2;33m\u23F9\e[0m\e[1;93m\u23F9 \e[0m\e[90m]\e[0m" + #"\e[90m[ \e[2;33m\u23F9\e[0m\e[1;93m\u23F9 \e[0m\e[90m]\e[0m" + #"\e[90m[ \e[2;33m\u23F9\e[0m\e[1;93m\u23F9\e[0m\e[90m]\e[0m" + #"\e[90m[ \e[1;93m\u23F9\e[0m\e[2;33m\u23F9\e[0m\e[90m]\e[0m" + #"\e[90m[ \e[1;93m\u23F9\e[0m\e[2;33m\u23F9 \e[0m\e[90m]\e[0m" + #"\e[90m[ \e[1;93m\u23F9\e[0m\e[2;33m\u23F9 \e[0m\e[90m]\e[0m" + #"\e[90m[ \e[1;93m\u23F9\e[0m\e[2;33m\u23F9 \e[0m\e[90m]\e[0m" + #"\e[90m[\e[1;93m\u23F9\e[0m\e[2;33m\u23F9 \e[0m\e[90m]\e[0m" "\e[90m[\e[1;93m. \e[90m]\e[0m" - "\e[90m[\e[2;33m.\e[0m\e[1;93m. \e[90m]\e[0m" - "\e[90m[ \e[2;33m.\e[0m\e[1;93m. \e[90m]\e[0m" - "\e[90m[ \e[2;33m.\e[0m\e[1;93m. \e[90m]\e[0m" - "\e[90m[ \e[2;33m.\e[0m\e[1;93m. \e[90m]\e[0m" - "\e[90m[ \e[2;33m.\e[0m\e[1;93m.\e[90m]\e[0m" - "\e[90m[ \e[1;93m.\e[0m\e[2;33m.\e[90m]\e[0m" - "\e[90m[ \e[1;93m.\e[0m\e[2;33m. \e[90m]\e[0m" - "\e[90m[ \e[1;93m.\e[0m\e[2;33m. \e[90m]\e[0m" - "\e[90m[ \e[1;93m.\e[0m\e[2;33m. \e[90m]\e[0m" - "\e[90m[\e[1;93m.\e[0m\e[2;33m. \e[90m]\e[0m" + "\e[90m[\e[2;33m.\e[0m\e[1;93m. \e[0m\e[90m]\e[0m" + "\e[90m[ \e[2;33m.\e[0m\e[1;93m. \e[0m\e[90m]\e[0m" + "\e[90m[ \e[2;33m.\e[0m\e[1;93m. \e[0m\e[90m]\e[0m" + "\e[90m[ \e[2;33m.\e[0m\e[1;93m. \e[0m\e[90m]\e[0m" + "\e[90m[ \e[2;33m.\e[0m\e[1;93m.\e[0m\e[90m]\e[0m" + "\e[90m[ \e[1;93m.\e[0m\e[2;33m.\e[0m\e[90m]\e[0m" + "\e[90m[ \e[1;93m.\e[0m\e[2;33m. \e[0m\e[90m]\e[0m" + "\e[90m[ \e[1;93m.\e[0m\e[2;33m. \e[0m\e[90m]\e[0m" + "\e[90m[ \e[1;93m.\e[0m\e[2;33m. \e[0m\e[90m]\e[0m" + "\e[90m[\e[1;93m.\e[0m\e[2;33m. \e[0m\e[90m]\e[0m" ) for (( i=0; i<=${#aprocess_string[*]}; i++ )); do - (( i == 10 )) && i=1 + (( i == 11 )) && i=1 builtin printf "\r${aprocess_string[i]} " sleep 0.15 From 9dc90b96c81293fa7b5085b609340c108525ae12 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Jan 2018 01:16:15 +0100 Subject: [PATCH 262/390] v6.0 + tiny --- dietpi/dietpi-process_tool | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-process_tool b/dietpi/dietpi-process_tool index 15bb6d1557..7c2ab09129 100644 --- a/dietpi/dietpi-process_tool +++ b/dietpi/dietpi-process_tool @@ -73,7 +73,7 @@ aPID[$i]=$line #info - echo -e " ${aNAME[$i]} (${aPID[$i]})" + echo -e "${aNAME[$i]} (${aPID[$i]})" # - Check if PID exists (this can occur with programs like netdata that run as root initally, create a new process under a different user, then terminate the original root process. if (( ! $( ps ax | awk '{print $1}' | grep -ci -m1 "${aPID[$i]}") )); then From d0fbe60e367152cdab2e144544e6b32a8e4e257e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Jan 2018 01:17:18 +0100 Subject: [PATCH 263/390] v6.0 + Fix quoting --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 3b017d8f3e..ec2ab9a054 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -15818,7 +15818,7 @@ _EOF_ Banner_Configs(){ G_DIETPI-NOTIFY 3 DietPi-Software "Optimize and configure software" - G_DIETPI-NOTIFY 2 "Applying DietPi optimizations and configurations for $G_HW_MODEL_DESCRIPTION", please wait...\n" + G_DIETPI-NOTIFY 2 "Applying DietPi optimizations and configurations for $G_HW_MODEL_DESCRIPTION, please wait...\n" } From b0fda8140cc9dfa97620623a7b56f85fff598cb5 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 8 Jan 2018 11:54:47 +0000 Subject: [PATCH 264/390] v6.0 - Minor text --- dietpi/func/dietpi-globals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index f529263d42..b1e35292d8 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -981,7 +981,7 @@ $print_logfile_info else - G_DIETPI-NOTIFY 2 "($i) | Not found, flagging pre-req APT package for installation" + G_DIETPI-NOTIFY 2 "($i) | Not found, flagged for installation" packages_to_install+=" $i" fi From 0edf8a2623de9ba0d269e4c558c6b764c3583329 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 8 Jan 2018 12:02:43 +0000 Subject: [PATCH 265/390] v6.0 + Unset local functions: https://github.com/Fourdee/DietPi/pull/1377 + G_TREESIZE to declare its a global, + optional input directory RE: @MichaIng --- dietpi/func/dietpi-globals | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index b1e35292d8..5b21d7ed5b 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -70,9 +70,10 @@ [ -f /var/www/nextcloud/occ ] && ncc(){ sudo -u www-data php /var/www/nextcloud/occ "$@"; } # - Treesize - treesize() + # $1 = Optional input directory (eg: G_TREESIZE /etc/apt) + G_TREESIZE() { - du -k --max-depth=1 | sort -nr | awk ' + du -k --max-depth=1 $1 | sort -nr | awk ' BEGIN { split("KB,MB,GB,TB", Units, ","); } @@ -287,14 +288,14 @@ fi #----------------------------------------------------------------------------------- - #unset ainput_string + unset ainput_string # Unset also internal functions, otherwise they are accessible from terminal. - #unset Print_Process_Animation - #unset Print_Ok - #unset Print_Failed - #unset Print_Info - #unset Print_Process - #unset Print_Input_String + unset Print_Process_Animation + unset Print_Ok + unset Print_Failed + unset Print_Info + unset Print_Process + unset Print_Input_String #----------------------------------------------------------------------------------- } From da8868b374c3804301e987167cafffe5609d727e Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 8 Jan 2018 12:54:56 +0000 Subject: [PATCH 266/390] v6.0 DietPi-Software | Mosquitto: Resolved various issues with failed install, due to Mosq repo not being maintained (deb's missing from repo header list, requires non-stretch available packages). deb's are now hosted on dietpi.com: https://github.com/Fourdee/DietPi/issues/1306 --- CHANGELOG.txt | 2 +- dietpi/dietpi-software | 83 +++++++++++++++--------------------------- 2 files changed, 31 insertions(+), 54 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index baad357c2e..b0f9124206 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -42,7 +42,7 @@ DietPi-Software | Shairport-sync (Stretch): Resolved an issue where this would f DietPi-Software | Plex Media Server: Resolved uninstall to include /var/lib/plexmediaserver in removal (which is not completed via apt purge). DietPi-Software | MariaDB: Resolved an issue where MariaDB would fail to uninstall correctly: https://github.com/Fourdee/DietPi/pull/1280 DietPi-Software | Aira2 (Stretch): Resolved installation, now used APT installation: https://github.com/Fourdee/DietPi/issues/1310 -DietPi-Software | Mosquitto (Stretch): Resolved issue with failed install, due to unavailable pre-req libs in Debian/Mosq repos: https://github.com/Fourdee/DietPi/issues/1306 +DietPi-Software | Mosquitto: Resolved various issues with failed install, due to Mosq repo not being maintained (deb's missing from repo header list, requires non-stretch available packages). deb's are now hosted on dietpi.com: https://github.com/Fourdee/DietPi/issues/1306 DietPi-Software | ownCloud/Nextcloud: Fixed an installation issue on Jessie with MariaDB: https://github.com/Fourdee/DietPi/pull/1319 DietPi-Software | Google AIY: Updated install to gitbranch=voicekit. Many thanks to @mpember for the heads up: https://github.com/Fourdee/DietPi/issues/1065#issuecomment-354304388 DietPi-Update | dietpi.txt is now checked for missing entries, and, will now be patched during the update: https://github.com/Fourdee/DietPi/issues/1292#issuecomment-350818969 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index ec2ab9a054..3bcc7d6088 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4811,83 +4811,60 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS="http://repo.mosquitto.org/debian/mosquitto-$G_DISTRO_NAME.list" - G_CHECK_URL "$INSTALL_URL_ADDRESS" - - wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key - apt-key add mosquitto-repo.gpg.key - rm mosquitto-repo.gpg.key - - wget "$INSTALL_URL_ADDRESS" -O /etc/apt/sources.list.d/mosquitto-"$G_DISTRO_NAME".list - - # - ARM64 + # - ARMv8 if (( $G_HW_ARCH == 3 )); then - echo -e "deb [arch=armhf] http://repo.mosquitto.org/debian $G_DISTRO_NAME main" > /etc/apt/sources.list.d/mosquitto-"$G_DISTRO_NAME".list dpkg --add-architecture armhf + G_AGUP fi - #Pre-Req stretch + #Pre-Req # - libssl1.0.0 no longer available: https://github.com/Fourdee/DietPi/issues/1299 - if (( $G_DISTRO >= 4 )); then - - INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/' - - # - ARMv6/7 - if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then - - INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_armhf.deb' + INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/' - # - ARM64 - elif (( $G_HW_ARCH == 3 )); then - - INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_arm64.deb' - - # - x86_64 - elif (( $G_HW_ARCH == 10 )); then + # - ARMv6/7/8 + if (( $G_HW_ARCH >= 1 && $G_HW_ARCH <= 3 )); then - INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_amd64.deb' + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_armhf.deb' - fi + # - x86_64 + elif (( $G_HW_ARCH == 10 )); then - G_CHECK_URL "$INSTALL_URL_ADDRESS" + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_amd64.deb' - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb + fi - # - libwebsockets3 no longer available: https://github.com/Fourdee/DietPi/issues/1299 - INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/' + G_CHECK_URL "$INSTALL_URL_ADDRESS" - # - ARMv6/7 - if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb - INSTALL_URL_ADDRESS+='libwebsockets3_1.2.2-1_armhf.deb' + INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/mosquitto_1.4.14-0mosquitto1_nows1_armhf.deb' + G_CHECK_URL "$INSTALL_URL_ADDRESS" + if (( $G_HW_ARCH == 10 )); then - # - ARM64 - elif (( $G_HW_ARCH == 3 )); then + INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/mosquitto_1.4.14-0mosquitto1_nows1_amd64.deb' - INSTALL_URL_ADDRESS+='libwebsockets3_1.2.2-1_arm64.deb' + fi - # - x86_64 - elif (( $G_HW_ARCH == 10 )); then + wget "$INSTALL_URL_ADDRESS" -O package.deb - INSTALL_URL_ADDRESS+='libwebsockets3_1.2.2-1_amd64.deb' + #Install deb + # ARMv8, allow error, so we can install additional required packages automatically + if (( $G_HW_ARCH == 3 )); then - fi + dpkg -i package.deb + G_AGF - G_CHECK_URL "$INSTALL_URL_ADDRESS" + else - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb + G_RUN_CMD dpkg -i package.deb fi - G_AGUP - - G_AGI mosquitto + rm package.deb fi @@ -12799,7 +12776,7 @@ _EOF_ #apt-mark auto libssl1.0.0 libwebsockets3 &> /dev/null G_AGP mosquitto - rm /etc/apt/sources.list.d/mosquitto-*.list + #rm /etc/apt/sources.list.d/mosquitto-*.list elif (( $index == 124 )); then From 0aa1267056a1440457121deda76577cff42b7d7d Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 8 Jan 2018 13:27:13 +0000 Subject: [PATCH 267/390] v6.0 + Removal of G_ERROR_HANDLER_ONERROR_USERMSG: https://github.com/Fourdee/DietPi/issues/1311#issuecomment-355951850 --- dietpi/dietpi-software | 7 ------- dietpi/func/dietpi-globals | 21 --------------------- 2 files changed, 28 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 3bcc7d6088..3debb152f7 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -12574,8 +12574,6 @@ _EOF_ #Inform User G_DIETPI-NOTIFY 3 DietPi-Software "Uninstall" - export G_ERROR_HANDLER_ONERROR_USERMSG="Failed to uninstall:\n - ${aSOFTWARE_WHIP_NAME[$index]}: ${aSOFTWARE_WHIP_DESC[$index]}." - echo -e "" G_DIETPI-NOTIFY 0 "Uninstalling ${aSOFTWARE_WHIP_NAME[$index]}: ${aSOFTWARE_WHIP_DESC[$index]}\n" @@ -13839,7 +13837,6 @@ _EOF_ local package_to_test='bash-doc' - export G_ERROR_HANDLER_ONERROR_USERMSG="DietPi-Software APT simulation has failed:" G_AGI $package_to_test -s #Upgrade Apt @@ -15758,16 +15755,12 @@ _EOF_ G_DIETPI-NOTIFY 3 DietPi-Software "Installing ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}" - export G_ERROR_HANDLER_ONERROR_USERMSG="Failed to Install:\n - ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}." - } Banner_Configuration(){ G_DIETPI-NOTIFY 3 DietPi-Software "Configuring ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}" - export G_ERROR_HANDLER_ONERROR_USERMSG="Failed to configure:\n - ${aSOFTWARE_WHIP_NAME[$INSTALLING_INDEX]}: ${aSOFTWARE_WHIP_DESC[$INSTALLING_INDEX]}." - } Banner_Apt_Update(){ diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 5b21d7ed5b..58887fc395 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -354,7 +354,6 @@ # For export: On error, following entries will be used G_ERROR_HANDLER_ONERROR_EXIT=1 #Do we exit the program when the error occurs? 0=no 1=yes G_ERROR_HANDLER_ONERROR_FPLOGFILE='' #FP to logfile, if available - G_ERROR_HANDLER_ONERROR_USERMSG='' #Additional Message we can show user (eg: apt installation failures, please report to us, fixing tips etc) #Runs automatically after G_ERROR_HANDLER to reset vars to default G_ERROR_HANDLER_RESET(){ @@ -365,14 +364,12 @@ unset G_ERROR_HANDLER_ONERROR_EXIT unset G_ERROR_HANDLER_ONERROR_FPLOGFILE - unset G_ERROR_HANDLER_ONERROR_USERMSG G_ERROR_HANDLER_EXITCODE='' G_ERROR_HANDLER_COMMAND='' G_ERROR_HANDLER_ONERROR_EXIT=1 G_ERROR_HANDLER_ONERROR_FPLOGFILE='' - G_ERROR_HANDLER_ONERROR_USERMSG='' } @@ -381,7 +378,6 @@ # export G_ERROR_HANDLER_COMMAND='Doing something usefull with Owncloud' # export G_ERROR_HANDLER_ONERROR_EXIT=0 # Don't exit program on error, continue # export G_ERROR_HANDLER_ONERROR_FPLOGFILE=/var/log/mylogfile # to print if error occurs - # export G_ERROR_HANDLER_ONERROR_USERMSG='Owncloud failed to pass a test, here is some info....' #optional user message if error occurs. # occ --doing-something-useful # export G_ERROR_HANDLER_EXITCODE=$? # G_ERROR_HANDLER @@ -422,13 +418,6 @@ fi - # - On Error: Display user message? - if [ -n "$G_ERROR_HANDLER_ONERROR_USERMSG" ]; then - - G_DIETPI-NOTIFY 2 "User message:\n$G_ERROR_HANDLER_ONERROR_USERMSG" - - fi - # Display "please report to dietpi", if its one of our programs if [ -n "$G_PROGRAM_NAME" ]; then @@ -464,14 +453,6 @@ fi - # Display optional usermessage? - if [ -n "$G_ERROR_HANDLER_ONERROR_USERMSG" ]; then - - whip_msg+="$G_ERROR_HANDLER_ONERROR_USERMSG" - whip_msg+='\n\n' - - fi - # Display "please report to dietpi", if its one of our programs if [ -n "$G_PROGRAM_NAME" ]; then @@ -553,7 +534,6 @@ $print_logfile_info #NB: This command does not support inputs with redirects. For file creation, use G_FILE_EXISTS afterwards to check it exists: https://github.com/Fourdee/DietPi/issues/1311#issuecomment-354541417 # $@ = input command # eg: - # G_ERROR_HANDLER_ONERROR_USERMSG='We couldn't make a critical directory, holy cow!' #Optional user message if error occurs # G_RUN_CMD mkdir /never/gonna/work G_RUN_CMD(){ @@ -772,7 +752,6 @@ $print_logfile_info #--no-check-certificate #https://github.com/Fourdee/DietPi/issues/352#issuecomment-221013166 - G_ERROR_HANDLER_ONERROR_USERMSG="Connection failed while trying to access: $string. The URL may be offline, or invalid." G_ERROR_HANDLER rm /tmp/G_CHECK_URL From 1059ab7dfa0ff69cf128037cb4da064521ec772e Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 8 Jan 2018 14:02:36 +0000 Subject: [PATCH 268/390] v6.0 + DietPi-Automation | dietpi.txt: CONFIG_NTP_MIRROR will now be applied to systemd-timesyncd configuration: https://github.com/Fourdee/DietPi/issues/1379 + removal of few cats ;) --- CHANGELOG.txt | 1 + dietpi.txt | 6 ++++++ dietpi/conf/cron.daily_dietpi | 2 +- dietpi/conf/cron.hourly_dietpi | 2 +- dietpi/dietpi-config | 2 +- dietpi/func/dietpi-set_software | 3 ++- 6 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b0f9124206..c8799008f5 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -33,6 +33,7 @@ DietPi-Software | NodeRed: Corrected user which nodered runs under, now runs as Bug Fixes: General | Fixed two systemd error messages during shutdown and boot: https://github.com/Fourdee/DietPi/issues/1330 +DietPi-Automation | dietpi.txt: CONFIG_NTP_MIRROR will now be applied to systemd-timesyncd configuration: https://github.com/Fourdee/DietPi/issues/1379 DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi drop during software installs/updates etc: https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480 DietPi-Software | qBittorrent: Resolved an issue with inability to log into web interface: https://github.com/Fourdee/DietPi/issues/1366 DietPi-Software | Resolved an issue where our custom LD_LIBRARY_PATH would cause APT failures. LD_LIBRARY_PATH has now been reverted, apologies if this effected your system: https://github.com/Fourdee/DietPi/issues/1329 diff --git a/dietpi.txt b/dietpi.txt index 38877d7a25..59c10aa6f7 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -135,20 +135,24 @@ CONFIG_CPU_ONDEMAND_SAMPLE_RATE=25000 CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=80 #Samba Client Details (Used by DietPi-Config | Networking NAS | Samba Client) +# NB: Do not modify, you must use dietpi-config to configure/set options CONFIG_SMBCLIENT_COMPUTERNAME=computername CONFIG_SMBCLIENT_SHARENAME=sharename CONFIG_SMBCLIENT_USERNAME=username CONFIG_SMBCLIENT_PASSWORD=password #FTP Client Filesystem Mount (CurlFtpFs) (Used by DietPi-Config | Networking NAS | FTP Client) +# NB: Do not modify, you must use dietpi-config to configure/set options CONFIG_CURLFTPFS_ADDRESS=192.168.0.100 CONFIG_CURLFTPFS_USERNAME=username CONFIG_CURLFTPFS_PASSWORD=password #NFS Client Filesystem Mount (Used by DietPi-Config | Networking NAS | NFS Client) +# NB: Do not modify, you must use dietpi-config to configure/set options CONFIG_NFSCLIENT_ADDRESS= #Proxy settings | System-wide proxy settings. Use dietpi-config > networking options to apply. +# NB: Do not modify, you must use dietpi-config to configure/set options CONFIG_PROXY_ENABLED=0 CONFIG_PROXY_ADDRESS=MyProxyServer.com CONFIG_PROXY_PORT=8080 @@ -162,6 +166,7 @@ CONFIG_BOOT_WAIT_FOR_NETWORK=1 CONFIG_CHECK_DIETPI_UPDATES=1 #NTPD Update Mode: 0=disabled | 1=boot only | 2=boot + daily | 3=boot + hourly | 4=Daemon + Drift +# NB: Do not modify, you must use dietpi-config to configure/set options CONFIG_NTP_MODE=2 #WiFi country code. 2 character value (eg GB US DE JP): https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 @@ -174,6 +179,7 @@ CONFIG_SERIAL_CONSOLE_ENABLE=0 CONFIG_SOUNDCARD=none #LCD Panel addon +# NB: Do not modify, you must use dietpi-config to configure/set options CONFIG_LCDPANEL=none #Prefer IPversion (for: APT) | auto (let system decide) / ipv4 (force) / ipv6 (force) | eg: force IPv4 with CONFIG_PREFER_IPVERSION=ipv4 diff --git a/dietpi/conf/cron.daily_dietpi b/dietpi/conf/cron.daily_dietpi index 8a9b95cef8..904435a165 100644 --- a/dietpi/conf/cron.daily_dietpi +++ b/dietpi/conf/cron.daily_dietpi @@ -10,7 +10,7 @@ # #//////////////////////////////////// - NTPD_UPDATE_MODE=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_NTP_MODE=' | sed 's/.*=//') + NTPD_UPDATE_MODE=$(grep -m1 '^CONFIG_NTP_MODE=' /DietPi/dietpi.txt | sed 's/.*=//') #---------------------------------------------------------------- # Main Loop diff --git a/dietpi/conf/cron.hourly_dietpi b/dietpi/conf/cron.hourly_dietpi index f0cd6aaa69..fd66d6b89f 100644 --- a/dietpi/conf/cron.hourly_dietpi +++ b/dietpi/conf/cron.hourly_dietpi @@ -17,7 +17,7 @@ fi - NTPD_UPDATE_MODE=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_NTP_MODE=' | sed 's/.*=//') + NTPD_UPDATE_MODE=$(grep -m1 '^CONFIG_NTP_MODE=' /DietPi/dietpi.txt | sed 's/.*=//') #---------------------------------------------------------------- # Main Loop diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 7128c4769e..ab9953c2ad 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1171,7 +1171,7 @@ whiptail_menu_array+=("Swapfile size" ": $swap_text") #NTPD - local ntpd_mode_current=$(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_NTP_MODE=' | sed 's/.*=//') + local ntpd_mode_current=$(grep -m1 '^CONFIG_NTP_MODE=' /DietPi/dietpi.txt | sed 's/.*=//') local ntpd_mode_text="" if (( $ntpd_mode_current == 0 )); then ntpd_mode_text="Disabled" diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 748249bd0a..33f0a50530 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -187,9 +187,10 @@ _EOF_ if (( $INPUT_MODE_VALUE == 4 )); then # - Set default pool servers + local pool_servers=$(grep -m1 '^CONFIG_NTP_MIRROR=' /DietPi/dietpi.txt | sed 's/.*=//') cat << _EOF_ > /etc/systemd/timesyncd.conf [Time] -Servers=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org +Servers=0.$pool_servers 1.$pool_servers 2.$pool_servers 3.$pool_servers _EOF_ # - enable From d01ac6aeaad842b11c5ec9438557acbaf94963c0 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Jan 2018 15:47:13 +0100 Subject: [PATCH 269/390] v6.0 DietPi-Software | MariaDB: Fix database/user creation: https://github.com/Fourdee/DietPi/issues/1344 --- dietpi/func/create_mysql_db | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dietpi/func/create_mysql_db b/dietpi/func/create_mysql_db index 82e39e1962..f3238a41e3 100644 --- a/dietpi/func/create_mysql_db +++ b/dietpi/func/create_mysql_db @@ -33,12 +33,18 @@ G_DIETPI-NOTIFY 2 "Creating MySql DB for $DATABASE_NAME\n" + # On MariaDB, unix_socket authentication is used, thus no root password is necessary + it breaks access on Jessie. + # If 'IDENTIFIED BY' is used on root user, it will overwrite unix_socket authentication, thus this part need to be left out on MariaDB. #Generate DB - mysql -u root -p$MYSQL_ROOT_PW -e "create database \`$DATABASE_NAME\`;GRANT ALL PRIVILEGES ON \`$DATABASE_NAME\`.* TO $DATABASE_USER@localhost IDENTIFIED BY '$DATABASE_PW';FLUSH PRIVILEGES;" + mysql_auth='-uroot' + grep -q 'aSOFTWARE_INSTALL_STATE[86]=2' /DietPi/dietpi/.installed && mysql_auth+=" -p$MYSQL_ROOT_PW" + grant_privileges='' + [ ! "$DATABASE_USER" == 'root' ] && grant_privileges="GRANT ALL PRIVILEGES ON \`$DATABASE_NAME\`.* TO $DATABASE_USER@localhost IDENTIFIED BY '$DATABASE_PW';flush privileges;" + mysql "$mysql_auth" -e "create database \`$DATABASE_NAME\`;$grant_privileges" G_DIETPI-NOTIFY -1 $? "Create database $DATABASE_NAME |" #----------------------------------------------------------------------------------- exit #----------------------------------------------------------------------------------- -} \ No newline at end of file +} From 46c86b34d066ab2b42e93e456a42e7fc66769b18 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Jan 2018 16:02:03 +0100 Subject: [PATCH 270/390] v6.0 DietPi-Software | MariaDB/MySQL: Fix some possible installation issues --- dietpi/dietpi-software | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 3debb152f7..f63425fe51 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3677,6 +3677,8 @@ _EOF_ debconf-set-selections <<< "mysql-server mysql-server/root_password password $GLOBAL_PW" debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $GLOBAL_PW" + # In case remove old symlink, created by DietPi MySQL/MariaDB installation, otherwise installation will fail. + rm /var/lib/mysql &> /dev/null G_AGI mysql-server # Fix depricated key_buffer -> key_buffer_size per MySQL 5.x notification @@ -3693,6 +3695,8 @@ _EOF_ Banner_Installing + # In case remove old symlink, created by DietPi MySQL/MariaDB installation, otherwise installation will fail. + rm /var/lib/mysql &> /dev/null G_AGI mariadb-server fi @@ -8235,6 +8239,22 @@ thread_stack=128K _EOF_ fi + + #WEBSERVER_MARIADB + INSTALLING_INDEX=88 + if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + + # On Jessie assure unix_socket authentication: + if (( $G_DISTRO < 4 )); then + + mysql -uroot -e "install plugin unix_socket soname 'auth_socket';" + mysql -uroot -e "grant usage on *.* to 'root'@'localhost' identified via unix_socket;flush privileges;" + # Drop unnecessary root user children. + mysql -uroot -e "drop user root@dietpi;drop user root@'127.0.0.1';drop user root@'::1';" + + fi + + fi #MariaDB + MySQL | Move SQL store to userdata location: https://github.com/Fourdee/DietPi/issues/672 if (( ${aSOFTWARE_INSTALL_STATE[86]} == 1 || @@ -12663,7 +12683,7 @@ _EOF_ rm /var/lib/mysql/debian-* # - SQL store - rm -R /var/lib/mysql + rm /var/lib/mysql &> /dev/null || rm -R /var/lib/mysql &> /dev/null #in case of symlink or folder rm -R "$G_FP_DIETPI_USERDATA"/mysql elif (( $index == 87 )); then From ad705f513b9bc09c1b2bc7a65c7c46fd00e3c5f9 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 8 Jan 2018 15:03:35 +0000 Subject: [PATCH 271/390] v6.0 + run_ntpd | Added support for systemd-timesyncd completion/detection: https://github.com/Fourdee/DietPi/issues/1379 --- CHANGELOG.txt | 1 + dietpi/func/run_ntpd | 63 +++++++++++++++++++++++++++++++++++++++----- 2 files changed, 58 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c8799008f5..e86fdd153b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -30,6 +30,7 @@ DietPi-Software | ownCloud/Nextcloud: Switch to pretty URLs (without "index.php" DietPi-Software | Nextcloud: Resolve OPcache admin panel warnings on Lighttpd DietPi-Software | UrBackup: Installation updated to latest version 2.1.20. For new installations only: https://github.com/Fourdee/DietPi/issues/1335 DietPi-Software | NodeRed: Corrected user which nodered runs under, now runs as its own user, created during install: https://github.com/Fourdee/DietPi/issues/1294#issuecomment-354314318 +run_ntpd | Added support for systemd-timesyncd completion/detection: https://github.com/Fourdee/DietPi/issues/1379 Bug Fixes: General | Fixed two systemd error messages during shutdown and boot: https://github.com/Fourdee/DietPi/issues/1330 diff --git a/dietpi/func/run_ntpd b/dietpi/func/run_ntpd index 525c24c822..82b7814010 100644 --- a/dietpi/func/run_ntpd +++ b/dietpi/func/run_ntpd @@ -22,6 +22,7 @@ . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER export G_PROGRAM_NAME='DietPi-Run_ntpd' + export G_USER_INPUTS=0 #Import DietPi-Globals --------------------------------------------------------------- INPUT_MODE=$1 @@ -54,10 +55,25 @@ ntpd -gq -l /var/log/ntpd.log &> /dev/null EXIT_CODE=$? - #systemD-timesyncd/other method: assume status is ok + #systemd-timesyncd + elif (( $NTPD_UPDATE_MODE == 4 )); then + + if (( $(systemctl is-active systemd-timesyncd | grep -ci -m1 '^active') )); then + + G_DIETPI-NOTIFY 0 "NTPD: systemd-timesyncd detected" + EXIT_CODE=0 + + else + + G_DIETPI-NOTIFY 1 "NTPD: systemd-timesyncd is not active" + EXIT_CODE=1 + + fi + + #other method: assume status is ok else - G_DIETPI-NOTIFY 0 "NTPD: non-NTPD mode detected. Completed" + G_DIETPI-NOTIFY 0 "NTPD: manual mode detected" EXIT_CODE=0 fi @@ -105,10 +121,32 @@ done - #systemD-timesyncd/other method: assume status is ok + #systemd-timesyncd + elif (( $NTPD_UPDATE_MODE == 4 )); then + + while true + do + + TIME_SYNCED=$(timedatectl status --no-pager | grep -ci -m1 'NTP synchronized: yes') + if (( $TIME_SYNCED )); then + + G_DIETPI-NOTIFY 0 "NTPD: systemd-timesyncd" + EXIT_CODE=0 + break + + else + + G_DIETPI-NOTIFY 2 "NTPD: Waiting for completion of systemd-timesyncd" + sleep 1 + + fi + + done + + #other method: assume status is ok else - G_DIETPI-NOTIFY 0 "NTPD: non-NTPD mode detected. Completed" + G_DIETPI-NOTIFY 0 "NTPD: manual mode detected" EXIT_CODE=0 fi @@ -124,8 +162,21 @@ G_DIETPI-NOTIFY -1 $EXIT_CODE 'NTPD: time sync |' if (( $EXIT_CODE != 0 )); then - G_DIETPI-NOTIFY 2 "NTPD: Please check the log file for more information:" - G_DIETPI-NOTIFY 2 "NTPD: /var/log/ntpd.log" + if (( $NTPD_UPDATE_MODE >= 1 && $NTPD_UPDATE_MODE <= 3 )); then + + G_DIETPI-NOTIFY 2 "NTPD: Please check the log file for more information:" + G_DIETPI-NOTIFY 2 "NTPD: /var/log/ntpd.log" + + elif (( $NTPD_UPDATE_MODE == 4 )); then + + G_DIETPI-NOTIFY 2 "NTPD: Please check the service status for more information:" + G_DIETPI-NOTIFY 2 "NTPD: systemctl status systemd-timesyncd -l" + + else + + echo -e "Should never occur" + + fi fi #----------------------------------------------------------------------------------- From cff30be1751d105a631fb86f87cf0a52ab1a2782 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 8 Jan 2018 15:54:41 +0000 Subject: [PATCH 272/390] v6.0 + Fixes/optimzations for functions: https://github.com/Fourdee/DietPi/issues/1379 --- dietpi/boot | 4 +-- dietpi/dietpi-config | 11 ++---- dietpi/func/dietpi-set_software | 63 +++++++++++++-------------------- 3 files changed, 30 insertions(+), 48 deletions(-) diff --git a/dietpi/boot b/dietpi/boot index 8623112618..fe9a4d0d54 100644 --- a/dietpi/boot +++ b/dietpi/boot @@ -358,8 +358,8 @@ /DietPi/dietpi/func/dietpi-set_software apt-mirror $(cat /DietPi/dietpi.txt | grep -m1 "^$TARGET_REPO=" | sed 's/.*=//') - # - Set NTPD mirror - /DietPi/dietpi/func/dietpi-set_software ntpd-mirror $(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_NTP_MIRROR=' | sed 's/.*=//') + # - Set NTPD + #/DietPi/dietpi/func/dietpi-set_software ntpd-mode $(grep -m1 '^CONFIG_NTP_MODE=' /DietPi/dietpi.txt | sed 's/.*=//') #Disable /tmp tmpfs if RAM <= 512MB: https://github.com/Fourdee/DietPi/issues/1027 if (( $(free -m | grep -m1 'Mem:' | awk '{print $2}') <= 512 )); then diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index ab9953c2ad..adfb766167 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -4907,7 +4907,7 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ fi #NTPD mirror - local ntpd_mirror_current=$(cat /etc/ntp.conf | grep -m1 '^server 0.' | awk '{print $2}' | sed 's/^0.//g') + local ntpd_mirror_current=$(grep -m1 '^CONFIG_NTP_MIRROR=' /DietPi/dietpi.txt | sed 's/.*=//') if [ ! -n "$ntpd_mirror_current" ]; then ntpd_mirror_current='Unknown, no string from scrape' @@ -5076,13 +5076,8 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ esac - /DietPi/dietpi/func/dietpi-set_software ntpd-mirror $OPTION - - # Kill all existing, refresh now - killall -w /DietPi/dietpi/func/run_ntpd &> /dev/null - killall -w ntpd &> /dev/null - rm /var/lib/dietpi/.ntpd_exit_status &> /dev/null - /DietPi/dietpi/func/run_ntpd status + sed -i "/CONFIG_NTP_MIRROR=/c\CONFIG_NTP_MIRROR=$OPTION" /DietPi/dietpi.txt + /DietPi/dietpi/func/dietpi-set_software ntpd-mode $(grep -m1 '^CONFIG_NTP_MODE=' /DietPi/dietpi.txt | sed 's/.*=//') #Return to this Menu TARGETMENUID=16 diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 33f0a50530..4d41fe435f 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -18,7 +18,6 @@ $FP_SCRIPT allo eth_dhcp / eth_static $FP_SCRIPT useradd X=create user with name X and default permissions, using global DietPi password (dietpi) $FP_SCRIPT userdel X=delete user with name X $FP_SCRIPT apt-mirror url/default -$FP_SCRIPT ntpd-mirror url/default $FP_SCRIPT ntpd-mode configures NTPD mode (eg: ntp/systemd) $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entries if required " @@ -128,41 +127,10 @@ _EOF_ } - #///////////////////////////////////////////////////////////////////////////////////// - # Set NTPD mirror - #///////////////////////////////////////////////////////////////////////////////////// - NtpdMirror_Main(){ - - if [ -n "$INPUT_MODE_VALUE" ]; then - - # - Set defaults? - if [ "$INPUT_MODE_VALUE" = "default" ]; then - - INPUT_MODE_VALUE='debian.pool.ntp.org' - - fi - - sed -i '/^server [0-9]/d' /etc/ntp.conf - for ((i=0; i<4; i++)) - do - - echo -e "server $i.$INPUT_MODE_VALUE iburst" >> /etc/ntp.conf - - done - - # - Update DietPi.txt - sed -i "/CONFIG_NTP_MIRROR=/c\CONFIG_NTP_MIRROR=$INPUT_MODE_VALUE" /DietPi/dietpi.txt - - else - - Unknown_Input_Mode - - fi - - } - #///////////////////////////////////////////////////////////////////////////////////// # Set NTPD Mode + # NB: also sets mirror as defined in dietpi.txt CONFIG_NTP_MIRROR + # NB: Also restarts NTP updates #///////////////////////////////////////////////////////////////////////////////////// NtpdMode_Main(){ @@ -171,11 +139,28 @@ _EOF_ # - Reset global to disabled, prevents run_ntpd in dietpi-software sed -i "/CONFIG_NTP_MODE=/c\CONFIG_NTP_MODE=0" /DietPi/dietpi.txt + local ntpd_mirror=$(grep -m1 '^CONFIG_NTP_MIRROR=' /DietPi/dietpi.txt | sed 's/.*=//') + # - Set defaults? + if [ "$ntpd_mirror" = "default" ]; then + + ntpd_mirror='debian.pool.ntp.org' + + fi + #Install ntp if required if (( $INPUT_MODE_VALUE >= 1 && $INPUT_MODE_VALUE <= 3 )); then /DietPi/dietpi/dietpi-software install 170 + # - Set NTPD mirror + sed -i '/^server [0-9]/d' /etc/ntp.conf + for ((i=0; i<4; i++)) + do + + echo -e "server $i.$ntpd_mirror iburst" >> /etc/ntp.conf + + done + #Uninstall ntp if not required else @@ -186,18 +171,16 @@ _EOF_ #Setup Drift mode, use SystemD if (( $INPUT_MODE_VALUE == 4 )); then - # - Set default pool servers - local pool_servers=$(grep -m1 '^CONFIG_NTP_MIRROR=' /DietPi/dietpi.txt | sed 's/.*=//') + # - Set NTPD mirror cat << _EOF_ > /etc/systemd/timesyncd.conf [Time] -Servers=0.$pool_servers 1.$pool_servers 2.$pool_servers 3.$pool_servers +Servers=0.$ntpd_mirror 1.$ntpd_mirror 2.$ntpd_mirror 3.$ntpd_mirror _EOF_ # - enable systemctl daemon-reload timedatectl set-ntp true - #Disable SystemD and allow "run_ntpd" script to take control else @@ -210,6 +193,10 @@ _EOF_ sed -i "/CONFIG_NTP_MODE=/c\CONFIG_NTP_MODE=$INPUT_MODE_VALUE" /DietPi/dietpi.txt # - Update now + # Kill all existing, refresh now + killall -w /DietPi/dietpi/func/run_ntpd &> /dev/null + killall -w ntpd &> /dev/null + rm /var/lib/dietpi/.ntpd_exit_status &> /dev/null /DietPi/dietpi/func/run_ntpd status else From 07765368d28547dc2148904c3856840183de7ab1 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Jan 2018 17:01:11 +0100 Subject: [PATCH 273/390] v6.0 + Include MySQL install stage 1, for password authentication. --- dietpi/func/create_mysql_db | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/create_mysql_db b/dietpi/func/create_mysql_db index f3238a41e3..da9d7ffd13 100644 --- a/dietpi/func/create_mysql_db +++ b/dietpi/func/create_mysql_db @@ -37,7 +37,7 @@ # If 'IDENTIFIED BY' is used on root user, it will overwrite unix_socket authentication, thus this part need to be left out on MariaDB. #Generate DB mysql_auth='-uroot' - grep -q 'aSOFTWARE_INSTALL_STATE[86]=2' /DietPi/dietpi/.installed && mysql_auth+=" -p$MYSQL_ROOT_PW" + grep -q 'aSOFTWARE_INSTALL_STATE[86]=0' /DietPi/dietpi/.installed || mysql_auth+=" -p$MYSQL_ROOT_PW" grant_privileges='' [ ! "$DATABASE_USER" == 'root' ] && grant_privileges="GRANT ALL PRIVILEGES ON \`$DATABASE_NAME\`.* TO $DATABASE_USER@localhost IDENTIFIED BY '$DATABASE_PW';flush privileges;" mysql "$mysql_auth" -e "create database \`$DATABASE_NAME\`;$grant_privileges" From 325de58298b21b20d2b38703b630c154d0708384 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 8 Jan 2018 16:10:39 +0000 Subject: [PATCH 274/390] v6.0 + DietPi-Automation | dietpi.txt: CONFIG_NTP_MODE will now be applied during 1st run of device: https://github.com/Fourdee/DietPi/issues/1379 --- CHANGELOG.txt | 1 + dietpi.txt | 1 - dietpi/boot | 6 +++--- dietpi/func/dietpi-set_software | 29 ++++++++++++++++++++++------- dietpi/func/run_ntpd | 15 +++++++++++---- 5 files changed, 37 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e86fdd153b..aac3c38b2a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -17,6 +17,7 @@ General | SparkySBC: CPU gov default changed to Performance, reports of increase General | Swapfile generation is now completed during 1st run of dietpi-software (previously boot stage): https://github.com/Fourdee/DietPi/issues/1270#issue-278797206 General | DietPi-Funtime: Removed from DietPi. Although it looked pretty, it did absolutely nothing (except slow down a program) DietPi-Automation | All dietpi.txt entries have been renamed and cleaned up. +DietPi-Automation | dietpi.txt: CONFIG_NTP_MODE will now be applied during 1st run of device: https://github.com/Fourdee/DietPi/issues/1379 DietPi-Boot | Improved the method of initial FS_partition and FS_expansion during 1st run, via systemD services. 'fs_force_resize=' in dietpi.txt is no longer supported: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352159930 DietPi-Banner | IP: Will now also list the active network adapter used (eg: eth0/wlan0) DietPi-Config | Dion Audio LOCO V1/V2: Soundcards added for RPi. diff --git a/dietpi.txt b/dietpi.txt index 59c10aa6f7..e73e6b34d5 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -166,7 +166,6 @@ CONFIG_BOOT_WAIT_FOR_NETWORK=1 CONFIG_CHECK_DIETPI_UPDATES=1 #NTPD Update Mode: 0=disabled | 1=boot only | 2=boot + daily | 3=boot + hourly | 4=Daemon + Drift -# NB: Do not modify, you must use dietpi-config to configure/set options CONFIG_NTP_MODE=2 #WiFi country code. 2 character value (eg GB US DE JP): https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 diff --git a/dietpi/boot b/dietpi/boot index fe9a4d0d54..5f1de1df61 100644 --- a/dietpi/boot +++ b/dietpi/boot @@ -358,9 +358,6 @@ /DietPi/dietpi/func/dietpi-set_software apt-mirror $(cat /DietPi/dietpi.txt | grep -m1 "^$TARGET_REPO=" | sed 's/.*=//') - # - Set NTPD - #/DietPi/dietpi/func/dietpi-set_software ntpd-mode $(grep -m1 '^CONFIG_NTP_MODE=' /DietPi/dietpi.txt | sed 's/.*=//') - #Disable /tmp tmpfs if RAM <= 512MB: https://github.com/Fourdee/DietPi/issues/1027 if (( $(free -m | grep -m1 'Mem:' | awk '{print $2}') <= 512 )); then @@ -379,6 +376,9 @@ Workaround_WiFi + # - Set NTPD + /DietPi/dietpi/func/dietpi-set_software ntpd-mode $(grep -m1 '^CONFIG_NTP_MODE=' /DietPi/dietpi.txt | sed 's/.*=//') + #Finished /DietPi/dietpi/dietpi-banner 0 echo -e " Default Login:\n Username = root\n Password = dietpi\n" diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 4d41fe435f..f177e20a5b 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -130,7 +130,7 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// # Set NTPD Mode # NB: also sets mirror as defined in dietpi.txt CONFIG_NTP_MIRROR - # NB: Also restarts NTP updates + # NB: Also restarts NTP updates and waits for them to complete #///////////////////////////////////////////////////////////////////////////////////// NtpdMode_Main(){ @@ -139,6 +139,11 @@ _EOF_ # - Reset global to disabled, prevents run_ntpd in dietpi-software sed -i "/CONFIG_NTP_MODE=/c\CONFIG_NTP_MODE=0" /DietPi/dietpi.txt + # Kill all existing ntp + killall -w /DietPi/dietpi/func/run_ntpd &> /dev/null + killall -w ntpd &> /dev/null + rm /var/lib/dietpi/.ntpd_exit_status &> /dev/null + local ntpd_mirror=$(grep -m1 '^CONFIG_NTP_MIRROR=' /DietPi/dietpi.txt | sed 's/.*=//') # - Set defaults? if [ "$ntpd_mirror" = "default" ]; then @@ -150,7 +155,12 @@ _EOF_ #Install ntp if required if (( $INPUT_MODE_VALUE >= 1 && $INPUT_MODE_VALUE <= 3 )); then - /DietPi/dietpi/dietpi-software install 170 + # - avoid dpsoftware install if system first run is not completed + if (( $G_DIETPI_INSTALL_STAGE >= 0 )); then + + /DietPi/dietpi/dietpi-software install 170 + + fi # - Set NTPD mirror sed -i '/^server [0-9]/d' /etc/ntp.conf @@ -164,7 +174,16 @@ _EOF_ #Uninstall ntp if not required else - /DietPi/dietpi/dietpi-software uninstall 170 + # - avoid dpsoftware uninstall if system first run is not completed + if (( $G_DIETPI_INSTALL_STAGE >= 0 )); then + + /DietPi/dietpi/dietpi-software uninstall 170 + + else + + G_AGP ntp + + fi fi @@ -193,10 +212,6 @@ _EOF_ sed -i "/CONFIG_NTP_MODE=/c\CONFIG_NTP_MODE=$INPUT_MODE_VALUE" /DietPi/dietpi.txt # - Update now - # Kill all existing, refresh now - killall -w /DietPi/dietpi/func/run_ntpd &> /dev/null - killall -w ntpd &> /dev/null - rm /var/lib/dietpi/.ntpd_exit_status &> /dev/null /DietPi/dietpi/func/run_ntpd status else diff --git a/dietpi/func/run_ntpd b/dietpi/func/run_ntpd index 82b7814010..a2cd69af9a 100644 --- a/dietpi/func/run_ntpd +++ b/dietpi/func/run_ntpd @@ -91,11 +91,12 @@ #----------------------------------------------------------------------------------- if [ "$INPUT_MODE" = "status" ]; then + MAX_LOOPS=30 + CURRENT_LOOP=1 + #NTPD: if (( $NTPD_UPDATE_MODE >= 1 && $NTPD_UPDATE_MODE <= 3 )); then - MAX_LOOPS=30 - CURRENT_LOOP=1 while (( $CURRENT_LOOP <= $MAX_LOOPS )) do @@ -128,7 +129,13 @@ do TIME_SYNCED=$(timedatectl status --no-pager | grep -ci -m1 'NTP synchronized: yes') - if (( $TIME_SYNCED )); then + if (( $CURRENT_LOOP >= $MAX_LOOPS )); then + + G_DIETPI-NOTIFY 2 "NTPD: time out waiting for systemd-timesyncd" + EXIT_CODE=1 + break + + elif (( $TIME_SYNCED )); then G_DIETPI-NOTIFY 0 "NTPD: systemd-timesyncd" EXIT_CODE=0 @@ -136,7 +143,7 @@ else - G_DIETPI-NOTIFY 2 "NTPD: Waiting for completion of systemd-timesyncd" + G_DIETPI-NOTIFY 2 "NTPD: Waiting for completion of systemd-timesyncd ($CURRENT_LOOP/$MAX_LOOPS)" sleep 1 fi From 928353e5e15c3ed537736e4e63bf667f986d9169 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 8 Jan 2018 16:12:59 +0000 Subject: [PATCH 275/390] v6.0 + Whoopsie! --- dietpi/func/run_ntpd | 1 + 1 file changed, 1 insertion(+) diff --git a/dietpi/func/run_ntpd b/dietpi/func/run_ntpd index a2cd69af9a..9342394ba0 100644 --- a/dietpi/func/run_ntpd +++ b/dietpi/func/run_ntpd @@ -145,6 +145,7 @@ G_DIETPI-NOTIFY 2 "NTPD: Waiting for completion of systemd-timesyncd ($CURRENT_LOOP/$MAX_LOOPS)" sleep 1 + ((CURRENT_LOOP++)) fi From 5f23995b3990fd766be3b8635813d9894dd9a315 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 9 Jan 2018 12:36:56 +0000 Subject: [PATCH 276/390] v6.0 + DietPi-Config | Locale: en_GB.UTF-8 is now automatically installed, alongside user selected choice. Required for DietPi scripts to function. + Function locale through dietpi scripts: https://github.com/Fourdee/DietPi/issues/1285 --- CHANGELOG.txt | 1 + PREP_SYSTEM_FOR_DIETPI.sh | 4 +-- dietpi.txt | 4 +-- dietpi/dietpi-config | 40 +++++++++--------------- dietpi/dietpi-software | 17 +++++----- dietpi/func/dietpi-set_software | 55 +++++++++++++++++++++++++++++++++ 6 files changed, 84 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index aac3c38b2a..3c1d388bf1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -21,6 +21,7 @@ DietPi-Automation | dietpi.txt: CONFIG_NTP_MODE will now be applied during 1st r DietPi-Boot | Improved the method of initial FS_partition and FS_expansion during 1st run, via systemD services. 'fs_force_resize=' in dietpi.txt is no longer supported: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352159930 DietPi-Banner | IP: Will now also list the active network adapter used (eg: eth0/wlan0) DietPi-Config | Dion Audio LOCO V1/V2: Soundcards added for RPi. +DietPi-Config | Locale: en_GB.UTF-8 is now automatically installed, alongside user selected choice. Required for DietPi scripts to function. DietPi-Drive_Manager | Added support for exFAT, many thanks @MichaIng : https://github.com/Fourdee/DietPi/pull/1312 DietPi-Globals | Global variables and functions are now exported during login. Please see the sourcecode for more information: https://github.com/Fourdee/DietPi/issues/1311 DietPi-Set_Hardware | Sparky SBC: enable aotg.aotg1_speed compatibility setting for USB 1.1, when USB-DAC configured: https://github.com/Fourdee/DietPi/issues/1301 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 98cf813fb3..e47a6dca3c 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -66,6 +66,7 @@ echo 'prefer-family = IPv4' >> /etc/wgetrc #Setup locale + # NB: DEV, any changes here must be also rolled into function '/DietPi/dietpi/func/dietpi-set_software locale', for future script use echo 'en_GB.UTF-8 UTF-8' > /etc/locale.gen dpkg-reconfigure -f noninteractive locales if (( $? != 0 )); then @@ -95,8 +96,7 @@ export LANG="en_GB.UTF-8" export LC_ALL="en_GB.UTF-8" export LANGUAGE="en_GB:en" _EOF_ - - + chmod +x /etc/profile.d/99-dietpi-force-locale.sh #Force en_GB Locale for rest of script. Prevents incorrect parsing with non-english locales. LANG=en_GB.UTF-8 diff --git a/dietpi.txt b/dietpi.txt index e73e6b34d5..758791aa57 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -100,8 +100,8 @@ AUTO_SETUP_AUTOSTART_TARGET_INDEX=0 # Language/Regional settings | Requires AUTO_SETUP_AUTOMATED=1 # Timezone eg: Europe/London America/New_York | Full list (TZ*): https://en.wikipedia.org/wiki/List_of_tz_database_time_zones AUTO_SETUP_TIMEZONE=Europe/London -# Locale eg: en_GB OR en_US etc. One entry ONLY. DietPi automatically applies .UTF-8 to your locale | Full list: cat /etc/locale.gen -AUTO_SETUP_LOCALE=en_GB +# Locale eg: en_GB.UTF-8 / en_US.UTF-8 etc. One entry ONLY. +AUTO_SETUP_LOCALE=en_GB.UTF-8 # Keyboard Layout eg: gb us de fr AUTO_SETUP_KEYBOARD_LAYOUT=gb diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index adfb766167..a8b1448c1b 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -2294,53 +2294,40 @@ case "$OPTION" in Locale) - REBOOT_REQUIRED=1 - # - Warn user that DietPi requires en_GB to be installed, to ensure all DietPi script parsing is correct. - whiptail --title "DietPi Locale" --msgbox "DietPi requires en_GB.UTF-8 to be installed. This ensures all DietPi scripts can scrape correctly.\n\nPlease do NOT remove en_GB.UTF-8 from the system, when selecting your Locale." --backtitle "$WHIP_BACKTITLE" 12 65 + REBOOT_REQUIRED=1 dpkg-reconfigure locales - #Pump current system locale into env: https://github.com/Fourdee/DietPi/issues/825 - local locale_current=$(cat /etc/default/locale | grep -m1 '^LANG=' | sed 's/.*=//') + local locale_new=$(grep -m1 '^LANG=' /etc/default/locale | sed 's/.*=//') # Sanity, No result, revert back to default - if [ -z "$locale_current" ]; then + if [ -z "$locale_new" ]; then - locale_current='en_GB.UTF-8' + locale_new='en_GB.UTF-8' fi - cat << _EOF_ > /etc/environment -LC_ALL=$locale_current -LANG=$locale_current -_EOF_ - - # - and default locale (jessie/meveric) - cat << _EOF_ > /etc/default/locale -LC_ALL=$locale_current -LANG=$locale_current -_EOF_ - - # - and force locale for remote access, especially dropbear, where receiving locale from client can't be suppressed: - cat << _EOF_ > /etc/profile.d/99-dietpi-force-locale.sh -# To force server locales on SSH access, as dropbear does automatically overwrite them by client values: -export LANG="$locale_current" -export LC_ALL="$locale_current" -export LANGUAGE="$( echo $locale_current | sed 's/\..*//' ):$( echo $locale_current | sed 's/_.*//' )" -_EOF_ + # - Re-apply locale + auto install en_GB.UTF-8 alongside + /DietPi/dietpi/func/dietpi-set_software locale "$locale_new" #Return to this menu TARGETMENUID=7 + ;; + Timezone) + REBOOT_REQUIRED=1 dpkg-reconfigure tzdata #Return to this menu TARGETMENUID=7 + ;; + Keyboard) + REBOOT_REQUIRED=1 #Keyboard must be plugged in for this to bring up the menu.. @@ -2350,8 +2337,11 @@ _EOF_ #Return to this menu TARGETMENUID=7 + ;; + esac + } ETH_IP_STATIC="0.0.0.0" diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f63425fe51..01a07b00d7 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -13938,18 +13938,19 @@ _EOF_ fi #Apply Language (Locale) - if [ "$AUTOINSTALL_LANGUAGE" != "en_GB" ]; then + if [ "$AUTOINSTALL_LANGUAGE" != "en_GB.UTF-8" ]; then - G_DIETPI-NOTIFY 2 "Setting Locale $AUTOINSTALL_LANGUAGE. Please wait...\n" + G_DIETPI-NOTIFY 2 "Setting Locale $AUTOINSTALL_LANGUAGE. Please wait" - #Enable user setting - sed -i "/$AUTOINSTALL_LANGUAGE.UTF-8/c $AUTOINSTALL_LANGUAGE.UTF-8 UTF-8" /etc/locale.gen - echo -e "LANG=$AUTOINSTALL_LANGUAGE.UTF-8" > /etc/default/locale - echo -e "LC_ALL=$AUTOINSTALL_LANGUAGE.UTF-8" > /etc/environment #This prevents LC_* errors when checking locale on non-rpi devices. + # Sanity, No result, revert back to default + if [ -z "$AUTOINSTALL_LANGUAGE" ]; then - locale-gen + AUTOINSTALL_LANGUAGE='en_GB.UTF-8' + + fi - localectl set-locale LANG="$AUTOINSTALL_LANGUAGE.UTF-8" + # - Re-apply locale + auto install en_GB.UTF-8 alongside + /DietPi/dietpi/func/dietpi-set_software locale "$AUTOINSTALL_LANGUAGE" fi diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index f177e20a5b..dc5a81fdfc 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -14,6 +14,7 @@ FP_SCRIPT='/DietPi/dietpi/func/dietpi-set_software' AVAIABLE_COMMANDS=" Available commands +$FP_SCRIPT locale en_GB.UTF-8 $FP_SCRIPT allo eth_dhcp / eth_static $FP_SCRIPT useradd X=create user with name X and default permissions, using global DietPi password (dietpi) $FP_SCRIPT userdel X=delete user with name X @@ -37,6 +38,7 @@ $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entrie G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW export G_PROGRAM_NAME='DietPi-Set_software' + export G_USER_INPUTS=0 #Import DietPi-Globals --------------------------------------------------------------- EXIT_CODE=0 @@ -56,6 +58,55 @@ $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entrie } + #///////////////////////////////////////////////////////////////////////////////////// + # locale + # NB: auto installs en_GB.UTF-8 alongside any input option + #///////////////////////////////////////////////////////////////////////////////////// + Locale_Main(){ + + if [ -n "$INPUT_MODE_VALUE" ]; then + + cat << _EOF_ > /etc/locale.gen +$INPUT_MODE_VALUE UTF-8 +en_GB.UTF-8 UTF-8 +_EOF_ + G_RUN_CMD dpkg-reconfigure -f noninteractive locales + + # - Pump default locale into sys env: https://github.com/Fourdee/DietPi/issues/825 + cat << _EOF_ > /etc/environment +LC_ALL=$INPUT_MODE_VALUE +LANG=$INPUT_MODE_VALUE +_EOF_ + + # - and default locale (jessie?) + cat << _EOF_ > /etc/default/locale +LC_ALL=$INPUT_MODE_VALUE +LANG=$INPUT_MODE_VALUE +_EOF_ + + # - and force locale for remote access, especially dropbear, where receiving locale from client can't be suppressed: + cat << _EOF_ > /etc/profile.d/99-dietpi-force-locale.sh +# To force server locales on SSH access, as dropbear does automatically overwrite them by client values: +export LANG="$INPUT_MODE_VALUE" +export LC_ALL="$INPUT_MODE_VALUE" +export LANGUAGE="$( echo $INPUT_MODE_VALUE | sed 's/\..*//' ):$( echo $INPUT_MODE_VALUE | sed 's/_.*//' )" +_EOF_ + chmod +x /etc/profile.d/99-dietpi-force-locale.sh + + + #??? Is this still required? + localectl set-locale LANG="$INPUT_MODE_VALUE" + + sed -i "/AUTO_SETUP_LOCALE=/c\AUTO_SETUP_LOCALE=$INPUT_MODE_VALUE" /DietPi/dietpi.txt + + else + + Unknown_Input_Mode + + fi + + } + #///////////////////////////////////////////////////////////////////////////////////// # Set Apt Mirror #///////////////////////////////////////////////////////////////////////////////////// @@ -435,6 +486,10 @@ _EOF_ Verify_DietPi_Txt + elif [ "$INPUT_MODE_NAME" = 'locale' ]; then + + Locale_Main + else Unknown_Input_Name From 785221eb899dd45eecbf15af56c0c9b433810676 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 9 Jan 2018 13:43:23 +0000 Subject: [PATCH 277/390] v6.0 + DietPi-Software | SqueezeBox/LMS (Stretch): Installation resolved: https://github.com/Fourdee/DietPi/issues/1124 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 72 +++++++++++++++++++++++--------------- dietpi/func/dietpi-globals | 2 ++ 3 files changed, 46 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 3c1d388bf1..4b2ed0f73e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -32,6 +32,7 @@ DietPi-Software | ownCloud/Nextcloud: Switch to pretty URLs (without "index.php" DietPi-Software | Nextcloud: Resolve OPcache admin panel warnings on Lighttpd DietPi-Software | UrBackup: Installation updated to latest version 2.1.20. For new installations only: https://github.com/Fourdee/DietPi/issues/1335 DietPi-Software | NodeRed: Corrected user which nodered runs under, now runs as its own user, created during install: https://github.com/Fourdee/DietPi/issues/1294#issuecomment-354314318 +DietPi-Software | SqueezeBox/LMS (Stretch): Installation resolved: https://github.com/Fourdee/DietPi/issues/1124 run_ntpd | Added support for systemd-timesyncd completion/detection: https://github.com/Fourdee/DietPi/issues/1379 Bug Fixes: diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 01a07b00d7..33f11f56db 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -16,10 +16,10 @@ # # Usage: # - dietpi-software - # - /DietPi/dietpi/dietpi-software install iUNIQUEID (OR) sINDEX_{SSHSERVER,FILESERVER,LOGGING,WEBSERVER}_TARGET=-int + # - /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 list #Lists UNIQUEIDs for software. # - /DietPi/dietpi/dietpi-software setpermissions #Sets shared permissions for /var/www and userdata folders. #//////////////////////////////////// @@ -309,7 +309,7 @@ _EOF_ aSOFTWARE_REQUIRES_NODEJS=0 # - Available for - MAX_G_HW_MODEL=110 #This needs to match highest G_HW_MODEL value in dietpi-obtain_hw_model + MAX_G_HW_MODEL=110 #This needs to match highest G_HW_MODEL value in dietpi-obtain_hw_model MAX_G_HW_ARCH=10 #This needs to match highest G_HW_ARCH value in dietpi-obtain_hw_model # 2D array (well, bash style) declare -A aSOFTWARE_AVAIL_G_HW_MODEL @@ -5058,42 +5058,56 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/logitechmediaserver_7.9.0_all.deb' - G_CHECK_URL "$INSTALL_URL_ADDRESS" + #Stretch + if (( $G_DISTRO >= 4 )); then - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb + #Untested ARMv8 + if (( $G_HW_ARCH == 3 )); then - #https://github.com/Fourdee/DietPi/issues/736 - G_AGF + dpkg --add-architecture armhf + G_AGUP - #Stop service - service logitechmediaserver stop + fi - #Stretch - # Compile pre-req CPAN modules??? - # if (( $G_DISTRO >= 4 )); then + INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/logitechmediaserver_7.9.1_armv7-(stretch).deb' + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb + G_AGF + + else - # G_AGI yasm git build-essential automake cpanminus nasm libxml-parser-perl libexpat1-dev libgif-dev zlib1g-dev libjpeg-dev libpng-dev + INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/logitechmediaserver_7.9.0_all.deb' + G_CHECK_URL "$INSTALL_URL_ADDRESS" + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb - # + ARMv6 cpan - if (( $G_HW_ARCH == 1 )); then + #https://github.com/Fourdee/DietPi/issues/736 + G_AGF - wget http://dietpi.com/downloads/binaries/all/logitechmediaserver_7.9.0_CPAN_5.20_armv6hf.tar.gz -O package.tar - tar xvzf package.tar -C / - rm package.tar + #Stop service + service logitechmediaserver stop - # + ARM64 cpan - elif (( $G_HW_ARCH == 3 )); then + # + ARMv6 cpan + if (( $G_HW_ARCH == 1 )); then - G_AGI libxml-parser-perl - G_AGI zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev # shared libs needed for Image::Scale@0.08 + wget http://dietpi.com/downloads/binaries/all/logitechmediaserver_7.9.0_CPAN_5.20_armv6hf.tar.gz -O package.tar + tar xvzf package.tar -C / + rm package.tar - wget http://dietpi.com/downloads/binaries/all/DietPi-LMS7.9-CPAN_arm64.zip -O package.zip - unzip -o package.zip -d /usr/share/squeezeboxserver - rm package.zip + # + ARM64 cpan + elif (( $G_HW_ARCH == 3 )); then + + G_AGI libxml-parser-perl + G_AGI zlib1g-dev libjpeg-dev libpng-dev libjpeg62-turbo-dev # shared libs needed for Image::Scale@0.08 + + wget http://dietpi.com/downloads/binaries/all/DietPi-LMS7.9-CPAN_arm64.zip -O package.zip + unzip -o package.zip -d /usr/share/squeezeboxserver + rm package.zip + + fi fi @@ -8239,7 +8253,7 @@ thread_stack=128K _EOF_ fi - + #WEBSERVER_MARIADB INSTALLING_INDEX=88 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 58887fc395..71a66c66f5 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -154,6 +154,8 @@ done + unset aprocess_string + } Clean_Process_Animation(){ From b8c46df12dc883287f6e303b156cb4fd0116b26e Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 9 Jan 2018 15:24:39 +0000 Subject: [PATCH 278/390] v6.0 + DietPi-Automation | Resolved an issue where AUTO_SETUP_TIMEZONE was not being applied correctly, thanks @k-plan: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-356310496 --- CHANGELOG.txt | 1 + PREP_SYSTEM_FOR_DIETPI.sh | 6 ++++-- dietpi/dietpi-software | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4b2ed0f73e..ca3f2d0426 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -37,6 +37,7 @@ run_ntpd | Added support for systemd-timesyncd completion/detection: https://git Bug Fixes: General | Fixed two systemd error messages during shutdown and boot: https://github.com/Fourdee/DietPi/issues/1330 +DietPi-Automation | Resolved an issue where AUTO_SETUP_TIMEZONE was not being applied correctly, thanks @k-plan: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-356310496 DietPi-Automation | dietpi.txt: CONFIG_NTP_MIRROR will now be applied to systemd-timesyncd configuration: https://github.com/Fourdee/DietPi/issues/1379 DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi drop during software installs/updates etc: https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480 DietPi-Software | qBittorrent: Resolved an issue with inability to log into web interface: https://github.com/Fourdee/DietPi/issues/1366 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index e47a6dca3c..29803613d2 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -968,8 +968,10 @@ _EOF_ G_DIETPI-NOTIFY 2 "Configuring regional settings (TZdata):" - echo "Europe/London" > /etc/timezone - G_RUN_CMD dpkg-reconfigure -f noninteractive tzdata #Europe > London + rm /etc/timezone &> /dev/null + rm /etc/localtime + ln -fs /usr/share/zoneinfo/Europe/London /etc/localtime + G_RUN_CMD dpkg-reconfigure -f noninteractive tzdata G_DIETPI-NOTIFY 2 "Configuring regional settings (Keyboard):" diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 33f11f56db..bb645b6a1b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -13946,7 +13946,9 @@ _EOF_ if [ "$AUTOINSTALL_TIMEZONE" != "Europe/London" ]; then echo -e "\nDietPi: Setting Timezone = $AUTOINSTALL_TIMEZONE" - echo -e "$AUTOINSTALL_TIMEZONE" > /etc/timezone + rm /etc/timezone + rm /etc/localtime + ln -fs /usr/share/zoneinfo/$AUTOINSTALL_TIMEZONE /etc/localtime dpkg-reconfigure -f noninteractive tzdata fi From 4ef0673a9f640bea9f91a711ed5c5ad05de13186 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 10 Jan 2018 14:58:36 +0000 Subject: [PATCH 279/390] v6.0 + UUID updated: https://github.com/Fourdee/DietPi/issues/1385 --- boot_xu4.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot_xu4.ini b/boot_xu4.ini index 7ef4236360..080267f7f2 100644 --- a/boot_xu4.ini +++ b/boot_xu4.ini @@ -10,7 +10,7 @@ setenv macaddr "00:1e:06:61:7a:72" #------------------------------------------------------------------------------------------------------ # Basic Ubuntu Setup. Don't touch unless you know what you are doing. # -------------------------------- -setenv bootrootfs "console=tty1 root=UUID=a4f12232-1670-43f4-8eca-49bfbe4d01ee rootwait ro fsck.repair=yes" +setenv bootrootfs "console=tty1 root=UUID=e139ce78-9841-40fe-8823-96a304a09859e rootwait ro fsck.repair=yes" # --- Screen Configuration for HDMI --- # setenv videoconfig "drm_kms_helper.edid_firmware=edid/1920x1080.bin" From 383f222bc007b024b0a73bff11e6fc5325bb316c Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 11 Jan 2018 11:58:06 +0000 Subject: [PATCH 280/390] v6.0 + rock64 fix: https://github.com/Fourdee/DietPi/issues/1385#issuecomment-356912377 --- PREP_SYSTEM_FOR_DIETPI.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 29803613d2..411111c7b7 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1309,8 +1309,9 @@ _EOF_ G_RUN_CMD cp /DietPi/dietpi/.version /var/lib/dietpi/.dietpi_image_version - # - Native PC/EFI - if [ -d /boot/efi ]; then + # - Native PC/EFI (assume x86_64 only possible) + if (( $(dpkg --get-selections | grep -ci -m1 '^grub-efi-amd64[[:space:]]') )) && + [ -d /boot/efi ]; then G_DIETPI-NOTIFY 2 'Recreating GRUB-EFI' From 100fe52a439825ae355cc04def85c2e097a4fcc8 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 11 Jan 2018 12:15:06 +0000 Subject: [PATCH 281/390] v6.0 + systemd required pkg: https://github.com/Fourdee/DietPi/issues/1385#issuecomment-356912377 --- PREP_SYSTEM_FOR_DIETPI.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 411111c7b7..16ce66f9b6 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -542,6 +542,7 @@ _EOF_ 'psmisc' # DietPi-Boot + DietPi-Software: e.g. killall 'resolvconf' # System name server updater 'sudo' # DietPi-Software + general use + 'systemd' # Base 'tzdata' # Time zone data for system clock, auto summer/winter time adjustment 'unzip' # .zip unwrapper 'usbutils' # DietPi-Software + DietPi-Bugreport: e.g. lsusb From 6bfb08ecf75212ca5c93bc21cbe5a6ba1bc8e83c Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 11 Jan 2018 13:11:56 +0000 Subject: [PATCH 282/390] v6.0 + systemd-sysv pkg dep: https://github.com/Fourdee/DietPi/issues/1385#issuecomment-356912377 --- PREP_SYSTEM_FOR_DIETPI.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 16ce66f9b6..1423c0f305 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -542,7 +542,8 @@ _EOF_ 'psmisc' # DietPi-Boot + DietPi-Software: e.g. killall 'resolvconf' # System name server updater 'sudo' # DietPi-Software + general use - 'systemd' # Base + 'systemd' # Basic system control + 'systemd-sysv' # Additional: Poweroff/shutdown etc 'tzdata' # Time zone data for system clock, auto summer/winter time adjustment 'unzip' # .zip unwrapper 'usbutils' # DietPi-Software + DietPi-Bugreport: e.g. lsusb From c78132da7b1537af81e8e638184226e40f77938e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 11 Jan 2018 14:30:04 +0100 Subject: [PATCH 283/390] v6.0 + DietPi-Config | Adjust IPv related settings: https://github.com/Fourdee/DietPi/issues/472#issuecomment-356444922 --- dietpi/dietpi-config | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index a8b1448c1b..a89c0d1d46 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -3044,7 +3044,7 @@ #IPv6 status local ipv6_enabled=1 local ipv6_status_text='Enabled' - if [ -f /etc/modprobe.d/blacklist-ipv6.conf ]; then + if [ -f /etc/modprobe.d/99-dietpi-blacklist-ipv6.conf ]; then ipv6_enabled=0 ipv6_status_text='Disabled' fi @@ -3125,7 +3125,16 @@ if (( $CHOICE == 0 )); then - echo -e "blacklist ipv6" > /etc/modprobe.d/blacklist-ipv6.conf + # - Blacklist kernel module + echo 'blacklist ipv6' > /etc/modprobe.d/99-dietpi-blacklist-ipv6.conf + # - APT force IPv4 + echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99-dietpi-force-ipv4 + # - Wget prefer IPv4 + grep -q '^[[:blank:]]*prefer-family =' /etc/wgetrc && + sed -i '/^[[:blank:]]*prefer-family =/c\prefer-family = IPv4' /etc/wgetrc || + grep -q '^[[:blank:]#;]*prefer-family =' /etc/wgetrc && + sed -i '/^[[:blank:]#;]*prefer-family =/c\prefer-family = IPv4' /etc/wgetrc || + echo 'prefer-family = IPv4' >> /etc/wgetrc REBOOT_REQUIRED=1 fi @@ -3138,7 +3147,15 @@ if (( $CHOICE == 0 )); then - rm /etc/modprobe.d/blacklist-ipv6.conf &> /dev/null + rm /etc/modprobe.d/99-dietpi-blacklist-ipv6.conf &> /dev/null + # - APT allow IPv6 but do not force it: https://github.com/Fourdee/DietPi/issues/472#issuecomment-356444922 + rm /etc/apt/apt.conf.d/99-dietpi-force-ipv4 &> /dev/null + # - Wget prefer IPv6 + grep -q '^[[:blank:]]*prefer-family =' /etc/wgetrc && + sed -i '/^[[:blank:]]*prefer-family =/c\prefer-family = IPv6' /etc/wgetrc || + grep -q '^[[:blank:]#;]*prefer-family =' /etc/wgetrc && + sed -i '/^[[:blank:]#;]*prefer-family =/c\prefer-family = IPv6' /etc/wgetrc || + echo 'prefer-family = IPv6' >> /etc/wgetrc REBOOT_REQUIRED=1 fi From 68148cec6b49afc787deca638456e1c4689e1cab Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 11 Jan 2018 14:38:12 +0100 Subject: [PATCH 284/390] v6.0 + DietPi-Prep | Remove doubled IPv4 settings --- dietpi/func/dietpi-set_core_environment | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index 1dc96197f1..ad26f1e4ab 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -347,14 +347,6 @@ _EOF_ fi - G_DIETPI-NOTIFY 2 "Configuring: prefer IPv4 (wget):" - - sed -i '/prefer-family =/c\prefer-family = IPv4' /etc/wgetrc - - G_DIETPI-NOTIFY 2 "Configuring: force IPv4 (APT):" - - echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99force-ipv - #----------------------------------------------------------------------------------- #MISC @@ -371,8 +363,8 @@ _EOF_ G_DIETPI-NOTIFY 2 "Setting vm.swappiness=1:" - sed -i '/vm.swappiness=/d' /etc/sysctl.conf - echo -e "vm.swappiness=1" > /etc/sysctl.d/97-dietpi.conf + sed -i '/^[[:blank:]]*vm.swappiness=/d' /etc/sysctl.conf + echo -e "vm.swappiness=1" > /etc/sysctl.d/99-dietpi.conf #----------------------------------------------------------------------------------- G_DIETPI-NOTIFY 0 "Completed DietPi core environment" From 6440d147702cb2890cee3398650812379f0f1af6 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 11 Jan 2018 15:25:16 +0000 Subject: [PATCH 285/390] v6.0 + PineA64 reduced to one G_HW_MODEL --- PREP_SYSTEM_FOR_DIETPI.sh | 14 +++++++++----- dietpi/dietpi-config | 4 ++-- dietpi/dietpi-obtain_hw_model | 25 +++---------------------- dietpi/dietpi-software | 2 +- dietpi/func/dietpi-globals | 2 +- dietpi/func/dietpi-set_hardware | 8 ++++---- 6 files changed, 20 insertions(+), 35 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 1423c0f305..5666ae05b2 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -306,9 +306,7 @@ _EOF_ '51' 'BananaPi Pro (Lemaker)' '50' 'BananaPi M2+ (sinovoip)' '43' 'Rock64' - '42' 'Pine A64+ (2048mb)' - '41' 'Pine A64+ (1024mb)' - '40' 'Pine A64 (512mb)' + '40' 'Pine A64' '38' 'OrangePi PC 2' '37' 'OrangePi Prime' '36' 'OrangePi Win' @@ -614,6 +612,11 @@ _EOF_ G_AGI device-tree-compiler #Kern + # Asus TB + # elif (( $G_HW_MODEL == 100 )); then + + # G_AGI linaro-overlay-minimal + fi G_DIETPI-NOTIFY 2 "WiFi selection" @@ -1056,7 +1059,7 @@ ACTION=="add", SUBSYSTEM=="leds", ENV{DEVPATH}=="*/input*::scrolllock", ATTR{tri _EOF_ # - PINE64 (and possibily others): Cursor fix for FB - elif (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then + elif (( $G_HW_MODEL == 40 )); then cat << _EOF_ >> "$HOME"/.bashrc infocmp > terminfo.txt @@ -1112,6 +1115,7 @@ _EOF_ G_DIETPI-NOTIFY 2 'Disabling swapfile' /DietPi/dietpi/func/dietpi-set_dphys-swapfile 0 /var/swap + rm /var/swap &> /dev/null # still exists on some images... # BBB disable swapfile gen if (( $G_HW_MODEL == 71 )); then @@ -1123,7 +1127,7 @@ _EOF_ G_DIETPI-NOTIFY 2 'Resetting boot.ini, config.txt, cmdline.txt etc' # - PineA64 - delete ethaddr from uEnv.txt file - if (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then + if (( $G_HW_MODEL == 40 )); then sed -i '/^ethaddr/ d' /boot/uEnv.txt diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index a8b1448c1b..08e2135a12 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1116,7 +1116,7 @@ fi #Pine a64 - elif (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then + elif (( $G_HW_MODEL == 40 )); then #Get Current Values local current_resolution=$(cat /DietPi/uEnv.txt | grep -m1 'optargs=disp.screen0_output_mode=' | sed 's/.*=//') @@ -1351,7 +1351,7 @@ fi #PineA64 - elif (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then + elif (( $G_HW_MODEL == 40 )); then WHIP_QUESTION=" Would you like to update the firmware on your $G_HW_MODEL_DESCRIPTION? \n - This will run longsleep's update scripts to update the U-Boot and kernel." whiptail --title "$WHIP_TITLE" --yesno "$WHIP_QUESTION" --yes-button "Ok" --no-button "Back" --defaultno --backtitle "$WHIP_BACKTITLE" 12 60 CHOICE=$? diff --git a/dietpi/dietpi-obtain_hw_model b/dietpi/dietpi-obtain_hw_model index 748377abb8..33b7a920b8 100644 --- a/dietpi/dietpi-obtain_hw_model +++ b/dietpi/dietpi-obtain_hw_model @@ -32,9 +32,7 @@ # G_HW_MODEL 51 BananaPi Pro (Lemaker) # G_HW_MODEL 50 BananaPi M2+ (sinovoip) # G_HW_MODEL 43 Rock64 - # G_HW_MODEL 42 Pine A64+ (2048mb) - # G_HW_MODEL 41 Pine A64+ (1024mb) - # G_HW_MODEL 40 Pine A64 (512mb) + # G_HW_MODEL 40 Pine A64 # G_HW_MODEL 38 OrangePi PC 2 # G_HW_MODEL 37 OrangePi Prime # G_HW_MODEL 36 OrangePi Win @@ -478,27 +476,10 @@ IMAGE_ADDITIONAL_CREDITS='Longsleep, Ayufan' #PineA64 - elif (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then + elif (( $G_HW_MODEL == 40 )); then IMAGE_ADDITIONAL_CREDITS='Longsleep, Rhkean' - - MEMTOTAL=$(free | awk '/^Mem:/{print $2}') - if (( $MEMTOTAL > 2000000 )); then - - G_HW_MODEL_DESCRIPTION='Pine A64+ 2GB' - G_HW_MODEL=42 - - elif (( $MEMTOTAL > 1000000 )); then - - G_HW_MODEL_DESCRIPTION='Pine A64+ 1GB' - G_HW_MODEL=41 - - else - - G_HW_MODEL_DESCRIPTION='Pine A64 512MB' - G_HW_MODEL=40 - - fi + G_HW_MODEL_DESCRIPTION='Pine A64' #OrangePi PC 2 elif (( $G_HW_MODEL == 38 )); then diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index bb645b6a1b..f0a35fa050 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7114,7 +7114,7 @@ _EOF_ cp /DietPi/dietpi/conf/xorg_c1.conf /etc/X11/xorg.conf #Pine64 - elif (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then + elif (( $G_HW_MODEL == 40 )); then INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/libump_1-1_arm64.deb' G_CHECK_URL "$INSTALL_URL_ADDRESS" diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 71a66c66f5..36f277f553 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -673,7 +673,7 @@ $print_logfile_info # NanoPi M3 # H3 3.x # H2+ 3.x - if (( ( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 ) || + if (( $G_HW_MODEL == 40 || $G_HW_MODEL == 61 || $G_HW_MODEL == 62 || ( $G_HW_CPUID == 1 && $(uname -r | grep -ci -m1 '^3.') ) || diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index c38ec79cc3..cf424bdfb6 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1155,7 +1155,7 @@ _EOF_ aWIFI_MODULES+=("8189es") # + Pine A64 / Asus tinker board (onboard) - elif (( ( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 ) || $G_HW_MODEL == 100 )); then + elif (( $G_HW_MODEL == 40 || $G_HW_MODEL == 100 )); then aWIFI_MODULES+=("8723bs") @@ -1420,7 +1420,7 @@ _EOF_ sed -i '/^setenv condev/c\setenv condev "console=tty0 console=ttyS0,115200n8"' /DietPi/boot.ini # - Pine A64 - elif (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then + elif (( $G_HW_MODEL == 40 )); then if (( ! $(cat /DietPi/uEnv.txt | grep -ci -m1 'console=ttyS0,115200n8 ') )); then @@ -1484,7 +1484,7 @@ _EOF_ sed -i '/^setenv condev/c\setenv condev "console=tty0"' /DietPi/boot.ini # - Pine A64 - elif (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then + elif (( $G_HW_MODEL == 40 )); then sed -i 's/console=ttyS0,115200n8 //' /DietPi/uEnv.txt @@ -1547,7 +1547,7 @@ _EOF_ Soundcard_Reset_H3 # - Pine a64 - elif (( $G_HW_MODEL >= 40 && $G_HW_MODEL <= 42 )); then + elif (( $G_HW_MODEL == 40 )); then Soundcard_Reset_PineA64 From 2549523dff28de20a0672531a18a1bb3d471500e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 12 Jan 2018 02:55:36 +0100 Subject: [PATCH 286/390] v6.0 + DietPi-Globals | G_DIETPI-NOTIFY: Final hardenings of processing notifications --- dietpi/func/dietpi-globals | 96 +++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 52 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 71a66c66f5..0a98eb3af9 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -73,7 +73,7 @@ # $1 = Optional input directory (eg: G_TREESIZE /etc/apt) G_TREESIZE() { - du -k --max-depth=1 $1 | sort -nr | awk ' + du -k --max-depth=1 "$1" | sort -nr | awk ' BEGIN { split("KB,MB,GB,TB", Units, ","); } @@ -92,6 +92,8 @@ # DietPi-Notify # $1: + # -2=process animation + # - $2 = text # -1=autodetect_fail_ok # - $2 = EXIT_CODE # 0=OK @@ -121,79 +123,71 @@ Print_Process_Animation(){ + local bright_dot="\e[1;93m.\e[0m" + local dimmed_dot="\e[2;33m.\e[0m" local aprocess_string=( - #"\e[90m[\e[1;93m\u23F9 \e[90m]\e[0m" - #"\e[90m[\e[2;33m\u23F9\e[0m\e[1;93m\u23F9 \e[0m\e[90m]\e[0m" - #"\e[90m[ \e[2;33m\u23F9\e[0m\e[1;93m\u23F9 \e[0m\e[90m]\e[0m" - #"\e[90m[ \e[2;33m\u23F9\e[0m\e[1;93m\u23F9 \e[0m\e[90m]\e[0m" - #"\e[90m[ \e[2;33m\u23F9\e[0m\e[1;93m\u23F9 \e[0m\e[90m]\e[0m" - #"\e[90m[ \e[2;33m\u23F9\e[0m\e[1;93m\u23F9\e[0m\e[90m]\e[0m" - #"\e[90m[ \e[1;93m\u23F9\e[0m\e[2;33m\u23F9\e[0m\e[90m]\e[0m" - #"\e[90m[ \e[1;93m\u23F9\e[0m\e[2;33m\u23F9 \e[0m\e[90m]\e[0m" - #"\e[90m[ \e[1;93m\u23F9\e[0m\e[2;33m\u23F9 \e[0m\e[90m]\e[0m" - #"\e[90m[ \e[1;93m\u23F9\e[0m\e[2;33m\u23F9 \e[0m\e[90m]\e[0m" - #"\e[90m[\e[1;93m\u23F9\e[0m\e[2;33m\u23F9 \e[0m\e[90m]\e[0m" - "\e[90m[\e[1;93m. \e[90m]\e[0m" - "\e[90m[\e[2;33m.\e[0m\e[1;93m. \e[0m\e[90m]\e[0m" - "\e[90m[ \e[2;33m.\e[0m\e[1;93m. \e[0m\e[90m]\e[0m" - "\e[90m[ \e[2;33m.\e[0m\e[1;93m. \e[0m\e[90m]\e[0m" - "\e[90m[ \e[2;33m.\e[0m\e[1;93m. \e[0m\e[90m]\e[0m" - "\e[90m[ \e[2;33m.\e[0m\e[1;93m.\e[0m\e[90m]\e[0m" - "\e[90m[ \e[1;93m.\e[0m\e[2;33m.\e[0m\e[90m]\e[0m" - "\e[90m[ \e[1;93m.\e[0m\e[2;33m. \e[0m\e[90m]\e[0m" - "\e[90m[ \e[1;93m.\e[0m\e[2;33m. \e[0m\e[90m]\e[0m" - "\e[90m[ \e[1;93m.\e[0m\e[2;33m. \e[0m\e[90m]\e[0m" - "\e[90m[\e[1;93m.\e[0m\e[2;33m. \e[0m\e[90m]\e[0m" + #\u23F9 + "$bright_dot " + "$dimmed_dot$bright_dot " + " $dimmed_dot$bright_dot " + " $dimmed_dot$bright_dot " + " $dimmed_dot$bright_dot " + " $dimmed_dot$bright_dot" + " $bright_dot$dimmed_dot" + " $bright_dot$dimmed_dot " + " $bright_dot$dimmed_dot " + " $bright_dot$dimmed_dot " + "$bright_dot$dimmed_dot " ) - for (( i=0; i<=${#aprocess_string[*]}; i++ )); do + for (( i=0; i<=${#aprocess_string[@]}; i++ )); do (( i == 11 )) && i=1 - builtin printf "\r${aprocess_string[i]} " + [ -f /tmp/dietpi-process.pid ] && printf "\r$bracket_string_l${aprocess_string[i]}$bracket_string_r " || break sleep 0.15 done - unset aprocess_string - } Clean_Process_Animation(){ - if [ -f /var/run/dietpi-process.pid ]; then + if [ -f /tmp/dietpi-process.pid ]; then - kill $( /dev/null - rm /var/run/dietpi-process.pid + kill "$( /dev/null + rm /tmp/dietpi-process.pid &> /dev/null + # In case, the output took more than one line, clean from cursor (animation position) until end of terminal. + tput ed fi - echo -en "\r\e[K" + printf "\r\e[K" } Print_Process(){ - echo -ne "\r\e[9C" + printf "\r\e[9C" } Print_Ok(){ Clean_Process_Animation - echo -ne "$bracket_string_l$status_text_ok$bracket_string_r " + printf "$bracket_string_l$status_text_ok$bracket_string_r " } Print_Failed(){ Clean_Process_Animation - echo -ne "$bracket_string_l$status_text_error$bracket_string_r " + printf "$bracket_string_l$status_text_error$bracket_string_r " } Print_Info(){ Clean_Process_Animation - echo -ne "$bracket_string_l$status_text_info$bracket_string_r " + printf "$bracket_string_l$status_text_info$bracket_string_r " } @@ -204,18 +198,9 @@ local i=0 for (( i=$1;i<${#ainput_string[@]} ;i++)) do - echo -ne "${ainput_string[$i]}" + printf "${ainput_string[$i]}" done - # echo -e "SIZE = ${#ainput_string}" - - # ainput_string="$@" - # for (( i=$1;i<${#ainput_string} ;i++)) - # do - # echo -ne "${ainput_string:$i:1}" - # sleep 0.02 - # done - } #-------------------------------------------------------------------------------------- @@ -249,7 +234,17 @@ Print_Process Print_Input_String 1 - [ ! -f /var/run/dietpi-process.pid ] && ( Print_Process_Animation & builtin echo $! > /var/run/dietpi-process.pid ) + # Calculate the amount of output lines and in case move cursor up for correct animation and to allow cleaning the whole output. + local string="$*" + local lines=0 + (( lines=(${#string}+6)/$(tput cols) )) + while (( lines > 0 )); do + + tput cuu1 + (( lines-- )) + + done + [ ! -f /tmp/dietpi-process.pid ] && ( Print_Process_Animation & echo $! > /tmp/dietpi-process.pid ) && chmod 777 /tmp/dietpi-process.pid #Status Ok #$@ = txt desc @@ -284,19 +279,16 @@ echo -e "\n \e[38;5;154m$2\e[0m" echo -e "$header_line" echo -e " \e[90mMode: \e[0m$(Print_Input_String 2)\n" - #Print_Process - #echo -ne "\e[90mPlease wait...\e[0m" - #[ ! -f /var/run/dietpi-process.pid ] && ( Print_Process_Animation & builtin echo $! > /var/run/dietpi-process.pid ) fi #----------------------------------------------------------------------------------- - unset ainput_string # Unset also internal functions, otherwise they are accessible from terminal. unset Print_Process_Animation + unset Clean_Process_Animation + unset Print_Process unset Print_Ok unset Print_Failed unset Print_Info - unset Print_Process unset Print_Input_String #----------------------------------------------------------------------------------- @@ -951,7 +943,7 @@ $print_logfile_info local string=( "$@" ) local packages_to_install='' - G_DIETPI-NOTIFY 2 "Checking for pre-req APT packages: ${string[@]}" + G_DIETPI-NOTIFY 2 "Checking for pre-req APT packages: ${string[*]}" dpkg --get-selections > "$fp_temp" for i in "${string[@]}" From dc53a33a7e347ed8675ee82e9897c14a3884c136 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 12 Jan 2018 04:21:43 +0100 Subject: [PATCH 287/390] v6.0 + DietPi-Globals | G_DIETPI-NOTIFY: Further minor improvements --- dietpi/func/dietpi-globals | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 0a98eb3af9..46bade1b3a 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -155,7 +155,7 @@ if [ -f /tmp/dietpi-process.pid ]; then kill "$( /dev/null - rm /tmp/dietpi-process.pid &> /dev/null + rm /tmp/dietpi-process.pid &> /dev/null || sudo rm /tmp/dietpi-process.pid &> /dev/null # In case, the output took more than one line, clean from cursor (animation position) until end of terminal. tput ed @@ -244,7 +244,7 @@ (( lines-- )) done - [ ! -f /tmp/dietpi-process.pid ] && ( Print_Process_Animation & echo $! > /tmp/dietpi-process.pid ) && chmod 777 /tmp/dietpi-process.pid + [ ! -f /tmp/dietpi-process.pid ] && touch /tmp/dietpi-process.pid && ( Print_Process_Animation & echo $! > /tmp/dietpi-process.pid ) #Status Ok #$@ = txt desc From 349c70a9413e833d639ac921f8b4d0550260544c Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 12 Jan 2018 12:29:11 +0000 Subject: [PATCH 288/390] v6.0 + Disable /boot x-systemd.automount: https://github.com/Fourdee/DietPi/issues/1385#issuecomment-356912377 --- dietpi/dietpi-drive_manager | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 25af34e53e..352a35fa66 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -219,8 +219,11 @@ local mount_options='defaults,noatime,nofail' - # Disable x-systemd.automount for RootFS, breaks FS_partition - if [ "${aDRIVE_MOUNT_TARGET[$i]}" != '/' ]; then + # Disable x-systemd.automount for + # RootFS, breaks FS_partition + # Boot, breaks dietpi-ramdisk on ASUS TB + if [ "${aDRIVE_MOUNT_TARGET[$i]}" != '/' ] && + [ "${aDRIVE_MOUNT_TARGET[$i]}" != '/boot' ]; then mount_options+=',x-systemd.automount' From 9548ede7f30b5d4e8f81135f5e9460cb39df00ca Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 12 Jan 2018 13:48:31 +0000 Subject: [PATCH 289/390] v6.0 + Always reinstall RPI kernel (eg: DietPi jessie image with dietpi kernel, ensure replace) --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 5666ae05b2..b5dd76ceb0 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -583,7 +583,7 @@ _EOF_ # RPi if (( $G_HW_MODEL < 10 )); then - G_AGI libraspberrypi-bin libraspberrypi0 raspberrypi-bootloader raspberrypi-kernel raspberrypi-sys-mods raspi-copies-and-fills + G_AGI libraspberrypi-bin libraspberrypi0 raspberrypi-bootloader raspberrypi-kernel raspberrypi-sys-mods raspi-copies-and-fills --reinstall # Odroid C2 elif (( $G_HW_MODEL == 12 )); then From 87975637196579c8d32e2a243d3237746fe329ae Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 12 Jan 2018 14:57:37 +0100 Subject: [PATCH 290/390] v6.0 + DietPi-Globals | G_DIETPI-NOTIFY: Revert to "echo -ne", as "printf" shows format errors with leading hyphen --- dietpi/func/dietpi-globals | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 5277020b56..9f0a0cf6b2 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -143,7 +143,7 @@ for (( i=0; i<=${#aprocess_string[@]}; i++ )); do (( i == 11 )) && i=1 - [ -f /tmp/dietpi-process.pid ] && printf "\r$bracket_string_l${aprocess_string[i]}$bracket_string_r " || break + [ -f /tmp/dietpi-process.pid ] && echo -ne "\r$bracket_string_l${aprocess_string[i]}$bracket_string_r " || break sleep 0.15 done @@ -160,34 +160,34 @@ tput ed fi - printf "\r\e[K" + echo -ne "\r\e[K" } Print_Process(){ - printf "\r\e[9C" + echo -ne "\r\e[9C" } Print_Ok(){ Clean_Process_Animation - printf "$bracket_string_l$status_text_ok$bracket_string_r " + echo -ne "$bracket_string_l$status_text_ok$bracket_string_r " } Print_Failed(){ Clean_Process_Animation - printf "$bracket_string_l$status_text_error$bracket_string_r " + echo -ne "$bracket_string_l$status_text_error$bracket_string_r " } Print_Info(){ Clean_Process_Animation - printf "$bracket_string_l$status_text_info$bracket_string_r " + echo -ne "$bracket_string_l$status_text_info$bracket_string_r " } @@ -198,7 +198,7 @@ local i=0 for (( i=$1;i<${#ainput_string[@]} ;i++)) do - printf "${ainput_string[$i]}" + echo -ne "${ainput_string[$i]}" done } From 02efde69da1deef07cb2ce4771c3c3eaa33ec42a Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 12 Jan 2018 14:46:33 +0000 Subject: [PATCH 291/390] v6.0 + RPi kernel tweaks. --- PREP_SYSTEM_FOR_DIETPI.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index b5dd76ceb0..1da04c4aa5 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -583,6 +583,9 @@ _EOF_ # RPi if (( $G_HW_MODEL < 10 )); then + apt-mark unhold libraspberrypi-bin libraspberrypi0 raspberrypi-bootloader raspberrypi-kernel raspberrypi-sys-mods raspi-copies-and-fills + rm -R /lib/modules/* + G_AGI libraspberrypi-bin libraspberrypi0 raspberrypi-bootloader raspberrypi-kernel raspberrypi-sys-mods raspi-copies-and-fills --reinstall # Odroid C2 From bb3fc1725e62c8acf0663c2776953e21b99c6271 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 12 Jan 2018 18:37:42 +0000 Subject: [PATCH 292/390] v6.0 + https://github.com/Fourdee/DietPi/issues/1385#issuecomment-356320628 --- dietpi/patch_file | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index da2f9c9857..e13f2cbdeb 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -83,7 +83,10 @@ if (( $SUBVERSION_CURRENT == 0 )); then #------------------------------------------------------------------------------- - echo 0 + #bash.bashrc removal of any outstanding dietpi entries (moved to globals). Just incase I missed any manually during PREP... + sed -i '/#DietPi_Entries/Q' /etc/bash.bashrc + sed -i '/#Apply system locale/Q' /etc/bash.bashrc + sed -i '/#DietPi Additions/Q' /etc/bash.bashrc #------------------------------------------------------------------------------- fi From dd97235417742a0496258ff0d2314e7a64c655e8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 13 Jan 2018 14:25:58 +0100 Subject: [PATCH 293/390] v6.0 + DietPi-Prep | Minor APT package adjustments --- PREP_SYSTEM_FOR_DIETPI.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 1da04c4aa5..a3c31d4017 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -518,7 +518,7 @@ _EOF_ 'debconf' # APT package configuration, e.g. 'debconf-set-selections' 'dosfstools' # DietPi-Drive_Manager + fat (boot) drive file system check 'dphys-swapfile' # Swap file management - 'dropbear' # DietPi sefault SSH-Client + 'dropbear-run' # DietPi default SSH-Client (excluding initramfs integration) 'ethtool' # Ethernet link checking 'fake-hwclock' # Hardware clock emulation, to allow correct timestamps during boot before network time sync 'fbset' # DietPi-Config display settings @@ -541,7 +541,7 @@ _EOF_ 'resolvconf' # System name server updater 'sudo' # DietPi-Software + general use 'systemd' # Basic system control - 'systemd-sysv' # Additional: Poweroff/shutdown etc + 'systemd-sysv' # Includes systemd and additional commands: poweroff, shutdown etc. 'tzdata' # Time zone data for system clock, auto summer/winter time adjustment 'unzip' # .zip unwrapper 'usbutils' # DietPi-Software + DietPi-Bugreport: e.g. lsusb @@ -615,6 +615,12 @@ _EOF_ G_AGI device-tree-compiler #Kern + # VM + elif (( $G_HW_MODEL == 20 )); then + + # No network firmware necessary and hard drive power management stays at host system. + apt-mark auto firmware-realtek hdparm + # Asus TB # elif (( $G_HW_MODEL == 100 )); then From 3282bc17c047d2182be05be4242ebc5ff909603b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 13 Jan 2018 14:28:15 +0100 Subject: [PATCH 294/390] v6.0 + "systemd-sysv" includes "systemd" --- PREP_SYSTEM_FOR_DIETPI.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index a3c31d4017..ee0ed36331 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -540,7 +540,6 @@ _EOF_ 'psmisc' # DietPi-Boot + DietPi-Software: e.g. killall 'resolvconf' # System name server updater 'sudo' # DietPi-Software + general use - 'systemd' # Basic system control 'systemd-sysv' # Includes systemd and additional commands: poweroff, shutdown etc. 'tzdata' # Time zone data for system clock, auto summer/winter time adjustment 'unzip' # .zip unwrapper From 95e63041434aee0a3880947d766b036553b3cf75 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 14 Jan 2018 12:59:18 +0000 Subject: [PATCH 295/390] v6.0 + Auto detect kernel package, if unknown: https://github.com/Fourdee/DietPi/issues/1385#issuecomment-357507674 --- PREP_SYSTEM_FOR_DIETPI.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 1da04c4aa5..c9645357a0 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -577,11 +577,9 @@ _EOF_ fi - fi - # - G_HW_MODEL specific required packages # RPi - if (( $G_HW_MODEL < 10 )); then + elif (( $G_HW_MODEL < 10 )); then apt-mark unhold libraspberrypi-bin libraspberrypi0 raspberrypi-bootloader raspberrypi-kernel raspberrypi-sys-mods raspi-copies-and-fills rm -R /lib/modules/* @@ -615,10 +613,20 @@ _EOF_ G_AGI device-tree-compiler #Kern - # Asus TB - # elif (( $G_HW_MODEL == 100 )); then + # - Auto detect kernel package + else + + AUTO_DETECT_KERN_PKG=$(dpkg --get-selections | grep '^linux-image' | awk '{print $1}') + if [ -n "$AUTO_DETECT_KERN_PKG" ]; then - # G_AGI linaro-overlay-minimal + G_AGI $AUTO_DETECT_KERN_PKG + + else + + G_DIETPI-NOTIFY 1 'Error: Unable to find kernel packages for installation. Aborting...' + exit 1 + + fi fi From ece309797122530f0f9b3a831eb3046a1cc06980 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 14 Jan 2018 13:12:58 +0000 Subject: [PATCH 296/390] v6.0 + Minor reorder --- PREP_SYSTEM_FOR_DIETPI.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 8e2d314bb7..6290b994d1 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -551,6 +551,15 @@ _EOF_ ) + # - G_HW_MODEL specific package removals: + # VM + if (( $G_HW_MODEL == 20 )); then + + # No network firmware necessary and hard drive power management stays at host system. + apt-mark auto firmware-realtek hdparm + + fi + # - G_HW_ARCH specific required packages # As these are kernel, firmware or bootloader packages, we need to install them directly to allow autoremove of in case older kernel packages: # https://github.com/Fourdee/DietPi/issues/1285#issuecomment-354602594 @@ -576,14 +585,6 @@ _EOF_ fi - # VM - if (( $G_HW_MODEL == 20 )); then - - # No network firmware necessary and hard drive power management stays at host system. - apt-mark auto firmware-realtek hdparm - - fi - # - G_HW_MODEL specific required packages # RPi elif (( $G_HW_MODEL < 10 )); then From 4e10e8b2c7df6aa8412d253797d1eb9b69a52274 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 14 Jan 2018 14:22:45 +0000 Subject: [PATCH 297/390] v6.0 + fix: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-357515055 --- PREP_SYSTEM_FOR_DIETPI.sh | 23 ++++++++++++++++++++++- dietpi/dietpi-obtain_hw_model | 6 +++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 6290b994d1..46f80a5586 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -97,6 +97,12 @@ export LC_ALL="en_GB.UTF-8" export LANGUAGE="en_GB:en" _EOF_ chmod +x /etc/profile.d/99-dietpi-force-locale.sh + #. /etc/profile.d/99-dietpi-force-locale.sh + # root@nanopineo:~# . /etc/profile.d/99-dietpi-force-locale.sh + # -bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8) + # root@nanopineo:~# localectl set-locale LANG="en_GB.UTF-8" + # root@nanopineo:~# localectl set-locale LC_ALL="en_GB.UTF-8" + # Failed to issue method call: Invalid Locale data. #Force en_GB Locale for rest of script. Prevents incorrect parsing with non-english locales. LANG=en_GB.UTF-8 @@ -622,7 +628,7 @@ _EOF_ G_AGI device-tree-compiler #Kern - # - Auto detect kernel package + # - Auto detect kernel/firmware package else AUTO_DETECT_KERN_PKG=$(dpkg --get-selections | grep '^linux-image' | awk '{print $1}') @@ -637,6 +643,21 @@ _EOF_ fi + # Check for existing firmware + # - ARMbian + # AUTO_DETECT_FIRMWARE_PKG=$(dpkg --get-selections | grep '^armbian-firmware' | awk '{print $1}') + # if [ -n "$AUTO_DETECT_FIRMWARE_PKG" ]; then + + # G_AGI $AUTO_DETECT_FIRMWARE_PKG + + # fi + + # Unpacking armbian-firmware (5.35) ... + # dpkg: error processing archive /var/cache/apt/archives/armbian-firmware_5.35_all .deb (--unpack): + # trying to overwrite '/lib/firmware/rt2870.bin', which is also in package firmwa re-misc-nonfree 20161130-3 + # dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) + + fi G_DIETPI-NOTIFY 2 "WiFi selection" diff --git a/dietpi/dietpi-obtain_hw_model b/dietpi/dietpi-obtain_hw_model index 33b7a920b8..31a89cc34a 100644 --- a/dietpi/dietpi-obtain_hw_model +++ b/dietpi/dietpi-obtain_hw_model @@ -602,15 +602,15 @@ fi #Get Distro Index - if (( $( grep -ci -m1 'jessie' /etc/*release) )); then + if (( $( grep -ci -m1 'jessie' /etc/os-release) )); then G_DISTRO=3 - elif (( $( grep -ci -m1 'stretch' /etc/*release) )); then + elif (( $( grep -ci -m1 'stretch' /etc/os-release) )); then G_DISTRO=4 - elif (( $( grep -ci -m1 'buster' /etc/*release) )); then + elif (( $( grep -ci -m1 'buster' /etc/os-release) )); then G_DISTRO=5 From 9660e1d4570e363fb27e125e561d84f4c8809add Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 14 Jan 2018 14:59:42 +0000 Subject: [PATCH 298/390] v6.0 + fix https://github.com/Fourdee/DietPi/issues/1385#issuecomment-357516534 --- PREP_SYSTEM_FOR_DIETPI.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 46f80a5586..25869459f0 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -643,6 +643,14 @@ _EOF_ fi + #ARMbian DTB + AUTO_DETECT_DTB_PKG=$(dpkg --get-selections | grep '^ linux-dtb-' | awk '{print $1}') + if [ -n "$AUTO_DETECT_DTB_PKG" ]; then + + G_AGI $AUTO_DETECT_DTB_PKG + + fi + # Check for existing firmware # - ARMbian # AUTO_DETECT_FIRMWARE_PKG=$(dpkg --get-selections | grep '^armbian-firmware' | awk '{print $1}') @@ -652,10 +660,10 @@ _EOF_ # fi - # Unpacking armbian-firmware (5.35) ... - # dpkg: error processing archive /var/cache/apt/archives/armbian-firmware_5.35_all .deb (--unpack): - # trying to overwrite '/lib/firmware/rt2870.bin', which is also in package firmwa re-misc-nonfree 20161130-3 - # dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) + # Unpacking armbian-firmware (5.35) ... + # dpkg: error processing archive /var/cache/apt/archives/armbian-firmware_5.35_all .deb (--unpack): + # trying to overwrite '/lib/firmware/rt2870.bin', which is also in package firmwa re-misc-nonfree 20161130-3 + # dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) fi From 686262e27669ec675b821d7b8d68bea2ee01ed10 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 14 Jan 2018 15:00:17 +0000 Subject: [PATCH 299/390] v6.0 + typo --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 25869459f0..e214178a13 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -644,7 +644,7 @@ _EOF_ fi #ARMbian DTB - AUTO_DETECT_DTB_PKG=$(dpkg --get-selections | grep '^ linux-dtb-' | awk '{print $1}') + AUTO_DETECT_DTB_PKG=$(dpkg --get-selections | grep '^linux-dtb-' | awk '{print $1}') if [ -n "$AUTO_DETECT_DTB_PKG" ]; then G_AGI $AUTO_DETECT_DTB_PKG From cb93396a5726bf7f2077b2e4a71be481d1c03f46 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 15 Jan 2018 13:55:02 +0100 Subject: [PATCH 300/390] v6.0 + DietPi-Prep | Correct dropbear package selection based on distro version --- PREP_SYSTEM_FOR_DIETPI.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index e214178a13..f9b0241d89 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -524,7 +524,6 @@ _EOF_ 'debconf' # APT package configuration, e.g. 'debconf-set-selections' 'dosfstools' # DietPi-Drive_Manager + fat (boot) drive file system check 'dphys-swapfile' # Swap file management - 'dropbear-run' # DietPi default SSH-Client (excluding initramfs integration) 'ethtool' # Ethernet link checking 'fake-hwclock' # Hardware clock emulation, to allow correct timestamps during boot before network time sync 'fbset' # DietPi-Config display settings @@ -556,6 +555,17 @@ _EOF_ 'zip' # .zip wrapper ) + + # - G_DISTRO specific packages: + if (( $G_DISTRO < 4 )); then + + aPACKAGES_REQUIRED_INSTALL+=('dropbear') # DietPi default SSH-Client + + else + + aPACKAGES_REQUIRED_INSTALL+=('dropbear-run') # DietPi default SSH-Client (excluding initramfs integration, available since Stretch) + + fi # - G_HW_MODEL specific package removals: # VM From 97d74775e950bfa57a5040fa71d3fd132ad30f51 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Mon, 15 Jan 2018 13:20:19 +0000 Subject: [PATCH 301/390] v6.0 + Remove G_HW_MODEL auto detection for Odroid's: https://github.com/Fourdee/DietPi/issues/1385#issuecomment-357679133 --- dietpi/dietpi-obtain_hw_model | 41 ++++++++++++----------------------- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/dietpi/dietpi-obtain_hw_model b/dietpi/dietpi-obtain_hw_model index 31a89cc34a..fb872c137b 100644 --- a/dietpi/dietpi-obtain_hw_model +++ b/dietpi/dietpi-obtain_hw_model @@ -556,49 +556,35 @@ #oDroid U3 elif (( $G_HW_MODEL == 13 )); then - G_HW_MODEL_DESCRIPTION='oDroid U3' + G_HW_MODEL_DESCRIPTION='Odroid U3' #IMAGE_ADDITIONAL_CREDITS='Meveric' + #Odroid C2 elif (( $G_HW_MODEL == 12 )); then - G_HW_MODEL_DESCRIPTION='oDroid C2' + G_HW_MODEL_DESCRIPTION='Odroid C2' IMAGE_ADDITIONAL_CREDITS='Meveric' - #oDroid XU3/4 via /etc/.dietpi_hw_model + #Odroid XU3/XU4/HC1 elif (( $G_HW_MODEL == 11 )); then - G_HW_MODEL_DESCRIPTION='oDroid XU3/4' + G_HW_MODEL_DESCRIPTION='Odroid XU3/4' + IMAGE_ADDITIONAL_CREDITS='Meveric' + + #Odroid C1 + elif (( $G_HW_MODEL == 10 )); then + + G_HW_MODEL_DESCRIPTION='Odroid C1' IMAGE_ADDITIONAL_CREDITS='Meveric' fi #RPi - elif (( $(cat /etc/os-release | grep -ci -m1 '^ID=raspbian') )); then + elif (( $(grep -ci -m1 '^ID=raspbian' /etc/os-release) )); then #Grab hardware description from rpi_boardinfo RPi_BoardInfo - #oDroid C2 - elif (( $(cat /proc/cpuinfo | grep -ci -m1 'ODROID-C2') )); then - - G_HW_MODEL_DESCRIPTION='oDroid C2' - G_HW_MODEL=12 - IMAGE_ADDITIONAL_CREDITS='Meveric' - - #oDroid XU3/4 - elif (( $(cat /proc/cpuinfo | grep -ci -m1 'ODROID-XU3') )); then - - G_HW_MODEL_DESCRIPTION='oDroid XU3/4' - G_HW_MODEL=11 - IMAGE_ADDITIONAL_CREDITS='Meveric' - - #oDroid C1 - elif (( $(cat /proc/cpuinfo | grep -ci -m1 'ODROIDC') )); then - - G_HW_MODEL_DESCRIPTION='oDroid C1' - G_HW_MODEL=10 - IMAGE_ADDITIONAL_CREDITS='Meveric' - fi #Get Distro Index @@ -680,6 +666,7 @@ _EOF_ #Main Obtain_HW_Info #----------------------------------------------------------------------------------- - exit + exit 0 #----------------------------------------------------------------------------------- + } From 768e2c9d6603d94878e88fade476333d6eadd7bf Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 15 Jan 2018 23:05:46 +0100 Subject: [PATCH 302/390] v6.0 + DietPi-Software | Create_MySQL_DB: Fix and minor enhancements --- dietpi/func/create_mysql_db | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dietpi/func/create_mysql_db b/dietpi/func/create_mysql_db index da9d7ffd13..5401899fc0 100644 --- a/dietpi/func/create_mysql_db +++ b/dietpi/func/create_mysql_db @@ -21,28 +21,28 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER - export G_PROGRAM_NAME='DietPi-Create_mysql_db' + export G_PROGRAM_NAME='DietPi-Create_MySQL_DB' #Import DietPi-Globals --------------------------------------------------------------- #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - #Start sql if not running. + #Start MySQL if not running. service mysql start &> /dev/null - G_DIETPI-NOTIFY 2 "Creating MySql DB for $DATABASE_NAME\n" + G_DIETPI-NOTIFY 2 "Creating MySQL database: $DATABASE_NAME" # On MariaDB, unix_socket authentication is used, thus no root password is necessary + it breaks access on Jessie. # If 'IDENTIFIED BY' is used on root user, it will overwrite unix_socket authentication, thus this part need to be left out on MariaDB. #Generate DB mysql_auth='-uroot' - grep -q 'aSOFTWARE_INSTALL_STATE[86]=0' /DietPi/dietpi/.installed || mysql_auth+=" -p$MYSQL_ROOT_PW" + grep -q 'aSOFTWARE_INSTALL_STATE\[86\]=0' /DietPi/dietpi/.installed || mysql_auth+=" -p$MYSQL_ROOT_PW" grant_privileges='' - [ ! "$DATABASE_USER" == 'root' ] && grant_privileges="GRANT ALL PRIVILEGES ON \`$DATABASE_NAME\`.* TO $DATABASE_USER@localhost IDENTIFIED BY '$DATABASE_PW';flush privileges;" + [ "$DATABASE_USER" == 'root' ] || grant_privileges="grant all privileges on \`$DATABASE_NAME\`.* to $DATABASE_USER@localhost identified by '$DATABASE_PW';flush privileges" mysql "$mysql_auth" -e "create database \`$DATABASE_NAME\`;$grant_privileges" - G_DIETPI-NOTIFY -1 $? "Create database $DATABASE_NAME |" + G_DIETPI-NOTIFY -1 "$?" "Creating MySQL database: $DATABASE_NAME |" #----------------------------------------------------------------------------------- exit From 4bca9c62b2c4dcfc255315479f27fa62bd64a00a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 15 Jan 2018 23:32:41 +0100 Subject: [PATCH 303/390] v6.0 + Further fix --- dietpi/func/create_mysql_db | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/func/create_mysql_db b/dietpi/func/create_mysql_db index 5401899fc0..1d3b88c634 100644 --- a/dietpi/func/create_mysql_db +++ b/dietpi/func/create_mysql_db @@ -36,11 +36,11 @@ # On MariaDB, unix_socket authentication is used, thus no root password is necessary + it breaks access on Jessie. # If 'IDENTIFIED BY' is used on root user, it will overwrite unix_socket authentication, thus this part need to be left out on MariaDB. #Generate DB - mysql_auth='-uroot' - grep -q 'aSOFTWARE_INSTALL_STATE\[86\]=0' /DietPi/dietpi/.installed || mysql_auth+=" -p$MYSQL_ROOT_PW" + mysql_cmd='mysql -uroot' + grep -q 'aSOFTWARE_INSTALL_STATE\[86\]=0' /DietPi/dietpi/.installed || mysql_cmd+=" -p$MYSQL_ROOT_PW" grant_privileges='' [ "$DATABASE_USER" == 'root' ] || grant_privileges="grant all privileges on \`$DATABASE_NAME\`.* to $DATABASE_USER@localhost identified by '$DATABASE_PW';flush privileges" - mysql "$mysql_auth" -e "create database \`$DATABASE_NAME\`;$grant_privileges" + $mysql_cmd -e "create database \`$DATABASE_NAME\`;$grant_privileges" G_DIETPI-NOTIFY -1 "$?" "Creating MySQL database: $DATABASE_NAME |" From b8f2fae93581ab4493b0fe6f1367fabb5e60f648 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 16 Jan 2018 11:24:09 +0000 Subject: [PATCH 304/390] v6.0 + Resolve ondemand error: https://github.com/Fourdee/DietPi/issues/1385#issuecomment-357766293 --- dietpi/dietpi-config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index de8f73aa15..5a0b9d67bf 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1556,7 +1556,7 @@ local current_cpu_sample_rate=$(( $(cat /DietPi/dietpi.txt | grep -m1 '^CONFIG_CPU_ONDEMAND_SAMPLE_RATE=' | sed 's/.*=//') / 1000 )) #convert to ms whiptail_menu_array+=("Ondemand Sample Rate" ": $current_cpu_sample_rate ms") - local current_cpu_down_factor=$(cat /DietPi/dietpi.txt | grep -m1 '^cpu_ondemand_sampling_down_factor=' | sed 's/.*=//') + local current_cpu_down_factor=$(grep -m1 '^CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=' /DietPi/dietpi.txt | sed 's/.*=//') local current_cpu_down_factor_ms=$(( $current_cpu_down_factor * $current_cpu_sample_rate )) whiptail_menu_array+=("Ondemand Down Factor" ": $current_cpu_down_factor ($current_cpu_down_factor_ms ms)") @@ -1629,7 +1629,7 @@ if [[ $OPTION =~ ^-?[0-9]+$ ]] && (($OPTION <= $MAX_VALUE)) && (($OPTION >= $MIN_VALUE)); then - sed -i "/cpu_ondemand_sampling_down_factor=/c\cpu_ondemand_sampling_down_factor=$OPTION" /DietPi/dietpi.txt + sed -i "/CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=/c\CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=$OPTION" /DietPi/dietpi.txt #Apply changes /DietPi/dietpi/dietpi-cpu_set From 7ae462367b3e7e7bf6580a9da707c4092176215d Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 16 Jan 2018 12:09:38 +0000 Subject: [PATCH 305/390] v6.0 + Resolve: https://github.com/Fourdee/DietPi/issues/1352#issuecomment-357940774 --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f0a35fa050..f6c2da34ac 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -13367,7 +13367,7 @@ _EOF_ elif (( $index == 42 )); then - (( $G_HW_ARCH == 10 )) && G_RUN_CMD dpkg -P plexmediaserver plexmediaserver-installer || G_AGP plexmediaserver-installer + (( $G_HW_ARCH == 10 )) && G_RUN_CMD dpkg -P plexmediaserver plexmediaserver-installer || G_AGP plexmediaserver* rm -R /var/lib/plexmediaserver From 1d90070c5625b66001ca00704a7096622981c00b Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 16 Jan 2018 12:51:47 +0000 Subject: [PATCH 306/390] v6.0 + Resolve apt mirror function: https://github.com/Fourdee/DietPi/issues/1385#issuecomment-357931542 --- dietpi/func/dietpi-set_software | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index dc5a81fdfc..78124ac610 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -147,10 +147,10 @@ _EOF_ else cat << _EOF_ > /etc/apt/sources.list -deb https://deb.debian.org/debian/ $G_DISTRO_NAME main contrib non-free -deb https://deb.debian.org/debian/ $G_DISTRO_NAME-updates main contrib non-free -deb https://deb.debian.org/debian-security/ $G_DISTRO_NAME/updates main contrib non-free -deb https://deb.debian.org/debian/ $G_DISTRO_NAME-backports main contrib non-free +deb $INPUT_MODE_VALUE $G_DISTRO_NAME main contrib non-free +deb $INPUT_MODE_VALUE $G_DISTRO_NAME-updates main contrib non-free +deb $(echo -e "$INPUT_MODE_VALUE" | sed 's/\/debian\//\/debian-security\//' ) $G_DISTRO_NAME/updates main contrib non-free +deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free _EOF_ # Jessie, switch to http: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 From 7f2172682778c803cabb19ca1cd571a9fc474e0d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 16 Jan 2018 14:55:19 +0100 Subject: [PATCH 307/390] v6.0 + DietPi-Software | MySQL: Completely remove MySQL from DietPi in favour of MariaDB --- dietpi/dietpi-software | 277 ++++++++--------------------------------- 1 file changed, 51 insertions(+), 226 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f6c2da34ac..57f93c0356 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1865,21 +1865,6 @@ _EOF_ #Webserver stacks #-------------------------------------------------------------------------------- - index_current=74 - - aSOFTWARE_WHIP_NAME[$index_current]='LAMP' - aSOFTWARE_WHIP_DESC[$index_current]='apache2 | mysql | php' - aSOFTWARE_CATEGORY_INDEX[$index_current]=13 - aSOFTWARE_TYPE[$index_current]=0 - aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&start=10#p52' - # - disable on Stretch - if (( $G_DISTRO >= 4 )); then - - aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$G_HW_MODEL]=0 - - fi - - #------------------ index_current=75 aSOFTWARE_WHIP_NAME[$index_current]='LASP' @@ -1897,21 +1882,6 @@ _EOF_ aSOFTWARE_TYPE[$index_current]=0 aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&start=10#p52' - #------------------ - index_current=77 - - aSOFTWARE_WHIP_NAME[$index_current]='LEMP' - aSOFTWARE_WHIP_DESC[$index_current]='nginx | mysql | php' - aSOFTWARE_CATEGORY_INDEX[$index_current]=13 - aSOFTWARE_TYPE[$index_current]=0 - aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5#p5' - # - disable on Stretch - if (( $G_DISTRO >= 4 )); then - - aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$G_HW_MODEL]=0 - - fi - #------------------ index_current=78 @@ -1930,21 +1900,6 @@ _EOF_ aSOFTWARE_TYPE[$index_current]=0 aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5#p5' - #------------------ - index_current=80 - - aSOFTWARE_WHIP_NAME[$index_current]='LLMP' - aSOFTWARE_WHIP_DESC[$index_current]='lighttpd | mysql | php' - aSOFTWARE_CATEGORY_INDEX[$index_current]=13 - aSOFTWARE_TYPE[$index_current]=0 - aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=1335#p1335' - # - disable on Stretch - if (( $G_DISTRO >= 4 )); then - - aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$G_HW_MODEL]=0 - - fi - #------------------ index_current=81 @@ -1990,21 +1945,6 @@ _EOF_ aSOFTWARE_TYPE[$index_current]=-1 aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5#p5' - #------------------ - index_current=86 - - aSOFTWARE_WHIP_NAME[$index_current]='MySQL' - aSOFTWARE_WHIP_DESC[$index_current]='database' - aSOFTWARE_CATEGORY_INDEX[$index_current]=13 - aSOFTWARE_TYPE[$index_current]=-1 - aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=1335#p1335' - # - disable on Stretch - if (( $G_DISTRO >= 4 )); then - - aSOFTWARE_AVAIL_G_HW_MODEL[$index_current,$G_HW_MODEL]=0 - - fi - #------------------ index_current=87 @@ -2862,13 +2802,6 @@ _EOF_ aSOFTWARE_INSTALL_STATE[89]=1 fi - #LLMP - if (( ${aSOFTWARE_INSTALL_STATE[80]} == 1 )); then - aSOFTWARE_INSTALL_STATE[84]=1 - aSOFTWARE_INSTALL_STATE[86]=1 - aSOFTWARE_INSTALL_STATE[89]=1 - fi - #LEAP if (( ${aSOFTWARE_INSTALL_STATE[79]} == 1 )); then aSOFTWARE_INSTALL_STATE[85]=1 @@ -2883,13 +2816,6 @@ _EOF_ aSOFTWARE_INSTALL_STATE[89]=1 fi - #LEMP - if (( ${aSOFTWARE_INSTALL_STATE[77]} == 1 )); then - aSOFTWARE_INSTALL_STATE[85]=1 - aSOFTWARE_INSTALL_STATE[86]=1 - aSOFTWARE_INSTALL_STATE[89]=1 - fi - #LAAP if (( ${aSOFTWARE_INSTALL_STATE[76]} == 1 )); then aSOFTWARE_INSTALL_STATE[83]=1 @@ -2904,13 +2830,6 @@ _EOF_ aSOFTWARE_INSTALL_STATE[89]=1 fi - #LAMP - if (( ${aSOFTWARE_INSTALL_STATE[74]} == 1 )); then - aSOFTWARE_INSTALL_STATE[83]=1 - aSOFTWARE_INSTALL_STATE[86]=1 - aSOFTWARE_INSTALL_STATE[89]=1 - fi - #WEBSERVER - Auto install via choice system for ((i=0; i<$TOTAL_SOFTWARE_INDEXS; i++)) do @@ -2964,9 +2883,8 @@ _EOF_ if (( ${aSOFTWARE_REQUIRES_MYSQL[$i]} && ${aSOFTWARE_INSTALL_STATE[$i]} == 1 )); then - # - Check for existing mysql/mariaDB installations - if (( ! ${aSOFTWARE_INSTALL_STATE[86]} && - ! ${aSOFTWARE_INSTALL_STATE[88]} )); then + # - Check for existing MariaDB installations + if (( ! ${aSOFTWARE_INSTALL_STATE[88]} )); then #WEBSERVER_MARIADB as new default aSOFTWARE_INSTALL_STATE[88]=1 @@ -3003,14 +2921,6 @@ _EOF_ #WEBSERVER_APACHE if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then - #MySQL - if (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 )); then - - #WEBSERVER_LAMP - aSOFTWARE_INSTALL_STATE[74]=1 - - fi - #SQLite if (( ${aSOFTWARE_INSTALL_STATE[87]} >= 1 )); then @@ -3031,14 +2941,6 @@ _EOF_ #WEBSERVER_NGINX elif (( ${aSOFTWARE_INSTALL_STATE[85]} >= 1 )); then - #MySQL - if (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 )); then - - #WEBSERVER_LEMP - aSOFTWARE_INSTALL_STATE[77]=1 - - fi - #SQLite if (( ${aSOFTWARE_INSTALL_STATE[87]} >= 1 )); then @@ -3058,14 +2960,6 @@ _EOF_ #WEBSERVER_LIGHTTPD elif (( ${aSOFTWARE_INSTALL_STATE[84]} >= 1 )); then - #MySQL - if (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 )); then - - #WEBSERVER_LLMP - aSOFTWARE_INSTALL_STATE[80]=1 - - fi - #SQLite if (( ${aSOFTWARE_INSTALL_STATE[87]} >= 1 )); then @@ -3085,31 +2979,6 @@ _EOF_ fi - #Prevent incompatible MySQL + MariaDB installation: https://github.com/Fourdee/DietPi/issues/761#issuecomment-280848758 - if (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 && ${aSOFTWARE_INSTALL_STATE[88]} >= 1 )); then - - # MySQL installed - if (( ${aSOFTWARE_INSTALL_STATE[86]} == 2 )); then - - aSOFTWARE_INSTALL_STATE[88]=0 - G_DIETPI-NOTIFY 2 "MySQL is already installed, MariaDB install has been disabled" - - # MariaDB installed - elif (( ${aSOFTWARE_INSTALL_STATE[88]} == 2 )); then - - aSOFTWARE_INSTALL_STATE[86]=0 - G_DIETPI-NOTIFY 2 "MariaDB is already installed, MySQL install has been disabled" - - # Both selected for install, disable MySQL - else - - aSOFTWARE_INSTALL_STATE[86]=0 - G_DIETPI-NOTIFY 2 "MySQL and MariaDB are selected for install. MySQL has been de-selected to prevent incompatible MySQL + MariaDB installation" - - fi - - fi - #DESKTOP for ((i=0; i<$TOTAL_SOFTWARE_INDEXS; i++)) do @@ -3668,34 +3537,14 @@ _EOF_ fi - #WEBSERVER_MYSQL - INSTALLING_INDEX=86 - if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - - Banner_Installing - - debconf-set-selections <<< "mysql-server mysql-server/root_password password $GLOBAL_PW" - debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $GLOBAL_PW" - - # In case remove old symlink, created by DietPi MySQL/MariaDB installation, otherwise installation will fail. - rm /var/lib/mysql &> /dev/null - G_AGI mysql-server - - # Fix depricated key_buffer -> key_buffer_size per MySQL 5.x notification - sed -i 's/^key_buffer[[:space:]]/key_buffer_size /g' /etc/mysql/my.cnf - - # Restart service and leave it running (just incase another install requires SQL DB creation). - systemctl restart mysql - - fi - #WEBSERVER_MARIADB INSTALLING_INDEX=88 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then Banner_Installing - # In case remove old symlink, created by DietPi MySQL/MariaDB installation, otherwise installation will fail. + # In case remove old symlink, created by DietPi MariaDB installation, otherwise installation will fail. + # This will not remove the folder in case, without "-R". rm /var/lib/mysql &> /dev/null G_AGI mariadb-server @@ -3796,7 +3645,7 @@ _EOF_ Banner_Installing - #Mysql must be running during install to allow debconf setup. + #MySQL must be running during install to allow debconf setup. systemctl start mysql # Set password parameters before installing @@ -8236,46 +8085,23 @@ _EOF_ fi - #WEBSERVER_MYSQL - INSTALLING_INDEX=86 - if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - - Banner_Configuration - - #Optimize for reduced memory use: https://github.com/Fourdee/DietPi/issues/605#issue-188930987 - cat << _EOF_ > /etc/mysql/conf.d/reduce_resources.cnf -[mysqld] -key_buffer_size=8M -max_connections=30 -query_cache_size=8M -query_cache_limit=512K -thread_stack=128K -_EOF_ - - fi - #WEBSERVER_MARIADB INSTALLING_INDEX=88 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + Banner_Configuration + # On Jessie assure unix_socket authentication: if (( $G_DISTRO < 4 )); then mysql -uroot -e "install plugin unix_socket soname 'auth_socket';" - mysql -uroot -e "grant usage on *.* to 'root'@'localhost' identified via unix_socket;flush privileges;" + mysql -uroot -e "grant all privileges on *.* to 'root'@'localhost' identified via unix_socket with grant option;flush privileges" # Drop unnecessary root user children. - mysql -uroot -e "drop user root@dietpi;drop user root@'127.0.0.1';drop user root@'::1';" + mysql -uroot -e "drop user 'root'@'dietpi';drop user 'root'@'127.0.0.1';drop user 'root'@'::1'" fi - fi - - #MariaDB + MySQL | Move SQL store to userdata location: https://github.com/Fourdee/DietPi/issues/672 - if (( ${aSOFTWARE_INSTALL_STATE[86]} == 1 || - ${aSOFTWARE_INSTALL_STATE[88]} == 1 )); then - - Banner_Configuration - + # Move SQL store to userdata location: https://github.com/Fourdee/DietPi/issues/672 if [ "$(readlink /var/lib/mysql)" != "$G_FP_DIETPI_USERDATA/mysql" ]; then systemctl stop mysql @@ -8284,7 +8110,7 @@ _EOF_ mkdir -p "$G_FP_DIETPI_USERDATA"/mysql # - copy - cp -R /var/lib/mysql/* "$G_FP_DIETPI_USERDATA"/mysql/ + cp -a /var/lib/mysql/* "$G_FP_DIETPI_USERDATA"/mysql/ if (( $? != 0 )); then G_DIETPI-NOTIFY 1 "Moving of MySQL data store failed to $G_FP_DIETPI_USERDATA/mysql. DietPi-Software will now exit" @@ -8304,6 +8130,17 @@ _EOF_ fi + ### Also for MariaDB? + #Optimize for reduced memory use: https://github.com/Fourdee/DietPi/issues/605#issue-188930987 +# cat << _EOF_ > /etc/mysql/conf.d/reduce_resources.cnf +#[mysqld] +#key_buffer_size=8M +#max_connections=30 +#query_cache_size=8M +#query_cache_limit=512K +#thread_stack=128K +#_EOF_ + fi #WEBSERVER_MYADMINPHP @@ -8452,7 +8289,7 @@ _EOF_ fi # Enable MySQL 4-byte support: https://doc.owncloud.org/server/latest/admin_manual/configuration/database/linux_database_configuration.html#configure-mysql-for-4-byte-unicode-support - cat << _EOF_ > /etc/mysql/conf.d/99-dietpi-4bit.cnf + cat << _EOF_ > /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf [mysqld] innodb_large_prefix=1 innodb_file_format=barracuda @@ -8483,11 +8320,9 @@ _EOF_ systemctl start mysql # For MariaDB, temporary database admin user needs to be created, as 'root' uses unix_socket login, which cannot be accessed by sudo -u www-data. - local mysql_cmd='mysql -uroot' - (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 )) && mysql_cmd+=" -p$GLOBAL_PW" - $mysql_cmd -e "grant all privileges on *.* to 'tmp_root'@'localhost' identified by '$GLOBAL_PW' with grant option" + mysql -uroot -e "grant all privileges on *.* to 'tmp_root'@'localhost' identified by '$GLOBAL_PW' with grant option" grep -q "'installed' => true," $config_php 2>/dev/null || occ maintenance:install --no-interaction --database "mysql" --database-name "owncloud" --database-user "tmp_root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$datadir" - $mysql_cmd -e "drop user 'tmp_root'@'localhost'" + mysql -uroot -e "drop user 'tmp_root'@'localhost'" # Enable MySQL 4-byte support for new installations only, to prevent risky database conversion tasks: if (( $oc_is_fresh == 1 )); then @@ -8652,7 +8487,7 @@ _EOF_ fi # Enable MySQL 4-byte support: https://docs.nextcloud.com/server/12/admin_manual/configuration_database/mysql_4byte_support.html - cat << _EOF_ > /etc/mysql/conf.d/99-dietpi-4bit.cnf + cat << _EOF_ > /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf [mysqld] innodb_large_prefix=1 innodb_file_format=barracuda @@ -8683,11 +8518,9 @@ _EOF_ systemctl start mysql # For MariaDB, temporary database admin user needs to be created, as 'root' uses unix_socket login, which cannot be accessed by sudo -u www-data. - local mysql_cmd='mysql -uroot' - (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 )) && mysql_cmd+=" -p$GLOBAL_PW" - $mysql_cmd -e "grant all privileges on *.* to 'tmp_root'@'localhost' identified by '$GLOBAL_PW' with grant option" + mysql -uroot -e "grant all privileges on *.* to 'tmp_root'@'localhost' identified by '$GLOBAL_PW' with grant option" grep -q "'installed' => true," $config_php 2>/dev/null || ncc maintenance:install --no-interaction --database "mysql" --database-name "nextcloud" --database-user "tmp_root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$datadir" - $mysql_cmd -e "drop user 'tmp_root'@'localhost'" + mysql -uroot -e "drop user 'tmp_root'@'localhost'" # Enable MySQL 4-byte support for new installations only, to prevent risky database conversion tasks: if (( $nc_is_fresh == 1 )); then @@ -12684,17 +12517,13 @@ _EOF_ G_AGP lighttpd - elif (( $index == 86 || $index == 88 )); then - - G_AGP mysql-server mysql-client + elif (( $index == 88 )); then - G_AGP mariadb-server mariadb-client + G_AGP mariadb-server + ### Also for MariaDB? # - custom confs - rm /etc/mysql/conf.d/reduce_resources.cnf - - # - Remove debian flag generated by mariaDB install that prevents mysql 5.5 being installed. - rm /var/lib/mysql/debian-* + #rm /etc/mysql/conf.d/reduce_resources.cnf # - SQL store rm /var/lib/mysql &> /dev/null || rm -R /var/lib/mysql &> /dev/null #in case of symlink or folder @@ -12737,14 +12566,12 @@ _EOF_ a2dissite owncloud 2>/dev/null rm /etc/apache2/sites-available/owncloud.conf 2>/dev/null rm /etc/nginx/sites-dietpi/owncloud.config 2>/dev/null - # Drop MySQL/MariaDB user and database + # Drop MariaDB user and database systemctl start mysql - local mysql_auth='-uroot' - (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 )) && mysql_auth+=" -p$GLOBAL_PW" - mysql "$mysql_auth" -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")@$(grep -m1 "'dbhost'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" - mysql "$mysql_auth" -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" - mysqldump --lock-tables "$mysql_auth" owncloud > "$G_FP_DIETPI_USERDATA"/owncloud_data/mysql_backup.sql - mysqladmin "$mysql_auth" drop owncloud -f + mysql -uroot -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")@$(grep -m1 "'dbhost'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" + mysql -uroot -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" + mysqldump -uroot --lock-tables owncloud > "$G_FP_DIETPI_USERDATA"/owncloud_data/mysql_backup.sql + mysqladmin -uroot drop owncloud -f # Purge APT package G_AGP owncloud-files owncloud owncloud-deps # Remove ownCloud installation folder @@ -12762,14 +12589,12 @@ _EOF_ rm /etc/nginx/sites-dietpi/nextcloud.config 2>/dev/null lighttpd-disable-mod dietpi-nextcloud 2>/dev/null rm /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf 2>/dev/null - # Drop MySQL/MariaDB user and database + # Drop MariaDB user and database systemctl start mysql - local mysql_auth='-uroot' - (( ${aSOFTWARE_INSTALL_STATE[86]} >= 1 )) && mysql_auth+=" -p$GLOBAL_PW" - mysql "$mysql_auth" -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/,//")" - mysql "$mysql_auth" -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" - mysqldump --lock-tables "$mysql_auth" nextcloud > "$G_FP_DIETPI_USERDATA"/nextcloud_data/mysql_backup.sql - mysqladmin "$mysql_auth" drop nextcloud -f + mysql -uroot -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/,//")" + mysql -uroot -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" + mysqldump -uroot --lock-tables nextcloud > "$G_FP_DIETPI_USERDATA"/nextcloud_data/mysql_backup.sql + mysqladmin -uroot drop nextcloud -f # Remove Nextcloud installation folder rm -R /var/www/nextcloud @@ -12828,7 +12653,7 @@ _EOF_ rm -R /var/www/ompd systemctl start mysql - mysqladmin -u root -p"$GLOBAL_PW" drop ompd -f + mysqladmin -uroot drop ompd -f elif (( $index == 130 )); then @@ -12926,7 +12751,7 @@ _EOF_ elif (( $index == 143 )); then systemctl start mysql - mysqladmin -u root -p"$GLOBAL_PW" drop koel -f + mysqladmin -uroot drop koel -f rm -R /var/www/koel @@ -13190,7 +13015,7 @@ _EOF_ #drop database systemctl start mysql - mysqladmin -u root -p"$GLOBAL_PW" drop ampache -f + mysqladmin -uroot drop ampache -f elif (( $index == 117 )); then @@ -13300,7 +13125,7 @@ _EOF_ #drop database systemctl start mysql - mysqladmin -u root -p"$GLOBAL_PW" drop pydio -f + mysqladmin -uroot drop pydio -f elif (( $index == 36 )); then @@ -13325,7 +13150,7 @@ _EOF_ #drop database systemctl start mysql - mysqladmin -u root -p"$GLOBAL_PW" drop baikal -f + mysqladmin -uroot drop baikal -f elif (( $index == 65 )); then @@ -13400,7 +13225,7 @@ _EOF_ rm /var/log/gogs.log systemctl start mysql - mysqladmin -u root -p"$GLOBAL_PW" drop gogs -f + mysqladmin -uroot drop gogs -f elif (( $index == 46 )); then @@ -13495,7 +13320,7 @@ _EOF_ # drop/delete database systemctl start mysql - mysqladmin -u root -p"$GLOBAL_PW" drop gitea -f + mysqladmin -uroot drop gitea -f systemctl stop mysql elif (( $index == 166 )); then @@ -13586,7 +13411,7 @@ _EOF_ rm -R /var/www/allo systemctl start mysql - mysqladmin -u root -p"$GLOBAL_PW" drop allo_db -f + mysqladmin -uroot drop allo_db -f systemctl stop mysql @@ -15380,7 +15205,7 @@ _EOF_ ( ${aSOFTWARE_INSTALL_STATE[80]} < 2 && ${aSOFTWARE_INSTALL_STATE[82]} < 2 ) )); then WHIP_TITLE='PhpMyAdmin' - WHIP_QUESTION="Due to a apt-get installation issue with PhpMyAdmin, you must have a fully installed Lighttpd + Mysql/MaridaDB webserver stack, before PhpMyAdmin can be selected for install.\n\nYour selection for PhpMyAdmin has been removed." + WHIP_QUESTION="Due to a apt-get installation issue with PhpMyAdmin, you must have a fully installed Lighttpd + MaridaDB webserver stack, before PhpMyAdmin can be selected for install.\n\nYour selection for PhpMyAdmin has been removed." whiptail --title "$WHIP_TITLE" --msgbox "$WHIP_QUESTION" --backtitle "$WHIP_BACKTITLE" 13 70 aSOFTWARE_INSTALL_STATE[90]=0 From 7f02c4da81cc6cbf6ec0aed2e7d2ad2bc6b992cc Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 16 Jan 2018 15:10:59 +0100 Subject: [PATCH 308/390] v6.0 + DietPi-Software | MySQL: Remove MySQL from DietPi in favour of MariaDB --- dietpi/func/create_mysql_db | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/dietpi/func/create_mysql_db b/dietpi/func/create_mysql_db index 1d3b88c634..9e29ea90dd 100644 --- a/dietpi/func/create_mysql_db +++ b/dietpi/func/create_mysql_db @@ -31,18 +31,15 @@ #Start MySQL if not running. service mysql start &> /dev/null - G_DIETPI-NOTIFY 2 "Creating MySQL database: $DATABASE_NAME" + G_DIETPI-NOTIFY 2 "Creating MariaDB database: $DATABASE_NAME" - # On MariaDB, unix_socket authentication is used, thus no root password is necessary + it breaks access on Jessie. - # If 'IDENTIFIED BY' is used on root user, it will overwrite unix_socket authentication, thus this part need to be left out on MariaDB. #Generate DB - mysql_cmd='mysql -uroot' - grep -q 'aSOFTWARE_INSTALL_STATE\[86\]=0' /DietPi/dietpi/.installed || mysql_cmd+=" -p$MYSQL_ROOT_PW" + # 'identified by' can overwrite unix_socket authentication, thus just use this for non-root users. grant_privileges='' [ "$DATABASE_USER" == 'root' ] || grant_privileges="grant all privileges on \`$DATABASE_NAME\`.* to $DATABASE_USER@localhost identified by '$DATABASE_PW';flush privileges" - $mysql_cmd -e "create database \`$DATABASE_NAME\`;$grant_privileges" + mysql -uroot -e "create database \`$DATABASE_NAME\`;$grant_privileges" - G_DIETPI-NOTIFY -1 "$?" "Creating MySQL database: $DATABASE_NAME |" + G_DIETPI-NOTIFY -1 "$?" "Creating MariaDB database: $DATABASE_NAME |" #----------------------------------------------------------------------------------- exit From 240f92e2791bd4645b298ded91019c36f57fb6d6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 16 Jan 2018 15:21:07 +0100 Subject: [PATCH 309/390] v6.0 + DietPi-Software | Create_MySQL_DB: Remove root password due to unix_socket authentication --- dietpi/dietpi-software | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 57f93c0356..31b3563d2d 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8703,7 +8703,7 @@ _EOF_ Banner_Configuration - /DietPi/dietpi/func/create_mysql_db phpbb3 "$GLOBAL_PW" root "$GLOBAL_PW" + /DietPi/dietpi/func/create_mysql_db phpbb3 root "$GLOBAL_PW" fi @@ -9634,7 +9634,7 @@ _EOF_ Banner_Configuration #Create mysql DB - /DietPi/dietpi/func/create_mysql_db wordpress "$GLOBAL_PW" root "$GLOBAL_PW" + /DietPi/dietpi/func/create_mysql_db wordpress root "$GLOBAL_PW" fi @@ -9917,7 +9917,7 @@ _EOF_ unzip -o sql.zip rm sql.zip - /DietPi/dietpi/func/create_mysql_db ampache "$GLOBAL_PW" root "$GLOBAL_PW" + /DietPi/dietpi/func/create_mysql_db ampache root "$GLOBAL_PW" mysql -u root -p"$GLOBAL_PW" ampache < ampache.sql rm ampache.sql @@ -10299,7 +10299,7 @@ _EOF_ a2enmod rewrite #Create Mysql DB - /DietPi/dietpi/func/create_mysql_db pydio "$GLOBAL_PW" root "$GLOBAL_PW" + /DietPi/dietpi/func/create_mysql_db pydio root "$GLOBAL_PW" #Setup Data directory local target_data_dir="$G_FP_DIETPI_USERDATA/pydio_data" @@ -10472,7 +10472,7 @@ _EOF_ cd ~/ # - Mysql DB - /DietPi/dietpi/func/create_mysql_db baikal "$GLOBAL_PW" root "$GLOBAL_PW" + /DietPi/dietpi/func/create_mysql_db baikal root "$GLOBAL_PW" fi @@ -10627,7 +10627,7 @@ _EOF_ mkdir -p "$G_FP_DIETPI_USERDATA"/gogs-repo # - sqldb - /DietPi/dietpi/func/create_mysql_db gogs "$GLOBAL_PW" root "$GLOBAL_PW" + /DietPi/dietpi/func/create_mysql_db gogs root "$GLOBAL_PW" # - service (couldnt get this to run as a new thread with systemD (&). so bash script ftw. cat << _EOF_ > /etc/gogs/start.sh @@ -11271,7 +11271,7 @@ _EOF_ sed -i "/'media_dir'/c \$cfg[\'media_dir\'] = \'/var/lib/mpd/music/\';" /var/www/ompd/include/config.inc.php sed -i "/'ignore_media_dir_access_error'/c \$cfg[\'ignore_media_dir_access_error\'] = \'true';" /var/www/ompd/include/config.inc.php - /DietPi/dietpi/func/create_mysql_db ompd "$GLOBAL_PW" root "$GLOBAL_PW" + /DietPi/dietpi/func/create_mysql_db ompd root "$GLOBAL_PW" fi @@ -11537,7 +11537,7 @@ _EOF_ Download_Test_Media - /DietPi/dietpi/func/create_mysql_db koel "$GLOBAL_PW" root "$GLOBAL_PW" + /DietPi/dietpi/func/create_mysql_db koel root "$GLOBAL_PW" cd /var/www/koel @@ -11947,7 +11947,7 @@ _EOF_ chown -R dietpi:dietpi /var/log/gitea # - sqldb - /DietPi/dietpi/func/create_mysql_db gitea "$GLOBAL_PW" root "$GLOBAL_PW" + /DietPi/dietpi/func/create_mysql_db gitea root "$GLOBAL_PW" fi @@ -11959,7 +11959,7 @@ _EOF_ Banner_Configuration - /DietPi/dietpi/func/create_mysql_db allo_db dietpi root dietpi + /DietPi/dietpi/func/create_mysql_db allo_db root "$GLOBAL_PW" mysql -u root -pdietpi allo_db < /var/www/allo_db.sql rm /var/www/allo_db.sql From 924a30da8e31681be2ce290b9ab0b7c9068d1677 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 16 Jan 2018 15:23:57 +0100 Subject: [PATCH 310/390] v6.0 + DietPi-Software | Create_MySQL_DB: Remove root password due to unix_socket authentication --- dietpi/func/create_mysql_db | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dietpi/func/create_mysql_db b/dietpi/func/create_mysql_db index 9e29ea90dd..d10ce98f94 100644 --- a/dietpi/func/create_mysql_db +++ b/dietpi/func/create_mysql_db @@ -2,21 +2,20 @@ { #//////////////////////////////////// # DietPi Function: - # - Creates a MySql database + # - Creates a MariaDB database #//////////////////////////////////// # Created by Daniel Knight / daniel.knight@dietpi.com / dietpi.com #//////////////////////////////////// # Usage: - # - /DietPi/dietpi/func/create_mysql_db DATABASE_NAME MYSQL_ROOT_PW DATABASE_USER DATABASE_PW + # - /DietPi/dietpi/func/create_mysql_db DATABASE_NAME DATABASE_USER DATABASE_PW # # Drop database: - # - mysqladmin -u root -pdietpi drop phpbb3 -f + # - mysqladmin -uroot drop phpbb3 -f #//////////////////////////////////// DATABASE_NAME="$1" - MYSQL_ROOT_PW="$2" - DATABASE_USER="$3" - DATABASE_PW="$4" + DATABASE_USER="$2" + DATABASE_PW="$3" #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals From 7002681aa2f5001493d0b5864bd80a6f71c2b71c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 16 Jan 2018 15:54:20 +0100 Subject: [PATCH 311/390] v6.0 + DietPi-Set_Software | Switch default repo to "deb.debian.org" --- dietpi/func/dietpi-set_software | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 78124ac610..95943a43ed 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -123,7 +123,7 @@ _EOF_ else - INPUT_MODE_VALUE='http://ftp.debian.org/debian/' + INPUT_MODE_VALUE='https://deb.debian.org/debian/' fi @@ -501,4 +501,4 @@ _EOF_ #----------------------------------------------------------------------------------- exit $EXIT_CODE #----------------------------------------------------------------------------------- -} \ No newline at end of file +} From 258b4f7b9193979b9f8320af184472705bbd0611 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 16 Jan 2018 16:13:13 +0100 Subject: [PATCH 312/390] v6.0 + DietPi-Software | MySQL: Adding dummy entries, as script expects all software indexes to be present --- dietpi/dietpi-software | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 31b3563d2d..31f32e9c3f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2511,6 +2511,29 @@ _EOF_ aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&start=10#p63' #------------------ + #-------------------------------------------------------------------------------- + #Free indexes (due to removal of MySQL) + #-------------------------------------------------------------------------------- + index_current=74 + aSOFTWARE_WHIP_NAME[$index_current]='free index' + aSOFTWARE_WHIP_DESC[$index_current]='' + aSOFTWARE_CATEGORY_INDEX[$index_current]=0 + aSOFTWARE_TYPE[$index_current]=-1 + index_current=77 + aSOFTWARE_WHIP_NAME[$index_current]='free index' + aSOFTWARE_WHIP_DESC[$index_current]='' + aSOFTWARE_CATEGORY_INDEX[$index_current]=0 + aSOFTWARE_TYPE[$index_current]=-1 + index_current=80 + aSOFTWARE_WHIP_NAME[$index_current]='free index' + aSOFTWARE_WHIP_DESC[$index_current]='' + aSOFTWARE_CATEGORY_INDEX[$index_current]=0 + aSOFTWARE_TYPE[$index_current]=-1 + index_current=86 + aSOFTWARE_WHIP_NAME[$index_current]='free index' + aSOFTWARE_WHIP_DESC[$index_current]='' + aSOFTWARE_CATEGORY_INDEX[$index_current]=0 + aSOFTWARE_TYPE[$index_current]=-1 #-------------------------------------------------------------------------------- #Total software installations @@ -2620,7 +2643,6 @@ _EOF_ 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 From 50875c7a4b4e1eee0d68783e9d1923052d03083e Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 16 Jan 2018 15:14:47 +0000 Subject: [PATCH 313/390] v6.0 + Revert to hard coded debian-security url: https://github.com/Fourdee/DietPi/issues/1385#issuecomment-357931542 --- dietpi/func/dietpi-set_software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 78124ac610..373446997f 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -149,7 +149,7 @@ _EOF_ cat << _EOF_ > /etc/apt/sources.list deb $INPUT_MODE_VALUE $G_DISTRO_NAME main contrib non-free deb $INPUT_MODE_VALUE $G_DISTRO_NAME-updates main contrib non-free -deb $(echo -e "$INPUT_MODE_VALUE" | sed 's/\/debian\//\/debian-security\//' ) $G_DISTRO_NAME/updates main contrib non-free +deb http://security.debian.org/debian-security/ $G_DISTRO_NAME/updates main contrib non-free deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free _EOF_ From a75747cf627e749c7909c23bcc63d5a9d92fd91b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 16 Jan 2018 20:36:31 +0100 Subject: [PATCH 314/390] v6.0 + DietPi-Set_Software | Repository fixes --- dietpi/func/dietpi-set_software | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 373446997f..03b57a900e 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -149,17 +149,17 @@ _EOF_ cat << _EOF_ > /etc/apt/sources.list deb $INPUT_MODE_VALUE $G_DISTRO_NAME main contrib non-free deb $INPUT_MODE_VALUE $G_DISTRO_NAME-updates main contrib non-free -deb http://security.debian.org/debian-security/ $G_DISTRO_NAME/updates main contrib non-free +deb https://deb.debian.org/debian-security/ $G_DISTRO_NAME/updates main contrib non-free deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free _EOF_ - # Jessie, switch to http: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 - if (( $G_DISTRO == 3 )); then + # Jessie, switch deb.debian.org to http: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 + if (( $G_DISTRO < 4 )); then - sed -i 's/https/http/g' /etc/apt/sources.list + sed -i 's|https://deb.debian.org|http://deb.debian.org|g' /etc/apt/sources.list # Buster, remove backports: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 - elif (( $G_DISTRO == 5 )); then + elif (( $G_DISTRO > 4 )); then sed -i '/backports/d' /etc/apt/sources.list @@ -501,4 +501,4 @@ _EOF_ #----------------------------------------------------------------------------------- exit $EXIT_CODE #----------------------------------------------------------------------------------- -} \ No newline at end of file +} From 20a03896e9378f17b14b5cbfd1a6d424aa6ff031 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 16 Jan 2018 23:14:01 +0100 Subject: [PATCH 315/390] DietPi-Software | MariaDB symlink fix + phpMyAdmin user fix --- dietpi/dietpi-software | 43 +++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 31f32e9c3f..be35ab9b3e 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3567,7 +3567,7 @@ _EOF_ # In case remove old symlink, created by DietPi MariaDB installation, otherwise installation will fail. # This will not remove the folder in case, without "-R". - rm /var/lib/mysql &> /dev/null + [ "$(readlink /var/lib/mysql)" ] && [ ! -d "$(readlink /var/lib/mysql)/mysql" ] && rm /var/lib/mysql G_AGI mariadb-server fi @@ -3668,13 +3668,12 @@ _EOF_ Banner_Installing #MySQL must be running during install to allow debconf setup. - systemctl start mysql + G_RUN_CMD systemctl start mysql # Set password parameters before installing debconf-set-selections <<< "phpmyadmin phpmyadmin/dbconfig-install boolean true" - debconf-set-selections <<< "phpmyadmin phpmyadmin/app-password-confirm password $GLOBAL_PW" - debconf-set-selections <<< "phpmyadmin phpmyadmin/mysql/admin-pass password $GLOBAL_PW" debconf-set-selections <<< "phpmyadmin phpmyadmin/mysql/app-pass password $GLOBAL_PW" + debconf-set-selections <<< "phpmyadmin phpmyadmin/app-password-confirm password $GLOBAL_PW" if (( ${aSOFTWARE_INSTALL_STATE[83]} == 1 )); then @@ -8113,20 +8112,10 @@ _EOF_ Banner_Configuration - # On Jessie assure unix_socket authentication: - if (( $G_DISTRO < 4 )); then - - mysql -uroot -e "install plugin unix_socket soname 'auth_socket';" - mysql -uroot -e "grant all privileges on *.* to 'root'@'localhost' identified via unix_socket with grant option;flush privileges" - # Drop unnecessary root user children. - mysql -uroot -e "drop user 'root'@'dietpi';drop user 'root'@'127.0.0.1';drop user 'root'@'::1'" - - fi - # Move SQL store to userdata location: https://github.com/Fourdee/DietPi/issues/672 - if [ "$(readlink /var/lib/mysql)" != "$G_FP_DIETPI_USERDATA/mysql" ]; then + if [ "$(readlink /var/lib/mysql)" != "$G_FP_DIETPI_USERDATA/mysql/" ]; then - systemctl stop mysql + G_RUN_CMD systemctl stop mysql # - Create target dir mkdir -p "$G_FP_DIETPI_USERDATA"/mysql @@ -8140,7 +8129,7 @@ _EOF_ fi - rm -R /var/lib/mysql + rm -R /var/lib/mysql &> /dev/null || rm /var/lib/mysql &> /dev/null # - Symlink ln -sf "$G_FP_DIETPI_USERDATA"/mysql /var/lib/mysql @@ -8152,9 +8141,20 @@ _EOF_ fi + # On Jessie assure unix_socket authentication: + if (( $G_DISTRO < 4 )); then + + G_RUN_CMD systemctl start mysql + mysql -uroot -e "install plugin unix_socket soname 'auth_socket';" &> /dev/null + mysql -uroot -e "grant all privileges on *.* to 'root'@'localhost' identified via unix_socket with grant option;flush privileges" + # Drop unnecessary root user children. + mysql -uroot -e "drop user 'root'@'dietpi';drop user 'root'@'127.0.0.1';drop user 'root'@'::1'" &> /dev/null + + fi + ### Also for MariaDB? - #Optimize for reduced memory use: https://github.com/Fourdee/DietPi/issues/605#issue-188930987 -# cat << _EOF_ > /etc/mysql/conf.d/reduce_resources.cnf + # Optimize for reduced memory use: https://github.com/Fourdee/DietPi/issues/605#issue-188930987 + #cat << _EOF_ > /etc/mysql/conf.d/reduce_resources.cnf #[mysqld] #key_buffer_size=8M #max_connections=30 @@ -8179,6 +8179,11 @@ _EOF_ fi + # Due to MariaDB unix_socket authentication, "root" cannot be used to login the web ui. + # Thus default "phpmyadmin" user need to be used, who on Jessie does not have all privileges: + # http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=54#p54 + mysql -uroot -e "grant all privileges on *.* to phpmyadmin@localhost with grant option" + fi #WEBSERVER_REDIS From 7cf31f57898b875a7a50dc5157d12ea8d3d2dbe1 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 17 Jan 2018 01:05:33 +0100 Subject: [PATCH 316/390] v6.0 DietPi-Set_Software | Fix locales? --- dietpi/func/dietpi-set_software | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 373446997f..3acf6091af 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -72,18 +72,6 @@ en_GB.UTF-8 UTF-8 _EOF_ G_RUN_CMD dpkg-reconfigure -f noninteractive locales - # - Pump default locale into sys env: https://github.com/Fourdee/DietPi/issues/825 - cat << _EOF_ > /etc/environment -LC_ALL=$INPUT_MODE_VALUE -LANG=$INPUT_MODE_VALUE -_EOF_ - - # - and default locale (jessie?) - cat << _EOF_ > /etc/default/locale -LC_ALL=$INPUT_MODE_VALUE -LANG=$INPUT_MODE_VALUE -_EOF_ - # - and force locale for remote access, especially dropbear, where receiving locale from client can't be suppressed: cat << _EOF_ > /etc/profile.d/99-dietpi-force-locale.sh # To force server locales on SSH access, as dropbear does automatically overwrite them by client values: @@ -93,10 +81,6 @@ export LANGUAGE="$( echo $INPUT_MODE_VALUE | sed 's/\..*//' ):$( echo $INPUT_MOD _EOF_ chmod +x /etc/profile.d/99-dietpi-force-locale.sh - - #??? Is this still required? - localectl set-locale LANG="$INPUT_MODE_VALUE" - sed -i "/AUTO_SETUP_LOCALE=/c\AUTO_SETUP_LOCALE=$INPUT_MODE_VALUE" /DietPi/dietpi.txt else @@ -501,4 +485,4 @@ _EOF_ #----------------------------------------------------------------------------------- exit $EXIT_CODE #----------------------------------------------------------------------------------- -} \ No newline at end of file +} From 31b77e2641c9a8f8a73f8a6033c85b3a55c93df7 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 17 Jan 2018 13:14:18 +0000 Subject: [PATCH 317/390] v6.0 + https://github.com/Fourdee/DietPi/issues/1397 --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ca3f2d0426..d1a21c2cbc 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -33,6 +33,7 @@ DietPi-Software | Nextcloud: Resolve OPcache admin panel warnings on Lighttpd DietPi-Software | UrBackup: Installation updated to latest version 2.1.20. For new installations only: https://github.com/Fourdee/DietPi/issues/1335 DietPi-Software | NodeRed: Corrected user which nodered runs under, now runs as its own user, created during install: https://github.com/Fourdee/DietPi/issues/1294#issuecomment-354314318 DietPi-Software | SqueezeBox/LMS (Stretch): Installation resolved: https://github.com/Fourdee/DietPi/issues/1124 +DietPi-Software | MySQL: Completely remove MySQL from DietPi in favour of MariaDB: https://github.com/Fourdee/DietPi/issues/1397 run_ntpd | Added support for systemd-timesyncd completion/detection: https://github.com/Fourdee/DietPi/issues/1379 Bug Fixes: From 16dcaeeb2b4f1e4a3559efb936ed87c55b5d181b Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 17 Jan 2018 13:23:22 +0000 Subject: [PATCH 318/390] v6.0 + https://github.com/Fourdee/DietPi/pull/1399#issuecomment-358284235 --- dietpi.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi.txt b/dietpi.txt index 758791aa57..4fb78bc96b 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -188,7 +188,7 @@ CONFIG_PREFER_IPVERSION=ipv4 # Raspbian = https://www.raspbian.org/RaspbianMirrors # Debian = https://www.debian.org/mirror/official#list CONFIG_APT_RASPBIAN_MIRROR=https://www.mirrorservice.org/sites/archive.raspbian.org/raspbian -CONFIG_APT_DEBIAN_MIRROR=http://ftp.debian.org/debian/ +CONFIG_APT_DEBIAN_MIRROR=https://deb.debian.org/debian/ #NTPD mirror, applied to /etc/ntp.conf # For a full list, please see http://www.pool.ntp.org From cdee74a4056770d208ba9f6b2e479e93071226a5 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 17 Jan 2018 13:26:24 +0000 Subject: [PATCH 319/390] v6.0 + Allow for PREP to run on images, which do not contain apt/.deb based kernels (eg: nanopi official images): https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index f9b0241d89..578f099d24 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -555,7 +555,7 @@ _EOF_ 'zip' # .zip wrapper ) - + # - G_DISTRO specific packages: if (( $G_DISTRO < 4 )); then @@ -648,8 +648,7 @@ _EOF_ else - G_DIETPI-NOTIFY 1 'Error: Unable to find kernel packages for installation. Aborting...' - exit 1 + G_DIETPI-NOTIFY 2 'Unable to find kernel packages for installation. Assuming non-APT/.deb install.' fi From 59383d944fc125cdf25304fc86ff24790bb2ec60 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 17 Jan 2018 13:46:38 +0000 Subject: [PATCH 320/390] v6.0 + Repo key packages: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-358301273 --- PREP_SYSTEM_FOR_DIETPI.sh | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 578f099d24..1550a4d3ec 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -556,7 +556,7 @@ _EOF_ ) - # - G_DISTRO specific packages: + # - G_DISTRO specific required packages: if (( $G_DISTRO < 4 )); then aPACKAGES_REQUIRED_INSTALL+=('dropbear') # DietPi default SSH-Client @@ -567,6 +567,18 @@ _EOF_ fi + # - G_HW_MODEL specific required repo key packages + # Repo keys: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-358301273 + if (( $G_HW_MODEL > 10 )); then + + G_AGI debian-keyring debian-archive-keyring + + else + + G_AGI raspbian-archive-keyring + + fi + # - G_HW_MODEL specific package removals: # VM if (( $G_HW_MODEL == 20 )); then @@ -576,9 +588,10 @@ _EOF_ fi + # - Kernel required packages # - G_HW_ARCH specific required packages - # As these are kernel, firmware or bootloader packages, we need to install them directly to allow autoremove of in case older kernel packages: - # https://github.com/Fourdee/DietPi/issues/1285#issuecomment-354602594 + # As these are kernel, firmware or bootloader packages, we need to install them directly to allow autoremove of in case older kernel packages: + # https://github.com/Fourdee/DietPi/issues/1285#issuecomment-354602594 # x86_64 if (( $G_HW_ARCH == 10 )); then @@ -601,7 +614,7 @@ _EOF_ fi - # - G_HW_MODEL specific required packages + # - G_HW_MODEL specific required Kernel packages # RPi elif (( $G_HW_MODEL < 10 )); then @@ -648,11 +661,11 @@ _EOF_ else - G_DIETPI-NOTIFY 2 'Unable to find kernel packages for installation. Assuming non-APT/.deb install.' + G_DIETPI-NOTIFY 2 'Unable to find kernel packages for installation. Assuming non-APT/.deb kernel installation.' fi - #ARMbian DTB + #ARMbian/others DTB AUTO_DETECT_DTB_PKG=$(dpkg --get-selections | grep '^linux-dtb-' | awk '{print $1}') if [ -n "$AUTO_DETECT_DTB_PKG" ]; then @@ -668,7 +681,6 @@ _EOF_ # G_AGI $AUTO_DETECT_FIRMWARE_PKG # fi - # Unpacking armbian-firmware (5.35) ... # dpkg: error processing archive /var/cache/apt/archives/armbian-firmware_5.35_all .deb (--unpack): # trying to overwrite '/lib/firmware/rt2870.bin', which is also in package firmwa re-misc-nonfree 20161130-3 From 9088ce16f9cd0dc6b1de5c74cd79914dafa135af Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 17 Jan 2018 13:57:27 +0000 Subject: [PATCH 321/390] v6.0 + minor text --- PREP_SYSTEM_FOR_DIETPI.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 1550a4d3ec..8ad69dc2b3 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -346,7 +346,7 @@ _EOF_ #------------------------------------------------------------------------------------------------ echo -e '' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' - G_DIETPI-NOTIFY 0 'Step 3: Distro selection / APT prep:' + G_DIETPI-NOTIFY 0 'Step 3: Distro selection:' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ @@ -503,7 +503,7 @@ _EOF_ #------------------------------------------------------------------------------------------------ echo -e '' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' - G_DIETPI-NOTIFY 0 'Step 4: APT removals:' + G_DIETPI-NOTIFY 0 'Step 4: APT configuration:' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ @@ -589,7 +589,7 @@ _EOF_ fi # - Kernel required packages - # - G_HW_ARCH specific required packages + # - G_HW_ARCH specific required Kernel packages # As these are kernel, firmware or bootloader packages, we need to install them directly to allow autoremove of in case older kernel packages: # https://github.com/Fourdee/DietPi/issues/1285#issuecomment-354602594 # x86_64 @@ -743,7 +743,7 @@ _EOF_ #------------------------------------------------------------------------------------------------ echo -e '' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' - G_DIETPI-NOTIFY 0 'Step 5: APT Installations:' + G_DIETPI-NOTIFY 0 'Step 5: APT installations:' G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ From 1ae6c4371f2e7f7dbcb2d2642ae0a454d98b175a Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 17 Jan 2018 14:26:16 +0000 Subject: [PATCH 322/390] v6.0 root@DietPi:/# G_TREESIZE du: invalid zero-length file name --- dietpi/func/dietpi-globals | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 9f0a0cf6b2..8d13fb41d1 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -73,7 +73,8 @@ # $1 = Optional input directory (eg: G_TREESIZE /etc/apt) G_TREESIZE() { - du -k --max-depth=1 "$1" | sort -nr | awk ' + + du -k --max-depth=1 $1 | sort -nr | awk ' BEGIN { split("KB,MB,GB,TB", Units, ","); } From 2f0b0c14d3259a5de3401528faa6bf030fe5f30e Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 17 Jan 2018 14:51:15 +0000 Subject: [PATCH 323/390] v6.0 + Info for v6.0 images: https://github.com/Fourdee/DietPi/issues/1385 https://github.com/Fourdee/DietPi/issues/1285 --- CHANGELOG.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d1a21c2cbc..fc7896a43f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,11 +1,16 @@ -v6.0 +v6.0 (previously v160) (xx/01/18) +Important Information: +All DietPi images have been re-created. Existing installations (v159 or lower), can no longer be updated, or supported. To continue support, users must install the latest v6.0 image. + - https://github.com/Fourdee/DietPi/issues/1385 + - All images are now Debian Stretch (excluding Odroid's) + - ARMbian based images are now mainline kernel 4.13. + - If you are happy with your existing installation of v159 (or lower), you are not required to install the v6.0 image, however, we cannot provide support for the v159 (or lower) installation. + Minor notes: The XMAS tree has now been taken down, stored away on github for next year. Hope you all had a good one :D -Image Modifications: - Changes / Improvements / Optimizations: General | DietPi RPi kernel, now reverted to stock RPi kernel: https://github.com/Fourdee/DietPi/issues/1378 General | We have completed much needed backbone work for DietPi, which will allow for improved expansion in source code. This includes the use of dietpi-globals. From 3423a9e229b55d7261dda7d30738ac78c4252908 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2018 00:37:55 +0100 Subject: [PATCH 324/390] v6.0 + Remove /etc/default/locales and /etc/environment adjustment on locale setup. + Some minor typos/wording/cleanup. + Doubled apt clean and update before repository adjustments. --- PREP_SYSTEM_FOR_DIETPI.sh | 48 ++++++++------------------------------- 1 file changed, 10 insertions(+), 38 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index f9b0241d89..ec4ca26f4d 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -69,40 +69,23 @@ # NB: DEV, any changes here must be also rolled into function '/DietPi/dietpi/func/dietpi-set_software locale', for future script use echo 'en_GB.UTF-8 UTF-8' > /etc/locale.gen dpkg-reconfigure -f noninteractive locales + # dpkg-reconfigure includes: + # - "locale-gen": Generate locale(s) based on "/etc/locale.gen" or interactive selection. + # - "update-locale": Add $LANG to "/etc/default/locale" based on generated locale(s) or interactive default language selection. if (( $? != 0 )); then echo -e 'Error: Locale generation failed. Aborting...\n' exit 1 fi - #locale-gen - # - Pump default locale into sys env: https://github.com/Fourdee/DietPi/issues/825 - cat << _EOF_ > /etc/environment -LC_ALL=en_GB.UTF-8 -LANG=en_GB.UTF-8 -_EOF_ - - # - and default locale (jessie/meveric) - cat << _EOF_ > /etc/default/locale -LC_ALL=en_GB.UTF-8 -LANG=en_GB.UTF-8 -_EOF_ - - # - and force locale for remote access, especially dropbear, where receiving locale from client can't be suppressed: cat << _EOF_ > /etc/profile.d/99-dietpi-force-locale.sh -# To force server locales on SSH access, as dropbear does automatically overwrite them by client values: -export LANG="en_GB.UTF-8" -export LC_ALL="en_GB.UTF-8" -export LANGUAGE="en_GB:en" +# Force locale on remote access, especially via dropbear, where overwriting server locale by SSH client cannot be suppressed: +export LANG=en_GB.UTF-8 +export LC_ALL=en_GB.UTF-8 +export LANGUAGE=en_GB:en _EOF_ chmod +x /etc/profile.d/99-dietpi-force-locale.sh - #. /etc/profile.d/99-dietpi-force-locale.sh - # root@nanopineo:~# . /etc/profile.d/99-dietpi-force-locale.sh - # -bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8) - # root@nanopineo:~# localectl set-locale LANG="en_GB.UTF-8" - # root@nanopineo:~# localectl set-locale LC_ALL="en_GB.UTF-8" - # Failed to issue method call: Invalid Locale data. #Force en_GB Locale for rest of script. Prevents incorrect parsing with non-english locales. LANG=en_GB.UTF-8 @@ -276,10 +259,6 @@ _EOF_ #Recreate dietpi logs dir, used by G_AGx G_RUN_CMD mkdir -p /var/tmp/dietpi/logs - G_RUN_CMD apt-get clean - - G_AGUP - G_DIETPI-NOTIFY 2 'Installing core packages, required for next stage of this script:' G_AGI apt-transport-https unzip whiptail @@ -372,12 +351,6 @@ _EOF_ G_DIETPI-NOTIFY 2 "Disabled Distro downgrade: index $temp_distro_index" temp_distro_available=0 - # - RPi disable buster - #elif (( $temp_distro_index == 5 && $G_HW_MODEL < 10 )); then - - # G_DIETPI-NOTIFY 2 "Disabled Buster for RPi: index $temp_distro_index" - # temp_distro_available=0 - fi # - Enable option @@ -416,7 +389,7 @@ _EOF_ fi G_DIETPI-NOTIFY 2 'Removing conflicting apt sources.list.d' - # NB: Apt sources will get overwritten during 1st run, via boot script andn dietpi.txt entry + # NB: Apt sources will get overwritten during 1st run, via boot script and dietpi.txt entry #rm /etc/apt/sources.list.d/* &> /dev/null #Probably a bad idea rm /etc/apt/sources.list.d/deb-multimedia.list &> /dev/null #meveric @@ -448,11 +421,10 @@ deb https://deb.debian.org/debian-security/ $DISTRO_TARGET_NAME/updates main con deb https://deb.debian.org/debian/ $DISTRO_TARGET_NAME-backports main contrib non-free _EOF_ - # Jessie, switch to http: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 + # Jessie, switch deb.debian.org to http: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 if (( $G_DISTRO < 4 )); then sed -i 's/https:/http:/g' /etc/apt/sources.list - #sed -i 's/https:/http:/g' /etc/apt/sources.list.d/* # Buster, remove backports: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-351830101 elif (( $DISTRO_TARGET > 4 )); then @@ -761,7 +733,7 @@ _EOF_ G_AGA - # Enable HTTPS for Debian ATP repo, after system was dist-upgraded to Stretch+ + # Reenable HTTPS for deb.debian.org, if system was dist-upgraded to Stretch+ if (( $G_DISTRO > 3 && $G_HW_MODEL > 9 )); then sed -i 's/http:/https:/g' /etc/apt/sources.list From b896b8b14537f95d6ebf7babd2d6afebebcaff6a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2018 00:39:29 +0100 Subject: [PATCH 325/390] v6.0 + Remove unnecessary double quotes, which might also cause issues. --- dietpi/func/dietpi-set_software | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 3acf6091af..edcb909ccc 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -75,9 +75,9 @@ _EOF_ # - and force locale for remote access, especially dropbear, where receiving locale from client can't be suppressed: cat << _EOF_ > /etc/profile.d/99-dietpi-force-locale.sh # To force server locales on SSH access, as dropbear does automatically overwrite them by client values: -export LANG="$INPUT_MODE_VALUE" -export LC_ALL="$INPUT_MODE_VALUE" -export LANGUAGE="$( echo $INPUT_MODE_VALUE | sed 's/\..*//' ):$( echo $INPUT_MODE_VALUE | sed 's/_.*//' )" +export LANG=$INPUT_MODE_VALUE +export LC_ALL=$INPUT_MODE_VALUE +export LANGUAGE=$( echo $INPUT_MODE_VALUE | sed 's/\..*//' ):$( echo $INPUT_MODE_VALUE | sed 's/_.*//' ) _EOF_ chmod +x /etc/profile.d/99-dietpi-force-locale.sh From 29e5a4db7225a5d517dcd9106bff88255cd32847 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2018 14:43:21 +0100 Subject: [PATCH 326/390] v6.0 DietPi-Config | Minor NTP enhancements --- dietpi/dietpi-config | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 5a0b9d67bf..bb4cbcd997 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -5056,12 +5056,13 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ whiptail_menu_array+=('debian.pool.ntp.org' 'Debian Global') whiptail_menu_array+=('pool.ntp.org' 'Global') whiptail_menu_array+=('europe.pool.ntp.org' 'Europe') - whiptail_menu_array+=('north-america.pool.ntp.org' 'US North') - whiptail_menu_array+=('south-america.pool.ntp.org' 'US South') - whiptail_menu_array+=('oceania.pool.ntp.org' 'Oceania') + whiptail_menu_array+=('north-america.pool.ntp.org' 'North America') + whiptail_menu_array+=('south-america.pool.ntp.org' 'South America') + whiptail_menu_array+=('africa.pool.ntp.org' 'Africa') whiptail_menu_array+=('asia.pool.ntp.org' 'Asia') + whiptail_menu_array+=('oceania.pool.ntp.org' 'Oceania') - OPTION=$(whiptail --title "Choose NTPD Mirror" --menu "Please select a NTPD mirror, or choose custom for manual entry." --default-item "$ntpd_mirror_current" --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" 15 100 7 "${whiptail_menu_array[@]}" 3>&1 1>&2 2>&3) + OPTION=$(whiptail --title "Choose NTPD Mirror" --menu "Please select a NTPD mirror, or choose custom for manual entry.\n - Further information: \"http://www.pool.ntp.org/zone/@\"" --default-item "$ntpd_mirror_current" --cancel-button "$TEXT_MENU_BACK" --backtitle "$WHIP_BACKTITLE" 16 100 7 "${whiptail_menu_array[@]}" 3>&1 1>&2 2>&3) CHOICE=$? if (( $CHOICE == 0 )); then From 32df927ac47a29097db1071da6168238ade8323c Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 18 Jan 2018 13:49:55 +0000 Subject: [PATCH 327/390] v6.0 + Coding error: https://github.com/Fourdee/DietPi/commit/59383d944fc125cdf25304fc86ff24790bb2ec60 re: @k-plan --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 8ad69dc2b3..651e5c4c8b 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -569,7 +569,7 @@ _EOF_ # - G_HW_MODEL specific required repo key packages # Repo keys: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-358301273 - if (( $G_HW_MODEL > 10 )); then + if (( $G_HW_MODEL >= 10 )); then G_AGI debian-keyring debian-archive-keyring From 7eaf7ceede062f552f7ecd56ec8298454ff27708 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 18 Jan 2018 14:07:45 +0000 Subject: [PATCH 328/390] v6.0 + C1, allow ondemand: https://github.com/Fourdee/DietPi/issues/1385#issuecomment-358366419 RE: @k-plan --- dietpi/dietpi-config | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index bb4cbcd997..0d09a19b61 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1865,9 +1865,7 @@ local Description="Change CPU Governor:" local whiptail_menu_array=() - # - C1 | disable ondemand: https://github.com/Fourdee/DietPi/issues/248 - if (( $(cat "$FP_CPU_SCALING_GOV" | grep -ci -m1 'ondemand') == 1 )) && - (( $G_HW_MODEL != 10 )); then + if (( $(cat "$FP_CPU_SCALING_GOV" | grep -ci -m1 'ondemand') == 1 )); 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 (recommended)." From cb2915a11d50a98e36ad2600ed0527c74178c680 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2018 15:08:35 +0100 Subject: [PATCH 329/390] v6.0 + Switch NTP config to "pool" directive: https://serverfault.com/a/773234 + Use sed to leave directives in place. --- dietpi/func/dietpi-set_software | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index ed0b0ca856..bf9f0bbb5f 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -214,11 +214,23 @@ _EOF_ fi # - Set NTPD mirror - sed -i '/^server [0-9]/d' /etc/ntp.conf - for ((i=0; i<4; i++)) - do + # - Remove obsolete 'server' entries. + sed -i '/^[[:blank:]#;]*server [0-9]/d' /etc/ntp.conf + for ((i=0; i<4; i++)) do - echo -e "server $i.$ntpd_mirror iburst" >> /etc/ntp.conf + if grep "^[[:blank:]]*pool $i" /etc/ntp.conf; then + + sed -i "s/^[[:blank:]]*pool $i.*/pool $i.$ntpd_mirror iburst/" /etc/ntp.conf + + elif grep "^[[:blank:]#;]*pool $i" /etc/ntp.conf; then + + sed -i "s/^[[:blank:]#;]*pool $i.*/pool $i.$ntpd_mirror iburst/" /etc/ntp.conf + + else + + echo -e "pool $i.$ntpd_mirror iburst" >> /etc/ntp.conf + + fi done From 14ff529f463095a61ffd131ed6bbf84f012c7890 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 18 Jan 2018 14:54:52 +0000 Subject: [PATCH 330/390] v6.0 + https://github.com/Fourdee/DietPi/pull/1404 --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fc7896a43f..a8de0a0a55 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -30,6 +30,7 @@ DietPi-Config | Locale: en_GB.UTF-8 is now automatically installed, alongside us DietPi-Drive_Manager | Added support for exFAT, many thanks @MichaIng : https://github.com/Fourdee/DietPi/pull/1312 DietPi-Globals | Global variables and functions are now exported during login. Please see the sourcecode for more information: https://github.com/Fourdee/DietPi/issues/1311 DietPi-Set_Hardware | Sparky SBC: enable aotg.aotg1_speed compatibility setting for USB 1.1, when USB-DAC configured: https://github.com/Fourdee/DietPi/issues/1301 +DietPi-Set_Software | "pool" directive is now used for NTPD: https://github.com/Fourdee/DietPi/pull/1404 DietPi-Software | NAA Daemon: Updated to latest (3.5.2-36). Existing installs will be patched automatically: https://github.com/Fourdee/DietPi/issues/1305 DietPi-Software | PHP-FPM: Increased from "$CPU_CORES_TOTAL" to "pm.max_children = $(( $CPU_CORES_TOTAL * 3 ))". This should avoid failed forking of PHP-FPM processes/requests : https://github.com/Fourdee/DietPi/issues/1298 DietPi-Software | ownCloud/Nextcloud: Added option to choose data directory via dietpi.txt pre installation: https://github.com/Fourdee/DietPi/issues/1314#issuecomment-352782055 From a8dc2e4e4e01dc4a78e9baedbfe7b2af291ad9b1 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2018 17:44:10 +0100 Subject: [PATCH 331/390] v6.0 + Switch from OracleJDK to OpenJDK --- dietpi/dietpi-software | 57 ++++++++++-------------------------------- 1 file changed, 13 insertions(+), 44 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index be35ab9b3e..f805cb81f6 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2294,7 +2294,7 @@ _EOF_ index_current=8 aSOFTWARE_WHIP_NAME[$index_current]='Java' - aSOFTWARE_WHIP_DESC[$index_current]='oracle java 8 jdk/jre libary' + aSOFTWARE_WHIP_DESC[$index_current]='OpenJDK 8 + JRE libary' aSOFTWARE_CATEGORY_INDEX[$index_current]=4 aSOFTWARE_TYPE[$index_current]=1 #------------------ @@ -3107,7 +3107,7 @@ _EOF_ # - Flag for install aSOFTWARE_INSTALL_STATE[8]=1 - G_DIETPI-NOTIFY 2 "Oracle Java will be installed" + G_DIETPI-NOTIFY 2 "OpenJDK 8 will be installed" break @@ -7326,29 +7326,21 @@ _EOF_ Banner_Installing - # - Raspbian - if (( $G_HW_MODEL < 10 )); then - - G_AGI oracle-java8-jdk - - # - Debian. Add repo - else + # On Jessie use backports repo: + if (( $G_DISTRO == 3 )); then - cat << _EOF_ > /etc/apt/sources.list.d/webupd8team-java.list -deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main -deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main + cat << _EOF_ > /etc/apt/preferences.d/99-dietpi-openjdk-8-jdk +Package: openjdk-8-jdk +Pin: release a=jessie-backports +Pin-Priority: 990 _EOF_ - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 G_AGUP - # - Accept the license: https://github.com/Fourdee/DietPi/issues/298 - debconf-set-selections <<< "oracle-java8-installer shared/accepted-oracle-license-v1-1 boolean true" - - G_AGI oracle-java8-installer - fi + G_AGI openjdk-8-jdk + fi INSTALLING_INDEX=9 @@ -8947,29 +8939,7 @@ _EOF_ Banner_Configuration - # - Possible locations for Java - # sed -i "/JAVA_HOME=/c\JAVA_HOME=$(which java)" /etc/default/tomcat8 # This doesnt work... | c2=/usr/bin/java/bin/java (Not a directory) | RPi = /usr/bin/java/bin/java (Not a directory) - local afp_java=( - - '/usr/lib/jvm/java-7-oracle' - '/usr/lib/jvm/java-8-oracle' - '/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt' #Rasbian - - ) - - for ((i=0; i<${#afp_java[@]}; i++)) - do - - if [ -d "${afp_java[$i]}" ]; then - - sed -i "/JAVA_HOME=/c\JAVA_HOME=${afp_java[$i]}" /etc/default/tomcat8 - break - - fi - - done - - unset afp_java + sed -i "/JAVA_HOME=/c\JAVA_HOME=$(find \/usr\/lib\/jvm\/ -name java-8-openjdk*)" /etc/default/tomcat8 fi @@ -13571,9 +13541,8 @@ _EOF_ elif (( $index == 8 )); then - G_AGP oracle-java8-* - rm /etc/apt/sources.list.d/webupd8team-java.list - G_AGUP + G_AGP openjdk-8-jdk + rm /etc/apt/preferences.d/99-dietpi-openjdk-8-jdk &> /dev/null elif (( $index == 104 )); then From 0774080c53f6e900b187b613ad45a96ef83aaece Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2018 18:10:59 +0100 Subject: [PATCH 332/390] v6.0 + Fix package pinning does not force dependency installation. + On upgrade this should work/include dependencies, though keeping an eye on it. --- dietpi/dietpi-software | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f805cb81f6..0cafbd7b32 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7335,11 +7335,13 @@ Pin: release a=jessie-backports Pin-Priority: 990 _EOF_ - G_AGUP + G_AGI openjdk-8-jdk -t jessie-backports - fi + else - G_AGI openjdk-8-jdk + G_AGI openjdk-8-jdk + + fi fi From 34c0182c8ac8a6eb33b7125f79a33627d08e0a45 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 18 Jan 2018 18:13:24 +0000 Subject: [PATCH 333/390] v6.0 + https://github.com/Fourdee/DietPi/issues/1401 --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a8de0a0a55..cf938b5fb1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -58,6 +58,7 @@ DietPi-Software | Aira2 (Stretch): Resolved installation, now used APT installat DietPi-Software | Mosquitto: Resolved various issues with failed install, due to Mosq repo not being maintained (deb's missing from repo header list, requires non-stretch available packages). deb's are now hosted on dietpi.com: https://github.com/Fourdee/DietPi/issues/1306 DietPi-Software | ownCloud/Nextcloud: Fixed an installation issue on Jessie with MariaDB: https://github.com/Fourdee/DietPi/pull/1319 DietPi-Software | Google AIY: Updated install to gitbranch=voicekit. Many thanks to @mpember for the heads up: https://github.com/Fourdee/DietPi/issues/1065#issuecomment-354304388 +DietPi-Software | OpenJDK: Replaces OracleJDK: https://github.com/Fourdee/DietPi/issues/1401 DietPi-Update | dietpi.txt is now checked for missing entries, and, will now be patched during the update: https://github.com/Fourdee/DietPi/issues/1292#issuecomment-350818969 Sparky SBC | Kernel updated, which resolves issues with HQPlayer playback: https://www.computeraudiophile.com/forums/topic/32132-allo-sparky-usbridge/?do=findComment&comment=753100 From 9f4079b1987fbb5aa173201fbe08dd0dd809d619 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2018 20:19:25 +0100 Subject: [PATCH 334/390] v6.0 + Update Blynk to Java8 version: https://github.com/Fourdee/DietPi/pull/1405#issuecomment-358740228 --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 0cafbd7b32..a65d0fdb30 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4754,7 +4754,7 @@ _EOF_ mkdir -p /etc/blynkserver - INSTALL_URL_ADDRESS='https://github.com/blynkkk/blynk-server/releases/download/v0.29.2/server-0.29.2.jar' + INSTALL_URL_ADDRESS='https://github.com/blynkkk/blynk-server/releases/download/v0.29.7/server-0.29.7-java8.jar' wget "$INSTALL_URL_ADDRESS" -O /etc/blynkserver/server.jar # - Install Blynk JS Libary From ef814b2316f9fe70e7911dd6effb6671b111869d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2018 20:57:44 +0100 Subject: [PATCH 335/390] v6.0 + DietPi-Software | Blynk: Fix typo, which leaded to empty config file --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a65d0fdb30..acf651582e 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11359,7 +11359,7 @@ _EOF_ mkdir -p "$G_FP_DIETPI_USERDATA"/blynk CONFIG_FILE_URL_ADDRESS='https://raw.githubusercontent.com/blynkkk/blynk-server/master/server/core/src/main/resources/server.properties' - wget "$CONFIG_URL_ADDRESS" -O "$G_FP_DIETPI_USERDATA"/blynk/server.properties + wget "$CONFIG_FILE_URL_ADDRESS" -O "$G_FP_DIETPI_USERDATA"/blynk/server.properties sed -i "/data.folder=/c\data.folder=$G_FP_DIETPI_USERDATA/blynk" "$G_FP_DIETPI_USERDATA"/blynk/server.properties cat << _EOF_ > /etc/systemd/system/blynkserver.service From 44252acad18d405219fee57cf37a0d799579e064 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2018 22:41:45 +0100 Subject: [PATCH 336/390] v6.0 + DietPi-Software | Mosquitto: Allow apt-get -f auto dependency installation for all architectures --- dietpi/dietpi-software | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 0cafbd7b32..828032c98d 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4716,28 +4716,19 @@ _EOF_ rm package.deb INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/mosquitto_1.4.14-0mosquitto1_nows1_armhf.deb' - G_CHECK_URL "$INSTALL_URL_ADDRESS" if (( $G_HW_ARCH == 10 )); then INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/mosquitto_1.4.14-0mosquitto1_nows1_amd64.deb' fi + G_CHECK_URL "$INSTALL_URL_ADDRESS" wget "$INSTALL_URL_ADDRESS" -O package.deb #Install deb - # ARMv8, allow error, so we can install additional required packages automatically - if (( $G_HW_ARCH == 3 )); then - - dpkg -i package.deb - G_AGF - - else - - G_RUN_CMD dpkg -i package.deb - - fi - + # Allow error, so we can install additional required packages automatically + dpkg -i package.deb + G_AGF rm package.deb fi @@ -12630,9 +12621,8 @@ _EOF_ elif (( $index == 123 )); then - #apt-mark auto libssl1.0.0 libwebsockets3 &> /dev/null + #apt-mark auto libssl1.0.0 G_AGP mosquitto - #rm /etc/apt/sources.list.d/mosquitto-*.list elif (( $index == 124 )); then From 1667af5d67d2421a2a5588a6fc32333552dd4f5a Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 19 Jan 2018 15:29:38 +0000 Subject: [PATCH 337/390] v6.0 + G_CHECK_URL: prompt user to configure network on failure: https://github.com/Fourdee/DietPi/issues/1385#issuecomment-358972239 --- dietpi/boot | 3 +- dietpi/dietpi-software | 89 ++++++-------------------------------- dietpi/func/dietpi-globals | 59 +++++++++++++++++++++---- 3 files changed, 67 insertions(+), 84 deletions(-) diff --git a/dietpi/boot b/dietpi/boot index 5f1de1df61..9ca86eac37 100644 --- a/dietpi/boot +++ b/dietpi/boot @@ -16,6 +16,7 @@ #Import DietPi-Globals --------------------------------------------------------------- /DietPi/dietpi/dietpi-obtain_hw_model # Running for the 1st time . /DietPi/dietpi/func/dietpi-globals + export G_USER_INPUTS=0 export G_PROGRAM_NAME='DietPi-Boot' #Import DietPi-Globals --------------------------------------------------------------- @@ -356,7 +357,7 @@ fi - /DietPi/dietpi/func/dietpi-set_software apt-mirror $(cat /DietPi/dietpi.txt | grep -m1 "^$TARGET_REPO=" | sed 's/.*=//') + /DietPi/dietpi/func/dietpi-set_software apt-mirror $(grep -m1 "^$TARGET_REPO=" /DietPi/dietpi.txt | sed 's/.*=//') #Disable /tmp tmpfs if RAM <= 512MB: https://github.com/Fourdee/DietPi/issues/1027 if (( $(free -m | grep -m1 'Mem:' | awk '{print $2}') <= 512 )); then diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index acf651582e..dee4e2be72 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -13998,51 +13998,12 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// # Internet Connection Test Vars #///////////////////////////////////////////////////////////////////////////////////// - INTERNET_CONNECTED=0 #Use /etc/apt/sources.list for connection test - INTERNET_URL_TEST=$(cat /etc/apt/sources.list | grep -m1 'deb ' | awk '{print $2}') + INTERNET_URL_TEST=$(grep -m1 'deb ' /etc/apt/sources.list | awk '{print $2}') Check_Internet_Connection(){ - #Max loops for G_USER_INPUTS=0 - local max_loops=20 - local current_loop=0 - - INTERNET_CONNECTED=0 - while (( ! $INTERNET_CONNECTED )); do - - sleep 1 - - G_CHECK_URL "$INTERNET_URL_TEST" - - if (( $? == 0 )); then - - INTERNET_CONNECTED=1 - - elif (( $G_USER_INPUTS )); then - - Menu_No_Internet - - else - - if (( $current_loop >= $max_loops )); then - - G_DIETPI-NOTIFY 1 "Connection test failed. $INTERNET_URL_TEST" - Exit_Destroy - - else - - G_DIETPI-NOTIFY 2 "Testing connection to $INTERNET_URL_TEST" - G_DIETPI-NOTIFY 2 "Attempt ($current_loop / $max_loops), please wait..." - - fi - - ((current_loop++)) - - fi - - - done + G_CHECK_URL "$INTERNET_URL_TEST" #will exit on failure here } @@ -14535,25 +14496,6 @@ _EOF_ } - Menu_No_Internet(){ - - #Ask to check settings, - whiptail --title "No Internet Connection!" --yesno "Internet access is required to start the DietPi Installation Program.\nWould you like to change your network settings and try again?\n\nIf problems persist:\n$INTERNET_URL_TEST may be offline and/or unreachable." --yes-button "Ok" --no-button "Exit" --defaultno --backtitle "$WHIP_BACKTITLE" 15 70 - CHOICE=$? - #run dietpi config - if (( $CHOICE == 0 )); then - whiptail --title "Launching DietPi-Config" --msgbox "DietPi-Config will now be started.\nUse the Network Options menu to change and test your network settings.\n\nWhen completed, Exit DietPi-Config to resume setup." --backtitle "Launching DietPi-Config" 14 60 - /DietPi/dietpi/dietpi-config 8 1 - #User aborted setup - else - Banner_Aborted - - #Exit Script NOW - Exit_Destroy - fi - - } - Menu_Main(){ #Data for storing SSH server index info @@ -15783,27 +15725,24 @@ _EOF_ Check_Internet_Connection - if (( $INTERNET_CONNECTED == 1 )); then - - #Start installations for software - Run_Installations + #Start installations for software + Run_Installations - #Upload DietPi-Survey Data - /DietPi/dietpi/dietpi-survey &> /dev/null + #Upload DietPi-Survey Data + /DietPi/dietpi/dietpi-survey &> /dev/null - #Reboot - Banner_Reboot + #Reboot + Banner_Reboot - if (( $DISABLE_REBOOT )); then + if (( $DISABLE_REBOOT )); then - # - Start services - /DietPi/dietpi/dietpi-services start + # - Start services + /DietPi/dietpi/dietpi-services start - else - - reboot + else - fi + sync + reboot fi diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 8d13fb41d1..c353e1a757 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -727,27 +727,70 @@ $print_logfile_info #----------------------------------------------------------------------------------- # URL Connection test #----------------------------------------------------------------------------------- - # $1 = URL + # $@ = URL # NB: automatically error handled (G_ERROR_HANDLER) + # Prompts user to configure network if $G_USER_INPUTS=1 (default) G_CHECK_URL(){ - local string="$1" + local string="$@" local timeout=10 local retry=2 + local error_connection_failed=0 G_ERROR_HANDLER_EXITCODE=0 G_ERROR_HANDLER_COMMAND="Connection test: $string" G_ERROR_HANDLER_ONERROR_FPLOGFILE='/tmp/G_CHECK_URL' - G_DIETPI-NOTIFY -2 "Testing connection to $string for max $(($timeout * $retry)) seconds" + while true + do - wget --spider --timeout=$timeout --tries=$retry "$string" &> /tmp/G_CHECK_URL - G_ERROR_HANDLER_EXITCODE=$? + #Allow user choice to configure network on failure + if (( $G_USER_INPUTS )); then - #--no-check-certificate - #https://github.com/Fourdee/DietPi/issues/352#issuecomment-221013166 + G_ERROR_HANDLER_ONERROR_EXIT=0 - G_ERROR_HANDLER + if (( $error_connection_failed )); then + + #Ask to check settings, + whiptail --title "URL Connection Test Failed" --yesno "DietPi was unable to establish a connection:\n - $string\n\nIf problems persist, the URL may be offline/unreachable.\n\nWould you like to configure network settings and try again?" --yes-button "Ok" --no-button "Exit" --defaultno --backtitle "$G_PROGRAM_NAME" 15 70 + CHOICE=$? + + #run dietpi config + if (( $CHOICE == 0 )); then + + whiptail --title "Launching DietPi-Config" --msgbox "DietPi-Config will now be started.\nUse the Network Options menu to change and test your network settings.\n\nWhen completed, Exit DietPi-Config to resume." --backtitle "Launching DietPi-Config" 14 60 + /DietPi/dietpi/dietpi-config 8 1 + + #User aborted, exit now with current error information + else + + G_ERROR_HANDLER_ONERROR_EXIT=1 + G_ERROR_HANDLER_EXITCODE=1 + G_USER_INPUTS=0 #disable whiptail info + G_ERROR_HANDLER + + fi + + fi + + fi + + G_DIETPI-NOTIFY -2 "Testing connection to $string for max $(($timeout * $retry)) seconds" + + wget --spider --timeout=$timeout --tries=$retry "$string" &> /tmp/G_CHECK_URL + G_ERROR_HANDLER_EXITCODE=$? + if (( $G_ERROR_HANDLER_EXITCODE != 0 )); then + + error_connection_failed=1 + + fi + + #--no-check-certificate + #https://github.com/Fourdee/DietPi/issues/352#issuecomment-221013166 + + G_ERROR_HANDLER + + done rm /tmp/G_CHECK_URL From ddf5a5b361c27512fc7d2c85cf0684d52f5c89ae Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 19 Jan 2018 15:40:45 +0000 Subject: [PATCH 338/390] v6.0 + Not required if G_ERROR_HANDLER_EXITCODE=1, break just incase. --- dietpi/func/dietpi-globals | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index c353e1a757..53c05c7ecd 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -768,6 +768,7 @@ $print_logfile_info G_ERROR_HANDLER_EXITCODE=1 G_USER_INPUTS=0 #disable whiptail info G_ERROR_HANDLER + break fi @@ -789,6 +790,7 @@ $print_logfile_info #https://github.com/Fourdee/DietPi/issues/352#issuecomment-221013166 G_ERROR_HANDLER + break done From d2394fc7a0784e80ee669751c3b13db1eee6ee6c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 19 Jan 2018 16:47:00 +0100 Subject: [PATCH 339/390] v6.0 + DietPi-Update | Adding recent file name and value changes to patch_file --- dietpi/patch_file | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index e13f2cbdeb..d41e5279b8 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -88,6 +88,13 @@ sed -i '/#Apply system locale/Q' /etc/bash.bashrc sed -i '/#DietPi Additions/Q' /etc/bash.bashrc #------------------------------------------------------------------------------- + #Fix locales according to: https://github.com/Fourdee/DietPi/pull/1402 + [ -f /etc/environment ] && rm /etc/environment + [ -f /etc/default/locales ] && rm /etc/default/locales + local locale_value="$(grep '^[[:blank:]]*AUTO_SETUP_LOCALE=' /DietPi/dietpi.txt | sed 's/^[[:blank:]]*AUTO_SETUP_LOCALE=//')" + (( ! -n $locale_value )) && locale_value="en_GB.UTF-8" + /DietPi/dietpi/func/dietpi-set_software locale "$locale_value" + #------------------------------------------------------------------------------- fi From b3124f1d014ade30f2ae30d755caf1b8438ed077 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 19 Jan 2018 15:48:28 +0000 Subject: [PATCH 340/390] v6.0 + Disable eth0 prior to 1st run (delays FS_resize etc). automatically enabled via boot script --- PREP_SYSTEM_FOR_DIETPI.sh | 2 -- dietpi/func/dietpi-globals | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 15b4658d62..a6bc31d65f 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -931,8 +931,6 @@ _EOF_ G_RUN_CMD cp /boot/dietpi/conf/network_interfaces /etc/network/interfaces - # - enable allow-hotplug eth0 after copying. - sed -i "/allow-hotplug eth/c\allow-hotplug eth0" /etc/network/interfaces # - Remove all predefined eth*/wlan* adapter rules rm /etc/udev/rules.d/70-persistent-net.rules &> /dev/null rm /etc/udev/rules.d/70-persistant-net.rules &> /dev/null diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 53c05c7ecd..18e32c686a 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -752,13 +752,13 @@ $print_logfile_info if (( $error_connection_failed )); then #Ask to check settings, - whiptail --title "URL Connection Test Failed" --yesno "DietPi was unable to establish a connection:\n - $string\n\nIf problems persist, the URL may be offline/unreachable.\n\nWould you like to configure network settings and try again?" --yes-button "Ok" --no-button "Exit" --defaultno --backtitle "$G_PROGRAM_NAME" 15 70 + whiptail --title "URL Connection Test Failed" --yesno "DietPi was unable to establish a connection:\n - $string\n\nIf problems persist, the URL may be offline/unreachable.\n\nWould you like to configure network settings and try again?" --yes-button "Ok" --no-button "Exit" --defaultno --backtitle "$G_PROGRAM_NAME" 15 80 CHOICE=$? #run dietpi config if (( $CHOICE == 0 )); then - whiptail --title "Launching DietPi-Config" --msgbox "DietPi-Config will now be started.\nUse the Network Options menu to change and test your network settings.\n\nWhen completed, Exit DietPi-Config to resume." --backtitle "Launching DietPi-Config" 14 60 + whiptail --title "Launching DietPi-Config" --msgbox "DietPi-Config will now be started.\nUse the Network Options menu to change and test your network settings.\n\nWhen completed, exit DietPi-Config to resume." --backtitle "Launching DietPi-Config" 14 60 /DietPi/dietpi/dietpi-config 8 1 #User aborted, exit now with current error information From 7be41ad10d1c5f44903e5c204fdcc7eac269225d Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 19 Jan 2018 16:00:49 +0000 Subject: [PATCH 341/390] v6.0 + Tweaks. --- dietpi/func/dietpi-globals | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 18e32c686a..3193e0b120 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -767,13 +767,17 @@ $print_logfile_info G_ERROR_HANDLER_ONERROR_EXIT=1 G_ERROR_HANDLER_EXITCODE=1 G_USER_INPUTS=0 #disable whiptail info - G_ERROR_HANDLER - break + G_ERROR_HANDLER #break handled by script kill fi fi + #Force exit on failure to end loop + else + + G_ERROR_HANDLER_EXITCODE=1 + fi G_DIETPI-NOTIFY -2 "Testing connection to $string for max $(($timeout * $retry)) seconds" @@ -789,8 +793,7 @@ $print_logfile_info #--no-check-certificate #https://github.com/Fourdee/DietPi/issues/352#issuecomment-221013166 - G_ERROR_HANDLER - break + G_ERROR_HANDLER #break handled by script kill done From 3060d1b58e82e29af0f48bfbdd143feb362f9ed9 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 19 Jan 2018 16:10:02 +0000 Subject: [PATCH 342/390] v6.0 + minor --- dietpi/func/dietpi-globals | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 3193e0b120..cb2c5d6669 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -767,16 +767,17 @@ $print_logfile_info G_ERROR_HANDLER_ONERROR_EXIT=1 G_ERROR_HANDLER_EXITCODE=1 G_USER_INPUTS=0 #disable whiptail info - G_ERROR_HANDLER #break handled by script kill + G_ERROR_HANDLER + #break #handled by G_ERROR_HANDLER script kill fi fi - #Force exit on failure to end loop + #Force exit on failure to end loop (overrides any export G_ERROR_HANDLER_ONERROR_EXIT in this session) else - G_ERROR_HANDLER_EXITCODE=1 + G_ERROR_HANDLER_ONERROR_EXIT=1 fi @@ -793,7 +794,8 @@ $print_logfile_info #--no-check-certificate #https://github.com/Fourdee/DietPi/issues/352#issuecomment-221013166 - G_ERROR_HANDLER #break handled by script kill + G_ERROR_HANDLER + #break #handled by G_ERROR_HANDLER script kill done From 511668f3b0c583824fd5fd51dc0145756e543d57 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 19 Jan 2018 16:25:27 +0000 Subject: [PATCH 343/390] v6.0 + tweaks due to testing --- dietpi/func/dietpi-globals | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index cb2c5d6669..f94d7350cb 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -795,7 +795,11 @@ $print_logfile_info #https://github.com/Fourdee/DietPi/issues/352#issuecomment-221013166 G_ERROR_HANDLER - #break #handled by G_ERROR_HANDLER script kill + if (( $G_ERROR_HANDLER_EXITCODE == 0 )); then + + break + + fi done From 2c7f344633bae5747e563eb9811812df75ab7022 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 19 Jan 2018 20:04:43 +0000 Subject: [PATCH 344/390] v6.0 + G_USER_INPUTS auto set, based on interactive detection: https://github.com/Fourdee/DietPi/issues/1385 NB: Needs further testing, will do this ASAP --- dietpi.txt | 3 ++- dietpi/boot | 1 - dietpi/dietpi-backup | 2 -- dietpi/dietpi-software | 10 ---------- dietpi/dietpi-survey | 1 - dietpi/dietpi-sync | 1 - dietpi/func/dietpi-globals | 22 ++++++++++++++++++---- dietpi/func/dietpi-set_software | 1 - dietpi/func/run_ntpd | 1 - dietpi/login | 13 +++++++++++++ dietpi/patch_file | 5 ----- 11 files changed, 33 insertions(+), 27 deletions(-) diff --git a/dietpi.txt b/dietpi.txt index 4fb78bc96b..a052e1dc13 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -47,13 +47,14 @@ AUTO_SETUP_SWAPFILE_SIZE=1 # Fully automate installation # 1=Automated installation with no user inputs. +# It is HIGHLY recommended to also set CONFIG_BOOT_WAIT_FOR_NETWORK=2, to force infinite wait for network connection during boot, preventing no connection errors due to timeout. AUTO_SETUP_AUTOMATED=0 # Global Password to be applied for the system # Affects user "root" and "dietpi" login passwords, and, all software installed by dietpi-software, that requires a password # eg: MySQL, Transmission, Deluge etc. # WARN: Passwords with the any of the following characters are not supported: \"$ -# WARN: Do NOT change this entry, after 1st run setup of DietPi has been completed. It is always scraped by dietpi-software. +# WARN: Do NOT change this entry after 1st run setup of DietPi has been completed. It is always scraped by dietpi-software. AUTO_SETUP_GLOBAL_PASSWORD=dietpi # DietPi-Software to automatically install. | requires AUTO_SETUP_AUTOMATED=1 diff --git a/dietpi/boot b/dietpi/boot index 9ca86eac37..e4b39d0a51 100644 --- a/dietpi/boot +++ b/dietpi/boot @@ -16,7 +16,6 @@ #Import DietPi-Globals --------------------------------------------------------------- /DietPi/dietpi/dietpi-obtain_hw_model # Running for the 1st time . /DietPi/dietpi/func/dietpi-globals - export G_USER_INPUTS=0 export G_PROGRAM_NAME='DietPi-Boot' #Import DietPi-Globals --------------------------------------------------------------- diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index cab1be45b0..ec251f22af 100644 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -823,13 +823,11 @@ _EOF_ #Run Backup if (( $INPUT == 1 )); then - export G_USER_INPUTS=0 Run_Backup #Run Restore elif (( $INPUT == -1 )); then - export G_USER_INPUTS=0 Run_Restore #----------------------------------------------------------------------------- diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index dee4e2be72..b08c66d012 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -15629,9 +15629,6 @@ _EOF_ # - CLi input mode if [ -n "$1" ]; then - # - Disable user inputs and prompts. - export G_USER_INPUTS=0 - # - Run input mode Input_Modes "$@" @@ -15645,13 +15642,6 @@ _EOF_ FirstRun_Automation_Init - if (( $AUTOINSTALL_ENABLED >= 1 )); then - - # - Disable user inputs and prompts. - export G_USER_INPUTS=0 - - fi - fi #GPL compliance prompt diff --git a/dietpi/dietpi-survey b/dietpi/dietpi-survey index d9d01e675d..2ca1b714c5 100644 --- a/dietpi/dietpi-survey +++ b/dietpi/dietpi-survey @@ -25,7 +25,6 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals export G_PROGRAM_NAME='DietPi-Survey' - export G_USER_INPUTS=0 G_CHECK_ROOT_USER #Import DietPi-Globals --------------------------------------------------------------- diff --git a/dietpi/dietpi-sync b/dietpi/dietpi-sync index 0cfbcced02..977bcf3125 100644 --- a/dietpi/dietpi-sync +++ b/dietpi/dietpi-sync @@ -787,7 +787,6 @@ #Run Sync if (( $INPUT == 1 )); then - export G_USER_INPUTS=0 Run_Sync #----------------------------------------------------------------------------- diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index f94d7350cb..aad59ad5b5 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -32,10 +32,24 @@ # G_ERROR_ (info) G_PROGRAM_NAME='' - #User input? - # Affects: + #User input? (eg: interactive shell available) + # Effects: # - G_ERROR_HANDLER whiptail display - G_USER_INPUTS=1 + # NB: You can export G_USER_INPUTS=1 to force interactive (eg: .bashrc), but not the other way round. Must run 'unset G_USER_INPUTS' after + G_USER_INPUTS=${G_USER_INPUTS:=0} #only init once for each session + if [[ $- == *i* ]]; then + + #checked: + # - OK | systemD = non-STDIN + # - OK | Cron = non-STDIN + + #shopt login_shell # == [[ $- == *i* ]] #.bashrc dietpi/login exec is not interactive... + #[ -t 0 ]# .bashrc dietpi/login exec is interactive... + #set -i in .bashrc is not available... + + G_USER_INPUTS=1 + + fi # - DietPi Scripts, moved from /etc/bash.bashrc alias sudo='sudo ' # https://github.com/Fourdee/DietPi/issues/424 @@ -729,7 +743,7 @@ $print_logfile_info #----------------------------------------------------------------------------------- # $@ = URL # NB: automatically error handled (G_ERROR_HANDLER) - # Prompts user to configure network if $G_USER_INPUTS=1 (default) + # Prompts user to configure network if $G_USER_INPUTS=1 G_CHECK_URL(){ local string="$@" diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 29034e61d1..aba476bdc0 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -38,7 +38,6 @@ $FP_SCRIPT verify_dietpi.txt verifies dietpi.txt entries, adds missing entrie G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW export G_PROGRAM_NAME='DietPi-Set_software' - export G_USER_INPUTS=0 #Import DietPi-Globals --------------------------------------------------------------- EXIT_CODE=0 diff --git a/dietpi/func/run_ntpd b/dietpi/func/run_ntpd index 9342394ba0..b5882c0e60 100644 --- a/dietpi/func/run_ntpd +++ b/dietpi/func/run_ntpd @@ -22,7 +22,6 @@ . /DietPi/dietpi/func/dietpi-globals G_CHECK_ROOT_USER export G_PROGRAM_NAME='DietPi-Run_ntpd' - export G_USER_INPUTS=0 #Import DietPi-Globals --------------------------------------------------------------- INPUT_MODE=$1 diff --git a/dietpi/login b/dietpi/login index 5b804cb6c7..bfaf6c2f01 100644 --- a/dietpi/login +++ b/dietpi/login @@ -185,6 +185,9 @@ if (( $AUTO_START_INDEX > 0 )); then + #??? testing required + #Set interactive (as .bashrc run is non-interactive) + #export G_USER_INPUTS=1 Run_AutoStart fi @@ -219,8 +222,18 @@ G_DIETPI_INSTALL_STAGE=$(cat /DietPi/dietpi/.install_stage) if (( $G_DIETPI_INSTALL_STAGE == 0 )); then + #Set interactive shell (as .bashrc run is non-interactive), if not automated installation + if (( $(grep -ci -m1 '^AUTO_SETUP_AUTOMATED=0' /DietPi/dietpi.txt) )); then + + export G_USER_INPUTS=1 + + fi + /DietPi/dietpi/dietpi-software | tee "$FP_DIETPI_FIRSTRUNSETUP_LOG" + # reset to auto detection + unset G_USER_INPUTS + fi #---------------------------------------------------------------- diff --git a/dietpi/patch_file b/dietpi/patch_file index e13f2cbdeb..3913826952 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -37,11 +37,6 @@ fi AUTOINSTALL_ENABLED=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_SETUP_AUTOMATED=' | sed 's/.*=//') - if (( $AUTOINSTALL_ENABLED == 1 && $(cat /DietPi/dietpi/.install_stage) <= 0 )); then #Automated - - export G_USER_INPUTS=0 - - fi # FP_EMR='/DietPi/dietpi/.patch_emr' # EMR_INDEX=0 From 14409f2cd8ce9d9894d3fb21ec5f09c26a4041ae Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 19 Jan 2018 20:42:46 +0000 Subject: [PATCH 345/390] v6.0 + G_USER_INPUTS changed to STDIN method: https://github.com/Fourdee/DietPi/issues/1385 + avoid G_CHECK_URL (and error handle), when user running dietpi-config connection test. --- dietpi/dietpi-config | 2 +- dietpi/func/dietpi-globals | 33 ++++++++++++++++++++++----------- dietpi/login | 10 +++++----- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 0d09a19b61..3dd6139f56 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -2834,7 +2834,7 @@ INTERNET_ONLINE=0 #Not tested #Check for connection - G_CHECK_URL "$INTERNET_URL" + wget --spider --timeout=10 --tries=2 "$INTERNET_URL" if (( $? == 0 )); then INTERNET_ONLINE=2 #Online else diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index aad59ad5b5..04c13e74d2 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -32,25 +32,36 @@ # G_ERROR_ (info) G_PROGRAM_NAME='' - #User input? (eg: interactive shell available) + #User input? (eg: interactive shell available via STDIN check) # Effects: # - G_ERROR_HANDLER whiptail display - # NB: You can export G_USER_INPUTS=1 to force interactive (eg: .bashrc), but not the other way round. Must run 'unset G_USER_INPUTS' after - G_USER_INPUTS=${G_USER_INPUTS:=0} #only init once for each session - if [[ $- == *i* ]]; then + # NB: You can export G_USER_INPUTS=0 to force non-interactive (eg: .bashrc) Must run 'unset G_USER_INPUTS' after to return to auto detection. + if [ -z $G_USER_INPUTS ]; then - #checked: - # - OK | systemD = non-STDIN - # - OK | Cron = non-STDIN + G_USER_INPUTS=0 - #shopt login_shell # == [[ $- == *i* ]] #.bashrc dietpi/login exec is not interactive... - #[ -t 0 ]# .bashrc dietpi/login exec is interactive... - #set -i in .bashrc is not available... + if [[ -t 0 ]]; then - G_USER_INPUTS=1 + #checked: + # - OK | systemD = non-STDIN + # - OK | Cron = non-STDIN + + #shopt login_shell # == [[ $- == *i* ]] #.bashrc dietpi/login exec is not interactive... + #[ -t 0 ]# .bashrc dietpi/login exec is interactive... + #set -i in .bashrc is not available... + + G_USER_INPUTS=1 + + fi fi + #DEBUG: + # echo $G_USER_INPUTS + # shopt login_shell + # sleep 1 + #DEBUG: + # - DietPi Scripts, moved from /etc/bash.bashrc alias sudo='sudo ' # https://github.com/Fourdee/DietPi/issues/424 alias dietpi-process_tool='/DietPi/dietpi/dietpi-process_tool' diff --git a/dietpi/login b/dietpi/login index bfaf6c2f01..8225a3fafb 100644 --- a/dietpi/login +++ b/dietpi/login @@ -186,8 +186,8 @@ if (( $AUTO_START_INDEX > 0 )); then #??? testing required - #Set interactive (as .bashrc run is non-interactive) - #export G_USER_INPUTS=1 + #Set non-interactive (as .bashrc via STDIN check is interactive) + #export G_USER_INPUTS=0 Run_AutoStart fi @@ -222,10 +222,10 @@ G_DIETPI_INSTALL_STAGE=$(cat /DietPi/dietpi/.install_stage) if (( $G_DIETPI_INSTALL_STAGE == 0 )); then - #Set interactive shell (as .bashrc run is non-interactive), if not automated installation - if (( $(grep -ci -m1 '^AUTO_SETUP_AUTOMATED=0' /DietPi/dietpi.txt) )); then + #Set non-interactive shell, if automated installation (as .bashrc run via STDIN check is interactive) + if (( $(grep -ci -m1 '^AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt) )); then - export G_USER_INPUTS=1 + export G_USER_INPUTS=0 fi From f6799dc099ea9dda4d9cc26a1f06507473b46701 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 20 Jan 2018 13:31:45 +0000 Subject: [PATCH 346/390] v6.0 + DietPi-Config | Resolved an issue with WiFi Country code, failing to set on some devices: https://github.com/Fourdee/DietPi/issues/838 --- CHANGELOG.txt | 1 + dietpi/boot | 3 +++ dietpi/dietpi-config | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index cf938b5fb1..054baec2bd 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -46,6 +46,7 @@ Bug Fixes: General | Fixed two systemd error messages during shutdown and boot: https://github.com/Fourdee/DietPi/issues/1330 DietPi-Automation | Resolved an issue where AUTO_SETUP_TIMEZONE was not being applied correctly, thanks @k-plan: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-356310496 DietPi-Automation | dietpi.txt: CONFIG_NTP_MIRROR will now be applied to systemd-timesyncd configuration: https://github.com/Fourdee/DietPi/issues/1379 +DietPi-Config | Resolved an issue with WiFi Country code, failing to set on some devices: https://github.com/Fourdee/DietPi/issues/838 DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi drop during software installs/updates etc: https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480 DietPi-Software | qBittorrent: Resolved an issue with inability to log into web interface: https://github.com/Fourdee/DietPi/issues/1366 DietPi-Software | Resolved an issue where our custom LD_LIBRARY_PATH would cause APT failures. LD_LIBRARY_PATH has now been reverted, apologies if this effected your system: https://github.com/Fourdee/DietPi/issues/1329 diff --git a/dietpi/boot b/dietpi/boot index e4b39d0a51..eb9a90abd4 100644 --- a/dietpi/boot +++ b/dietpi/boot @@ -230,6 +230,9 @@ Run_Init(){ + #---------------------------------------------------------------- + #WiFi Country | Additional fallback for (older kernel?) devices that fail with wpa_supplicant.conf https://github.com/Fourdee/DietPi/issues/838 + iw reg set $(grep -m1 '^CONFIG_WIFI_COUNTRY_CODE=' /DietPi/dietpi.txt | sed 's/.*=//') &> /dev/null & #---------------------------------------------------------------- #Update NTP /DietPi/dietpi/func/run_ntpd & diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 3dd6139f56..e3fbad8efd 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -2745,11 +2745,14 @@ #Apply /DietPi/dietpi/func/dietpi-set_hardware wificountrycode "$wifi_country_code_target" - #iw reg set $wifi_country_code_target # - Restart networking Network_Restart + # - Additional fallback for (older kernel?) devices that fail with wpa_supplicant.conf https://github.com/Fourdee/DietPi/issues/838 + # NB: Requires adapter up... hence, not in dietpi-set_hardware + iw reg set $wifi_country_code_target + # - Check if country code was successfully applied WIFI_COUNTRYCODE=$(iw reg get | grep -m1 'country' | awk '{print $2}' | tr -d ':') if [ "$WIFI_COUNTRYCODE" != "$wifi_country_code_target" ]; then From 06292935136d81bd985a6ac6fefc2c1d90b53dcf Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 20 Jan 2018 15:20:29 +0100 Subject: [PATCH 347/390] v6.0 + Fix doubled and renamed config files: https://github.com/Fourdee/DietPi/commit/68148cec6b49afc787deca638456e1c4689e1cab#diff-8370b86e635383d521462994afe04a2d --- dietpi/patch_file | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index d41e5279b8..034d109194 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -95,6 +95,11 @@ (( ! -n $locale_value )) && locale_value="en_GB.UTF-8" /DietPi/dietpi/func/dietpi-set_software locale "$locale_value" #------------------------------------------------------------------------------- + #Fix doubled and renamed config files: + #https://github.com/Fourdee/DietPi/commit/68148cec6b49afc787deca638456e1c4689e1cab#diff-8370b86e635383d521462994afe04a2d + [ -f /etc/apt/apt.conf.d/99force-ipv ] && rm /etc/apt/apt.conf.d/99force-ipv + [ -f /etc/sysctl.d/97-dietpi.conf ] && mv /etc/sysctl.d/97-dietpi.conf /etc/sysctl.d/99-dietpi.conf + #------------------------------------------------------------------------------- fi From 5d2c9aafbf852ac6436ab90f8e00ddca50e209b8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 20 Jan 2018 16:08:08 +0100 Subject: [PATCH 348/390] v6.0 + Fix no arithmetic --- dietpi/patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 034d109194..4a3b4c614b 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -92,7 +92,7 @@ [ -f /etc/environment ] && rm /etc/environment [ -f /etc/default/locales ] && rm /etc/default/locales local locale_value="$(grep '^[[:blank:]]*AUTO_SETUP_LOCALE=' /DietPi/dietpi.txt | sed 's/^[[:blank:]]*AUTO_SETUP_LOCALE=//')" - (( ! -n $locale_value )) && locale_value="en_GB.UTF-8" + [ -n $locale_value ] || locale_value="en_GB.UTF-8" /DietPi/dietpi/func/dietpi-set_software locale "$locale_value" #------------------------------------------------------------------------------- #Fix doubled and renamed config files: From 2d737be38c0e1115eaea0078e8c8cc2a9d37fc29 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 20 Jan 2018 16:26:09 +0100 Subject: [PATCH 349/390] v6.0 + Tiny spelling --- dietpi.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dietpi.txt b/dietpi.txt index 4fb78bc96b..37e22bf197 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -58,11 +58,11 @@ AUTO_SETUP_GLOBAL_PASSWORD=dietpi # DietPi-Software to automatically install. | requires AUTO_SETUP_AUTOMATED=1 # For a list of software index's (ID's), run '/DietPi/dietpi/dietpi-software list' -# No limit on number entires, add as many as you need and uncomment the line. +# No limit on number entries, add as many as you need and uncomment the line. # DietPi will automatically install all pre-reqs (eg: ALSA/XSERVER for desktops etc) # - Examples: -#AUTO_SETUP_INSTALL_SOFTWARE_ID=23 #will install Desktop LXDE -#AUTO_SETUP_INSTALL_SOFTWARE_ID=74 #will install LAMP webserver stack +#AUTO_SETUP_INSTALL_SOFTWARE_ID=23 #will install Desktop LXDE +#AUTO_SETUP_INSTALL_SOFTWARE_ID=74 #will install LAMP webserver stack #AUTO_SETUP_INSTALL_SOFTWARE_ID=44 #will install Bittorrent transmission # DietPi-Software Choice System @@ -86,7 +86,7 @@ AUTO_SETUP_FILE_SERVER_INDEX=0 AUTO_SETUP_LOGGING_INDEX=-1 # Webserver Preference Selection: -# NB: This will get ignored, if you have manually selected any WEBSERVER_Stacks. +# NB: This will get ignored, if you have manually selected any WEBSERVER_Stack. # 0=Apache2 # -1=Nginx # -2=Lighttpd @@ -131,7 +131,7 @@ CONFIG_CPU_MIN_FREQ=Disabled #Min value 10000 microseconds (10ms) CONFIG_CPU_ONDEMAND_SAMPLE_RATE=25000 -#sampling rate * down factor / 1000 = Miliseconds (40 = 1000ms when sampling rate is 25000) +#sampling rate * down factor / 1000 = Milliseconds (40 = 1000ms when sampling rate is 25000) CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=80 #Samba Client Details (Used by DietPi-Config | Networking NAS | Samba Client) From 6fab093e48c2316925abfff57625cbf01f2fd74b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 20 Jan 2018 17:23:28 +0100 Subject: [PATCH 350/390] v6.0 + Change "preferipversion" behaviour according to: https://github.com/Fourdee/DietPi/issues/472#issuecomment-356444922 --- dietpi/func/dietpi-set_hardware | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index cf424bdfb6..b0e4aace30 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1108,15 +1108,33 @@ _EOF_ if [ "$INPUT_DEVICE_VALUE" = "ipv4" ]; then + # - APT force IPv4 echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99-dietpi-force-ipv4 + # - Wget prefer IPv4 + grep -q '^[[:blank:]]*prefer-family =' /etc/wgetrc && + sed -i '/^[[:blank:]]*prefer-family =/c\prefer-family = IPv4' /etc/wgetrc || + grep -q '^[[:blank:]#;]*prefer-family =' /etc/wgetrc && + sed -i '/^[[:blank:]#;]*prefer-family =/c\prefer-family = IPv4' /etc/wgetrc || + echo 'prefer-family = IPv4' >> /etc/wgetrc elif [ "$INPUT_DEVICE_VALUE" = "ipv6" ]; then - echo 'Acquire::ForceIPv6 "true";' > /etc/apt/apt.conf.d/99-dietpi-force-ipv4 + # - APT allow IPv6 + rm /etc/apt/apt.conf.d/99-dietpi-force-ipv4 &> /dev/null + # - Wget prefer IPv6 + grep -q '^[[:blank:]]*prefer-family =' /etc/wgetrc && + sed -i '/^[[:blank:]]*prefer-family =/c\prefer-family = IPv6' /etc/wgetrc || + grep -q '^[[:blank:]#;]*prefer-family =' /etc/wgetrc && + sed -i '/^[[:blank:]#;]*prefer-family =/c\prefer-family = IPv6' /etc/wgetrc || + echo 'prefer-family = IPv6' >> /etc/wgetrc elif [ "$INPUT_DEVICE_VALUE" = "auto" ]; then + # - APT allow IPv6 rm /etc/apt/apt.conf.d/99-dietpi-force-ipv4 &> /dev/null + # - Wget back to default + grep -q '^[[:blank:]]*prefer-family =' /etc/wgetrc && + sed -i 's/^[[:blank:]]*prefer-family =/#prefer-family =/' /etc/wgetrc else From 86b5f6563fa392def10b4946af7e24503a925cf7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 20 Jan 2018 17:27:50 +0100 Subject: [PATCH 351/390] v6.0 + Reflect changed behaviour: https://github.com/Fourdee/DietPi/issues/472#issuecomment-356444922 --- dietpi.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi.txt b/dietpi.txt index a052e1dc13..b8b00c2458 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -182,7 +182,7 @@ CONFIG_SOUNDCARD=none # NB: Do not modify, you must use dietpi-config to configure/set options CONFIG_LCDPANEL=none -#Prefer IPversion (for: APT) | auto (let system decide) / ipv4 (force) / ipv6 (force) | eg: force IPv4 with CONFIG_PREFER_IPVERSION=ipv4 +#Prefer IPversion (for: APT, wget) | auto (let system decide) / ipv4 (force) / ipv6 (prefer) | eg: force IPv4 with CONFIG_PREFER_IPVERSION=ipv4 CONFIG_PREFER_IPVERSION=ipv4 #Apt mirrors which are applied to /etc/apt/sources.list | Values here will also be applied during 1st run setup From 18de10ef242097eed9c516821b3247a85192e68e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 20 Jan 2018 18:45:14 +0100 Subject: [PATCH 352/390] v6.0 + DietPi-Update | Avoid locale recreation on fixed images --- dietpi/patch_file | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 4a3b4c614b..0f10b9d17a 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -89,11 +89,16 @@ sed -i '/#DietPi Additions/Q' /etc/bash.bashrc #------------------------------------------------------------------------------- #Fix locales according to: https://github.com/Fourdee/DietPi/pull/1402 - [ -f /etc/environment ] && rm /etc/environment - [ -f /etc/default/locales ] && rm /etc/default/locales - local locale_value="$(grep '^[[:blank:]]*AUTO_SETUP_LOCALE=' /DietPi/dietpi.txt | sed 's/^[[:blank:]]*AUTO_SETUP_LOCALE=//')" - [ -n $locale_value ] || locale_value="en_GB.UTF-8" - /DietPi/dietpi/func/dietpi-set_software locale "$locale_value" + if [ -f /etc/environment ]; then + + rm /etc/environment + [ -f /etc/default/locales ] && rm /etc/default/locales + locale_value="$(grep '^[[:blank:]]*AUTO_SETUP_LOCALE=' /DietPi/dietpi.txt | sed 's/^.*=//')" + [ -n $locale_value ] || locale_value='en_GB.UTF-8' + /DietPi/dietpi/func/dietpi-set_software locale "$locale_value" + unset locale_value + + fi #------------------------------------------------------------------------------- #Fix doubled and renamed config files: #https://github.com/Fourdee/DietPi/commit/68148cec6b49afc787deca638456e1c4689e1cab#diff-8370b86e635383d521462994afe04a2d From 0e03014e55d664dc9b2c04c03034acff84f978b8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 20 Jan 2018 22:51:31 +0100 Subject: [PATCH 353/390] v6.0 + DietPi-Software | ownCloud/Nextcloud: Enable auto backup & recovery from and to data directory + DietPi-Software | ownCloud/Nextcloud: Remove initial adjustment of max upload size, which caused integrity check errors and was overwritten by updater and other occ commands + DietPi-Software | ownCloud/Nextcloud: Uninstallation will be now done before webservers and databases, to ensure database backups can be done + DietPi-Software | ownCloud: Switch to archive based installation, which is now the recommended method by ownCloud --- dietpi/dietpi-software | 300 +++++++++++++++++++++-------------------- 1 file changed, 156 insertions(+), 144 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 4a5bc61abf..e7b6813be9 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3854,34 +3854,34 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS="https://download.owncloud.org/download/repositories/stable/Debian_$(( $G_DISTRO + 5 )).0/Release.key" - # No repository available yet after Stretch, thus we choose archive here: - (( $G_DISTRO > 4 )) && INSTALL_URL_ADDRESS='https://download.owncloud.org/community/owncloud-latest.zip' + G_DIETPI-NOTIFY 2 'Installing needed PHP modules: https://doc.owncloud.org/server/latest/admin_manual/installation/source_installation.html#php-extensions' + G_AGI "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis - G_CHECK_URL "$INSTALL_URL_ADDRESS" + if [ -f /var/www/owncloud/occ ]; then - # Install necessary PHP modules: https://doc.owncloud.org/server/latest/admin_manual/installation/source_installation.html#php-extensions - G_AGI "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis + G_DIETPI-NOTIFY 2 'Existing ownCloud installation found, will NOT overwrite...' - if [ ! -f /etc/apt/sources.list.d/owncloud.list ] && [ ! -f /var/www/owncloud/occ ]; then + else - wget "$INSTALL_URL_ADDRESS" -O owncloud.key_or_zip - if (( $G_DISTRO < 5 )); then + local datadir="$(grep -m1 '^[[:blank:]]*SOFTWARE_OWNCLOUD_DATADIR=' /DietPi/dietpi.txt | sed 's/^.*=//')" + [ -n "$datadir" ] || datadir="$G_FP_DIETPI_USERDATA/owncloud_data" + if [ -f "$datadir"/dietpi-owncloud-installation-backup/occ ]; then - echo -e "deb https://download.owncloud.org/download/repositories/stable/Debian_$(( $G_DISTRO + 5 )).0/ /" > /etc/apt/sources.list.d/owncloud.list - apt-key add - < owncloud.key_or_zip && G_AGUP + G_DIETPI-NOTIFY 2 'ownCloud installation backup found, starting recovery...' + G_RUN_CMD cp -a "$datadir"/dietpi-owncloud-installation-backup/. /var/www/owncloud else - unzip -o owncloud.key_or_zip -d /var/www + INSTALL_URL_ADDRESS='https://download.owncloud.org/community/owncloud-latest.zip' + G_CHECK_URL "$INSTALL_URL_ADDRESS" + G_RUN_CMD wget "$INSTALL_URL_ADDRESS" -O package.zip + G_RUN_CMD unzip -o package.zip -d /var/www + rm package.zip fi - rm owncloud.key_or_zip fi - [ -f /etc/apt/sources.list.d/owncloud.list ] && G_AGI owncloud-files - fi #Nextcloud @@ -3890,18 +3890,31 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS='https://download.nextcloud.com/server/releases/latest.zip' + G_DIETPI-NOTIFY 2 'Installing needed PHP modules: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation' + G_AGI "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis + + if [ -f /var/www/nextcloud/occ ]; then - G_CHECK_URL "$INSTALL_URL_ADDRESS" + G_DIETPI-NOTIFY 2 'Existing Nextcloud installation found, will NOT overwrite...' - # Install necessary PHP modules: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - G_AGI "$PHP_APT_PACKAGE_NAME"-intl "$PHP_APT_PACKAGE_NAME"-redis + else - if [ ! -f /var/www/nextcloud/occ ]; then + local datadir="$(grep -m1 '^[[:blank:]]*SOFTWARE_NEXTCLOUD_DATADIR=' /DietPi/dietpi.txt | sed 's/^.*=//')" + [ -n "$datadir" ] || datadir="$G_FP_DIETPI_USERDATA/nextcloudcloud_data" + if [ -f "$datadir"/dietpi-nextcloud-installation-backup/occ ]; then - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip -d /var/www - rm package.zip + G_DIETPI-NOTIFY 2 'Nextcloud installation backup found, starting recovery...' + G_RUN_CMD cp -a "$datadir"/dietpi-nextcloud-installation-backup/. /var/www/nextcloud + + else + + INSTALL_URL_ADDRESS='https://download.nextcloud.com/server/releases/latest.zip' + G_CHECK_URL "$INSTALL_URL_ADDRESS" + G_RUN_CMD wget "$INSTALL_URL_ADDRESS" -O package.zip + G_RUN_CMD unzip -o package.zip -d /var/www + rm package.zip + + fi fi @@ -8238,7 +8251,7 @@ _EOF_ Banner_Configuration - # Enable necessary PHP modules: https://doc.owncloud.org/server/latest/admin_manual/installation/source_installation.html#php-extensions + G_DIETPI-NOTIFY 2 'Enabling needed PHP modules: https://doc.owncloud.org/server/latest/admin_manual/installation/source_installation.html#php-extensions' "$PHP_APT_PACKAGE_NAME"enmod curl gd intl json pdo_mysql opcache apcu redis # Following modules are switchable since Stretch: if (( $G_DISTRO > 3 )); then @@ -8250,33 +8263,32 @@ _EOF_ # APCu configuration: To prevent cli (cron.php) producing ownCloud log 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 - # Create ownCloud specific webserver config. - # Apache: https://doc.owncloud.org/server/latest/admin_manual/installation/source_installation.html#configure-apache-web-server if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then + G_DIETPI-NOTIFY 2 'Apache webserver found, enable ownCloud specific configuration: "https://doc.owncloud.org/server/latest/admin_manual/installation/source_installation.html#configure-apache-web-server"' a2enmod rewrite headers env dir mime 1> /dev/null local owncloud_conf='/etc/apache2/sites-available/owncloud.conf' - # Do not overwrite existing config. if [ -f $owncloud_conf ]; then + G_DIETPI-NOTIFY 2 'Existing ownCloud configuration found, will save the new one for review and comparison to: /etc/apache2/sites-available/owncloud.conf.dietpi-new' owncloud_conf='/etc/apache2/sites-available/owncloud.conf.dietpi-new' fi cp /DietPi/dietpi/conf/apache.ownnextcloud.conf $owncloud_conf sed -i 's/nextcloud/owncloud/g' $owncloud_conf - # OPcache adjustment is just asked by Nextcloud + # OPcache adjustment is just needed by Nextcloud sed -i 's/php_admin_value/#php_admin_value/' $owncloud_conf a2ensite owncloud 1> /dev/null fi - # NGINX: https://doc.owncloud.org/server/latest/admin_manual/installation/nginx_configuration.html#owncloud-in-a-subdir-of-nginx if (( ${aSOFTWARE_INSTALL_STATE[85]} >= 1 )); then + G_DIETPI-NOTIFY 2 'Nginx webserver found, enable ownCloud specific configuration: "https://doc.owncloud.org/server/latest/admin_manual/installation/nginx_configuration.html#owncloud-in-a-subdir-of-nginx"' local owncloud_config='/etc/nginx/sites-dietpi/owncloud.config' - # Do not overwrite existing config. if [ -f $owncloud_config ]; then + G_DIETPI-NOTIFY 2 'Existing ownCloud configuration found, will save the new one for review and comparison to: /etc/nginx/sites-dietpi/owncloud.config.dietpi-new' owncloud_config='/etc/nginx/sites-dietpi/owncloud.config.dietpi-new' fi @@ -8300,49 +8312,57 @@ _EOF_ fi - # Enable MySQL 4-byte support: https://doc.owncloud.org/server/latest/admin_manual/configuration/database/linux_database_configuration.html#configure-mysql-for-4-byte-unicode-support + # Enable 4-byte support for MariaDB: https://doc.owncloud.org/server/latest/admin_manual/configuration/database/linux_database_configuration.html#configure-mysql-for-4-byte-unicode-support cat << _EOF_ > /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf [mysqld] innodb_large_prefix=1 innodb_file_format=barracuda innodb_file_per_table=1 _EOF_ - # Check if we really do fresh installation: - local oc_is_fresh=1 - if [ -d "$G_FP_DIETPI_USERDATA"/mysql/owncloud ]; then + G_RUN_CMD systemctl restart mysql - oc_is_fresh=0 - - fi - - # Re-source dietpi-globals to load occ command shortcut: + # Reload dietpi-globals to enable occ command shortcut: . /DietPi/dietpi/func/dietpi-globals # Adjusting config file: local config_php='/var/www/owncloud/config/config.php' - # Terminal installation: - local datadir=$(cat /DietPi/dietpi.txt | grep -m1 '^SOFTWARE_OWNCLOUD_DATADIR=' | sed 's/.*=//') - [ ! -n "$datadir" ] && datadir="$G_FP_DIETPI_USERDATA/owncloud_data" + local datadir="$(grep -m1 '^[[:blank:]]*SOFTWARE_OWNCLOUD_DATADIR=' /DietPi/dietpi.txt | sed 's/^.*=//')" + [ -n "$datadir" ] || datadir="$G_FP_DIETPI_USERDATA/owncloud_data" mkdir -p "$datadir" Install_Apply_Permissions &> /dev/null - local username=$(cat /DietPi/dietpi.txt | grep -m1 '^SOFTWARE_OWNCLOUD_NEXTCLOUD_USERNAME=' | sed 's/.*=//') - [ ! -n "$username" ] && username='admin' + if [ -d "$G_FP_DIETPI_USERDATA"/mysql/owncloud ]; then - systemctl start mysql - # For MariaDB, temporary database admin user needs to be created, as 'root' uses unix_socket login, which cannot be accessed by sudo -u www-data. - mysql -uroot -e "grant all privileges on *.* to 'tmp_root'@'localhost' identified by '$GLOBAL_PW' with grant option" - grep -q "'installed' => true," $config_php 2>/dev/null || occ maintenance:install --no-interaction --database "mysql" --database-name "owncloud" --database-user "tmp_root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$datadir" - mysql -uroot -e "drop user 'tmp_root'@'localhost'" + G_DIETPI-NOTIFY 2 'ownCloud database found, will NOT overwrite.' - # Enable MySQL 4-byte support for new installations only, to prevent risky database conversion tasks: - if (( $oc_is_fresh == 1 )); then + else - grep -q "^[[:blank:]]*'mysql.utf8mb4'" $config_php || sed -i "/^[[:blank:]]*'dbpassword'/a \ \ 'mysql.utf8mb4' => true," $config_php + if [ -f "$datadir"/dietpi-owncloud-database-backup.sql ]; then + + G_DIETPI-NOTIFY 2 'ownCloud database backup found, starting recovery...' + local dbuser=$(grep -m1 "^[[:blank:]]*'dbuser'" $config_php | awk '{print $3}' | sed "s/[',]//g") + local dbpass=$(grep -m1 "^[[:blank:]]*'dbpassword'" $config_php | awk '{print $3}' | sed "s/[',]//g") + /DietPi/dietpi/func/create_mysql_db owncloud "$dbuser" "$dbpass" + mysql -uroot owncloud < "$datadir"/dietpi-owncloud-database-backup.sql + + else + + local username="$(cat /DietPi/dietpi.txt | grep -m1 '^[[:blank:]]*SOFTWARE_OWNCLOUD_NEXTCLOUD_USERNAME=' | sed 's/^.*=//')" + [ -n "$username" ] || username='admin' + + # For MariaDB, temporary database admin user needs to be created, as 'root' uses unix_socket login, which cannot be accessed by sudo -u www-data. + mysql -uroot -e "grant all privileges on *.* to 'tmp_root'@'localhost' identified by '$GLOBAL_PW' with grant option" + grep -q "'installed' => true," $config_php 2>/dev/null || occ maintenance:install --no-interaction --database "mysql" --database-name "owncloud" --database-user "tmp_root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$datadir" + mysql -uroot -e "drop user 'tmp_root'@'localhost'" + + fi fi + # Enable ownCloud to use 4-byte database + grep -q "^[[:blank:]]*'mysql.utf8mb4'" $config_php || sed -i "/^[[:blank:]]*'dbpassword'/a \ \ 'mysql.utf8mb4' => true," $config_php + # Add local IP and hostname to trusted domains. # If "1 => '" does not exist, the config.php is not copied e.g. from older instance, so we add entries. if (( ! $(cat $config_php | grep -ci -m1 "1 => '") )); then @@ -8386,16 +8406,6 @@ _EOF_ fi - # ownCloud/Nextcloud ignores system wide php.ini settings. Use their own config. - # Set max upload size - local php_max_upload_size="$(( $(php -r 'print(PHP_INT_MAX);') / 1024 / 1024))M" - sed -i "/upload_max_filesize=/c\upload_max_filesize=$php_max_upload_size" /var/www/owncloud/.user.ini - sed -i "/post_max_size=/c\post_max_size=$php_max_upload_size" /var/www/owncloud/.user.ini - - # Set memory limit: total / 4 - local memory_limit_max="$(( $RAM_TOTAL / 4 ))M" - sed -i "/memory_limit=/c\memory_limit=$memory_limit_max" /var/www/owncloud/.user.ini - # Enable ownCloud background cron job: crontab -u www-data -l 2>/dev/null | grep -q '/var/www/owncloud/cron.php' || ( crontab -u www-data -l 2>/dev/null ; echo "*/15 * * * * php /var/www/owncloud/cron.php" ) | crontab -u www-data - occ background:cron @@ -8411,7 +8421,7 @@ _EOF_ Banner_Configuration - # Enable necessary PHP modules: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation + G_DIETPI-NOTIFY 2 'Enabling needed PHP modules: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation' "$PHP_APT_PACKAGE_NAME"enmod curl gd intl json pdo_mysql opcache apcu redis # Following modules are switchable since Stretch: if (( $G_DISTRO > 3 )); then @@ -8431,15 +8441,14 @@ _EOF_ 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 + G_DIETPI-NOTIFY 2 'Apache webserver found, enable Nextcloud specific configuration: "https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#apache-web-server-configuration"' a2enmod rewrite headers env dir mime 1> /dev/null local nextcloud_conf='/etc/apache2/sites-available/nextcloud.conf' - # Do not overwrite existing config. if [ -f $nextcloud_conf ]; then - + + G_DIETPI-NOTIFY 2 'Existing Nextcloud configuration found, will save the new one for review and comparison to: /etc/apache2/sites-available/nextcloud.conf.dietpi-new' nextcloud_conf='/etc/apache2/sites-available/nextcloud.conf.dietpi-new' fi @@ -8448,13 +8457,13 @@ _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 + G_DIETPI-NOTIFY 2 'Nginx webserver found, enable Nextcloud specific configuration: "https://docs.nextcloud.com/server/12/admin_manual/installation/nginx.html#nextcloud-in-a-subdir-of-nginx"' local nextcloud_config='/etc/nginx/sites-dietpi/nextcloud.config' - # Do not overwrite existing config. if [ -f $nextcloud_config ]; then + G_DIETPI-NOTIFY 2 'Existing Nextcloud configuration found, will save the new one for review and comparison to: /etc/nginx/sites-dietpi/nextcloud.config.dietpi-new' nextcloud_config='/etc/nginx/sites-dietpi/nextcloud.config.dietpi-new' fi @@ -8478,9 +8487,9 @@ _EOF_ fi - # Lighttpd: So far just to solve OPcache warning on admin panel if (( ${aSOFTWARE_INSTALL_STATE[84]} >= 1 )); then + G_DIETPI-NOTIFY 2 'Lighttpd webserver found, enable Nextcloud specific configuration.' local lighttpd_conf='/etc/lighttpd/lighttpd.conf' # Enable mod_setenv @@ -8494,53 +8503,59 @@ _EOF_ lighttpd-enable-mod dietpi-nextcloud service lighttpd force-reload - unset lighttpd_conf - fi - # Enable MySQL 4-byte support: https://docs.nextcloud.com/server/12/admin_manual/configuration_database/mysql_4byte_support.html + # Enable 4-byte support for MariaDB: https://docs.nextcloud.com/server/12/admin_manual/configuration_database/mysql_4byte_support.html cat << _EOF_ > /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf [mysqld] innodb_large_prefix=1 innodb_file_format=barracuda innodb_file_per_table=1 _EOF_ - # Check if we really do fresh installation: - local nc_is_fresh=1 - if [ -d "$G_FP_DIETPI_USERDATA"/mysql/nextcloud ]; then - - nc_is_fresh=0 + G_RUN_CMD systemctl restart mysql - fi - - # Re-source dietpi-globals to load ncc command shortcut: + # Reload dietpi-globals to enable ncc command shortcut: . /DietPi/dietpi/func/dietpi-globals # Adjusting config file: local config_php='/var/www/nextcloud/config/config.php' - # Terminal installation: - local datadir=$(grep -m1 '^SOFTWARE_NEXTCLOUD_DATADIR=' /DietPi/dietpi.txt | sed 's/.*=//') - [ ! -n "$datadir" ] && datadir="$G_FP_DIETPI_USERDATA/nextcloud_data" + local datadir="$(grep -m1 '^[[:blank:]]*SOFTWARE_NEXTCLOUD_DATADIR=' /DietPi/dietpi.txt | sed 's/^.*=//')" + [ -n "$datadir" ] || datadir="$G_FP_DIETPI_USERDATA/nextcloud_data" mkdir -p "$datadir" Install_Apply_Permissions &> /dev/null - local username=$(grep -m1 '^SOFTWARE_OWNCLOUD_NEXTCLOUD_USERNAME=' /DietPi/dietpi.txt | sed 's/.*=//') - [ ! -n "$username" ] && username='admin' + if [ -d "$G_FP_DIETPI_USERDATA"/mysql/nextcloud ]; then + + G_DIETPI-NOTIFY 2 'Nextcloud database found, will NOT overwrite.' - systemctl start mysql - # For MariaDB, temporary database admin user needs to be created, as 'root' uses unix_socket login, which cannot be accessed by sudo -u www-data. - mysql -uroot -e "grant all privileges on *.* to 'tmp_root'@'localhost' identified by '$GLOBAL_PW' with grant option" - grep -q "'installed' => true," $config_php 2>/dev/null || ncc maintenance:install --no-interaction --database "mysql" --database-name "nextcloud" --database-user "tmp_root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$datadir" - mysql -uroot -e "drop user 'tmp_root'@'localhost'" + else + + if [ -f "$datadir"/dietpi-nextcloud-database-backup.sql ]; then - # Enable MySQL 4-byte support for new installations only, to prevent risky database conversion tasks: - if (( $nc_is_fresh == 1 )); then + G_DIETPI-NOTIFY 2 'Nextcloud database backup found, starting recovery...' + local dbuser=$(grep -m1 "^[[:blank:]]*'dbuser'" $config_php | awk '{print $3}' | sed "s/[',]//g") + local dbpass=$(grep -m1 "^[[:blank:]]*'dbpassword'" $config_php | awk '{print $3}' | sed "s/[',]//g") + /DietPi/dietpi/func/create_mysql_db nextcloud "$dbuser" "$dbpass" + mysql -uroot nextcloud < "$datadir"/dietpi-nextcloud-database-backup.sql - grep -q "^[[:blank:]]*'mysql.utf8mb4'" $config_php || sed -i "/^[[:blank:]]*'dbpassword'/a \ \ 'mysql.utf8mb4' => true," $config_php + else + + local username="$(grep -m1 '^[[:blank:]]*SOFTWARE_OWNCLOUD_NEXTCLOUD_USERNAME=' /DietPi/dietpi.txt | sed 's/^.*=//')" + [ -n "$username" ] || username='admin' + + # For MariaDB, temporary database admin user needs to be created, as 'root' uses unix_socket login, which cannot be accessed by sudo -u www-data. + mysql -uroot -e "grant all privileges on *.* to 'tmp_root'@'localhost' identified by '$GLOBAL_PW' with grant option" + grep -q "'installed' => true," $config_php 2>/dev/null || ncc maintenance:install --no-interaction --database "mysql" --database-name "nextcloud" --database-user "tmp_root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$datadir" + mysql -uroot -e "drop user 'tmp_root'@'localhost'" + + fi fi + # Enable Nextcloud to use 4-byte database + grep -q "^[[:blank:]]*'mysql.utf8mb4'" $config_php || sed -i "/^[[:blank:]]*'dbpassword'/a \ \ 'mysql.utf8mb4' => true," $config_php + # Disable trusted_domains. if (( ! $(cat $config_php | grep -ci -m1 "1 => '*'") )); then @@ -8582,16 +8597,6 @@ _EOF_ fi - # ownCloud/Nextcloud ignores system wide php.ini settings. Use their own config. - # Set max upload size - local php_max_upload_size="$(( $(php -r 'print(PHP_INT_MAX);') / 1024 / 1024))M" - sed -i "/upload_max_filesize=/c\upload_max_filesize=$php_max_upload_size" /var/www/nextcloud/.user.ini - sed -i "/post_max_size=/c\post_max_size=$php_max_upload_size" /var/www/nextcloud/.user.ini - - # Set memory limit: total / 4 - local memory_limit_max="$(( $RAM_TOTAL / 4 ))M" - sed -i "/memory_limit=/c\memory_limit=$memory_limit_max" /var/www/nextcloud/.user.ini - # Enable Nextcloud background cron job: crontab -u www-data -l 2>/dev/null | grep -q '/var/www/nextcloud/cron.php' || ( crontab -u www-data -l 2>/dev/null ; echo "*/15 * * * * php /var/www/nextcloud/cron.php" ) | crontab -u www-data - ncc background:cron @@ -12495,6 +12500,53 @@ _EOF_ rm /etc/init.d/transmission-daemon &> /dev/null rm /etc/systemd/system/transmission-daemon.service &> /dev/null + elif (( $index == 47 )); then + #ownCloud + # Remove background cron job + crontab -u www-data -l | grep -v '/var/www/owncloud/cron.php' | crontab -u www-data - + # Disable and remove webserver configs + a2dissite owncloud 2>/dev/null + rm /etc/apache2/sites-available/owncloud.conf 2>/dev/null + rm /etc/nginx/sites-dietpi/owncloud.config 2>/dev/null + # Find datadir for backups + G_DIETPI-NOTIFY 2 "DietPi will perform an automated backup of your ownCloud database and installation directory, which will be stored inside your ownCloud data directory.\nThe data directory won't be removed. So you can at any time recover your whole ownCloud instance.\nRemove the data directory manually, if you don't need it anymore." + local datadir=$(grep -m1 "'datadirectory'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/[',]//g") + [ -n "$datadir" ] || datadir="$G_FP_DIETPI_USERDATA/owncloud_data" + # Drop MariaDB user and database + G_RUN_CMD systemctl start mysql + mysql -uroot -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")@$(grep -m1 "'dbhost'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" + mysql -uroot -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" + mysqldump -uroot --lock-tables owncloud > "$datadir"/dietpi-owncloud-database-backup.sql + mysqladmin -uroot drop owncloud -f + # Backup ownCloud installation folder + cp -a /var/www/owncloud/. "$datadir"/dietpi-owncloud-installation-backup + # Remove ownCloud installation folder + rm -R /var/www/owncloud + + elif (( $index == 114 )); then + #Nextcloud + crontab -u www-data -l | grep -v '/var/www/nextcloud/cron.php' | crontab -u www-data - + # Disable and remove webserver configs + 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 + lighttpd-disable-mod dietpi-nextcloud 2>/dev/null + rm /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf 2>/dev/null + # Find datadir for backups + G_DIETPI-NOTIFY 2 "DietPi will perform an automated backup of your Nextcloud database and installation directory, which will be stored inside your Nextcloud data directory.\nThe data directory won't be removed. So you can at any time recover your whole Nextcloud instance.\nRemove the data directory manually, if you don't need it anymore." + local datadir=$(grep -m1 "'datadirectory'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/[',]//g") + [ -n "$datadir" ] || datadir="$G_FP_DIETPI_USERDATA/nextcloud_data" + # Drop MariaDB user and database + G_RUN_CMD systemctl start mysql + mysql -uroot -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/,//")" + mysql -uroot -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" + mysqldump -uroot --lock-tables nextcloud > "$datadir"/dietpi-nextcloud-database-backup.sql + mysqladmin -uroot drop nextcloud -f + # Backup Nextcloud installation folder + cp -a /var/www/nextcloud/. "$datadir"/dietpi-nextcloud-installation-backup + # Remove Nextcloud installation folder + rm -R /var/www/nextcloud + elif (( $index == 83 )); then G_AGP apache2 @@ -12548,46 +12600,6 @@ _EOF_ mysqladmin -u root -p"$GLOBAL_PW" drop phpbb3 -f rm -R /var/www/phpBB3 - elif (( $index == 47 )); then - #ownCloud - # Remove background cron job - crontab -u www-data -l | grep -v '/var/www/owncloud/cron.php' | crontab -u www-data - - # Disable and remove webservier configs - a2dissite owncloud 2>/dev/null - rm /etc/apache2/sites-available/owncloud.conf 2>/dev/null - rm /etc/nginx/sites-dietpi/owncloud.config 2>/dev/null - # Drop MariaDB user and database - systemctl start mysql - mysql -uroot -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")@$(grep -m1 "'dbhost'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" - mysql -uroot -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" - mysqldump -uroot --lock-tables owncloud > "$G_FP_DIETPI_USERDATA"/owncloud_data/mysql_backup.sql - mysqladmin -uroot drop owncloud -f - # Purge APT package - G_AGP owncloud-files owncloud owncloud-deps - # Remove ownCloud installation folder - rm -R /var/www/owncloud - # Remove ownCloud repo - rm /etc/apt/sources.list.d/owncloud.list 2> /dev/null - - elif (( $index == 114 )); then - #Nextcloud - # Remove background cron job - crontab -u www-data -l | grep -v '/var/www/nextcloud/cron.php' | crontab -u www-data - - # Disable and remove webservier configs - 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 - lighttpd-disable-mod dietpi-nextcloud 2>/dev/null - rm /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf 2>/dev/null - # Drop MariaDB user and database - systemctl start mysql - mysql -uroot -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/,//")" - mysql -uroot -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" - mysqldump -uroot --lock-tables nextcloud > "$G_FP_DIETPI_USERDATA"/nextcloud_data/mysql_backup.sql - mysqladmin -uroot drop nextcloud -f - # Remove Nextcloud installation folder - rm -R /var/www/nextcloud - elif (( $index == 115 )); then G_RUN_CMD dpkg -P webmin From a6b7773fd58eaaf87feaaf1baea19f898d64397e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 21 Jan 2018 00:23:37 +0100 Subject: [PATCH 354/390] v6.0 + DietPi-Prep | Fix VM specific package removals --- PREP_SYSTEM_FOR_DIETPI.sh | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index a6bc31d65f..7d37d4193b 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -479,8 +479,7 @@ _EOF_ G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' #------------------------------------------------------------------------------------------------ - # - DietPi list of minimal required packages which must be installed: - # dpkg --get-selections | awk '{print $1}' | sed 's/:a....//g' | sed "s/^/'/g" | sed "s/$/'/g" + # - DietPi list of minimal required packages, which must be installed: aPACKAGES_REQUIRED_INSTALL=( 'apt-transport-https' # Allows https sources in ATP @@ -499,9 +498,7 @@ _EOF_ 'ethtool' # Ethernet link checking 'fake-hwclock' # Hardware clock emulation, to allow correct timestamps during boot before network time sync 'fbset' # DietPi-Config display settings - 'firmware-realtek' # Eth/WiFi/BT dongle firmware 'gnupg' # apt-key add - 'hdparm' # Drive power management adjustment 'hfsplus' # DietPi-Drive_Manager NTS (MacOS) file system support 'htop' # System monitor 'initramfs-tools' # RAM file system initialization @@ -551,12 +548,12 @@ _EOF_ fi - # - G_HW_MODEL specific package removals: - # VM - if (( $G_HW_MODEL == 20 )); then + # - G_HW_MODEL specific required packages: + # VM: No network firmware necessary and hard drive power management stays at host system. + if (( $G_HW_MODEL != 20 )); then - # No network firmware necessary and hard drive power management stays at host system. - apt-mark auto firmware-realtek hdparm + G_AGI firmware-realtek # Eth/WiFi/BT dongle firmware + aPACKAGES_REQUIRED_INSTALL+=('hdparm') # Drive power management adjustment fi @@ -567,7 +564,9 @@ _EOF_ # x86_64 if (( $G_HW_ARCH == 10 )); then - G_AGI linux-image-amd64 firmware-linux-nonfree + G_AGI linux-image-amd64 + # Usually no firmware should be necessary for VMs. If user manually passes though some USB device, he might need to install the firmware then. + (( $G_HW_MODEL != 20 )) && G_AGI firmware-linux-nonfree grep 'vendor_id' /proc/cpuinfo | grep -qi 'intel' && G_AGI intel-microcode grep 'vendor_id' /proc/cpuinfo | grep -qi 'amd' && G_AGI amd64-microcode #aPACKAGES_REQUIRED_INSTALL+=('firmware-misc-nonfree') @@ -605,7 +604,7 @@ _EOF_ #G_AGI linux-image-4.9-armhf-odroid-xu3 G_AGI $(dpkg --get-selections | grep '^linux-image' | awk '{print $1}') - (( ! $(dpkg --get-selections | grep -ci -m1 '^linux-image') )) && G_AGI linux-image-armhf-odroid-xu3 + (( $(dpkg --get-selections | grep -ci -m1 '^linux-image') )) || G_AGI linux-image-armhf-odroid-xu3 # Odroid C1 elif (( $G_HW_MODEL == 10 )); then From afe4542a2f8518aeee098cdba94ccf2ac80b22d2 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 21 Jan 2018 02:13:02 +0100 Subject: [PATCH 355/390] v6.0 + DietPi-Prep | Remove "debian-keyring" from dependencies --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 7d37d4193b..94a87cbc7a 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -540,7 +540,7 @@ _EOF_ # Repo keys: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-358301273 if (( $G_HW_MODEL >= 10 )); then - G_AGI debian-keyring debian-archive-keyring + G_AGI debian-archive-keyring else From 73d2e985b854ac2d72e76c0989ebbeba1ac08869 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 21 Jan 2018 14:48:49 +0000 Subject: [PATCH 356/390] v6.0 Minor, moved "Step 4: APT configuration:" --- PREP_SYSTEM_FOR_DIETPI.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index a6bc31d65f..8ca5feb8e5 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -388,6 +388,14 @@ _EOF_ fi + + #------------------------------------------------------------------------------------------------ + echo -e '' + G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' + G_DIETPI-NOTIFY 0 'Step 4: APT configuration:' + G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' + #------------------------------------------------------------------------------------------------ + G_DIETPI-NOTIFY 2 'Removing conflicting apt sources.list.d' # NB: Apt sources will get overwritten during 1st run, via boot script and dietpi.txt entry @@ -471,14 +479,6 @@ _EOF_ export G_ERROR_HANDLER_EXITCODE=$? G_ERROR_HANDLER - - #------------------------------------------------------------------------------------------------ - echo -e '' - G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' - G_DIETPI-NOTIFY 0 'Step 4: APT configuration:' - G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------' - #------------------------------------------------------------------------------------------------ - # - DietPi list of minimal required packages which must be installed: # dpkg --get-selections | awk '{print $1}' | sed 's/:a....//g' | sed "s/^/'/g" | sed "s/$/'/g" aPACKAGES_REQUIRED_INSTALL=( From 1692e330b8396d1cefd93de5d89aca9536f148d7 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 21 Jan 2018 16:04:18 +0000 Subject: [PATCH 357/390] v6.0 + Native PC (EFI): is now an ISO, with clonezilla bundled. Simplifies installation via Rufus write: https://github.com/Fourdee/DietPi/issues/1171#issuecomment-336522021 --- CHANGELOG.txt | 1 + PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 054baec2bd..8d2980bc07 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ All DietPi images have been re-created. Existing installations (v159 or lower), - https://github.com/Fourdee/DietPi/issues/1385 - All images are now Debian Stretch (excluding Odroid's) - ARMbian based images are now mainline kernel 4.13. + - Native PC (EFI): is now an ISO, with clonezilla bundled. Simplifies installation via Rufus write: https://github.com/Fourdee/DietPi/issues/1171#issuecomment-336522021 - If you are happy with your existing installation of v159 (or lower), you are not required to install the v6.0 image, however, we cannot provide support for the v159 (or lower) installation. Minor notes: diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 88e8333dc5..0738811169 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1234,7 +1234,7 @@ _EOF_ G_DIETPI-NOTIFY 2 'Remove server_version / patch_file (downloads fresh from dietpi-update)' rm /DietPi/dietpi/patch_file &> /dev/null - rm /DietPi/dietpi/server_version &> /dev/null + rm /DietPi/dietpi/server_version* &> /dev/null G_DIETPI-NOTIFY 2 'Clearing APT cache' From 6ea69350b944c2be5105a289a963986f2478416e Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 23 Jan 2018 17:30:30 +0000 Subject: [PATCH 358/390] v6.0 + fix: https://github.com/Fourdee/DietPi/issues/1416#issue-290869898 --- CHANGELOG.txt | 2 +- dietpi/dietpi-software | 46 +++++++++++++++++++++--------------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8d2980bc07..e41d5923fc 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -7,7 +7,7 @@ All DietPi images have been re-created. Existing installations (v159 or lower), - All images are now Debian Stretch (excluding Odroid's) - ARMbian based images are now mainline kernel 4.13. - Native PC (EFI): is now an ISO, with clonezilla bundled. Simplifies installation via Rufus write: https://github.com/Fourdee/DietPi/issues/1171#issuecomment-336522021 - - If you are happy with your existing installation of v159 (or lower), you are not required to install the v6.0 image, however, we cannot provide support for the v159 (or lower) installation. + - If you are happy with your existing installation of v159 (or lower), you are not required to install the v6.0 image, however, we cannot continue to provide support for v159 (or lower) installations. Minor notes: The XMAS tree has now been taken down, stored away on github for next year. Hope you all had a good one :D diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 4a5bc61abf..4a065f633a 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -14023,6 +14023,15 @@ _EOF_ else + # - Uninstall | Stop services prior + if [ "$1" = "uninstall" ]; then + + # - stop services + /DietPi/dietpi/dietpi-services stop + + fi + + # - Process inputs for i in "${ainput[@]}" do @@ -14031,29 +14040,7 @@ _EOF_ if [ "$1" = "uninstall" ]; then - # - stop services - /DietPi/dietpi/dietpi-services stop - - for i in "${ainput[@]}" - do - - #Valid int means input is unique ID for software index - if [[ $i =~ ^-?[0-9]+$ ]]; then - - Uninstall_Software "$i" - - fi - - done - - #Finish up and clear non-required packages - Uninstall_Software_Finalize - - #Save - Write_InstallFileList - - # - Start services - /DietPi/dietpi/dietpi-services start + Uninstall_Software "$i" elif [ "$1" = "reinstall" ]; then @@ -14100,6 +14087,19 @@ _EOF_ done + # - Uninstall | Finish up and clear non-required packages + if [ "$1" = "uninstall" ]; then + + Uninstall_Software_Finalize + + #Save + Write_InstallFileList + + # - Start services + /DietPi/dietpi/dietpi-services start + + fi + fi #Apply permissions From d97d7176e4d803ba1f93f35200286b0569f1d2a3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 23 Jan 2018 20:07:10 +0100 Subject: [PATCH 359/390] v6.0 + DietPi-Software | ownCloud/Nextcloud: Prevent mysqldump from overwriting existing backup file with "not existing" error message --- dietpi/dietpi-software | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index e7b6813be9..d09ff6376b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -12513,10 +12513,10 @@ _EOF_ local datadir=$(grep -m1 "'datadirectory'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/[',]//g") [ -n "$datadir" ] || datadir="$G_FP_DIETPI_USERDATA/owncloud_data" # Drop MariaDB user and database - G_RUN_CMD systemctl start mysql + systemctl start mysql mysql -uroot -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")@$(grep -m1 "'dbhost'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" - mysql -uroot -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" - mysqldump -uroot --lock-tables owncloud > "$datadir"/dietpi-owncloud-database-backup.sql + mysql -uroot -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" 2> /dev/null + [ -d "$G_FP_DIETPI_USERDATA"/mysql/owncloud ] && mysqldump -uroot --lock-tables owncloud > "$datadir"/dietpi-owncloud-database-backup.sql mysqladmin -uroot drop owncloud -f # Backup ownCloud installation folder cp -a /var/www/owncloud/. "$datadir"/dietpi-owncloud-installation-backup @@ -12537,10 +12537,10 @@ _EOF_ local datadir=$(grep -m1 "'datadirectory'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/[',]//g") [ -n "$datadir" ] || datadir="$G_FP_DIETPI_USERDATA/nextcloud_data" # Drop MariaDB user and database - G_RUN_CMD systemctl start mysql + systemctl start mysql mysql -uroot -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/,//")" - mysql -uroot -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" - mysqldump -uroot --lock-tables nextcloud > "$datadir"/dietpi-nextcloud-database-backup.sql + mysql -uroot -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" 2> /dev/null + [ -d "$G_FP_DIETPI_USERDATA"/mysql/nextcloud ] && mysqldump -uroot --lock-tables nextcloud > "$datadir"/dietpi-nextcloud-database-backup.sql mysqladmin -uroot drop nextcloud -f # Backup Nextcloud installation folder cp -a /var/www/nextcloud/. "$datadir"/dietpi-nextcloud-installation-backup From 41c8724234b8a88be1085e9c9b9c0c7858da6b59 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 24 Jan 2018 01:04:44 +0100 Subject: [PATCH 360/390] v6.0 + DietPi-Config | Correctly disable IPv6 on x64 devices: https://github.com/Fourdee/DietPi/issues/1343#issuecomment-359652751 --- dietpi/dietpi-config | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index e3fbad8efd..32c4e8162e 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -3045,7 +3045,7 @@ #IPv6 status local ipv6_enabled=1 local ipv6_status_text='Enabled' - if [ -f /etc/modprobe.d/99-dietpi-blacklist-ipv6.conf ]; then + if [ ! -d /proc/sys/net/ipv6 ]; then ipv6_enabled=0 ipv6_status_text='Disabled' fi @@ -3126,8 +3126,17 @@ if (( $CHOICE == 0 )); then - # - Blacklist kernel module - echo 'blacklist ipv6' > /etc/modprobe.d/99-dietpi-blacklist-ipv6.conf + if (( G_HW_ARCH == 10 )); then + # On amd64 images, IPv6 is no kernel module, but can be disabled via grub: https://github.com/Fourdee/DietPi/issues/1343#issuecomment-359652751 + + sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT=\"/GRUB_CMDLINE_LINUX_DEFAULT=\"ipv6.disable=1 /' /etc/default/grub + + else + # On all other images, IPv6 is a kernel module, which can be blacklisted. + + echo 'blacklist ipv6' > /etc/modprobe.d/99-dietpi-blacklist-ipv6.conf + + fi # - APT force IPv4 echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99-dietpi-force-ipv4 # - Wget prefer IPv4 @@ -3148,7 +3157,15 @@ if (( $CHOICE == 0 )); then - rm /etc/modprobe.d/99-dietpi-blacklist-ipv6.conf &> /dev/null + if (( G_HW_ARCH == 10 )); then + + sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT=\"ipv6.disable=1 /GRUB_CMDLINE_LINUX_DEFAULT=\"/' /etc/default/grub + + else + + rm /etc/modprobe.d/99-dietpi-blacklist-ipv6.conf &> /dev/null + + fi # - APT allow IPv6 but do not force it: https://github.com/Fourdee/DietPi/issues/472#issuecomment-356444922 rm /etc/apt/apt.conf.d/99-dietpi-force-ipv4 &> /dev/null # - Wget prefer IPv6 From 329bf766fbad783b6f26248ba8b422ad462963fe Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 24 Jan 2018 14:13:22 +0000 Subject: [PATCH 361/390] v6.0 - Prevent dupes - update-grub on changes --- dietpi/dietpi-config | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 32c4e8162e..821e02121d 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -3129,7 +3129,8 @@ if (( G_HW_ARCH == 10 )); then # On amd64 images, IPv6 is no kernel module, but can be disabled via grub: https://github.com/Fourdee/DietPi/issues/1343#issuecomment-359652751 - sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT=\"/GRUB_CMDLINE_LINUX_DEFAULT=\"ipv6.disable=1 /' /etc/default/grub + sed -i 's/ipv6.disable=1 //g' /etc/default/grub + update-grub else # On all other images, IPv6 is a kernel module, which can be blacklisted. @@ -3159,7 +3160,12 @@ if (( G_HW_ARCH == 10 )); then - sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT=\"ipv6.disable=1 /GRUB_CMDLINE_LINUX_DEFAULT=\"/' /etc/default/grub + if (( ! $(grep -ci -m1 'ipv6.disable=1' /etc/default/grub) )); then + + sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT=\"/GRUB_CMDLINE_LINUX_DEFAULT=\"ipv6.disable=1 /g' /etc/default/grub + update-grub + + fi else From 9ea78771b9f1cf59cabcedfe2a34880777a2e02a Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 24 Jan 2018 14:18:34 +0000 Subject: [PATCH 362/390] v6.0 + Disable console blanking + ipv6 by default: https://github.com/Fourdee/DietPi/pull/1419#issuecomment-360145758 --- dietpi/func/dietpi-set_core_environment | 1 + 1 file changed, 1 insertion(+) diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index ad26f1e4ab..1f9d98fa17 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -341,6 +341,7 @@ _EOF_ # HW_ARCH not set at this stage within DietPi, using PREP_SYSTEM if [ -f /etc/default/grub ]; then + sed -i '/^GRUB_CMDLINE_LINUX_DEFAULT=/c\GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 consoleblank=0 quiet"' /etc/default/grub sed -i '/^GRUB_CMDLINE_LINUX=/c\GRUB_CMDLINE_LINUX="net.ifnames=0"' /etc/default/grub sed -i '/^GRUB_TIMEOUT=/c\GRUB_TIMEOUT=0' /etc/default/grub update-grub From f1af9294f07aab297a6a9de71d5af5332ebf0e01 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 24 Jan 2018 14:24:53 +0000 Subject: [PATCH 363/390] v6.0 + Update core_env: https://github.com/Fourdee/DietPi/pull/1419 --- dietpi/patch_file | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index 5ad04f4221..773ff754f9 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -100,6 +100,12 @@ [ -f /etc/apt/apt.conf.d/99force-ipv ] && rm /etc/apt/apt.conf.d/99force-ipv [ -f /etc/sysctl.d/97-dietpi.conf ] && mv /etc/sysctl.d/97-dietpi.conf /etc/sysctl.d/99-dietpi.conf #------------------------------------------------------------------------------- + #Core_ENV update: https://github.com/Fourdee/DietPi/pull/1419 + # IPv6 disable x86_64 + # consoleblank disable x86_64 + /DietPi/dietpi/func/dietpi-set_core_environment + #------------------------------------------------------------------------------- + fi From f874d87e277c8788c0f6ea76ede8b71dd91220e6 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 24 Jan 2018 14:26:45 +0000 Subject: [PATCH 364/390] v6.0 + Correction to match RC image versions --- dietpi/patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 773ff754f9..0fc39e3c85 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -75,7 +75,7 @@ #///////////////////////////////////////////////////////////////////////////////////// #Incremental patch system: - if (( $SUBVERSION_CURRENT == 0 )); then + if (( $SUBVERSION_CURRENT == -1 )); then #------------------------------------------------------------------------------- #bash.bashrc removal of any outstanding dietpi entries (moved to globals). Just incase I missed any manually during PREP... From f2474f2ab9a1aa2b47f3c3466c0658f18f35853f Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 24 Jan 2018 15:05:53 +0000 Subject: [PATCH 365/390] v6.0 + Conflict resolve: https://github.com/Fourdee/DietPi/pull/1418 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 97 ++++++++++++++++++++++-------------------- 2 files changed, 52 insertions(+), 46 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e41d5923fc..e7f9f9de9b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -49,6 +49,7 @@ DietPi-Automation | Resolved an issue where AUTO_SETUP_TIMEZONE was not being ap DietPi-Automation | dietpi.txt: CONFIG_NTP_MIRROR will now be applied to systemd-timesyncd configuration: https://github.com/Fourdee/DietPi/issues/1379 DietPi-Config | Resolved an issue with WiFi Country code, failing to set on some devices: https://github.com/Fourdee/DietPi/issues/838 DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi drop during software installs/updates etc: https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480 +DietPi-Software | General: MySQL using software titles now have their own database user, instead of accessing as "root": https://github.com/Fourdee/DietPi/issues/1397#issuecomment-359655198 DietPi-Software | qBittorrent: Resolved an issue with inability to log into web interface: https://github.com/Fourdee/DietPi/issues/1366 DietPi-Software | Resolved an issue where our custom LD_LIBRARY_PATH would cause APT failures. LD_LIBRARY_PATH has now been reverted, apologies if this effected your system: https://github.com/Fourdee/DietPi/issues/1329 DietPi-Software | Resolved an issue where APT installations would fail if services were masked. All known DietPi software services, will be enabled/unmasked, before installation: https://github.com/Fourdee/DietPi/issues/1320 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 765ee23661..e3487c6251 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2147,7 +2147,6 @@ _EOF_ aSOFTWARE_REQUIRES_GIT[$index_current]=1 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$index_current]=1 aSOFTWARE_REQUIRES_SQLITE[$index_current]=1 - aSOFTWARE_REQUIRES_MYSQL[$index_current]=1 aSOFTWARE_REQUIRES_FFMPEG[$index_current]=1 aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&start=20#p70' @@ -7451,12 +7450,11 @@ _EOF_ # Install needed libraries G_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 (( $G_DISTRO == 3 )); then + if (( $G_DISTRO < 4 )); then G_AGI libmysqlclient-dev - fi - if (( $G_DISTRO >= 4 )); then + else G_AGI libmariadbclient-dev @@ -8143,10 +8141,10 @@ _EOF_ if (( $G_DISTRO < 4 )); then G_RUN_CMD systemctl start mysql - mysql -uroot -e "install plugin unix_socket soname 'auth_socket';" &> /dev/null - mysql -uroot -e "grant all privileges on *.* to 'root'@'localhost' identified via unix_socket with grant option;flush privileges" + mysql -e "install plugin unix_socket soname 'auth_socket';" &> /dev/null + mysql -e "grant all privileges on *.* to 'root'@'localhost' identified via unix_socket with grant option;flush privileges" # Drop unnecessary root user children. - mysql -uroot -e "drop user 'root'@'dietpi';drop user 'root'@'127.0.0.1';drop user 'root'@'::1'" &> /dev/null + mysql -e "drop user 'root'@'dietpi';drop user 'root'@'127.0.0.1';drop user 'root'@'::1'" &> /dev/null fi @@ -8180,7 +8178,7 @@ _EOF_ # Due to MariaDB unix_socket authentication, "root" cannot be used to login the web ui. # Thus default "phpmyadmin" user need to be used, who on Jessie does not have all privileges: # http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=54#p54 - mysql -uroot -e "grant all privileges on *.* to phpmyadmin@localhost with grant option" + mysql -e "grant all privileges on *.* to phpmyadmin@localhost with grant option" fi @@ -8352,9 +8350,9 @@ _EOF_ [ -n "$username" ] || username='admin' # For MariaDB, temporary database admin user needs to be created, as 'root' uses unix_socket login, which cannot be accessed by sudo -u www-data. - mysql -uroot -e "grant all privileges on *.* to 'tmp_root'@'localhost' identified by '$GLOBAL_PW' with grant option" + mysql -e "grant all privileges on *.* to 'tmp_root'@'localhost' identified by '$GLOBAL_PW' with grant option" grep -q "'installed' => true," $config_php 2>/dev/null || occ maintenance:install --no-interaction --database "mysql" --database-name "owncloud" --database-user "tmp_root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$datadir" - mysql -uroot -e "drop user 'tmp_root'@'localhost'" + mysql -e "drop user 'tmp_root'@'localhost'" fi @@ -8447,7 +8445,7 @@ _EOF_ a2enmod rewrite headers env dir mime 1> /dev/null local nextcloud_conf='/etc/apache2/sites-available/nextcloud.conf' if [ -f $nextcloud_conf ]; then - + G_DIETPI-NOTIFY 2 'Existing Nextcloud configuration found, will save the new one for review and comparison to: /etc/apache2/sites-available/nextcloud.conf.dietpi-new' nextcloud_conf='/etc/apache2/sites-available/nextcloud.conf.dietpi-new' @@ -8545,9 +8543,9 @@ _EOF_ [ -n "$username" ] || username='admin' # For MariaDB, temporary database admin user needs to be created, as 'root' uses unix_socket login, which cannot be accessed by sudo -u www-data. - mysql -uroot -e "grant all privileges on *.* to 'tmp_root'@'localhost' identified by '$GLOBAL_PW' with grant option" + mysql -e "grant all privileges on *.* to 'tmp_root'@'localhost' identified by '$GLOBAL_PW' with grant option" grep -q "'installed' => true," $config_php 2>/dev/null || ncc maintenance:install --no-interaction --database "mysql" --database-name "nextcloud" --database-user "tmp_root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$datadir" - mysql -uroot -e "drop user 'tmp_root'@'localhost'" + mysql -e "drop user 'tmp_root'@'localhost'" fi @@ -8720,7 +8718,7 @@ _EOF_ Banner_Configuration - /DietPi/dietpi/func/create_mysql_db phpbb3 root "$GLOBAL_PW" + /DietPi/dietpi/func/create_mysql_db phpbb3 phpbb3 "$GLOBAL_PW" fi @@ -9629,7 +9627,7 @@ _EOF_ Banner_Configuration #Create mysql DB - /DietPi/dietpi/func/create_mysql_db wordpress root "$GLOBAL_PW" + /DietPi/dietpi/func/create_mysql_db wordpress wordpress "$GLOBAL_PW" fi @@ -9912,8 +9910,8 @@ _EOF_ unzip -o sql.zip rm sql.zip - /DietPi/dietpi/func/create_mysql_db ampache root "$GLOBAL_PW" - mysql -u root -p"$GLOBAL_PW" ampache < ampache.sql + /DietPi/dietpi/func/create_mysql_db ampache ampache "$GLOBAL_PW" + mysql ampache < ampache.sql rm ampache.sql #Grab config @@ -10294,7 +10292,7 @@ _EOF_ a2enmod rewrite #Create Mysql DB - /DietPi/dietpi/func/create_mysql_db pydio root "$GLOBAL_PW" + /DietPi/dietpi/func/create_mysql_db pydio pydio "$GLOBAL_PW" #Setup Data directory local target_data_dir="$G_FP_DIETPI_USERDATA/pydio_data" @@ -10467,7 +10465,7 @@ _EOF_ cd ~/ # - Mysql DB - /DietPi/dietpi/func/create_mysql_db baikal root "$GLOBAL_PW" + /DietPi/dietpi/func/create_mysql_db baikal baikal "$GLOBAL_PW" fi @@ -10622,7 +10620,7 @@ _EOF_ mkdir -p "$G_FP_DIETPI_USERDATA"/gogs-repo # - sqldb - /DietPi/dietpi/func/create_mysql_db gogs root "$GLOBAL_PW" + /DietPi/dietpi/func/create_mysql_db gogs gogs "$GLOBAL_PW" # - service (couldnt get this to run as a new thread with systemD (&). so bash script ftw. cat << _EOF_ > /etc/gogs/start.sh @@ -11261,12 +11259,12 @@ _EOF_ Banner_Configuration - sed -i "/'mysqli_user'/c \$cfg[\'mysqli_user\'] = \'root\';" /var/www/ompd/include/config.inc.php + sed -i "/'mysqli_user'/c \$cfg[\'mysqli_user\'] = \'ompd\';" /var/www/ompd/include/config.inc.php sed -i "/'mysqli_password'/c \$cfg[\'mysqli_password\'] = \'$GLOBAL_PW\';" /var/www/ompd/include/config.inc.php sed -i "/'media_dir'/c \$cfg[\'media_dir\'] = \'/var/lib/mpd/music/\';" /var/www/ompd/include/config.inc.php sed -i "/'ignore_media_dir_access_error'/c \$cfg[\'ignore_media_dir_access_error\'] = \'true';" /var/www/ompd/include/config.inc.php - /DietPi/dietpi/func/create_mysql_db ompd root "$GLOBAL_PW" + /DietPi/dietpi/func/create_mysql_db ompd ompd "$GLOBAL_PW" fi @@ -11532,14 +11530,14 @@ _EOF_ Download_Test_Media - /DietPi/dietpi/func/create_mysql_db koel root "$GLOBAL_PW" + /DietPi/dietpi/func/create_mysql_db koel koel "$GLOBAL_PW" cd /var/www/koel sed -i '/DB_CONNECTION=/c\DB_CONNECTION=mysql' .env sed -i '/DB_HOST=/c\DB_HOST=127.0.0.1' .env sed -i '/DB_DATABASE=/c\DB_DATABASE=koel' .env - sed -i '/DB_USERNAME=/c\DB_USERNAME=root' .env + sed -i '/DB_USERNAME=/c\DB_USERNAME=koel' .env sed -i "/DB_PASSWORD=/c\DB_PASSWORD=$GLOBAL_PW" .env sed -i '/ADMIN_EMAIL=/c\ADMIN_EMAIL=dietpi@dietpi.com' .env @@ -11942,7 +11940,7 @@ _EOF_ chown -R dietpi:dietpi /var/log/gitea # - sqldb - /DietPi/dietpi/func/create_mysql_db gitea root "$GLOBAL_PW" + /DietPi/dietpi/func/create_mysql_db gitea gitea "$GLOBAL_PW" fi @@ -11954,8 +11952,8 @@ _EOF_ Banner_Configuration - /DietPi/dietpi/func/create_mysql_db allo_db root "$GLOBAL_PW" - mysql -u root -pdietpi allo_db < /var/www/allo_db.sql + /DietPi/dietpi/func/create_mysql_db allo_db allo_db "$GLOBAL_PW" + mysql allo_db < /var/www/allo_db.sql rm /var/www/allo_db.sql # - Redirect to web interface by default: @@ -12514,10 +12512,10 @@ _EOF_ [ -n "$datadir" ] || datadir="$G_FP_DIETPI_USERDATA/owncloud_data" # Drop MariaDB user and database systemctl start mysql - mysql -uroot -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")@$(grep -m1 "'dbhost'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" - mysql -uroot -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" 2> /dev/null - [ -d "$G_FP_DIETPI_USERDATA"/mysql/owncloud ] && mysqldump -uroot --lock-tables owncloud > "$datadir"/dietpi-owncloud-database-backup.sql - mysqladmin -uroot drop owncloud -f + mysql -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")@$(grep -m1 "'dbhost'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" + mysql -e "drop user $(grep -m1 "'dbuser'" /var/www/owncloud/config/config.php | awk '{print $3}' | sed "s/,//")" 2> /dev/null + [ -d "$G_FP_DIETPI_USERDATA"/mysql/owncloud ] && mysqldump owncloud > "$datadir"/dietpi-owncloud-database-backup.sql + mysqladmin drop owncloud -f # Backup ownCloud installation folder cp -a /var/www/owncloud/. "$datadir"/dietpi-owncloud-installation-backup # Remove ownCloud installation folder @@ -12538,10 +12536,10 @@ _EOF_ [ -n "$datadir" ] || datadir="$G_FP_DIETPI_USERDATA/nextcloud_data" # Drop MariaDB user and database systemctl start mysql - mysql -uroot -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/,//")" - mysql -uroot -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" 2> /dev/null - [ -d "$G_FP_DIETPI_USERDATA"/mysql/nextcloud ] && mysqldump -uroot --lock-tables nextcloud > "$datadir"/dietpi-nextcloud-database-backup.sql - mysqladmin -uroot drop nextcloud -f + mysql -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/,//")" + mysql -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" 2> /dev/null + [ -d "$G_FP_DIETPI_USERDATA"/mysql/nextcloud ] && mysqldump nextcloud > "$datadir"/dietpi-nextcloud-database-backup.sql + mysqladmin drop nextcloud -f # Backup Nextcloud installation folder cp -a /var/www/nextcloud/. "$datadir"/dietpi-nextcloud-installation-backup # Remove Nextcloud installation folder @@ -12597,7 +12595,8 @@ _EOF_ elif (( $index == 54 )); then systemctl start mysql - mysqladmin -u root -p"$GLOBAL_PW" drop phpbb3 -f + mysqladmin drop phpbb3 -f + mysql -e "drop user phpbb3@localhost" rm -R /var/www/phpBB3 elif (( $index == 115 )); then @@ -12654,7 +12653,8 @@ _EOF_ rm -R /var/www/ompd systemctl start mysql - mysqladmin -uroot drop ompd -f + mysqladmin drop ompd -f + mysql -e "drop user ompd@localhost" elif (( $index == 130 )); then @@ -12752,7 +12752,8 @@ _EOF_ elif (( $index == 143 )); then systemctl start mysql - mysqladmin -uroot drop koel -f + mysqladmin drop koel -f + mysql -e "drop user koel@localhost" rm -R /var/www/koel @@ -13016,7 +13017,8 @@ _EOF_ #drop database systemctl start mysql - mysqladmin -uroot drop ampache -f + mysqladmin drop ampache -f + mysql -e "drop user ampache@localhost" elif (( $index == 117 )); then @@ -13126,7 +13128,8 @@ _EOF_ #drop database systemctl start mysql - mysqladmin -uroot drop pydio -f + mysqladmin drop pydio -f + mysql -e "drop user pydio@localhost" elif (( $index == 36 )); then @@ -13151,7 +13154,8 @@ _EOF_ #drop database systemctl start mysql - mysqladmin -uroot drop baikal -f + mysqladmin drop baikal -f + mysql -e "drop user baikal@localhost" elif (( $index == 65 )); then @@ -13226,7 +13230,8 @@ _EOF_ rm /var/log/gogs.log systemctl start mysql - mysqladmin -uroot drop gogs -f + mysqladmin drop gogs -f + mysql -e "drop user gogs@localhost" elif (( $index == 46 )); then @@ -13321,8 +13326,8 @@ _EOF_ # drop/delete database systemctl start mysql - mysqladmin -uroot drop gitea -f - systemctl stop mysql + mysqladmin drop gitea -f + mysql -e "drop user gitea@localhost" elif (( $index == 166 )); then @@ -13412,8 +13417,8 @@ _EOF_ rm -R /var/www/allo systemctl start mysql - mysqladmin -uroot drop allo_db -f - systemctl stop mysql + mysqladmin drop allo_db -f + mysql -e "drop user allo_db@localhost" #---------------------------------------------------------------------- From 026b78e34b03f0f32f6f23c074f30136e8da349a Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 24 Jan 2018 15:13:55 +0000 Subject: [PATCH 366/390] v6.0 + ampache conf update: https://github.com/Fourdee/DietPi/issues/1420 --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index e3487c6251..73c0a25be6 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9915,7 +9915,7 @@ _EOF_ rm ampache.sql #Grab config - wget http://dietpi.com/downloads/conf/ampache.cfg.php_3.8.2-v113 -O /var/www/ampache/config/ampache.cfg.php + wget http://dietpi.com/downloads/conf/ampache.cfg.php_3.8.2-v6.0 -O /var/www/ampache/config/ampache.cfg.php fi From f5cbe6f6a0043e03f71f1f68b712d7e6572e19d8 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 24 Jan 2018 15:19:38 +0000 Subject: [PATCH 367/390] v6.0 + Minor, clean during G_AGUP --- dietpi/func/dietpi-globals | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 04c13e74d2..4f2ed700e5 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -956,7 +956,8 @@ $print_logfile_info G_DIETPI-NOTIFY 2 "APT update, please wait..." - DEBIAN_FRONTEND=noninteractive apt-get update 2>&1 | tee "$G_FP_LOG_APT" + DEBIAN_FRONTEND=noninteractive apt-get clean 2>&1 | tee "$G_FP_LOG_APT" + DEBIAN_FRONTEND=noninteractive apt-get update 2>&1 | tee -a "$G_FP_LOG_APT" G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]} G_ERROR_HANDLER From b5d545195858444061517ba4fa7e3afc5498dbf9 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 24 Jan 2018 15:59:21 +0000 Subject: [PATCH 368/390] v6.0 + DietPi-Software | Ampache: MySQL DB and configs have been updated (adds correct userdata folder for music by default): https://github.com/Fourdee/DietPi/issues/1420 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e7f9f9de9b..7126b0d2d8 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -41,6 +41,7 @@ DietPi-Software | UrBackup: Installation updated to latest version 2.1.20. For n DietPi-Software | NodeRed: Corrected user which nodered runs under, now runs as its own user, created during install: https://github.com/Fourdee/DietPi/issues/1294#issuecomment-354314318 DietPi-Software | SqueezeBox/LMS (Stretch): Installation resolved: https://github.com/Fourdee/DietPi/issues/1124 DietPi-Software | MySQL: Completely remove MySQL from DietPi in favour of MariaDB: https://github.com/Fourdee/DietPi/issues/1397 +DietPi-Software | Ampache: MySQL DB and configs have been updated (adds correct userdata folder for music by default): https://github.com/Fourdee/DietPi/issues/1420 run_ntpd | Added support for systemd-timesyncd completion/detection: https://github.com/Fourdee/DietPi/issues/1379 Bug Fixes: diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 73c0a25be6..b9bfac88bf 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9906,7 +9906,7 @@ _EOF_ Download_Test_Media #create/insert our pre-made ampache sql db - wget http://dietpi.com/downloads/mysql_databases/ampache_mysql_3.8.2-v113.zip -O sql.zip + wget http://dietpi.com/downloads/mysql_databases/ampache_mysql_3.8.2-v6.0.zip -O sql.zip unzip -o sql.zip rm sql.zip From 87c044a3f63f795167fe13dc41d9f1e0fb8b6ba1 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 24 Jan 2018 16:17:44 +0000 Subject: [PATCH 369/390] v6.0 + Drop phpmyadmin DB+user: https://github.com/Fourdee/DietPi/issues/1420 --- dietpi/dietpi-software | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index b9bfac88bf..f61c9db51d 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9906,7 +9906,7 @@ _EOF_ Download_Test_Media #create/insert our pre-made ampache sql db - wget http://dietpi.com/downloads/mysql_databases/ampache_mysql_3.8.2-v6.0.zip -O sql.zip + G_RUN_CMD wget http://dietpi.com/downloads/mysql_databases/ampache_mysql_3.8.2-v6.0.zip -O sql.zip unzip -o sql.zip rm sql.zip @@ -9915,7 +9915,7 @@ _EOF_ rm ampache.sql #Grab config - wget http://dietpi.com/downloads/conf/ampache.cfg.php_3.8.2-v6.0 -O /var/www/ampache/config/ampache.cfg.php + G_RUN_CMD wget http://dietpi.com/downloads/conf/ampache.cfg.php_3.8.2-v6.0 -O /var/www/ampache/config/ampache.cfg.php fi @@ -12590,6 +12590,9 @@ _EOF_ elif (( $index == 90 )); then + systemctl start mysql + mysqladmin drop phpmyadmin -f + mysql -e "drop user 'phpmyadmin'@'localhost'" G_AGP phpmyadmin elif (( $index == 54 )); then From f38b316a7ad53e24e1f99fd9543d973b4f7b7a30 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 24 Jan 2018 16:46:02 +0000 Subject: [PATCH 370/390] v6.0 + drop wordpress DB+user: https://github.com/Fourdee/DietPi/issues/1420 --- dietpi/dietpi-software | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f61c9db51d..61f98f34b3 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -12980,6 +12980,10 @@ _EOF_ elif (( $index == 55 )); then + systemctl start mysql + mysqladmin drop wordpress -f + mysql -e "drop user wordpress@localhost" + rm -R /var/www/wordpress elif (( $index == 27 || $index == 28 || $index == 120 )); then From 06ec991d99247edeb50c06016e9bc589fc68c71e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 24 Jan 2018 21:01:45 +0100 Subject: [PATCH 371/390] v6.0 + DietPi-Config | Fix reversed IPv6 grub adjustment --- dietpi/dietpi-config | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 821e02121d..1878f8f846 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -3129,8 +3129,12 @@ if (( G_HW_ARCH == 10 )); then # On amd64 images, IPv6 is no kernel module, but can be disabled via grub: https://github.com/Fourdee/DietPi/issues/1343#issuecomment-359652751 - sed -i 's/ipv6.disable=1 //g' /etc/default/grub - update-grub + if (( ! $(grep -ci -m1 'ipv6.disable=1' /etc/default/grub) )); then + + sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT=\"/GRUB_CMDLINE_LINUX_DEFAULT=\"ipv6.disable=1 /g' /etc/default/grub + update-grub + + fi else # On all other images, IPv6 is a kernel module, which can be blacklisted. @@ -3160,12 +3164,8 @@ if (( G_HW_ARCH == 10 )); then - if (( ! $(grep -ci -m1 'ipv6.disable=1' /etc/default/grub) )); then - - sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT=\"/GRUB_CMDLINE_LINUX_DEFAULT=\"ipv6.disable=1 /g' /etc/default/grub - update-grub - - fi + sed -i 's/ipv6.disable=1 //g' /etc/default/grub + update-grub else From 104972c98af0c676af7067f6baa0fc6bfa82b4eb Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 24 Jan 2018 21:36:55 +0100 Subject: [PATCH 372/390] v6.0 + Added missing changes to changelog. --- CHANGELOG.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7126b0d2d8..bdda8bb085 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -17,8 +17,8 @@ General | DietPi RPi kernel, now reverted to stock RPi kernel: https://github.co General | We have completed much needed backbone work for DietPi, which will allow for improved expansion in source code. This includes the use of dietpi-globals. DietPi-Globals | New script which optimizes most used DietPi commands and vars, throughout our scripts. Also exported to bash session, please type 'G_' then press 'TAB' to see a full list of options: https://github.com/Fourdee/DietPi/issues/1311 General | FHS compliance completed. /etc/dietpi has moved to /var/lib/dietpi. RAMlog store has moved to /var/tmp/dietpi: https://github.com/Fourdee/DietPi/issues/1297#issuecomment-352241193 -General | wget: Now set to prefer IPv4 by default (generally faster): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 -General | APT: Now set to force IPv4 by default (generally faster): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 +General | wget: Now set to prefer IPv4 by default (generally faster, can be changed by 'CONFIG_PREFER_IPVERSION' in dietpi.txt): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 +General | APT: Now set to force IPv4 by default (generally faster, can be changed by 'CONFIG_PREFER_IPVERSION' in dietpi.txt): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 General | SparkySBC: CPU gov default changed to Performance, reports of increased stability. General | Swapfile generation is now completed during 1st run of dietpi-software (previously boot stage): https://github.com/Fourdee/DietPi/issues/1270#issue-278797206 General | DietPi-Funtime: Removed from DietPi. Although it looked pretty, it did absolutely nothing (except slow down a program) @@ -36,7 +36,9 @@ DietPi-Software | NAA Daemon: Updated to latest (3.5.2-36). Existing installs wi DietPi-Software | PHP-FPM: Increased from "$CPU_CORES_TOTAL" to "pm.max_children = $(( $CPU_CORES_TOTAL * 3 ))". This should avoid failed forking of PHP-FPM processes/requests : https://github.com/Fourdee/DietPi/issues/1298 DietPi-Software | ownCloud/Nextcloud: Added option to choose data directory via dietpi.txt pre installation: https://github.com/Fourdee/DietPi/issues/1314#issuecomment-352782055 DietPi-Software | ownCloud/Nextcloud: Switch to pretty URLs (without "index.php") on Apache -DietPi-Software | Nextcloud: Resolve OPcache admin panel warnings on Lighttpd +DietPi-Software | ownCloud/Nextcloud: Automated backup restoring on install and creation und uninstall to ownCloud/Nextcloud data directory +DietPi-Software | ownCloud: Switch to non-package/archive installation. This allows usage of preferred web based updater. +DietPi-Software | Nextcloud: Resolved OPcache admin panel warnings now also on Lighttpd DietPi-Software | UrBackup: Installation updated to latest version 2.1.20. For new installations only: https://github.com/Fourdee/DietPi/issues/1335 DietPi-Software | NodeRed: Corrected user which nodered runs under, now runs as its own user, created during install: https://github.com/Fourdee/DietPi/issues/1294#issuecomment-354314318 DietPi-Software | SqueezeBox/LMS (Stretch): Installation resolved: https://github.com/Fourdee/DietPi/issues/1124 @@ -49,6 +51,7 @@ General | Fixed two systemd error messages during shutdown and boot: https://git DietPi-Automation | Resolved an issue where AUTO_SETUP_TIMEZONE was not being applied correctly, thanks @k-plan: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-356310496 DietPi-Automation | dietpi.txt: CONFIG_NTP_MIRROR will now be applied to systemd-timesyncd configuration: https://github.com/Fourdee/DietPi/issues/1379 DietPi-Config | Resolved an issue with WiFi Country code, failing to set on some devices: https://github.com/Fourdee/DietPi/issues/838 +DietPi-Config | Resolved an issue where disabling IPv6 didn't have an effect on AMD64 devices: https://github.com/Fourdee/DietPi/issues/1343#issuecomment-359652751 DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi drop during software installs/updates etc: https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480 DietPi-Software | General: MySQL using software titles now have their own database user, instead of accessing as "root": https://github.com/Fourdee/DietPi/issues/1397#issuecomment-359655198 DietPi-Software | qBittorrent: Resolved an issue with inability to log into web interface: https://github.com/Fourdee/DietPi/issues/1366 From 2dae771722d14554ff49050fb5aafcd8f687e29e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 24 Jan 2018 22:41:25 +0100 Subject: [PATCH 373/390] v6.0 + DietPi-Software | Mask new ntp systemd service on Buster: https://github.com/Fourdee/DietPi/issues/1286 --- PREP_SYSTEM_FOR_DIETPI.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 0738811169..610b035200 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1009,6 +1009,7 @@ _EOF_ systemctl disable systemd-timesyncd rm /etc/init.d/ntp &> /dev/null + (( $G_DISTRO > 4 )) && systemctl mask ntp G_DIETPI-NOTIFY 2 "Configuring regional settings (TZdata):" From 57ee409330267d6bc557f2330d64659b64469944 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 24 Jan 2018 23:14:56 +0100 Subject: [PATCH 374/390] v6.0 + DietPi-Software | Mosquitto: Fix installation on Buster, using default Debian repo package --- dietpi/dietpi-software | 80 +++++++++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 32 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 61f98f34b3..7aebec5573 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4697,51 +4697,59 @@ _EOF_ Banner_Installing - # - ARMv8 - if (( $G_HW_ARCH == 3 )); then + if (( $G_DISTRO > 4 )); then - dpkg --add-architecture armhf - G_AGUP + # On Buster, we can use current APT package from Debian repo + G_AGI mosquitto - fi + else - #Pre-Req - # - libssl1.0.0 no longer available: https://github.com/Fourdee/DietPi/issues/1299 - INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/' + # - ARMv8 + if (( $G_HW_ARCH == 3 )); then - # - ARMv6/7/8 - if (( $G_HW_ARCH >= 1 && $G_HW_ARCH <= 3 )); then + dpkg --add-architecture armhf + G_AGUP - INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_armhf.deb' + fi - # - x86_64 - elif (( $G_HW_ARCH == 10 )); then + #Pre-Req + # - libssl1.0.0 no longer available: https://github.com/Fourdee/DietPi/issues/1299 + INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/' - INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_amd64.deb' + # - ARMv6/7/8 + if (( $G_HW_ARCH >= 1 && $G_HW_ARCH <= 3 )); then - fi + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_armhf.deb' - G_CHECK_URL "$INSTALL_URL_ADDRESS" + # - x86_64 + elif (( $G_HW_ARCH == 10 )); then - wget "$INSTALL_URL_ADDRESS" -O package.deb - dpkg -i package.deb - rm package.deb + INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_amd64.deb' - INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/mosquitto_1.4.14-0mosquitto1_nows1_armhf.deb' - if (( $G_HW_ARCH == 10 )); then + fi + G_CHECK_URL "$INSTALL_URL_ADDRESS" - INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/mosquitto_1.4.14-0mosquitto1_nows1_amd64.deb' + wget "$INSTALL_URL_ADDRESS" -O package.deb + dpkg -i package.deb + rm package.deb - fi - G_CHECK_URL "$INSTALL_URL_ADDRESS" + INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/mosquitto_1.4.14-0mosquitto1_nows1_armhf.deb' + if (( $G_HW_ARCH == 10 )); then - wget "$INSTALL_URL_ADDRESS" -O package.deb + INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/mosquitto_1.4.14-0mosquitto1_nows1_amd64.deb' - #Install deb - # Allow error, so we can install additional required packages automatically - dpkg -i package.deb - G_AGF - rm package.deb + fi + G_CHECK_URL "$INSTALL_URL_ADDRESS" + + wget "$INSTALL_URL_ADDRESS" -O package.deb + + #Install deb + # Allow error, so we can install additional required packages automatically + dpkg -i package.deb + G_AGF + rm package.deb + + fi fi @@ -12635,8 +12643,16 @@ _EOF_ elif (( $index == 123 )); then - #apt-mark auto libssl1.0.0 - G_AGP mosquitto + if (( $G_DISTRO > 4 )); then + + G_AGP mosquitto + + else + + #apt-mark auto libssl1.0.0 + dpkg -P mosquitto + + fi elif (( $index == 124 )); then From 4756f075508c300bd79b8ca407f5a040dfa44881 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 24 Jan 2018 23:36:01 +0100 Subject: [PATCH 375/390] v6.0 + Add G_DIETPI-NOTIFY rework to changelog --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index bdda8bb085..6cc426d3fa 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -17,6 +17,7 @@ General | DietPi RPi kernel, now reverted to stock RPi kernel: https://github.co General | We have completed much needed backbone work for DietPi, which will allow for improved expansion in source code. This includes the use of dietpi-globals. DietPi-Globals | New script which optimizes most used DietPi commands and vars, throughout our scripts. Also exported to bash session, please type 'G_' then press 'TAB' to see a full list of options: https://github.com/Fourdee/DietPi/issues/1311 General | FHS compliance completed. /etc/dietpi has moved to /var/lib/dietpi. RAMlog store has moved to /var/tmp/dietpi: https://github.com/Fourdee/DietPi/issues/1297#issuecomment-352241193 +General | We have refreshed our terminal messages look & feel, oriented on RPi boot messages, and with process animation: https://github.com/Fourdee/DietPi/pull/1377 General | wget: Now set to prefer IPv4 by default (generally faster, can be changed by 'CONFIG_PREFER_IPVERSION' in dietpi.txt): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 General | APT: Now set to force IPv4 by default (generally faster, can be changed by 'CONFIG_PREFER_IPVERSION' in dietpi.txt): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 General | SparkySBC: CPU gov default changed to Performance, reports of increased stability. From 25575cc1373530e29cabb836ff4537046f905030 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 25 Jan 2018 12:21:51 +0000 Subject: [PATCH 376/390] v6.0 + Remove debian-keyring (-dev), to match current PREP change. --- dietpi/patch_file | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index 0fc39e3c85..7ff2a33943 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -105,6 +105,9 @@ # consoleblank disable x86_64 /DietPi/dietpi/func/dietpi-set_core_environment #------------------------------------------------------------------------------- + #Remove -dev keyring + G_AGP debian-keyring + #------------------------------------------------------------------------------- fi From cbdfad1994135d9d159f30252a7d1af1086c52be Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 25 Jan 2018 12:26:25 +0000 Subject: [PATCH 377/390] v6.0 + re-enable IPV6 x86_64: https://github.com/Fourdee/DietPi/pull/1419#issuecomment-360452027 --- dietpi/func/dietpi-set_core_environment | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_core_environment b/dietpi/func/dietpi-set_core_environment index 1f9d98fa17..549b0c8d1d 100644 --- a/dietpi/func/dietpi-set_core_environment +++ b/dietpi/func/dietpi-set_core_environment @@ -341,7 +341,7 @@ _EOF_ # HW_ARCH not set at this stage within DietPi, using PREP_SYSTEM if [ -f /etc/default/grub ]; then - sed -i '/^GRUB_CMDLINE_LINUX_DEFAULT=/c\GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 consoleblank=0 quiet"' /etc/default/grub + sed -i '/^GRUB_CMDLINE_LINUX_DEFAULT=/c\GRUB_CMDLINE_LINUX_DEFAULT="consoleblank=0 quiet"' /etc/default/grub #ipv6.disable=1 # https://github.com/Fourdee/DietPi/pull/1419#issuecomment-360452027 sed -i '/^GRUB_CMDLINE_LINUX=/c\GRUB_CMDLINE_LINUX="net.ifnames=0"' /etc/default/grub sed -i '/^GRUB_TIMEOUT=/c\GRUB_TIMEOUT=0' /etc/default/grub update-grub From 36b59349ae339f4d8082eaac915360facf77df22 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 25 Jan 2018 19:40:38 +0000 Subject: [PATCH 378/390] v6.0 + resolve AUTO_SETUP_INSTALL_SOFTWARE_ID: https://github.com/Fourdee/DietPi/issues/1385#issuecomment-360573369 --- dietpi/dietpi-software | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 7aebec5573..69d5ef6070 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4748,7 +4748,7 @@ _EOF_ dpkg -i package.deb G_AGF rm package.deb - + fi fi @@ -12644,7 +12644,7 @@ _EOF_ elif (( $index == 123 )); then if (( $G_DISTRO > 4 )); then - + G_AGP mosquitto else @@ -13958,11 +13958,11 @@ _EOF_ #Set start install GOSTARTINSTALL=1 - #Find all software entires of AUTO_DietpiSoftware_Install_ID= in dietpi.txt. Then set to state 1 for installation. + #Find all software entires of AUTO_SETUP_INSTALL_SOFTWARE_ID= in dietpi.txt. Then set to state 1 for installation. while read -r line do - local index=$( echo -e "$line" | grep '^AUTO_DietpiSoftware_Install_ID=' | sed 's/[^0-9]*//g' ) + local index=$( echo -e "$line" | grep '^AUTO_SETUP_INSTALL_SOFTWARE_ID=' | sed 's/[^0-9]*//g' ) # - Flag for installation if [[ $index =~ ^-?[0-9]+$ ]]; then From 23622868bc40e0916ea8875fd72862da1d1e6268 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 26 Jan 2018 15:16:52 +0000 Subject: [PATCH 379/390] v6.0 + Allo GUI v5: https://github.com/Fourdee/DietPi/issues/1385 + G_RPI_UPDATE --- CHANGELOG.txt | 6 +++--- dietpi/dietpi-software | 2 +- dietpi/func/dietpi-globals | 26 ++++++++++++++++++++------ 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 6cc426d3fa..cf9c9829aa 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,11 +1,11 @@ v6.0 (previously v160) -(xx/01/18) +(28/01/18) Important Information: All DietPi images have been re-created. Existing installations (v159 or lower), can no longer be updated, or supported. To continue support, users must install the latest v6.0 image. - https://github.com/Fourdee/DietPi/issues/1385 - All images are now Debian Stretch (excluding Odroid's) - - ARMbian based images are now mainline kernel 4.13. + - ARMbian based images are now mainline kernel 4.13+. - Native PC (EFI): is now an ISO, with clonezilla bundled. Simplifies installation via Rufus write: https://github.com/Fourdee/DietPi/issues/1171#issuecomment-336522021 - If you are happy with your existing installation of v159 (or lower), you are not required to install the v6.0 image, however, we cannot continue to provide support for v159 (or lower) installations. @@ -70,7 +70,7 @@ DietPi-Software | OpenJDK: Replaces OracleJDK: https://github.com/Fourdee/DietPi DietPi-Update | dietpi.txt is now checked for missing entries, and, will now be patched during the update: https://github.com/Fourdee/DietPi/issues/1292#issuecomment-350818969 Sparky SBC | Kernel updated, which resolves issues with HQPlayer playback: https://www.computeraudiophile.com/forums/topic/32132-allo-sparky-usbridge/?do=findComment&comment=753100 -Allo Web Interface v4: +Allo Web Interface v5: Sparky SBC: Matrix Audio X-SPDIF 2, native DSD is now added to kernel, many thanks @sudeep: https://github.com/sparkysbc/Linux/pull/3 ----------------------------------------------------------------------------------------------------------- diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 69d5ef6070..b304cafa6e 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6713,7 +6713,7 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/allo_web_interface_v4.7z' + INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/allo_web_interface_v5.7z' G_CHECK_URL "$INSTALL_URL_ADDRESS" wget "$INSTALL_URL_ADDRESS" -O package.7z diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 4f2ed700e5..59e978da19 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1030,11 +1030,7 @@ $print_logfile_info for i in "${string[@]}" do - if (( $(grep -ci -m1 "^$i[[:space:]]" "$fp_temp") )); then - - G_DIETPI-NOTIFY 2 "($i) | Currently installed" - - else + if (( ! $(grep -ci -m1 "^$i[[:space:]]" "$fp_temp") )); then G_DIETPI-NOTIFY 2 "($i) | Not found, flagged for installation" packages_to_install+=" $i" @@ -1051,7 +1047,7 @@ $print_logfile_info else - G_DIETPI-NOTIFY 2 "Pre-req APT packages are currently already installed" + G_DIETPI-NOTIFY 2 "Pre-req APT packages are installed" fi @@ -1063,6 +1059,24 @@ $print_logfile_info } + #----------------------------------------------------------------------------------- + # HW specific + #----------------------------------------------------------------------------------- + #rpi-update + # - Holds APT packages + # - Skips backup + G_RPI_UPDATE(){ + + if (( $G_HW_MODEL < 10 )); then + + G_AG_CHECK_INSTALL_PREREQ rpi-update + G_RUN_CMD SKIP_BACKUP=1 rpi-update + apt-mark hold raspberrypi-bootloader raspberrypi-kernel libraspberrypi-bin + + fi + + } + #----------------------------------------------------------------------------------- #G_DIETPI-NOTIFY 2 'DietPi-Globals loaded\n' #----------------------------------------------------------------------------------- From ac7156e6a86a99cfafe82689f2cf991b33a11009 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 26 Jan 2018 18:10:20 +0000 Subject: [PATCH 380/390] v6.0 + RPi update fix (most likley pipes) ``` Log file contents: -bash: SKIP_BACKUP=1: command not found ``` --- dietpi/func/dietpi-globals | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 59e978da19..80d9465f3d 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1070,7 +1070,8 @@ $print_logfile_info if (( $G_HW_MODEL < 10 )); then G_AG_CHECK_INSTALL_PREREQ rpi-update - G_RUN_CMD SKIP_BACKUP=1 rpi-update + export SKIP_BACKUP=1 + G_RUN_CMD rpi-update apt-mark hold raspberrypi-bootloader raspberrypi-kernel libraspberrypi-bin fi From 01fc58f464a3cbb2ab229cff8efcef84db75c9b7 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 27 Jan 2018 13:55:29 +0000 Subject: [PATCH 381/390] v6.0 + Desktop icons for DietPi fix --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index b304cafa6e..2c91ada67a 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3206,7 +3206,7 @@ _EOF_ wget http://dietpi.com/downloads/conf/desktop/justboom.png -O /var/lib/dietpi/dietpi-software/installed/desktop_icons/justboom.png # - Replace icon dir in .desktop from /etc/dietpi/desktop_icons - sed -i 's#^Icon=/etc/dietpi/desktop_icons#/var/lib/dietpi/dietpi-software/installed/desktop_icons#g' /var/lib/dietpi/dietpi-software/installed/desktop_icons/*.desktop + sed -i 's#^Icon=/etc/dietpi/desktop_icons#/var/lib/dietpi/dietpi-software/installed/desktop_icons#g' /usr/share/applications/*.desktop # - Set execute to prevent "untrusted" prompt in Mate, and possibily other desktops. chmod +x /usr/share/applications/* From 3ef09b0c0fa3cfcd8c2ea3c82cf46f3bdd546479 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 27 Jan 2018 13:57:43 +0000 Subject: [PATCH 382/390] v6.0 + icons continued. --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 2c91ada67a..c0909e1c09 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3206,7 +3206,7 @@ _EOF_ wget http://dietpi.com/downloads/conf/desktop/justboom.png -O /var/lib/dietpi/dietpi-software/installed/desktop_icons/justboom.png # - Replace icon dir in .desktop from /etc/dietpi/desktop_icons - sed -i 's#^Icon=/etc/dietpi/desktop_icons#/var/lib/dietpi/dietpi-software/installed/desktop_icons#g' /usr/share/applications/*.desktop + sed -i 's#^Icon=/etc/dietpi/desktop_icons#Icon=/var/lib/dietpi/dietpi-software/installed/desktop_icons#g' /usr/share/applications/*.desktop # - Set execute to prevent "untrusted" prompt in Mate, and possibily other desktops. chmod +x /usr/share/applications/* From a142e3820900788d460230f63ada86dc305ffa48 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 27 Jan 2018 15:45:13 +0000 Subject: [PATCH 383/390] v6.0 + Removal of Wifi hotspot Allo GUI (as per v4) --- dietpi/dietpi-software | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index c0909e1c09..96036f509c 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2633,11 +2633,11 @@ _EOF_ aSOFTWARE_INSTALL_STATE[36]=1 # Squeezelite aSOFTWARE_INSTALL_STATE[37]=1 # Shairport Sync - if (( $G_HW_MODEL == 70 )); then + # if (( $G_HW_MODEL == 70 )); then - aSOFTWARE_INSTALL_STATE[60]=1 # WiFi Hotspot + # aSOFTWARE_INSTALL_STATE[60]=1 # WiFi Hotspot - fi + # fi aSOFTWARE_INSTALL_STATE[65]=1 # Netdata aSOFTWARE_INSTALL_STATE[96]=1 # Samba From 59eab280937707750d25561ddf6b9ace3c4e05d2 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 27 Jan 2018 17:32:39 +0000 Subject: [PATCH 384/390] v6.0 + Manually handle G_CHECK_URL retries. --- dietpi/func/dietpi-globals | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 80d9465f3d..5f970ea3f7 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -759,7 +759,7 @@ $print_logfile_info local string="$@" local timeout=10 - local retry=2 + local retry_max=5 local error_connection_failed=0 G_ERROR_HANDLER_EXITCODE=0 @@ -806,15 +806,28 @@ $print_logfile_info fi - G_DIETPI-NOTIFY -2 "Testing connection to $string for max $(($timeout * $retry)) seconds" + for ((i=1; i<=$retry_max; i++)) + do - wget --spider --timeout=$timeout --tries=$retry "$string" &> /tmp/G_CHECK_URL - G_ERROR_HANDLER_EXITCODE=$? - if (( $G_ERROR_HANDLER_EXITCODE != 0 )); then + G_DIETPI-NOTIFY -2 "($i/$retry_max) Testing connection to $string, please wait..." - error_connection_failed=1 + wget --spider --timeout=$timeout --tries=1 "$string" &> /tmp/G_CHECK_URL + G_ERROR_HANDLER_EXITCODE=$? + # Valid + if (( $G_ERROR_HANDLER_EXITCODE == 0 )); then - fi + break + + # Retry + else + + sleep 2 + error_connection_failed=1 + G_DIETPI-NOTIFY -2 "Failed connection attempt ($i/$retry_max), retrying..." + + fi + + done #--no-check-certificate #https://github.com/Fourdee/DietPi/issues/352#issuecomment-221013166 From 7a7d3da6296269b4787b5b6743767dca651cc145 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 28 Jan 2018 14:29:29 +0000 Subject: [PATCH 385/390] v6.0 + Use G_AGDUG for kernel/firmware updates,for all other devices without this feature previously. --- dietpi/dietpi-config | 51 ++++++++++++++------------------------------ 1 file changed, 16 insertions(+), 35 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 1878f8f846..009b982849 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1309,61 +1309,42 @@ #RPI if (( $G_HW_MODEL < 10 )); then - WHIP_QUESTION=" Would you like to update the firmware on your Pi? \n - This will run rpi-update" - whiptail --title "$WHIP_TITLE" --yesno "$WHIP_QUESTION" --yes-button "Ok" --no-button "Back" --defaultno --backtitle "$WHIP_BACKTITLE" 12 60 + WHIP_QUESTION="Would you like to update the firmware/kernel for $G_HW_MODEL_DESCRIPTION?\n - This will run G_RPI_UPDATE" + whiptail --title "$WHIP_TITLE" --yesno "$WHIP_QUESTION" --yes-button "Ok" --no-button "Back" --defaultno --backtitle "$WHIP_BACKTITLE" 14 70 CHOICE=$? if (( $CHOICE == 0 )); then - G_AG_CHECK_INSTALL_PREREQ rpi-update - if (( $? != 0 )); then - - exit 1 - - fi - - rpi-update + G_RPI_UPDATE REBOOT_REQUIRED=1 fi - #Odroid - elif (( $G_HW_MODEL >= 10 )) && (( $G_HW_MODEL < 20 )); then + #PineA64 + elif (( $G_HW_MODEL == 40 )); then - WHIP_QUESTION=" Would you like to update the firmware on your $G_HW_MODEL_DESCRIPTION? \n - This will run apt-get dist-upgrade\n\nNB: When asked if you wish to overwrite the current kernel, press Tab and then enter (to confirm)." - whiptail --title "$WHIP_TITLE" --yesno "$WHIP_QUESTION" --yes-button "Ok" --no-button "Back" --defaultno --backtitle "$WHIP_BACKTITLE" 14 60 + WHIP_QUESTION="Would you like to update the firmware/kernel for $G_HW_MODEL_DESCRIPTION?\n - This will run longsleep's update scripts to update the U-Boot and kernel." + whiptail --title "$WHIP_TITLE" --yesno "$WHIP_QUESTION" --yes-button "Ok" --no-button "Back" --defaultno --backtitle "$WHIP_BACKTITLE" 14 70 CHOICE=$? if (( $CHOICE == 0 )); then - G_AGDUG + /usr/local/sbin/pine64_update_uboot.sh + /usr/local/sbin/pine64_update_kernel.sh fi - #OrangePi - elif (( $G_HW_MODEL >= 30 )) && (( $G_HW_MODEL < 40 )); then + #G_AGDUG based (not all devices support this) + else - WHIP_QUESTION=" Would you like to update the firmware on your $G_HW_MODEL_DESCRIPTION? \n - This will run apt-get dist-upgrade\n\nNB: When asked if you wish to overwrite the current kernel, press Tab and then enter (to confirm)." - whiptail --title "$WHIP_TITLE" --yesno "$WHIP_QUESTION" --yes-button "Ok" --no-button "Back" --defaultno --backtitle "$WHIP_BACKTITLE" 14 60 + WHIP_QUESTION="Would you like to update the firmware/kernel for $G_HW_MODEL_DESCRIPTION?\n - This will run G_AGDUG\n - Most (but not all) devices allow APT based firmware updates\n\nNB: If requested to overwrite the current kernel, press TAB and then ENTER (to confirm)." + whiptail --title "$WHIP_TITLE" --yesno "$WHIP_QUESTION" --yes-button "Ok" --no-button "Back" --defaultno --backtitle "$WHIP_BACKTITLE" 16 70 CHOICE=$? if (( $CHOICE == 0 )); then + G_AGUP G_AGDUG fi - #PineA64 - elif (( $G_HW_MODEL == 40 )); then - WHIP_QUESTION=" Would you like to update the firmware on your $G_HW_MODEL_DESCRIPTION? \n - This will run longsleep's update scripts to update the U-Boot and kernel." - whiptail --title "$WHIP_TITLE" --yesno "$WHIP_QUESTION" --yes-button "Ok" --no-button "Back" --defaultno --backtitle "$WHIP_BACKTITLE" 12 60 - CHOICE=$? - if (( $CHOICE == 0 )); then - /usr/local/sbin/pine64_update_uboot.sh - /usr/local/sbin/pine64_update_kernel.sh - fi - - else - - Info_HW_OptionNotSupported - fi #Return to This Menu @@ -3130,10 +3111,10 @@ # On amd64 images, IPv6 is no kernel module, but can be disabled via grub: https://github.com/Fourdee/DietPi/issues/1343#issuecomment-359652751 if (( ! $(grep -ci -m1 'ipv6.disable=1' /etc/default/grub) )); then - + sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT=\"/GRUB_CMDLINE_LINUX_DEFAULT=\"ipv6.disable=1 /g' /etc/default/grub update-grub - + fi else From 16eb0603fbed83ddd5796ea016916b2fe382371a Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 28 Jan 2018 15:19:23 +0000 Subject: [PATCH 386/390] v6.0 + Order PREP available devices Reduce G_HW_MODEL's + ASUS TB is now 52 + Drop 'A20-OLinuXino-MICRO' && 'Cubieboard 3' (unused). Drop RoseapplePi. Favour and replace with 'Generic device (eg: unknown to DietPi)': https://github.com/Fourdee/DietPi/issues/1285 --- CHANGELOG.txt | 2 +- PREP_SYSTEM_FOR_DIETPI.sh | 30 +++++++++--------- dietpi/dietpi-config | 2 +- dietpi/dietpi-obtain_hw_model | 54 ++++++++++++--------------------- dietpi/dietpi-software | 4 +-- dietpi/func/dietpi-globals | 2 +- dietpi/func/dietpi-set_hardware | 8 ++--- dietpi/patch_file | 10 ++++++ 8 files changed, 53 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index cf9c9829aa..1c88b44422 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -10,7 +10,7 @@ All DietPi images have been re-created. Existing installations (v159 or lower), - If you are happy with your existing installation of v159 (or lower), you are not required to install the v6.0 image, however, we cannot continue to provide support for v159 (or lower) installations. Minor notes: -The XMAS tree has now been taken down, stored away on github for next year. Hope you all had a good one :D +The XMAS tree has now been taken down, stored away on github history for next year. Hope you all had a good one :D Changes / Improvements / Optimizations: General | DietPi RPi kernel, now reverted to stock RPi kernel: https://github.com/Fourdee/DietPi/issues/1378 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 610b035200..7086f1569e 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -272,15 +272,14 @@ _EOF_ WHIP_TITLE='Hardware selection:' WHIP_DESC='Please select the current device this is being installed on:' - WHIP_DEFAULT_ITEM=0 + WHIP_DEFAULT_ITEM=22 WHIP_MENU_ARRAY=( - '110' 'RoseapplePi' - '100' 'Asus Tinker Board' - '90' 'A20-OLinuXino-MICRO' - '80' 'Cubieboard 3' + '52' 'Asus Tinker Board' + '51' 'BananaPi Pro (Lemaker)' + '50' 'BananaPi M2+ (sinovoip)' '71' 'Beagle Bone Black' - '70' 'Sparky SBC' + '22' 'Generic device (unknown to DietPi)' '66' 'NanoPi M1 Plus' '65' 'NanoPi NEO 2' '64' 'NanoPi NEO Air' @@ -288,10 +287,10 @@ _EOF_ '62' 'NanoPi M3/T3' '61' 'NanoPi M2/T2' '60' 'NanoPi Neo' - '51' 'BananaPi Pro (Lemaker)' - '50' 'BananaPi M2+ (sinovoip)' - '43' 'Rock64' - '40' 'Pine A64' + '13' 'Odroid U3' + '12' 'Odroid C2' + '11' 'Odroid XU3/4/HC1' + '10' 'Odroid C1' '38' 'OrangePi PC 2' '37' 'OrangePi Prime' '36' 'OrangePi Win' @@ -301,16 +300,15 @@ _EOF_ '32' 'OrangePi Zero (H2+)' '31' 'OrangePi One' '30' 'OrangePi PC' - '21' 'x86_64 Native PC' - '20' 'x86_64 VMware/VirtualBox' - '13' 'oDroid U3' - '12' 'oDroid C2' - '11' 'oDroid XU3/4/HC1' - '10' 'oDroid C1' + '40' 'Pine A64' '3' 'Raspberry Pi 3' '2' 'Raspberry Pi 2' '1' 'Raspberry Pi 1/Zero (512mb)' '0' 'Raspberry Pi 1 (256mb)' + '43' 'Rock64' + '70' 'Sparky SBC' + '21' 'x86_64 Native PC' + '20' 'x86_64 VMware/VirtualBox' ) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 009b982849..5e54bdc7e8 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -4613,7 +4613,7 @@ Custom : Write = $CUSTOM_WRITE | Read = $CUSTOM_READ\ whiptail_menu_array+=("allo-cheapo-optical" "Allo Cheapo (Optical output)") # - Asus tb - elif (( $G_HW_MODEL == 100 )); then + elif (( $G_HW_MODEL == 52 )); then whiptail_menu_array+=("asus-tb-analogue" "3.5mm analogue") diff --git a/dietpi/dietpi-obtain_hw_model b/dietpi/dietpi-obtain_hw_model index fb872c137b..0ae72f21eb 100644 --- a/dietpi/dietpi-obtain_hw_model +++ b/dietpi/dietpi-obtain_hw_model @@ -16,10 +16,6 @@ # MAX_G_HW_ARCH=10 #This needs to match highest G_HW_ARCH value in dietpi-obtain_hw_model # # - Line1 - - # G_HW_MODEL 110 RoseapplePi - # G_HW_MODEL 100 Asus Tinker Board - # G_HW_MODEL 90 A20-OLinuXino-MICRO - # G_HW_MODEL 80 Cubieboard 3 # G_HW_MODEL 71 Beagle Bone Black # G_HW_MODEL 70 Sparky SBC # G_HW_MODEL 66 NanoPi M1 Plus @@ -29,6 +25,7 @@ # G_HW_MODEL 62 NanoPi M3/T3 # G_HW_MODEL 61 NanoPi M2/T2 # G_HW_MODEL 60 NanoPi Neo + # G_HW_MODEL 52 Asus Tinker Board # G_HW_MODEL 51 BananaPi Pro (Lemaker) # G_HW_MODEL 50 BananaPi M2+ (sinovoip) # G_HW_MODEL 43 Rock64 @@ -42,11 +39,12 @@ # G_HW_MODEL 32 OrangePi Zero (H2+) # G_HW_MODEL 31 OrangePi One # G_HW_MODEL 30 OrangePi PC + # G_HW_MODEL 22 Generic device (eg: unknown to DietPi) # G_HW_MODEL 21 x86_64 native (PC) # G_HW_MODEL 20 VM x64 (VMware VirtualBox) # G_HW_MODEL 13 oDroid U3 # G_HW_MODEL 12 oDroid C2 - # G_HW_MODEL 11 oDroid XU3/4 + # G_HW_MODEL 11 oDroid XU3/XU4/HC1 # G_HW_MODEL 10 oDroid C1 # G_HW_MODEL 3 Raspberry Pi 3 # G_HW_MODEL 2 Raspberry Pi 2 @@ -378,31 +376,8 @@ G_HW_MODEL=$(sed -n 1p "$FP_G_HW_MODEL_INDENTIFIER") - #RoseapplePi - if (( $G_HW_MODEL == 110 )); then - - G_HW_MODEL_DESCRIPTION='RoseapplePi' - IMAGE_ADDITIONAL_CREDITS='ARMbian' - - #Asus Tinker Board - elif (( $G_HW_MODEL == 100 )); then - - G_HW_MODEL_DESCRIPTION='Asus Tinker Board' - - #A20-OLinuXino-MICRO - elif (( $G_HW_MODEL == 90 )); then - - G_HW_MODEL_DESCRIPTION='A20-OLinuXino-MICRO' - IMAGE_ADDITIONAL_CREDITS='ARMbian' - - #Cubieboard 3 - elif (( $G_HW_MODEL == 80 )); then - - G_HW_MODEL_DESCRIPTION='Cubieboard 3' - IMAGE_ADDITIONAL_CREDITS='ARMbian' - #Beagle Bone Black - elif (( $G_HW_MODEL == 71 )); then + if (( $G_HW_MODEL == 71 )); then G_HW_MODEL_DESCRIPTION='BBB' @@ -456,12 +431,10 @@ IMAGE_ADDITIONAL_CREDITS='ARMbian' G_HW_CPUID=1 - #BananaPi M2+ - elif (( $G_HW_MODEL == 50 )); then + #Asus Tinker Board + elif (( $G_HW_MODEL == 52 )); then - G_HW_MODEL_DESCRIPTION='BananaPi M2+' - IMAGE_ADDITIONAL_CREDITS='ARMbian' - G_HW_CPUID=1 + G_HW_MODEL_DESCRIPTION='Asus Tinker Board' #BananaPi Pro elif (( $G_HW_MODEL == 51 )); then @@ -469,6 +442,13 @@ G_HW_MODEL_DESCRIPTION='BananaPi Pro' IMAGE_ADDITIONAL_CREDITS='ARMbian' + #BananaPi M2+ + elif (( $G_HW_MODEL == 50 )); then + + G_HW_MODEL_DESCRIPTION='BananaPi M2+' + IMAGE_ADDITIONAL_CREDITS='ARMbian' + G_HW_CPUID=1 + #Rock64 elif (( $G_HW_MODEL == 43 )); then @@ -543,6 +523,12 @@ IMAGE_ADDITIONAL_CREDITS='ARMbian' G_HW_CPUID=1 + #Generic device (eg: unknown to DietPi) + elif (( $G_HW_MODEL == 22 )); then + + G_HW_MODEL_DESCRIPTION='Generic Device' + IMAGE_ADDITIONAL_CREDITS='You!' + #x86_64 native PC elif (( $G_HW_MODEL == 21 )); then diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 96036f509c..ce3b736036 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -309,7 +309,7 @@ _EOF_ aSOFTWARE_REQUIRES_NODEJS=0 # - Available for - MAX_G_HW_MODEL=110 #This needs to match highest G_HW_MODEL value in dietpi-obtain_hw_model + MAX_G_HW_MODEL=71 #This needs to match highest G_HW_MODEL value in dietpi-obtain_hw_model MAX_G_HW_ARCH=10 #This needs to match highest G_HW_ARCH value in dietpi-obtain_hw_model # 2D array (well, bash style) declare -A aSOFTWARE_AVAIL_G_HW_MODEL @@ -7018,7 +7018,7 @@ EndSection _EOF_ #Asus TB - # elif (( $G_HW_MODEL == 100 )); then + # elif (( $G_HW_MODEL == 52 )); then # cat << _EOF_ > /etc/X11/xorg.conf # Section "Device" diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 5f970ea3f7..80a87a632c 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -675,7 +675,7 @@ $print_logfile_info if [ -f "${afp_temperature[$i]}" ]; then # Sparky/asus, special case: - if (( $G_HW_MODEL == 70 || $G_HW_MODEL == 100 || $G_HW_MODEL == 110 )); then + if (( $G_HW_MODEL == 70 || $G_HW_MODEL == 52 )); then cpu_temp_current=$(cat /sys/class/thermal/thermal_zone1/temp) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index b0e4aace30..b1dd66c062 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1025,7 +1025,7 @@ _EOF_ # + RPi 3 (apply to all, as pi-bluetooth package is default installed on all RPi's now) # + Asus TB - if (( $G_HW_MODEL < 10 || $G_HW_MODEL == 100 )); then + if (( $G_HW_MODEL < 10 || $G_HW_MODEL == 52 )); then systemctl stop hciuart systemctl disable hciuart @@ -1083,7 +1083,7 @@ _EOF_ G_RUN_CMD systemctl start bluetooth # + RPi / Asus TB - if (( $G_HW_MODEL < 10 || $G_HW_MODEL == 100 )); then + if (( $G_HW_MODEL < 10 || $G_HW_MODEL == 52 )); then systemctl enable hciuart G_RUN_CMD systemctl start hciuart @@ -1173,7 +1173,7 @@ _EOF_ aWIFI_MODULES+=("8189es") # + Pine A64 / Asus tinker board (onboard) - elif (( $G_HW_MODEL == 40 || $G_HW_MODEL == 100 )); then + elif (( $G_HW_MODEL == 40 || $G_HW_MODEL == 52 )); then aWIFI_MODULES+=("8723bs") @@ -1580,7 +1580,7 @@ _EOF_ Soundcard_Reset_SparkySBC #ASUS - elif (( $G_HW_MODEL == 100 )); then + elif (( $G_HW_MODEL == 52 )); then Soundcard_Reset_Asus diff --git a/dietpi/patch_file b/dietpi/patch_file index 7ff2a33943..9a210cd6db 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -77,6 +77,16 @@ #Incremental patch system: if (( $SUBVERSION_CURRENT == -1 )); then + #------------------------------------------------------------------------------- + #Asus TB G_HW_MODEL change + if [ -f /etc/.dietpi_hw_model_identifier ] && + (( $(sed -n 1p /etc/.dietpi_hw_model_identifier) == 100 )); then + + echo 52 > /etc/.dietpi_hw_model_identifier + /DietPi/dietpi/dietpi-obtain_hw_model + . /DietPi/dietpi/func/dietpi-globals + + fi #------------------------------------------------------------------------------- #bash.bashrc removal of any outstanding dietpi entries (moved to globals). Just incase I missed any manually during PREP... sed -i '/#DietPi_Entries/Q' /etc/bash.bashrc From 44aef80d11f2b3b1b385c1cd1acf81bd73e172a0 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 28 Jan 2018 15:20:42 +0000 Subject: [PATCH 387/390] v6.0 + Minor text desc. --- PREP_SYSTEM_FOR_DIETPI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 7086f1569e..86df7ea8a8 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -271,7 +271,7 @@ _EOF_ #------------------------------------------------------------------------------------------------ WHIP_TITLE='Hardware selection:' - WHIP_DESC='Please select the current device this is being installed on:' + WHIP_DESC='Please select the current device this is being installed on:\n - NB: Select "Generic device" if not listed.' WHIP_DEFAULT_ITEM=22 WHIP_MENU_ARRAY=( From deb9af5ae0949d937928614c80b0d08150b0f350 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 28 Jan 2018 15:21:49 +0000 Subject: [PATCH 388/390] v6.0 + Minor --- dietpi/patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 9a210cd6db..05f5f4ff0a 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -84,7 +84,7 @@ echo 52 > /etc/.dietpi_hw_model_identifier /DietPi/dietpi/dietpi-obtain_hw_model - . /DietPi/dietpi/func/dietpi-globals + export G_HW_MODEL=52 fi #------------------------------------------------------------------------------- From 7d48249675c43c5c5207cba24dbf3174fd2cc67a Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 28 Jan 2018 15:23:31 +0000 Subject: [PATCH 389/390] v6.0 + ;) --- dietpi/patch_file | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 05f5f4ff0a..cd5f996e2f 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -82,9 +82,9 @@ if [ -f /etc/.dietpi_hw_model_identifier ] && (( $(sed -n 1p /etc/.dietpi_hw_model_identifier) == 100 )); then - echo 52 > /etc/.dietpi_hw_model_identifier - /DietPi/dietpi/dietpi-obtain_hw_model export G_HW_MODEL=52 + echo $G_HW_MODEL > /etc/.dietpi_hw_model_identifier + /DietPi/dietpi/dietpi-obtain_hw_model fi #------------------------------------------------------------------------------- From de4f40ce430caa2700b3df7583d4eda16b3a64e1 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 28 Jan 2018 15:44:58 +0000 Subject: [PATCH 390/390] v6.0 + Cat available devices + Default to master GIT_BRANCH if unset https://github.com/Fourdee/DietPi/issues/1285 --- PREP_SYSTEM_FOR_DIETPI.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 86df7ea8a8..a38ac48179 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -8,6 +8,10 @@ # - Active eth0 connection #------------------------------------------------------------------------------------------------ + #Use master branch, if unset + GIT_BRANCH=${GIT_BRANCH:=master} + echo -e "Git Branch: $GIT_BRANCH" + #Ensure we are in users home dir: https://github.com/Fourdee/DietPi/issues/905#issuecomment-298223705 cd "$HOME" @@ -187,7 +191,8 @@ _EOF_ WHIP_OPTION=$(whiptail --title "$WHIP_TITLE" --menu "$WHIP_DESC" --default-item "$WHIP_DEFAULT_ITEM" --backtitle "$WHIP_BACKTITLE" 24 85 12 "${WHIP_MENU_ARRAY[@]}" 3>&1 1>&2 2>&3) WHIP_CHOICE=$? - if (( $WHIP_CHOICE == 0 )); then + if (( $WHIP_CHOICE == 0 )) && + [ -n "$WHIP_OPTION" ]; then WHIP_RETURN_VALUE=$WHIP_OPTION @@ -275,11 +280,13 @@ _EOF_ WHIP_DEFAULT_ITEM=22 WHIP_MENU_ARRAY=( + '' '────Other──────────────────────────────' + '22' 'Generic device (unknown to DietPi)' + '' '────SBC────────────────────────────────' '52' 'Asus Tinker Board' '51' 'BananaPi Pro (Lemaker)' '50' 'BananaPi M2+ (sinovoip)' '71' 'Beagle Bone Black' - '22' 'Generic device (unknown to DietPi)' '66' 'NanoPi M1 Plus' '65' 'NanoPi NEO 2' '64' 'NanoPi NEO Air' @@ -307,6 +314,7 @@ _EOF_ '0' 'Raspberry Pi 1 (256mb)' '43' 'Rock64' '70' 'Sparky SBC' + '' '────PC─────────────────────────────────' '21' 'x86_64 Native PC' '20' 'x86_64 VMware/VirtualBox'